diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ca90e84..218cf43f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,16 @@ + +# v2.4.3 (2016-11-28) + + +### Bug Fixes + +* Fix change tracking of collections not working properly in some cases +* Fix OAuth handling is sometimes broken in IE 11 when used via iframe + +### Features + +* Add `eq` and `ne` as new aliases for `equal` and `notEqual` + # v2.4.2 (2016-11-9) diff --git a/dist/baqend-streaming.js b/dist/baqend-streaming.js new file mode 100644 index 00000000..ddc2ee7c --- /dev/null +++ b/dist/baqend-streaming.js @@ -0,0 +1,17993 @@ +/*! +* Baqend JavaScript SDK 2.4.3 +* http://baqend.com +* +* Copyright (c) 2015 Baqend GmbH +* +* Includes: +* babel-helpers - https://babeljs.io/docs/plugins/external-helpers/ +* Copyright (c) 2014-2016 Sebastian McKenzie +* +* core.js - https://github.com/zloirock/core-js +* Copyright (c) 2014-2016 Denis Pushkarev +* +* node-uuid - http://github.com/broofa/node-uuid +* Copyright (c) 2010-2012 Robert Kieffer +* +* validator - http://github.com/chriso/validator.js +* Copyright (c) 2015 Chris O'Hara +* +* Released under the MIT license +* +* Date: Mon, 28 Nov 2016 19:17:54 GMT +*/ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.DB = f()}})(function(){var define,module,exports;var babelHelpers = {}; +babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + +babelHelpers.classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +babelHelpers.createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + +babelHelpers.defaults = function (obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + + return obj; +}; + +babelHelpers.inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : babelHelpers.defaults(subClass, superClass); +}; + +babelHelpers.possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + +return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;otrue If public access is allowed + */ + + + Acl.prototype.isPublicReadAllowed = function isPublicReadAllowed() { + return this.read.isPublicAllowed(); + }; + + /** + * Sets whenever all users and roles should have the permission to read the object. + * Note: All other allow read rules will be removed. + */ + + + Acl.prototype.setPublicReadAllowed = function setPublicReadAllowed() { + return this.read.setPublicAllowed(); + }; + + /** + * Checks whenever the user or role is explicit allowed to read the object. + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {boolean} true if read access is explicitly allowed for the given user or role + */ + + + Acl.prototype.isReadAllowed = function isReadAllowed(userOrRole) { + return this.read.isAllowed(userOrRole); + }; + + /** + * Checks whenever the user or role is explicit denied to read the object + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {boolean} true if read access is explicitly denied for the given user or role + */ + + + Acl.prototype.isReadDenied = function isReadDenied(userOrRole) { + return this.read.isDenied(userOrRole); + }; + + /** + * Allows the given user or rule to read the object + * @param {...(model.User|model.Role|string)} userOrRole The user or role to allow + * @return {Acl} this acl object + */ + + + Acl.prototype.allowReadAccess = function allowReadAccess(userOrRole) { + Permission.prototype.allowAccess.apply(this.read, arguments); + return this; + }; + + /** + * Denies the given user or rule to read the object + * @param {...(model.User|model.Role|string)} userOrRole The user or role to deny + * @return {Acl} this acl object + */ + + + Acl.prototype.denyReadAccess = function denyReadAccess(userOrRole) { + Permission.prototype.denyAccess.apply(this.read, arguments); + return this; + }; + + /** + * Deletes any read allow/deny rule for the given user or role + * @param {...(model.User|model.Role|string)} userOrRole The user or role + * @return {Acl} this acl object + */ + + + Acl.prototype.deleteReadAccess = function deleteReadAccess(userOrRole) { + Permission.prototype.deleteAccess.apply(this.read, arguments); + return this; + }; + + /** + * Gets whenever all users and roles have the permission to write the object + * @return {boolean} true If public access is allowed + */ + + + Acl.prototype.isPublicWriteAllowed = function isPublicWriteAllowed() { + return this.write.isPublicAllowed(); + }; + + /** + * Sets whenever all users and roles should have the permission to write the object. + * Note: All other allow write rules will be removed. + */ + + + Acl.prototype.setPublicWriteAllowed = function setPublicWriteAllowed() { + return this.write.setPublicAllowed(); + }; + + /** + * Checks whenever the user or role is explicit allowed to write the object. + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {boolean} true if write access is explicitly allowed for the given user or role + */ + + + Acl.prototype.isWriteAllowed = function isWriteAllowed(userOrRole) { + return this.write.isAllowed(userOrRole); + }; + + /** + * Checks whenever the user or role is explicit denied to write the object + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {boolean} true if write access is explicitly denied for the given user or role + */ + + + Acl.prototype.isWriteDenied = function isWriteDenied(userOrRole) { + return this.write.isDenied(userOrRole); + }; + + /** + * Allows the given user or rule to write the object + * @param {...(model.User|model.Role|string)} userOrRole The user or role to allow + * @return {Acl} this acl object + */ + + + Acl.prototype.allowWriteAccess = function allowWriteAccess(userOrRole) { + Permission.prototype.allowAccess.apply(this.write, arguments); + return this; + }; + + /** + * Denies the given user or rule to write the object + * @param {...(model.User|model.Role|string)} userOrRole The user or role to deny + * @return {Acl} this acl object + */ + + + Acl.prototype.denyWriteAccess = function denyWriteAccess(userOrRole) { + Permission.prototype.denyAccess.apply(this.write, arguments); + return this; + }; + + /** + * Deletes any write allow/deny rule for the given user or role + * @param {...(model.User|model.Role|string)} userOrRole The user or role + * @return {Acl} this acl object + */ + + + Acl.prototype.deleteWriteAccess = function deleteWriteAccess(userOrRole) { + Permission.prototype.deleteAccess.apply(this.write, arguments); + return this; + }; + + /** + * A Json representation of the set of rules + * @return {json} + */ + + + Acl.prototype.toJSON = function toJSON() { + return { + read: this.read, + write: this.write + }; + }; + + /** + * Sets the acl rules form json + * @param {json} json The json encoded acls + */ + + + Acl.prototype.fromJSON = function fromJSON(json) { + this.read.fromJSON(json.read || {}); + this.write.fromJSON(json.write || {}); + }; + + return Acl; +}(); + +module.exports = Acl; + +},{"65":65}],2:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var error = _dereq_(34); +var binding = _dereq_(20); +var util = _dereq_(70); +var query = _dereq_(59); + +var UserFactory = _dereq_(19); +var EntityTransaction = _dereq_(4); +var Metadata = _dereq_(63); +var Message = _dereq_(25); +var BloomFilter = _dereq_(21); +var StatusCode = Message.StatusCode; + +/** + * @alias EntityManager + * @extends util.Lockable + */ + +var EntityManager = function (_util$Lockable) { + babelHelpers.inherits(EntityManager, _util$Lockable); + babelHelpers.createClass(EntityManager, [{ + key: 'isOpen', + + + /** + * Determine whether the entity manager is open. + * true until the entity manager has been closed + * @type boolean + */ + get: function get() { + return !!this._connector; + } + + /** + * The authentication token if the user is logged in currently + * @type String + */ + + }, { + key: 'token', + get: function get() { + return this.tokenStorage.token; + }, + + + /** + * The authentication token if the user is logged in currently + * @param {String} value + */ + set: function set(value) { + this.tokenStorage.update(value); + } + + /** + * @param {EntityManagerFactory} entityManagerFactory The factory which of this entityManager instance + */ + + }, { + key: 'isCachingDisabled', + get: function get() { + return !this.bloomFilter; + } + }]); + + function EntityManager(entityManagerFactory) { + babelHelpers.classCallCheck(this, EntityManager); + + /** + * Log messages can created by calling log directly as function, with a specific log level or with the helper + * methods, which a members of the log method. + * + * Logs will be filtered by the client logger and the before they persisted. The default log level is + * 'info' therefore all log messages below the given message aren't persisted. + * + * Examples: + *
+     // default log level ist info
+     db.log('test message %s', 'my string');
+     // info: test message my string
+      // pass a explicit log level as the first argument, one of ('trace', 'debug', 'info', 'warn', 'error')
+     db.log('warn', 'test message %d', 123);
+     // warn: test message 123
+      // debug log level will not be persisted by default, since the default logging level is info
+     db.log('debug', 'test message %j', {number: 123}, {});
+     // debug: test message {"number":123}
+     // data = {}
+      // One additional json object can be provided, which will be persisted together with the log entry
+     db.log('info', 'test message %s, %s', 'first', 'second', {number: 123});
+     // info: test message first, second
+     // data = {number: 123}
+      //use the log level helper
+     db.log.info('test message', 'first', 'second', {number: 123});
+     // info: test message first second
+     // data = {number: 123}
+      //change the default log level to trace, i.e. all log levels will be persisted, note that the log level can be
+     //additionally configured in the baqend
+     db.log.level = 'trace';
+      //trace will be persisted now
+     db.log.trace('test message', 'first', 'second', {number: 123});
+     // info: test message first second
+     // data = {number: 123}
+     * 
+ * + * @type util.Logger + */ + var _this = babelHelpers.possibleConstructorReturn(this, _util$Lockable.call(this)); + + _this.log = util.Logger.create(_this); + + /** + * The connector used for requests + * @type connector.Connector + * @private + */ + _this._connector = null; + + /** + * All managed and cached entity instances + * @type Map + */ + _this._entities = null; + + /** @type EntityManagerFactory */ + _this.entityManagerFactory = entityManagerFactory; + + /** @type metamodel.Metamodel */ + _this.metamodel = entityManagerFactory.metamodel; + + /** @type util.Code */ + _this.code = entityManagerFactory.code; + + /** @type util.Modules */ + _this.modules = null; + + /** + * The current logged in user object + * @type model.User + */ + _this.me = null; + + /** + * Returns true if the device token is already registered, otherwise false. + * @type boolean + */ + _this.isDeviceRegistered = false; + + /** + * Returns the tokenStorage which will be used to authorize all requests. + * @type {util.TokenStorage} + */ + _this.tokenStorage = null; + + /** + * @type {caching.BloomFilter} + */ + _this.bloomFilter = null; + + /** + * Set of object ids that were revalidated after the Bloom filter was loaded. + */ + _this.cacheWhiteList = null; + + /** + * Set of object ids that were updated but are not yet included in the bloom filter. + * This set essentially implements revalidation by side effect which does not work in Chrome. + */ + _this.cacheBlackList = null; + + /** + * Bloom filter refresh interval in seconds. + * + * @type {number} + */ + _this.bloomFilterRefresh = 60; + + /** + * Bloom filter refresh Promise + * + */ + _this._bloomFilterLock = new util.Lockable(); + return _this; + } + + /** + * Connects this entityManager, used for synchronous and asynchronous initialization + * @param {connector.Connector} connector + * @param {Object} connectData + * @param {util.TokenStorage} tokenStorage The used tokenStorage for token persistence + */ + + + EntityManager.prototype.connected = function connected(connector, connectData, tokenStorage) { + this._connector = connector; + this.tokenStorage = tokenStorage; + this.bloomFilterRefresh = this.entityManagerFactory.staleness; + this._entities = {}; + + this.File = binding.FileFactory.create(this); + this._createObjectFactory(this.metamodel.embeddables); + this._createObjectFactory(this.metamodel.entities); + + this.transaction = new EntityTransaction(this); + this.modules = new util.Modules(this, connector); + + if (connectData) { + this.isDeviceRegistered = !!connectData.device; + if (connectData.user && connectData.token == tokenStorage.token) this._updateUser(connectData.user, true); + + if (this.bloomFilterRefresh > 0 && connectData.bloomFilter && util.atob && !util.isNode) { + this.updateBloomFilter(connectData.bloomFilter); + } + } + }; + + /** + * @param {metamodel.ManagedType[]} types + * @return {binding.ManagedFactory} + * @private + */ + + + EntityManager.prototype._createObjectFactory = function _createObjectFactory(types) { + Object.keys(types).forEach(function (ref) { + var type = this.metamodel.managedType(ref); + var name = type.name; + + if (this[name]) { + type.typeConstructor = this[name]; + Object.defineProperty(this, name, { + value: type.createObjectFactory(this) + }); + } else { + Object.defineProperty(this, name, { + get: function get() { + Object.defineProperty(this, name, { + value: type.createObjectFactory(this) + }); + + return this[name]; + }, + set: function set(typeConstructor) { + type.typeConstructor = typeConstructor; + }, + + configurable: true + }); + } + }, this); + }; + + EntityManager.prototype.send = function send(message) { + var _this2 = this; + + message.tokenStorage = this.tokenStorage; + return this._connector.send(message).catch(function (e) { + if (e.status == StatusCode.BAD_CREDENTIALS) { + _this2._logout(); + } + throw e; + }); + }; + + /** + * Get an instance, whose state may be lazily fetched. If the requested instance does not exist + * in the database, the EntityNotFoundError is thrown when the instance state is first accessed. + * The application should not expect that the instance state will be available upon detachment, + * unless it was accessed by the application while the entity manager was open. + * + * @param {(Class|string)} entityClass + * @param {string=} key + */ + + + EntityManager.prototype.getReference = function getReference(entityClass, key) { + var id, type; + if (key) { + type = this.metamodel.entity(entityClass); + if (key.indexOf('/db/') == 0) { + id = key; + } else { + id = type.ref + '/' + encodeURIComponent(key); + } + } else { + id = entityClass; + type = this.metamodel.entity(id.substring(0, id.indexOf('/', 4))); //skip /db/ + } + + var entity = this._entities[id]; + if (!entity) { + entity = type.create(); + var metadata = Metadata.get(entity); + metadata.id = id; + metadata.setUnavailable(); + + this._attach(entity); + } + + return entity; + }; + + /** + * Creates an instance of Query.Builder for query creation and execution. The Query results are instances of the + * resultClass argument. + * @param {Class<*>=} resultClass - the type of the query result + * @return {query.Builder<*>} A query builder to create one ore more queries for the specified class + */ + + + EntityManager.prototype.createQueryBuilder = function createQueryBuilder(resultClass) { + return new query.Builder(this, resultClass); + }; + + /** + * Clear the persistence context, causing all managed entities to become detached. + * Changes made to entities that have not been flushed to the database will not be persisted. + */ + + + EntityManager.prototype.clear = function clear() { + this._entities = {}; + }; + + /** + * Close an application-managed entity manager. After the close method has been invoked, + * all methods on the EntityManager instance and any Query and TypedQuery objects obtained from it + * will throw the IllegalStateError except for transaction, and isOpen (which will return false). + * If this method is called when the entity manager is associated with an active transaction, + * the persistence context remains managed until the transaction completes. + */ + + + EntityManager.prototype.close = function close() { + this._connector = null; + + return this.clear(); + }; + + /** + * Check if the instance is a managed entity instance belonging to the current persistence context. + * @param {binding.Entity} entity - entity instance + * @returns {boolean} boolean indicating if entity is in persistence context + */ + + + EntityManager.prototype.contains = function contains(entity) { + return !!entity && this._entities[entity.id] === entity; + }; + + /** + * Check if an object with the id from the given entity is already attached. + * @param {binding.Entity} entity - entity instance + * @returns {boolean} boolean indicating if entity with same id is attached + */ + + + EntityManager.prototype.containsById = function containsById(entity) { + return !!(entity && this._entities[entity.id]); + }; + + /** + * Remove the given entity from the persistence context, causing a managed entity to become detached. + * Unflushed changes made to the entity if any (including removal of the entity), + * will not be synchronized to the database. Entities which previously referenced the detached entity will continue to reference it. + * @param {binding.Entity} entity - entity instance + */ + + + EntityManager.prototype.detach = function detach(entity) { + var _this3 = this; + + var state = Metadata.get(entity); + return state.withLock(function () { + _this3.removeReference(entity); + return Promise.resolve(entity); + }); + }; + + /** + * Resolve the depth by loading the referenced objects of the given entity. + * + * @param {binding.Entity} entity - entity instance + * @param {Object} [options] The load options + * @return {Promise} + */ + + + EntityManager.prototype.resolveDepth = function resolveDepth(entity, options) { + var _this4 = this; + + if (!options || !options.depth) return Promise.resolve(entity); + + options.resolved = options.resolved || []; + var promises = []; + var subOptions = Object.assign({}, options, { + depth: options.depth === true ? true : options.depth - 1 + }); + this.getSubEntities(entity, 1).forEach(function (subEntity) { + if (subEntity != null && !~options.resolved.indexOf(subEntity)) { + options.resolved.push(subEntity); + promises.push(_this4.load(subEntity.id, null, subOptions)); + } + }); + + return Promise.all(promises).then(function () { + return entity; + }); + }; + + /** + * Search for an entity of the specified oid. + * If the entity instance is contained in the persistence context, it is returned from there. + * @param {(Class|string)} entityClass - entity class + * @param {String} oid - Object ID + * @param {Object} [options] The load options. + * @return {Promise} the loaded entity or null + */ + + + EntityManager.prototype.load = function load(entityClass, oid, options) { + var _this5 = this; + + options = options || {}; + var entity = this.getReference(entityClass, oid); + var state = Metadata.get(entity); + + if (!options.refresh && options.local && state.isAvailable) { + return this.resolveDepth(entity, options); + } + + var msg = new message.GetObject(state.bucket, state.key); + + this.ensureCacheHeader(entity.id, msg, options.refresh); + + return this.send(msg).then(function (response) { + // refresh object if loaded older version from cache + // chrome doesn't using cache when ifNoneMatch is set + if (entity.version > response.entity.version) { + options.refresh = true; + return _this5.load(entityClass, oid, options); + } + + _this5.addToWhiteList(response.entity.id); + + if (response.status != StatusCode.NOT_MODIFIED) { + state.setJson(response.entity, true); + } + + return _this5.resolveDepth(entity, options); + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + _this5.removeReference(entity); + state.setRemoved(); + return null; + } else { + throw e; + } + }); + }; + + /** + * @param {binding.Entity} entity + * @param {Object} options + * @return {Promise} + */ + + + EntityManager.prototype.insert = function insert(entity, options) { + var _this6 = this; + + options = options || {}; + var isNew; + + return this._save(entity, options, function (state, json) { + if (state.version) throw new error.PersistentError('Existing objects can\'t be inserted.'); + + isNew = !state.id; + + return new message.CreateObject(state.bucket, json); + }).then(function (val) { + if (isNew) _this6._attach(entity); + + return val; + }); + }; + + /** + * @param {binding.Entity} entity + * @param {Object} options + * @return {Promise} + */ + + + EntityManager.prototype.update = function update(entity, options) { + options = options || {}; + + return this._save(entity, options, function (state, json) { + if (!state.version) throw new error.PersistentError("New objects can't be inserted."); + + if (options.force) { + delete json.version; + return new message.ReplaceObject(state.bucket, state.key, json).ifMatch('*'); + } else { + return new message.ReplaceObject(state.bucket, state.key, json).ifMatch(state.version); + } + }); + }; + + /** + * @param {binding.Entity} entity + * @param {Object} options The save options + * @param {boolean=} withoutLock Set true to save the entity without locking + * @return {Promise} + */ + + + EntityManager.prototype.save = function save(entity, options, withoutLock) { + options = options || {}; + + var msgFactory = function msgFactory(state, json) { + if (options.force) { + if (!state.id) throw new error.PersistentError("New special objects can't be forcedly saved."); + + delete json.version; + return new message.ReplaceObject(state.bucket, state.key, json); + } else if (state.version) { + return new message.ReplaceObject(state.bucket, state.key, json).ifMatch(state.version); + } else { + return new message.CreateObject(state.bucket, json); + } + }; + + return withoutLock ? this._locklessSave(entity, options, msgFactory) : this._save(entity, options, msgFactory); + }; + + /** + * @param {binding.Entity} entity + * @param {Function} cb pre-safe callback + * @return {Promise} + */ + + + EntityManager.prototype.optimisticSave = function optimisticSave(entity, cb) { + var _this7 = this; + + return Metadata.get(entity).withLock(function () { + return _this7._optimisticSave(entity, cb); + }); + }; + + /** + * @param {binding.Entity} entity + * @param {Function} cb pre-safe callback + * @return {Promise} + * @private + */ + + + EntityManager.prototype._optimisticSave = function _optimisticSave(entity, cb) { + var _this8 = this; + + var abort = false; + var abortFn = function abortFn() { + abort = true; + }; + var promise = Promise.resolve(cb(entity, abortFn)); + + if (abort) return Promise.resolve(entity); + + return promise.then(function () { + return _this8.save(entity, {}, true).catch(function (e) { + if (e.status == 412) { + return _this8.refresh(entity, {}).then(function () { + return _this8._optimisticSave(entity, cb); + }); + } else { + throw e; + } + }); + }); + }; + + /** + * Save the object state without locking + * @param {binding.Entity} entity + * @param {Object} options + * @param {Function} msgFactory + * @return {Promise.} + * @private + */ + + + EntityManager.prototype._locklessSave = function _locklessSave(entity, options, msgFactory) { + var _this9 = this; + + this.attach(entity); + var state = Metadata.get(entity); + var refPromises; + + var json; + if (state.isAvailable) { + //getting json will check all collections changes, therefore we must do it before proofing the dirty state + json = state.getJson(false, true); + } + + if (state.isDirty) { + if (!options.refresh) { + state.setPersistent(); + } + + var sendPromise = this.send(msgFactory(state, json)).then(function (response) { + if (options.refresh) { + state.setJson(response.entity, true); + } else { + state.setJsonMetadata(response.entity); + } + return entity; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + _this9.removeReference(entity); + state.setRemoved(); + return null; + } else { + state.setDirty(); + throw e; + } + }); + + refPromises = [sendPromise]; + } else { + refPromises = [Promise.resolve(entity)]; + } + + var subOptions = Object.assign({}, options); + subOptions.depth = 0; + this.getSubEntities(entity, options.depth).forEach(function (sub) { + refPromises.push(_this9._save(sub, subOptions, msgFactory)); + }); + + return Promise.all(refPromises).then(function () { + return entity; + }); + }; + + /** + * Save and lock the object state + * @param {binding.Entity} entity + * @param {Object} options + * @param {Function} msgFactory + * @return {Promise.} + * @private + */ + + + EntityManager.prototype._save = function _save(entity, options, msgFactory) { + var _this10 = this; + + this.ensureBloomFilterFreshness(); + + var state = Metadata.get(entity); + if (state.version) { + this.addToBlackList(entity.id); + } + + return state.withLock(function () { + return _this10._locklessSave(entity, options, msgFactory); + }); + }; + + /** + * Returns all referenced sub entities for the given depth and root entity + * @param {binding.Entity} entity + * @param {boolean|number} depth + * @param {binding.Entity[]} [resolved] + * @param {binding.Entity=} initialEntity + * @returns {binding.Entity[]} + */ + + + EntityManager.prototype.getSubEntities = function getSubEntities(entity, depth, resolved, initialEntity) { + var _this11 = this; + + resolved = resolved || []; + if (!depth) { + return resolved; + } + initialEntity = initialEntity || entity; + + var state = Metadata.get(entity); + for (var _iterator = state.type.references(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var value = _ref; + + this.getSubEntitiesByPath(entity, value.path).forEach(function (subEntity) { + if (!~resolved.indexOf(subEntity) && subEntity != initialEntity) { + resolved.push(subEntity); + resolved = _this11.getSubEntities(subEntity, depth === true ? depth : depth - 1, resolved, initialEntity); + } + }); + } + + return resolved; + }; + + /** + * Returns all referenced one level sub entities for the given path + * @param {binding.Entity} entity + * @param {Array} path + * @returns {binding.Entity[]} + */ + + + EntityManager.prototype.getSubEntitiesByPath = function getSubEntitiesByPath(entity, path) { + var _this12 = this; + + var subEntities = [entity]; + + path.forEach(function (attributeName) { + + var tmpSubEntities = []; + subEntities.forEach(function (subEntity) { + var curEntity = subEntity[attributeName]; + if (!curEntity) return; + + var attribute = _this12.metamodel.managedType(subEntity.constructor).getAttribute(attributeName); + if (attribute.isCollection) { + for (var _iterator2 = curEntity.entries(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var entry = _ref2; + + tmpSubEntities.push(entry[1]); + attribute.keyType && attribute.keyType.isEntity && tmpSubEntities.push(entry[0]); + } + } else { + tmpSubEntities.push(curEntity); + } + }); + subEntities = tmpSubEntities; + }); + + return subEntities; + }; + + /** + * Delete the entity instance. + * @param {binding.Entity} entity + * @param {Object} options The delete options + * @return {Promise} + */ + + + EntityManager.prototype['delete'] = function _delete(entity, options) { + var _this13 = this; + + options = options || {}; + + this.attach(entity); + var state = Metadata.get(entity); + + return state.withLock(function () { + if (!state.version && !options.force) throw new error.IllegalEntityError(entity); + + var msg = new message.DeleteObject(state.bucket, state.key); + + _this13.addToBlackList(entity.id); + + if (!options.force) msg.ifMatch(state.version); + + var refPromises = [_this13.send(msg).then(function () { + _this13.removeReference(entity); + state.setRemoved(); + return entity; + })]; + + var subOptions = Object.assign({}, options); + subOptions.depth = 0; + _this13.getSubEntities(entity, options.depth).forEach(function (sub) { + refPromises.push(_this13.delete(sub, subOptions)); + }); + + return Promise.all(refPromises).then(function () { + return entity; + }); + }); + }; + + /** + * Synchronize the persistence context to the underlying database. + * + * @returns {Promise<*>} + */ + + + EntityManager.prototype.flush = function flush(doneCallback, failCallback) {} + // TODO: implement this + + + /** + * Make an instance managed and persistent. + * @param {binding.Entity} entity - entity instance + */ + ; + + EntityManager.prototype.persist = function persist(entity) { + this.attach(entity); + }; + + /** + * Refresh the state of the instance from the database, overwriting changes made to the entity, if any. + * @param {binding.Entity} entity - entity instance + * @param {Object} options The refresh options + * @return {Promise} + */ + + + EntityManager.prototype.refresh = function refresh(entity, options) { + options = options || {}; + options.refresh = true; + + return this.load(entity.id, null, options); + }; + + /** + * Attach the instance to this database context, if it is not already attached + * @param {binding.Entity} entity The entity to attach + */ + + + EntityManager.prototype.attach = function attach(entity) { + if (!this.contains(entity)) { + var type = this.metamodel.entity(entity.constructor); + if (!type) throw new error.IllegalEntityError(entity); + + if (this.containsById(entity)) throw new error.EntityExistsError(entity); + + this._attach(entity); + } + }; + + EntityManager.prototype._attach = function _attach(entity) { + var metadata = Metadata.get(entity); + if (metadata.isAttached) { + if (metadata.db != this) { + throw new error.EntityExistsError(entity); + } + } else { + metadata.db = this; + } + + if (!metadata.id) { + if (metadata.type.name != 'User' && metadata.type.name != 'Role' && metadata.type.name != 'logs.AppLog') { + metadata.id = '/db/' + metadata.type.name + '/' + util.uuid(); + } + } + + if (metadata.id) { + this._entities[metadata.id] = entity; + } + }; + + EntityManager.prototype.removeReference = function removeReference(entity) { + var state = Metadata.get(entity); + if (!state) throw new error.IllegalEntityError(entity); + + delete this._entities[state.id]; + }; + + EntityManager.prototype.register = function register(user, password, loginOption) { + var _this14 = this; + + var login = loginOption > UserFactory.LoginOption.NO_LOGIN; + if (this.me && login) { + throw new error.PersistentError('User is already logged in.'); + } + + return this.withLock(function () { + var msg = new message.Register({ + user: user, + password: password, + login: login + }); + return _this14._userRequest(msg, loginOption); + }); + }; + + EntityManager.prototype.login = function login(username, password, loginOption) { + var _this15 = this; + + if (this.me) throw new error.PersistentError('User is already logged in.'); + + return this.withLock(function () { + var msg = new message.Login({ + username: username, + password: password + }); + + return _this15._userRequest(msg, loginOption); + }); + }; + + EntityManager.prototype.logout = function logout() { + var _this16 = this; + + return this.withLock(function () { + return _this16.send(new message.Logout()).then(_this16._logout.bind(_this16)); + }); + }; + + EntityManager.prototype.loginWithOAuth = function loginWithOAuth(provider, clientID, options) { + if (this.me) throw new error.PersistentError('User is already logged in.'); + + options = Object.assign({ + title: "Login with " + provider, + timeout: 5 * 60 * 1000, + state: {}, + loginOption: true + }, options); + + var msg; + if (Message[provider + 'OAuth']) { + msg = new Message[provider + 'OAuth'](clientID, options.scope, JSON.stringify(options.state)); + } else { + throw new Error('OAuth provider ' + provider + ' not supported.'); + } + + var req = this._userRequest(msg, options.loginOption); + var w = open(msg.request.path, options.title, 'width=' + options.width + ',height=' + options.height); + + return new Promise(function (resolve, reject) { + var timeout = setTimeout(function () { + reject(new error.PersistentError('OAuth login timeout.')); + }, options.timeout); + + req.then(resolve, reject).then(function () { + clearTimeout(timeout); + }); + }); + }; + + EntityManager.prototype.renew = function renew() { + var _this17 = this; + + return this.withLock(function () { + var msg = new message.Me(); + return _this17._userRequest(msg, true); + }); + }; + + EntityManager.prototype.newPassword = function newPassword(username, password, _newPassword) { + var _this18 = this; + + return this.withLock(function () { + var msg = new message.NewPassword({ + username: username, + password: password, + newPassword: _newPassword + }); + + return _this18.send(msg).then(function (response) { + return _this18._updateUser(response.entity); + }); + }); + }; + + EntityManager.prototype._updateUser = function _updateUser(obj, updateMe) { + var user = this.getReference(obj.id); + var metadata = Metadata.get(user); + metadata.setJson(obj, true); + + if (updateMe) this.me = user; + + return user; + }; + + EntityManager.prototype._logout = function _logout() { + this.me = null; + this.token = null; + }; + + EntityManager.prototype._userRequest = function _userRequest(msg, loginOption) { + var _this19 = this; + + var login = loginOption > UserFactory.LoginOption.NO_LOGIN; + if (login) { + this.tokenStorage.temporary = loginOption < UserFactory.LoginOption.PERSIST_LOGIN; + } + + return this.send(msg).then(function (response) { + if (response.entity) { + return _this19._updateUser(response.entity, login); + } + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + if (login) _this19._logout(); + return null; + } else { + throw e; + } + }); + }; + + EntityManager.prototype.registerDevice = function registerDevice(os, token, device) { + var msg = new message.DeviceRegister({ + token: token, + devicetype: os, + device: device + }); + + msg.withCredentials = true; + return this.send(msg); + }; + + EntityManager.prototype.checkDeviceRegistration = function checkDeviceRegistration() { + var _this20 = this; + + return this.send(new message.DeviceRegistered()).then(function () { + return _this20.isDeviceRegistered = true; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + return _this20.isDeviceRegistered = false; + } else { + throw e; + } + }); + }; + + EntityManager.prototype.pushDevice = function pushDevice(pushMessage) { + return this.send(new message.DevicePush(pushMessage)); + }; + + /** + * The given entity will be checked by the validation code of the entity type. + * + * @param {binding.Entity} entity + * @returns {util.ValidationResult} result + */ + + + EntityManager.prototype.validate = function validate(entity) { + var type = Metadata.get(entity).type; + + var result = new util.ValidationResult(); + for (var iter = type.attributes(), item; !(item = iter.next()).done;) { + var validate = new util.Validator(item.value.name, entity); + result.fields[validate.key] = validate; + } + + var validationCode = type.validationCode; + if (validationCode) { + validationCode(result.fields); + } + + return result; + }; + + /** + * Adds the given object id to the cacheWhiteList if needed. + * @param {string} objectId The id to add. + */ + + + EntityManager.prototype.addToWhiteList = function addToWhiteList(objectId) { + if (!this.isCachingDisabled) { + if (this.bloomFilter.contains(objectId)) { + this.cacheWhiteList.add(objectId); + } + this.cacheBlackList.delete(objectId); + } + }; + + /** + * Adds the given object id to the cacheBlackList if needed. + * @param {string} objectId The id to add. + */ + + + EntityManager.prototype.addToBlackList = function addToBlackList(objectId) { + if (!this.isCachingDisabled) { + if (!this.bloomFilter.contains(objectId)) { + this.cacheBlackList.add(objectId); + } + this.cacheWhiteList.delete(objectId); + } + }; + + EntityManager.prototype.refreshBloomFilter = function refreshBloomFilter() { + var _this21 = this; + + if (this.isCachingDisabled) return Promise.resolve(); + + var msg = new message.GetBloomFilter(); + return this.send(msg).then(function (response) { + _this21.updateBloomFilter(response.entity); + return _this21.bloomFilter; + }); + }; + + EntityManager.prototype.updateBloomFilter = function updateBloomFilter(bloomFilter) { + this.bloomFilter = new BloomFilter(bloomFilter); + this.cacheWhiteList = new Set(); + this.cacheBlackList = new Set(); + }; + + /** + * Checks the freshness of the bloom filter and does a reload if necessary + */ + + + EntityManager.prototype.ensureBloomFilterFreshness = function ensureBloomFilterFreshness() { + var _this22 = this; + + if (this.isCachingDisabled) return; + + var now = new Date().getTime(); + var refreshRate = this.bloomFilterRefresh * 1000; + + if (this._bloomFilterLock.isReady && now - this.bloomFilter.creation > refreshRate) { + this._bloomFilterLock.withLock(function () { + return _this22.refreshBloomFilter(); + }); + } + }; + + /** + * Checks for a given id, if revalidation is required, the resource is stale or caching was disabled + * @param {string} id The object id to check + * @returns {boolean} Indicates if the resource must be revalidated + */ + + + EntityManager.prototype.mustRevalidate = function mustRevalidate(id) { + if (util.isNode) return false; + + this.ensureBloomFilterFreshness(); + + var refresh = this.isCachingDisabled || !this._bloomFilterLock.isReady; + refresh = refresh || !this.cacheWhiteList.has(id) && (this.cacheBlackList.has(id) || this.bloomFilter.contains(id)); + return refresh; + }; + + /** + * + * @param {string} id To check the bloom filter + * @param {connector.Message} message To attach the headers + * @param {boolean} refresh To force the reload headers + */ + + + EntityManager.prototype.ensureCacheHeader = function ensureCacheHeader(id, message, refresh) { + refresh = refresh || this.mustRevalidate(id); + + if (refresh) { + message.noCache(); + } + }; + + /** + * Creates a absolute url for the given relative one + * @param {string} relativePath the relative url + * @param {boolean=} authorize indicates if authorization credentials should be generated and be attached to the url + * @return {string} a absolute url wich is optionaly signed with a resource token which authenticates the currently + * logged in user + */ + + + EntityManager.prototype.createURL = function createURL(relativePath, authorize) { + var path = this._connector.basePath + relativePath; + + var append = false; + if (authorize && this.me) { + path = this.tokenStorage.signPath(path); + append = true; + } else { + path = path.split('/').map(encodeURIComponent).join('/'); + } + + if (this.mustRevalidate(relativePath)) { + path = path + (append ? '&' : '?') + 'BCB'; + } + + return this._connector.origin + path; + }; + + return EntityManager; +}(util.Lockable); + +/** + * Constructor for a new List collection + * @function + * @param {...*} args Same arguments can be passed as the Array constructor takes + * @return {void} The new created List + */ + + +EntityManager.prototype.List = Array; + +/** + * Constructor for a new Set collection + * @function + * @param {Iterable<*>=} collection The initial array or collection to initialize the new Set + * @return {void} The new created Set + */ +EntityManager.prototype.Set = Set; + +/** + * Constructor for a new Map collection + * @function + * @param {Iterable<*>=} collection The initial array or collection to initialize the new Map + * @return {void} The new created Map + */ +EntityManager.prototype.Map = Map; + +/** + * Constructor for a new GeoPoint + * @function + * @param {string|number|Object|Array} [latitude] A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude + * @param {number=} longitude The GeoPoint's longitude + * @return {void} The new created GeoPoint + */ +EntityManager.prototype.GeoPoint = _dereq_(5); + +/** + * An User factory for user objects. + * The User factory can be called to create new instances of users or can be used to register/login/logout users. + * The created instances implements the {@link model.User} interface + * @name User + * @type binding.UserFactory + * @memberOf EntityManager.prototype + */ + +/** + * An Role factory for role objects. + * The Role factory can be called to create new instances of roles, later on users can be attached to roles to manage the + * access permissions through this role + * The created instances implements the {@link model.Role} interface + * @name Role + * @memberOf EntityManager.prototype + * @type binding.EntityFactory + */ + +/** + * An Device factory for user objects. + * The Device factory can be called to create new instances of devices or can be used to register, push to and + * check registration status of devices. + * @name Device + * @memberOf EntityManager.prototype + * @type binding.DeviceFactory + */ + +/** + * An Object factory for entity or embedded objects, + * that can be accessed by the type name of the entity type. + * An object factory can be called to create new instances of the type. + * The created instances implements the {@link binding.Entity} or the {@link binding.Managed} interface + * whenever the class is an entity or embedded object + * @name [YourEntityClass: string] + * @memberOf EntityManager.prototype + * @type {*} + */ + +/** + * A File factory for file objects. + * The file factory can be called to create new instances for files. + * The created instances implements the {@link binding.File} interface + * @name File + * @memberOf EntityManager.prototype + * @type binding.FileFactory + */ + +module.exports = EntityManager; + +},{"19":19,"20":20,"21":21,"25":25,"34":34,"36":36,"4":4,"5":5,"59":59,"63":63,"70":70}],3:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var metamodel = _dereq_(52); + +var util = _dereq_(70); +var caching = _dereq_(22); +var Connector = _dereq_(23); +var EntityManager = _dereq_(2); + +/** + * @alias EntityManagerFactory + * @extends util.Lockable + */ + +var EntityManagerFactory = function (_util$Lockable) { + babelHelpers.inherits(EntityManagerFactory, _util$Lockable); + + EntityManagerFactory.prototype._connected = function _connected() {}; + + /** + * Creates a new EntityManagerFactory connected to the given destination + * @param {string|Object} [options] The destination to connect with, or an options object + * @param {string} [options.host] The destination to connect with + * @param {number} [options.port=80|443] The optional destination port to connect with + * @param {boolean} [options.secure=false] true To use a secure ssl encrypted connection + * @param {string} [options.basePath="/v1"] The base path of the api + * @param {Object} [options.schema=null] The serialized schema as json used to initialize the metamodel + * @param {util.TokenStorage} [options.tokenStorage] The tokenStorage which should be used by this emf + * @param {util.TokenStorageFactory} [options.tokenStorageFactory] The tokenStorage factory implementation which should + * be used for token storage + * @param {number} [options.staleness=60] The maximum staleness of objects that are acceptable while reading cached data + */ + + + function EntityManagerFactory(options) { + babelHelpers.classCallCheck(this, EntityManagerFactory); + + var _this = babelHelpers.possibleConstructorReturn(this, _util$Lockable.call(this)); + + options = Object(options) instanceof String ? { host: options } : options || {}; + + /** @type connector.Connector */ + _this._connector = null; + /** @type metamodel.Metamodel */ + _this.metamodel = _this.createMetamodel(); + /** @type util.Code */ + _this.code = new util.Code(_this.metamodel, _this); + /** @type util.TokenStorageFactory */ + _this.tokenStorageFactory = util.TokenStorage.WEB_STORAGE || util.TokenStorage.GLOBAL; + + _this.configure(options); + + var isReady = true; + var ready = new Promise(function (success) { + _this._connected = success; + }); + + if (options.host) { + _this.connect(options.host, options.port, options.secure, options.basePath); + } else { + isReady = false; + } + + if (!_this.tokenStorage) { + isReady = false; + ready = ready.then(function () { + return _this.tokenStorageFactory.create(_this._connector.origin); + }).then(function (tokenStorage) { + _this.tokenStorage = tokenStorage; + }); + } + + if (options.schema) { + _this._connectData = options; + _this.metamodel.init(options.schema); + } else { + isReady = false; + ready = ready.then(function () { + var msg = new message.Connect(); + msg.withCredentials = true; //used for registered devices + + if (_this.staleness === 0) msg.noCache(); + + return _this.send(msg); + }).then(function (response) { + _this._connectData = response.entity; + + if (_this.staleness === undefined) { + _this.staleness = _this._connectData.bloomFilterRefresh || 60; + } + + if (!_this.metamodel.isInitialized) _this.metamodel.init(_this._connectData.schema); + + _this.tokenStorage.update(_this._connectData.token); + }); + } + + if (!isReady) { + _this.withLock(function () { + return ready; + }, true); + } + return _this; + } + + /** + * Apply additional configurations to this EntityManagerFactory + * @param {Object} options The additional configuration options + * @param {util.TokenStorage} [options.tokenStorage] The tokenStorage which should be used by this emf + * @param {util.TokenStorageFactory} [options.tokenStorageFactory] The tokenStorage factory implementation which should + * be used for token storage + * @param {number} [options.staleness=60] The maximum staleness of objects that are acceptable while reading cached data, + * 0 to always bypass the browser cache + */ + + + EntityManagerFactory.prototype.configure = function configure(options) { + if (this._connector) throw new Error('The EntityManagerFactory can only be configured before is is connected.'); + + if (options.tokenStorage) { + /** @type util.TokenStorage */ + this.tokenStorage = options.tokenStorage; + } + + if (options.tokenStorageFactory) { + this.tokenStorageFactory = options.tokenStorageFactory; + } + + if (options.staleness !== undefined) { + /** @type number */ + this.staleness = options.staleness; + } + }; + + /** + * Connects this EntityManager to the given destination + * @param {string} hostOrApp The host or the app name to connect with + * @param {number} [port=80|443] The port to connect to + * @param {boolean} [secure=false] true To use a secure connection + * @param {string} [basePath="/v1"] The base path of the api + */ + + + EntityManagerFactory.prototype.connect = function connect(hostOrApp, port, secure, basePath) { + if (this._connector) throw new Error('The EntityManagerFactory is already connected.'); + + if (Object(port) instanceof Boolean) { + secure = port; + port = 0; + } + + this._connector = Connector.create(hostOrApp, port, secure, basePath); + + this._connected(); + return this.ready(); + }; + + /** + * Connects this EntityManager to the given destination + * @param {string} hostOrApp The host or the app name to connect with + * @param {boolean} [secure=false] true To use a secure connection + * @name connect + * @memberOf EntityManagerFactory.prototype + * @method + */ + + /** + * Creates a new Metamodel instance, which is not connected + * @return {metamodel.Metamodel} A new Metamodel instance + */ + + + EntityManagerFactory.prototype.createMetamodel = function createMetamodel() { + return new metamodel.Metamodel(this); + }; + + /** + * Create a new application-managed EntityManager. + * + * @param {boolean=} useSharedTokenStorage The token storage to persist the authorization token, or + * true To use the shared token storage of the emf. + * false To use a instance based storage. + * + * @returns {EntityManager} a new entityManager + */ + + + EntityManagerFactory.prototype.createEntityManager = function createEntityManager(useSharedTokenStorage) { + var _this2 = this; + + var em = new EntityManager(this); + + if (this.isReady) { + em.connected(this._connector, this._connectData, useSharedTokenStorage ? this.tokenStorage : new util.TokenStorage(this._connector.origin)); + } else { + em.withLock(function () { + return _this2.ready().then(function () { + em.connected(_this2._connector, _this2._connectData, useSharedTokenStorage ? _this2.tokenStorage : new util.TokenStorage(_this2._connector.origin)); + }); + }, true); + } + + return em; + }; + + EntityManagerFactory.prototype.send = function send(message) { + if (!message.tokenStorage) message.tokenStorage = this.tokenStorage; + return this._connector.send(message); + }; + + return EntityManagerFactory; +}(util.Lockable); + +module.exports = EntityManagerFactory; + +},{"2":2,"22":22,"23":23,"36":36,"52":52,"70":70}],4:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var error = _dereq_(34); + +/** + * @alias EntityTransaction + */ + +var EntityTransaction = function () { + babelHelpers.createClass(EntityTransaction, [{ + key: 'isActive', + + + /** + * Indicate whether a resource transaction is in progress. + * @returns {boolean} indicating whether transaction is in progress + */ + get: function get() { + return Boolean(this.tid); + } + + /** + * @param {EntityManager} entityManager + */ + + }]); + + function EntityTransaction(entityManager) { + babelHelpers.classCallCheck(this, EntityTransaction); + + this._connector = entityManager.connector; + this.entityManager = entityManager; + + this.tid = null; + this.rollbackOnly = false; + + this.readSet = null; + this.changeSet = null; + } + + /** + * Start a resource transaction. + */ + + + EntityTransaction.prototype.begin = function begin(doneCallback, failCallback) { + return this.yield().then(function () { + var result = this.send(new message.PostTransaction()).done(function (msg) { + this.tid = msg.tid; + + this.rollbackOnly = false; + this.readSet = {}; + this.changeSet = {}; + }); + + return this.wait(result); + }).then(doneCallback, failCallback); + }; + + /** + * Commit the current resource transaction, writing any unflushed changes to the database. + */ + + + EntityTransaction.prototype.commit = function commit(doneCallback, failCallback) { + return this.yield().then(function () { + if (this.getRollbackOnly()) { + return this.rollback().then(function () { + throw new error.RollbackError(); + }); + } else { + return this.wait(this.entityManager.flush()).then(function () { + var readSet = []; + for (var ref in this.readSet) { + readSet.push({ + "oid": ref, + "version": this.readSet[ref] + }); + } + + var result = this.send(new message.PutTransactionCommitted(this.tid, readSet)); + + return this.wait(result).then(function (msg) { + this.tid = null; + this.readSet = null; + this.changeSet = null; + + var oids = msg.oids; + for (var oid in oids) { + var version = oids[oid]; + var entity = this.entityManager.entities[oid]; + + if (entity) { + var state = util.Metadata.get(entity); + if (version == 'DELETED' || state.isDeleted) { + this.entityManager.removeReference(entity); + } else { + state.setJsonValue(state.type.version, version); + } + } + } + }); + }); + } + }).then(doneCallback, failCallback); + }; + + /** + * Determine whether the current resource transaction has been marked for rollback. + * @returns {boolean} indicating whether the transaction has been marked for rollback + */ + + + EntityTransaction.prototype.getRollbackOnly = function getRollbackOnly() { + return this.rollbackOnly; + }; + + /** + * Roll back the current resource transaction. + */ + + + EntityTransaction.prototype.rollback = function rollback(doneCallback, failCallback) { + return this.yield().then(function () { + var result = this.send(new message.PutTransactionAborted(this.tid)); + + this.wait(result).then(function () { + this.tid = null; + this.readSet = null; + this.changeSet = null; + return this.entityManager.clear(); + }, function () { + return this.entityManager.clear(); + }); + }).then(doneCallback, failCallback); + }; + + /** + * Mark the current resource transaction so that the only possible outcome of the transaction is for the transaction to be rolled back. + */ + + + EntityTransaction.prototype.setRollbackOnly = function setRollbackOnly(context, onSuccess) { + return this.yield().done(function () { + this.rollbackOnly = true; + }); + }; + + EntityTransaction.prototype.isRead = function isRead(identifier) { + return this.isActive && identifier in this.readSet; + }; + + EntityTransaction.prototype.setRead = function setRead(identifier, version) { + if (this.isActive && !this.isChanged(identifier)) { + this.readSet[identifier] = version; + } + }; + + EntityTransaction.prototype.isChanged = function isChanged(identifier) { + return this.isActive && identifier in this.changeSet; + }; + + EntityTransaction.prototype.setChanged = function setChanged(identifier) { + if (this.isActive) { + delete this.readSet[identifier]; + this.changeSet[identifier] = true; + } + }; + + return EntityTransaction; +}(); + +module.exports = EntityTransaction; + +},{"34":34,"36":36}],5:[function(_dereq_,module,exports){ +"use strict"; + +/** + * Creates a new GeoPoint instance + * From latitude and longitude + * From a json object + * Or an tuple of latitude and longitude + * + * @alias GeoPoint + */ + +var GeoPoint = function () { + + /** + * Creates a GeoPoint with the user's current location, if available. + * @return {Promise} A promise that will be resolved with a GeoPoint + */ + GeoPoint.current = function current() { + return new Promise(function (resolve, reject) { + navigator.geolocation.getCurrentPosition(function (location) { + resolve(new GeoPoint(location.coords.latitude, location.coords.longitude)); + }, function (error) { + reject(error); + }); + }); + }; + + /** + * @param {string|number|Object|Array} [latitude] A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude + * @param {number=} longitude The GeoPoint's longitude + */ + + + function GeoPoint(latitude, longitude) { + babelHelpers.classCallCheck(this, GeoPoint); + + var lat = void 0, + lng = void 0; + if (Object(latitude) instanceof String) { + var index = latitude.indexOf(';'); + lat = latitude.substring(0, index); + lng = latitude.substring(index + 1); + } else if (Object(latitude) instanceof Number) { + lat = latitude; + lng = longitude; + } else if (Object(latitude) instanceof Array) { + lat = latitude[0]; + lng = latitude[1]; + } else if (latitude instanceof Object) { + lat = latitude.latitude; + lng = latitude.longitude; + } else { + lat = 0; + lng = 0; + } + + /** + * Longitude of the given point + * @type {number} + */ + this.longitude = lng; + + /** + * Latitude of the given point + * @type {number} + */ + this.latitude = lat; + + if (this.latitude < -90 || this.latitude > 90) { + throw new Error("Latitude " + this.latitude + " is not in bound of -90 <= latitude <= 90"); + } + + if (this.longitude < -180 || this.longitude > 180) { + throw new Error("Longitude " + this.longitude + " is not in bound of -180 <= longitude <= 180"); + } + } + + /** + * Returns the distance from this GeoPoint to another in kilometers. + * @param {GeoPoint} point another GeoPoint + * @return {number} The distance in kilometers + * + * @see GeoPoint#radiansTo + */ + + + GeoPoint.prototype.kilometersTo = function kilometersTo(point) { + return Number((GeoPoint.EARTH_RADIUS_IN_KILOMETERS * this.radiansTo(point)).toFixed(3)); + }; + + /** + * Returns the distance from this GeoPoint to another in miles. + * @param {GeoPoint} point another GeoPoint + * @return {number} The distance in miles + * + * @see GeoPoint#radiansTo + */ + + + GeoPoint.prototype.milesTo = function milesTo(point) { + return Number((GeoPoint.EARTH_RADIUS_IN_MILES * this.radiansTo(point)).toFixed(3)); + }; + + /** + * Computes the arc, in radian, between two WGS-84 positions. + * + * The haversine formula implementation is taken from: + * {@link http://www.movable-type.co.uk/scripts/latlong.html} + * + * Returns the distance from this GeoPoint to another in radians. + * @param {GeoPoint} point another GeoPoint + * @return {number} the arc, in radian, between two WGS-84 positions + * + * @see http://en.wikipedia.org/wiki/Haversine_formula + */ + + + GeoPoint.prototype.radiansTo = function radiansTo(point) { + var from = this, + to = point; + var rad1 = from.latitude * GeoPoint.DEG_TO_RAD, + rad2 = to.latitude * GeoPoint.DEG_TO_RAD, + dLng = (to.longitude - from.longitude) * GeoPoint.DEG_TO_RAD; + + return Math.acos(Math.sin(rad1) * Math.sin(rad2) + Math.cos(rad1) * Math.cos(rad2) * Math.cos(dLng)); + }; + + /** + * A String representation in latitude, longitude format + * @return {string} The string representation of this class + */ + + + GeoPoint.prototype.toString = function toString() { + return this.latitude + ';' + this.longitude; + }; + + /** + * Returns a JSON representation of the GeoPoint + * @return {json} A GeoJson object of this GeoPoint + */ + + + GeoPoint.prototype.toJSON = function toJSON() { + return { latitude: this.latitude, longitude: this.longitude }; + }; + + return GeoPoint; +}(); + +GeoPoint.DEG_TO_RAD = Math.PI / 180; + +/** + * The Earth radius in kilometers used by {@link GeoPoint#kilometersTo} + * @type {number} + */ +GeoPoint.EARTH_RADIUS_IN_KILOMETERS = 6371; + +/** + * The Earth radius in miles used by {@link GeoPoint#milesTo} + * @type {number} + */ +GeoPoint.EARTH_RADIUS_IN_MILES = 3956; + +module.exports = GeoPoint; + +},{}],6:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @interface baqend + * @extends EntityManager + */ +var EntityManagerFactory = _dereq_(3); +var EntityManager = _dereq_(2); + +EntityManager.prototype.binding = _dereq_(20); +EntityManager.prototype.connector = _dereq_(28); +EntityManager.prototype.error = _dereq_(34); +EntityManager.prototype.message = _dereq_(36); +EntityManager.prototype.metamodel = _dereq_(52); +EntityManager.prototype.util = _dereq_(70); +EntityManager.prototype.caching = _dereq_(22); +EntityManager.prototype.query = _dereq_(59); + +EntityManager.prototype.EntityManager = _dereq_(2); +EntityManager.prototype.EntityManagerFactory = _dereq_(3); +EntityManager.prototype.EntityTransaction = _dereq_(4); +EntityManager.prototype.Acl = _dereq_(1); + +var emf = new EntityManagerFactory(); +var db = emf.createEntityManager(true); + +/** + * Configures the DB with additional config options + * @param {Object} options The additional configuration options + * @param {util.TokenStorage} [options.tokenStorage] The tokenStorage which should be used by this emf + * @param {util.TokenStorageFactory} [options.tokenStorageFactory] The tokenStorage factory implementation which should + * be used for token storage + * @param {number} [options.staleness=60] The maximum staleness of objects that are acceptable while reading cached data, + * 0 to always bypass the browser cache + * @function + * @return {baqend} + * @alias baqend#configure + */ +db.configure = function (options) { + emf.configure(options); + return this; +}; + +/** + * Connects the DB with the server and calls the callback on success + * @param {string} hostOrApp The host or the app name to connect with + * @param {boolean} [secure=false] true To use a secure connection + * @param {util.Lockable~callback=} doneCallback The callback, called when a connection is established and the + * SDK is ready to use + * @param {util.Lockable~callback=} failCallback When an error occurred while initializing the SDK + * @function + * @return {Promise} + * @alias baqend#connect + */ +db.connect = function (hostOrApp, secure, doneCallback, failCallback) { + if (secure instanceof Function) { + failCallback = doneCallback; + doneCallback = secure; + secure = undefined; + } + + emf.connect(hostOrApp, secure); + return this.ready(doneCallback, failCallback); +}; + +exports = module.exports = db; +//import {db} from 'baqend'; +exports.db = db; +//import db from 'baqend'; +exports.default = db; + +},{"1":1,"2":2,"20":20,"22":22,"28":28,"3":3,"34":34,"36":36,"4":4,"52":52,"59":59,"70":70}],7:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias binding.Accessor + */ + +var Accessor = function () { + function Accessor() { + babelHelpers.classCallCheck(this, Accessor); + } + + /** + * @param {Object} object + * @param {metamodel.Attribute} attribute + * @returns {*} + */ + Accessor.prototype.getValue = function getValue(object, attribute) { + return object[attribute.name]; + }; + + /** + * @param {Object} object + * @param {metamodel.Attribute} attribute + * @param {*} value + */ + + + Accessor.prototype.setValue = function setValue(object, attribute, value) { + object[attribute.name] = value; + }; + + return Accessor; +}(); + +module.exports = Accessor; + +},{}],8:[function(_dereq_,module,exports){ +"use strict"; + +var EntityFactory = _dereq_(11); + +/** + * @class binding.DeviceFactory + * @extends binding.EntityFactory + * + * @param {Object=} properties initial properties to set on the instance + * @param {...*} arguments Additional constructor params passed through the type constructor + * @return {model.Device} The new managed instance + */ +var DeviceFactory = EntityFactory.extend( /** @lends binding.DeviceFactory.prototype */{ + + /** + * Returns true if the devices is already registered, otherwise false. + * @returns {boolean} Status of the device registration + */ + get isRegistered() { + return this._db.isDeviceRegistered; + }, + + /** + * Register a new device with the given device token and OS. + * @param {string} os The OS of the device (IOS/Android) + * @param {string} token The GCM or APNS device token + * @param {model.Device=} device A optional device entity to set custom field values + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + */ + register: function register(os, token, device, doneCallback, failCallback) { + if (device instanceof Function) { + failCallback = doneCallback; + doneCallback = device; + device = null; + } + + return this._db.registerDevice(os, token, device).then(doneCallback, failCallback); + }, + + + /** + * Uses the info from the given {util.PushMessage} message to send an push notification. + * @param {util.PushMessage} pushMessage to send an push notification. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + */ + push: function push(pushMessage, doneCallback, failCallback) { + return this._db.pushDevice(pushMessage).then(doneCallback, failCallback); + } +}); + +DeviceFactory.PushMessage = _dereq_(66); + +module.exports = DeviceFactory; + +},{"11":11,"66":66}],9:[function(_dereq_,module,exports){ +"use strict"; + +var Metadata = _dereq_(63); +var Lockable = _dereq_(61); + +/** + * @alias binding.Enhancer + */ + +var Enhancer = function () { + function Enhancer() { + babelHelpers.classCallCheck(this, Enhancer); + } + + /** + * @param {Class<*>} superClass + * @returns {Class<*>} typeConstructor + */ + Enhancer.prototype.createProxy = function createProxy(superClass) { + return function (_superClass) { + babelHelpers.inherits(Proxy, _superClass); + + function Proxy() { + babelHelpers.classCallCheck(this, Proxy); + return babelHelpers.possibleConstructorReturn(this, _superClass.apply(this, arguments)); + } + + return Proxy; + }(superClass); + }; + + /** + * @param {Class<*>} typeConstructor + * @returns {string} + */ + + + Enhancer.prototype.getIdentifier = function getIdentifier(typeConstructor) { + return typeConstructor.__d__; + }; + + /** + * @param {Class<*>} typeConstructor + * @param {string} identifier + */ + + + Enhancer.prototype.setIdentifier = function setIdentifier(typeConstructor, identifier) { + Object.defineProperty(typeConstructor, '__d__', { + value: identifier + }); + }; + + /** + * @param {metamodel.ManagedType} type + * @param {Class<*>} typeConstructor + */ + + + Enhancer.prototype.enhance = function enhance(type, typeConstructor) { + if (typeConstructor.__ype__ == type) return; + + if (typeConstructor.hasOwnProperty('__ype__')) throw new Error('Type is already used by a different manager'); + + Object.defineProperty(typeConstructor, '__ype__', { + value: type + }); + + this.setIdentifier(typeConstructor, type.ref); + this.enhancePrototype(typeConstructor.prototype, type); + }; + + /** + * Enhance the prototype of the type + * @param {Object} proto + * @param {metamodel.ManagedType} type + */ + + + Enhancer.prototype.enhancePrototype = function enhancePrototype(proto, type) { + if (proto.toString === Object.prototype.toString) { + // implements a better convenience toString method + Object.defineProperty(proto, 'toString', { + value: function toString() { + return this._metadata.id || this._metadata.bucket; + }, + enumerable: false + }); + } + + // enhance all persistent object properties + if (type.superType && type.superType.name == 'Object') { + for (var _iterator = type.superType.declaredAttributes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var attr = _ref; + + if (!attr.isMetadata) this.enhanceProperty(proto, attr); + } + } + + // enhance all persistent properties + for (var _iterator2 = type.declaredAttributes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _attr = _ref2; + + this.enhanceProperty(proto, _attr); + } + }; + + /** + * @param {Object} proto + * @param {metamodel.Attribute} attribute + */ + + + Enhancer.prototype.enhanceProperty = function enhanceProperty(proto, attribute) { + var name = '$' + attribute.name; + Object.defineProperty(proto, attribute.name, { + get: function get() { + var metadata = this._metadata; + metadata.readAccess(); + return metadata[name]; + }, + set: function set(value) { + var metadata = this._metadata; + metadata.writeAccess(); + metadata[name] = value; + }, + + configurable: true, + enumerable: true + }); + }; + + return Enhancer; +}(); + +module.exports = Enhancer; + +},{"61":61,"63":63}],10:[function(_dereq_,module,exports){ +"use strict"; + +var Managed = _dereq_(15); + +/** + * @alias binding.Entity + * @extends binding.Managed + */ + +var Entity = function (_Managed) { + babelHelpers.inherits(Entity, _Managed); + + /** + * The default constructor, copy all given properties to this object + * @param {Object=} properties - The optional properties to copy + */ + function Entity(properties) { + babelHelpers.classCallCheck(this, Entity); + return babelHelpers.possibleConstructorReturn(this, _Managed.call(this, properties)); + } + + return Entity; +}(Managed); + +Object.defineProperties(Entity.prototype, /** @lends binding.Entity.prototype */{ + /** + * The unique id of this object + * + * Sets the unique id of this object, if the id is not formatted as an valid id, + * it will be used as the key component of the id has the same affect as setting the key + * + * @type string + */ + id: { + get: function get() { + return this._metadata.id; + }, + set: function set(value) { + if (this._metadata.id) throw new Error('The id can\'t be set twice: ' + value); + + value += ''; + if (value.indexOf('/db/' + this._metadata.bucket + '/') == 0) { + this._metadata.id = value; + } else { + this.key = value; + } + }, + + enumerable: true + }, + + /** + * The unique key part of the id + * When the key of the unique id is set an error will be thrown if an id is already set. + * @type string + */ + key: { + get: function get() { + return this._metadata.key; + }, + set: function set(value) { + this._metadata.key = value; + } + }, + + /** + * The version of this object + * @type number + */ + version: { + get: function get() { + return this._metadata.version; + }, + + enumerable: true + }, + + /** + * The object read/write permissions + * @type Acl + */ + acl: { + get: function get() { + return this._metadata.acl; + }, + + enumerable: true + }, + + /** + * Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled + * @param {util.Lockable~callback=} doneCallback The callback which will be invoked when the previously + * operations on this object is completed. + * @return {Promise} A promise which completes successfully, when the previously requested + * operation completes + * @method + */ + ready: { + value: function ready(doneCallback) { + return this._metadata.ready(doneCallback); + } + }, + + /** + * Attach this object to the given db + * @param {EntityManager} db The db which will be used for future crud operations + * @method + */ + attach: { + value: function attach(db) { + db.attach(this); + } + }, + + /** + * Saves the object. Inserts the object if it doesn't exists and updates the object if the object exist. + * @param {Object} [options] The save options + * @param {boolean} [options.force=false] Force the save operation, the version will not be validated. + * @param {number|boolean} [options.depth=0] The object depth which will be saved. Depth 0 save this object only, + * true saves the objects by reachability. + * @param {boolean} [options.refresh=false] Refresh the local object state from remote. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + save: { + value: function save(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._metadata.db.save(this, options).then(doneCallback, failCallback); + } + }, + + /** + * Inserts a new object. Inserts the object if it doesn't exists and raise an error if the object already exist. + * @param {Object} [options] The insertion options + * @param {number|boolean} [options.depth=0] The object depth which will be inserted. Depth 0 insert this object only, + * true inserts objects by reachability. + * @param {boolean} [options.refresh=false] Refresh the local object state from remote. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + insert: { + value: function insert(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._metadata.db.insert(this, options).then(doneCallback, failCallback); + } + }, + + /** + * Updates an existing object. + * Updates the object if it exists and raise an error if the object doesn't exist. + * @param {Object} [options] The update options + * @param {boolean} [options.force=false] Force the update operation, the version will not be validated, only existence will be checked. + * @param {number|boolean} [options.depth=0] The object depth which will be updated. Depth 0 updates this object only, + * true updates objects by reachability. + * @param {boolean} [options.refresh=false] Refresh the local object state from remote. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + update: { + value: function update(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._metadata.db.update(this, options).then(doneCallback, failCallback); + } + }, + + /** + * Resolves the referenced object in the specified depth. Only unresolved objects will be loaded unless the refresh option is specified. + * Removed objects will be marked as removed. + * @param {Object} [options] The load options + * @param {number|boolean} [options.depth=0] The object depth which will be loaded. Depth set to true + * loads objects by reachability. + * @param {boolean} [options.refresh=false] Refresh the local object state from remote. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + load: { + value: function load(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + options = options || {}; + options.local = true; + + return this._metadata.db.load(this.id, null, options).then(doneCallback, failCallback); + } + }, + + /** + * Delete an existing object. + * @param {Object} [options] The remove options + * @param {boolean} [options.force=false] Force the remove operation, the version will not be validated. + * @param {number|boolean} [options.depth=0] The object depth which will be removed. Depth 0 removes this object only, + * true removes objects by reachability. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + 'delete': { + value: function value(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._metadata.db.delete(this, options).then(doneCallback, failCallback); + } + }, + + /** + * Saves the object and repeats the operation if the object is out of date. + * In each pass the callback will be called. Ths first parameter of the callback is the entity and the second one + * is a function to abort the process. + * + * @param {Function} cb Will be called in each pass + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + optimisticSave: { + value: function optimisticSave(cb, doneCallback, failCallback) { + return this._metadata.db.optimisticSave(this, cb).then(doneCallback, failCallback); + } + }, + + attr: { + value: function attr() { + throw new Error("Attr is not yet implemented."); + } + }, + + /** + * Validates the entity by using the validation code of the entity type + * + * @returns {util.ValidationResult} Contains the result of the Validation + * @method + */ + validate: { + value: function validate() { + return this._metadata.db.validate(this); + } + }, + + /** + * Converts the entity to an JSON-Object. + * @param {boolean=} excludeMetadata Indicates if the metadata i.e. id, version and acls should not be included into the json + * @return {json} JSON-Object + * @method + */ + toJSON: { + value: function toJSON(excludeMetadata) { + return this._metadata.getJson(excludeMetadata); + } + } +}); + +module.exports = Entity; + +/** + * The done callback is called, when the asynchronous operation completes successfully + * @callback binding.Entity~doneCallback + * @param {binding.Entity} entity This entity + * @return {Promise<*>|*} A Promise, result or undefined + */ + +/** + * The fail callback is called, when the asynchronous operation is rejected by an error + * @callback binding.Entity~failCallback + * @param {error.PersistentError} error The error which reject the operation + * @return {Promise<*>|*} A Promise, result or undefined + */ + +},{"15":15}],11:[function(_dereq_,module,exports){ +"use strict"; + +var ManagedFactory = _dereq_(16); + +/** + * @class binding.EntityFactory + * @extends binding.ManagedFactory + * + * @param {Object=} properties initial properties to set on the instance + * @param {...*} arguments Additional constructor params passed through the type constructor + * @return {T} The new managed instance + */ +var EntityFactory = ManagedFactory.extend( /** @lends binding.EntityFactory.prototype */{ + /** + * Loads the instance for the given id, or null if the id does not exists. + * @param {string} id The id to query + * @param {Object} [options] The load options + * @param {number|boolean} [options.depth=0] The object depth which will be saved. Depth 0 saves only this object, + * true saves the objects by reachability. + * @param {boolean} [options.refresh=false] Indicates whether the object should be revalidated (cache bypass). + * @param {boolean} [options.local=false] Indicates whether the local copy (from the entity manager) + * of an object should be returned if it exists. This value might be stale. + * @param {binding.EntityFactory~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.EntityFactory~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + */ + load: function load(id, options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._db.load(this._managedType.typeConstructor, id, options).then(doneCallback, failCallback); + }, + + + /** + * Creates a new instance and sets the DatabaseObject to the given json + * @param {json} json + * @returns {T} instance + */ + fromJSON: function fromJSON(json) { + var instance = json.id ? this._db.getReference(this._managedType.typeConstructor, json.id) : this.newInstance(); + var metadata = instance._metadata; + metadata.setJson(json); + return instance; + }, + + + /** + * Creates a new query for this class + * @return {query.Builder} The query builder + */ + find: function find() { + return this._db.createQueryBuilder(this._managedType.typeConstructor); + }, + partialUpdate: function partialUpdate() { + throw new Error("partialUpdate is not yet implemented."); + } + + /** + * Creates a new instance of the of this type + * @function + * @name new + * @param {Object} properties Additional properties which will be applied to the created instance + * @return {binding.Entity} A new created instance of this class + * @memberOf binding.EntityFactory.prototype + */ + +}); + +module.exports = EntityFactory; + +/** + * The entity callback is called, when the asynchronous operation completes successfully + * @callback binding.EntityFactory~doneCallback + * @param {T} entity The entity + * @return {Promise<*>|*} A Promise or result + */ + +/** + * The fail callback is called, when the asynchronous operation is rejected by an error + * @callback binding.EntityFactory~failCallback + * @param {error.PersistentError} error The error which reject the operation + * @return {Promise<*>|*} A Promise or result + */ + +},{"16":16}],12:[function(_dereq_,module,exports){ +"use strict"; + +/** + * This factory creates instances of type T, by invoking the {@link #new()} method or by instanciating this factory directly + * @class binding.Factory + * + * @param {...any} args constructor params passed to the type constructor + * @return {T} The new instance + */ + +var Factory = _extend( /** @lends binding.Factory.prototype */{ + + /** + * Creates a child factory of this factory + * @param {Object} factoryMembers additional members applied to the child factory + * @returns {Object} The new created child Factory + * @static + * @ignore + */ + extend: function extend(factoryMembers) { + //copy all factory members to the child factory + return _extend({}, this, factoryMembers); + }, + + + /** + * Creates a new Factory for the given type + * @param {Class<*>} type the type constructor of T + * @return {binding.Factory} A new object factory to created instances of T + * @static + * @ignore + */ + create: function create(type) { + var factory = function Factory(properties) { + return factory.newInstance(arguments); + }; + + _extend(factory, this); + + //lets instanceof work properly + factory.prototype = type.prototype; + factory._type = type; + + return factory; + }, + + + /** + * Creates a new instance of the factory type + * @param {...any} args Constructor arguments used for instantiation + * @return {*} A new created instance of * + * @instance + */ + new: function _new() { + return this.newInstance(arguments); + }, + + + /** + * Creates a new instance of the factory type + * @param {Array<*>=} a Constructor arguments used for instantiation + * @return {*} A new created instance of * + * @instance + */ + newInstance: function newInstance(a) { + var instance; + if (!a || a.length == 0) { + instance = new this._type(); + } else { + //es6 constructors can't be called, therfore we must provide all arguments separately + //TODO: uggly! replace this with the spread operator if node support it + instance = new this._type(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9]); + } + + return instance; + } +}); + +function _extend(target) { + for (var i = 1, source; source = arguments[i]; ++i) { + for (var _iterator = Object.getOwnPropertyNames(source), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var prop = _ref; + + Object.defineProperty(target, prop, Object.getOwnPropertyDescriptor(source, prop)); + } + }return target; +} + +module.exports = Factory; + +},{}],13:[function(_dereq_,module,exports){ +"use strict"; + +var error = _dereq_(34); +var Acl = _dereq_(1); +var util = _dereq_(71); +var message = _dereq_(36); +var StatusCode = _dereq_(25).StatusCode; + +var PREFIX = '/file'; +var LEN = PREFIX.length; + +/** + * Creates a file object, which represents one specific file reference. + * This File object can afterwards be used to up- and download the file contents or to retrieves and change the files + * metadata. + * + * The file data can be uploaded and downloaded as: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
typeJavaScript typeDescription
'arraybuffer'ArrayBufferThe content is represented as a fixed-length raw binary data buffer
'blob' + * BlobThe content is represented as a simple blob
'json'object|array|stringThe file content is represented as json
'text'stringThe file content is represented through the string
'base64'stringThe file content as base64 encoded string
'data-url'stringA data url which represents the file content
+ * + * + * @alias binding.File + */ + +var File = function () { + babelHelpers.createClass(File, [{ + key: 'id', + + + /** + * The complete id of the file, including folder and name + * @type string + */ + get: function get() { + return this._id; + } + + /** + * The fully url to the file, can be directly used to link the file, i.e. in link tags ot image sources + * @type string + */ + + }, { + key: 'url', + get: function get() { + if (this.isFolder) { + throw new Error("Url can not be created for folders."); + } + if (!this._url) { + this._url = this._db.createURL(this.id, this.bucket != 'www'); + } + return this._url; + } + + /** + * The name of the file + * @type string + */ + + }, { + key: 'name', + get: function get() { + if (!this._name) this._name = this._id.substring(this._id.lastIndexOf('/', this._id.length - 2) + 1); + return this._name; + } + + /** + * The mimeType of the file, only accessible after fetching the metadata or downloading/uploading/providing the file + * @type string + */ + + }, { + key: 'mimeType', + get: function get() { + if (this.isFolder) { + throw new Error("A folder has no mimeType"); + } + this._checkAvailable(); + return this._mimeType; + } + + /** + * The current file acl, only accessible after fetching the metadata or downloading/uploading/providing the file + * @type string + */ + + }, { + key: 'acl', + get: function get() { + this._checkAvailable(); + return this._acl; + } + + /** + * The last modified date of the file, only accessible after fetching the metadata or downloading/uploading/providing the eTag + * @type string + */ + + }, { + key: 'lastModified', + get: function get() { + if (this.isFolder) { + throw new Error("A folder has no lastModified"); + } + this._checkAvailable(); + return this._lastModified; + } + + /** + * The eTag of the file, only accessible after fetching the metadata or downloading/uploading/providing the file + * @type string + */ + + }, { + key: 'eTag', + get: function get() { + if (this.isFolder) { + throw new Error("A folder has no eTag"); + } + this._checkAvailable(); + return this._eTag; + } + + /** + * The size of the file, only accessible after fetching the metadata or downloading/uploading/providing the file + * @type string + */ + + }, { + key: 'size', + get: function get() { + if (this.isFolder) { + throw new Error("A folder has no size"); + } + this._checkAvailable(); + return this._size; + } + }, { + key: 'bucket', + get: function get() { + return this.id.substring(LEN + 1, this.id.indexOf('/', LEN + 1)); + } + }, { + key: 'key', + get: function get() { + return this.id.substring(this.id.indexOf('/', LEN + 1) + 1); + } + + /** + * The full path of the file. + * @type string + */ + + }, { + key: 'path', + get: function get() { + return this.id.substring(LEN); + } + + /** + * The parent folder of the file. + * @type string + */ + + }, { + key: 'parent', + get: function get() { + return this.id.substring(LEN, this.id.lastIndexOf('/', this.id.length - 2)); + } + + /** + * Indicates if the metadata are loaded. + * @type boolean + */ + + }, { + key: 'isMetadataLoaded', + get: function get() { + return this._available; + } + + /** + * Creates a new file object which represents the a file at the given id. Data are provided to the constructor will + * be uploaded by invoking {@link upload()} + * @param {object|string} fileOptions The fileOptions used to create a new file object, or just the id of the + * file object + * @param {string=} fileOptions.id The id of the file. + * @param {string=} fileOptions.name The filename without the id. If omitted and data is provided as a file object, the + * {@link File#name} will be used otherwise a uuid will be generated. + * @param {string} [fileOptions.parent="/www"] The parent folder which contains the file + * @param {string} [fileOptions.path="/www"] The full path of the file. You might either specifiy the path of the file or a combination of parent and file name. + * @param {string|Blob|File|ArrayBuffer|json=} fileOptions.data The initial file content, which will be uploaded by + * invoking {@link #upload} later on. + * @param {string=} fileOptions.type A optional type hint used to correctly interpret the provided data + * @param {string=} fileOptions.mimeType The mimType of the file. Defaults to the mimeType of the provided data if + * it is a file object, blob or data-url + * @param {string=} fileOptions.eTag The optional current ETag of the file + * @param {string=} fileOptions.lastModified The optional last modified date + * @param {Acl=} fileOptions.acl The file acl which will be set, if the file is uploaded afterwards + */ + + }]); + + function File(fileOptions) { + babelHelpers.classCallCheck(this, File); + + fileOptions = fileOptions || {}; + + this._available = false; + + if (Object(fileOptions) instanceof String) { + var id = fileOptions; + var nameSeparator = id.indexOf('/', '/file/'.length); + if (nameSeparator == -1 || id.indexOf('/file/') != 0) { + throw new Error('Invalid file reference ' + id); + } + + this._id = id; + } else if (fileOptions.id) { + this._id = fileOptions.id; + this._setMetadata(fileOptions); + } else { + var path = void 0; + if (fileOptions.path) { + path = fileOptions.path; + } else { + var parent = fileOptions.parent || '/www'; + if (parent.charAt(parent.length - 1) != '/') parent = parent + '/'; + + if (parent.length < 3) { + throw new Error('Invalid parent name: ' + parent); + } + + var name = fileOptions.name || fileOptions.data && fileOptions.data.name || util.uuid(); + path = parent + name; + } + + if (path.charAt(0) != '/') path = '/' + path; + + if (path.indexOf('//') != -1 || path.length < 3) throw new Error('Invalid path: ' + path); + + this._id = PREFIX + path; + this._setMetadata(fileOptions); + } + + /** + * Specifies whether this file is a folder. + * @type {boolean} + */ + this.isFolder = this._id.charAt(this._id.length - 1) == '/'; + } + + /** + * Uploads the file content which was provided in the constructor or by uploadOptions.data + * @param {object=} uploadOptions The upload options + * @param {string|Blob|File|ArrayBuffer|json=} uploadOptions.data The initial file content, which will be uploaded by + * invoking {@link #upload} later on. + * @param {string=} uploadOptions.type A optional type hint used to correctly interpret the provided data + * @param {string=} uploadOptions.mimeType The mimType of the file. Defaults to the mimeType of the provided data if + * it is a file object, blob or data-url + * @param {string=} uploadOptions.eTag The optional current ETag of the file + * @param {string=} uploadOptions.lastModified The optional last modified date + * @param {Acl=} uploadOptions.acl The file acl which will be set, if the file is uploaded afterwards + * @param {boolean} [uploadOptions.force=false] force the upload and overwrite any existing files without validating it + * @param {connector.Message~progressCallback} [uploadOptions.progress] listen to progress changes during upload + * @param {binding.File~fileCallback=} doneCallback The callback is invoked after the upload succeed successfully + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error is occurred + * @return {Promise} A promise which will be fulfilled with this file object where the metadata is updated + */ + + + File.prototype.upload = function upload(uploadOptions, doneCallback, failCallback) { + var _this = this; + + uploadOptions = uploadOptions || {}; + + if (this.isFolder) { + throw new Error("A folder cannot be uploaded"); + } + + this._setMetadata(uploadOptions); + + var uploadMessage = new message.UploadFile(this.bucket, this.key).entity(this._data, this._type).acl(this._acl); + + uploadMessage.progress(uploadOptions.progress); + + if (this._size) { + uploadMessage.contentLength(this._size); + } + + if (this._mimeType) { + uploadMessage.mimeType(this._mimeType); + } + + this._conditional(uploadMessage, uploadOptions); + + this._db.addToBlackList(this.id); + return this._db.send(uploadMessage).then(function (response) { + _this._data = null; + _this._type = null; + + _this.fromJSON(response.entity); + return _this; + }).then(doneCallback, failCallback); + }; + + /** + * Download a file and providing it in the requested type + * @param {object=} downloadOptions The download options + * @param {string} [downloadOptions.type="blob"] The type used to provide the file + * @param {string} [downloadOptions.refresh=false] Indicates to make a revalidation request and not use the cache + * @param {binding.File~downloadCallback=} doneCallback The callback is invoked after the download succeed successfully + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error is occurred + * @return {Promise} A promise which will be fulfilled with the downloaded file content + */ + + + File.prototype.download = function download(downloadOptions, doneCallback, failCallback) { + var _this2 = this; + + downloadOptions = downloadOptions || {}; + + if (this.isFolder) { + throw new Error("A folder cannot be downloaded"); + } + + var type = downloadOptions.type || 'blob'; + + var downloadMessage = new message.DownloadFile(this.bucket, this.key).responseType(type); + + this._db.ensureCacheHeader(this.id, downloadMessage, downloadOptions.refresh); + + return this._db.send(downloadMessage).then(function (response) { + _this2._db.addToWhiteList(_this2.id); + _this2._fromHeaders(response.headers); + return response.entity; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + return null; + } else { + throw e; + } + }).then(doneCallback, failCallback); + }; + + /** + * Deletes a file + * @param {object=} deleteOptions The delete options + * @param {boolean} [deleteOptions.force=false] force the deletion without verifying any version + * @param {binding.File~deleteCallback=} doneCallback The callback is invoked after the deletion succeed successfully + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error is occurred + * @return {Promise} A promise which will be fulfilled with this file object + */ + + + File.prototype.delete = function _delete(deleteOptions, doneCallback, failCallback) { + deleteOptions = deleteOptions || {}; + + if (this.isFolder) { + throw new Error("A folder cannot be deleted"); + } + + var deleteMessage = new message.DeleteFile(this.bucket, this.key); + this._conditional(deleteMessage, deleteOptions); + + this._db.addToBlackList(this.id); + return this._db.send(deleteMessage).then(function () { + return this; + }).then(doneCallback, failCallback); + }; + + File.prototype._conditional = function _conditional(message, options) { + if (!options.force) { + if (this._lastModified) message.ifUnmodifiedSince(this._lastModified); + if (this._eTag) message.ifMatch(this._eTag); + if (!this._lastModified && !this._eTag) message.ifNoneMatch('*'); + } + }; + + /** + * Gets the file metadata of a file + * @param {Object} options The load metadata options + * @param {Object} [options.refresh=false] Force a revalidation while fetching the metadata + * @param {binding.File~fileCallback=} doneCallback The callback is invoked after the metadata is fetched + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise} A promise which will be fulfilled with this file + */ + + + File.prototype.loadMetadata = function loadMetadata(options, doneCallback, failCallback) { + var _this3 = this; + + options = options || {}; + + if (this.isFolder) { + throw new Error("A folder has no matadata"); + } + + var msg = new message.GetFileMetadata(this.bucket, this.key); + this._db.ensureCacheHeader(this.id, msg, options.refresh); + return this._db.send(msg).then(function (response) { + // do not white list the file, because head-request does not revalidate the cache. + _this3._fromHeaders(response.headers); + return _this3; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + return null; + } else { + throw e; + } + }).then(doneCallback, failCallback); + }; + + /** + * Updates the matadata of this file. + * @param {boolean} [options.force=false] force the update and overwrite the existing metadata without validating it + * @return {Promise} A promise which will be fulfilled with this file + */ + + + File.prototype.saveMetadata = function saveMetadata(options, doneCallback, failCallback) { + var _this4 = this; + + options = options || {}; + + var metadata = this.toJSON(); + metadata.id = this._id; + + var msg = new message.UpdateFileMetadata(this.bucket, this.key).entity(metadata); + + this._conditional(msg, options); + + return this._db.send(msg).then(function (response) { + _this4.fromJSON(response); + return _this4; + }); + }; + + /** + * Validates and sets the file metadata based on the given options + * @param {Object} options + * @private + */ + + + File.prototype._setMetadata = function _setMetadata(options) { + var data = options.data; + var type = options.type; + var eTag = options.eTag; + var acl = options.acl; + var size = options.size; + var mimeType = options.mimeType; + var lastModified = options.lastModified; + + if (!data) { + this._available = false; + } else { + if (typeof Blob !== "undefined" && data instanceof Blob) { + mimeType = mimeType || data.type; + } else if (type == 'data-url') { + var match = data.match(/^data:(.+?)(;base64)?,.*$/); + mimeType = mimeType || match[1]; + } + + this._data = data; + this._type = type; + this._size = size; + + this._mimeType = mimeType; + this._acl = acl || this._acl || new Acl(); + this._available = true; + } + + this._eTag = eTag || this._eTag; + + if (lastModified) { + this._lastModified = new Date(lastModified); + } + }; + + File.prototype._fromHeaders = function _fromHeaders(headers) { + this.fromJSON({ + eTag: headers.etag ? headers.etag.substring(1, headers.etag.length - 1) : null, + lastModified: headers['last-modified'], + mimeType: headers['content-type'], + acl: headers['baqend-acl'] && JSON.parse(headers['baqend-acl']), + contentLength: +headers['baqend-size'] + }); + }; + + File.prototype.fromJSON = function fromJSON(metadata) { + if (metadata.mimeType) this._mimeType = metadata.mimeType; + + if (metadata.lastModified) this._lastModified = new Date(metadata.lastModified); + + if (metadata.eTag) this._eTag = metadata.eTag; + + this._acl = this._acl || new Acl(); + if (metadata.acl) this._acl.fromJSON(metadata.acl); + + if (metadata.contentLength) this._size = metadata.contentLength; + + this._available = true; + }; + + File.prototype.toJSON = function toJSON() { + var result = { + mimeType: this._mimeType, + eTag: this._eTag, + acl: this._acl, + contentLength: this._size + }; + + if (this._lastModified) { + result.lastModified = this._lastModified.toISOString(); + } + return result; + }; + + File.prototype._checkAvailable = function _checkAvailable() { + if (!this._available) { + throw new error.PersistentError('The file metadata of ' + this.id + ' is not available.'); + } + }; + + /** + * The database connection to use + * @member {EntityManager} _db + * @private + */ + + + return File; +}(); + +/** + * The file callback is called, when the asynchronous operation completes successfully + * @callback binding.File~fileCallback + * @param {binding.File} file The updated file metadata + * @return {any} A Promise, result or undefined + */ + +/** + * The download callback is called, when the asynchronous download completes successfully + * @callback binding.File~downloadCallback + * @param {string|Blob|File|ArrayBuffer|json} data The download file content in the requested format + * @return {any} A Promise, result or undefined + */ + +/** + * The delete callback is called, when the asynchronous deletion completes successfully + * @callback binding.File~deleteCallback + * @param {binding.File} data The file metadata + * @return {any} A Promise, result or undefined + */ + +/** + * The fail callback is called, when the asynchronous operation is rejected by an error + * @callback binding.File~failCallback + * @param {error.PersistentError} error The error which reject the operation + * @return {any} A Promise, result or undefined + */ + +module.exports = File; + +},{"1":1,"25":25,"34":34,"36":36,"71":71}],14:[function(_dereq_,module,exports){ +"use strict"; + +var Factory = _dereq_(12); +var File = _dereq_(13); +var message = _dereq_(36); +var Permission = _dereq_(65); + +/** + * @class binding.FileFactory + * @extends binding.Factory + * + * @param {Object=} properties initial properties to set on the file + * @param {...*} arguments Additional constructor params passed through the type constructor + * @return {binding.File} The new managed instance + */ +var FileFactory = Factory.extend( /** @lends binding.FileFactory.prototype */{ + + /** + * Creates a new FileFactory for the given type + * @param {EntityManager} db + * @return {binding.FileFactory} A new file factory + * @static + */ + create: function create(db) { + //invoke super method + var factory = Factory.create.call(this, File); + factory._db = db; + return factory; + }, + + + /** + * Creates a new file + * @param {Array<*>=} args Constructor arguments used for instantiation, the constructor will not be called + * when no arguments are passed + * @return {binding.File} A new created file + */ + newInstance: function newInstance(args) { + var instance = Factory.newInstance.call(this, args); + instance._db = this._db; + return instance; + }, + + + /** + * Updates the metadata of the root file directory formally the file "bucket" + * @param {string} bucket The name of the root file directory + * @param {Object} metadata The new metadata for the bucket + * @param {util.Permission} metadata.loadPermission The load permission which grants read access to all stored + * files under the specified bucket + * @param {util.Permission} metadata.insertPermission The insert permission which is required to insert new + * files into the bucket + * @param {util.Permission} metadata.updatePermission The update permission which is required to update existing + * files within the bucket + * @param {util.Permission} metadata.deletePermission The delete permission which is required to delete existing + * files within the bucket + * @param {util.Permission} metadata.queryPermission The query permission which is required to list all files + * within a bucket + * @param {binding.FileFactory~bucketMetadataCallback=} doneCallback Invoked if the operation succeeds + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise} A promise which will fulfilled with the updated metadata + */ + saveMetadata: function saveMetadata(bucket, metadata, doneCallback, failCallback) { + var msg = new message.SetFileBucketMetadata(bucket, metadata); + return this._db.send(msg).then(doneCallback, failCallback); + }, + + + /** + * Gets the metadata of the root folder (formally the file "bucket") + * @param {string} bucket The name of the root file directory + * @param {Object} options The load metadata options + * @param {Object} [options.refresh=false] Force a revalidation while fetching the metadata + * @param {binding.FileFactory~bucketMetadataCallback=} doneCallback The callback is invoked after the metadata is fetched + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise} A promise which will be fulfilled with the bucket acls + */ + loadMetadata: function loadMetadata(bucket, options, doneCallback, failCallback) { + options = options || {}; + + var msg = new message.GetFileBucketMetadata(bucket); + // this._db.ensureCacheHeader(this.id, msg, options.refresh); + // do not white list the file, because head-request does not revalidate the cache. + return this._db.send(msg).then(function (response) { + var result = {}; + Permission.BASE_PERMISSIONS.forEach(function (key) { + result[key] = Permission.fromJSON(response.entity[key] || {}); + }); + return result; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + return null; + } else { + throw e; + } + }).then(doneCallback, failCallback); + }, + + + /** + * Lists all the buckets. + * @param {binding.FileFactory~fileListCallback=} doneCallback The callback is invoked with the listed buckets + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise>} The listed buckets. + */ + listBuckets: function listBuckets(doneCallback, failCallback) { + var _this = this; + + return this._db.send(new message.ListBuckets()).then(function (response) { + return response.entity.map(function (bucket) { + return _this.new(bucket + '/'); + }); + }).then(doneCallback, failCallback); + }, + + + /** + * Lists the files (and folders) in the given folder. + * + * @param {binding.File|string} folder The folder/path to list. + * @param {binding.File} start The file/folder from where to start listing (not included) + * @param {number} count The maximum number of files to return. + * @param {binding.FileFactory~fileListCallback=} doneCallback The callback is invoked with the listed files + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise>} The listed files/folders. + */ + listFiles: function listFiles(folder, start, count, doneCallback, failCallback) { + var _this2 = this; + + if (Object(folder) instanceof String) { + if (folder.charAt(folder.length - 1) != '/') { + folder += '/'; + } + folder = this.new({ path: folder }); + } + + var path = folder.key; + var bucket = folder.bucket; + start = start ? start.key : null; + return this._db.send(new message.ListFiles(bucket, path, start, count)).then(function (response) { + return response.entity.map(function (file) { + return _this2.new(file); + }); + }).then(doneCallback, failCallback); + } + + /** + * Creates a new file object which represents the a file at the given id. Data are provided to the constructor will + * be uploaded by invoking {@link upload()} + * @param {object|string} fileOptions The fileOptions used to create a new file object, or just the id of the + * file object + * @param {string=} fileOptions.name The filename without the id. If omitted and data is provided as a file object, the + * {@link File#name} will be used otherwise a uuid will be generated. + * @param {string} [fileOptions.parent="/www"] The parent folder which contains the file + * @param {string|Blob|File|ArrayBuffer|json=} fileOptions.data The initial file content, which will be uploaded by + * invoking {@link #upload} later on. + * @param {string=} fileOptions.type A optional type hint used to correctly interpret the provided data + * @param {string=} fileOptions.mimeType The mimType of the file. Defaults to the mimeType of the provided data if + * it is a file object, blob or data-url + * @param {string=} fileOptions.eTag The optional current ETag of the file + * @param {string=} fileOptions.lastModified The optional last modified date + * @param {Acl=} fileOptions.acl The file acl which will be set, if the file is uploaded afterwards + * @return {binding.File} A new file instance + * + * @function + * @name new + * @memberOf binding.FileFactory.prototype + */ + +}); + +/** + * The list files callback is called, with the bucket metadata + * @callback binding.FileFactory~bucketMetadataCallback + * @param {Array} bucketMetadata the bucket metadata + * @return {any} A Promise, result or undefined + */ + +/** + * The list files callback is called, with the loaded files + * @callback binding.FileFactory~fileListCallback + * @param {Array} files The listed files + * @return {any} A Promise, result or undefined + */ + +module.exports = FileFactory; + +},{"12":12,"13":13,"36":36,"65":65}],15:[function(_dereq_,module,exports){ +"use strict"; + +var Metadata = _dereq_(63); + +/** + * @alias binding.Managed + */ + +var Managed = function () { + + /** + * Initialize the given instance + * @param {binding.Managed} instance The managed instance to initialize + * @param {Object=} properties The optional properties to set on the instance + */ + Managed.init = function init(instance, properties) { + var type = instance.constructor.__ype__; + if (type) { + Object.defineProperty(instance, '_metadata', { + value: Metadata.create(type, instance), + configurable: true + }); + } + + if (properties) Object.assign(instance, properties); + }; + + /** + * Creates a subclass of this class + * @param {Class<*>} childClass + * @return {Class<*>} The extended child class + */ + + + Managed.extend = function extend(childClass) { + childClass.prototype = Object.create(this.prototype, { + constructor: { + value: childClass, + configurable: true, + writable: true + } + }); + childClass.extend = Managed.extend; + return childClass; + }; + + /** + * The default constructor, copy all given properties to this object + * @param {Object=} properties - The optional properties to copy + */ + + + function Managed(properties) { + babelHelpers.classCallCheck(this, Managed); + + Managed.init(this, properties); + } + + return Managed; +}(); + +Object.defineProperties(Managed.prototype, /** @lends binding.Managed.prototype */{ + /** + * Converts the managed object to an JSON-Object. + * @return {json} JSON-Object + * @method + */ + toJSON: { + value: function toJSON() { + return this._metadata.type.toJsonValue(this._metadata, this); + } + } +}); + +/** + * Contains the metadata of this managed object + * @type util.Metadata + * @name _metadata + * @memberOf binding.Managed + * @private + */ + +module.exports = Managed; + +},{"63":63}],16:[function(_dereq_,module,exports){ +"use strict"; + +var Factory = _dereq_(12); +var Managed = _dereq_(15); + +/** + * @class binding.ManagedFactory + * @extends binding.Factory + * + * @param {Object=} properties initial properties to set on the instance + * @param {...*} args Additional constructor params passed through the type constructor + * @return {T} The new managed instance + */ +var ManagedFactory = Factory.extend( /** @lends binding.ManagedFactory.prototype */{ + + /** + * Creates a new ManagedFactory for the given type + * @param {metamodel.ManagedType} managedType The metadata of type T + * @param {EntityManager} db + * @return {binding.ManagedFactory<*>} A new object factory to created instances of T + * @static + * @ignore + */ + create: function create(managedType, db) { + //invoke super method + var factory = Factory.create.call(this, managedType.typeConstructor); + factory.methods = factory.prototype; + + factory._managedType = managedType; + factory._db = db; + + return factory; + }, + + + /** + * Creates a new instance of the factory type + * @param {Array<*>=} args Constructor arguments used for instantiation, the constructor will not be called + * when no arguments are passed + * @return {T} A new created instance of T + */ + newInstance: function newInstance(args) { + var instance = args ? Factory.newInstance.call(this, args) : this._managedType.create(args); + instance._metadata.db = this._db; + return instance; + }, + + + /** + * Creates a new instance and sets the Managed Object to the given json + * @param {json} json + * @returns {T} instance + */ + fromJSON: function fromJSON(json) { + var instance = this.newInstance(); + var metadata = instance._metadata; + this._managedType.fromJsonValue(metadata, json, instance); + return instance; + }, + + + /** + * Adds methods to instances of this factories type + * @param {Object} methods The methods to add + */ + addMethods: function addMethods(methods) { + Object.assign(this.methods, methods); + }, + + + /** + * Add a method to instances of this factories type + * @param {string} name The method name to add + * @param {Function} fn The Method to add + */ + addMethod: function addMethod(name, fn) { + this.methods[name] = fn; + } + + /** + * Methods that are added to object instances + * This property is an alias for this factory type prototype + * @name methods + * @type {Object} + * @memberOf binding.ManagedFactory.prototype + */ + + /** + * The managed type of this factory + * @name _managedType + * @type metamodel.ManagedType + * @protected + * @memberOf binding.ManagedFactory.prototype + */ + + /** + * The owning EntityManager where this factory belongs to + * @name _db + * @type EntityManager + * @protected + * @memberOf binding.ManagedFactory.prototype + */ + + /** + * Creates a new instance of the of this type + * @function + * @name new + * @param {Object} properties Additional properties which will be applied to the created instance + * @return {T} A new created instance of this class + * @memberOf binding.ManagedFactory.prototype + */ + +}); + +module.exports = ManagedFactory; + +},{"12":12,"15":15}],17:[function(_dereq_,module,exports){ +"use strict"; + +var Entity = _dereq_(10); +var User = _dereq_(18); + +/** + * @alias binding.Role + * @extends binding.Entity + */ + +var Role = function (_Entity) { + babelHelpers.inherits(Role, _Entity); + + /** + * The default constructor, copy all given properties to this object + * @param {Object=} properties - The optional properties to copy + */ + function Role(properties) { + babelHelpers.classCallCheck(this, Role); + return babelHelpers.possibleConstructorReturn(this, _Entity.call(this, properties)); + } + + return Role; +}(Entity); + +Object.defineProperties(Role.prototype, /** @lends binding.Role.prototype */{ + /** + * Test if the given user has this role + * @return {boolean} true if the given user has this role, + * otherwise false + * @method + */ + hasUser: { + value: function hasUser(user) { + return this.users && this.users.has(user); + } + }, + + /** + * Add the given user to this role + * @param {model.User} user The user to add + * @method + */ + addUser: { + value: function addUser(user) { + if (user instanceof User) { + if (!this.users) this.users = new Set(); + + this.users.add(user); + } else { + throw new Error('Only user instances can be added to a role.'); + } + } + }, + + /** + * Remove the given user from this role + * @param {model.User} user The user to remove + * @method + */ + removeUser: { + value: function removeUser(user) { + if (user instanceof User) { + if (this.users) this.users.delete(user); + } else { + throw new Error('Only user instances can be removed from a role.'); + } + } + } + + /** + * A set of users which have this role + * @type Set + * @name users + * @memberOf binding.Role.prototype + */ + + /** + * The name of the role + * @type string + * @name name + * @memberOf binding.Role.prototype + */ +}); + +module.exports = Role; + +},{"10":10,"18":18}],18:[function(_dereq_,module,exports){ +"use strict"; + +var Entity = _dereq_(10); + +/** + * @alias binding.User + * @extends binding.Entity + */ + +var User = function (_Entity) { + babelHelpers.inherits(User, _Entity); + + /** + * The default constructor, copy all given properties to this object + * @param {Object=} properties - The optional properties to copy + */ + function User(properties) { + babelHelpers.classCallCheck(this, User); + return babelHelpers.possibleConstructorReturn(this, _Entity.call(this, properties)); + } + + return User; +}(Entity); + +Object.defineProperties(User.prototype, /** @lends binding.User.prototype */{ + + /** + * Change the password of the given user + * + * @param {string} currentPassword Current password of the user + * @param {string} password New password of the user + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * @method + */ + newPassword: { + value: function newPassword(currentPassword, password, doneCallback, failCallback) { + return this._metadata.db.newPassword(this.username, currentPassword, password).then(doneCallback, failCallback); + } + } + + /** + * The users username or email address + * @type string + * @name username + * @memberOf binding.User.prototype + */ + + /** + * Indicates if the user is currently inactive, which disallow user login + * @type boolean + * @name inactive + * @memberOf binding.User.prototype + */ +}); + +module.exports = User; + +},{"10":10}],19:[function(_dereq_,module,exports){ +"use strict"; + +var EntityFactory = _dereq_(11); + +/** + * @class binding.UserFactory + * @extends binding.EntityFactory + * + * Creates a new instance of the managed type of this factory + * @param {Object=} properties initial properties to set on the instance + * @param {...*} arguments Additional constructor params passed through the type constructor + * @return {model.User} The new managed instance + */ +var UserFactory = EntityFactory.extend( /** @lends binding.UserFactory.prototype */{ + /** + * The current logged in user, or null if the user is not logged in + * @type model.User + */ + get me() { + return this._db.me; + }, + + /** + * Register a new user with the given username and password, if the username is not used by an another user. + * @param {string|model.User} user The username as a string or a Object, which must contain the username. + * @param {string} password The password for the given user + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default logs the user in after a successful registration and keeps the user logged in over multiple sessions + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} The created user object, for the new registered user. + */ + register: function register(user, password, loginOption, doneCallback, failCallback) { + if (loginOption instanceof Function) { + failCallback = doneCallback; + doneCallback = loginOption; + loginOption = true; + } + + user = Object(user) instanceof String ? this.fromJSON({ username: user }) : user; + return this._db.register(user, password, loginOption === undefined ? true : loginOption).then(doneCallback, failCallback); + }, + + + /** + * Log in the user with the given username and password and starts a user session + * @param {string} username The username of the user + * @param {string} password The password of the user + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + */ + login: function login(username, password, loginOption, doneCallback, failCallback) { + if (loginOption instanceof Function) { + failCallback = doneCallback; + doneCallback = loginOption; + loginOption = true; + } + + return this._db.login(username, password, loginOption === undefined ? true : loginOption).then(doneCallback, failCallback); + }, + + + /** + * Log out the current logged in user and ends the active user session + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise<*>} + */ + logout: function logout(doneCallback, failCallback) { + return this._db.logout().then(doneCallback, failCallback); + }, + + + /** + * Change the password of the given user + * + * @param {string} username Username to identify the user + * @param {string} password Current password of the user + * @param {string} newPassword New password of the user + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + */ + newPassword: function newPassword(username, password, _newPassword, doneCallback, failCallback) { + return this._db.newPassword(username, password, _newPassword).then(doneCallback, failCallback); + } + + /** + * Prompts the user for the Google login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/google and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=585] defines the width of the popup window + * @param {number} [options.height=545] defines the height of the popup window + * @param {string} [options.scope="email"] the range of rights requested from the user + * @param {Object} [options.state={}] + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithGoogle + * @memberOf binding.UserFactory.prototype + */ + + /** + * Prompts the user for the Facebook login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/facebook and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=1140] defines the width of the popup window + * @param {number} [options.height=640] defines the height of the popup window + * @param {string} [options.scope="email"] the range of rights requested from the user + * @param {Object} [options.state={}] + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithFacebook + * @memberOf binding.UserFactory.prototype + */ + + /** + * Prompts the user for the GitHub login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/github and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=1040] defines the width of the popup window + * @param {number} [options.height=580] defines the height of the popup window + * @param {string} [options.scope="user:email"] the range of rights requested from the user + * @param {Object} [options.state={}] + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithGitHub + * @memberOf binding.UserFactory.prototype + */ + + /** + * Prompts the user for the Twitter login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/twitter and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=740] defines the width of the popup window + * @param {number} [options.height=730] defines the height of the popup window + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithTwitter + * @memberOf binding.UserFactory.prototype + */ + + /** + * Prompts the user for the LinkedIn login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/linkedin and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=630] defines the width of the popup window + * @param {number} [options.height=530] defines the height of the popup window + * @param {string} [options.scope=""] the range of rights requested from the user + * @param {Object} [options.state={}] + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithLinkedIn + * @memberOf binding.UserFactory.prototype + */ + + /** + * Creates a new user object + * @function + * @name new + * @param {Object} properties Additional properties which will be applied to the created instance + * @return {model.User} A new created user + * @memberOf binding.UserFactory.prototype + */ + +}); + +/** + * @alias binding.UserFactory.LoginOption + * @enum {number} + */ +UserFactory.LoginOption = { + /** + * Do not login the user after a successful registration + */ + NO_LOGIN: -1, + /** + * Login in after a successful registration and keep the token in a nonpermanent storage, i.e SessionStorage + */ + SESSION_LOGIN: 0, + /** + * Login in after a successful registration and keep the token in a persistent storage, i.e LocalStorage + */ + PERSIST_LOGIN: 1 +}; + +/** + * @alias binding.UserFactory.DefaultOptions + * @property {Object} oauth default properties + * @property {Object} oauth.google default oauth properties for Google + * @property {Object} oauth.facebook default oauth properties for Facebook + * @property {Object} oauth.github default oauth properties for GitHub + * @property {Object} oauth.twitter default oauth properties for Twitter + * @property {Object} oauth.linkedin default oauth properties for LinkedIn + */ +UserFactory.DefaultOptions = { + google: { + width: 585, + height: 545, + scope: 'email' + }, + facebook: { + width: 1140, + height: 640, + scope: 'email' + }, + github: { + width: 1040, + height: 580, + scope: 'user:email' + }, + twitter: { + width: 740, + height: 730 + }, + linkedin: { + width: 630, + height: 530, + scope: '' + } +}; + +["Google", "Facebook", "GitHub", "Twitter", "LinkedIn"].forEach(function (name) { + UserFactory["loginWith" + name] = function (clientID, options, doneCallback, failCallback) { + //noinspection JSPotentiallyInvalidUsageOfThis + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + options = Object.assign({}, UserFactory.DefaultOptions[name.toLowerCase()], options || {}); + + return this._db.loginWithOAuth(name, clientID, options).then(doneCallback, failCallback); + }; +}); + +module.exports = UserFactory; + +},{"11":11}],20:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace binding + */ + +exports.Accessor = _dereq_(7); +exports.Enhancer = _dereq_(9); +exports.Factory = _dereq_(12); +exports.ManagedFactory = _dereq_(16); +exports.EntityFactory = _dereq_(11); +exports.UserFactory = _dereq_(19); +exports.DeviceFactory = _dereq_(8); +exports.FileFactory = _dereq_(14); +exports.Managed = _dereq_(15); +exports.Entity = _dereq_(10); +exports.Role = _dereq_(17); +exports.User = _dereq_(18); +exports.File = _dereq_(13); + +},{"10":10,"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"7":7,"8":8,"9":9}],21:[function(_dereq_,module,exports){ +"use strict"; + +var atob = _dereq_(70).atob; + +/** + * @alias caching.BloomFilter + */ + +var BloomFilter = function () { + function BloomFilter(rawBF) { + babelHelpers.classCallCheck(this, BloomFilter); + + this.bytes = atob(rawBF.b); + this.bits = rawBF.m; + this.hashes = rawBF.h; + this.creation = new Date().getTime(); + } + + BloomFilter.prototype.contains = function contains(element) { + for (var _iterator = BloomFilter._getHashes(element, this.bits, this.hashes), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var hash = _ref; + + if (!this._isSet(hash)) { + return false; + } + } + return true; + }; + + BloomFilter.prototype._isSet = function _isSet(index) { + var pos = Math.floor(index / 8); + var bit = 1 << index % 8; + //Extract byte as int or NaN if out of range + var byte = this.bytes.charCodeAt(pos); + //Bit-wise AND should be non-zero (NaN always yields false) + return (byte & bit) != 0; + }; + + BloomFilter._getHashes = function _getHashes(element, bits, hashes) { + var hashValues = new Array(this.hashes); + var hash1 = BloomFilter._murmur3(0, element); + var hash2 = BloomFilter._murmur3(hash1, element); + for (var i = 0; i < hashes; i++) { + hashValues[i] = (hash1 + i * hash2) % bits; + } + return hashValues; + }; + + BloomFilter._murmur3 = function _murmur3(seed, key) { + var remainder, bytes, h1, h1b, c1, c2, k1, i; + remainder = key.length & 3; + bytes = key.length - remainder; + h1 = seed; + c1 = 0xcc9e2d51; + c2 = 0x1b873593; + i = 0; + + while (i < bytes) { + k1 = key.charCodeAt(i) & 0xff | (key.charCodeAt(++i) & 0xff) << 8 | (key.charCodeAt(++i) & 0xff) << 16 | (key.charCodeAt(++i) & 0xff) << 24; + ++i; + + k1 = (k1 & 0xffff) * c1 + (((k1 >>> 16) * c1 & 0xffff) << 16) & 0xffffffff; + k1 = k1 << 15 | k1 >>> 17; + k1 = (k1 & 0xffff) * c2 + (((k1 >>> 16) * c2 & 0xffff) << 16) & 0xffffffff; + + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1b = (h1 & 0xffff) * 5 + (((h1 >>> 16) * 5 & 0xffff) << 16) & 0xffffffff; + h1 = (h1b & 0xffff) + 0x6b64 + (((h1b >>> 16) + 0xe654 & 0xffff) << 16); + } + + k1 = 0; + + switch (remainder) { + case 3: + k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16; + case 2: + k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8; + case 1: + k1 ^= key.charCodeAt(i) & 0xff; + + k1 = (k1 & 0xffff) * c1 + (((k1 >>> 16) * c1 & 0xffff) << 16) & 0xffffffff; + k1 = k1 << 15 | k1 >>> 17; + k1 = (k1 & 0xffff) * c2 + (((k1 >>> 16) * c2 & 0xffff) << 16) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= key.length; + + h1 ^= h1 >>> 16; + h1 = (h1 & 0xffff) * 0x85ebca6b + (((h1 >>> 16) * 0x85ebca6b & 0xffff) << 16) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 & 0xffff) * 0xc2b2ae35 + (((h1 >>> 16) * 0xc2b2ae35 & 0xffff) << 16) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + return BloomFilter; +}(); + +module.exports = BloomFilter; + +},{"70":70}],22:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace caching + */ +exports.BloomFilter = _dereq_(21); + +},{"21":21}],23:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); +var message = _dereq_(36); + +/** + * @alias connector.Connector + */ + +var Connector = function () { + + /** + * @param {string} host or location + * @param {number=} port + * @param {boolean=} secure true for an secure connection + * @param {string=} basePath The basepath of the api + * @return {connector.Connector} + */ + Connector.create = function create(host, port, secure, basePath) { + if (typeof window !== 'undefined') { + if (!host) { + host = window.location.hostname; + port = Number(window.location.port); + } + + if (secure === undefined) { + secure = window.location.protocol == 'https:'; + } + } + + //ensure right type + secure = !!secure; + if (basePath === undefined) basePath = Connector.DEFAULT_BASE_PATH; + + if (host.indexOf('/') != -1) { + var matches = /^(https?):\/\/([^\/:]+|\[[^\]]+])(:(\d*))?(\/\w+)?\/?$/.exec(host); + if (matches) { + secure = matches[1] == 'https'; + host = matches[2].replace(/(\[|])/g, ''); + port = matches[4]; + basePath = matches[5] || ''; + } else { + throw new Error('The connection uri host ' + host + ' seems not to be valid'); + } + } else if (host != 'localhost' && /^[a-z0-9-]*$/.test(host)) { + //handle app names as hostname + host += secure ? Connector.SSL_DOMAIN : Connector.HTTP_DOMAIN; + } + + if (!port) port = secure ? 443 : 80; + + var url = Connector.toUri(host, port, secure, basePath); + var connection = this.connections[url]; + + if (!connection) { + for (var name in this.connectors) { + var connector = this.connectors[name]; + if (connector.isUsable && connector.isUsable(host, port, secure, basePath)) { + connection = new connector(host, port, secure, basePath); + break; + } + } + + if (!connection) throw new Error('No connector is usable for the requested connection.'); + + this.connections[url] = connection; + } + + return connection; + }; + + Connector.toUri = function toUri(host, port, secure, basePath) { + var uri = (secure ? 'https://' : 'http://') + (host.indexOf(':') != -1 ? '[' + host + ']' : host); + uri += secure && port != 443 || !secure && port != 80 ? ':' + port : ''; + uri += basePath; + return uri; + }; + + /** + * @param {string} host + * @param {number} port + * @param {boolean} secure + * @param {string} basePath + */ + + + function Connector(host, port, secure, basePath) { + babelHelpers.classCallCheck(this, Connector); + + this.host = host; + this.port = port; + this.secure = secure; + this.basePath = basePath; + + //the origin do not contains the basepath + this.origin = Connector.toUri(host, port, secure, ""); + } + + /** + * @param {connector.Message} message + * @returns {Promise} + */ + + + Connector.prototype.send = function send(message) { + var _this = this; + + if (message.request.method == 'OAUTH') { + message.addRedirectOrigin(this.origin + this.basePath); + } + + var response = { status: 0 }; + return new Promise(function (resolve) { + _this.prepareRequest(message); + _this.doSend(message, message.request, resolve); + }).then(function (res) { + return response = res; + }).then(function () { + return _this.prepareResponse(message, response); + }).then(function () { + message.doReceive(response); + return response; + }).catch(function (e) { + response.entity = null; + throw PersistentError.of(e); + }); + }; + + /** + * Handle the actual message send + * @param {connector.Message} message + * @param {Object} request + * @param {Function} receive + * @abstract + */ + + + Connector.prototype.doSend = function doSend(message, request, receive) {}; + + /** + * @param {connector.Message} message + */ + + + Connector.prototype.prepareRequest = function prepareRequest(message) { + var mimeType = message.mimeType(); + if (!mimeType) { + var type = message.request.type; + if (type == 'json') { + message.mimeType('application/json;charset=utf-8'); + } else if (type == 'text') { + message.mimeType('text/plain;charset=utf-8'); + } + } + + this.toFormat(message); + + var accept = void 0; + switch (message.responseType()) { + case 'json': + accept = 'application/json'; + break; + case 'text': + accept = 'text/*'; + break; + default: + accept = 'application/json,text/*;q=0.5,*/*;q=0.1'; + } + + if (!message.accept()) { + message.accept(accept); + } + + if (this.gzip) { + var ifNoneMatch = message.ifNoneMatch(); + if (ifNoneMatch && ifNoneMatch !== '""' && ifNoneMatch != '*') { + message.ifNoneMatch(ifNoneMatch.slice(0, -1) + '--gzip"'); + } + } + + if (message.request.path == '/connect') { + message.request.path = message.tokenStorage.signPath(this.basePath + message.request.path).substring(this.basePath.length); + if (message.cacheControl()) { + message.request.path += (message.tokenStorage.token ? '&' : '?') + 'BCB'; + } + } else if (message.tokenStorage) { + var token = message.tokenStorage.token; + if (token) { + message.header('authorization', 'BAT ' + token); + } + } + }; + + /** + * Convert the message entity to the sendable representation + * @param {connector.Message} message The message to send + * @protected + * @abstract + */ + + + Connector.prototype.toFormat = function toFormat(message) {}; + + /** + * @param {connector.Message} message + * @param {Object} response The received response headers and data + */ + + + Connector.prototype.prepareResponse = function prepareResponse(message, response) { + var _this2 = this; + + // IE9 returns status code 1223 instead of 204 + response.status = response.status == 1223 ? 204 : response.status; + + var type = void 0; + var headers = response.headers || {}; + var entity = response.entity; + + if (entity) { + type = message.responseType(); + if (!type || response.status >= 400) { + var contentType = headers['content-type'] || headers['Content-Type']; + if (contentType && contentType.indexOf("application/json") > -1) { + type = 'json'; + } + } + } + + if (headers.etag) { + headers.etag = headers.etag.replace('--gzip', ''); + } + + if (message.tokenStorage) { + var token = headers['baqend-authorization-token'] || headers['Baqend-Authorization-Token']; + if (token) { + message.tokenStorage.update(token); + } + } + + return new Promise(function (resolve) { + resolve(entity && _this2.fromFormat(response, entity, type)); + }).then(function (entity) { + response.entity = entity; + + if (message.request.path.indexOf('/connect') != -1 && entity) { + _this2.gzip = !!entity.gzip; + } + }, function (e) { + throw new Error('Response was not valid ' + type + ': ' + e.message); + }); + }; + + /** + * Convert received data to the requested response entity type + * @param {Object} response The response object + * @param {*} entity The received data + * @param {string} type The requested response format + * @protected + * @abstract + */ + + + Connector.prototype.fromFormat = function fromFormat(response, entity, type) {}; + + return Connector; +}(); + +Object.assign(Connector, /** @lends connector.Connector */{ + DEFAULT_BASE_PATH: '/v1', + HTTP_DOMAIN: '.app.baqend.com', + SSL_DOMAIN: '-bq.global.ssl.fastly.net', + + /** + * An array of all exposed response headers + * @type string[] + */ + RESPONSE_HEADERS: ['baqend-authorization-token', 'content-type', 'baqend-size', 'baqend-acl', 'etag', 'last-modified'], + + /** + * Array of all available connector implementations + * @type connector.Connector[] + */ + connectors: [], + + /** + * Array of all created connections + * @type Object + */ + connections: {}, + + /** + * The connector will detect if gzip is supports. + * Returns true if supported otherwise false. + * @returns {boolean} gzip + */ + gzip: false +}); + +module.exports = Connector; + +},{"32":32,"36":36}],24:[function(_dereq_,module,exports){ +"use strict"; + +var Connector = _dereq_(23); +var XMLHttpConnector = _dereq_(27); + +/** + * @alias connector.IFrameConnector + * @extends connector.XMLHttpConnector + */ + +var IFrameConnector = function (_XMLHttpConnector) { + babelHelpers.inherits(IFrameConnector, _XMLHttpConnector); + + /** + * Indicates if this connector implementation is usable for the given host and port + * @param {string} host + * @param {number} port + * @param {boolean} secure + * @returns {boolean} + */ + IFrameConnector.isUsable = function isUsable(host, port, secure) { + return typeof window != 'undefined'; + }; + + function IFrameConnector(host, port, secure, basePath) { + babelHelpers.classCallCheck(this, IFrameConnector); + + var _this = babelHelpers.possibleConstructorReturn(this, _XMLHttpConnector.call(this, host, port, secure, basePath)); + + _this.mid = 0; + _this.messages = {}; + _this.doReceive = _this.doReceive.bind(_this); + + addEventListener('message', _this.doReceive, false); + return _this; + } + + IFrameConnector.prototype.load = function load(path) { + this.iframe = document.createElement('iframe'); + this.iframe.src = this.origin + this.basePath + path; + this.iframe.setAttribute("style", IFrameConnector.style); + document.body.appendChild(this.iframe); + + this.queue = []; + this.iframe.addEventListener('load', this.onLoad.bind(this), false); + }; + + IFrameConnector.prototype.onLoad = function onLoad() { + var queue = this.queue; + + for (var i = 0; i < queue.length; ++i) { + this.postMessage(queue[i]); + } + + this.queue = null; + }; + + /** + * @inheritDoc + */ + + + IFrameConnector.prototype.doSend = function doSend(message, request, receive) { + var _this2 = this; + + //binary data will be send and received directly + if (message.isBinary) { + return _XMLHttpConnector.prototype.doSend.call(this, message, request, receive); + } + + if (!this.iframe) { + this.load(message.request.path); + } + + var msg = { + mid: ++this.mid, + method: request.method, + path: request.path, + headers: request.headers, + entity: request.entity, + responseHeaders: Connector.RESPONSE_HEADERS + }; + + this.messages[msg.mid] = receive; + + var strMsg = JSON.stringify(msg); + if (this.queue) { + this.queue.push(strMsg); + } else { + this.postMessage(strMsg); + } + + if (!this.connected) { + setTimeout(function () { + if (_this2.messages[msg.mid]) { + delete _this2.messages[msg.mid]; + receive({ + status: 0, + error: new Error('Connection refused.') + }); + } + }, 10000); + } + }; + + IFrameConnector.prototype.postMessage = function postMessage(msg) { + this.iframe.contentWindow.postMessage(msg, this.origin); + }; + + IFrameConnector.prototype.doReceive = function doReceive(event) { + if (event.origin !== this.origin || event.data[0] != '{') { + return; + } + + var msg = JSON.parse(event.data); + + var receive = this.messages[msg.mid]; + if (receive) { + delete this.messages[msg.mid]; + this.connected = true; + + receive({ + status: msg.status, + headers: msg.headers, + entity: msg.entity + }); + } + }; + + return IFrameConnector; +}(XMLHttpConnector); + +IFrameConnector.style = 'width:1px;height:1px;position:absolute;top:-10px;left:-10px;'; + +Connector.connectors.push(IFrameConnector); + +module.exports = IFrameConnector; + +},{"23":23,"27":27}],25:[function(_dereq_,module,exports){ +"use strict"; + +var CommunicationError = _dereq_(29); + +/** + * Checks whether the user uses google chrome. + */ +var isChrome = typeof window != 'undefined' && (!!window.chrome && /google/i.test(navigator.vendor) || /cros i686/i.test(window.navigator.platform)); + +/** + * @alias connector.Message + */ + +var Message = function () { + /** + * Creates a new message class with the given message specification + * @param {Object} specification + * @return {Class} + */ + Message.create = function create(specification) { + var parts = specification.path.split('?'); + var path = parts[0].split(/[:\*]\w*/); + + var query = []; + if (parts[1]) { + parts[1].split('&').forEach(function (arg) { + var part = arg.split('='); + query.push(part[0]); + }); + } + + specification.dynamic = specification.path.indexOf('*') != -1; + specification.path = path; + specification.query = query; + + return function (_Message) { + babelHelpers.inherits(_class, _Message); + + function _class() { + babelHelpers.classCallCheck(this, _class); + return babelHelpers.possibleConstructorReturn(this, _Message.apply(this, arguments)); + } + + babelHelpers.createClass(_class, [{ + key: 'spec', + get: function get() { + return specification; + } + }]); + return _class; + }(Message); + }; + + /** + * Creates a new message class with the given message specification and a full path + * @param {Object} specification + * @param {Object} members additional members applied to the created message + * @return {Class} + */ + + + Message.createExternal = function createExternal(specification, members) { + specification.path = [specification.path]; + + /** + * @ignore + */ + var cls = function (_Message2) { + babelHelpers.inherits(cls, _Message2); + + function cls() { + babelHelpers.classCallCheck(this, cls); + return babelHelpers.possibleConstructorReturn(this, _Message2.apply(this, arguments)); + } + + babelHelpers.createClass(cls, [{ + key: 'spec', + get: function get() { + return specification; + } + }]); + return cls; + }(Message); + + Object.assign(cls.prototype, members); + + return cls; + }; + + babelHelpers.createClass(Message, [{ + key: 'isBinary', + get: function get() { + return this.request.type in Message.BINARY || this._responseType in Message.BINARY; + } + + /** + * @param {string} arguments... The path arguments + */ + + }]); + + function Message() { + babelHelpers.classCallCheck(this, Message); + + /** @type boolean */ + this.withCredentials = false; + + /** @type util.TokenStorage */ + this.tokenStorage = null; + + /** @type connector.Message~progressCallback */ + this._progress = null; + + var args = arguments; + var index = 0; + var path = this.spec.path; + if (Object(path) instanceof Array) { + path = this.spec.path[0]; + var len = this.spec.path.length; + for (var i = 1; i < len; ++i) { + if (this.spec.dynamic && len - 1 == i) { + path += args[index].split('/').map(encodeURIComponent).join('/'); + index += 1; + } else { + path += encodeURIComponent(args[index++]) + this.spec.path[i]; + } + } + } + + var query = ""; + for (var _i = 0; _i < this.spec.query.length; ++_i) { + var arg = args[index++]; + if (arg !== undefined && arg !== null) { + query += query || ~path.indexOf("?") ? "&" : "?"; + query += this.spec.query[_i] + '=' + encodeURIComponent(arg); + } + } + + this.request = { + method: this.spec.method, + path: path + query, + entity: null, + headers: {} + }; + + if (args[index]) { + this.entity(args[index], 'json'); + } + + this.responseType('json'); + } + + /** + * Get/Sets the value of a the specified request header + * @param {string} name The header name + * @param {string=} value The header value if omitted the value will be returned + * @return {connector.Message|string} This message object + */ + + + Message.prototype.header = function header(name, value) { + if (value !== undefined) { + this.request.headers[name] = value; + return this; + } else { + return this.request.headers[name]; + } + }; + + /** + * sets the entity type + * @param {any} data The data to send + * @param {string} [type="json"] the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json' + * @return {connector.Message} This message object + */ + + + Message.prototype.entity = function entity(data, type) { + if (!type) { + if (typeof data === 'string') { + if (/^data:(.+?)(;base64)?,.*$/.test(data)) { + type = 'data-url'; + } else { + type = 'text'; + } + } else if (typeof Blob != 'undefined' && data instanceof Blob) { + type = 'blob'; + } else if (typeof Buffer != 'undefined' && data instanceof Buffer) { + type = 'buffer'; + } else if (typeof ArrayBuffer != 'undefined' && data instanceof ArrayBuffer) { + type = 'arraybuffer'; + } else if (typeof FormData != 'undefined' && data instanceof FormData) { + type = 'form'; + } else { + type = 'json'; + } + } + + this.request.type = type; + this.request.entity = data; + return this; + }; + + /** + * Get/Sets the mimeType + * @param {string=} mimeType the mimeType of the data + * @return {connector.Message} This message object + */ + + + Message.prototype.mimeType = function mimeType(_mimeType) { + return this.header('content-type', _mimeType); + }; + + /** + * Get/Sets the contentLength + * @param {number=} contentLength the content length of the data + * @return {connector.Message} This message object + */ + + + Message.prototype.contentLength = function contentLength(_contentLength) { + return this.header('content-length', _contentLength); + }; + + /** + * Get/Sets the request conditional If-Match header + * @param {string=} eTag the If-Match ETag value + * @return {connector.Message} This message object + */ + + + Message.prototype.ifMatch = function ifMatch(eTag) { + return this.header('If-Match', this._formatETag(eTag)); + }; + + /** + * Get/Sets the request a ETag based conditional header + * @param {string=} eTag The ETag value + * @return {connector.Message} This message object + */ + + + Message.prototype.ifNoneMatch = function ifNoneMatch(eTag) { + return this.header('If-None-Match', this._formatETag(eTag)); + }; + + /** + * Get/Sets the request date based conditional header + * @param {Date=} date The date value + * @return {connector.Message} This message object + */ + + + Message.prototype.ifUnmodifiedSince = function ifUnmodifiedSince(date) { + //IE 10 returns UTC strings and not an RFC-1123 GMT date string + return this.header('if-unmodified-since', date && date.toUTCString().replace('UTC', 'GMT')); + }; + + /** + * Indicates that the request should not be served by a local cache + */ + + + Message.prototype.noCache = function noCache() { + if (!isChrome) { + this.ifMatch('') // is needed for firefox or safari (but forbidden for chrome) + .ifNoneMatch('-'); // is needed for edge and ie (but forbidden for chrome) + } + + return this.cacheControl('max-age=0, no-cache'); + }; + + /** + * Get/Sets the cache control header + * @param {string=} value The cache control flags + * @return {connector.Message} This message object + */ + + + Message.prototype.cacheControl = function cacheControl(value) { + return this.header('cache-control', value); + }; + + /** + * Get/Sets and encodes the acl of a file into the Baqend-Acl header + * @param {Acl=} acl the file acls + * @return {connector.Message} This message object + */ + + + Message.prototype.acl = function acl(_acl) { + return this.header('baqend-acl', _acl && JSON.stringify(_acl)); + }; + + /** + * Get/Sets the request accept header + * @param {string=} accept the accept header value + * @return {connector.Message} This message object + */ + + + Message.prototype.accept = function accept(_accept) { + return this.header('accept', _accept); + }; + + /** + * Get/Sets the response type which should be returned + * @param {string=} type The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json' + * @return {connector.Message} This message object + */ + + + Message.prototype.responseType = function responseType(type) { + if (type !== undefined) { + this._responseType = type; + return this; + } + + return this._responseType; + }; + + /** + * Get/Sets the progress callback + * @param {connector.Message~progressCallback} callback + * @return {connector.Message} This message object + */ + + + Message.prototype.progress = function progress(callback) { + if (callback !== undefined) { + this._progress = callback; + return this; + } + + return this._progress; + }; + + /** + * Adds the given String to the request path. + * If the parameter is an object the query string will be created. + * + * @param {string|Object} query which will added to the request path + */ + + + Message.prototype.addQueryString = function addQueryString(query) { + var _this3 = this; + + if (Object(query) instanceof String) { + this.request.path += query; + } else if (query) { + var sep = ~this.request.path.indexOf("?") ? "&" : "?"; + Object.keys(query).forEach(function (key, i) { + _this3.request.path += sep + key + "=" + encodeURIComponent(query[key]); + if (i == 0) { + sep = "&"; + } + }); + } + return this; + }; + + Message.prototype._formatETag = function _formatETag(eTag) { + if (eTag && eTag != '*') { + eTag = '' + eTag; + if (eTag.indexOf('"') == -1) eTag = '"' + eTag + '"'; + } + + return eTag; + }; + + /** + * Handle the receive + * @param {Object} response The received response headers and data + */ + + + Message.prototype.doReceive = function doReceive(response) { + if (this.spec.status.indexOf(response.status) == -1) { + throw new CommunicationError(this, response); + } + }; + + return Message; +}(); + +/** + * The message specification + * @name spec + * @memberOf connector.Message.prototype + * @type {Object} + */ + +Object.assign(Message, { + /** + * @alias connector.Message.StatusCode + * @enum {number} + */ + StatusCode: { + NOT_MODIFIED: 304, + BAD_CREDENTIALS: 460, + BUCKET_NOT_FOUND: 461, + INVALID_PERMISSION_MODIFICATION: 462, + INVALID_TYPE_VALUE: 463, + OBJECT_NOT_FOUND: 404, + OBJECT_OUT_OF_DATE: 412, + PERMISSION_DENIED: 466, + QUERY_DISPOSED: 467, + QUERY_NOT_SUPPORTED: 468, + SCHEMA_NOT_COMPATIBLE: 469, + SCHEMA_STILL_EXISTS: 470, + SYNTAX_ERROR: 471, + TRANSACTION_INACTIVE: 472, + TYPE_ALREADY_EXISTS: 473, + TYPE_STILL_REFERENCED: 474, + SCRIPT_ABORTION: 475 + }, + + BINARY: { + blob: true, + buffer: true, + stream: true, + arraybuffer: true, + 'data-url': true, + 'base64': true + }, + + GoogleOAuth: Message.createExternal({ + method: 'OAUTH', + path: 'https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=online', + query: ["client_id", "scope", "state"], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.addQueryString({ + redirect_uri: baseUri + '/db/User/OAuth/google' + }); + } + }), + + FacebookOAuth: Message.createExternal({ + method: 'OAUTH', + path: 'https://www.facebook.com/dialog/oauth?response_type=code', + query: ["client_id", "scope", "state"], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.addQueryString({ + redirect_uri: baseUri + '/db/User/OAuth/facebook' + }); + } + }), + + GitHubOAuth: Message.createExternal({ + method: 'OAUTH', + path: 'https://github.com/login/oauth/authorize?response_type=code&access_type=online', + query: ["client_id", "scope", "state"], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.addQueryString({ + redirect_uri: baseUri + '/db/User/OAuth/github' + }); + } + }), + + LinkedInOAuth: Message.createExternal({ + method: 'OAUTH', + path: 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&access_type=online', + query: ["client_id", "scope", "state"], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.addQueryString({ + redirect_uri: baseUri + '/db/User/OAuth/linkedin' + }); + } + }), + + TwitterOAuth: Message.createExternal({ + method: 'OAUTH', + path: '', + query: [], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.request.path = baseUri + '/db/User/OAuth1/twitter'; + } + }) +}); + +module.exports = Message; + +/** + * The progress callback is called, when you send a message to the server and a progress is noticed + * @callback connector.Message~progressCallback + * @param {ProgressEvent} event The Progress Event + * @return {*} unused + */ + +},{"29":29}],26:[function(_dereq_,module,exports){ +"use strict"; + +var Connector = _dereq_(23); +var PersistentError = _dereq_(32); +var http; +var https; +var stream; + +/** + * @alias connector.NodeConnector + * @extends connector.Connector + */ + +var NodeConnector = function (_Connector) { + babelHelpers.inherits(NodeConnector, _Connector); + + NodeConnector.isUsable = function isUsable(host, port, secure) { + if (!http) { + try { + http = _dereq_('http'); + https = _dereq_('https'); + stream = _dereq_('stream'); + } catch (e) {} + } + //prevent using when it is shimmed + return http && http.Server; + }; + + function NodeConnector(host, port, secure, basePath) { + babelHelpers.classCallCheck(this, NodeConnector); + + var _this = babelHelpers.possibleConstructorReturn(this, _Connector.call(this, host, port, secure, basePath)); + + _this.cookie = null; + _this.http = secure ? https : http; + return _this; + } + + /** + * @inheritDoc + */ + + + NodeConnector.prototype.doSend = function doSend(message, request, receive) { + var _this2 = this; + + request.host = this.host; + request.port = this.port; + request.path = this.basePath + request.path; + + var entity = request.entity; + var type = request.type; + var responseType = message.responseType(); + + if (this.cookie && message.withCredentials) request.headers['cookie'] = this.cookie; + + var req = this.http.request(request, function (res) { + var cookie = res.headers['set-cookie']; + if (cookie) { + // cookie may be an array, convert it to a string + _this2.cookie = _this2.parseCookie(cookie + ''); + } + + var status = res.statusCode; + if (status >= 400) { + responseType = 'json'; + } + + if (responseType == 'stream') { + receive({ + status: status, + headers: res.headers, + entity: res + }); + return; + } + + var binary = responseType && responseType != 'text' && responseType != 'json'; + var chunks = []; + if (!binary) { + res.setEncoding('utf-8'); + } + + res.on('data', function (chunk) { + chunks.push(chunk); + }); + + res.on('end', function () { + receive({ + status: status, + headers: res.headers, + entity: binary ? Buffer.concat(chunks) : chunks.join('') + }); + }); + }); + + req.on('error', function (e) { + receive({ + status: 0, + error: e + }); + }); + + if (type == 'stream') { + entity.pipe(req); + } else if (type == 'buffer') { + req.end(entity); + } else if (type) { + req.end(entity, 'utf8'); + } else { + req.end(); + } + }; + + /** + * Parse the cookie header + * @param {string} header + */ + + + NodeConnector.prototype.parseCookie = function parseCookie(header) { + var parts = header.split(';'); + + for (var i = 0, part; part = parts[i]; ++i) { + if (part.indexOf('Expires=') == 0) { + var date = Date.parse(part.substring(8)); + if (date < Date.now()) { + return null; + } + } + } + + return parts[0]; + }; + + /** + * @inheritDoc + */ + + + NodeConnector.prototype.toFormat = function toFormat(message) { + var type = message.request.type; + + if (type) { + var entity = message.request.entity; + var mimeType = message.mimeType(); + + switch (type) { + case 'stream': + if (!message.contentLength()) { + throw new PersistentError('You must specify a content length while making a stream based upload.'); + } + break; + case 'buffer': + break; + case 'arraybuffer': + type = 'buffer'; + entity = new Buffer(entity); + break; + case 'data-url': + var match = entity.match(/^data:(.+?)(;base64)?,(.*)$/); + var isBase64 = match[2]; + entity = match[3]; + + type = 'buffer'; + mimeType = mimeType || match[1]; + if (isBase64) { + entity = new Buffer(entity, 'base64'); + } else { + entity = new Buffer(decodeURIComponent(entity), 'utf8'); + } + + break; + case 'base64': + type = 'buffer'; + entity = new Buffer(entity, 'base64'); + break; + case 'json': + if (typeof entity != 'string') { + entity = JSON.stringify(entity); + } + break; + case 'text': + break; + default: + throw new Error('The request type ' + type + ' is not supported'); + } + + message.entity(entity, type).mimeType(mimeType); + } + }; + + /** + * @inheritDoc + */ + + + NodeConnector.prototype.fromFormat = function fromFormat(response, entity, type) { + if (type == 'json') { + entity = JSON.parse(entity); + } else if (type == 'data-url' || type == 'base64') { + entity = entity.toString('base64'); + + if (type == 'data-url') { + entity = 'data:' + response.headers['content-type'] + ';base64,' + entity; + } + } else if (type == 'arraybuffer') { + entity = entity.buffer.slice(entity.byteOffset, entity.byteOffset + entity.byteLength); + } + + return entity; + }; + + return NodeConnector; +}(Connector); + +Connector.connectors.push(NodeConnector); + +module.exports = NodeConnector; + +},{"23":23,"32":32,"undefined":undefined}],27:[function(_dereq_,module,exports){ +"use strict"; + +var Connector = _dereq_(23); + +/** + * @alias connector.XMLHttpConnector + * @extends connector.Connector + */ + +var XMLHttpConnector = function (_Connector) { + babelHelpers.inherits(XMLHttpConnector, _Connector); + + function XMLHttpConnector() { + babelHelpers.classCallCheck(this, XMLHttpConnector); + return babelHelpers.possibleConstructorReturn(this, _Connector.apply(this, arguments)); + } + + /** + * Indicates if this connector implementation is usable for the given host and port + * @param {string} host + * @param {number} port + * @param {boolean} secure + * @returns {boolean} + */ + XMLHttpConnector.isUsable = function isUsable(host, port, secure) { + if (typeof window == 'undefined') return false; + + var locationSecure = location.protocol == 'https:'; + var locationPort = location.port || (locationSecure ? 443 : 80); + + return location.hostname == host && locationPort == port && locationSecure == secure; + }; + + /** + * @inheritDoc + */ + + + XMLHttpConnector.prototype.doSend = function doSend(message, request, receive) { + var _this2 = this; + + if (request.method == 'OAUTH') { + if (this.oAuthHandle) this.oAuthHandle({ status: 409, entity: '{"message": "A new OAuth request was sent."}' }); + + localStorage.removeItem('oauth-response'); + + var handler = function handler(event) { + if (event.key == 'oauth-response') { + _this2.oAuthHandle(JSON.parse(event.newValue)); + } + }; + + this.oAuthHandle = function (msg) { + receive(msg); + localStorage.removeItem('oauth-response'); + removeEventListener("storage", handler, false); + }; + + addEventListener("storage", handler, false); + return; + } + + var xhr = new XMLHttpRequest(); + + var url = this.origin + this.basePath + request.path; + + xhr.onreadystatechange = function () { + //if we receive an error switch the response type to json + if (xhr.readyState == 2 && xhr.status >= 400) xhr.responseType = 'text'; + + if (xhr.readyState == 4) { + var response = { + headers: {}, + status: xhr.status, + entity: xhr.response || xhr.responseText + }; + + Connector.RESPONSE_HEADERS.forEach(function (name) { + response.headers[name] = xhr.getResponseHeader(name); + }); + + receive(response); + } + }; + + // Set the message progress callback + xhr.upload.onprogress = message.progress(); + + xhr.open(request.method, url, true); + + var entity = request.entity; + var headers = request.headers; + for (var name in headers) { + xhr.setRequestHeader(name, headers[name]); + }xhr.withCredentials = message.withCredentials; + + switch (message.responseType()) { + case 'arraybuffer': + xhr.responseType = 'arraybuffer'; + break; + case 'blob': + case 'data-url': + case 'base64': + xhr.responseType = 'blob'; + break; + } + + xhr.send(entity); + }; + + /** + * @inheritDoc + */ + + + XMLHttpConnector.prototype.fromFormat = function fromFormat(response, entity, type) { + if (type == 'json') { + entity = JSON.parse(entity); + } else if (type == 'data-url' || type == 'base64') { + var _ret = function () { + var reader = new FileReader(); + reader.readAsDataURL(entity); + + return { + v: new Promise(function (resolve, reject) { + reader.onload = resolve; + reader.onerror = reject; + }).then(function () { + var result = reader.result; + + if (type == 'base64') result = result.substring(result.indexOf(',') + 1); + + return result; + }) + }; + }(); + + if ((typeof _ret === 'undefined' ? 'undefined' : babelHelpers.typeof(_ret)) === "object") return _ret.v; + } + + return entity; + }; + + /** + * @inheritDoc + */ + + + XMLHttpConnector.prototype.toFormat = function toFormat(message) { + var type = message.request.type; + + if (type) { + var entity = message.request.entity; + var mimeType = message.mimeType(); + switch (type) { + case 'blob': + mimeType = mimeType || entity.type; + break; + case 'arraybuffer': + case 'form': + break; + case 'data-url': + var match = entity.match(/^data:(.+?)(;base64)?,(.*)$/); + var isBase64 = match[2]; + entity = match[3]; + + type = 'blob'; + mimeType = mimeType || match[1]; + if (!isBase64) { + entity = decodeURIComponent(entity); + break; + } + + //fallthrough + case 'base64': + var binaryStr = atob(entity), + len = binaryStr.length; + var array = new Uint8Array(len); + for (var i = 0; i < len; ++i) { + array[i] = binaryStr.charCodeAt(i); + } + type = 'blob'; + entity = new Blob([array], { type: mimeType }); + break; + case 'json': + if (typeof entity != 'string') { + entity = JSON.stringify(entity); + } + break; + case 'text': + break; + } + + message.entity(entity, type).mimeType(mimeType); + } + }; + + return XMLHttpConnector; +}(Connector); + +Connector.connectors.push(XMLHttpConnector); + +module.exports = XMLHttpConnector; + +},{"23":23}],28:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace connector + */ + +exports.Message = _dereq_(25); +exports.Connector = _dereq_(23); +exports.NodeConnector = _dereq_(26); +exports.XMLHttpConnector = _dereq_(27); +exports.IFrameConnector = _dereq_(24); + +},{"23":23,"24":24,"25":25,"26":26,"27":27}],29:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); + +/** + * @alias error.CommunicationError + * @extends error.PersistentError + */ + +var CommunicationError = function (_PersistentError) { + babelHelpers.inherits(CommunicationError, _PersistentError); + + /** + * @param {connector.Message} httpMessage The http message which was send + * @param {Object} response The received entity headers and content + */ + function CommunicationError(httpMessage, response) { + babelHelpers.classCallCheck(this, CommunicationError); + + var entity = response.entity || response.error || {}; + var state = response.status == 0 ? 'Request' : 'Response'; + var message = entity.message || 'Handling the ' + state + ' for ' + httpMessage.request.method + ' ' + httpMessage.request.path; + + var _this = babelHelpers.possibleConstructorReturn(this, _PersistentError.call(this, message, entity)); + + _this.name = entity.className || 'CommunicationError'; + _this.reason = entity.reason || 'Communication failed'; + _this.status = response.status; + + if (entity.data) _this.data = entity.data; + + var cause = entity; + while (cause && cause.stackTrace) { + _this.stack += '\nServerside Caused by: ' + cause.className + ' ' + cause.message; + + var stackTrace = cause.stackTrace; + for (var i = 0; i < stackTrace.length; ++i) { + var el = stackTrace[i]; + + _this.stack += '\n at ' + el.className + '.' + el.methodName; + _this.stack += ' (' + el.fileName + ':' + el.lineNumber + ')'; + } + + cause = cause.cause; + } + return _this; + } + + return CommunicationError; +}(PersistentError); + +module.exports = CommunicationError; + +},{"32":32}],30:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); + +/** + * @alias error.EntityExistsError + * @extends error.PersistentError + */ + +var EntityExistsError = function (_PersistentError) { + babelHelpers.inherits(EntityExistsError, _PersistentError); + + /** + * @param {string} entity + */ + function EntityExistsError(entity) { + babelHelpers.classCallCheck(this, EntityExistsError); + + var _this = babelHelpers.possibleConstructorReturn(this, _PersistentError.call(this, 'The entity ' + entity + ' is managed by a different db.')); + + _this.entity = entity; + return _this; + } + + return EntityExistsError; +}(PersistentError); + +module.exports = EntityExistsError; + +},{"32":32}],31:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); + +/** + * @alias error.IllegalEntityError + * @extends error.PersistentError + */ + +var IllegalEntityError = function (_PersistentError) { + babelHelpers.inherits(IllegalEntityError, _PersistentError); + + /** + * @param {binding.Entity} entity + */ + function IllegalEntityError(entity) { + babelHelpers.classCallCheck(this, IllegalEntityError); + + var _this = babelHelpers.possibleConstructorReturn(this, _PersistentError.call(this, 'Entity ' + entity + ' is not a valid entity')); + + _this.entity = entity; + return _this; + } + + return IllegalEntityError; +}(PersistentError); + +module.exports = IllegalEntityError; + +},{"32":32}],32:[function(_dereq_,module,exports){ +"use strict"; +/** + * @class error.PersistentError + * @extends Error + * + * @param {string} message + * @param {Error=} cause + */ + +//do not use class here, since we can't change the class prototype + +function PersistentError(message, cause) { + message = message ? message : 'An unexpected persistent error occured.'; + + if (Error.hasOwnProperty('captureStackTrace')) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack; + } + + this.message = message; + this.name = this.constructor.name; + + if (cause) { + this.cause = cause; + if (cause.stack) { + this.stack += '\nCaused By: ' + cause.stack; + } + } +} + +PersistentError.of = function of(error) { + if (error instanceof PersistentError) { + return error; + } else { + return new PersistentError(null, error); + } +}; + +//custom errors must be manually extended for babel, otherwise the super call destroys the origin 'this' reference +PersistentError.prototype = Object.create(Error.prototype, { + constructor: { + value: PersistentError, + enumerable: false, + configurable: true + } +}); + +module.exports = PersistentError; + +},{}],33:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); + +/** + * @alias error.RollbackError + * @extends error.PersistentError + */ + +var RollbackError = function (_PersistentError) { + babelHelpers.inherits(RollbackError, _PersistentError); + + /** + * @param {Error} cause + */ + function RollbackError(cause) { + babelHelpers.classCallCheck(this, RollbackError); + return babelHelpers.possibleConstructorReturn(this, _PersistentError.call(this, 'The transaction has been rollbacked', cause)); + } + + return RollbackError; +}(PersistentError); + +module.exports = RollbackError; + +},{"32":32}],34:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace error + */ + +exports.CommunicationError = _dereq_(29); +exports.IllegalEntityError = _dereq_(31); +exports.EntityExistsError = _dereq_(30); +exports.PersistentError = _dereq_(32); +exports.RollbackError = _dereq_(33); + +},{"29":29,"30":30,"31":31,"32":32,"33":33}],35:[function(_dereq_,module,exports){ +'use strict'; + +_dereq_(163); + +module.exports = _dereq_(6); + +},{"163":163,"6":6}],36:[function(_dereq_,module,exports){ +'use strict'; + +var Message = _dereq_(25); + +/** + * Get the list of all available subresources + * + * @class message.ListAllResources + * @extends connector.Message + * + */ +exports.ListAllResources = Message.create({ + method: 'GET', + path: '/', + status: [200] +}); + +/** + * Get the API version of the Orestes-Server + * + * @class message.ApiVersion + * @extends connector.Message + * + */ +exports.ApiVersion = Message.create({ + method: 'GET', + path: '/version', + status: [200] +}); + +/** + * Gets the event Endpoint + * + * @class message.Events + * @extends connector.Message + * + */ +exports.EventsUrl = Message.create({ + method: 'GET', + path: '/events-url', + status: [200] +}); + +/** + * The Swagger specification of the Orestes-Server + * + * @class message.Specification + * @extends connector.Message + * + */ +exports.Specification = Message.create({ + method: 'GET', + path: '/spec', + status: [200] +}); + +/** + * Returns all changed objects + * + * @class message.GetBloomFilter + * @extends connector.Message + * + */ +exports.GetBloomFilter = Message.create({ + method: 'GET', + path: '/bloomfilter', + status: [200] +}); + +/** + * Get the current Orestes config + * + * @class message.GetOrestesConfig + * @extends connector.Message + * + */ +exports.GetOrestesConfig = Message.create({ + method: 'GET', + path: '/config', + status: [200] +}); + +/** + * Updates the current Orestes config + * + * @class message.UpdateOrestesConfig + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.UpdateOrestesConfig = Message.create({ + method: 'PUT', + path: '/config', + status: [200, 202] +}); + +/** + * Connects a browser to this server + * + * @class message.Connect + * @extends connector.Message + * + */ +exports.Connect = Message.create({ + method: 'GET', + path: '/connect', + status: [200] +}); + +/** + * Gets the status of the server health + * + * @class message.Status + * @extends connector.Message + * + */ +exports.Status = Message.create({ + method: 'GET', + path: '/status', + status: [200] +}); + +/** + * Determines whether the IP has exceeded its rate limit + * + * @class message.BannedIp + * @extends connector.Message + * + * @param ip {Object} The ip to test + */ +exports.BannedIp = Message.create({ + method: 'GET', + path: '/banned/:ip', + status: [204] +}); + +/** + * Always returns banned status for proper CDN handling + * + * @class message.Banned + * @extends connector.Message + * + */ +exports.Banned = Message.create({ + method: 'GET', + path: '/banned', + status: [] +}); + +/** + * Clears all rate-limiting information for all IPs + * + * @class message.Unban + * @extends connector.Message + * + */ +exports.Unban = Message.create({ + method: 'DELETE', + path: '/banned', + status: [204] +}); + +/** + * Clears rate-limiting information for given IPs + * + * @class message.UnbanIp + * @extends connector.Message + * + * @param ip {Object} The ip to reset + */ +exports.UnbanIp = Message.create({ + method: 'DELETE', + path: '/banned/:ip', + status: [204] +}); + +/** + * List all available bucket names + * List all bucket + * + * @class message.GetBucketNames + * @extends connector.Message + * + */ +exports.GetBucketNames = Message.create({ + method: 'GET', + path: '/db', + status: [200] +}); + +/** + * List all bucket objects + * List all object ids of the bucket + * + * @class message.GetBucketIds + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param start {Object} The offset to skip + * @param count {Object} The upper limit to return + */ +exports.GetBucketIds = Message.create({ + method: 'GET', + path: '/db/:bucket/ids?start=0&count=-1', + status: [200] +}); + +/** + * Dumps all objects of the bucket + * Exports the complete Bucket content + * + * @class message.ExportBucket + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.ExportBucket = Message.create({ + method: 'GET', + path: '/db/:bucket', + status: [200] +}); + +/** + * Upload all objects to the bucket + * Imports the complete Bucket content + * + * @class message.ImportBucket + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.ImportBucket = Message.create({ + method: 'PUT', + path: '/db/:bucket', + status: [200] +}); + +/** + * Deletes all objects of the bucket + * Deletes all objects of the bucket + * + * @class message.TruncateBucket + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.TruncateBucket = Message.create({ + method: 'DELETE', + path: '/db/:bucket', + status: [200] +}); + +/** + * Create object + * Create the given Object. + * The object will be created and gets a unique oid. + * + * @class message.CreateObject + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.CreateObject = Message.create({ + method: 'POST', + path: '/db/:bucket', + status: [201, 202] +}); + +/** + * Get object + * Returns the specified object. Each object has one unique identifier and therefore only one location. + * + * @class message.GetObject + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + */ +exports.GetObject = Message.create({ + method: 'GET', + path: '/db/:bucket/:oid', + status: [200, 304] +}); + +/** + * Replace object + * Replace the current object with the updated one. + * To update a specific version of the object a version Number can be provided in the If-Match header. + * The update will only be accepted, if the current version matchesToBeForwarded the provided one, otherwise the update + * will be rejected. + * You can use the * wildcard to match any existing object, but prevents a insertion if the object doesn't exists. + * + * @class message.ReplaceObject + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + * @param body {Object} The massage Content + */ +exports.ReplaceObject = Message.create({ + method: 'PUT', + path: '/db/:bucket/:oid', + status: [200, 202] +}); + +/** + * Deletes the object + * Deletes the object. The If-Match Header can be used to specify an expected version. The object will + * only be deleted if the version matchesToBeForwarded the provided one. The * wildcard can be used to match any existing + * version but results in an error if the object doesn't exists. + * + * @class message.DeleteObject + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + */ +exports.DeleteObject = Message.create({ + method: 'DELETE', + path: '/db/:bucket/:oid', + status: [202, 204] +}); + +/** + * Get all available class schemas + * Gets the complete schema + * + * @class message.GetAllSchemas + * @extends connector.Message + * + */ +exports.GetAllSchemas = Message.create({ + method: 'GET', + path: '/schema', + status: [200] +}); + +/** + * Create new class schemas and update existing class schemas + * Updates the complete schema, merge all changes, reject the schema update if the schema changes aren't compatible + * + * @class message.UpdateAllSchemas + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.UpdateAllSchemas = Message.create({ + method: 'POST', + path: '/schema', + status: [200] +}); + +/** + * Replace all currently created schemas with the new ones + * Replace the complete schema, with the new one. + * + * @class message.ReplaceAllSchemas + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.ReplaceAllSchemas = Message.create({ + method: 'PUT', + path: '/schema', + status: [200] +}); + +/** + * Get the class schema + * Returns the schema definition of the class + * The class definition contains a link to its parent class and all persistable fields with there types of the class + * + * @class message.GetSchema + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.GetSchema = Message.create({ + method: 'GET', + path: '/schema/:bucket', + status: [200] +}); + +/** + * Update the class schema + * Modify the schema definition of the class by adding all missing fields + * + * @class message.UpdateSchema + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.UpdateSchema = Message.create({ + method: 'POST', + path: '/schema/:bucket', + status: [200] +}); + +/** + * Replace the class schema + * Replace the schema definition of the class + * + * @class message.ReplaceSchema + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.ReplaceSchema = Message.create({ + method: 'PUT', + path: '/schema/:bucket', + status: [200] +}); + +/** + * Delete the class schema + * Delete the schema definition of the class + * + * @class message.DeleteSchema + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.DeleteSchema = Message.create({ + method: 'DELETE', + path: '/schema/:bucket', + status: [204] +}); + +/** + * Executes a basic ad-hoc query + * Executes the given query and returns a list of matching objects. + * + * @class message.AdhocQuery + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param q {Object} The query + * @param eager {Object} indicates if the query result should be send back as ids or as objects + * @param start {Object} The offset to start from + * @param count {Object} The number of objects to list + * @param sort {Object} The sort object + */ +exports.AdhocQuery = Message.create({ + method: 'GET', + path: '/db/:bucket/query?q&start=0&count=-1&sort=&eager=', + status: [200] +}); + +/** + * Executes a basic ad-hoc query + * Executes the given query and returns a list of matching objects. + * + * @class message.AdhocQueryPOST + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param start {Object} The offset to start from + * @param count {Object} The number of objects to list + * @param sort {Object} The sort object + * @param body {Object} The massage Content + */ +exports.AdhocQueryPOST = Message.create({ + method: 'POST', + path: '/db/:bucket/query?start=0&count=-1&sort=', + status: [200] +}); + +/** + * Executes a count query + * Executes the given query and returns the number of objects that match the query + * + * @class message.AdhocCountQuery + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param q {Object} The query + */ +exports.AdhocCountQuery = Message.create({ + method: 'GET', + path: '/db/:bucket/count?q', + status: [200] +}); + +/** + * Executes a count query + * Executes the given query and returns the number of objects that match the query + * + * @class message.AdhocCountQueryPOST + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.AdhocCountQueryPOST = Message.create({ + method: 'POST', + path: '/db/:bucket/count', + status: [200] +}); + +/** + * List all Query subresources + * + * @class message.ListQueryResources + * @extends connector.Message + * + */ +exports.ListQueryResources = Message.create({ + method: 'GET', + path: '/query', + status: [200] +}); + +/** + * Creates a prepared query + * + * @class message.CreateQuery + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.CreateQuery = Message.create({ + method: 'POST', + path: '/query', + status: [201] +}); + +/** + * List all subresources of a query + * + * @class message.ListThisQueryResources + * @extends connector.Message + * + * @param qid {Object} The query id + */ +exports.ListThisQueryResources = Message.create({ + method: 'GET', + path: '/query/:qid', + status: [200] +}); + +/** + * Get the query string + * + * @class message.GetQueryCode + * @extends connector.Message + * + * @param qid {Object} The query id + */ +exports.GetQueryCode = Message.create({ + method: 'GET', + path: '/query/:qid/source', + status: [200] +}); + +/** + * Executes a prepared query + * + * @class message.RunQuery + * @extends connector.Message + * + * @param start {Object} The offset from where to start from + * @param count {Object} The number of objects to enlist + * @param qid {Object} The query id + */ +exports.RunQuery = Message.create({ + method: 'GET', + path: '/query/:qid/result?start=0&count=-1', + status: [200] +}); + +/** + * Get the declared query parameters + * + * @class message.GetQueryParameters + * @extends connector.Message + * + * @param qid {Object} The query id + */ +exports.GetQueryParameters = Message.create({ + method: 'GET', + path: '/query/:qid/parameters', + status: [200] +}); + +/** + * Starts a new Transaction + * + * @class message.NewTransaction + * @extends connector.Message + * + */ +exports.NewTransaction = Message.create({ + method: 'POST', + path: '/transaction', + status: [201] +}); + +/** + * Commits the transaction + * If the transaction can be completed a list of all changed objects with their updated versions are returned. + * + * @class message.CommitTransaction + * @extends connector.Message + * + * @param tid {Object} The transaction id + * @param body {Object} The massage Content + */ +exports.CommitTransaction = Message.create({ + method: 'PUT', + path: '/transaction/:tid/committed', + status: [200] +}); + +/** + * Returns the object in the given version or the newest version if the given does not exist. + * + * @class message.GetObjectInExplicitVersion + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + * @param version {Object} The version to load + */ +exports.GetObjectInExplicitVersion = Message.create({ + method: 'GET', + path: '/db/:bucket/:oid/:version', + status: [200] +}); + +/** + * Update the object + * Executes the partial updates on the object. + * To update an object an explicit version must be provided in the If-Match header. + * If the version is not equal to the current object version the update will be aborted. + * The version identifier Any (*) can be used to skip the version validation and therefore + * the update will always be applied. + * + * @class message.UpdatePartially + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + * @param body {Object} The massage Content + */ +exports.UpdatePartially = Message.create({ + method: 'POST', + path: '/db/:bucket/:oid', + status: [204] +}); + +/** + * Update the object field + * Executes the partial update on a object field. + * To update an object an explicit version must be provided in the If-Match header. + * If the version is not equal to the current object version the update will be aborted. + * The version identifier Any (*) can be used to skip the version validation and therefore + * the update will always be applied. + * + * @class message.UpdateField + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param field {Object} The field name + * @param oid {Object} The unique object identifier + * @param body {Object} The massage Content + */ +exports.UpdateField = Message.create({ + method: 'POST', + path: '/db/:bucket/:oid/:field', + status: [204] +}); + +/** + * Method to login a user + * Log in a user by it's credentials + * + * @class message.Login + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.Login = Message.create({ + method: 'POST', + path: '/db/User/login', + status: [200] +}); + +/** + * Method to register a user + * Register and creates a new user + * + * @class message.Register + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.Register = Message.create({ + method: 'POST', + path: '/db/User/register', + status: [200, 204] +}); + +/** + * Method to load the current user object + * Gets the user object of the currently logged in user + * + * @class message.Me + * @extends connector.Message + * + */ +exports.Me = Message.create({ + method: 'GET', + path: '/db/User/me', + status: [200] +}); + +/** + * Method to validate a user token + * Validates if a given token is still valid + * + * @class message.ValidateUser + * @extends connector.Message + * + */ +exports.ValidateUser = Message.create({ + method: 'GET', + path: '/db/User/validate', + status: [200] +}); + +/** + * Method to remove token cookie + * Log out a user by removing the cookie token + * + * @class message.Logout + * @extends connector.Message + * + */ +exports.Logout = Message.create({ + method: 'GET', + path: '/db/User/logout', + status: [204] +}); + +/** + * Method to change the password + * + * @class message.NewPassword + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.NewPassword = Message.create({ + method: 'POST', + path: '/db/User/password', + status: [200] +}); + +/** + * Method to verify user by a given token + * + * @class message.Verify + * @extends connector.Message + * + * @param token {Object} Token to verify the user + */ +exports.Verify = Message.create({ + method: 'GET', + path: '/db/User/verify?token=', + status: [204] +}); + +/** + * Method to register or login using an OAuth provider. + * This resource is invoked by the provider with a redirect after the user granted permission. + * + * @class message.OAuth2 + * @extends connector.Message + * + * @param oauth_verifier {Object} OAuth 1.0 code + * @param code {Object} The code written by the provider + * @param provider {Object} The OAuth provider + * @param oauth_token {Object} OAuth 1.0 identifier + * @param error_description {Object} The error description of the oauth provider + * @param state {Object} On true a token will be returned + */ +exports.OAuth2 = Message.create({ + method: 'GET', + path: '/db/User/OAuth/:provider?state=&code=&oauth_verifier=&oauth_token=&error_description=', + status: [200] +}); + +/** + * Method to invoke a OAuth-1.0 login/register + * The resource requests a request-token and redirects the user to the provider page to log-in and grant permission for + * your application. + * + * @class message.OAuth1 + * @extends connector.Message + * + * @param provider {Object} The OAuth provider + */ +exports.OAuth1 = Message.create({ + method: 'GET', + path: '/db/User/OAuth1/:provider', + status: [200] +}); + +/** + * Gets the code of the the given bucket and type + * + * @class message.GetBaqendCode + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param type {Object} The type of the script + */ +exports.GetBaqendCode = Message.create({ + method: 'GET', + path: '/code/:bucket/:type', + status: [200] +}); + +/** + * Sets the code of the bucket and type + * + * @class message.SetBaqendCode + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param type {Object} The type of the script + * @param body {Object} The massage Content + */ +exports.SetBaqendCode = Message.create({ + method: 'PUT', + path: '/code/:bucket/:type', + status: [200, 202] +}); + +/** + * Delete the code of the given bucket and type + * + * @class message.DeleteBaqendCode + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param type {Object} The type of the script + */ +exports.DeleteBaqendCode = Message.create({ + method: 'DELETE', + path: '/code/:bucket/:type', + status: [202, 204] +}); + +/** + * Calls the module of the specific bucket + * + * @class message.PostBaqendModule + * @extends connector.Message + * + * @param bucket {Object} The method name + */ +exports.PostBaqendModule = Message.create({ + method: 'POST', + path: '/code/:bucket', + status: [200, 204] +}); + +/** + * Calls the module of the specific bucket + * + * @class message.GetBaqendModule + * @extends connector.Message + * + * @param bucket {Object} The module name + */ +exports.GetBaqendModule = Message.create({ + method: 'GET', + path: '/code/:bucket', + status: [200, 204] +}); + +/** + * List all available modules + * + * @class message.GetAllModules + * @extends connector.Message + * + */ +exports.GetAllModules = Message.create({ + method: 'GET', + path: '/code', + status: [200] +}); + +/** + * Get all file ID's in the given folder + * Retrieve meta-information about all accessible Files and folders in a specified folder. + * + * @class message.ListFiles + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param path {Object} The folder to list + * @param start {Object} The file/folder name from where to start listing + * @param count {Object} The upper limit to return. + */ +exports.ListFiles = Message.create({ + method: 'GET', + path: '/file/:bucket/ids?path=/&start=&count=-1', + status: [200] +}); + +/** + * Get all buckets + * Get all buckets. + * + * @class message.ListBuckets + * @extends connector.Message + * + */ +exports.ListBuckets = Message.create({ + method: 'GET', + path: '/file/buckets', + status: [200] +}); + +/** + * Retrieves the bucket Metadata + * The bucket metadata object contains the bucketAcl + * + * @class message.GetFileBucketMetadata + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.GetFileBucketMetadata = Message.create({ + method: 'GET', + path: '/file/:bucket', + status: [200] +}); + +/** + * Sets the Bucket Metadata + * Creates or replaces the bucket Metadata to control permission access to all included Files. + * + * @class message.SetFileBucketMetadata + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.SetFileBucketMetadata = Message.create({ + method: 'PUT', + path: '/file/:bucket', + status: [204] +}); + +/** + * deletes all files of a file Bucket + * Deletes the bucket and all its content + * + * @class message.DeleteFileBucket + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.DeleteFileBucket = Message.create({ + method: 'DELETE', + path: '/file/:bucket', + status: [204] +}); + +/** + * Creates a new file with a random UUID + * Creates a File with a random ID, only Insert permissions are required + * + * @class message.CreateFile + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.CreateFile = Message.create({ + method: 'POST', + path: '/file/:bucket', + status: [200] +}); + +/** + * Download a file + * Download a file. + * + * @class message.DownloadFile + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique object identifier + */ +exports.DownloadFile = Message.create({ + method: 'GET', + path: '/file/:bucket/*oid', + status: [200, 304] +}); + +/** + * Upload a new file + * Upload and replace any existing File with the new one. + * The If-Match or If-Unmodified-Since header can be used to make a conditional update + * + * @class message.UploadFile + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique file identifier + */ +exports.UploadFile = Message.create({ + method: 'PUT', + path: '/file/:bucket/*oid', + status: [200] +}); + +/** + * Gets the file metadata + * Gets the file Acl and metadata. + * + * @class message.GetFileMetadata + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique object identifier + */ +exports.GetFileMetadata = Message.create({ + method: 'HEAD', + path: '/file/:bucket/*oid', + status: [200] +}); + +/** + * update File Metadata + * Updates the file Metadata. + * + * @class message.UpdateFileMetadata + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique object identifier + * @param body {Object} The massage Content + */ +exports.UpdateFileMetadata = Message.create({ + method: 'POST', + path: '/file/:bucket/*oid', + status: [200] +}); + +/** + * Delete a file + * Deletes a file. + * The If-Match or If-Unmodified-Since header can be used to make a conditional deletion + * + * @class message.DeleteFile + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique file identifier + */ +exports.DeleteFile = Message.create({ + method: 'DELETE', + path: '/file/:bucket/*oid', + status: [204] +}); + +/** + * List bucket indexes + * List all indexes of the given bucket + * + * @class message.ListIndexes + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.ListIndexes = Message.create({ + method: 'GET', + path: '/index/:bucket', + status: [200] +}); + +/** + * Create or drop bucket index + * Create or drop a index for the given bucket + * + * @class message.CreateDropIndex + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.CreateDropIndex = Message.create({ + method: 'POST', + path: '/index/:bucket', + status: [202] +}); + +/** + * Drop all indexes + * Drop all indexes on the given bucket + * + * @class message.DropAllIndexes + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.DropAllIndexes = Message.create({ + method: 'DELETE', + path: '/index/:bucket', + status: [202] +}); + +/** + * Method to register a new device + * Registers a new devices + * + * @class message.DeviceRegister + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.DeviceRegister = Message.create({ + method: 'POST', + path: '/db/Device/register', + status: [204] +}); + +/** + * Method to push a message to devices + * Pushes a message to devices + * + * @class message.DevicePush + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.DevicePush = Message.create({ + method: 'POST', + path: '/db/Device/push', + status: [204] +}); + +/** + * Check if device is registered + * Checks if the device is already registered + * + * @class message.DeviceRegistered + * @extends connector.Message + * + */ +exports.DeviceRegistered = Message.create({ + method: 'GET', + path: '/db/Device/registered', + status: [200] +}); + +/** + * Upload APNS certificate + * Upload APNS certificate + * + * @class message.UploadAPNSCertificate + * @extends connector.Message + * + */ +exports.UploadAPNSCertificate = Message.create({ + method: 'POST', + path: '/config/APNSCert', + status: [204] +}); + +/** + * Set GCM-API-Key + * Sets the GCM-API-Key + * + * @class message.GCMAKey + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.GCMAKey = Message.create({ + method: 'POST', + path: '/config/GCMKey', + status: [204] +}); + +},{"25":25}],37:[function(_dereq_,module,exports){ +"use strict"; + +var Accessor = _dereq_(7); + +/** + * @alias metamodel.Attribute + */ + +var Attribute = function () { + babelHelpers.createClass(Attribute, [{ + key: 'persistentAttributeType', + + /** + * @type number + */ + get: function get() { + return -1; + } + + /** + * @type boolean + */ + + }, { + key: 'isAssociation', + get: function get() { + return this.persistentAttributeType > Attribute.PersistentAttributeType.EMBEDDED; + } + + /** + * @type boolean + */ + + }, { + key: 'isCollection', + get: function get() { + return this.persistentAttributeType == Attribute.PersistentAttributeType.ELEMENT_COLLECTION; + } + + /** + * @param {string} name The attribute name + * @param {boolean=} isMetadata true if the attribute is an metadata attribute + */ + + }]); + + function Attribute(name, isMetadata) { + babelHelpers.classCallCheck(this, Attribute); + + /** @type boolean */ + this.isMetadata = !!isMetadata; + /** @type boolean */ + this.isId = false; + /** @type boolean */ + this.isVersion = false; + /** @type boolean */ + this.isAcl = false; + + /** @type string */ + this.name = name; + /** @type number */ + this.order = null; + /** @type binding.Accessor */ + this.accessor = null; + /** @type metamodel.ManagedType */ + this.declaringType = null; + } + + /** + * @param {metamodel.ManagedType} declaringType The type that owns this attribute + * @param {number} order Position of the attribute + */ + + + Attribute.prototype.init = function init(declaringType, order) { + if (this.declaringType) throw new Error('The attribute is already initialized.'); + + this.order = order; + this.accessor = new Accessor(); + this.declaringType = declaringType; + }; + + /** + * @param {Object} entity + * @returns {*} + */ + + + Attribute.prototype.getValue = function getValue(entity) { + return this.accessor.getValue(entity, this); + }; + + /** + * @param {Object} entity + * @param {*} value + */ + + + Attribute.prototype.setValue = function setValue(entity, value) { + this.accessor.setValue(entity, this, value); + }; + + /** + * Gets this attribute value form the object as json + * @param {util.Metadata} state The root object state + * @param {*} object The object which contains the value of this attribute + * @return {*} The converted json value + * @abstract + */ + + + Attribute.prototype.getJsonValue = function getJsonValue(state, object) {}; + + /** + * Sets this attribute value from json to the object + * @param {util.Metadata} state The root state + * @param {*} object The object which contains the attribute + * @param {*} jsonValue The json value to convert an set + * @abstract + */ + + + Attribute.prototype.setJsonValue = function setJsonValue(state, object, jsonValue) {}; + + /** + * Converts this attribute field to json + * @abstract + * @returns {json} The attribute description as json + */ + + + Attribute.prototype.toJSON = function toJSON() {}; + + return Attribute; +}(); + +/** + * @enum {number} + */ + + +Attribute.PersistentAttributeType = { + BASIC: 0, + ELEMENT_COLLECTION: 1, + EMBEDDED: 2, + MANY_TO_MANY: 3, + MANY_TO_ONE: 4, + ONE_TO_MANY: 5, + ONE_TO_ONE: 6 +}; + +module.exports = Attribute; + +},{"7":7}],38:[function(_dereq_,module,exports){ +"use strict"; + +var Type = _dereq_(51); +var GeoPoint = _dereq_(5); + +/** + * @alias metamodel.BasicType + * @extends metamodel.Type + */ + +var BasicType = function (_Type) { + babelHelpers.inherits(BasicType, _Type); + babelHelpers.createClass(BasicType, [{ + key: 'persistenceType', + + + /** + * The persistent type of this type + * @type number + */ + get: function get() { + return Type.PersistenceType.BASIC; + } + + /** + * Creates a new instance of a native db type + * @param {string} ref The db ref of this type + * @param {Class<*>} typeConstructor The javascript class of this type + * @param {boolean=} noResolving Indicates if this type is not the main type of the constructor + */ + + }]); + + function BasicType(ref, typeConstructor, noResolving) { + babelHelpers.classCallCheck(this, BasicType); + + if (ref.indexOf('/db/') != 0) ref = '/db/' + ref; + + /** + * Indicates if this type is not the main type of the constructor + * @type {boolean} + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Type.call(this, ref, typeConstructor)); + + _this.noResolving = noResolving; + return _this; + } + + /** + * @inheritDoc + */ + + + BasicType.prototype.toJsonValue = function toJsonValue(state, currentValue) { + return currentValue === null || currentValue === undefined ? null : this.typeConstructor(currentValue); + }; + + /** + * @inheritDoc + */ + + + BasicType.prototype.fromJsonValue = function fromJsonValue(state, jsonValue, currentValue) { + return jsonValue === null || jsonValue === undefined ? null : jsonValue; + }; + + BasicType.prototype.toString = function toString() { + return "BasicType(" + this.ref + ")"; + }; + + return BasicType; +}(Type); + +function dateToJson(value) { + //remove trailing zeros + return value instanceof Date ? value.toISOString().replace(/\.?0*Z/, 'Z') : null; +} + +function jsonToDate(json, currentValue) { + var date = typeof json === 'string' ? new Date(json) : null; + if (currentValue && date) { + //compare normalized date strings instead of plain strings + return currentValue.toISOString() == date.toISOString() ? currentValue : date; + } else { + return date; + } +} + +Object.assign(BasicType, /** @lends metamodel.BasicType */{ + Boolean: new (function (_BasicType) { + babelHelpers.inherits(BooleanType, _BasicType); + + function BooleanType() { + babelHelpers.classCallCheck(this, BooleanType); + return babelHelpers.possibleConstructorReturn(this, _BasicType.apply(this, arguments)); + } + + BooleanType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return typeof json === 'string' ? json !== "false" : _BasicType.prototype.fromJsonValue.call(this, state, json, currentValue); + }; + + return BooleanType; + }(BasicType))('Boolean', Boolean), + + Double: new (function (_BasicType2) { + babelHelpers.inherits(DoubleType, _BasicType2); + + function DoubleType() { + babelHelpers.classCallCheck(this, DoubleType); + return babelHelpers.possibleConstructorReturn(this, _BasicType2.apply(this, arguments)); + } + + DoubleType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return typeof json === 'string' ? parseFloat(json) : _BasicType2.prototype.fromJsonValue.call(this, state, json, currentValue); + }; + + return DoubleType; + }(BasicType))('Double', Number), + + Integer: new (function (_BasicType3) { + babelHelpers.inherits(IntegerType, _BasicType3); + + function IntegerType() { + babelHelpers.classCallCheck(this, IntegerType); + return babelHelpers.possibleConstructorReturn(this, _BasicType3.apply(this, arguments)); + } + + IntegerType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return typeof json === 'string' ? parseInt(json) : _BasicType3.prototype.fromJsonValue.call(this, state, json, currentValue); + }; + + return IntegerType; + }(BasicType))('Integer', Number), + + String: new (function (_BasicType4) { + babelHelpers.inherits(StringType, _BasicType4); + + function StringType() { + babelHelpers.classCallCheck(this, StringType); + return babelHelpers.possibleConstructorReturn(this, _BasicType4.apply(this, arguments)); + } + + return StringType; + }(BasicType))('String', String), + + DateTime: new (function (_BasicType5) { + babelHelpers.inherits(DateTimeType, _BasicType5); + + function DateTimeType() { + babelHelpers.classCallCheck(this, DateTimeType); + return babelHelpers.possibleConstructorReturn(this, _BasicType5.apply(this, arguments)); + } + + DateTimeType.prototype.toJsonValue = function toJsonValue(state, value) { + return dateToJson(value); + }; + + DateTimeType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return jsonToDate(json, currentValue); + }; + + return DateTimeType; + }(BasicType))('DateTime', Date), + + Date: new (function (_BasicType6) { + babelHelpers.inherits(DateType, _BasicType6); + + function DateType() { + babelHelpers.classCallCheck(this, DateType); + return babelHelpers.possibleConstructorReturn(this, _BasicType6.apply(this, arguments)); + } + + DateType.prototype.toJsonValue = function toJsonValue(state, value) { + var json = dateToJson(value); + return json ? json.substring(0, json.indexOf('T')) : null; + }; + + DateType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return jsonToDate(json, currentValue); + }; + + return DateType; + }(BasicType))('Date', Date), + + Time: new (function (_BasicType7) { + babelHelpers.inherits(TimeType, _BasicType7); + + function TimeType() { + babelHelpers.classCallCheck(this, TimeType); + return babelHelpers.possibleConstructorReturn(this, _BasicType7.apply(this, arguments)); + } + + TimeType.prototype.toJsonValue = function toJsonValue(state, value) { + var json = dateToJson(value); + return json ? json.substring(json.indexOf('T') + 1) : null; + }; + + TimeType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return typeof json === 'string' ? jsonToDate('1970-01-01T' + json, currentValue) : json; + }; + + return TimeType; + }(BasicType))('Time', Date), + + GeoPoint: new (function (_BasicType8) { + babelHelpers.inherits(GeoPointType, _BasicType8); + + function GeoPointType() { + babelHelpers.classCallCheck(this, GeoPointType); + return babelHelpers.possibleConstructorReturn(this, _BasicType8.apply(this, arguments)); + } + + GeoPointType.prototype.toJsonValue = function toJsonValue(state, value) { + return value instanceof GeoPoint ? value : null; + }; + + GeoPointType.prototype.fromJsonValue = function fromJsonValue(state, json) { + return json ? new GeoPoint(json) : null; + }; + + return GeoPointType; + }(BasicType))('GeoPoint', GeoPoint), + + JsonArray: new (function (_BasicType9) { + babelHelpers.inherits(JsonArrayType, _BasicType9); + + function JsonArrayType() { + babelHelpers.classCallCheck(this, JsonArrayType); + return babelHelpers.possibleConstructorReturn(this, _BasicType9.apply(this, arguments)); + } + + JsonArrayType.prototype.init = function init(classFactory) { + //do not manipulate array properties + this._enhancer = classFactory; + }; + + JsonArrayType.prototype.toJsonValue = function toJsonValue(state, value) { + return Array.isArray(value) ? value : null; + }; + + JsonArrayType.prototype.fromJsonValue = function fromJsonValue(state, json) { + return Array.isArray(json) ? json : null; + }; + + return JsonArrayType; + }(BasicType))('JsonArray', Array), + + JsonObject: new (function (_BasicType10) { + babelHelpers.inherits(JsonObjectType, _BasicType10); + + function JsonObjectType() { + babelHelpers.classCallCheck(this, JsonObjectType); + return babelHelpers.possibleConstructorReturn(this, _BasicType10.apply(this, arguments)); + } + + JsonObjectType.prototype.init = function init(classFactory) { + //do not manipulate object properties + this._enhancer = classFactory; + }; + + JsonObjectType.prototype.toJsonValue = function toJsonValue(state, value) { + if (value && value.constructor == Object) { + return value; + } + + return null; + }; + + return JsonObjectType; + }(BasicType))('JsonObject', Object) +}); + +module.exports = BasicType; + +},{"5":5,"51":51}],39:[function(_dereq_,module,exports){ +"use strict"; + +var PluralAttribute = _dereq_(48); + +/** + * @alias metamodel.CollectionAttribute + * @extends metamodel.PluralAttribute + */ + +var CollectionAttribute = function (_PluralAttribute) { + babelHelpers.inherits(CollectionAttribute, _PluralAttribute); + babelHelpers.createClass(CollectionAttribute, [{ + key: "collectionType", + + + /** + * @inheritDoc + */ + get: function get() { + return PluralAttribute.CollectionType.COLLECTION; + } + + /** + * @param {string} name + * @param {metamodel.Type} elementType + */ + + }]); + + function CollectionAttribute(name, elementType) { + babelHelpers.classCallCheck(this, CollectionAttribute); + + var _this = babelHelpers.possibleConstructorReturn(this, _PluralAttribute.call(this, name, elementType)); + + _this.typeConstructor = null; + return _this; + } + + return CollectionAttribute; +}(PluralAttribute); + +module.exports = CollectionAttribute; + +},{"48":48}],40:[function(_dereq_,module,exports){ +"use strict"; +/** + * Creates a new index instance which is needed to create an + * database index. + * + * @alias metamodel.DbIndex + */ + +var DbIndex = function () { + + /** + * @param {string|Object|Array} keys The name of the field which will be used for the index, + * an object of an field and index type combination or + * an array of objects to create an compound index + * @param {boolean=} unique Indicates if the index will be unique + */ + function DbIndex(keys, unique) { + babelHelpers.classCallCheck(this, DbIndex); + + if (Object(keys) instanceof String) { + var key = {}; + key[keys] = DbIndex.ASC; + this.keys = [key]; + } else if (Object(keys) instanceof Array) { + this.keys = keys; + } else if (keys) { + this.keys = [keys]; + } else { + throw new Error("The keys parameter must be an String, Object or Array."); + } + + /** @type boolean */ + this.drop = false; + this.unique = unique === true; + } + + DbIndex.prototype.hasKey = function hasKey(name) { + for (var i = 0; i < this.keys.length; i++) { + if (this.keys[i][name]) { + return true; + } + } + return false; + }; + + /** + * Returns a JSON representation of the Index object + * + * @return {json} A Json of this Index object + */ + DbIndex.prototype.toJSON = function toJSON() { + return { + unique: this.unique, + keys: this.keys, + drop: this.drop + }; + }; + + babelHelpers.createClass(DbIndex, [{ + key: "isCompound", + get: function get() { + return this.keys.length > 1; + } + }, { + key: "isUnique", + get: function get() { + return this.unique; + } + }]); + return DbIndex; +}(); + +Object.assign(DbIndex, /** @lends metamodel.DbIndex */{ + /** + * @type string + */ + ASC: 'asc', + + /** + * @type string + */ + DESC: 'desc', + + /** + * @type string + */ + GEO: 'geo', + + /** + * Returns DbIndex Object created from the given JSON + * @param {json} json + */ + fromJSON: function fromJSON(json) { + return new DbIndex(json.keys, json.unique); + } +}); + +module.exports = DbIndex; + +},{}],41:[function(_dereq_,module,exports){ +"use strict"; + +var ManagedType = _dereq_(44); +var Type = _dereq_(51); +var binding = _dereq_(20); + +/** + * @alias metamodel.EmbeddableType + * @extends metamodel.ManagedType + */ + +var EmbeddableType = function (_ManagedType) { + babelHelpers.inherits(EmbeddableType, _ManagedType); + babelHelpers.createClass(EmbeddableType, [{ + key: 'persistenceType', + get: function get() { + return Type.PersistenceType.EMBEDDABLE; + } + }]); + + function EmbeddableType(name, typeConstructor) { + babelHelpers.classCallCheck(this, EmbeddableType); + return babelHelpers.possibleConstructorReturn(this, _ManagedType.call(this, name, typeConstructor)); + } + + /** + * {@inheritDoc} + */ + + + EmbeddableType.prototype.createProxyClass = function createProxyClass() { + return this._enhancer.createProxy(binding.Managed); + }; + + /** + * {@inheritDoc} + * @param {EntityManager} db {@inheritDoc} + * @return {binding.ManagedFactory<*>} A factory which creates embeddable objects + */ + + + EmbeddableType.prototype.createObjectFactory = function createObjectFactory(db) { + return binding.ManagedFactory.create(this, db); + }; + + /** + * @inheritDoc + */ + + + EmbeddableType.prototype.toJsonValue = function toJsonValue(state, object) { + if (state._root && object instanceof this.typeConstructor && !object._metadata._root) { + object._metadata._root = state._root; + } + + return _ManagedType.prototype.toJsonValue.call(this, state, object); + }; + + /** + * @inheritDoc + */ + + + EmbeddableType.prototype.fromJsonValue = function fromJsonValue(state, jsonObject, currentObject) { + if (jsonObject) { + if (!(currentObject instanceof this.typeConstructor)) currentObject = this.create(); + + if (state._root && !currentObject._metadata._root) currentObject._metadata._root = state._root; + } + + return _ManagedType.prototype.fromJsonValue.call(this, state, jsonObject, currentObject); + }; + + EmbeddableType.prototype.toString = function toString() { + return "EmbeddableType(" + this.ref + ")"; + }; + + return EmbeddableType; +}(ManagedType); + +module.exports = EmbeddableType; + +},{"20":20,"44":44,"51":51}],42:[function(_dereq_,module,exports){ +"use strict"; + +var binding = _dereq_(20); + +var SingularAttribute = _dereq_(50); +var BasicType = _dereq_(38); +var Type = _dereq_(51); +var ManagedType = _dereq_(44); +var util = _dereq_(70); + +/** + * @alias metamodel.EntityType + * @extends metamodel.ManagedType + */ + +var EntityType = function (_ManagedType) { + babelHelpers.inherits(EntityType, _ManagedType); + babelHelpers.createClass(EntityType, [{ + key: 'persistenceType', + get: function get() { + return Type.PersistenceType.ENTITY; + } + + /** + * @type metamodel.SingularAttribute + */ + + }, { + key: 'id', + get: function get() { + return this.declaredId || this.superType.id; + } + + /** + * @type metamodel.SingularAttribute + */ + + }, { + key: 'version', + get: function get() { + return this.declaredVersion || this.superType.version; + } + + /** + * @type metamodel.SingularAttribute + */ + + }, { + key: 'acl', + get: function get() { + return this.declaredAcl || this.superType.acl; + } + + /** + * @param {string} ref + * @param {metamodel.EntityType} superType + * @param {Class} typeConstructor + */ + + }]); + + function EntityType(ref, superType, typeConstructor) { + babelHelpers.classCallCheck(this, EntityType); + + /** @type metamodel.SingularAttribute */ + var _this = babelHelpers.possibleConstructorReturn(this, _ManagedType.call(this, ref, typeConstructor)); + + _this.declaredId = null; + /** @type metamodel.SingularAttribute */ + _this.declaredVersion = null; + /** @type metamodel.SingularAttribute */ + _this.declaredAcl = null; + /** @type metamodel.EntityType */ + _this.superType = superType; + + /** @type util.Permission */ + _this.loadPermission = new util.Permission(); + /** @type util.Permission */ + _this.updatePermission = new util.Permission(); + /** @type util.Permission */ + _this.deletePermission = new util.Permission(); + /** @type util.Permission */ + _this.queryPermission = new util.Permission(); + /** @type util.Permission */ + _this.schemaSubclassPermission = new util.Permission(); + /** @type util.Permission */ + _this.insertPermission = new util.Permission(); + return _this; + } + + /** + * {@inheritDoc} + */ + + + EntityType.prototype.createProxyClass = function createProxyClass() { + var Class = this.superType.typeConstructor; + if (Class === Object) { + switch (this.name) { + case 'User': + Class = binding.User; + break; + case 'Role': + Class = binding.Role; + break; + default: + Class = binding.Entity; + break; + } + } + + return this._enhancer.createProxy(Class); + }; + + /** + * {@inheritDoc} + * Creates an ObjectFactory for this type and the given EntityManager + * @return {binding.EntityFactory} A factory which creates entity objects + */ + + + EntityType.prototype.createObjectFactory = function createObjectFactory(db) { + switch (this.name) { + case 'User': + return binding.UserFactory.create(this, db); + case 'Device': + return binding.DeviceFactory.create(this, db); + case 'Object': + return undefined; + } + + return binding.EntityFactory.create(this, db); + }; + + /** + * @inheritDoc + */ + + + EntityType.prototype.fromJsonValue = function fromJsonValue(state, jsonObject, currentObject, isRoot) { + if (isRoot) { + return _ManagedType.prototype.fromJsonValue.call(this, state, jsonObject, currentObject); + } else if (jsonObject) { + return state.db.getReference(jsonObject); + } else { + return null; + } + }; + + /** + * @inheritDoc + */ + + + EntityType.prototype.toJsonValue = function toJsonValue(state, object, isRoot) { + if (isRoot) { + return _ManagedType.prototype.toJsonValue.call(this, state, object); + } else if (object instanceof this.typeConstructor) { + object.attach(state.db); + return object.id; + } else { + return null; + } + }; + + EntityType.prototype.toString = function toString() { + return "EntityType(" + this.ref + ")"; + }; + + EntityType.prototype.toJSON = function toJSON() { + var json = _ManagedType.prototype.toJSON.call(this); + + json.acl.schemaSubclass = this.schemaSubclassPermission; + json.acl.insert = this.insertPermission; + json.acl.update = this.updatePermission; + json.acl.delete = this.deletePermission; + json.acl.query = this.queryPermission; + + return json; + }; + + return EntityType; +}(ManagedType); + +/** + * @alias metamodel.EntityType.Object + * @extends metamodel.EntityType + */ + + +var ObjectType = function (_EntityType) { + babelHelpers.inherits(ObjectType, _EntityType); + babelHelpers.createClass(ObjectType, null, [{ + key: 'ref', + get: function get() { + return '/db/Object'; + } + }]); + + function ObjectType() { + babelHelpers.classCallCheck(this, ObjectType); + + var _this2 = babelHelpers.possibleConstructorReturn(this, _EntityType.call(this, EntityType.Object.ref, null, Object)); + + _this2.declaredId = new SingularAttribute('id', BasicType.String, true); + _this2.declaredId.init(_this2, 0); + _this2.declaredId.isId = true; + _this2.declaredVersion = new SingularAttribute('version', BasicType.Double, true); + _this2.declaredVersion.init(_this2, 1); + _this2.declaredVersion.isVersion = true; + _this2.declaredAcl = new SingularAttribute('acl', BasicType.JsonObject, true); + _this2.declaredAcl.init(_this2, 2); + _this2.declaredAcl.isAcl = true; + + _this2.declaredAttributes = [_this2.declaredId, _this2.declaredVersion, _this2.declaredAcl]; + return _this2; + } + + return ObjectType; +}(EntityType); + +EntityType.Object = ObjectType; + +module.exports = EntityType; + +},{"20":20,"38":38,"44":44,"50":50,"51":51,"70":70}],43:[function(_dereq_,module,exports){ +"use strict"; + +var PluralAttribute = _dereq_(48); + +/** + * @alias metamodel.ListAttribute + * @extends metamodel.PluralAttribute + */ + +var ListAttribute = function (_PluralAttribute) { + babelHelpers.inherits(ListAttribute, _PluralAttribute); + babelHelpers.createClass(ListAttribute, [{ + key: 'collectionType', + get: function get() { + return PluralAttribute.CollectionType.LIST; + } + + /** + * @param {string} name + * @param {metamodel.Type} elementType + */ + + }], [{ + key: 'ref', + get: function get() { + return '/db/collection.List'; + } + }]); + + function ListAttribute(name, elementType) { + babelHelpers.classCallCheck(this, ListAttribute); + + var _this = babelHelpers.possibleConstructorReturn(this, _PluralAttribute.call(this, name, elementType)); + + _this.typeConstructor = Array; + return _this; + } + + /** + * @inheritDoc + */ + + + ListAttribute.prototype.getJsonValue = function getJsonValue(state, object) { + var value = this.getValue(object); + + if (value instanceof this.typeConstructor) { + var len = value.length; + var persisting = new Array(len), + persistedState = value.__persistedState__ || []; + var changed = !value.__persistedState__ || persistedState.length != len; + + var json = new Array(len); + for (var i = 0; i < len; ++i) { + var el = value[i]; + json[i] = this.elementType.toJsonValue(state, el); + persisting[i] = el; + + changed |= persistedState[i] !== el; + } + + if (state.persisting) { + Object.defineProperty(value, '__persistedState__', { value: persisting, configurable: true }); + } + + if (state.isPersistent && changed) state.setDirty(); + + return json; + } else { + return null; + } + }; + + /** + * {@inheritDoc} + */ + + + ListAttribute.prototype.setJsonValue = function setJsonValue(state, obj, json) { + var value = null; + + if (json) { + value = this.getValue(obj); + + var len = json.length; + if (!(value instanceof this.typeConstructor)) { + value = new this.typeConstructor(len); + } + + var persisting = new Array(len), + persistedState = value.__persistedState__ || []; + + //clear additional items + if (len < value.length) value.splice(len, value.length - len); + + for (var i = 0; i < len; ++i) { + var el = this.elementType.fromJsonValue(state, json[i], persistedState[i]); + persisting[i] = value[i] = el; + } + + if (state.persisting) { + Object.defineProperty(value, '__persistedState__', { value: persisting, configurable: true }); + } + } + + this.setValue(obj, value); + }; + + /** + * {@inheritDoc} + * @returns {json} {@inheritDoc} + */ + + + ListAttribute.prototype.toJSON = function toJSON() { + return { + name: this.name, + type: ListAttribute.ref + '[' + this.elementType.ref + ']', + order: this.order + }; + }; + + return ListAttribute; +}(PluralAttribute); + +module.exports = ListAttribute; + +},{"48":48}],44:[function(_dereq_,module,exports){ +"use strict"; + +var Type = _dereq_(51); +var Permission = _dereq_(65); +var Validator = _dereq_(69); +var binding = _dereq_(20); + +/** + * @alias metamodel.ManagedType + * @extends metamodel.Type + */ + +var ManagedType = function (_Type) { + babelHelpers.inherits(ManagedType, _Type); + babelHelpers.createClass(ManagedType, [{ + key: 'validationCode', + + + /** + * @type Function + */ + get: function get() { + return this._validationCode; + }, + set: function set(code) { + if (!code) { + this._validationCode = null; + } else { + this._validationCode = Validator.compile(this, code); + } + } + + /** + * The Managed class + * @type Class + */ + + }, { + key: 'typeConstructor', + get: function get() { + if (!this._typeConstructor) { + this.typeConstructor = this.createProxyClass(); + } + return this._typeConstructor; + } + + /** + * The Managed class constructor + * @param {Class} typeConstructor The managed class constructor + */ + , + set: function set(typeConstructor) { + if (this._typeConstructor) { + throw new Error("Type constructor has already been set."); + } + + var isEntity = typeConstructor.prototype instanceof binding.Entity; + if (this.isEntity) { + if (!isEntity) throw new TypeError("Entity classes must extends the Entity class."); + } else { + if (!(typeConstructor.prototype instanceof binding.Managed) || isEntity) throw new TypeError("Embeddable classes must extends the Managed class."); + } + + this._enhancer.enhance(this, typeConstructor); + this._typeConstructor = typeConstructor; + } + + /** + * @param {string} ref or full class name + * @param {Class} typeConstructor + */ + + }]); + + function ManagedType(ref, typeConstructor) { + babelHelpers.classCallCheck(this, ManagedType); + + /** @type binding.Enhancer */ + var _this = babelHelpers.possibleConstructorReturn(this, _Type.call(this, ref.indexOf('/db/') != 0 ? '/db/' + ref : ref, typeConstructor)); + + _this._enhancer = null; + /** @type {metamodel.Attribute[]} */ + _this.declaredAttributes = []; + + /** @type util.Permission */ + _this.schemaAddPermission = new Permission(); + /** @type util.Permission */ + _this.schemaReplacePermission = new Permission(); + return _this; + } + + /** + * Initialize this type + * @param {binding.Enhancer} enhancer The class enhancer + * used to enhance and instantiate instance of this managed class + */ + + + ManagedType.prototype.init = function init(enhancer) { + this._enhancer = enhancer; + + if (this._typeConstructor && !this._enhancer.getIdentifier(this._typeConstructor)) this._enhancer.setIdentifier(this._typeConstructor, this.ref); + }; + + /** + * Creates an ProxyClass for this type + * @return {Class<*>} the crated proxy class for this type + * @abstract + */ + + + ManagedType.prototype.createProxyClass = function createProxyClass() {}; + + /** + * Creates an ObjectFactory for this type and the given EntityManager + * @param {EntityManager} db The created instances will be attached to this EntityManager + * @return {binding.ManagedFactory<*>} the crated object factory for the given EntityManager + * @abstract + */ + + + ManagedType.prototype.createObjectFactory = function createObjectFactory(db) {}; + + /** + * Creates a new instance of the managed type, without invoking any constructors + * This method is used to create object instances which are loaded form the backend + * @returns {Object} The created instance + */ + + + ManagedType.prototype.create = function create() { + var instance; + instance = Object.create(this.typeConstructor.prototype); + binding.Managed.init(instance); + + return instance; + }; + + /** + * An iterator which returns all attributes declared by this type and inherited form all super types + * @return {Iterator} + */ + + + ManagedType.prototype.attributes = function attributes() { + var _ref; + + var iter = void 0, + index = 0, + type = this; + if (this.superType) { + iter = this.superType.attributes(); + } + + return _ref = {}, _ref[Symbol.iterator] = function () { + return this; + }, _ref.next = function next() { + if (iter) { + var item = iter.next(); + if (item.done) { + iter = null; + } else { + return item; + } + } + + if (index < type.declaredAttributes.length) { + return { + value: type.declaredAttributes[index++], + done: false + }; + } else { + return { done: true }; + } + }, _ref; + }; + + /** + * Adds an attribute to this type + * @param {metamodel.Attribute} attr The attribute to add + * @param {number=} order Position of the attribute + */ + + + ManagedType.prototype.addAttribute = function addAttribute(attr, order) { + if (this.getAttribute(attr.name)) throw new Error("An attribute with the name " + attr.name + " is already declared."); + + if (attr.order == null) { + order = typeof order == 'undefined' ? this.declaredAttributes.length : order; + } else { + order = attr.order; + } + attr.init(this, order); + + this.declaredAttributes.push(attr); + if (this._typeConstructor && this.name != 'Object') this._enhancer.enhanceProperty(this._typeConstructor, attr); + }; + + /** + * Removes an attribute from this type + * @param {string} name The Name of the attribute which will be removed + */ + + + ManagedType.prototype.removeAttribute = function removeAttribute(name) { + var length = this.declaredAttributes.length; + this.declaredAttributes = this.declaredAttributes.filter(function (val) { + return val.name != name; + }); + + if (length == this.declaredAttributes.length) throw new Error("An Attribute with the name " + name + " is not declared."); + }; + + /** + * @param {!string} name + * @returns {metamodel.Attribute} + */ + + + ManagedType.prototype.getAttribute = function getAttribute(name) { + var attr = this.getDeclaredAttribute(name); + + if (!attr && this.superType) { + attr = this.superType.getAttribute(name); + } + + return attr; + }; + + /** + * @param {string|number} val Name or order of the attribute + * @returns {metamodel.Attribute} + */ + + + ManagedType.prototype.getDeclaredAttribute = function getDeclaredAttribute(val) { + for (var _iterator = this.declaredAttributes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var attr = _ref2; + + if (attr.name === val || attr.order === val) { + return attr; + } + } + + return null; + }; + + /** + * @inheritDoc + */ + + + ManagedType.prototype.fromJsonValue = function fromJsonValue(state, jsonObject, currentObject) { + if (jsonObject) { + for (var _iterator2 = this.attributes(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var attribute = _ref3; + + if (!attribute.isMetadata) attribute.setJsonValue(state, currentObject, jsonObject[attribute.name]); + } + } else { + currentObject = null; + } + + return currentObject; + }; + + /** + * @inheritDoc + */ + + + ManagedType.prototype.toJsonValue = function toJsonValue(state, object) { + var value = null; + + if (object instanceof this.typeConstructor) { + value = {}; + for (var _iterator3 = this.attributes(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + var attribute = _ref4; + + if (!attribute.isMetadata) value[attribute.name] = attribute.getJsonValue(state, object); + } + } + + return value; + }; + + /** + * Converts ths type schema to json + * @returns {json} + */ + + + ManagedType.prototype.toJSON = function toJSON() { + var json = {}; + json['class'] = this.ref; + + if (this.superType) json['superClass'] = this.superType.ref; + + if (this.isEmbeddable) json['embedded'] = true; + + json['acl'] = { + load: this.loadPermission, + schemaAdd: this.schemaAddPermission, + schemaReplace: this.schemaReplacePermission + }; + + var fields = json['fields'] = {}; + for (var _iterator4 = this.declaredAttributes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref5; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } + + var attribute = _ref5; + + if (!attribute.isMetadata) fields[attribute.name] = attribute; + } + + return json; + }; + + /** + * Returns iterator to get all referenced entities + * @return {Iterator} + */ + + + ManagedType.prototype.references = function references() { + var _ref8; + + var attributes = this.attributes(); + var embedded = []; + + return _ref8 = {}, _ref8[Symbol.iterator] = function () { + return this; + }, _ref8.next = function next() { + for (var _iterator5 = attributes, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref6; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref6 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref6 = _i5.value; + } + + var attribute = _ref6; + + var type = attribute.isCollection ? attribute.elementType : attribute.type; + if (type.isEntity) { + return { done: false, value: { path: [attribute.name] } }; + } else if (type.isEmbeddable) { + for (var _iterator6 = type.references(), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref7; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref7 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref7 = _i6.value; + } + + var emItem = _ref7; + + embedded.push({ done: false, value: { path: [attribute.name].concat(emItem.path) } }); + } + } + } + + return embedded.length ? embedded.pop() : { done: true }; + }, _ref8; + }; + + return ManagedType; +}(Type); + +module.exports = ManagedType; + +},{"20":20,"51":51,"65":65,"69":69}],45:[function(_dereq_,module,exports){ +"use strict"; + +var PluralAttribute = _dereq_(48); +var PersistentError = _dereq_(32); + +/** + * @alias metamodel.MapAttribute + * @extends metamodel.PluralAttribute + */ + +var MapAttribute = function (_PluralAttribute) { + babelHelpers.inherits(MapAttribute, _PluralAttribute); + babelHelpers.createClass(MapAttribute, [{ + key: 'collectionType', + get: function get() { + return PluralAttribute.CollectionType.MAP; + } + + /** + * @param {string} name + * @param {metamodel.Type} keyType + * @param {metamodel.Type} elementType + */ + + }], [{ + key: 'ref', + get: function get() { + return '/db/collection.Map'; + } + }]); + + function MapAttribute(name, keyType, elementType) { + babelHelpers.classCallCheck(this, MapAttribute); + + /** @type metamodel.Type */ + var _this = babelHelpers.possibleConstructorReturn(this, _PluralAttribute.call(this, name, elementType)); + + _this.keyType = keyType; + _this.typeConstructor = Map; + return _this; + } + + /** + * @inheritDoc + */ + + + MapAttribute.prototype.getJsonValue = function getJsonValue(state, object) { + var value = this.getValue(object); + + if (value instanceof this.typeConstructor) { + var persisting = {}, + persistedState = value.__persistedState__ || {}; + var changed = !value.__persistedState__ || value.__persistedSize__ !== value.size; + + var json = {}; + for (var _iterator = value.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var entry = _ref; + + if (entry[0] === null || entry[0] === undefined) throw new PersistentError('Map keys can\'t be null nor undefined.'); + + var jsonKey = this.keyType.toJsonValue(state, entry[0]); + json[jsonKey] = this.elementType.toJsonValue(state, entry[1]); + + persisting[jsonKey] = [entry[0], entry[1]]; + changed |= (persistedState[jsonKey] || [])[1] !== entry[1]; + } + + if (state.persisting) { + Object.defineProperties(value, { + '__persistedState__': { value: persisting, configurable: true }, + '__persistedSize__': { value: value.size, configurable: true } + }); + } + + if (state.isPersistent && changed) state.setDirty(); + + return json; + } else { + return null; + } + }; + + /** + * @inheritDoc + */ + + + MapAttribute.prototype.setJsonValue = function setJsonValue(state, obj, json) { + var value = null; + if (json) { + value = this.getValue(obj); + + if (!(value instanceof this.typeConstructor)) { + value = new this.typeConstructor(); + } + + var persisting = {}, + persistedState = value.__persistedState__ || {}; + + value.clear(); + for (var jsonKey in json) { + var persistedEntry = persistedState[jsonKey] || []; + // ensure that "false" keys will be converted to false + var key = this.keyType.fromJsonValue(state, jsonKey, persistedEntry[0]); + var val = this.elementType.fromJsonValue(state, json[jsonKey], persistedEntry[1]); + + persisting[jsonKey] = [key, val]; + value.set(key, val); + } + + if (state.persisting) { + Object.defineProperties(value, { + '__persistedState__': { value: persisting, configurable: true }, + '__persistedSize__': { value: value.size, configurable: true } + }); + } + } + + this.setValue(obj, value); + }; + + /** + * {@inheritDoc} + * @returns {json} {@inheritDoc} + */ + + + MapAttribute.prototype.toJSON = function toJSON() { + return { + name: this.name, + type: MapAttribute.ref + '[' + this.keyType.ref + ',' + this.elementType.ref + ']', + order: this.order + }; + }; + + return MapAttribute; +}(PluralAttribute); + +module.exports = MapAttribute; + +},{"32":32,"48":48}],46:[function(_dereq_,module,exports){ +"use strict"; + +var BasicType = _dereq_(38); +var ManagedType = _dereq_(44); +var EntityType = _dereq_(42); +var Enhancer = _dereq_(9); +var ModelBuilder = _dereq_(47); +var DbIndex = _dereq_(40); +var Lockable = _dereq_(61); +var StatusCode = _dereq_(25).StatusCode; + +var message = _dereq_(36); + +/** + * @alias metamodel.Metamodel + * @extends util.Lockable + */ + +var Metamodel = function (_Lockable) { + babelHelpers.inherits(Metamodel, _Lockable); + + function Metamodel(entityManagerFactory) { + babelHelpers.classCallCheck(this, Metamodel); + + /** + * Defines if the Metamodel has been finalized + * @type boolean + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Lockable.call(this)); + + _this.isInitialized = false; + + /** + * @type EntityManagerFactory + */ + _this.entityManagerFactory = entityManagerFactory; + + /** + * @type Array. + */ + _this.entities = null; + + /** + * @type Array. + */ + _this.embeddables = null; + + /** + * @type Array. + */ + _this.baseTypes = null; + + _this._enhancer = new Enhancer(); + return _this; + } + + /** + * Prepare the Metamodel for custom schema creation + * @param {Object=} jsonMetamodel initialize the metamodel with the serialized json schema + */ + + + Metamodel.prototype.init = function init(jsonMetamodel) { + if (this.isInitialized) { + throw new Error('Metamodel is already initialized.'); + } + + this.fromJSON(jsonMetamodel || []); + this.isInitialized = true; + }; + + /** + * @param {(Class|string)} arg + * @return {string} + */ + + + Metamodel.prototype._getRef = function _getRef(arg) { + var ref; + if (Object(arg) instanceof String) { + ref = arg; + + if (ref.indexOf('/db/') != 0) { + ref = '/db/' + arg; + } + } else { + ref = this._enhancer.getIdentifier(arg); + } + + return ref; + }; + + /** + * Return the metamodel entity type representing the entity. + * + * @param {(Class|string)} typeConstructor - the type of the represented entity + * @returns {metamodel.EntityType} the metamodel entity type + */ + + + Metamodel.prototype.entity = function entity(typeConstructor) { + var ref = this._getRef(typeConstructor); + return ref ? this.entities[ref] : null; + }; + + /** + * Return the metamodel basic type representing the native class. + * @param {(Class<*>|string)} typeConstructor - the type of the represented native class + * @returns {metamodel.BasicType} the metamodel basic type + */ + + + Metamodel.prototype.baseType = function baseType(typeConstructor) { + var ref = null; + if (Object(typeConstructor) instanceof String) { + ref = this._getRef(typeConstructor); + } else { + for (var name in this.baseTypes) { + var type = this.baseTypes[name]; + if (!type.noResolving && type.typeConstructor == typeConstructor) { + ref = name; + break; + } + } + } + + return ref ? this.baseTypes[ref] : null; + }; + + /** + * Return the metamodel embeddable type representing the embeddable class. + * @param {Class|string} typeConstructor - the type of the represented embeddable class + * @returns {metamodel.EmbeddableType} the metamodel embeddable type + */ + + + Metamodel.prototype.embeddable = function embeddable(typeConstructor) { + var ref = this._getRef(typeConstructor); + return ref ? this.embeddables[ref] : null; + }; + + /** + * Return the metamodel managed type representing the entity, mapped superclass, or embeddable class. + * + * @param {(Class|string)} typeConstructor - the type of the represented managed class + * @returns {metamodel.Type} the metamodel managed type + */ + + + Metamodel.prototype.managedType = function managedType(typeConstructor) { + return this.baseType(typeConstructor) || this.entity(typeConstructor) || this.embeddable(typeConstructor); + }; + + /** + * @param {metamodel.Type} type + * @return {metamodel.Type} the added type + */ + + + Metamodel.prototype.addType = function addType(type) { + var types; + + if (type.isBasic) { + types = this.baseTypes; + } else if (type.isEmbeddable) { + type.init(this._enhancer); + types = this.embeddables; + } else if (type.isEntity) { + type.init(this._enhancer); + types = this.entities; + + if (type.superType == null && type.ref != EntityType.Object.ref) { + type.superType = this.entity(EntityType.Object.ref); + } + } + + if (types[type.ref]) { + throw new Error("The type " + type.ref + " is already declared."); + } + + return types[type.ref] = type; + }; + + /** + * Load all schema data from the server + * @returns {Promise} + */ + + + Metamodel.prototype.load = function load() { + var _this2 = this; + + if (!this.isInitialized) { + return this.withLock(function () { + var msg = new message.GetAllSchemas(); + + return _this2.entityManagerFactory.send(msg).then(function (response) { + _this2.init(response.entity); + return _this2; + }); + }); + } else { + throw new Error("Metamodel is already initialized."); + } + }; + + /** + * Store all local schema data on the server, or the provided one + * + * Note: The schema must be initialized, by init or load + * + * @param {metamodel.ManagedType=} managedType The specific type to persist, if omitted the complete schema will be updated + * @returns {Promise} + */ + + + Metamodel.prototype.save = function save(managedType) { + var _this3 = this; + + return this._send(managedType || this.toJSON()).then(function () { + return _this3; + }); + }; + + /** + * The provided options object will be forwarded to the UpdateAllSchemas resource. + * The underlying schema of this Metamodel object will be replaced by the result. + * + * @param {json} data The JSON which will be send to the UpdateAllSchemas resource. + * @returns {Promise} + */ + + + Metamodel.prototype.update = function update(data) { + var _this4 = this; + + return this._send(data).then(function (response) { + _this4.fromJSON(response.entity); + return _this4; + }); + }; + + Metamodel.prototype._send = function _send(data) { + var _this5 = this; + + if (!this.isInitialized) throw new Error("Metamodel is not initialized."); + + return this.withLock(function () { + var msg; + if (data instanceof ManagedType) { + msg = new message.UpdateSchema(data.name, data.toJSON()); + } else { + msg = new message.UpdateAllSchemas(data); + } + + return _this5.entityManagerFactory.send(msg); + }); + }; + + /** + * Get the current schema types as json + * @returns {json} the json data + */ + + + Metamodel.prototype.toJSON = function toJSON() { + var json = []; + + for (var ref in this.entities) { + json.push(this.entities[ref]); + } + + for (ref in this.embeddables) { + json.push(this.embeddables[ref]); + } + + return json; + }; + + /** + * Replace the current schema by the provided one in json + * @param {json} json The json schema data + */ + + + Metamodel.prototype.fromJSON = function fromJSON(json) { + var builder = new ModelBuilder(); + var models = builder.buildModels(json); + + this.baseTypes = {}; + this.embeddables = {}; + this.entities = {}; + + for (var ref in models) { + var type = models[ref]; + this.addType(type); + } + }; + + /** + * Creates an index + * + * @param {string} bucket Name of the Bucket + * @param {metamodel.DbIndex} index Will be applied for the given bucket + * @return {Promise<*>} + */ + + + Metamodel.prototype.createIndex = function createIndex(bucket, index) { + index.drop = false; + var msg = new message.CreateDropIndex(bucket, index.toJSON()); + return this.entityManagerFactory.send(msg); + }; + + /** + * Drops an index + * + * @param {string} bucket Name of the Bucket + * @param {metamodel.DbIndex} index Will be dropped for the given bucket + * @return {Promise<*>} + */ + + + Metamodel.prototype.dropIndex = function dropIndex(bucket, index) { + index.drop = true; + var msg = new message.CreateDropIndex(bucket, index.toJSON()); + return this.entityManagerFactory.send(msg); + }; + + /** + * Drops all indexes + * + * @param {string} bucket Indexes will be dropped for the given bucket + * @returns {Promise<*>} + */ + + + Metamodel.prototype.dropAllIndexes = function dropAllIndexes(bucket) { + var msg = new message.DropAllIndexes(bucket); + return this.entityManagerFactory.send(msg); + }; + + /** + * Loads all indexes for the given bucket + * + * @param {string} bucket Current indexes will be loaded for the given bucket + * @returns {Promise>} + */ + + + Metamodel.prototype.getIndexes = function getIndexes(bucket) { + var msg = new message.ListIndexes(bucket); + return this.entityManagerFactory.send(msg).then(function (response) { + return response.entity.map(function (el) { + return new DbIndex(el.keys, el.unique); + }); + }, function (e) { + if (e.status == StatusCode.BUCKET_NOT_FOUND || e.status == StatusCode.OBJECT_NOT_FOUND) { + return null; + } else { + throw e; + } + }); + }; + + return Metamodel; +}(Lockable); + +module.exports = Metamodel; + +},{"25":25,"36":36,"38":38,"40":40,"42":42,"44":44,"47":47,"61":61,"9":9}],47:[function(_dereq_,module,exports){ +"use strict"; + +var BasicType = _dereq_(38); +var EntityType = _dereq_(42); +var EmbeddableType = _dereq_(41); + +var ListAttribute = _dereq_(43); +var MapAttribute = _dereq_(45); +var SetAttribute = _dereq_(49); +var SingularAttribute = _dereq_(50); + +var PersistentError = _dereq_(32); + +/** + * @alias metamodel.ModelBuilder + */ + +var ModelBuilder = function () { + /** + * @param {metamodel.Metamodel} metamodel + */ + function ModelBuilder() { + babelHelpers.classCallCheck(this, ModelBuilder); + + /** @type Object */ + this.models = {}; + + /** @type Object */ + this.modelDescriptors = null; + + for (var _iterator = Object.keys(BasicType), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var typeName = _ref; + + var basicType = BasicType[typeName]; + if (basicType instanceof BasicType) { + this.models[basicType.ref] = basicType; + } + } + } + + /** + * @param {string} ref + * @returns {metamodel.ManagedType} + */ + + + ModelBuilder.prototype.getModel = function getModel(ref) { + if (ref in this.models) { + return this.models[ref]; + } else { + return this.models[ref] = this.buildModel(ref); + } + }; + + /** + * @param {Object[]} modelDescriptors + * @returns {Object} + */ + + + ModelBuilder.prototype.buildModels = function buildModels(modelDescriptors) { + this.modelDescriptors = {}; + for (var i = 0, modelDescriptor; modelDescriptor = modelDescriptors[i]; ++i) { + this.modelDescriptors[modelDescriptor['class']] = modelDescriptor; + } + + for (var ref in this.modelDescriptors) { + try { + var model = this.getModel(ref); + this.buildAttributes(model); + } catch (e) { + throw new PersistentError('Can\'t create model for entity class ' + ref, e); + } + } + + //ensure at least an object entity + this.getModel(EntityType.Object.ref); + + return this.models; + }; + + /** + * @param {string} ref + * @returns {metamodel.ManagedType} + */ + + + ModelBuilder.prototype.buildModel = function buildModel(ref) { + var modelDescriptor = this.modelDescriptors[ref]; + var type; + if (ref == EntityType.Object.ref) { + type = new EntityType.Object(); + } else if (modelDescriptor) { + if (modelDescriptor.embedded) { + type = new EmbeddableType(ref); + } else { + var superTypeIdentifier = modelDescriptor['superClass'] || EntityType.Object.ref; + type = new EntityType(ref, this.getModel(superTypeIdentifier)); + } + } else { + throw new TypeError('No model available for ' + ref); + } + + if (modelDescriptor) { + var permissions = modelDescriptor['acl']; + for (var permission in permissions) { + type[permission + 'Permission'].fromJSON(permissions[permission]); + } + } + + return type; + }; + + /** + * @param {metamodel.EntityType} model + */ + + + ModelBuilder.prototype.buildAttributes = function buildAttributes(model) { + var modelDescriptor = this.modelDescriptors[model.ref]; + var fields = modelDescriptor['fields']; + + for (var name in fields) { + var field = fields[name]; + if (!model.getAttribute(name)) //skip predefined attributes + model.addAttribute(this.buildAttribute(field.name, field.type), field.order); + } + + if (modelDescriptor.validationCode) { + model.validationCode = modelDescriptor.validationCode; + } + }; + + /** + * @param {metamodel.EntityType} model + * @param {string} name + * @param {string} ref + * @returns {metamodel.Attribute} + */ + + + ModelBuilder.prototype.buildAttribute = function buildAttribute(name, ref) { + if (ref.indexOf('/db/collection.') == 0) { + var collectionType = ref.substring(0, ref.indexOf('[')); + + var elementType = ref.substring(ref.indexOf('[') + 1, ref.indexOf(']')).trim(); + switch (collectionType) { + case ListAttribute.ref: + return new ListAttribute(name, this.getModel(elementType)); + case SetAttribute.ref: + return new SetAttribute(name, this.getModel(elementType)); + case MapAttribute.ref: + var keyType = elementType.substring(0, elementType.indexOf(',')).trim(); + elementType = elementType.substring(elementType.indexOf(',') + 1).trim(); + + return new MapAttribute(name, this.getModel(keyType), this.getModel(elementType)); + default: + throw new TypeError('No collection available for ' + ref); + } + } else { + return new SingularAttribute(name, this.getModel(ref)); + } + }; + + return ModelBuilder; +}(); + +module.exports = ModelBuilder; + +},{"32":32,"38":38,"41":41,"42":42,"43":43,"45":45,"49":49,"50":50}],48:[function(_dereq_,module,exports){ +"use strict"; + +var Attribute = _dereq_(37); + +/** + * @alias metamodel.PluralAttribute + * @extends metamodel.Attribute + */ + +var PluralAttribute = function (_Attribute) { + babelHelpers.inherits(PluralAttribute, _Attribute); + babelHelpers.createClass(PluralAttribute, [{ + key: "persistentAttributeType", + get: function get() { + return Attribute.PersistentAttributeType.ELEMENT_COLLECTION; + } + + /** + * @param {string} name + * @param {metamodel.Type} elementType + */ + + }]); + + function PluralAttribute(name, elementType) { + babelHelpers.classCallCheck(this, PluralAttribute); + + /** @type metamodel.Type */ + var _this = babelHelpers.possibleConstructorReturn(this, _Attribute.call(this, name)); + + _this.elementType = elementType; + /** @type Class<*> */ + _this.typeConstructor = null; + return _this; + } + + return PluralAttribute; +}(Attribute); + +/** + * @enum {number} + */ + + +PluralAttribute.CollectionType = { + COLLECTION: 0, + LIST: 1, + MAP: 2, + SET: 3 +}; + +module.exports = PluralAttribute; + +},{"37":37}],49:[function(_dereq_,module,exports){ +"use strict"; + +var PluralAttribute = _dereq_(48); + +/** + * @alias metamodel.SetAttribute + * @extends metamodel.PluralAttribute + */ + +var SetAttribute = function (_PluralAttribute) { + babelHelpers.inherits(SetAttribute, _PluralAttribute); + babelHelpers.createClass(SetAttribute, [{ + key: 'collectionType', + get: function get() { + return PluralAttribute.CollectionType.SET; + } + + /** + * @param {string} name + * @param {metamodel.Type} elementType + */ + + }], [{ + key: 'ref', + get: function get() { + return '/db/collection.Set'; + } + }]); + + function SetAttribute(name, elementType) { + babelHelpers.classCallCheck(this, SetAttribute); + + var _this = babelHelpers.possibleConstructorReturn(this, _PluralAttribute.call(this, name, elementType)); + + _this.typeConstructor = Set; + return _this; + } + + /** + * @inheritDoc + */ + + + SetAttribute.prototype.getJsonValue = function getJsonValue(state, object) { + var value = this.getValue(object); + + if (value instanceof this.typeConstructor) { + var persisting = {}, + persistedState = value.__persistedState__ || {}; + var changed = !value.__persistedState__ || value.__persistedSize__ !== value.size; + + var json = []; + for (var _iterator = value, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var el = _ref; + + var jsonValue = this.elementType.toJsonValue(state, el); + json.push(jsonValue); + + persisting[jsonValue] = el; + changed |= persistedState[jsonValue] !== el; + } + + if (state.persisting) { + Object.defineProperties(value, { + '__persistedState__': { value: persisting, configurable: true }, + '__persistedSize__': { value: value.size, configurable: true } + }); + } + + if (state.isPersistent && changed) state.setDirty(); + + return json; + } else { + return null; + } + }; + + /** + * {@inheritDoc} + */ + + + SetAttribute.prototype.setJsonValue = function setJsonValue(state, obj, json) { + var value = null; + + if (json) { + value = this.getValue(obj); + + if (!(value instanceof this.typeConstructor)) { + value = new this.typeConstructor(); + } + + var persisting = {}, + persistedState = value.__persistedState__ || {}; + + value.clear(); + for (var i = 0, len = json.length; i < len; ++i) { + var jsonValue = json[i]; + var el = this.elementType.fromJsonValue(state, jsonValue, persistedState[jsonValue]); + value.add(el); + + persisting[jsonValue] = el; + } + + if (state.persisting) { + Object.defineProperties(value, { + '__persistedState__': { value: persisting, configurable: true }, + '__persistedSize__': { value: value.size, configurable: true } + }); + } + } + + this.setValue(obj, value); + }; + + /** + * {@inheritDoc} + * @returns {json} {@inheritDoc} + */ + + + SetAttribute.prototype.toJSON = function toJSON() { + return { + name: this.name, + type: SetAttribute.ref + '[' + this.elementType.ref + ']', + order: this.order + }; + }; + + return SetAttribute; +}(PluralAttribute); + +module.exports = SetAttribute; + +},{"48":48}],50:[function(_dereq_,module,exports){ +"use strict"; + +var Attribute = _dereq_(37); +var Type = _dereq_(51); + +/** + * @alias metamodel.SingularAttribute + * @extends metamodel.Attribute + */ + +var SingularAttribute = function (_Attribute) { + babelHelpers.inherits(SingularAttribute, _Attribute); + babelHelpers.createClass(SingularAttribute, [{ + key: 'typeConstructor', + get: function get() { + return this.type.typeConstructor; + } + }, { + key: 'persistentAttributeType', + get: function get() { + switch (this.type.persistenceType) { + case Type.PersistenceType.BASIC: + return Attribute.PersistentAttributeType.BASIC; + case Type.PersistenceType.EMBEDDABLE: + return Attribute.PersistentAttributeType.EMBEDDED; + case Type.PersistenceType.ENTITY: + return Attribute.PersistentAttributeType.ONE_TO_MANY; + } + } + + /** + * @param {string} name + * @param {metamodel.Type} type + * @param {boolean=} isMetadata + */ + + }]); + + function SingularAttribute(name, type, isMetadata) { + babelHelpers.classCallCheck(this, SingularAttribute); + + /** @type metamodel.Type */ + var _this = babelHelpers.possibleConstructorReturn(this, _Attribute.call(this, name, isMetadata)); + + _this.type = type; + return _this; + } + + /** + * @inheritDoc + */ + + + SingularAttribute.prototype.getJsonValue = function getJsonValue(state, object) { + return this.type.toJsonValue(state, this.getValue(object)); + }; + + /** + * @inheritDoc + */ + + + SingularAttribute.prototype.setJsonValue = function setJsonValue(state, object, jsonValue) { + this.setValue(object, this.type.fromJsonValue(state, jsonValue, this.getValue(object))); + }; + + /** + * @inheritDoc + */ + + + SingularAttribute.prototype.toJSON = function toJSON() { + return { + name: this.name, + type: this.type.ref, + order: this.order + }; + }; + + return SingularAttribute; +}(Attribute); + +module.exports = SingularAttribute; + +},{"37":37,"51":51}],51:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias metamodel.Type + */ + +var Type = function () { + babelHelpers.createClass(Type, [{ + key: "persistenceType", + + /** + * The persistent type of this type + * @type number + * @abstract + */ + get: function get() { + return -1; + } + + /** + * @type boolean + */ + + }, { + key: "isBasic", + get: function get() { + return this.persistenceType == Type.PersistenceType.BASIC; + } + + /** + * @type boolean + */ + + }, { + key: "isEmbeddable", + get: function get() { + return this.persistenceType == Type.PersistenceType.EMBEDDABLE; + } + + /** + * @type boolean + */ + + }, { + key: "isEntity", + get: function get() { + return this.persistenceType == Type.PersistenceType.ENTITY; + } + + /** + * @type boolean + */ + + }, { + key: "isMappedSuperclass", + get: function get() { + return this.persistenceType == Type.PersistenceType.MAPPED_SUPERCLASS; + } + + /** + * @return {Class<*>} + */ + + }, { + key: "typeConstructor", + get: function get() { + return this._typeConstructor; + } + + /** + * @param {Class<*>} typeConstructor + */ + , + set: function set(typeConstructor) { + if (this._typeConstructor) { + throw new Error("typeConstructor has already been set."); + } + this._typeConstructor = typeConstructor; + } + + /** + * @param {string} ref + * @param {Class<*>} typeConstructor + */ + + }]); + + function Type(ref, typeConstructor) { + babelHelpers.classCallCheck(this, Type); + + if (ref.indexOf("/db/") != 0) { + throw new SyntaxError("Type ref " + ref + " is invalid."); + } + + /** @type string */ + this.ref = ref; + /** @type string */ + this.name = ref.substring(4); + this._typeConstructor = typeConstructor; + } + + /** + * Merge the json data into the current object instance and returns the merged object + * @param {util.Metadata} state The root object state + * @param {json} jsonValue The json data to merge + * @param {*=} currentValue The object where the jsonObject will be merged into, if the current object is null, + * a new instance will be created + * @return {*} The merged object instance + * @abstract + */ + + + Type.prototype.fromJsonValue = function fromJsonValue(state, jsonValue, currentValue) {}; + + /** + * Converts the given object to json + * @param {util.Metadata} state The root object state + * @param {*} object The object to convert + * @return {json} The converted object as json + * @abstract + */ + + + Type.prototype.toJsonValue = function toJsonValue(state, object) {}; + + return Type; +}(); + +/** + * @enum {number} + */ + + +Type.PersistenceType = { + BASIC: 0, + EMBEDDABLE: 1, + ENTITY: 2, + MAPPED_SUPERCLASS: 3 +}; + +module.exports = Type; + +},{}],52:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace metamodel + */ + +var Metamodel = _dereq_(46); + +Metamodel.prototype.Attribute = _dereq_(37); +Metamodel.prototype.BasicType = _dereq_(38); +Metamodel.prototype.CollectionAttribute = _dereq_(39); +Metamodel.prototype.EmbeddableType = _dereq_(41); +Metamodel.prototype.EntityType = _dereq_(42); +Metamodel.prototype.ListAttribute = _dereq_(43); +Metamodel.prototype.ManagedType = _dereq_(44); +Metamodel.prototype.MapAttribute = _dereq_(45); +Metamodel.prototype.Metamodel = _dereq_(46); +Metamodel.prototype.ModelBuilder = _dereq_(47); +Metamodel.prototype.PluralAttribute = _dereq_(48); +Metamodel.prototype.SetAttribute = _dereq_(49); +Metamodel.prototype.SingularAttribute = _dereq_(50); +Metamodel.prototype.Type = _dereq_(51); +Metamodel.prototype.DbIndex = _dereq_(40); + +exports = module.exports = new Metamodel(); + +},{"37":37,"38":38,"39":39,"40":40,"41":41,"42":42,"43":43,"44":44,"45":45,"46":46,"47":47,"48":48,"49":49,"50":50,"51":51}],53:[function(_dereq_,module,exports){ +"use strict"; + +var Filter = _dereq_(55); +var Condition = _dereq_(54); +var Operator = _dereq_(57); +var Query = _dereq_(58); +var varargs = Query.varargs; + +/** + * @alias query.Builder + * @extends query.Query + * @extends query.Condition + */ + +var Builder = function (_Query) { + babelHelpers.inherits(Builder, _Query); + + /** + * @param {EntityManager} entityManager The owning entity manager of this query + * @param {Class} resultClass The query result class + */ + function Builder(entityManager, resultClass) { + babelHelpers.classCallCheck(this, Builder); + return babelHelpers.possibleConstructorReturn(this, _Query.call(this, entityManager, resultClass)); + } + + /** + * Joins the conditions by an logical AND + * @param {...(query.Query|Array>)} args The query nodes to join + * @return {query.Query} Returns a new query which joins the given queries by a logical AND + */ + + + Builder.prototype.and = function and(args) { + return this._addOperator('$and', varargs(0, arguments)); + }; + + /** + * Joins the conditions by an logical OR + * @param {...(query.Query|Array>)} args The query nodes to join + * @return {query.Query} Returns a new query which joins the given queries by a logical OR + */ + + + Builder.prototype.or = function or(args) { + return this._addOperator('$or', varargs(0, arguments)); + }; + + /** + * Joins the conditions by an logical NOR + * @param {...(query.Query|Array>)} args The query nodes to join + * @return {query.Query} Returns a new query which joins the given queries by a logical NOR + */ + + + Builder.prototype.nor = function nor(args) { + return this._addOperator('$nor', varargs(0, arguments)); + }; + + /** + * @inheritDoc + */ + + + Builder.prototype.stream = function stream(options) { + return this.where({})._stream(options, this); + }; + + /** + * @inheritDoc + */ + + + Builder.prototype.resultList = function resultList(options, doneCallback, failCallback) { + return this.where({}).resultList(options, doneCallback, failCallback); + }; + + /** + * @inheritDoc + */ + + + Builder.prototype.singleResult = function singleResult(options, doneCallback, failCallback) { + return this.where({}).singleResult(options, doneCallback, failCallback); + }; + + /** + * @inheritDoc + */ + + + Builder.prototype.count = function count(doneCallback, failCallback) { + return this.where({}).count(doneCallback, failCallback); + }; + + Builder.prototype._addOperator = function _addOperator(operator, args) { + if (args.length < 2) { + throw new Error('Only two or more queries can be joined with an ' + operator + ' operator.'); + } + + args.forEach(function (arg, index) { + if (!(arg instanceof Query)) { + throw new Error('Argument at index ' + index + ' is not a query.'); + } + }); + + return new Operator(this.entityManager, this.resultClass, operator, args); + }; + + Builder.prototype._addOrder = function _addOrder(fieldOrSort, order) { + return new Filter(this.entityManager, this.resultClass)._addOrder(fieldOrSort, order); + }; + + Builder.prototype._addFilter = function _addFilter(field, filter, value) { + return new Filter(this.entityManager, this.resultClass)._addFilter(field, filter, value); + }; + + Builder.prototype._addOffset = function _addOffset(offset) { + return new Filter(this.entityManager, this.resultClass)._addOffset(offset); + }; + + Builder.prototype._addLimit = function _addLimit(limit) { + return new Filter(this.entityManager, this.resultClass)._addLimit(limit); + }; + + return Builder; +}(Query); + +Object.assign(Builder.prototype, Condition); + +module.exports = Builder; + +},{"54":54,"55":55,"57":57,"58":58}],54:[function(_dereq_,module,exports){ +"use strict"; + +var varargs = _dereq_(58).varargs; + +/** + * @class query.Condition + */ +var Condition = {}; + +Object.assign(Condition, /** @lends query.Condition.prototype */{ + + /** + * An object, that contains filter rules which will be merged with the current filters of this query. + * @param {json} conditions - Additional filters for this query + * @return {query.Filter} The resulting Query + * @instance + */ + where: function where(conditions) { + return this._addFilter(null, null, conditions); + }, + + + /** + * Adds a equal filter to the field. All other other filters on the field will be discarded + * @param {string} field The field to filter + * @param {*} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + */ + equal: function equal(field, value) { + return this._addFilter(field, null, value); + }, + + + /** + * Adds a not equal filter to the field. + * @param {string} field The field to filter + * @param {*} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/ne/ + */ + notEqual: function notEqual(field, value) { + return this._addFilter(field, "$ne", value); + }, + + + /** + * Adds a greater than filter to the field. + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/gt/ + */ + greaterThan: function greaterThan(field, value) { + return this._addFilter(field, "$gt", value); + }, + + + /** + * Adds a greater than or equal to filter to the field. + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/gte/ + */ + greaterThanOrEqualTo: function greaterThanOrEqualTo(field, value) { + return this._addFilter(field, "$gte", value); + }, + + + /** + * Adds a less than filter to the field. + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/lt/ + */ + lessThan: function lessThan(field, value) { + return this._addFilter(field, "$lt", value); + }, + + + /** + * Adds a less than or equal to filter to the field. + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/lte/ + */ + lessThanOrEqualTo: function lessThanOrEqualTo(field, value) { + return this._addFilter(field, "$lte", value); + }, + + + /** + * Adds a between filter to the field. This is a shorthand for an less than and greater than filter. + * @param {string} field The field to filter + * @param {number|string|Date} lessValue The field value must be greater than this value + * @param {number|string|Date} greaterValue The field value must be less than this value + * @return {query.Filter} The resulting Query + * @instance + */ + between: function between(field, lessValue, greaterValue) { + return this._addFilter(field, "$gt", lessValue)._addFilter(field, "$lt", greaterValue); + }, + + + /** + * Adds a in filter to the field. The field value must be equal to one of the given values + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/in/ + */ + 'in': function _in(field, args) { + return this._addFilter(field, "$in", varargs(1, arguments)); + }, + + + /** + * Adds a in filter to the field. The field value must be equal to one of the given values + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * @instance + * @memberOf query.Condition.prototype + * @name in + * + * @see http://docs.mongodb.org/manual/reference/operator/query/in/ + */ + + /** + * Adds a not in filter to the field. The field value must not be equal to any of the given values + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/nin/ + */ + notIn: function notIn(field, args) { + return this._addFilter(field, "$nin", varargs(1, arguments)); + }, + + + /** + * Adds a null filter to the field. The field value must be null + * @param {string} field The field to filter + * @return {query.Filter} The resulting Query + * @instance + */ + isNull: function isNull(field) { + return this.equal(field, null); + }, + + + /** + * Adds a not null filter to the field. The field value must not be null + * @param {string} field The field to filter + * @return {query.Filter} The resulting Query + * @instance + */ + isNotNull: function isNotNull(field) { + return this._addFilter(field, "$exists", true)._addFilter(field, "$ne", null); + }, + + + /** + * Adds a contains all filter to the collection field. The collection must contain all the given values. + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/all/ + */ + containsAll: function containsAll(field, args) { + return this._addFilter(field, "$all", varargs(1, arguments)); + }, + + + /** + * Adds a modulo filter to the field. The field value divided by divisor must be equal to the remainder. + * @param {string} field The field to filter + * @param {number} divisor The divisor of the modulo filter + * @param {number} remainder The remainder of the modulo filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/mod/ + */ + mod: function mod(field, divisor, remainder) { + return this._addFilter(field, "$mod", [divisor, remainder]); + }, + + + /** + * Adds a regular expression filter to the field. The field value must matches the regular expression. + *

Note: Only anchored expressions (Expressions that starts with an ^) and the multiline flag are supported.

+ * @param {string} field The field to filter + * @param {string|RegExp} regExp The regular expression of the filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/regex/ + */ + matches: function matches(field, regExp) { + if (!(Object(regExp) instanceof RegExp)) { + regExp = new RegExp(regExp); + } + + if (regExp.ignoreCase) { + throw new Error('RegExp.ignoreCase flag is not supported.'); + } + + if (regExp.global) { + throw new Error('RegExp.global flag is not supported.'); + } + + if (regExp.source.indexOf('^') != 0) { + throw new Error('regExp must be an anchored expression, i.e. it must be started with a ^.'); + } + + var result = this._addFilter(field, '$regex', regExp.source); + if (regExp.multiline) { + result._addFilter(field, '$options', 'm'); + } + + return result; + }, + + + /** + * Adds a size filter to the collection field. The collection must have exactly size members. + * @param {string} field The field to filter + * @param {number} size The collections size to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/size/ + */ + size: function size(field, _size) { + return this._addFilter(field, "$size", _size); + }, + + + /** + * Adds a geopoint based near filter to the GeoPoint field. The GeoPoint must be within the maximum distance + * to the given GeoPoint. Returns from nearest to farthest. + * @param {string} field The field to filter + * @param {GeoPoint} geoPoint The GeoPoint to filter + * @param {number} maxDistance Tha maximum distance to filter in meters + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/nearSphere/ + */ + near: function near(field, geoPoint, maxDistance) { + return this._addFilter(field, "$nearSphere", { + $geometry: { + type: "Point", + coordinates: [geoPoint.longitude, geoPoint.latitude] + }, + $maxDistance: maxDistance + }); + }, + + + /** + * Adds a GeoPoint based polygon filter to the GeoPoint field. The GeoPoint must be contained within the polygon. + * @param {string} field The field to filter + * @param {...(GeoPoint|Array)} geoPoints The geoPoints that describes the polygon of the filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/geoWithin/ + */ + withinPolygon: function withinPolygon(field, geoPoints) { + geoPoints = varargs(1, arguments); + return this._addFilter(field, "$geoWithin", { + $geometry: { + type: "Polygon", + coordinates: [geoPoints.map(function (geoPoint) { + return [geoPoint.longitude, geoPoint.latitude]; + })] + } + }); + } +}); + +// aliases +Object.assign(Condition, /** @lends query.Condition.prototype */{ + /** + * Adds a equal filter to the field. All other other filters on the field will be discarded + * @method + * @param {string} field The field to filter + * @param {*} value The value used to filter + * @return {query.Filter} The resulting Query + */ + eq: Condition.equal, + + /** + * Adds a not equal filter to the field. + * @method + * @param {string} field The field to filter + * @param {*} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/ne/ + */ + ne: Condition.notEqual, + + /** + * Adds a less than filter to the field. Shorthand for {@link query.Condition#lessThan}. + * @method + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/lt/ + */ + lt: Condition.lessThan, + + /** + * Adds a less than or equal to filter to the field. Shorthand for {@link query.Condition#lessThanOrEqualTo}. + * @method + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/lte/ + */ + le: Condition.lessThanOrEqualTo, + + /** + * Adds a greater than filter to the field. Shorthand for {@link query.Condition#greaterThan}. + * @method + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/gt/ + */ + gt: Condition.greaterThan, + + /** + * Adds a greater than or equal to filter to the field. Shorthand for {@link query.Condition#greaterThanOrEqualTo}. + * @method + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/gte/ + */ + ge: Condition.greaterThanOrEqualTo, + + /** + * Adds a contains any filter to the collection field. The collection must contains one the given values. + * Alias for {@link query.Condition#in} + * @method + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/in/ + */ + containsAny: Condition.in +}); + +module.exports = Condition; + +},{"58":58}],55:[function(_dereq_,module,exports){ +"use strict"; + +var Node = _dereq_(56); +var Condition = _dereq_(54); + +/** + * @alias query.Filter + * @extends query.Node + * @extends query.Condition + */ + +var Filter = function (_Node) { + babelHelpers.inherits(Filter, _Node); + + /** + * @param {EntityManager} entityManager The owning entity manager of this query + * @param {Class} resultClass The query result class + */ + function Filter(entityManager, resultClass) { + babelHelpers.classCallCheck(this, Filter); + + /** + * The actual filters of this node + * @type Object + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Node.call(this, entityManager, resultClass)); + + _this._filter = {}; + return _this; + } + + Filter.prototype._addFilter = function _addFilter(field, filter, value) { + if (field !== null) { + if (!(Object(field) instanceof String)) throw new Error('Field must be a string.'); + + if (filter) { + var fieldFilter = this._filter[field]; + if (!(fieldFilter instanceof Object) || Object.getPrototypeOf(fieldFilter) != Object.prototype) { + this._filter[field] = fieldFilter = {}; + } + + fieldFilter[filter] = value; + } else { + this._filter[field] = value; + } + } else { + Object.assign(this._filter, value); + } + + return this; + }; + + Filter.prototype.toJSON = function toJSON() { + return this._filter; + }; + + return Filter; +}(Node); + +Object.assign(Filter.prototype, Condition); +module.exports = Filter; + +},{"54":54,"56":56}],56:[function(_dereq_,module,exports){ +"use strict"; + +var Query = _dereq_(58); +var message = _dereq_(36); +var Metadata = _dereq_(63); +var Entity = _dereq_(10); + +/** + * @alias query.Node + * @extends query.Query + */ + +var Node = function (_Query) { + babelHelpers.inherits(Node, _Query); + + /** + * @param {EntityManager} entityManager The owning entity manager of this query + * @param {Class} resultClass The query result class + */ + function Node(entityManager, resultClass) { + babelHelpers.classCallCheck(this, Node); + + /** + * The offset how many results should be skipped + * @type number + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Query.call(this, entityManager, resultClass)); + + _this.firstResult = 0; + + /** + * The limit how many objects should be returned + * @type number + */ + _this.maxResults = -1; + + _this._sort = {}; + return _this; + } + + /** + * @inheritDoc + */ + + + Node.prototype.stream = function stream(options) { + return this._stream(options, this); + }; + + /** + * Only available in streaming SDK! + * @ignore + */ + + + Node.prototype._stream = function _stream(options, target) { + throw new Error('Streaming features not available! Please use Streaming SDK!'); + }; + + /** + * @inheritDoc + */ + + + Node.prototype.resultList = function resultList(options, doneCallback, failCallback) { + var _this2 = this; + + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null; + + if (!type) { + throw new Error('Only typed queries can be executed.'); + } + + var query = this._serializeQuery(); + var sort = this._serializeSort(); + + var uriSize = this.entityManager._connector.host.length + query.length; + var msg; + if (uriSize > Query.MAX_URI_SIZE) { + msg = new message.AdhocQueryPOST(type.name, this.firstResult, this.maxResults, sort).entity(query, 'text'); + } else { + msg = new message.AdhocQuery(type.name, query, this.firstResult, this.maxResults, sort); + } + + return this.entityManager.send(msg).then(function (response) { + return _this2._createResultList(response.entity, options); + }).then(doneCallback, failCallback); + }; + + /** + * @inheritDoc + */ + + + Node.prototype.singleResult = function singleResult(options, doneCallback, failCallback) { + var _this3 = this; + + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null; + + if (!type) { + throw new Error('Only typed queries can be executed.'); + } + + var query = this._serializeQuery(); + var sort = this._serializeSort(); + + var uriSize = this.entityManager._connector.host.length + query.length; + var msg; + if (uriSize > Query.MAX_URI_SIZE) { + msg = new message.AdhocQueryPOST(type.name, query, this.firstResult, 1, sort).entity(query, 'text'); + } else { + msg = new message.AdhocQuery(type.name, query, this.firstResult, 1, sort); + } + + return this.entityManager.send(msg).then(function (response) { + return _this3._createResultList(response.entity, options); + }).then(function (list) { + return list.length ? list[0] : null; + }).then(doneCallback, failCallback); + }; + + /** + * @inheritDoc + */ + + + Node.prototype.count = function count(doneCallback, failCallback) { + var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null; + + if (!type) { + throw new Error('Only typed queries can be executed.'); + } + + var query = this._serializeQuery(); + + var uriSize = this.entityManager._connector.host.length + query.length; + var msg; + if (uriSize > Query.MAX_URI_SIZE) { + msg = new message.AdhocCountQueryPOST(type.name).entity(query, 'text'); + } else { + msg = new message.AdhocCountQuery(type.name, query); + } + + return this.entityManager.send(msg).then(function (response) { + return response.entity.count; + }).then(doneCallback, failCallback); + }; + + Node.prototype._serializeQuery = function _serializeQuery() { + return JSON.stringify(this, function (k, v) { + var typedValue = this[k]; + if (Object(typedValue) instanceof Date) { + return { $date: v }; + } else if (typedValue instanceof Entity) { + return typedValue.id; + } else { + return v; + } + }); + }; + + Node.prototype._serializeSort = function _serializeSort() { + return JSON.stringify(this._sort); + }; + + Node.prototype._createResultList = function _createResultList(result, options) { + if (result.length) { + return Promise.all(result.map(function (el) { + if (el.id) { + var entity = this.entityManager.getReference(this.resultClass, el.id); + var metadata = Metadata.get(entity); + metadata.setJson(el, true); + return this.entityManager.resolveDepth(entity, options); + } else { + return this.entityManager.load(Object.keys(el)[0]); + } + }, this)).then(function (result) { + return result.filter(function (val) { + return !!val; + }); + }); + } else { + return Promise.resolve([]); + } + }; + + Node.prototype._addOrder = function _addOrder(fieldOrSort, order) { + if (order) { + this._sort[fieldOrSort] = order; + } else { + this._sort = fieldOrSort; + } + return this; + }; + + Node.prototype._addOffset = function _addOffset(offset) { + this.firstResult = offset; + return this; + }; + + Node.prototype._addLimit = function _addLimit(limit) { + this.maxResults = limit; + return this; + }; + + return Node; +}(Query); + +module.exports = Node; + +},{"10":10,"36":36,"58":58,"63":63}],57:[function(_dereq_,module,exports){ +"use strict"; + +var Node = _dereq_(56); + +/** + * @alias query.Operator + * @extends query.Node + */ + +var Operator = function (_Node) { + babelHelpers.inherits(Operator, _Node); + + /** + * @param {EntityManager} entityManager The owning entity manager of this query + * @param {Class} resultClass The query result class + * @param {string} operator The operator used to join the childs + * @param {Array>} childs The childs to join + */ + function Operator(entityManager, resultClass, operator, childs) { + babelHelpers.classCallCheck(this, Operator); + + /** + * The operator used to join the child queries + * @type string + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Node.call(this, entityManager, resultClass)); + + _this._operator = operator; + /** + * The child Node of this query, it is always one + * @type Array + */ + _this._childs = childs; + return _this; + } + + Operator.prototype.toJSON = function toJSON() { + var json = {}; + json[this._operator] = this._childs; + return json; + }; + + return Operator; +}(Node); + +module.exports = Operator; + +},{"56":56}],58:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias query.Query + */ + +var Query = function () { + function Query(entityManager, resultClass) { + babelHelpers.classCallCheck(this, Query); + + /** + * The owning EntityManager of this query + * @type EntityManager + */ + this.entityManager = entityManager; + + /** + * The result class of this query + * @type Class + */ + this.resultClass = resultClass; + } + + /** + * Add an ascending sort for the specified field to this query + * @param {string} field The field to sort + * @return {query.Query} The resulting Query + */ + + + Query.prototype.ascending = function ascending(field) { + return this._addOrder(field, 1); + }; + + /** + * Add an decending sort for the specified field to this query + * @param {string} field The field to sort + * @return {query.Query} The resulting Query + */ + + + Query.prototype.descending = function descending(field) { + return this._addOrder(field, -1); + }; + + /** + * Sets the sort of the query and discard all existing paramaters + * @param {Object} sort The new sort of the query + * @return {query.Query} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/method/cursor.sort/ + */ + + + Query.prototype.sort = function sort(_sort) { + if (!(_sort instanceof Object) || Object.getPrototypeOf(_sort) != Object.prototype) throw new Error('sort must be an object.'); + + return this._addOrder(_sort); + }; + + /** + * Sets the offset of the query, i.e. how many elements should be skipped + * @param {number} offset The offset of this query + * @return {query.Query} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/method/cursor.skip/ + */ + + + Query.prototype.offset = function offset(_offset) { + if (_offset < 0) throw new Error("The offset can't be nagative."); + + return this._addOffset(_offset); + }; + + /** + * Sets the limit of this query, i.e hox many objects should be returnd + * @param {number} limit The limit of this query + * @return {query.Query} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/method/cursor.limit/ + */ + + + Query.prototype.limit = function limit(_limit) { + if (_limit < 0) throw new Error("The limit can't be nagative."); + + return this._addLimit(_limit); + }; + + /** + * Execute the query and return the query results as a List. + * Note: All local unsaved changes on matching objects, will be discarded. + * @param {Object} [options] The query options + * @param {number|boolean} [options.depth=0] The object depth which will be loaded. Depth 0 load only the found + * objects, true loads the objects by reachability. + * @param {query.Query~resultListCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise>} A promise that will be resolved with the query result as a list + */ + + + Query.prototype.resultList = function resultList(options, doneCallback, failCallback) {}; + + /** + * Execute the query and return the query results as a List. + * Note: All local unsaved changes on matching objects, will be discarded. + * @param {query.Query~resultListCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise>} A promise that will be resolved with the query result as a list + * @name resultList + * @memberOf query.Query.prototype + * @method + */ + + /** + * Execute the query that returns a single result. + * Note: All local unsaved changes on the matched object, will be discarded. + * @param {Object} [options] The query options + * @param {number|boolean} [options.depth=0] The object depth which will be loaded. Depth 0 load only the found + * object, true loads the objects by reachability. + * @param {query.Query~singleResultCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A promise that will be resolved with the query result as a single result + */ + + + Query.prototype.singleResult = function singleResult(options, doneCallback, failCallback) {}; + + /** + * Execute the query that returns a single result. + * Note: All local unsaved changes on the matched object, will be discarded. + * @param {query.Query~singleResultCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A promise that will be resolved with the query result as a single result + * @name singleResult + * @memberOf query.Query.prototype + * @method + */ + + /** + * Returns an RxJS observable that receives events for streaming query. + * @param {Object} [options] options on whether an initial result and what kind of events (w.r.t. match types and operations) are requested + * @param {boolean} [options.initial=true] whether or not you want to receive the initial result set (i.e. the entities matching the query at subscription time) + * @param {(string|Array)} [options.matchTypes=['all']] the match types you are interested in; accepts the default ('all'/['all']) or any combination of 'match', 'add', 'change', 'changeIndex' and 'remove' + * @param {(string|Array)} [options.operations=['any']] the operations you are interested in; accepts the default ('any'/['any']) or any combination of 'insert', 'update', 'delete' and 'none' + * @return {Observable>} an RxJS observable + */ + + + Query.prototype.stream = function stream(options) {}; + + /** + * Execute the query that returns the matching objects count. + * @param {query.Query~countCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise} The total number of matched objects + */ + + + Query.prototype.count = function count(doneCallback, failCallback) {}; + + return Query; +}(); + +Query.MAX_URI_SIZE = 2000; + +Query.varargs = function varargs(offset, args) { + return Array.prototype.concat.apply([], Array.prototype.slice.call(args, offset)); +}; + +module.exports = Query; + +/** + * The resultList callback is called, when the asynchronous query operation completes successfully + * @callback query.Query~resultListCallback + * @param {Array} result The query result list, an empty list if no match was found + * @return {Promise<*>|*} A Promise, result or undefined + */ + +/** + * The singleResult callback is called, when the asynchronous query operation completes successfully + * @callback query.Query~singleResultCallback + * @param {T} entity The matching object or null id no matching object was found + * @return {Promise<*>|*} A Promise, result or undefined + */ + +/** + * The count callback is called, when the asynchronous query operation completes successfully + * @callback query.Query~countCallback + * @param {number} count the matching object count + * @return {Promise<*>|*} A Promise, result or undefined + */ + +/** + * The fail callback is called, when the asynchronous query operation is rejected by an error + * @callback query.Query~failCallback + * @param {error.PersistentError} error The error which reject the operation + * @return {Promise<*>|*} A Promise, result or undefined + */ + +},{}],59:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace query + */ + +exports.Builder = _dereq_(53); +exports.Condition = _dereq_(54); +exports.Filter = _dereq_(55); +exports.Node = _dereq_(56); +exports.Operator = _dereq_(57); +exports.Query = _dereq_(58); + +},{"53":53,"54":54,"55":55,"56":56,"57":57,"58":58}],60:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var StatusCode = _dereq_(25).StatusCode; + +/** + * @alias util.Code + * @param {metamodel.Metamodel} metamodel + */ + +var Code = function () { + function Code(metamodel, entityManagerFactory) { + babelHelpers.classCallCheck(this, Code); + + /** + * @private + * @type metamodel.Metamodel + */ + this._metamodel = metamodel; + /** @type EntityManagerFactory */ + this.entityManagerFactory = entityManagerFactory; + } + + /** + * Converts the given function to a string + * @param {Function} fn The JavaScript function to serialize + * @return {string} The serialized function + */ + + + Code.prototype.functionToString = function functionToString(fn) { + if (!fn) return ""; + + var str = fn.toString(); + str = str.substring(str.indexOf("{") + 1, str.lastIndexOf("}")); + if (str.charAt(0) == '\n') str = str.substring(1); + + if (str.charAt(str.length - 1) == '\n') str = str.substring(0, str.length - 1); + + return str; + }; + + /** + * Converts the given string to a module wrapper function + * @param {Array} signature The expected parameters of the function + * @param {string} code The JavaScript function to deserialize + * @return {Function} The deserialized function + */ + + + Code.prototype.stringToFunction = function stringToFunction(signature, code) { + return new Function(signature, code); + }; + + /** + * Loads a list of all available modules + * Does not include handlers + * + * @returns {Promise>} + */ + + + Code.prototype.loadModules = function loadModules() { + var msg = new message.GetAllModules(); + return this.entityManagerFactory.send(msg).then(function (response) { + return response.entity; + }); + }; + + /** + * Loads Baqend code which will be identified by the given bucket and code codeType + * + * @param {metamodel.ManagedType|string} type The entity type for the handler or the Name of the + * Baqend code + * @param {string} codeType The type of the code + * @param {boolean} [asFunction=false] set it to true, to parse the code as a function and return it + * instead of a string + * @returns {Promise} The code as string or as a parsed function + */ + + + Code.prototype.loadCode = function loadCode(type, codeType, asFunction) { + var _this = this; + + var bucket = Object(type) instanceof String ? type : type.name; + var msg = new message.GetBaqendCode(bucket, codeType).responseType('text'); + + return this.entityManagerFactory.send(msg).then(function (response) { + return _this._parseCode(bucket, codeType, asFunction, response.entity); + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) return null; + + throw e; + }); + }; + + /** + * Saves Baqend code which will be identified by the given bucket and code type + * + * @param {metamodel.ManagedType|string} type The entity type for the handler or the Name of the + * Baqend code + * @param {string} codeType The type of the code + * @param {string|Function} fn Baqend code as a string or function + * @return {Promise} The stored code as a string or as a parsed function + */ + + + Code.prototype.saveCode = function saveCode(type, codeType, fn) { + var _this2 = this; + + var bucket = Object(type) instanceof String ? type : type.name; + var asFunction = fn instanceof Function; + + var msg = new message.SetBaqendCode(bucket, codeType).entity(asFunction ? this.functionToString(fn) : fn, 'text').responseType('text'); + + return this.entityManagerFactory.send(msg).then(function (response) { + return _this2._parseCode(bucket, codeType, asFunction, response.entity); + }); + }; + + /** + * Deletes Baqend code identified by the given bucket and code type + * + * @param {metamodel.ManagedType|string} type The entity type for the handler or the Name of the + * Baqend code + * @param {string} codeType The type of the code + * @returns {Promise<*>} succeed if the code was deleted + */ + + + Code.prototype.deleteCode = function deleteCode(type, codeType) { + var _this3 = this; + + var bucket = Object(type) instanceof String ? type : type.name; + var msg = new message.DeleteBaqendCode(bucket, codeType); + return this.entityManagerFactory.send(msg).then(function () { + return _this3._parseCode(bucket, codeType, false, null); + }); + }; + + Code.prototype._parseCode = function _parseCode(bucket, codeType, asFunction, code) { + if (codeType == 'validate') { + var type = this._metamodel.entity(bucket); + type.validationCode = code; + return asFunction ? type.validationCode : code; + } else { + return asFunction ? this.stringToFunction(['module', 'exports'], code) : code; + } + }; + + return Code; +}(); + +module.exports = Code; + +},{"25":25,"36":36}],61:[function(_dereq_,module,exports){ +"use strict"; + +/** + * This base class provides an lock interface to execute exclusive operations + * @alias util.Lockable + */ + +var Lockable = function () { + function Lockable() { + babelHelpers.classCallCheck(this, Lockable); + + /** + * Indicates if there is currently an onging exclusive operation + * @type boolean + * @private + */ + this._isLocked = false; + + /** + * A promise which represents the state of the least exclusive operation + * @type Promise + * @private + */ + this._readyPromise = Promise.resolve(this); + + /** + * A deferred used to explicit lock and unlock this instance + * @private + */ + this._deferred = null; + } + + /** + * Indicates if there is currently no exclusive operation executed + * true If no exclusive lock is hold + * @type {boolean} + */ + + + /** + * Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled + * @param {util.Lockable~callback=} doneCallback The callback which will be invoked when the previously + * operations on this object is completed. + * @param {util.Lockable~callback=} failCallback When the lock can't be released caused by a none + * recoverable error + * @return {Promise} A promise which completes successfully, when the previously requested + * operation completes + */ + Lockable.prototype.ready = function ready(doneCallback, failCallback) { + return this._readyPromise.then(doneCallback, failCallback); + }; + + /** + * Try to aquire an exclusive lock and executes the given callback. + * @param {util.Lockable~callback} callback The exclusive operation to execute + * @param {boolean} [critical=false] Indicates if the operation is critical. If the operation is critical and the + * operation fails, then the lock will not be released + * @return {Promise} A promise + * @throws {Error} If the lock can't be aquired + * @protected + */ + + + Lockable.prototype.withLock = function withLock(callback, critical) { + if (this._isLocked) throw new Error('Current operation has not been finished.'); + + var self = this; + try { + this._isLocked = true; + var result = callback().then(function (result) { + self._isLocked = false; + return result; + }, function (e) { + if (!critical) self._isLocked = false; + throw e; + }); + + this._readyPromise = result.then(function () { + return self; + }, function (e) { + if (!critical) return self; + throw e; + }); + + return result; + } catch (e) { + if (critical) { + this._readyPromise = Promise.reject(e); + } else { + this._isLocked = false; + } + throw e; + } + }; + + babelHelpers.createClass(Lockable, [{ + key: "isReady", + get: function get() { + return !this._isLocked; + } + }]); + return Lockable; +}(); + +module.exports = Lockable; + +/** + * The operation callback is used by the {@link util.Lockable#withLock} method, + * to perform an exclusive operation on the + * @callback util.Lockable~callback + * @return {Promise<*>} A Promise, which reflects the result of the operation + */ + +},{}],62:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var StatusCode = _dereq_(25).StatusCode; + +/** + * @alias util.Logger + */ + +var Logger = function () { + function Logger() { + babelHelpers.classCallCheck(this, Logger); + } + + Logger.create = function create(entityManager) { + var proto = this.prototype; + + function Logger() { + proto.log.apply(Logger, arguments); + } + + for (var _iterator = Object.getOwnPropertyNames(proto), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var key = _ref; + + Object.defineProperty(Logger, key, Object.getOwnPropertyDescriptor(proto, key)); + }Logger._init(entityManager); + + return Logger; + }; + + /** + * The log level which will be logged + * + * The log level can be one of 'trace', 'debug', 'info', 'warn', 'error' + * @type string + */ + + + /** + * Logs a message in the default level 'info' + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * + * @name log + * @memberOf util.Logger.prototype + * @function + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Logs a message in the default level 'info' + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * + * @name log + * @memberOf util.Logger.prototype + * @function + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Logs a message with the given log level + * @param {string} level The level used to log the message + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @name log + * @memberOf util.Logger.prototype + * @function + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Logs a message with the given log level + * @param {string} level The level used to log the message + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + Logger.prototype.log = function log(level, message, data) { + var args = Array.prototype.slice.call(arguments); + + if (Logger.LEVELS.indexOf(args[0]) == -1) { + level = 'info'; + } else { + level = args.shift(); + } + + if (this.levelIndex > Logger.LEVELS.indexOf(level)) return; + + message = typeof args[0] === 'string' ? this._format(args.shift(), args) : '[no message]'; + data = null; + if (args.length && babelHelpers.typeof(args[args.length - 1]) === 'object') { + data = args.pop(); + if (Array.isArray(data)) data = { data: data }; + } + + if (args.length) { + message += ", " + args.join(", "); + } + + return this._log({ + date: new Date(), + message: message, + level: level, + user: this.entityManager.me && this.entityManager.me.id, + data: data + }); + }; + + Logger.prototype._format = function _format(f, args) { + if (args.length == 0) return f; + + var str = String(f).replace(Logger.FORMAT_REGEXP, function (x) { + if (x === '%%') return '%'; + if (!args.length) return x; + switch (x) { + case '%s': + return String(args.shift()); + case '%d': + return Number(args.shift()); + case '%j': + try { + return JSON.stringify(args.shift()); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + + return str; + }; + + Logger.prototype._init = function _init(entityManager) { + var _this = this; + + /** @type EntityManager */ + this.entityManager = entityManager; + this.levelIndex = 2; + + Logger.LEVELS.forEach(function (level) { + _this[level] = _this.log.bind(_this, level); + }); + }; + + Logger.prototype._log = function _log(json) { + if (!this.entityManager.isReady) { + return this.entityManager.ready(this._log.bind(this, json)); + } else { + return this.entityManager.send(new message.CreateObject('logs.AppLog', json)); + } + }; + + /** + * Log message at trace level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function trace + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at trace level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function trace + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at debug level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function debug + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at debug level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function debug + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at info level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function info + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at info level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function info + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at warn level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function warn + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at warn level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function warn + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at error level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function error + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at error level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function error + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + + babelHelpers.createClass(Logger, [{ + key: 'level', + get: function get() { + return Logger.LEVELS[this.levelIndex]; + } + + /** + * Sets the log level which will be logged + * @param {string} value + */ + , + set: function set(value) { + var index = Logger.LEVELS.indexOf(value); + if (index == -1) throw new Error("Unknown logging level " + value); + + this.levelIndex = index; + } + }]); + return Logger; +}(); + +Object.assign(Logger, { + LEVELS: ['trace', 'debug', 'info', 'warn', 'error'], + FORMAT_REGEXP: /%[sdj%]/g +}); + +module.exports = Logger; + +},{"25":25,"36":36}],63:[function(_dereq_,module,exports){ +"use strict"; + +var error = _dereq_(34); +var Acl = _dereq_(1); +var Lockable = _dereq_(61); +var binding = _dereq_(20); + +/** + * @alias util.Metadata + * @extends util.Lockable + */ + +var Metadata = function (_Lockable) { + babelHelpers.inherits(Metadata, _Lockable); + + Metadata.create = function create(type, object) { + var metadata; + if (type.isEntity) { + metadata = new Metadata(object, type); + } else if (type.isEmbeddable) { + metadata = { + type: type, + readAccess: function readAccess() { + var metadata = this._root && this._root._metadata; + if (metadata) metadata.readAccess(); + }, + writeAccess: function writeAccess() { + var metadata = this._root && this._root._metadata; + if (metadata) metadata.writeAccess(); + } + }; + } else { + throw new Error('Illegal type ' + type); + } + + return metadata; + }; + + /** + * Returns the metadata of the managed object + * @param {binding.Managed} managed + * @return {util.Metadata} + */ + + + Metadata.get = function get(managed) { + return managed._metadata; + }; + + /** + * @type EntityManager + */ + + + babelHelpers.createClass(Metadata, [{ + key: 'db', + get: function get() { + if (this._db) return this._db; + + return this._db = _dereq_(6); + } + + /** + * @param db {EntityManager} + */ + , + set: function set(db) { + if (!this._db) { + this._db = db; + } else { + throw new Error("DB has already been set."); + } + } + + /** + * @type string + */ + + }, { + key: 'bucket', + get: function get() { + return this.type.name; + } + + /** + * @type string + */ + + }, { + key: 'key', + get: function get() { + if (!this._key && this.id) { + var index = this.id.lastIndexOf('/'); + this._key = decodeURIComponent(this.id.substring(index + 1)); + } + return this._key; + } + + /** + * @param {string} value + */ + , + set: function set(value) { + value += ''; + + if (this.id) throw new Error('The id can\'t be set twice.'); + + this.id = '/db/' + this.bucket + '/' + encodeURIComponent(value); + this._key = value; + } + + /** + * Indicates if this object already belongs to an db + * true if this object belongs already to an db otherwise false + * @type boolean + */ + + }, { + key: 'isAttached', + get: function get() { + return !!this._db; + } + + /** + * Indicates if this object is represents a db object, but was not loaded up to now + * @type boolean + */ + + }, { + key: 'isAvailable', + get: function get() { + return this._state > Metadata.Type.UNAVAILABLE; + } + + /** + * Indicates if this object represents the state of the db and was not modified in any manner + * @type boolean + */ + + }, { + key: 'isPersistent', + get: function get() { + return this._state == Metadata.Type.PERSISTENT; + } + + /** + * Indicates that this object was modified and the object was not written back to the db + * @type boolean + */ + + }, { + key: 'isDirty', + get: function get() { + return this._state == Metadata.Type.DIRTY; + } + + /** + * @param {binding.Entity} entity + * @param {metamodel.ManagedType} type + */ + + }]); + + function Metadata(entity, type) { + babelHelpers.classCallCheck(this, Metadata); + + /** + * @type binding.Entity + * @private + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Lockable.call(this)); + + _this._root = entity; + _this._state = Metadata.Type.DIRTY; + _this._enabled = true; + _this.persisting = false; + /** @type string */ + _this.id = null; + /** @type number */ + _this.version = null; + /** @type metamodel.ManagedType */ + _this.type = type; + /** @type Acl */ + _this.acl = new Acl(_this); + return _this; + } + + /** + * Signals that the object will be access by a read access + * Ensures that the object was loaded already + */ + + + Metadata.prototype.readAccess = function readAccess() { + if (this._enabled) { + if (!this.isAvailable) { + throw new error.PersistentError('This object ' + this.id + ' is not available.'); + } + } + }; + + /** + * Signals that the object will be access by a write access + * Ensures that the object was loaded already and marks the object as dirty + */ + + + Metadata.prototype.writeAccess = function writeAccess() { + if (this._enabled) { + if (!this.isAvailable) { + throw new error.PersistentError('This object ' + this.id + ' is not available.'); + } + + this.setDirty(); + } + }; + + /** + * Indicates that the associated object isn't available + */ + + + Metadata.prototype.setUnavailable = function setUnavailable() { + this._state = Metadata.Type.UNAVAILABLE; + }; + + /** + * Indicates that the associated object isn't stale, i.e. + * the object correlate the database state and is not modified by the user + */ + + + Metadata.prototype.setPersistent = function setPersistent() { + this._state = Metadata.Type.PERSISTENT; + }; + + /** + * Indicates the the object is modified by the user + */ + + + Metadata.prototype.setDirty = function setDirty() { + this._state = Metadata.Type.DIRTY; + }; + + /** + * Indicates the the object is removed + */ + + + Metadata.prototype.setRemoved = function setRemoved() { + //mark the object only as dirty if it was already available + if (this.isAvailable) { + this.setDirty(); + this.version = null; + } + }; + + Metadata.prototype.getJsonMetadata = function getJsonMetadata() { + var info = {}; + + if (this.id) { + info.id = this.id; + } + + if (this.version) { + info.version = this.version; + } + + info.acl = this.acl; + + return info; + }; + + /** + * Sets the object metadata from the object + * @param {Object} json + */ + + + Metadata.prototype.setJsonMetadata = function setJsonMetadata(json) { + if (!this.id) { + this.id = json.id; + } + + if (json.version) this.version = json.version; + + this.acl.fromJSON(json.acl || {}); + }; + + /** + * Converts the object to an JSON-Object + * @param {boolean} [excludeMetadata=false] + * @param {boolean} [persisting=false] indicates if the current state will be persisted. + * Used to update the internal change tracking state of collections and mark the object persistent if its true + * @returns {json} JSON-Object + */ + + + Metadata.prototype.getJson = function getJson(excludeMetadata, persisting) { + this._enabled = false; + this.persisting = !!persisting; + var json = this.type.toJsonValue(this, this._root, true); + this._enabled = true; + this.persisting = false; + + if (this.isAttached && !excludeMetadata) { + Object.assign(json, this.getJsonMetadata()); + } + + return json; + }; + + /** + * Sets the object content from json + * @param {json} json The updated json content + * @param {boolean} [persisting=false] indicates if the current state will be persisted. + * Used to update the internal change tracking state of collections and mark the object persistent or dirty afterwards + */ + + + Metadata.prototype.setJson = function setJson(json, persisting) { + if (json.id || json.version || json.acl) { + this.setJsonMetadata(json); + } + + this._enabled = false; + this.persisting = !!persisting; + this.type.fromJsonValue(this, json, this._root, true); + this._enabled = true; + this.persisting = false; + + if (persisting) { + this.setPersistent(); + } else { + this.setDirty(); + } + }; + + return Metadata; +}(Lockable); + +/** + * @enum {number} + */ + + +Metadata.Type = { + UNAVAILABLE: -1, + PERSISTENT: 0, + DIRTY: 1 +}; + +module.exports = Metadata; + +},{"1":1,"20":20,"34":34,"6":6,"61":61}],64:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); + +/** + * @alias util.Modules + */ + +var Modules = function () { + + /** + * @param {EntityManager} entityManager + * @param {connector.Connector} connector + */ + function Modules(entityManager, connector) { + babelHelpers.classCallCheck(this, Modules); + + /** + * @type EntityManager + */ + this._entityManager = entityManager; + /** + * The connector used for requests + * @type connector.Connector + */ + this._connector = connector; + } + + /** + * Calls the module, which is identified by the given bucket. + * The optional query parameter will be attached as GET-parameters. + * + * @param {string} bucket Name of the module + * @param {Object|string=} query GET-Parameter as key-value-pairs or query string + * @param {Object=} options Additional request options + * @param {string=} options.responseType The type used to provide the response data, defaults to text oder json depends + * on the received data, can be one of arraybuffer, blob, json, text, base64, data-url + * @param {Function=} doneCallback + * @param {Function=} failCallback + * @returns {Promise} + */ + + + Modules.prototype.get = function get(bucket, query, options, doneCallback, failCallback) { + if (query instanceof Function) { + failCallback = options; + doneCallback = query; + options = {}; + query = null; + } + + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + options = options || {}; + + var msg = new message.GetBaqendModule(bucket).addQueryString(query).responseType(options.responseType || null); + + return this._send(msg, doneCallback, failCallback); + }; + + /** + * Calls the module, which is identified by the given bucket. + * + * @param {string} bucket Name of the module + * @param body {string|Blob|File|ArrayBuffer|FormData|json=} The POST-body data to send + * @param {Object=} options Additional request options + * @param {string=} options.requestType A optional type hint used to correctly interpret the provided data, can be one of + * arraybuffer, blob, json, text, base64, data-url, form + * @param {string=} options.mimeType The mimType of the body. Defaults to the mimeType of the provided data if + * it is a file object, blob or data-url + * @param {string=} options.responseType The type used to provide the response data, defaults to text oder json depends + * on the received data, can be one of arraybuffer, blob, json, text, base64, data-url + * @param {Function=} doneCallback + * @param {Function=} failCallback + * @returns {Promise} + */ + + + Modules.prototype.post = function post(bucket, body, options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + options = options || {}; + + var msg = new message.PostBaqendModule(bucket).entity(body, options.requestType).mimeType(options.mimeType || null).responseType(options.responseType || null); + + return this._send(msg, doneCallback, failCallback); + }; + + Modules.prototype._send = function _send(msg, doneCallback, failCallback) { + return this._entityManager.send(msg).then(function (response) { + return response.entity; + }).then(doneCallback, failCallback); + }; + + return Modules; +}(); + +module.exports = Modules; + +},{"36":36}],65:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias util.Permission + */ + +var Permission = function () { + + /** + * Creates a new Permission object, with an empty rule set + * @param {util.Metadata} metadata The metadata of the object + */ + function Permission(metadata) { + babelHelpers.classCallCheck(this, Permission); + + /** @type {Object.} */ + this._rules = {}; + /** @type util.Metadata */ + this._metadata = metadata; + } + + /** + * Returns a list of user and role references of all rules + * @return {Array} a list of references + */ + + + Permission.prototype.allRules = function allRules() { + return Object.keys(this._rules); + }; + + /** + * Removes all rules from this permission object + */ + + + Permission.prototype.clear = function clear() { + this._metadata && this._metadata.writeAccess(); + this._rules = {}; + }; + + /** + * Copies permissions from another permission object + * @param {util.Permission} permission The permission to copy from + * @return {util.Permission} + */ + + + Permission.prototype.copy = function copy(permission) { + this._metadata && this._metadata.writeAccess(); + this._rules = Object.assign({}, permission._rules); + return this; + }; + + /** + * Gets whenever all users and roles have the permission to perform the operation + * @return {boolean} true If public access is allowed + */ + + + Permission.prototype.isPublicAllowed = function isPublicAllowed() { + if ('*' in this._rules) return false; + + for (var ref in this._rules) { + if (this._rules[ref] == 'allow') { + return false; + } + } + + return true; + }; + + /** + * Sets whenever all users and roles should have the permission to perform the operation. + * Note: All other allow rules will be removed. + */ + + + Permission.prototype.setPublicAllowed = function setPublicAllowed() { + this._metadata && this._metadata.writeAccess(); + for (var ref in this._rules) { + if (this._rules[ref] == 'allow') { + delete this._rules[ref]; + } + } + }; + + /** + * Returns the actual rule of the given user or role. + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {string} The actual access rule or undefined if no rule was found + */ + + + Permission.prototype.getRule = function getRule(userOrRole) { + return this._rules[this._getRef(userOrRole)]; + }; + + /** + * Checks whenever the user or role is explicit allowed to perform the operation. + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + */ + + + Permission.prototype.isAllowed = function isAllowed(userOrRole) { + return this._rules[this._getRef(userOrRole)] == 'allow'; + }; + + /** + * Checks whenever the user or role is explicit denied to perform the operation. + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + */ + + + Permission.prototype.isDenied = function isDenied(userOrRole) { + return this._rules[this._getRef(userOrRole)] == 'deny'; + }; + + /** + * Allows the given users or rules to perform the operation + * @param {...(model.User|model.Role|string)} userOrRole The users or roles to allow + * @return {util.Permission} this permission object + */ + + + Permission.prototype.allowAccess = function allowAccess(userOrRole) { + var rules = arguments; + this._metadata && this._metadata.writeAccess(); + for (var i = 0; i < rules.length; i++) { + this._rules[this._getRef(rules[i])] = 'allow'; + } + return this; + }; + + /** + * Denies the given users or rules to perform the operation + * @param {...(model.User|model.Role|string)} userOrRole The users or roles to deny + * @return {util.Permission} this permission object + */ + + + Permission.prototype.denyAccess = function denyAccess(userOrRole) { + var rules = arguments; + this._metadata && this._metadata.writeAccess(); + for (var i = 0; i < rules.length; i++) { + this._rules[this._getRef(rules[i])] = 'deny'; + } + return this; + }; + + /** + * Deletes any allow/deny rules for the given users or roles + * @param {...(model.User|model.Role|string)} userOrRole The users or roles to delete rules for + * @return {util.Permission} this permission object + */ + + + Permission.prototype.deleteAccess = function deleteAccess(userOrRole) { + var rules = arguments; + this._metadata && this._metadata.writeAccess(); + for (var i = 0; i < rules.length; i++) { + delete this._rules[this._getRef(rules[i])]; + } + return this; + }; + + /** + * A Json representation of the set of rules + * @return {json} + */ + + + Permission.prototype.toJSON = function toJSON() { + return this._rules; + }; + + /** + * Sets the permission rules from json + * @param {json} json The permission json representation + */ + + + Permission.prototype.fromJSON = function fromJSON(json) { + this._rules = json; + }; + + /** + * Creates a permission from the given rules. + * @param {json} json The rules. + * @return {util.Permission} The permission. + */ + + + Permission.fromJSON = function fromJSON(json) { + var permission = new this(); + permission.fromJSON(json); + return permission; + }; + + /** + * Resolves user and role references and validate given references + * @param {model.User|model.Role|string} userOrRole The user, role or reference + * @return {string} The resolved and validated reference + * @private + */ + + + Permission.prototype._getRef = function _getRef(userOrRole) { + if (typeof userOrRole !== 'string') { + userOrRole = userOrRole._metadata.id; + } + + if (userOrRole.indexOf('/db/User/') == 0 || userOrRole.indexOf('/db/Role/') == 0) { + return userOrRole; + } + + throw new TypeError('The given object isn\'t a user, role or a valid reference.'); + }; + + return Permission; +}(); + +Permission.BASE_PERMISSIONS = ['load', 'update', 'delete', 'query', 'insert']; +module.exports = Permission; + +},{}],66:[function(_dereq_,module,exports){ +"use strict"; + +var Entity = _dereq_(10); + +/** + * @alias util.PushMessage + */ + +var PushMessage = function () { + + /** + * Push message will be used to send a push notification to a set of devices + * + * @param {Set|Array} [devices] The Set of device references which + * will receive this push notification. + * @param {string=} message The message of the push notification. + * @param {string=} subject The subject of the push notification. + * @param {string=} sound The file reference of the sound file as a string. The device uses this file as the + * notification sound. + * @param {number=} badge The badge count. + * @param {Object=} data The data object which can contain additional information. + */ + function PushMessage(devices, message, subject, sound, badge, data) { + babelHelpers.classCallCheck(this, PushMessage); + + /** + * Set of devices + * @type Set + */ + this.devices = null; + + if (devices instanceof Set) { + this.devices = devices; + } else if (!devices || devices[Symbol.iterator]) { + this.devices = new Set(devices); + } else if (devices instanceof Entity) { + this.devices = new Set(); + this.devices.add(devices); + } else { + throw new Error("Only Sets, Lists and Arrays can be used as devices."); + } + + /** + * push notification message + * @type string + */ + this.message = message; + + /** + * push notification subject + * @type string + */ + this.subject = subject; + + /** + * push notification sound + * @type string + */ + this.sound = sound; + + /** + * badge count + * @type number + */ + this.badge = badge; + + /** + * data object + * @type json + */ + this.data = data; + } + + /** + * Adds a new object to the set of devices + * + * @param {binding.Entity} device will be added to the device set to receive the push notification + */ + + + PushMessage.prototype.addDevice = function addDevice(device) { + if (!this.devices) { + this.devices = new Set(); + } + + this.devices.add(device); + }; + + PushMessage.prototype.toJSON = function toJSON() { + if (!this.devices || !this.devices.size) throw new Error("Set of devices is empty."); + + return Object.assign({}, this, { + devices: Array.from(this.devices, function (device) { + return device.id; + }) + }); + }; + + return PushMessage; +}(); + +module.exports = PushMessage; + +},{"10":10}],67:[function(_dereq_,module,exports){ +"use strict"; + +var hmac = _dereq_(71).hmac; + +/** + * @interface util.TokenStorageFactory + */ + +/** + * Creates a new tokenStorage which persist tokens for the given origin + * @param {string} origin The origin where the token contains to + * @return {Promise} The initialized token storage + * @name create + * @memberOf util.TokenStorageFactory.prototype + * @method + */ + +/** + * @alias util.TokenStorage + */ + +var TokenStorage = function () { + TokenStorage.create = function create(origin) { + return Promise.resolve(new TokenStorage(origin)); + }; + + /** + * @param {string} origin The origin where the token belongs to + * @param {string} token The initial token + * @param {boolean=} temporary If the token should be saved temporary or permanently + */ + + + babelHelpers.createClass(TokenStorage, [{ + key: 'token', + + /** + * Get the stored token + * @returns {string} The token or undefined, if no token is available + */ + get: function get() { + return this._token; + } + }]); + + function TokenStorage(origin, token, temporary) { + babelHelpers.classCallCheck(this, TokenStorage); + + /** + * The actual stored token + */ + this._token = token || null; + this._origin = origin; + /** + * Indicates if the token should keep temporary only or should be persisted for later sessions + * @type boolean + */ + this.temporary = temporary; + } + + /** + * Use the underlying storage implementation to save the token + * @param {string} origin The origin where the token belongs to + * @param {string} token The initial token + * @param {boolean} temporary If the token should be saved temporary or permanently + * @protected + * @abstract + */ + + + TokenStorage.prototype._saveToken = function _saveToken(origin, token, temporary) {}; + + /** + * Update the token for the givin origin, the operation may be asynchronous + * @param {String} token The token to store or null to remove the token + */ + + + TokenStorage.prototype.update = function update(token) { + this._token = token; + this._saveToken(this._origin, this._token, this.temporary); + }; + + /** + * Derived a resource token from the the stored origin token for the resource and signs the resource with the + * generated resource token + * @param {string} resource The resource which will be accessible with the returned token + * @returns {string} A resource token which can only be used to access the specified resource + */ + + + TokenStorage.prototype.signPath = function signPath(resource) { + var token = this.token; + if (token) { + var data = token.substring(0, token.length - 40); + var sig = token.substring(data.length); + + var path = resource.split('/').map(encodeURIComponent).join('/'); + return path + '?BAT=' + (data + hmac(resource + data, sig)); + } + return resource; + }; + + return TokenStorage; +}(); + +var tokens = {}; +/** + * @ignore + */ + +var GlobalStorage = function (_TokenStorage) { + babelHelpers.inherits(GlobalStorage, _TokenStorage); + + function GlobalStorage() { + babelHelpers.classCallCheck(this, GlobalStorage); + return babelHelpers.possibleConstructorReturn(this, _TokenStorage.apply(this, arguments)); + } + + GlobalStorage.create = function create(origin) { + return Promise.resolve(new GlobalStorage(origin, tokens[origin])); + }; + + /** + * @inheritDoc + */ + + + GlobalStorage.prototype._saveToken = function _saveToken(origin, token, temporary) { + if (!temporary) { + if (token) { + tokens[origin] = token; + } else { + delete tokens[origin]; + } + } + }; + + return GlobalStorage; +}(TokenStorage); + +/** + * @alias util.TokenStorage.GLOBAL + * @type {util.TokenStorageFactory} + */ + + +TokenStorage.GLOBAL = GlobalStorage; + +/** + * @ignore + */ + +var WebStorage = function (_TokenStorage2) { + babelHelpers.inherits(WebStorage, _TokenStorage2); + + function WebStorage() { + babelHelpers.classCallCheck(this, WebStorage); + return babelHelpers.possibleConstructorReturn(this, _TokenStorage2.apply(this, arguments)); + } + + WebStorage.isAvailable = function isAvailable() { + try { + //firefox throws an exception if cookies are disabled + if (typeof localStorage === 'undefined') { + return false; + } + + localStorage.setItem('bq_webstorage_test', 'bq'); + localStorage.removeItem('bq_webstorage_test'); + return true; + } catch (e) {} + return false; + }; + + WebStorage.create = function create(origin) { + var temporary = false; + var token = localStorage.getItem('BAT:' + origin); + if (!token) { + token = sessionStorage.getItem('BAT:' + origin); + temporary = !!token; + } + + return Promise.resolve(new WebStorage(origin, token, temporary)); + }; + + /** + * @inheritDoc + */ + + + WebStorage.prototype._saveToken = function _saveToken(origin, token, temporary) { + var webStorage = temporary ? sessionStorage : localStorage; + if (token) { + webStorage.setItem('BAT:' + origin, token); + } else { + webStorage.removeItem('BAT:' + origin); + } + }; + + return WebStorage; +}(TokenStorage); + +if (WebStorage.isAvailable()) { + /** + * @alias util.TokenStorage.WEB_STORAGE + * @type {util.TokenStorageFactory} + */ + TokenStorage.WEB_STORAGE = WebStorage; +} + +module.exports = TokenStorage; + +},{"71":71}],68:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias util.ValidationResult + */ + +var ValidationResult = function () { + babelHelpers.createClass(ValidationResult, [{ + key: "isValid", + get: function get() { + for (var key in this.fields) { + if (!this.fields[key].isValid) { + return false; + } + } + return true; + } + }]); + + function ValidationResult() { + babelHelpers.classCallCheck(this, ValidationResult); + + this.fields = {}; + } + + ValidationResult.prototype.toJSON = function toJSON() { + var json = {}; + for (var key in this.fields) { + json[key] = this.fields[key].toJSON(); + } + return json; + }; + + return ValidationResult; +}(); + +module.exports = ValidationResult; + +},{}],69:[function(_dereq_,module,exports){ +"use strict"; + +var valLib = _dereq_(162); +var ValidationResult = _dereq_(68); + +/** + * @alias util.Validator + */ + +var Validator = function () { + + /** + * Compiles the given validation code for the managedType + * @param {metamodel.ManagedType} managedType The managedType of the code + * @param {string} validationCode The validation code + */ + Validator.compile = function compile(managedType, validationCode) { + var keys = []; + for (var _iterator = managedType.attributes(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var attr = _ref; + + keys.push(attr.name); + } + + var fn = new Function(keys, validationCode); + return function onValidate(argObj) { + var args = keys.map(function (name) { + return argObj[name]; + }); + + return fn.apply({}, args); + }; + }; + + /** + * Gets the value of the attribute + * @return {*} Value + */ + + + /** + * Executes the given validation function to validate the value. + * + * The value will be passed as the first parameter to the validation function and + * the library {@link https://github.com/chriso/validator.js} as the second one. + * If the function returns true the value is valid, otherwise it's invalid. + * + * @name is + * @memberOf util.Validator.prototype + * @function + * @param {Function} fn will be used to validate the value + * @returns {util.Validator} + */ + + /** + * Executes the given validation function to validate the value. + * + * The value will be passed as the first parameter to the validation function and + * the library {@link https://github.com/chriso/validator.js} as the second one. + * If the function returns true the value is valid, otherwise it's invalid. + * + * @param {string} error The error message which will be used if the value is invalid + * @param {Function} fn will be used to validate the value + * @returns {util.Validator} + */ + Validator.prototype.is = function is(error, fn) { + if (error instanceof Function) { + fn = error; + error = 'is'; + } + if (fn(this.value, valLib) === false) { + this.errors.push(error); + } + return this; + }; + + babelHelpers.createClass(Validator, [{ + key: 'value', + get: function get() { + return this._entity[this.key]; + } + + /** + * Checks if the attribute is valid + * @return {boolean} + */ + + }, { + key: 'isValid', + get: function get() { + return this.errors.length == 0; + } + }]); + + function Validator(key, entity) { + babelHelpers.classCallCheck(this, Validator); + + /** + * Name of the attribute + * @type string + */ + this.key = key; + + /** + * Entity to get the value of the attribute + * @type {binding.Entity} + * @private + */ + this._entity = entity; + + /** + * Entity to get the value of the attribute + * @type {binding.Entity} + * @private + */ + this.errors = []; + } + + Validator.prototype._callMethod = function _callMethod(method, error, args) { + args = args || []; + args.unshift(this.value); + if (valLib[method].apply(this, args) === false) { + this.errors.push(error); + } + return this; + }; + + Validator.prototype.toString = function toString() { + return this.value; + }; + + Validator.prototype.toJSON = function toJSON() { + return { + isValid: this.isValid, + errors: this.errors + }; + }; + + return Validator; +}(); + +Object.keys(valLib).forEach(function (name) { + if (typeof valLib[name] == 'function' && name !== 'toString' && name !== 'toDate' && name !== 'extend' && name !== 'init') { + + /** + * @ignore + */ + Validator.prototype[name] = function (error) { + //noinspection JSPotentiallyInvalidUsageOfThis + return this._callMethod(name, error || name, Array.prototype.slice.call(arguments, error ? 1 : 0)); + }; + } +}); + +module.exports = Validator; + +},{"162":162,"68":68}],70:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace util + */ +module.exports = exports = _dereq_(71); +exports.Metadata = _dereq_(63); +exports.Permission = _dereq_(65); +exports.Validator = _dereq_(69); +exports.ValidationResult = _dereq_(68); +exports.Code = _dereq_(60); +exports.Modules = _dereq_(64); +exports.Lockable = _dereq_(61); +exports.Logger = _dereq_(62); +exports.PushMessage = _dereq_(66); +exports.TokenStorage = _dereq_(67); + +/** + * @function + * @name uuid + * @memberOf util.prototype + * @return {string} A generated version 4 UUID. + */ +exports.uuid = _dereq_(160).v4; + +},{"160":160,"60":60,"61":61,"62":62,"63":63,"64":64,"65":65,"66":66,"67":67,"68":68,"69":69,"71":71}],71:[function(_dereq_,module,exports){ +'use strict'; + +exports.hmac = _dereq_(157); +exports.atob = window.atob; +exports.isNode = false; + +},{"157":157}],72:[function(_dereq_,module,exports){ +module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; +}; +},{}],73:[function(_dereq_,module,exports){ +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = _dereq_(144)('unscopables') + , ArrayProto = Array.prototype; +if(ArrayProto[UNSCOPABLES] == undefined)_dereq_(94)(ArrayProto, UNSCOPABLES, {}); +module.exports = function(key){ + ArrayProto[UNSCOPABLES][key] = true; +}; +},{"144":144,"94":94}],74:[function(_dereq_,module,exports){ +module.exports = function(it, Constructor, name, forbiddenField){ + if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; +},{}],75:[function(_dereq_,module,exports){ +var isObject = _dereq_(102); +module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; +}; +},{"102":102}],76:[function(_dereq_,module,exports){ +// false -> Array#indexOf +// true -> Array#includes +var toIObject = _dereq_(137) + , toLength = _dereq_(138) + , toIndex = _dereq_(135); +module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; +},{"135":135,"137":137,"138":138}],77:[function(_dereq_,module,exports){ +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = _dereq_(78) + , TAG = _dereq_(144)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } +}; + +module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; +},{"144":144,"78":78}],78:[function(_dereq_,module,exports){ +var toString = {}.toString; + +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; +},{}],79:[function(_dereq_,module,exports){ +'use strict'; +var dP = _dereq_(115).f + , create = _dereq_(114) + , redefineAll = _dereq_(126) + , ctx = _dereq_(83) + , anInstance = _dereq_(74) + , defined = _dereq_(84) + , forOf = _dereq_(91) + , $iterDefine = _dereq_(105) + , step = _dereq_(107) + , setSpecies = _dereq_(129) + , DESCRIPTORS = _dereq_(85) + , fastKey = _dereq_(111).fastKey + , SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + anInstance(this, C, 'forEach'); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)dP(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; +},{"105":105,"107":107,"111":111,"114":114,"115":115,"126":126,"129":129,"74":74,"83":83,"84":84,"85":85,"91":91}],80:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(92) + , $export = _dereq_(89) + , redefine = _dereq_(127) + , redefineAll = _dereq_(126) + , meta = _dereq_(111) + , forOf = _dereq_(91) + , anInstance = _dereq_(74) + , isObject = _dereq_(102) + , fails = _dereq_(90) + , $iterDetect = _dereq_(106) + , setToStringTag = _dereq_(130) + , inheritIfRequired = _dereq_(97); + +module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + var fixMethod = function(KEY){ + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a){ + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C + // early implementations not supports chaining + , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); }) + // most early implementations doesn't supports iterables, most modern - not close it correctly + , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + , BUGGY_ZERO = !IS_WEAK && fails(function(){ + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C() + , index = 5; + while(index--)$instance[ADDER](index, index); + return !$instance.has(-0); + }); + if(!ACCEPT_ITERABLES){ + C = wrapper(function(target, iterable){ + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base, target, C); + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){ + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER); + // weak collections should not contains .clear method + if(IS_WEAK && proto.clear)delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; +}; +},{"102":102,"106":106,"111":111,"126":126,"127":127,"130":130,"74":74,"89":89,"90":90,"91":91,"92":92,"97":97}],81:[function(_dereq_,module,exports){ +var core = module.exports = {version: '2.4.0'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef +},{}],82:[function(_dereq_,module,exports){ +'use strict'; +var $defineProperty = _dereq_(115) + , createDesc = _dereq_(125); + +module.exports = function(object, index, value){ + if(index in object)$defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; +},{"115":115,"125":125}],83:[function(_dereq_,module,exports){ +// optional / simple context binding +var aFunction = _dereq_(72); +module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; +}; +},{"72":72}],84:[function(_dereq_,module,exports){ +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; +}; +},{}],85:[function(_dereq_,module,exports){ +// Thank's IE8 for his funny defineProperty +module.exports = !_dereq_(90)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); +},{"90":90}],86:[function(_dereq_,module,exports){ +var isObject = _dereq_(102) + , document = _dereq_(92).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); +module.exports = function(it){ + return is ? document.createElement(it) : {}; +}; +},{"102":102,"92":92}],87:[function(_dereq_,module,exports){ +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); +},{}],88:[function(_dereq_,module,exports){ +// all enumerable object keys, includes symbols +var getKeys = _dereq_(123) + , gOPS = _dereq_(120) + , pIE = _dereq_(124); +module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; +}; +},{"120":120,"123":123,"124":124}],89:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , core = _dereq_(81) + , hide = _dereq_(94) + , redefine = _dereq_(127) + , ctx = _dereq_(83) + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) + , key, own, out, exp; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if(target)redefine(target, key, out, type & $export.U); + // export + if(exports[key] != out)hide(exports, key, exp); + if(IS_PROTO && expProto[key] != out)expProto[key] = out; + } +}; +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; +},{"127":127,"81":81,"83":83,"92":92,"94":94}],90:[function(_dereq_,module,exports){ +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; +},{}],91:[function(_dereq_,module,exports){ +var ctx = _dereq_(83) + , call = _dereq_(103) + , isArrayIter = _dereq_(100) + , anObject = _dereq_(75) + , toLength = _dereq_(138) + , getIterFn = _dereq_(145) + , BREAK = {} + , RETURN = {}; +var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; +},{"100":100,"103":103,"138":138,"145":145,"75":75,"83":83}],92:[function(_dereq_,module,exports){ +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef +},{}],93:[function(_dereq_,module,exports){ +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function(it, key){ + return hasOwnProperty.call(it, key); +}; +},{}],94:[function(_dereq_,module,exports){ +var dP = _dereq_(115) + , createDesc = _dereq_(125); +module.exports = _dereq_(85) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; +},{"115":115,"125":125,"85":85}],95:[function(_dereq_,module,exports){ +module.exports = _dereq_(92).document && document.documentElement; +},{"92":92}],96:[function(_dereq_,module,exports){ +module.exports = !_dereq_(85) && !_dereq_(90)(function(){ + return Object.defineProperty(_dereq_(86)('div'), 'a', {get: function(){ return 7; }}).a != 7; +}); +},{"85":85,"86":86,"90":90}],97:[function(_dereq_,module,exports){ +var isObject = _dereq_(102) + , setPrototypeOf = _dereq_(128).set; +module.exports = function(that, target, C){ + var P, S = target.constructor; + if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){ + setPrototypeOf(that, P); + } return that; +}; +},{"102":102,"128":128}],98:[function(_dereq_,module,exports){ +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; +},{}],99:[function(_dereq_,module,exports){ +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = _dereq_(78); +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); +}; +},{"78":78}],100:[function(_dereq_,module,exports){ +// check on default Array iterator +var Iterators = _dereq_(108) + , ITERATOR = _dereq_(144)('iterator') + , ArrayProto = Array.prototype; + +module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; +},{"108":108,"144":144}],101:[function(_dereq_,module,exports){ +// 7.2.2 IsArray(argument) +var cof = _dereq_(78); +module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; +}; +},{"78":78}],102:[function(_dereq_,module,exports){ +module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; +},{}],103:[function(_dereq_,module,exports){ +// call something on iterator step with safe closing on error +var anObject = _dereq_(75); +module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } +}; +},{"75":75}],104:[function(_dereq_,module,exports){ +'use strict'; +var create = _dereq_(114) + , descriptor = _dereq_(125) + , setToStringTag = _dereq_(130) + , IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +_dereq_(94)(IteratorPrototype, _dereq_(144)('iterator'), function(){ return this; }); + +module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); +}; +},{"114":114,"125":125,"130":130,"144":144,"94":94}],105:[function(_dereq_,module,exports){ +'use strict'; +var LIBRARY = _dereq_(110) + , $export = _dereq_(89) + , redefine = _dereq_(127) + , hide = _dereq_(94) + , has = _dereq_(93) + , Iterators = _dereq_(108) + , $iterCreate = _dereq_(104) + , setToStringTag = _dereq_(130) + , getPrototypeOf = _dereq_(121) + , ITERATOR = _dereq_(144)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + +var returnThis = function(){ return this; }; + +module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; +},{"104":104,"108":108,"110":110,"121":121,"127":127,"130":130,"144":144,"89":89,"93":93,"94":94}],106:[function(_dereq_,module,exports){ +var ITERATOR = _dereq_(144)('iterator') + , SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); +} catch(e){ /* empty */ } + +module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ return {done: safe = true}; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; +}; +},{"144":144}],107:[function(_dereq_,module,exports){ +module.exports = function(done, value){ + return {value: value, done: !!done}; +}; +},{}],108:[function(_dereq_,module,exports){ +module.exports = {}; +},{}],109:[function(_dereq_,module,exports){ +var getKeys = _dereq_(123) + , toIObject = _dereq_(137); +module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; +}; +},{"123":123,"137":137}],110:[function(_dereq_,module,exports){ +module.exports = false; +},{}],111:[function(_dereq_,module,exports){ +var META = _dereq_(141)('meta') + , isObject = _dereq_(102) + , has = _dereq_(93) + , setDesc = _dereq_(115).f + , id = 0; +var isExtensible = Object.isExtensible || function(){ + return true; +}; +var FREEZE = !_dereq_(90)(function(){ + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); +}; +var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; +},{"102":102,"115":115,"141":141,"90":90,"93":93}],112:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , macrotask = _dereq_(134).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = _dereq_(78)(process) == 'process'; + +module.exports = function(){ + var head, last, notify; + + var flush = function(){ + var parent, fn; + if(isNode && (parent = process.domain))parent.exit(); + while(head){ + fn = head.fn; + head = head.next; + try { + fn(); + } catch(e){ + if(head)notify(); + else last = undefined; + throw e; + } + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = true + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + var promise = Promise.resolve(); + notify = function(){ + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function(fn){ + var task = {fn: fn, next: undefined}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; +}; +},{"134":134,"78":78,"92":92}],113:[function(_dereq_,module,exports){ +'use strict'; +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = _dereq_(123) + , gOPS = _dereq_(120) + , pIE = _dereq_(124) + , toObject = _dereq_(139) + , IObject = _dereq_(99) + , $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || _dereq_(90)(function(){ + var A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , aLen = arguments.length + , index = 1 + , getSymbols = gOPS.f + , isEnum = pIE.f; + while(aLen > index){ + var S = IObject(arguments[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } return T; +} : $assign; +},{"120":120,"123":123,"124":124,"139":139,"90":90,"99":99}],114:[function(_dereq_,module,exports){ +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = _dereq_(75) + , dPs = _dereq_(116) + , enumBugKeys = _dereq_(87) + , IE_PROTO = _dereq_(131)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = _dereq_(86)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + _dereq_(95).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + +},{"116":116,"131":131,"75":75,"86":86,"87":87,"95":95}],115:[function(_dereq_,module,exports){ +var anObject = _dereq_(75) + , IE8_DOM_DEFINE = _dereq_(96) + , toPrimitive = _dereq_(140) + , dP = Object.defineProperty; + +exports.f = _dereq_(85) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; +}; +},{"140":140,"75":75,"85":85,"96":96}],116:[function(_dereq_,module,exports){ +var dP = _dereq_(115) + , anObject = _dereq_(75) + , getKeys = _dereq_(123); + +module.exports = _dereq_(85) ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; +}; +},{"115":115,"123":123,"75":75,"85":85}],117:[function(_dereq_,module,exports){ +var pIE = _dereq_(124) + , createDesc = _dereq_(125) + , toIObject = _dereq_(137) + , toPrimitive = _dereq_(140) + , has = _dereq_(93) + , IE8_DOM_DEFINE = _dereq_(96) + , gOPD = Object.getOwnPropertyDescriptor; + +exports.f = _dereq_(85) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); +}; +},{"124":124,"125":125,"137":137,"140":140,"85":85,"93":93,"96":96}],118:[function(_dereq_,module,exports){ +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = _dereq_(137) + , gOPN = _dereq_(119).f + , toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; + +},{"119":119,"137":137}],119:[function(_dereq_,module,exports){ +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = _dereq_(122) + , hiddenKeys = _dereq_(87).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); +}; +},{"122":122,"87":87}],120:[function(_dereq_,module,exports){ +exports.f = Object.getOwnPropertySymbols; +},{}],121:[function(_dereq_,module,exports){ +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = _dereq_(93) + , toObject = _dereq_(139) + , IE_PROTO = _dereq_(131)('IE_PROTO') + , ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; +},{"131":131,"139":139,"93":93}],122:[function(_dereq_,module,exports){ +var has = _dereq_(93) + , toIObject = _dereq_(137) + , arrayIndexOf = _dereq_(76)(false) + , IE_PROTO = _dereq_(131)('IE_PROTO'); + +module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; +},{"131":131,"137":137,"76":76,"93":93}],123:[function(_dereq_,module,exports){ +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = _dereq_(122) + , enumBugKeys = _dereq_(87); + +module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); +}; +},{"122":122,"87":87}],124:[function(_dereq_,module,exports){ +exports.f = {}.propertyIsEnumerable; +},{}],125:[function(_dereq_,module,exports){ +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; +}; +},{}],126:[function(_dereq_,module,exports){ +var redefine = _dereq_(127); +module.exports = function(target, src, safe){ + for(var key in src)redefine(target, key, src[key], safe); + return target; +}; +},{"127":127}],127:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , hide = _dereq_(94) + , has = _dereq_(93) + , SRC = _dereq_(141)('src') + , TO_STRING = 'toString' + , $toString = Function[TO_STRING] + , TPL = ('' + $toString).split(TO_STRING); + +_dereq_(81).inspectSource = function(it){ + return $toString.call(it); +}; + +(module.exports = function(O, key, val, safe){ + var isFunction = typeof val == 'function'; + if(isFunction)has(val, 'name') || hide(val, 'name', key); + if(O[key] === val)return; + if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if(O === global){ + O[key] = val; + } else { + if(!safe){ + delete O[key]; + hide(O, key, val); + } else { + if(O[key])O[key] = val; + else hide(O, key, val); + } + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString(){ + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); +},{"141":141,"81":81,"92":92,"93":93,"94":94}],128:[function(_dereq_,module,exports){ +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = _dereq_(102) + , anObject = _dereq_(75); +var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = _dereq_(83)(Function.call, _dereq_(117).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; +},{"102":102,"117":117,"75":75,"83":83}],129:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(92) + , dP = _dereq_(115) + , DESCRIPTORS = _dereq_(85) + , SPECIES = _dereq_(144)('species'); + +module.exports = function(KEY){ + var C = global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); +}; +},{"115":115,"144":144,"85":85,"92":92}],130:[function(_dereq_,module,exports){ +var def = _dereq_(115).f + , has = _dereq_(93) + , TAG = _dereq_(144)('toStringTag'); + +module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); +}; +},{"115":115,"144":144,"93":93}],131:[function(_dereq_,module,exports){ +var shared = _dereq_(132)('keys') + , uid = _dereq_(141); +module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); +}; +},{"132":132,"141":141}],132:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); +module.exports = function(key){ + return store[key] || (store[key] = {}); +}; +},{"92":92}],133:[function(_dereq_,module,exports){ +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = _dereq_(75) + , aFunction = _dereq_(72) + , SPECIES = _dereq_(144)('species'); +module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; +},{"144":144,"72":72,"75":75}],134:[function(_dereq_,module,exports){ +var ctx = _dereq_(83) + , invoke = _dereq_(98) + , html = _dereq_(95) + , cel = _dereq_(86) + , global = _dereq_(92) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; +var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function(event){ + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(_dereq_(78)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; +},{"78":78,"83":83,"86":86,"92":92,"95":95,"98":98}],135:[function(_dereq_,module,exports){ +var toInteger = _dereq_(136) + , max = Math.max + , min = Math.min; +module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; +},{"136":136}],136:[function(_dereq_,module,exports){ +// 7.1.4 ToInteger +var ceil = Math.ceil + , floor = Math.floor; +module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; +},{}],137:[function(_dereq_,module,exports){ +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = _dereq_(99) + , defined = _dereq_(84); +module.exports = function(it){ + return IObject(defined(it)); +}; +},{"84":84,"99":99}],138:[function(_dereq_,module,exports){ +// 7.1.15 ToLength +var toInteger = _dereq_(136) + , min = Math.min; +module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; +},{"136":136}],139:[function(_dereq_,module,exports){ +// 7.1.13 ToObject(argument) +var defined = _dereq_(84); +module.exports = function(it){ + return Object(defined(it)); +}; +},{"84":84}],140:[function(_dereq_,module,exports){ +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = _dereq_(102); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); +}; +},{"102":102}],141:[function(_dereq_,module,exports){ +var id = 0 + , px = Math.random(); +module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; +},{}],142:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , core = _dereq_(81) + , LIBRARY = _dereq_(110) + , wksExt = _dereq_(143) + , defineProperty = _dereq_(115).f; +module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); +}; +},{"110":110,"115":115,"143":143,"81":81,"92":92}],143:[function(_dereq_,module,exports){ +exports.f = _dereq_(144); +},{"144":144}],144:[function(_dereq_,module,exports){ +var store = _dereq_(132)('wks') + , uid = _dereq_(141) + , Symbol = _dereq_(92).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; +},{"132":132,"141":141,"92":92}],145:[function(_dereq_,module,exports){ +var classof = _dereq_(77) + , ITERATOR = _dereq_(144)('iterator') + , Iterators = _dereq_(108); +module.exports = _dereq_(81).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; +},{"108":108,"144":144,"77":77,"81":81}],146:[function(_dereq_,module,exports){ +'use strict'; +var ctx = _dereq_(83) + , $export = _dereq_(89) + , toObject = _dereq_(139) + , call = _dereq_(103) + , isArrayIter = _dereq_(100) + , toLength = _dereq_(138) + , createProperty = _dereq_(82) + , getIterFn = _dereq_(145); + +$export($export.S + $export.F * !_dereq_(106)(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } +}); + +},{"100":100,"103":103,"106":106,"138":138,"139":139,"145":145,"82":82,"83":83,"89":89}],147:[function(_dereq_,module,exports){ +'use strict'; +var addToUnscopables = _dereq_(73) + , step = _dereq_(107) + , Iterators = _dereq_(108) + , toIObject = _dereq_(137); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = _dereq_(105)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); +},{"105":105,"107":107,"108":108,"137":137,"73":73}],148:[function(_dereq_,module,exports){ +'use strict'; +var strong = _dereq_(79); + +// 23.1 Map Objects +module.exports = _dereq_(80)('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } +}, strong, true); +},{"79":79,"80":80}],149:[function(_dereq_,module,exports){ +// 19.1.3.1 Object.assign(target, source) +var $export = _dereq_(89); + +$export($export.S + $export.F, 'Object', {assign: _dereq_(113)}); +},{"113":113,"89":89}],150:[function(_dereq_,module,exports){ +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = _dereq_(89); +$export($export.S, 'Object', {setPrototypeOf: _dereq_(128).set}); +},{"128":128,"89":89}],151:[function(_dereq_,module,exports){ +'use strict'; +var LIBRARY = _dereq_(110) + , global = _dereq_(92) + , ctx = _dereq_(83) + , classof = _dereq_(77) + , $export = _dereq_(89) + , isObject = _dereq_(102) + , aFunction = _dereq_(72) + , anInstance = _dereq_(74) + , forOf = _dereq_(91) + , speciesConstructor = _dereq_(133) + , task = _dereq_(134).set + , microtask = _dereq_(112)() + , PROMISE = 'Promise' + , TypeError = global.TypeError + , process = global.process + , $Promise = global[PROMISE] + , process = global.process + , isNode = classof(process) == 'process' + , empty = function(){ /* empty */ } + , Internal, GenericPromiseCapability, Wrapper; + +var USE_NATIVE = !!function(){ + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1) + , FakePromise = (promise.constructor = {})[_dereq_(144)('species')] = function(exec){ exec(empty, empty); }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch(e){ /* empty */ } +}(); + +// helpers +var sameConstructor = function(a, b){ + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; +}; +var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var newPromiseCapability = function(C){ + return sameConstructor($Promise, C) + ? new PromiseCapability(C) + : new GenericPromiseCapability(C); +}; +var PromiseCapability = GenericPromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +}; +var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } +}; +var notify = function(promise, isReject){ + if(promise._n)return; + promise._n = true; + var chain = promise._c; + microtask(function(){ + var value = promise._v + , ok = promise._s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , domain = reaction.domain + , result, then; + try { + if(handler){ + if(!ok){ + if(promise._h == 2)onHandleUnhandled(promise); + promise._h = 1; + } + if(handler === true)result = value; + else { + if(domain)domain.enter(); + result = handler(value); + if(domain)domain.exit(); + } + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if(isReject && !promise._h)onUnhandled(promise); + }); +}; +var onUnhandled = function(promise){ + task.call(global, function(){ + var value = promise._v + , abrupt, handler, console; + if(isUnhandled(promise)){ + abrupt = perform(function(){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if(abrupt)throw abrupt.error; + }); +}; +var isUnhandled = function(promise){ + if(promise._h == 1)return false; + var chain = promise._a || promise._c + , i = 0 + , reaction; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; +}; +var onHandleUnhandled = function(promise){ + task.call(global, function(){ + var handler; + if(isNode){ + process.emit('rejectionHandled', promise); + } else if(handler = global.onrejectionhandled){ + handler({promise: promise, reason: promise._v}); + } + }); +}; +var $reject = function(value){ + var promise = this; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if(!promise._a)promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function(value){ + var promise = this + , then; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if(promise === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + microtask(function(){ + var wrapper = {_w: promise, _d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch(e){ + $reject.call({_w: promise, _d: false}, e); // wrap + } +}; + +// constructor polyfill +if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor){ + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch(err){ + $reject.call(this, err); + } + }; + Internal = function Promise(executor){ + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = _dereq_(126)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if(this._a)this._a.push(reaction); + if(this._s)notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + PromiseCapability = function(){ + var promise = new Internal; + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); +_dereq_(130)($Promise, PROMISE); +_dereq_(129)(PROMISE); +Wrapper = _dereq_(81)[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = newPromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; + var capability = newPromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } +}); +$export($export.S + $export.F * !(USE_NATIVE && _dereq_(106)(function(iter){ + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = this + , capability = newPromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject; + var abrupt = perform(function(){ + var values = [] + , index = 0 + , remaining = 1; + forOf(iterable, false, function(promise){ + var $index = index++ + , alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = this + , capability = newPromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } +}); +},{"102":102,"106":106,"110":110,"112":112,"126":126,"129":129,"130":130,"133":133,"134":134,"144":144,"72":72,"74":74,"77":77,"81":81,"83":83,"89":89,"91":91,"92":92}],152:[function(_dereq_,module,exports){ +'use strict'; +var strong = _dereq_(79); + +// 23.2 Set Objects +module.exports = _dereq_(80)('Set', function(get){ + return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value){ + return strong.def(this, value = value === 0 ? 0 : value, value); + } +}, strong); +},{"79":79,"80":80}],153:[function(_dereq_,module,exports){ +'use strict'; +// ECMAScript 6 symbols shim +var global = _dereq_(92) + , has = _dereq_(93) + , DESCRIPTORS = _dereq_(85) + , $export = _dereq_(89) + , redefine = _dereq_(127) + , META = _dereq_(111).KEY + , $fails = _dereq_(90) + , shared = _dereq_(132) + , setToStringTag = _dereq_(130) + , uid = _dereq_(141) + , wks = _dereq_(144) + , wksExt = _dereq_(143) + , wksDefine = _dereq_(142) + , keyOf = _dereq_(109) + , enumKeys = _dereq_(88) + , isArray = _dereq_(101) + , anObject = _dereq_(75) + , toIObject = _dereq_(137) + , toPrimitive = _dereq_(140) + , createDesc = _dereq_(125) + , _create = _dereq_(114) + , gOPNExt = _dereq_(118) + , $GOPD = _dereq_(117) + , $DP = _dereq_(115) + , $keys = _dereq_(123) + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; +}) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; +} : function(it){ + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + _dereq_(119).f = gOPNExt.f = $getOwnPropertyNames; + _dereq_(124).f = $propertyIsEnumerable; + _dereq_(120).f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !_dereq_(110)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + +for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + +for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || _dereq_(94)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); +},{"101":101,"109":109,"110":110,"111":111,"114":114,"115":115,"117":117,"118":118,"119":119,"120":120,"123":123,"124":124,"125":125,"127":127,"130":130,"132":132,"137":137,"140":140,"141":141,"142":142,"143":143,"144":144,"75":75,"85":85,"88":88,"89":89,"90":90,"92":92,"93":93,"94":94}],154:[function(_dereq_,module,exports){ +'use strict'; +// https://github.com/zenparsing/es-observable +var $export = _dereq_(89) + , global = _dereq_(92) + , core = _dereq_(81) + , microtask = _dereq_(112)() + , OBSERVABLE = _dereq_(144)('observable') + , aFunction = _dereq_(72) + , anObject = _dereq_(75) + , anInstance = _dereq_(74) + , redefineAll = _dereq_(126) + , hide = _dereq_(94) + , forOf = _dereq_(91) + , RETURN = forOf.RETURN; + +var getMethod = function(fn){ + return fn == null ? undefined : aFunction(fn); +}; + +var cleanupSubscription = function(subscription){ + var cleanup = subscription._c; + if(cleanup){ + subscription._c = undefined; + cleanup(); + } +}; + +var subscriptionClosed = function(subscription){ + return subscription._o === undefined; +}; + +var closeSubscription = function(subscription){ + if(!subscriptionClosed(subscription)){ + subscription._o = undefined; + cleanupSubscription(subscription); + } +}; + +var Subscription = function(observer, subscriber){ + anObject(observer); + this._c = undefined; + this._o = observer; + observer = new SubscriptionObserver(this); + try { + var cleanup = subscriber(observer) + , subscription = cleanup; + if(cleanup != null){ + if(typeof cleanup.unsubscribe === 'function')cleanup = function(){ subscription.unsubscribe(); }; + else aFunction(cleanup); + this._c = cleanup; + } + } catch(e){ + observer.error(e); + return; + } if(subscriptionClosed(this))cleanupSubscription(this); +}; + +Subscription.prototype = redefineAll({}, { + unsubscribe: function unsubscribe(){ closeSubscription(this); } +}); + +var SubscriptionObserver = function(subscription){ + this._s = subscription; +}; + +SubscriptionObserver.prototype = redefineAll({}, { + next: function next(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + try { + var m = getMethod(observer.next); + if(m)return m.call(observer, value); + } catch(e){ + try { + closeSubscription(subscription); + } finally { + throw e; + } + } + } + }, + error: function error(value){ + var subscription = this._s; + if(subscriptionClosed(subscription))throw value; + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.error); + if(!m)throw value; + value = m.call(observer, value); + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + }, + complete: function complete(value){ + var subscription = this._s; + if(!subscriptionClosed(subscription)){ + var observer = subscription._o; + subscription._o = undefined; + try { + var m = getMethod(observer.complete); + value = m ? m.call(observer, value) : undefined; + } catch(e){ + try { + cleanupSubscription(subscription); + } finally { + throw e; + } + } cleanupSubscription(subscription); + return value; + } + } +}); + +var $Observable = function Observable(subscriber){ + anInstance(this, $Observable, 'Observable', '_f')._f = aFunction(subscriber); +}; + +redefineAll($Observable.prototype, { + subscribe: function subscribe(observer){ + return new Subscription(observer, this._f); + }, + forEach: function forEach(fn){ + var that = this; + return new (core.Promise || global.Promise)(function(resolve, reject){ + aFunction(fn); + var subscription = that.subscribe({ + next : function(value){ + try { + return fn(value); + } catch(e){ + reject(e); + subscription.unsubscribe(); + } + }, + error: reject, + complete: resolve + }); + }); + } +}); + +redefineAll($Observable, { + from: function from(x){ + var C = typeof this === 'function' ? this : $Observable; + var method = getMethod(anObject(x)[OBSERVABLE]); + if(method){ + var observable = anObject(method.call(x)); + return observable.constructor === C ? observable : new C(function(observer){ + return observable.subscribe(observer); + }); + } + return new C(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + try { + if(forOf(x, false, function(it){ + observer.next(it); + if(done)return RETURN; + }) === RETURN)return; + } catch(e){ + if(done)throw e; + observer.error(e); + return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + }, + of: function of(){ + for(var i = 0, l = arguments.length, items = Array(l); i < l;)items[i] = arguments[i++]; + return new (typeof this === 'function' ? this : $Observable)(function(observer){ + var done = false; + microtask(function(){ + if(!done){ + for(var i = 0; i < items.length; ++i){ + observer.next(items[i]); + if(done)return; + } observer.complete(); + } + }); + return function(){ done = true; }; + }); + } +}); + +hide($Observable.prototype, OBSERVABLE, function(){ return this; }); + +$export($export.G, {Observable: $Observable}); + +_dereq_(129)('Observable'); +},{"112":112,"126":126,"129":129,"144":144,"72":72,"74":74,"75":75,"81":81,"89":89,"91":91,"92":92,"94":94}],155:[function(_dereq_,module,exports){ +_dereq_(142)('observable'); +},{"142":142}],156:[function(_dereq_,module,exports){ +;(function (root, factory) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(); + } + else if (typeof define === "function" && define.amd) { + // AMD + define([], factory); + } + else { + // Global (browser) + root.CryptoJS = factory(); + } +}(this, function () { + + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined) { + /* + * Local polyfil of Object.create + */ + var create = Object.create || (function () { + function F() {}; + + return function (obj) { + var subtype; + + F.prototype = obj; + + subtype = new F(); + + F.prototype = null; + + return subtype; + }; + }()) + + /** + * CryptoJS namespace. + */ + var C = {}; + + /** + * Library namespace. + */ + var C_lib = C.lib = {}; + + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { + + + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); + + // Augment + if (overrides) { + subtype.mixIn(overrides); + } + + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; + + // Reference supertype + subtype.$super = this; + + return subtype; + }, + + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); + + return instance; + }, + + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, + + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); + + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, + + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + + // Clamp excess bits + this.clamp(); + + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var i = 0; i < thatSigBytes; i += 4) { + thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; + } + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + + var r = (function (m_w) { + var m_w = m_w; + var m_z = 0x3ade68b1; + var mask = 0xffffffff; + + return function () { + m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask; + m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask; + var result = ((m_z << 0x10) + m_w) & mask; + result /= 0x100000000; + result += 0.5; + return result * (Math.random() > .5 ? 1 : -1); + } + }); + + for (var i = 0, rcache; i < nBytes; i += 4) { + var _r = r((rcache || Math.random()) * 0x100000000); + + rcache = _r() * 0x3ade67b7; + words.push((_r() * 0x100000000) | 0); + } + + return new WordArray.init(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return new WordArray.init(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + var processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + var hash = this._doFinalize(); + + return hash; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; + }(Math)); + + + return CryptoJS; + +})); +},{}],157:[function(_dereq_,module,exports){ +;(function (root, factory, undef) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(_dereq_(156), _dereq_(159), _dereq_(158)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./sha1", "./hmac"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } +}(this, function (CryptoJS) { + + return CryptoJS.HmacSHA1; + +})); +},{"156":156,"158":158,"159":159}],158:[function(_dereq_,module,exports){ +;(function (root, factory) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(_dereq_(156)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + + /** + * HMAC algorithm. + */ + var HMAC = C_algo.HMAC = Base.extend({ + /** + * Initializes a newly created HMAC. + * + * @param {Hasher} hasher The hash algorithm to use. + * @param {WordArray|string} key The secret key. + * + * @example + * + * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); + */ + init: function (hasher, key) { + // Init hasher + hasher = this._hasher = new hasher.init(); + + // Convert string to WordArray, else assume WordArray already + if (typeof key == 'string') { + key = Utf8.parse(key); + } + + // Shortcuts + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; + + // Allow arbitrary length keys + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + + // Clamp excess bits + key.clamp(); + + // Clone key for inner and outer pads + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + + // Shortcuts + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + + // XOR keys with pad constants + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; + } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + + // Set initial values + this.reset(); + }, + + /** + * Resets this HMAC to its initial state. + * + * @example + * + * hmacHasher.reset(); + */ + reset: function () { + // Shortcut + var hasher = this._hasher; + + // Reset + hasher.reset(); + hasher.update(this._iKey); + }, + + /** + * Updates this HMAC with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. + * + * @example + * + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); + */ + update: function (messageUpdate) { + this._hasher.update(messageUpdate); + + // Chainable + return this; + }, + + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Shortcut + var hasher = this._hasher; + + // Compute HMAC + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + + return hmac; + } + }); + }()); + + +})); +},{"156":156}],159:[function(_dereq_,module,exports){ +;(function (root, factory) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(_dereq_(156)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Reusable object + var W = []; + + /** + * SHA-1 hash algorithm. + */ + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476, + 0xc3d2e1f0 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + // Computation + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (n << 1) | (n >>> 31); + } + + var t = ((a << 5) | (a >>> 27)) + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; + } else /* if (i < 80) */ { + t += (b ^ c ^ d) - 0x359d3e2a; + } + + e = d; + d = c; + c = (b << 30) | (b >>> 2); + b = a; + a = t; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA1('message'); + * var hash = CryptoJS.SHA1(wordArray); + */ + C.SHA1 = Hasher._createHelper(SHA1); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA1(message, key); + */ + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + }()); + + + return CryptoJS.SHA1; + +})); +},{"156":156}],160:[function(_dereq_,module,exports){ +// uuid.js +// +// Copyright (c) 2010-2012 Robert Kieffer +// MIT License - http://opensource.org/licenses/mit-license.php + +/*global window, require, define */ +(function(_window) { + 'use strict'; + + // Unique ID creation requires a high quality random # generator. We feature + // detect to determine the best RNG source, normalizing to a function that + // returns 128-bits of randomness, since that's what's usually required + var _rng, _mathRNG, _nodeRNG, _whatwgRNG, _previousRoot; + + function setupBrowser() { + // Allow for MSIE11 msCrypto + var _crypto = _window.crypto || _window.msCrypto; + + if (!_rng && _crypto && _crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // + // Moderately fast, high quality + try { + var _rnds8 = new Uint8Array(16); + _whatwgRNG = _rng = function whatwgRNG() { + _crypto.getRandomValues(_rnds8); + return _rnds8; + }; + _rng(); + } catch(e) {} + } + + if (!_rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var _rnds = new Array(16); + _mathRNG = _rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; } + _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return _rnds; + }; + if ('undefined' !== typeof console && console.warn) { + console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()"); + } + } + } + + function setupNode() { + // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html + // + // Moderately fast, high quality + if ('function' === typeof _dereq_) { + try { + var _rb = _dereq_('crypto').randomBytes; + _nodeRNG = _rng = _rb && function() {return _rb(16);}; + _rng(); + } catch(e) {} + } + } + + if (_window) { + setupBrowser(); + } else { + setupNode(); + } + + // Buffer class to use + var BufferClass = ('function' === typeof Buffer) ? Buffer : Array; + + // Maps for number <-> hex string conversion + var _byteToHex = []; + var _hexToByte = {}; + for (var i = 0; i < 256; i++) { + _byteToHex[i] = (i + 0x100).toString(16).substr(1); + _hexToByte[_byteToHex[i]] = i; + } + + // **`parse()` - Parse a UUID into it's component bytes** + function parse(s, buf, offset) { + var i = (buf && offset) || 0, ii = 0; + + buf = buf || []; + s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { + if (ii < 16) { // Don't overflow! + buf[i + ii++] = _hexToByte[oct]; + } + }); + + // Zero out remaining bytes if string was short + while (ii < 16) { + buf[i + ii++] = 0; + } + + return buf; + } + + // **`unparse()` - Convert UUID byte array (ala parse()) into a string** + function unparse(buf, offset) { + var i = offset || 0, bth = _byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; + } + + // **`v1()` - Generate time-based UUID** + // + // Inspired by https://github.com/LiosK/UUID.js + // and http://docs.python.org/library/uuid.html + + // random #'s we need to init node and clockseq + var _seedBytes = _rng(); + + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + var _nodeId = [ + _seedBytes[0] | 0x01, + _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] + ]; + + // Per 4.2.2, randomize (14 bit) clockseq + var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; + + // Previous uuid creation time + var _lastMSecs = 0, _lastNSecs = 0; + + // See https://github.com/broofa/node-uuid for API details + function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + + var clockseq = (options.clockseq != null) ? options.clockseq : _clockseq; + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = (options.msecs != null) ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = (options.nsecs != null) ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq == null) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + var node = options.node || _nodeId; + for (var n = 0; n < 6; n++) { + b[i + n] = node[n]; + } + + return buf ? buf : unparse(b); + } + + // **`v4()` - Generate random UUID** + + // See https://github.com/broofa/node-uuid for API details + function v4(options, buf, offset) { + // Deprecated - 'format' argument, as supported in v1.2 + var i = buf && offset || 0; + + if (typeof(options) === 'string') { + buf = (options === 'binary') ? new BufferClass(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || _rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ii++) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || unparse(rnds); + } + + // Export public API + var uuid = v4; + uuid.v1 = v1; + uuid.v4 = v4; + uuid.parse = parse; + uuid.unparse = unparse; + uuid.BufferClass = BufferClass; + uuid._rng = _rng; + uuid._mathRNG = _mathRNG; + uuid._nodeRNG = _nodeRNG; + uuid._whatwgRNG = _whatwgRNG; + + if (('undefined' !== typeof module) && module.exports) { + // Publish as node.js module + module.exports = uuid; + } else if (typeof define === 'function' && define.amd) { + // Publish as AMD module + define(function() {return uuid;}); + + + } else { + // Publish as global (in browsers) + _previousRoot = _window.uuid; + + // **`noConflict()` - (browser only) to reset global 'uuid' var** + uuid.noConflict = function() { + _window.uuid = _previousRoot; + return uuid; + }; + + _window.uuid = uuid; + } +})('undefined' !== typeof window ? window : null); + +},{"undefined":undefined}],161:[function(_dereq_,module,exports){ +/*! + * depd + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = depd + +/** + * Create deprecate for namespace in caller. + */ + +function depd(namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + function deprecate(message) { + // no-op in browser + } + + deprecate._file = undefined + deprecate._ignored = true + deprecate._namespace = namespace + deprecate._traced = false + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Return a wrapped function in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapfunction(fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + return fn +} + +/** + * Wrap property in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapproperty(obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } + + return +} + +},{}],162:[function(_dereq_,module,exports){ +/*! + * Copyright (c) 2015 Chris O'Hara + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +(function (name, definition) { + if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + module.exports = definition(); + } else if (typeof define === 'function' && typeof define.amd === 'object') { + define(definition); + } else if (typeof define === 'function' && typeof define.petal === 'object') { + define(name, [], definition); + } else { + this[name] = definition(); + } +})('validator', function (validator) { + + 'use strict'; + + validator = { version: '4.9.0', coerce: true }; + + var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i; + var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i; + + var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i; + var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i; + + var displayName = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i; + + var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/; + + var isin = /^[A-Z]{2}[0-9A-Z]{9}[0-9]$/; + + var isbn10Maybe = /^(?:[0-9]{9}X|[0-9]{10})$/ + , isbn13Maybe = /^(?:[0-9]{13})$/; + + var macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/; + + var ipv4Maybe = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ + , ipv6Block = /^[0-9A-F]{1,4}$/i; + + var uuid = { + '3': /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i + , '4': /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i + , '5': /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i + , all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i + }; + + var alpha = { + 'en-US': /^[A-Z]+$/i, + 'de-DE': /^[A-ZÄÖÜß]+$/i, + 'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i, + 'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i, + 'nl-NL': /^[A-ZÉËÏÓÖÜ]+$/i, + 'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i, + 'ru-RU': /^[А-ЯЁа-яё]+$/i + } + , alphanumeric = { + 'en-US': /^[0-9A-Z]+$/i, + 'de-DE': /^[0-9A-ZÄÖÜß]+$/i, + 'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i, + 'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i, + 'nl-NL': /^[0-9A-ZÉËÏÓÖÜ]+$/i, + 'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i, + 'ru-RU': /^[0-9А-ЯЁа-яё]+$/i + }; + + var englishLocales = ['AU', 'GB', 'HK', 'IN', 'NZ', 'ZA', 'ZM']; + for (var locale, i = 0; i < englishLocales.length; i++) { + locale = 'en-' + englishLocales[i]; + alpha[locale] = alpha['en-US']; + alphanumeric[locale] = alphanumeric['en-US']; + } + + var numeric = /^[-+]?[0-9]+$/ + , int = /^(?:[-+]?(?:0|[1-9][0-9]*))$/ + , float = /^(?:[-+]?(?:[0-9]+))?(?:\.[0-9]*)?(?:[eE][\+\-]?(?:[0-9]+))?$/ + , hexadecimal = /^[0-9A-F]+$/i + , decimal = /^[-+]?([0-9]+|\.[0-9]+|[0-9]+\.[0-9]+)$/ + , hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{6})$/i; + + var ascii = /^[\x00-\x7F]+$/ + , multibyte = /[^\x00-\x7F]/ + , fullWidth = /[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/ + , halfWidth = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/; + + var surrogatePair = /[\uD800-\uDBFF][\uDC00-\uDFFF]/; + + var base64 = /^(?:[A-Z0-9+\/]{4})*(?:[A-Z0-9+\/]{2}==|[A-Z0-9+\/]{3}=|[A-Z0-9+\/]{4})$/i; + + var phones = { + 'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/, + 'de-DE': /^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/, + 'el-GR': /^(\+?30)?(69\d{8})$/, + 'en-AU': /^(\+?61|0)4\d{8}$/, + 'en-GB': /^(\+?44|0)7\d{9}$/, + 'en-HK': /^(\+?852\-?)?[569]\d{3}\-?\d{4}$/, + 'en-IN': /^(\+?91|0)?[789]\d{9}$/, + 'en-NZ': /^(\+?64|0)2\d{7,9}$/, + 'en-ZA': /^(\+?27|0)\d{9}$/, + 'en-ZM': /^(\+?26)?09[567]\d{7}$/, + 'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/, + 'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5)?|50)\s?(\d\s?){4,8}\d$/, + 'fr-FR': /^(\+?33|0)[67]\d{8}$/, + 'nb-NO': /^(\+?47)?[49]\d{7}$/, + 'nn-NO': /^(\+?47)?[49]\d{7}$/, + 'pt-BR': /^(\+?55|0)\-?[1-9]{2}\-?[2-9]{1}\d{3,4}\-?\d{4}$/, + 'pt-PT': /^(\+?351)?9[1236]\d{7}$/, + 'ru-RU': /^(\+?7|8)?9\d{9}$/, + 'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/, + 'zh-CN': /^(\+?0?86\-?)?((13\d|14[57]|15[^4,\D]|17[678]|18\d)\d{8}|170[059]\d{7})$/, + 'zh-TW': /^(\+?886\-?|0)?9\d{8}$/ + }; + + // from http://goo.gl/0ejHHW + var iso8601 = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; + + validator.extend = function (name, fn) { + validator[name] = function () { + var args = Array.prototype.slice.call(arguments); + args[0] = validator.toString(args[0]); + return fn.apply(validator, args); + }; + }; + + //Right before exporting the validator object, pass each of the builtins + //through extend() so that their first argument is coerced to a string + validator.init = function () { + for (var name in validator) { + if (typeof validator[name] !== 'function' || name === 'toString' || + name === 'toDate' || name === 'extend' || name === 'init' || + name === 'isServerSide') { + continue; + } + validator.extend(name, validator[name]); + } + }; + + validator.isServerSide = function () { + return typeof module === 'object' && module && + typeof module.exports === 'object' && + typeof process === 'object' && + typeof _dereq_ === 'function'; + }; + + var depd = null; + validator.deprecation = function (msg) { + if (depd === null) { + if (!validator.isServerSide()) { + return; + } + depd = _dereq_(161)('validator'); + } + depd(msg); + }; + + validator.toString = function (input) { + if (typeof input !== 'string') { + // The library validates strings only. Currently it coerces all input to a string, but this + // will go away in an upcoming major version change. Print a deprecation notice for now + if (!validator.coerce) { + throw new Error('this library validates strings only'); + } + validator.deprecation('you tried to validate a ' + typeof input + ' but this library ' + + '(validator.js) validates strings only. Please update your code as this will ' + + 'be an error soon.'); + } + if (typeof input === 'object' && input !== null) { + if (typeof input.toString === 'function') { + input = input.toString(); + } else { + input = '[object Object]'; + } + } else if (input === null || typeof input === 'undefined' || (isNaN(input) && !input.length)) { + input = ''; + } + return '' + input; + }; + + validator.toDate = function (date) { + if (Object.prototype.toString.call(date) === '[object Date]') { + return date; + } + date = Date.parse(date); + return !isNaN(date) ? new Date(date) : null; + }; + + validator.toFloat = function (str) { + return parseFloat(str); + }; + + validator.toInt = function (str, radix) { + return parseInt(str, radix || 10); + }; + + validator.toBoolean = function (str, strict) { + if (strict) { + return str === '1' || str === 'true'; + } + return str !== '0' && str !== 'false' && str !== ''; + }; + + validator.equals = function (str, comparison) { + return str === validator.toString(comparison); + }; + + validator.contains = function (str, elem) { + return str.indexOf(validator.toString(elem)) >= 0; + }; + + validator.matches = function (str, pattern, modifiers) { + if (Object.prototype.toString.call(pattern) !== '[object RegExp]') { + pattern = new RegExp(pattern, modifiers); + } + return pattern.test(str); + }; + + var default_email_options = { + allow_display_name: false, + allow_utf8_local_part: true, + require_tld: true + }; + + validator.isEmail = function (str, options) { + options = merge(options, default_email_options); + + if (options.allow_display_name) { + var display_email = str.match(displayName); + if (display_email) { + str = display_email[1]; + } + } + + var parts = str.split('@') + , domain = parts.pop() + , user = parts.join('@'); + + var lower_domain = domain.toLowerCase(); + if (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com') { + user = user.replace(/\./g, '').toLowerCase(); + } + + if (!validator.isByteLength(user, {max: 64}) || + !validator.isByteLength(domain, {max: 256})) { + return false; + } + + if (!validator.isFQDN(domain, {require_tld: options.require_tld})) { + return false; + } + + if (user[0] === '"') { + user = user.slice(1, user.length - 1); + return options.allow_utf8_local_part ? + quotedEmailUserUtf8.test(user) : + quotedEmailUser.test(user); + } + + var pattern = options.allow_utf8_local_part ? + emailUserUtf8Part : emailUserPart; + + var user_parts = user.split('.'); + for (var i = 0; i < user_parts.length; i++) { + if (!pattern.test(user_parts[i])) { + return false; + } + } + + return true; + }; + + var default_url_options = { + protocols: [ 'http', 'https', 'ftp' ] + , require_tld: true + , require_protocol: false + , require_valid_protocol: true + , allow_underscores: false + , allow_trailing_dot: false + , allow_protocol_relative_urls: false + }; + + validator.isURL = function (url, options) { + if (!url || url.length >= 2083 || /\s/.test(url)) { + return false; + } + if (url.indexOf('mailto:') === 0) { + return false; + } + options = merge(options, default_url_options); + var protocol, auth, host, hostname, port, + port_str, split; + split = url.split('://'); + if (split.length > 1) { + protocol = split.shift(); + if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) { + return false; + } + } else if (options.require_protocol) { + return false; + } else if (options.allow_protocol_relative_urls && url.substr(0, 2) === '//') { + split[0] = url.substr(2); + } + url = split.join('://'); + split = url.split('#'); + url = split.shift(); + + split = url.split('?'); + url = split.shift(); + + split = url.split('/'); + url = split.shift(); + split = url.split('@'); + if (split.length > 1) { + auth = split.shift(); + if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) { + return false; + } + } + hostname = split.join('@'); + split = hostname.split(':'); + host = split.shift(); + if (split.length) { + port_str = split.join(':'); + port = parseInt(port_str, 10); + if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) { + return false; + } + } + if (!validator.isIP(host) && !validator.isFQDN(host, options) && + host !== 'localhost') { + return false; + } + if (options.host_whitelist && + options.host_whitelist.indexOf(host) === -1) { + return false; + } + if (options.host_blacklist && + options.host_blacklist.indexOf(host) !== -1) { + return false; + } + return true; + }; + + validator.isMACAddress = function (str) { + return macAddress.test(str); + }; + + validator.isIP = function (str, version) { + version = version ? version + '' : ''; + if (!version) { + return validator.isIP(str, 4) || validator.isIP(str, 6); + } else if (version === '4') { + if (!ipv4Maybe.test(str)) { + return false; + } + var parts = str.split('.').sort(function (a, b) { + return a - b; + }); + return parts[3] <= 255; + } else if (version === '6') { + var blocks = str.split(':'); + var foundOmissionBlock = false; // marker to indicate :: + + // At least some OS accept the last 32 bits of an IPv6 address + // (i.e. 2 of the blocks) in IPv4 notation, and RFC 3493 says + // that '::ffff:a.b.c.d' is valid for IPv4-mapped IPv6 addresses, + // and '::a.b.c.d' is deprecated, but also valid. + var foundIPv4TransitionBlock = validator.isIP(blocks[blocks.length - 1], 4); + var expectedNumberOfBlocks = foundIPv4TransitionBlock ? 7 : 8; + + if (blocks.length > expectedNumberOfBlocks) + return false; + + // initial or final :: + if (str === '::') { + return true; + } else if (str.substr(0, 2) === '::') { + blocks.shift(); + blocks.shift(); + foundOmissionBlock = true; + } else if (str.substr(str.length - 2) === '::') { + blocks.pop(); + blocks.pop(); + foundOmissionBlock = true; + } + + for (var i = 0; i < blocks.length; ++i) { + // test for a :: which can not be at the string start/end + // since those cases have been handled above + if (blocks[i] === '' && i > 0 && i < blocks.length -1) { + if (foundOmissionBlock) + return false; // multiple :: in address + foundOmissionBlock = true; + } else if (foundIPv4TransitionBlock && i == blocks.length - 1) { + // it has been checked before that the last + // block is a valid IPv4 address + } else if (!ipv6Block.test(blocks[i])) { + return false; + } + } + + if (foundOmissionBlock) { + return blocks.length >= 1; + } else { + return blocks.length === expectedNumberOfBlocks; + } + } + return false; + }; + + var default_fqdn_options = { + require_tld: true + , allow_underscores: false + , allow_trailing_dot: false + }; + + validator.isFQDN = function (str, options) { + options = merge(options, default_fqdn_options); + + /* Remove the optional trailing dot before checking validity */ + if (options.allow_trailing_dot && str[str.length - 1] === '.') { + str = str.substring(0, str.length - 1); + } + var parts = str.split('.'); + if (options.require_tld) { + var tld = parts.pop(); + if (!parts.length || !/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) { + return false; + } + } + for (var part, i = 0; i < parts.length; i++) { + part = parts[i]; + if (options.allow_underscores) { + if (part.indexOf('__') >= 0) { + return false; + } + part = part.replace(/_/g, ''); + } + if (!/^[a-z\u00a1-\uffff0-9-]+$/i.test(part)) { + return false; + } + if (/[\uff01-\uff5e]/.test(part)) { + // disallow full-width chars + return false; + } + if (part[0] === '-' || part[part.length - 1] === '-') { + return false; + } + } + return true; + }; + + validator.isBoolean = function(str) { + return (['true', 'false', '1', '0'].indexOf(str) >= 0); + }; + + validator.isAlpha = function (str, locale) { + locale = locale || 'en-US'; + if (locale in alpha) { + return alpha[locale].test(str); + } + throw new Error('Invalid locale \'' + locale + '\''); + }; + + validator.isAlphanumeric = function (str, locale) { + locale = locale || 'en-US'; + if (locale in alphanumeric) { + return alphanumeric[locale].test(str); + } + throw new Error('Invalid locale \'' + locale + '\''); + }; + + validator.isNumeric = function (str) { + return numeric.test(str); + }; + + validator.isDecimal = function (str) { + return str !== '' && decimal.test(str); + }; + + validator.isHexadecimal = function (str) { + return hexadecimal.test(str); + }; + + validator.isHexColor = function (str) { + return hexcolor.test(str); + }; + + validator.isLowercase = function (str) { + return str === str.toLowerCase(); + }; + + validator.isUppercase = function (str) { + return str === str.toUpperCase(); + }; + + validator.isInt = function (str, options) { + options = options || {}; + return int.test(str) && (!options.hasOwnProperty('min') || str >= options.min) && (!options.hasOwnProperty('max') || str <= options.max); + }; + + validator.isFloat = function (str, options) { + options = options || {}; + if (str === '' || str === '.') { + return false; + } + return float.test(str) && (!options.hasOwnProperty('min') || str >= options.min) && (!options.hasOwnProperty('max') || str <= options.max); + }; + + validator.isDivisibleBy = function (str, num) { + return validator.toFloat(str) % parseInt(num, 10) === 0; + }; + + validator.isNull = function (str) { + return str.length === 0; + }; + + validator.isLength = function (str, options) { + var min, max; + if (typeof(options) === 'object') { + min = options.min || 0; + max = options.max; + } else { // backwards compatibility: isLength(str, min [, max]) + min = arguments[1]; + max = arguments[2]; + } + var surrogatePairs = str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g) || []; + var len = str.length - surrogatePairs.length; + return len >= min && (typeof max === 'undefined' || len <= max); + }; + validator.isByteLength = function (str, options) { + var min, max; + if (typeof(options) === 'object') { + min = options.min || 0; + max = options.max; + } else { // backwards compatibility: isByteLength(str, min [, max]) + min = arguments[1]; + max = arguments[2]; + } + var len = encodeURI(str).split(/%..|./).length - 1; + return len >= min && (typeof max === 'undefined' || len <= max); + }; + + validator.isUUID = function (str, version) { + var pattern = uuid[version ? version : 'all']; + return pattern && pattern.test(str); + }; + + function getTimezoneOffset(str) { + var iso8601Parts = str.match(iso8601) + , timezone, sign, hours, minutes; + if (!iso8601Parts) { + str = str.toLowerCase(); + timezone = str.match(/(?:\s|gmt\s*)(-|\+)(\d{1,4})(\s|$)/); + if (!timezone) { + return str.indexOf('gmt') !== -1 ? 0 : null; + } + sign = timezone[1]; + var offset = timezone[2]; + if (offset.length === 3) { + offset = '0' + offset; + } + if (offset.length <= 2) { + hours = 0; + minutes = parseInt(offset); + } else { + hours = parseInt(offset.slice(0, 2)); + minutes = parseInt(offset.slice(2, 4)); + } + } else { + timezone = iso8601Parts[21]; + if (!timezone) { + // if no hour/minute was provided, the date is GMT + return !iso8601Parts[12] ? 0 : null; + } + if (timezone === 'z' || timezone === 'Z') { + return 0; + } + sign = iso8601Parts[22]; + if (timezone.indexOf(':') !== -1) { + hours = parseInt(iso8601Parts[23]); + minutes = parseInt(iso8601Parts[24]); + } else { + hours = 0; + minutes = parseInt(iso8601Parts[23]); + } + } + return (hours * 60 + minutes) * (sign === '-' ? 1 : -1); + } + + validator.isDate = function (str) { + var normalizedDate = new Date(Date.parse(str)); + if (isNaN(normalizedDate)) { + return false; + } + + // normalizedDate is in the user's timezone. Apply the input + // timezone offset to the date so that the year and day match + // the input + var timezoneOffset = getTimezoneOffset(str); + if (timezoneOffset !== null) { + var timezoneDifference = normalizedDate.getTimezoneOffset() - + timezoneOffset; + normalizedDate = new Date(normalizedDate.getTime() + + 60000 * timezoneDifference); + } + + var day = String(normalizedDate.getDate()); + var dayOrYear, dayOrYearMatches, year; + //check for valid double digits that could be late days + //check for all matches since a string like '12/23' is a valid date + //ignore everything with nearby colons + dayOrYearMatches = str.match(/(^|[^:\d])[23]\d([^:\d]|$)/g); + if (!dayOrYearMatches) { + return true; + } + dayOrYear = dayOrYearMatches.map(function(digitString) { + return digitString.match(/\d+/g)[0]; + }).join('/'); + + year = String(normalizedDate.getFullYear()).slice(-2); + if (dayOrYear === day || dayOrYear === year) { + return true; + } else if ((dayOrYear === (day + '/' + year)) || (dayOrYear === (year + '/' + day))) { + return true; + } + return false; + }; + + validator.isAfter = function (str, date) { + var comparison = validator.toDate(date || new Date()) + , original = validator.toDate(str); + return !!(original && comparison && original > comparison); + }; + + validator.isBefore = function (str, date) { + var comparison = validator.toDate(date || new Date()) + , original = validator.toDate(str); + return !!(original && comparison && original < comparison); + }; + + validator.isIn = function (str, options) { + var i; + if (Object.prototype.toString.call(options) === '[object Array]') { + var array = []; + for (i in options) { + array[i] = validator.toString(options[i]); + } + return array.indexOf(str) >= 0; + } else if (typeof options === 'object') { + return options.hasOwnProperty(str); + } else if (options && typeof options.indexOf === 'function') { + return options.indexOf(str) >= 0; + } + return false; + }; + + validator.isWhitelisted = function (str, chars) { + for (var i = str.length - 1; i >= 0; i--) { + if (chars.indexOf(str[i]) === -1) { + return false; + } + } + + return true; + }; + + validator.isCreditCard = function (str) { + var sanitized = str.replace(/[^0-9]+/g, ''); + if (!creditCard.test(sanitized)) { + return false; + } + var sum = 0, digit, tmpNum, shouldDouble; + for (var i = sanitized.length - 1; i >= 0; i--) { + digit = sanitized.substring(i, (i + 1)); + tmpNum = parseInt(digit, 10); + if (shouldDouble) { + tmpNum *= 2; + if (tmpNum >= 10) { + sum += ((tmpNum % 10) + 1); + } else { + sum += tmpNum; + } + } else { + sum += tmpNum; + } + shouldDouble = !shouldDouble; + } + return !!((sum % 10) === 0 ? sanitized : false); + }; + + validator.isISIN = function (str) { + if (!isin.test(str)) { + return false; + } + + var checksumStr = str.replace(/[A-Z]/g, function(character) { + return parseInt(character, 36); + }); + + var sum = 0, digit, tmpNum, shouldDouble = true; + for (var i = checksumStr.length - 2; i >= 0; i--) { + digit = checksumStr.substring(i, (i + 1)); + tmpNum = parseInt(digit, 10); + if (shouldDouble) { + tmpNum *= 2; + if (tmpNum >= 10) { + sum += tmpNum + 1; + } else { + sum += tmpNum; + } + } else { + sum += tmpNum; + } + shouldDouble = !shouldDouble; + } + + return parseInt(str.substr(str.length - 1), 10) === (10000 - sum) % 10; + }; + + validator.isISBN = function (str, version) { + version = version ? version + '' : ''; + if (!version) { + return validator.isISBN(str, 10) || validator.isISBN(str, 13); + } + var sanitized = str.replace(/[\s-]+/g, '') + , checksum = 0, i; + if (version === '10') { + if (!isbn10Maybe.test(sanitized)) { + return false; + } + for (i = 0; i < 9; i++) { + checksum += (i + 1) * sanitized.charAt(i); + } + if (sanitized.charAt(9) === 'X') { + checksum += 10 * 10; + } else { + checksum += 10 * sanitized.charAt(9); + } + if ((checksum % 11) === 0) { + return !!sanitized; + } + } else if (version === '13') { + if (!isbn13Maybe.test(sanitized)) { + return false; + } + var factor = [ 1, 3 ]; + for (i = 0; i < 12; i++) { + checksum += factor[i % 2] * sanitized.charAt(i); + } + if (sanitized.charAt(12) - ((10 - (checksum % 10)) % 10) === 0) { + return !!sanitized; + } + } + return false; + }; + + validator.isMobilePhone = function(str, locale) { + if (locale in phones) { + return phones[locale].test(str); + } + return false; + }; + + var default_currency_options = { + symbol: '$' + , require_symbol: false + , allow_space_after_symbol: false + , symbol_after_digits: false + , allow_negatives: true + , parens_for_negatives: false + , negative_sign_before_digits: false + , negative_sign_after_digits: false + , allow_negative_sign_placeholder: false + , thousands_separator: ',' + , decimal_separator: '.' + , allow_space_after_digits: false + }; + + validator.isCurrency = function (str, options) { + options = merge(options, default_currency_options); + + return currencyRegex(options).test(str); + }; + + validator.isJSON = function (str) { + try { + var obj = JSON.parse(str); + return !!obj && typeof obj === 'object'; + } catch (e) {} + return false; + }; + + validator.isMultibyte = function (str) { + return multibyte.test(str); + }; + + validator.isAscii = function (str) { + return ascii.test(str); + }; + + validator.isFullWidth = function (str) { + return fullWidth.test(str); + }; + + validator.isHalfWidth = function (str) { + return halfWidth.test(str); + }; + + validator.isVariableWidth = function (str) { + return fullWidth.test(str) && halfWidth.test(str); + }; + + validator.isSurrogatePair = function (str) { + return surrogatePair.test(str); + }; + + validator.isBase64 = function (str) { + return base64.test(str); + }; + + validator.isMongoId = function (str) { + return validator.isHexadecimal(str) && str.length === 24; + }; + + validator.isISO8601 = function (str) { + return iso8601.test(str); + }; + + validator.ltrim = function (str, chars) { + var pattern = chars ? new RegExp('^[' + chars + ']+', 'g') : /^\s+/g; + return str.replace(pattern, ''); + }; + + validator.rtrim = function (str, chars) { + var pattern = chars ? new RegExp('[' + chars + ']+$', 'g') : /\s+$/g; + return str.replace(pattern, ''); + }; + + validator.trim = function (str, chars) { + var pattern = chars ? new RegExp('^[' + chars + ']+|[' + chars + ']+$', 'g') : /^\s+|\s+$/g; + return str.replace(pattern, ''); + }; + + validator.escape = function (str) { + return (str.replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>') + .replace(/\//g, '/') + .replace(/\`/g, '`')); + }; + + validator.stripLow = function (str, keep_new_lines) { + var chars = keep_new_lines ? '\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F' : '\\x00-\\x1F\\x7F'; + return validator.blacklist(str, chars); + }; + + validator.whitelist = function (str, chars) { + return str.replace(new RegExp('[^' + chars + ']+', 'g'), ''); + }; + + validator.blacklist = function (str, chars) { + return str.replace(new RegExp('[' + chars + ']+', 'g'), ''); + }; + + var default_normalize_email_options = { + lowercase: true, + remove_dots: true, + remove_extension: true + }; + + validator.normalizeEmail = function (email, options) { + options = merge(options, default_normalize_email_options); + if (!validator.isEmail(email)) { + return false; + } + var parts = email.split('@', 2); + parts[1] = parts[1].toLowerCase(); + if (parts[1] === 'gmail.com' || parts[1] === 'googlemail.com') { + if (options.remove_extension) { + parts[0] = parts[0].split('+')[0]; + } + if (options.remove_dots) { + parts[0] = parts[0].replace(/\./g, ''); + } + if (!parts[0].length) { + return false; + } + parts[0] = parts[0].toLowerCase(); + parts[1] = 'gmail.com'; + } else if (options.lowercase) { + parts[0] = parts[0].toLowerCase(); + } + return parts.join('@'); + }; + + function merge(obj, defaults) { + obj = obj || {}; + for (var key in defaults) { + if (typeof obj[key] === 'undefined') { + obj[key] = defaults[key]; + } + } + return obj; + } + + function currencyRegex(options) { + var symbol = '(\\' + options.symbol.replace(/\./g, '\\.') + ')' + (options.require_symbol ? '' : '?') + , negative = '-?' + , whole_dollar_amount_without_sep = '[1-9]\\d*' + , whole_dollar_amount_with_sep = '[1-9]\\d{0,2}(\\' + options.thousands_separator + '\\d{3})*' + , valid_whole_dollar_amounts = ['0', whole_dollar_amount_without_sep, whole_dollar_amount_with_sep] + , whole_dollar_amount = '(' + valid_whole_dollar_amounts.join('|') + ')?' + , decimal_amount = '(\\' + options.decimal_separator + '\\d{2})?'; + var pattern = whole_dollar_amount + decimal_amount; + // default is negative sign before symbol, but there are two other options (besides parens) + if (options.allow_negatives && !options.parens_for_negatives) { + if (options.negative_sign_after_digits) { + pattern += negative; + } + else if (options.negative_sign_before_digits) { + pattern = negative + pattern; + } + } + // South African Rand, for example, uses R 123 (space) and R-123 (no space) + if (options.allow_negative_sign_placeholder) { + pattern = '( (?!\\-))?' + pattern; + } + else if (options.allow_space_after_symbol) { + pattern = ' ?' + pattern; + } + else if (options.allow_space_after_digits) { + pattern += '( (?!$))?'; + } + if (options.symbol_after_digits) { + pattern += symbol; + } else { + pattern = symbol + pattern; + } + if (options.allow_negatives) { + if (options.parens_for_negatives) { + pattern = '(\\(' + pattern + '\\)|' + pattern + ')'; + } + else if (!(options.negative_sign_before_digits || options.negative_sign_after_digits)) { + pattern = negative + pattern; + } + } + return new RegExp( + '^' + + // ensure there's a dollar and/or decimal amount, and that it doesn't start with a space or a negative sign followed by a space + '(?!-? )(?=.*\\d)' + + pattern + + '$' + ); + } + + validator.init(); + + return validator; + +}); + +},{"161":161}],163:[function(_dereq_,module,exports){ +'use strict'; + +_dereq_(152); +_dereq_(148); + +if (!Object.assign) { + _dereq_(149); +} + +if (!Object.setPrototypeOf) { + _dereq_(150); +} + +if (typeof Promise === "undefined") { + _dereq_(151); +} + +if (!Array.from) { + _dereq_(146); + _dereq_(147); +} + +if (typeof Symbol === "undefined") { + _dereq_(153); +} + +},{"146":146,"147":147,"148":148,"149":149,"150":150,"151":151,"152":152,"153":153}],164:[function(_dereq_,module,exports){ +"use strict"; + +var Connector = _dereq_(23); +var message = _dereq_(36); +var WebSocket = _dereq_(165).WebSocket; + +/** + * @alias connector.WebSocketConnector + */ + +var WebSocketConnector = function () { + + /** + * @param {connector.Connector} connector a connector + * @return {connector.WebSocketConnector} a websocket connection + */ + WebSocketConnector.create = function create(connector) { + if (!connector) throw new Error('No connector was provided, but connector is required for websocket connection!'); + + var websocket = this.websockets[connector.origin]; + + if (!websocket) { + websocket = new WebSocketConnector(connector); + this.websockets[connector.origin] = websocket; + } + + return websocket; + }; + + /** + * @param {connector.Connector} connector + */ + + + function WebSocketConnector(connector) { + babelHelpers.classCallCheck(this, WebSocketConnector); + + this.host = connector.host; + this.port = connector.port; + this.secure = connector.secure; + this.basePath = connector.basePath; + this.connector = connector; + this.listeners = {}; + } + + /** + * Registers a handler for a topic. + * @param {string|Object} topic + * @param {Function} cb + */ + + + WebSocketConnector.prototype.subscribe = function subscribe(topic, cb) { + topic = Object(topic) instanceof String ? topic : JSON.stringify(topic); + if (!this.listeners[topic]) { + this.listeners[topic] = [cb]; + } else if (this.listeners[topic].indexOf(cb) == -1) { + this.listeners[topic].push(cb); + } + }; + + /** + * Deregisters a handler. + * @param {string|Object} topic + * @param {Function} cb + */ + + + WebSocketConnector.prototype.unsubscribe = function unsubscribe(topic, cb) { + topic = Object(topic) instanceof String ? topic : JSON.stringify(topic); + if (this.listeners[topic]) { + var index = this.listeners[topic].indexOf(cb); + if (index != -1) { + this.listeners[topic].splice(index, 1); + } + } + }; + + WebSocketConnector.prototype.socketListener = function socketListener(event) { + var message = JSON.parse(event.data); + var topic = message.topic; + topic = Object(topic) instanceof String ? topic : JSON.stringify(topic); + if (this.listeners[topic]) { + this.listeners[topic].forEach(function (listener) { + listener(message); + }); + } + }; + + /** + * Sends a websocket message over a lazily initialized websocket connection. + * @param {Object} msg + * @param {string} msg.topic + * @param {string} msg.token + */ + + + WebSocketConnector.prototype.sendOverSocket = function sendOverSocket(msg) { + var _this = this; + + //Lazy socket initialization + if (!this.socketOpen) { + //Resolve Promise on connect + this.socketOpen = new Promise(function (resolve, reject) { + _this.connector.send(new message.EventsUrl()).then(function (response) { + return response.entity.urls; + }, function () { + return null; + }).then(function (urls) { + var url = void 0; + if (urls) { + (function () { + var prefix = _this.secure ? "wss://" : "ws://"; + urls = urls.filter(function (url) { + return url.indexOf(prefix) == 0; + }); + + var len = urls.length; + url = urls[Math.floor(Math.random() * len)]; + })(); + } else { + url = (_this.secure ? 'wss://' : 'ws://') + _this.host + ':' + _this.port + _this.basePath + '/events'; + } + + _this.socket = _this.createWebSocket(url); + _this.socket.onmessage = _this.socketListener.bind(_this); + + _this.socket.onopen = resolve; + _this.socket.onerror = reject; + + //Reset socket on close + _this.socket.onclose = function () { + _this.socket = null; + _this.socketOpen = null; + }; + }).catch(reject); + }); + } + + this.socketOpen.then(function () { + var jsonMessage = JSON.stringify(msg); + _this.socket.send(jsonMessage); + }); + }; + + WebSocketConnector.prototype.createWebSocket = function createWebSocket(destination) { + return new WebSocket(destination); + }; + + return WebSocketConnector; +}(); + +Object.assign(WebSocketConnector, /** @lends connector.WebSocketConnector */{ + /** + * Map of all available connectors to their respective websocket connections + * @type connector.Connector[] + */ + websockets: {} +}); + +module.exports = WebSocketConnector; + +},{"165":165,"23":23,"36":36}],165:[function(_dereq_,module,exports){ +"use strict"; + +exports.WebSocket = window.WebSocket; + +},{}],166:[function(_dereq_,module,exports){ +'use strict'; + +var db = _dereq_(35); + +module.exports = exports = db; + +exports.Observable = _dereq_(167); +exports.connector.WebSocketConnector = _dereq_(164); +exports.query.Node = _dereq_(168); +exports.query.Stream = _dereq_(169); + +},{"164":164,"167":167,"168":168,"169":169,"35":35}],167:[function(_dereq_,module,exports){ +'use strict'; + +/* + * loads the observalbe from the global context, the global Rx variable or try to load Rx.js, fallback to core-js shim + * The Observable can be overwritten by setting the require('baqend/streaming').Observable = Observable afterwards + */ + +if (typeof Rx !== 'undefined') { + module.exports = Rx.Observable; +} else { + try { + module.exports = _dereq_('rxjs/Observable').Observable; + } catch (e) { + if (typeof Observable == 'undefined') { + //load Observable shim + _dereq_(155); + _dereq_(154); + var sub = Observable.prototype.subscribe; + + //patch subscribe until core-js implements the new proposal + //https://github.com/zloirock/core-js/issues/257 + Observable.prototype.subscribe = function (onNext, onError, onComplete) { + if (onNext instanceof Function) { + return sub.call(this, { + next: onNext, + error: onError, + complete: onComplete + }); + } else { + return sub.call(this, onNext); + } + }; + } + + module.exports = Observable; + } +} + +},{"154":154,"155":155,"undefined":undefined}],168:[function(_dereq_,module,exports){ +"use strict"; + +var Stream = _dereq_(169); +var Node = _dereq_(56); + +/** + * @ignore + * + * @param {Object} options + * @param {query.Node} target + * @returns {Observable} an RxJS observable + * @memberOf query.Node.prototype + */ +Node.prototype._stream = function (options, target) { + var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null; + if (!type) { + throw new Error('Only typed queries can be executed.'); + } + + if (!target) { + target = this; + } + + return new Stream(this.entityManager, type.name, this._serializeQuery(), options, this._serializeSort(), this.maxResults, this.firstResult, target).observable(); +}; + +module.exports = Node; + +},{"169":169,"56":56}],169:[function(_dereq_,module,exports){ +"use strict"; + +var Metadata = _dereq_(63); +var WebSocketConnector = _dereq_(164); +var lib = _dereq_(35); + +/** + * @alias query.Stream + */ + +var Stream = function () { + + /** + * Returns an RxJS observable. + * + * @returns {Observable} an RxJS observable + */ + Stream.prototype.observable = function observable() { + var _this = this; + + return new lib.Observable(function (observer) { + var callback = function callback(e) { + if (e.errorMessage) { + observer.error(e); + } else { + observer.next(e); + } + }; + + _this.on(_this.query.matchTypes, callback); + return function () { + _this.off(_this.query.matchTypes, callback); + }; + }); + }; + + /** + * @param {EntityManager} entityManager The owning entity manager of this query + * @param {string} bucket The Bucket on which the streaming query is performed + * @param {string} query The serialized query + * @param {Object} options an object containing parameters + * @param {string} sort the sort string + * @param {number} limit the count, i.e. the number of items in the result + * @param {number} offset offset, i.e. the number of items to skip + * @param {query.Node} target the target of the stream + */ + + + function Stream(entityManager, bucket, query, options, sort, limit, offset, target) { + babelHelpers.classCallCheck(this, Stream); + + var verifiedOptions = Stream.parseOptions(options); + this.entityManager = entityManager; + this.query = { + bucket: bucket, + matchTypes: verifiedOptions.matchTypes, + operations: verifiedOptions.operations, + initial: verifiedOptions.initial, + query: query, + sort: sort, + start: offset, + count: limit + }; + this.callbacks = []; + this.topic = Stream.getTopic(this.query.bucket, this.query.query, this.query.start, this.query.count, this.query.sort, this.query.matchTypes, this.query.operations); + this.target = target; + this.socket = WebSocketConnector.create(entityManager._connector); + } + + Stream.prototype.on = function on(matchTypes, callback) { + var wrappedCallback = this._wrapQueryCallback(callback); + this.socket.subscribe(this.topic, wrappedCallback); + + var queryMessage = { + register: true, + topic: this.topic, + query: this.query + }; + + if (this.query.initial === true) { + queryMessage.fromstart = true; + } + + this.socket.sendOverSocket(queryMessage); + + this.callbacks.push({ + matchTypes: matchTypes, + callback: callback, + topic: this.topic, + wrappedCallback: wrappedCallback, + queryMessage: queryMessage + }); + }; + + Stream.prototype.off = function off(matchTypes, callback) { + var _this2 = this; + + this.callbacks = this.callbacks.reduce(function (keep, el) { + if ((!callback || el.callback == callback) && (!matchTypes || el.matchTypes == matchTypes)) { + _this2.socket.unsubscribe(el.topic, el.wrappedCallback); + el.queryMessage.register = false; + _this2.socket.sendOverSocket(el.queryMessage); + } else { + keep.push(el); + } + return keep; + }, []); + }; + + Stream.getCachableQueryString = function getCachableQueryString(query, start, count, sort) { + var queryID = query; + if (Stream.isEmptyJSONString(query)) { + queryID = "{}"; + } + if (start > 0) { + queryID += "&start=" + start; + } + if (count > 0) { + queryID += "&count=" + count; + } + if (!Stream.isEmptyJSONString(sort)) { + queryID += "&sort=" + sort; + } + return queryID; + }; + + Stream.getTopic = function getTopic(bucket, query, start, count, sort, matchTypes, operations) { + return [bucket, Stream.getCachableQueryString(query, start, count, sort), Stream.normalizeMatchTypes(matchTypes).join("_"), Stream.normalizeOperations(operations).join("_")].join("/"); + }; + + Stream.isEmptyJSONString = function isEmptyJSONString(string) { + return string === undefined || string === null || /^\s*(\{\s*\})?\s*$/.test(string); + }; + + /** + * Valid options are: +
    +
  • initial: a Boolean indicating whether or not the initial result set should be delivered on creating the subscription
  • +
  • matchTypes: a list of match types
  • +
  • operations: a list of operations
  • +
  • +
+ * + * + * @param {Object} provided object containing options + * @returns {Object} an object containing VALID options + */ + + + Stream.parseOptions = function parseOptions(provided) { + var verified = { + matchTypes: ['all'], + operations: ['any'] + }; + + if (provided) { + if (provided.initial !== null && provided.initial !== undefined) { + if (typeof provided.initial === "boolean") { + verified.initial = provided.initial; + } else { + throw new Error('Option "initial" only permits Boolean values!'); + } + } + + if (provided.matchTypes) { + if (Array.isArray(provided.matchTypes)) { + verified.matchTypes = provided.matchTypes; + } else { + verified.matchTypes = [provided.matchTypes]; + } + + verified.matchTypes = Stream.normalizeMatchTypes(verified.matchTypes); + } + + if (provided.operations) { + if (Array.isArray(provided.operations)) { + verified.operations = provided.operations; + } else { + verified.operations = [provided.operations]; + } + + verified.operations = Stream.normalizeOperations(verified.operations); + } + + if (verified.matchTypes.indexOf('all') == -1 && verified.operations.indexOf('any') == -1) { + throw new Error('Only subscriptions for either operations or matchTypes are allowed. You cannot subscribe to a query using matchTypes and operations at the same time!'); + } + } + + // Apply default values if missing + if (verified.initial === null || verified.initial === undefined) { + verified.initial = true; + } + + if (!verified.matchTypes) { + verified.matchTypes = ['all']; + } + + if (!verified.operations) { + verified.operations = ['any']; + } + + return verified; + }; + + Stream.normalizeMatchTypes = function normalizeMatchTypes(list) { + return Stream.normalizeSortedSet(list, 'all', "match types", ['add', 'change', 'changeIndex', 'match', 'remove']); + }; + + Stream.normalizeOperations = function normalizeOperations(list) { + return Stream.normalizeSortedSet(list, 'any', "operations", ['delete', 'insert', 'none', 'update']); + }; + + Stream.normalizeSortedSet = function normalizeSortedSet(list, wildcard, itemType, allowedItems) { + if (!list || list.length == 0) { + //undefined or empty list --> default value + return undefined; + } + + // sort, remove duplicates and check whether all values are allowed + list.sort(); + var item; + var lastItem = undefined; + for (var i = list.length - 1; i >= 0; i--) { + item = list[i]; + if (!item) { + //undefined and null item in the list --> invalid! + throw new Error('undefined and null not allowed!'); + } + if (item === lastItem) { + //remove duplicates + list.splice(i, 1); + } + if (item === wildcard) { + return [wildcard]; + } + if (allowedItems.indexOf(item) == -1) { + //raise error on invalid elements + throw new Error(item + ' not allowed for ' + itemType + '! (permitted: ' + allowedItems + '.)'); + } + lastItem = item; + } + + return list; + }; + + Stream.prototype._wrapQueryCallback = function _wrapQueryCallback(cb) { + return function (msg) { + var _this3 = this; + + msg.query = this.query; + + if (msg.result) { + //Initial result received + var basicMatch = { matchType: "add", operation: 'none' }; + var index = 0; + msg.result.forEach(function (obj) { + var entity = _this3._createObject(obj, false); + if (msg.ordered) { + basicMatch.index = index++; + } + var callback = _this3.createCallback(msg, basicMatch, entity, true); + cb(callback); + }, this); + } + if (msg.match) { + //Single Match received, hollow object for deletes + var obj = msg.match.object; + var entity = this._createObject(obj, msg.match.operation === "delete"); + //Call wrapped callback + var callback = this.createCallback(msg, msg.match, entity, false); + cb(callback); + } + + if (msg.errorMessage) { + //error message + var error = this.createError(msg); + cb(error); + } + }.bind(this); + }; + + Stream.prototype.createCallback = function createCallback(msg, match, entity, init) { + var matchEvent = { + matchType: match.matchType, + operation: match.operation, + data: entity, + date: new Date(msg.date), + target: this.target, + initial: init + }; + if (match.index !== undefined) { + matchEvent.index = match.index; + } + return matchEvent; + }; + + Stream.prototype.createError = function createError(msg) { + var error = { + errorMessage: msg.errorMessage, + date: new Date(msg.date), + target: this.target + }; + return error; + }; + + Stream.prototype._createObject = function _createObject(object, objectWasDeleted) { + var entity; + if (object) { + entity = this.entityManager.getReference(object.id); + if (entity.version < object.version || objectWasDeleted) { + var metadata = Metadata.get(entity); + if (objectWasDeleted) { + metadata.setRemoved(); + } else { + metadata.setJson(object, true); + metadata.setPersistent(); + } + } + } + return entity; + }; + + return Stream; +}(); + +module.exports = Stream; + +},{"164":164,"35":35,"63":63}]},{},[166])(166) +}); \ No newline at end of file diff --git a/dist/baqend-streaming.min.js b/dist/baqend-streaming.min.js new file mode 100644 index 00000000..ac2b90ec --- /dev/null +++ b/dist/baqend-streaming.min.js @@ -0,0 +1,7 @@ +/*! baqend 2.4.3 | Copyright (c) 2015 Baqend GmbH | MIT */ +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.DB=a()}}(function(){var a,b={};return b.typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},b.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},b.createClass=function(){function a(a,b){for(var c=0;c0&&b.bloomFilter&&h.atob&&!h.isNode&&this.updateBloomFilter(b.bloomFilter))},c.prototype._createObjectFactory=function(a){Object.keys(a).forEach(function(a){var b=this.metamodel.managedType(a),c=b.name;this[c]?(b.typeConstructor=this[c],Object.defineProperty(this,c,{value:b.createObjectFactory(this)})):Object.defineProperty(this,c,{get:function(){return Object.defineProperty(this,c,{value:b.createObjectFactory(this)}),this[c]},set:function(a){b.typeConstructor=a},configurable:!0})},this)},c.prototype.send=function(a){var b=this;return a.tokenStorage=this.tokenStorage,this._connector.send(a).catch(function(a){throw a.status==o.BAD_CREDENTIALS&&b._logout(),a})},c.prototype.getReference=function(a,b){var c,d;b?(d=this.metamodel.entity(a),c=0==b.indexOf("/db/")?b:d.ref+"/"+encodeURIComponent(b)):(c=a,d=this.metamodel.entity(c.substring(0,c.indexOf("/",4))));var e=this._entities[c];if(!e){e=d.create();var f=l.get(e);f.id=c,f.setUnavailable(),this._attach(e)}return e},c.prototype.createQueryBuilder=function(a){return new i.Builder(this,a)},c.prototype.clear=function(){this._entities={}},c.prototype.close=function(){return this._connector=null,this.clear()},c.prototype.contains=function(a){return!!a&&this._entities[a.id]===a},c.prototype.containsById=function(a){return!(!a||!this._entities[a.id])},c.prototype.detach=function(a){var b=this,c=l.get(a);return c.withLock(function(){return b.removeReference(a),Promise.resolve(a)})},c.prototype.resolveDepth=function(a,b){var c=this;if(!b||!b.depth)return Promise.resolve(a);b.resolved=b.resolved||[];var d=[],e=Object.assign({},b,{depth:b.depth===!0||b.depth-1});return this.getSubEntities(a,1).forEach(function(a){null==a||~b.resolved.indexOf(a)||(b.resolved.push(a),d.push(c.load(a.id,null,e)))}),Promise.all(d).then(function(){return a})},c.prototype.load=function(a,b,c){var d=this;c=c||{};var f=this.getReference(a,b),g=l.get(f);if(!c.refresh&&c.local&&g.isAvailable)return this.resolveDepth(f,c);var h=new e.GetObject(g.bucket,g.key);return this.ensureCacheHeader(f.id,h,c.refresh),this.send(h).then(function(e){return f.version>e.entity.version?(c.refresh=!0,d.load(a,b,c)):(d.addToWhiteList(e.entity.id),e.status!=o.NOT_MODIFIED&&g.setJson(e.entity,!0),d.resolveDepth(f,c))},function(a){if(a.status==o.OBJECT_NOT_FOUND)return d.removeReference(f),g.setRemoved(),null;throw a})},c.prototype.insert=function(a,b){var c=this;b=b||{};var d;return this._save(a,b,function(a,b){if(a.version)throw new f.PersistentError("Existing objects can't be inserted.");return d=!a.id,new e.CreateObject(a.bucket,b)}).then(function(b){return d&&c._attach(a),b})},c.prototype.update=function(a,b){return b=b||{},this._save(a,b,function(a,c){if(!a.version)throw new f.PersistentError("New objects can't be inserted.");return b.force?(delete c.version,new e.ReplaceObject(a.bucket,a.key,c).ifMatch("*")):new e.ReplaceObject(a.bucket,a.key,c).ifMatch(a.version)})},c.prototype.save=function(a,b,c){b=b||{};var d=function(a,c){if(b.force){if(!a.id)throw new f.PersistentError("New special objects can't be forcedly saved.");return delete c.version,new e.ReplaceObject(a.bucket,a.key,c)}return a.version?new e.ReplaceObject(a.bucket,a.key,c).ifMatch(a.version):new e.CreateObject(a.bucket,c)};return c?this._locklessSave(a,b,d):this._save(a,b,d)},c.prototype.optimisticSave=function(a,b){var c=this;return l.get(a).withLock(function(){return c._optimisticSave(a,b)})},c.prototype._optimisticSave=function(a,b){var c=this,d=!1,e=function(){d=!0},f=Promise.resolve(b(a,e));return d?Promise.resolve(a):f.then(function(){return c.save(a,{},!0).catch(function(d){if(412==d.status)return c.refresh(a,{}).then(function(){return c._optimisticSave(a,b)});throw d})})},c.prototype._locklessSave=function(a,b,c){var d=this;this.attach(a);var e,f,g=l.get(a);if(g.isAvailable&&(f=g.getJson(!1,!0)),g.isDirty){b.refresh||g.setPersistent();var h=this.send(c(g,f)).then(function(c){return b.refresh?g.setJson(c.entity,!0):g.setJsonMetadata(c.entity),a},function(b){if(b.status==o.OBJECT_NOT_FOUND)return d.removeReference(a),g.setRemoved(),null;throw g.setDirty(),b});e=[h]}else e=[Promise.resolve(a)];var i=Object.assign({},b);return i.depth=0,this.getSubEntities(a,b.depth).forEach(function(a){e.push(d._save(a,i,c))}),Promise.all(e).then(function(){return a})},c.prototype._save=function(a,b,c){var d=this;this.ensureBloomFilterFreshness();var e=l.get(a);return e.version&&this.addToBlackList(a.id),e.withLock(function(){return d._locklessSave(a,b,c)})},c.prototype.getSubEntities=function(a,b,c,d){var e=this;if(c=c||[],!b)return c;d=d||a;for(var f=l.get(a),g=f.type.references(),h=Array.isArray(g),i=0,g=h?g:g[Symbol.iterator]();;){var j;if(h){if(i>=g.length)break;j=g[i++]}else{if(i=g.next(),i.done)break;j=i.value}var k=j;this.getSubEntitiesByPath(a,k.path).forEach(function(a){~c.indexOf(a)||a==d||(c.push(a),c=e.getSubEntities(a,b===!0?b:b-1,c,d))})}return c},c.prototype.getSubEntitiesByPath=function(a,b){var c=this,d=[a];return b.forEach(function(a){var b=[];d.forEach(function(d){var e=d[a];if(e){var f=c.metamodel.managedType(d.constructor).getAttribute(a);if(f.isCollection)for(var g=e.entries(),h=Array.isArray(g),i=0,g=h?g:g[Symbol.iterator]();;){var j;if(h){if(i>=g.length)break;j=g[i++]}else{if(i=g.next(),i.done)break;j=i.value}var k=j;b.push(k[1]),f.keyType&&f.keyType.isEntity&&b.push(k[0])}else b.push(e)}}),d=b}),d},c.prototype.delete=function(a,b){var c=this;b=b||{},this.attach(a);var d=l.get(a);return d.withLock(function(){if(!d.version&&!b.force)throw new f.IllegalEntityError(a);var g=new e.DeleteObject(d.bucket,d.key);c.addToBlackList(a.id),b.force||g.ifMatch(d.version);var h=[c.send(g).then(function(){return c.removeReference(a),d.setRemoved(),a})],i=Object.assign({},b);return i.depth=0,c.getSubEntities(a,b.depth).forEach(function(a){h.push(c.delete(a,i))}),Promise.all(h).then(function(){return a})})},c.prototype.flush=function(a,b){},c.prototype.persist=function(a){this.attach(a)},c.prototype.refresh=function(a,b){return b=b||{},b.refresh=!0,this.load(a.id,null,b)},c.prototype.attach=function(a){if(!this.contains(a)){var b=this.metamodel.entity(a.constructor);if(!b)throw new f.IllegalEntityError(a);if(this.containsById(a))throw new f.EntityExistsError(a);this._attach(a)}},c.prototype._attach=function(a){var b=l.get(a);if(b.isAttached){if(b.db!=this)throw new f.EntityExistsError(a)}else b.db=this;b.id||"User"!=b.type.name&&"Role"!=b.type.name&&"logs.AppLog"!=b.type.name&&(b.id="/db/"+b.type.name+"/"+h.uuid()),b.id&&(this._entities[b.id]=a)},c.prototype.removeReference=function(a){var b=l.get(a);if(!b)throw new f.IllegalEntityError(a);delete this._entities[b.id]},c.prototype.register=function(a,b,c){var d=this,g=c>j.LoginOption.NO_LOGIN;if(this.me&&g)throw new f.PersistentError("User is already logged in.");return this.withLock(function(){var f=new e.Register({user:a,password:b,login:g});return d._userRequest(f,c)})},c.prototype.login=function(a,b,c){var d=this;if(this.me)throw new f.PersistentError("User is already logged in.");return this.withLock(function(){var f=new e.Login({username:a,password:b});return d._userRequest(f,c)})},c.prototype.logout=function(){var a=this;return this.withLock(function(){return a.send(new e.Logout).then(a._logout.bind(a))})},c.prototype.loginWithOAuth=function(a,b,c){if(this.me)throw new f.PersistentError("User is already logged in.");c=Object.assign({title:"Login with "+a,timeout:3e5,state:{},loginOption:!0},c);var d;if(!m[a+"OAuth"])throw new Error("OAuth provider "+a+" not supported.");d=new m[a+"OAuth"](b,c.scope,JSON.stringify(c.state));var e=this._userRequest(d,c.loginOption);open(d.request.path,c.title,"width="+c.width+",height="+c.height);return new Promise(function(a,b){var d=setTimeout(function(){b(new f.PersistentError("OAuth login timeout."))},c.timeout);e.then(a,b).then(function(){clearTimeout(d)})})},c.prototype.renew=function(){var a=this;return this.withLock(function(){var b=new e.Me;return a._userRequest(b,!0)})},c.prototype.newPassword=function(a,b,c){var d=this;return this.withLock(function(){var f=new e.NewPassword({username:a,password:b,newPassword:c});return d.send(f).then(function(a){return d._updateUser(a.entity)})})},c.prototype._updateUser=function(a,b){var c=this.getReference(a.id),d=l.get(c);return d.setJson(a,!0),b&&(this.me=c),c},c.prototype._logout=function(){this.me=null,this.token=null},c.prototype._userRequest=function(a,b){var c=this,d=b>j.LoginOption.NO_LOGIN;return d&&(this.tokenStorage.temporary=bc&&this._bloomFilterLock.withLock(function(){return a.refreshBloomFilter()})}},c.prototype.mustRevalidate=function(a){if(h.isNode)return!1;this.ensureBloomFilterFreshness();var b=this.isCachingDisabled||!this._bloomFilterLock.isReady;return b=b||!this.cacheWhiteList.has(a)&&(this.cacheBlackList.has(a)||this.bloomFilter.contains(a))},c.prototype.ensureCacheHeader=function(a,b,c){c=c||this.mustRevalidate(a),c&&b.noCache()},c.prototype.createURL=function(a,b){var c=this._connector.basePath+a,d=!1;return b&&this.me?(c=this.tokenStorage.signPath(c),d=!0):c=c.split("/").map(encodeURIComponent).join("/"),this.mustRevalidate(a)&&(c=c+(d?"&":"?")+"BCB"),this._connector.origin+c},c}(h.Lockable);p.prototype.List=Array,p.prototype.Set=Set,p.prototype.Map=Map,p.prototype.GeoPoint=a(5),c.exports=p},{19:19,20:20,21:21,25:25,34:34,36:36,4:4,5:5,59:59,63:63,70:70}],3:[function(a,c,d){"use strict";var e=a(36),f=a(52),g=a(70),h=(a(22),a(23)),i=a(2),j=function(a){function c(d){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this));d=Object(d)instanceof String?{host:d}:d||{},f._connector=null,f.metamodel=f.createMetamodel(),f.code=new g.Code(f.metamodel,f),f.tokenStorageFactory=g.TokenStorage.WEB_STORAGE||g.TokenStorage.GLOBAL,f.configure(d);var h=!0,i=new Promise(function(a){f._connected=a});return d.host?f.connect(d.host,d.port,d.secure,d.basePath):h=!1,f.tokenStorage||(h=!1,i=i.then(function(){return f.tokenStorageFactory.create(f._connector.origin)}).then(function(a){f.tokenStorage=a})),d.schema?(f._connectData=d,f.metamodel.init(d.schema)):(h=!1,i=i.then(function(){var a=new e.Connect;return a.withCredentials=!0,0===f.staleness&&a.noCache(),f.send(a)}).then(function(a){f._connectData=a.entity,void 0===f.staleness&&(f.staleness=f._connectData.bloomFilterRefresh||60),f.metamodel.isInitialized||f.metamodel.init(f._connectData.schema),f.tokenStorage.update(f._connectData.token)})),h||f.withLock(function(){return i},!0),f}return b.inherits(c,a),c.prototype._connected=function(){},c.prototype.configure=function(a){if(this._connector)throw new Error("The EntityManagerFactory can only be configured before is is connected.");a.tokenStorage&&(this.tokenStorage=a.tokenStorage),a.tokenStorageFactory&&(this.tokenStorageFactory=a.tokenStorageFactory),void 0!==a.staleness&&(this.staleness=a.staleness)},c.prototype.connect=function(a,b,c,d){if(this._connector)throw new Error("The EntityManagerFactory is already connected.");return Object(b)instanceof Boolean&&(c=b,b=0),this._connector=h.create(a,b,c,d),this._connected(),this.ready()},c.prototype.createMetamodel=function(){return new f.Metamodel(this)},c.prototype.createEntityManager=function(a){var b=this,c=new i(this);return this.isReady?c.connected(this._connector,this._connectData,a?this.tokenStorage:new g.TokenStorage(this._connector.origin)):c.withLock(function(){return b.ready().then(function(){c.connected(b._connector,b._connectData,a?b.tokenStorage:new g.TokenStorage(b._connector.origin))})},!0),c},c.prototype.send=function(a){return a.tokenStorage||(a.tokenStorage=this.tokenStorage),this._connector.send(a)},c}(g.Lockable);c.exports=j},{2:2,22:22,23:23,36:36,52:52,70:70}],4:[function(a,c,d){"use strict";var e=a(36),f=a(34),g=function(){function a(c){b.classCallCheck(this,a),this._connector=c.connector,this.entityManager=c,this.tid=null,this.rollbackOnly=!1,this.readSet=null,this.changeSet=null}return b.createClass(a,[{key:"isActive",get:function(){return Boolean(this.tid)}}]),a.prototype.begin=function(a,b){return this.yield().then(function(){var a=this.send(new e.PostTransaction).done(function(a){this.tid=a.tid,this.rollbackOnly=!1,this.readSet={},this.changeSet={}});return this.wait(a)}).then(a,b)},a.prototype.commit=function(a,b){return this.yield().then(function(){return this.getRollbackOnly()?this.rollback().then(function(){throw new f.RollbackError}):this.wait(this.entityManager.flush()).then(function(){var a=[];for(var b in this.readSet)a.push({oid:b,version:this.readSet[b]});var c=this.send(new e.PutTransactionCommitted(this.tid,a));return this.wait(c).then(function(a){this.tid=null,this.readSet=null,this.changeSet=null;var b=a.oids;for(var c in b){var d=b[c],e=this.entityManager.entities[c];if(e){var f=util.Metadata.get(e);"DELETED"==d||f.isDeleted?this.entityManager.removeReference(e):f.setJsonValue(f.type.version,d)}}})})}).then(a,b)},a.prototype.getRollbackOnly=function(){return this.rollbackOnly},a.prototype.rollback=function(a,b){return this.yield().then(function(){var a=this.send(new e.PutTransactionAborted(this.tid));this.wait(a).then(function(){return this.tid=null,this.readSet=null,this.changeSet=null,this.entityManager.clear()},function(){return this.entityManager.clear()})}).then(a,b)},a.prototype.setRollbackOnly=function(a,b){return this.yield().done(function(){this.rollbackOnly=!0})},a.prototype.isRead=function(a){return this.isActive&&a in this.readSet},a.prototype.setRead=function(a,b){this.isActive&&!this.isChanged(a)&&(this.readSet[a]=b)},a.prototype.isChanged=function(a){return this.isActive&&a in this.changeSet},a.prototype.setChanged=function(a){this.isActive&&(delete this.readSet[a],this.changeSet[a]=!0)},a}();c.exports=g},{34:34,36:36}],5:[function(a,c,d){"use strict";var e=function(){function a(c,d){b.classCallCheck(this,a);var e=void 0,f=void 0;if(Object(c)instanceof String){var g=c.indexOf(";");e=c.substring(0,g),f=c.substring(g+1)}else Object(c)instanceof Number?(e=c,f=d):Object(c)instanceof Array?(e=c[0],f=c[1]):c instanceof Object?(e=c.latitude,f=c.longitude):(e=0,f=0);if(this.longitude=f,this.latitude=e,this.latitude<-90||this.latitude>90)throw new Error("Latitude "+this.latitude+" is not in bound of -90 <= latitude <= 90");if(this.longitude<-180||this.longitude>180)throw new Error("Longitude "+this.longitude+" is not in bound of -180 <= longitude <= 180")}return a.current=function(){return new Promise(function(b,c){navigator.geolocation.getCurrentPosition(function(c){b(new a(c.coords.latitude,c.coords.longitude))},function(a){c(a)})})},a.prototype.kilometersTo=function(b){return Number((a.EARTH_RADIUS_IN_KILOMETERS*this.radiansTo(b)).toFixed(3))},a.prototype.milesTo=function(b){return Number((a.EARTH_RADIUS_IN_MILES*this.radiansTo(b)).toFixed(3))},a.prototype.radiansTo=function(b){var c=this,d=b,e=c.latitude*a.DEG_TO_RAD,f=d.latitude*a.DEG_TO_RAD,g=(d.longitude-c.longitude)*a.DEG_TO_RAD;return Math.acos(Math.sin(e)*Math.sin(f)+Math.cos(e)*Math.cos(f)*Math.cos(g))},a.prototype.toString=function(){return this.latitude+";"+this.longitude},a.prototype.toJSON=function(){return{latitude:this.latitude,longitude:this.longitude}},a}();e.DEG_TO_RAD=Math.PI/180,e.EARTH_RADIUS_IN_KILOMETERS=6371,e.EARTH_RADIUS_IN_MILES=3956,c.exports=e},{}],6:[function(a,b,c){"use strict";var d=a(3),e=a(2);e.prototype.binding=a(20),e.prototype.connector=a(28),e.prototype.error=a(34),e.prototype.message=a(36),e.prototype.metamodel=a(52),e.prototype.util=a(70),e.prototype.caching=a(22),e.prototype.query=a(59),e.prototype.EntityManager=a(2),e.prototype.EntityManagerFactory=a(3),e.prototype.EntityTransaction=a(4),e.prototype.Acl=a(1);var f=new d,g=f.createEntityManager(!0);g.configure=function(a){return f.configure(a),this},g.connect=function(a,b,c,d){return b instanceof Function&&(d=c,c=b,b=void 0),f.connect(a,b),this.ready(c,d)},c=b.exports=g,c.db=g,c.default=g},{1:1,2:2,20:20,22:22,28:28,3:3,34:34,36:36,4:4,52:52,59:59,70:70}],7:[function(a,c,d){"use strict";var e=function(){function a(){b.classCallCheck(this,a)}return a.prototype.getValue=function(a,b){return a[b.name]},a.prototype.setValue=function(a,b,c){a[b.name]=c},a}();c.exports=e},{}],8:[function(a,b,c){"use strict";var d=a(11),e=d.extend({get isRegistered(){return this._db.isDeviceRegistered},register:function(a,b,c,d,e){return c instanceof Function&&(e=d,d=c,c=null),this._db.registerDevice(a,b,c).then(d,e)},push:function(a,b,c){return this._db.pushDevice(a).then(b,c)}});e.PushMessage=a(66),b.exports=e},{11:11,66:66}],9:[function(a,c,d){"use strict";var e=(a(63),a(61),function(){function a(){b.classCallCheck(this,a)}return a.prototype.createProxy=function(a){return function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c}(a)},a.prototype.getIdentifier=function(a){return a.__d__},a.prototype.setIdentifier=function(a,b){Object.defineProperty(a,"__d__",{value:b})},a.prototype.enhance=function(a,b){if(b.__ype__!=a){if(b.hasOwnProperty("__ype__"))throw new Error("Type is already used by a different manager");Object.defineProperty(b,"__ype__",{value:a}),this.setIdentifier(b,a.ref),this.enhancePrototype(b.prototype,a)}},a.prototype.enhancePrototype=function(a,b){if(a.toString===Object.prototype.toString&&Object.defineProperty(a,"toString",{value:function(){return this._metadata.id||this._metadata.bucket},enumerable:!1}),b.superType&&"Object"==b.superType.name)for(var c=b.superType.declaredAttributes,d=Array.isArray(c),e=0,c=d?c:c[Symbol.iterator]();;){var f;if(d){if(e>=c.length)break;f=c[e++]}else{if(e=c.next(),e.done)break;f=e.value}var g=f;g.isMetadata||this.enhanceProperty(a,g)}for(var h=b.declaredAttributes,i=Array.isArray(h),j=0,h=i?h:h[Symbol.iterator]();;){var k;if(i){if(j>=h.length)break;k=h[j++]}else{if(j=h.next(),j.done)break;k=j.value}var l=k;this.enhanceProperty(a,l)}},a.prototype.enhanceProperty=function(a,b){var c="$"+b.name;Object.defineProperty(a,b.name,{get:function(){var a=this._metadata;return a.readAccess(),a[c]},set:function(a){var b=this._metadata;b.writeAccess(),b[c]=a},configurable:!0,enumerable:!0})},a}());c.exports=e},{61:61,63:63}],10:[function(a,c,d){"use strict";var e=a(15),f=function(a){function c(d){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.call(this,d))}return b.inherits(c,a),c}(e);Object.defineProperties(f.prototype,{id:{get:function(){return this._metadata.id},set:function(a){if(this._metadata.id)throw new Error("The id can't be set twice: "+a);a+="",0==a.indexOf("/db/"+this._metadata.bucket+"/")?this._metadata.id=a:this.key=a},enumerable:!0},key:{get:function(){return this._metadata.key},set:function(a){this._metadata.key=a}},version:{get:function(){return this._metadata.version},enumerable:!0},acl:{get:function(){return this._metadata.acl},enumerable:!0},ready:{value:function(a){return this._metadata.ready(a)}},attach:{value:function(a){a.attach(this)}},save:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),this._metadata.db.save(this,a).then(b,c)}},insert:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),this._metadata.db.insert(this,a).then(b,c)}},update:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),this._metadata.db.update(this,a).then(b,c)}},load:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),a=a||{},a.local=!0,this._metadata.db.load(this.id,null,a).then(b,c)}},delete:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),this._metadata.db.delete(this,a).then(b,c)}},optimisticSave:{value:function(a,b,c){return this._metadata.db.optimisticSave(this,a).then(b,c)}},attr:{value:function(){throw new Error("Attr is not yet implemented.")}},validate:{value:function(){return this._metadata.db.validate(this)}},toJSON:{value:function(a){return this._metadata.getJson(a)}}}),c.exports=f},{15:15}],11:[function(a,b,c){"use strict";var d=a(16),e=d.extend({load:function(a,b,c,d){return b instanceof Function&&(d=c,c=b,b={}),this._db.load(this._managedType.typeConstructor,a,b).then(c,d)},fromJSON:function(a){var b=a.id?this._db.getReference(this._managedType.typeConstructor,a.id):this.newInstance(),c=b._metadata;return c.setJson(a),b},find:function(){return this._db.createQueryBuilder(this._managedType.typeConstructor)},partialUpdate:function(){throw new Error("partialUpdate is not yet implemented.")}});b.exports=e},{16:16}],12:[function(a,b,c){"use strict";function d(a){for(var b,c=1;b=arguments[c];++c)for(var d=Object.getOwnPropertyNames(b),e=Array.isArray(d),f=0,d=e?d:d[Symbol.iterator]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(b,h))}return a}var e=d({extend:function(a){return d({},this,a)},create:function(a){var b=function(a){return b.newInstance(arguments)};return d(b,this),b.prototype=a.prototype,b._type=a,b},new:function(){return this.newInstance(arguments)},newInstance:function(a){var b;return b=a&&0!=a.length?new this._type(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]):new this._type}});b.exports=e},{}],13:[function(a,c,d){"use strict";var e=a(34),f=a(1),g=a(71),h=a(36),i=a(25).StatusCode,j="/file",k=j.length,l=function(){function a(c){if(b.classCallCheck(this,a),c=c||{},this._available=!1,Object(c)instanceof String){var d=c,e=d.indexOf("/","/file/".length);if(e==-1||0!=d.indexOf("/file/"))throw new Error("Invalid file reference "+d);this._id=d}else if(c.id)this._id=c.id,this._setMetadata(c);else{var f=void 0;if(c.path)f=c.path;else{var h=c.parent||"/www";if("/"!=h.charAt(h.length-1)&&(h+="/"),h.length<3)throw new Error("Invalid parent name: "+h);var i=c.name||c.data&&c.data.name||g.uuid();f=h+i}if("/"!=f.charAt(0)&&(f="/"+f),f.indexOf("//")!=-1||f.length<3)throw new Error("Invalid path: "+f);this._id=j+f,this._setMetadata(c)}this.isFolder="/"==this._id.charAt(this._id.length-1)}return b.createClass(a,[{key:"id",get:function(){return this._id}},{key:"url",get:function(){if(this.isFolder)throw new Error("Url can not be created for folders.");return this._url||(this._url=this._db.createURL(this.id,"www"!=this.bucket)),this._url}},{key:"name",get:function(){return this._name||(this._name=this._id.substring(this._id.lastIndexOf("/",this._id.length-2)+1)),this._name}},{key:"mimeType",get:function(){if(this.isFolder)throw new Error("A folder has no mimeType");return this._checkAvailable(),this._mimeType}},{key:"acl",get:function(){return this._checkAvailable(),this._acl}},{key:"lastModified",get:function(){if(this.isFolder)throw new Error("A folder has no lastModified");return this._checkAvailable(),this._lastModified}},{key:"eTag",get:function(){if(this.isFolder)throw new Error("A folder has no eTag");return this._checkAvailable(),this._eTag}},{key:"size",get:function(){if(this.isFolder)throw new Error("A folder has no size");return this._checkAvailable(),this._size}},{key:"bucket",get:function(){return this.id.substring(k+1,this.id.indexOf("/",k+1))}},{key:"key",get:function(){return this.id.substring(this.id.indexOf("/",k+1)+1)}},{key:"path",get:function(){return this.id.substring(k)}},{key:"parent",get:function(){return this.id.substring(k,this.id.lastIndexOf("/",this.id.length-2))}},{key:"isMetadataLoaded",get:function(){return this._available}}]),a.prototype.upload=function(a,b,c){var d=this;if(a=a||{},this.isFolder)throw new Error("A folder cannot be uploaded");this._setMetadata(a);var e=new h.UploadFile(this.bucket,this.key).entity(this._data,this._type).acl(this._acl);return e.progress(a.progress),this._size&&e.contentLength(this._size),this._mimeType&&e.mimeType(this._mimeType),this._conditional(e,a),this._db.addToBlackList(this.id),this._db.send(e).then(function(a){return d._data=null,d._type=null,d.fromJSON(a.entity),d}).then(b,c)},a.prototype.download=function(a,b,c){var d=this;if(a=a||{},this.isFolder)throw new Error("A folder cannot be downloaded");var e=a.type||"blob",f=new h.DownloadFile(this.bucket,this.key).responseType(e);return this._db.ensureCacheHeader(this.id,f,a.refresh),this._db.send(f).then(function(a){return d._db.addToWhiteList(d.id),d._fromHeaders(a.headers),a.entity},function(a){if(a.status==i.OBJECT_NOT_FOUND)return null;throw a}).then(b,c)},a.prototype.delete=function(a,b,c){if(a=a||{},this.isFolder)throw new Error("A folder cannot be deleted");var d=new h.DeleteFile(this.bucket,this.key);return this._conditional(d,a),this._db.addToBlackList(this.id),this._db.send(d).then(function(){return this}).then(b,c)},a.prototype._conditional=function(a,b){b.force||(this._lastModified&&a.ifUnmodifiedSince(this._lastModified),this._eTag&&a.ifMatch(this._eTag),this._lastModified||this._eTag||a.ifNoneMatch("*"))},a.prototype.loadMetadata=function(a,b,c){var d=this;if(a=a||{},this.isFolder)throw new Error("A folder has no matadata");var e=new h.GetFileMetadata(this.bucket,this.key);return this._db.ensureCacheHeader(this.id,e,a.refresh),this._db.send(e).then(function(a){return d._fromHeaders(a.headers),d},function(a){if(a.status==i.OBJECT_NOT_FOUND)return null;throw a}).then(b,c)},a.prototype.saveMetadata=function(a,b,c){var d=this;a=a||{};var e=this.toJSON();e.id=this._id;var f=new h.UpdateFileMetadata(this.bucket,this.key).entity(e); +return this._conditional(f,a),this._db.send(f).then(function(a){return d.fromJSON(a),d})},a.prototype._setMetadata=function(a){var b=a.data,c=a.type,d=a.eTag,e=a.acl,g=a.size,h=a.mimeType,i=a.lastModified;if(b){if("undefined"!=typeof Blob&&b instanceof Blob)h=h||b.type;else if("data-url"==c){var j=b.match(/^data:(.+?)(;base64)?,.*$/);h=h||j[1]}this._data=b,this._type=c,this._size=g,this._mimeType=h,this._acl=e||this._acl||new f,this._available=!0}else this._available=!1;this._eTag=d||this._eTag,i&&(this._lastModified=new Date(i))},a.prototype._fromHeaders=function(a){this.fromJSON({eTag:a.etag?a.etag.substring(1,a.etag.length-1):null,lastModified:a["last-modified"],mimeType:a["content-type"],acl:a["baqend-acl"]&&JSON.parse(a["baqend-acl"]),contentLength:+a["baqend-size"]})},a.prototype.fromJSON=function(a){a.mimeType&&(this._mimeType=a.mimeType),a.lastModified&&(this._lastModified=new Date(a.lastModified)),a.eTag&&(this._eTag=a.eTag),this._acl=this._acl||new f,a.acl&&this._acl.fromJSON(a.acl),a.contentLength&&(this._size=a.contentLength),this._available=!0},a.prototype.toJSON=function(){var a={mimeType:this._mimeType,eTag:this._eTag,acl:this._acl,contentLength:this._size};return this._lastModified&&(a.lastModified=this._lastModified.toISOString()),a},a.prototype._checkAvailable=function(){if(!this._available)throw new e.PersistentError("The file metadata of "+this.id+" is not available.")},a}();c.exports=l},{1:1,25:25,34:34,36:36,71:71}],14:[function(a,b,c){"use strict";var d=a(12),e=a(13),f=a(36),g=a(65),h=d.extend({create:function(a){var b=d.create.call(this,e);return b._db=a,b},newInstance:function(a){var b=d.newInstance.call(this,a);return b._db=this._db,b},saveMetadata:function(a,b,c,d){var e=new f.SetFileBucketMetadata(a,b);return this._db.send(e).then(c,d)},loadMetadata:function(a,b,c,d){b=b||{};var e=new f.GetFileBucketMetadata(a);return this._db.send(e).then(function(a){var b={};return g.BASE_PERMISSIONS.forEach(function(c){b[c]=g.fromJSON(a.entity[c]||{})}),b},function(a){if(a.status==StatusCode.OBJECT_NOT_FOUND)return null;throw a}).then(c,d)},listBuckets:function(a,b){var c=this;return this._db.send(new f.ListBuckets).then(function(a){return a.entity.map(function(a){return c.new(a+"/")})}).then(a,b)},listFiles:function(a,b,c,d,e){var g=this;Object(a)instanceof String&&("/"!=a.charAt(a.length-1)&&(a+="/"),a=this.new({path:a}));var h=a.key,i=a.bucket;return b=b?b.key:null,this._db.send(new f.ListFiles(i,h,b,c)).then(function(a){return a.entity.map(function(a){return g.new(a)})}).then(d,e)}});b.exports=h},{12:12,13:13,36:36,65:65}],15:[function(a,c,d){"use strict";var e=a(63),f=function(){function a(c){b.classCallCheck(this,a),a.init(this,c)}return a.init=function(a,b){var c=a.constructor.__ype__;c&&Object.defineProperty(a,"_metadata",{value:e.create(c,a),configurable:!0}),b&&Object.assign(a,b)},a.extend=function(b){return b.prototype=Object.create(this.prototype,{constructor:{value:b,configurable:!0,writable:!0}}),b.extend=a.extend,b},a}();Object.defineProperties(f.prototype,{toJSON:{value:function(){return this._metadata.type.toJsonValue(this._metadata,this)}}}),c.exports=f},{63:63}],16:[function(a,b,c){"use strict";var d=a(12),e=(a(15),d.extend({create:function(a,b){var c=d.create.call(this,a.typeConstructor);return c.methods=c.prototype,c._managedType=a,c._db=b,c},newInstance:function(a){var b=a?d.newInstance.call(this,a):this._managedType.create(a);return b._metadata.db=this._db,b},fromJSON:function(a){var b=this.newInstance(),c=b._metadata;return this._managedType.fromJsonValue(c,a,b),b},addMethods:function(a){Object.assign(this.methods,a)},addMethod:function(a,b){this.methods[a]=b}}));b.exports=e},{12:12,15:15}],17:[function(a,c,d){"use strict";var e=a(10),f=a(18),g=function(a){function c(d){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.call(this,d))}return b.inherits(c,a),c}(e);Object.defineProperties(g.prototype,{hasUser:{value:function(a){return this.users&&this.users.has(a)}},addUser:{value:function(a){if(!(a instanceof f))throw new Error("Only user instances can be added to a role.");this.users||(this.users=new Set),this.users.add(a)}},removeUser:{value:function(a){if(!(a instanceof f))throw new Error("Only user instances can be removed from a role.");this.users&&this.users.delete(a)}}}),c.exports=g},{10:10,18:18}],18:[function(a,c,d){"use strict";var e=a(10),f=function(a){function c(d){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.call(this,d))}return b.inherits(c,a),c}(e);Object.defineProperties(f.prototype,{newPassword:{value:function(a,b,c,d){return this._metadata.db.newPassword(this.username,a,b).then(c,d)}}}),c.exports=f},{10:10}],19:[function(a,b,c){"use strict";var d=a(11),e=d.extend({get me(){return this._db.me},register:function(a,b,c,d,e){return c instanceof Function&&(e=d,d=c,c=!0),a=Object(a)instanceof String?this.fromJSON({username:a}):a,this._db.register(a,b,void 0===c||c).then(d,e)},login:function(a,b,c,d,e){return c instanceof Function&&(e=d,d=c,c=!0),this._db.login(a,b,void 0===c||c).then(d,e)},logout:function(a,b){return this._db.logout().then(a,b)},newPassword:function(a,b,c,d,e){return this._db.newPassword(a,b,c).then(d,e)}});e.LoginOption={NO_LOGIN:-1,SESSION_LOGIN:0,PERSIST_LOGIN:1},e.DefaultOptions={google:{width:585,height:545,scope:"email"},facebook:{width:1140,height:640,scope:"email"},github:{width:1040,height:580,scope:"user:email"},twitter:{width:740,height:730},linkedin:{width:630,height:530,scope:""}},["Google","Facebook","GitHub","Twitter","LinkedIn"].forEach(function(a){e["loginWith"+a]=function(b,c,d,f){return c instanceof Function&&(f=d,d=c,c={}),c=Object.assign({},e.DefaultOptions[a.toLowerCase()],c||{}),this._db.loginWithOAuth(a,b,c).then(d,f)}}),b.exports=e},{11:11}],20:[function(a,b,c){"use strict";c.Accessor=a(7),c.Enhancer=a(9),c.Factory=a(12),c.ManagedFactory=a(16),c.EntityFactory=a(11),c.UserFactory=a(19),c.DeviceFactory=a(8),c.FileFactory=a(14),c.Managed=a(15),c.Entity=a(10),c.Role=a(17),c.User=a(18),c.File=a(13)},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,7:7,8:8,9:9}],21:[function(a,c,d){"use strict";var e=a(70).atob,f=function(){function a(c){b.classCallCheck(this,a),this.bytes=e(c.b),this.bits=c.m,this.hashes=c.h,this.creation=(new Date).getTime()}return a.prototype.contains=function(b){for(var c=a._getHashes(b,this.bits,this.hashes),d=Array.isArray(c),e=0,c=d?c:c[Symbol.iterator]();;){var f;if(d){if(e>=c.length)break;f=c[e++]}else{if(e=c.next(),e.done)break;f=e.value}var g=f;if(!this._isSet(g))return!1}return!0},a.prototype._isSet=function(a){var b=Math.floor(a/8),c=1<>>16)*g&65535)<<16)&4294967295,i=i<<15|i>>>17,i=(65535&i)*h+(((i>>>16)*h&65535)<<16)&4294967295,e^=i,e=e<<13|e>>>19,f=5*(65535&e)+((5*(e>>>16)&65535)<<16)&4294967295,e=(65535&f)+27492+(((f>>>16)+58964&65535)<<16);switch(i=0,c){case 3:i^=(255&b.charCodeAt(j+2))<<16;case 2:i^=(255&b.charCodeAt(j+1))<<8;case 1:i^=255&b.charCodeAt(j),i=(65535&i)*g+(((i>>>16)*g&65535)<<16)&4294967295,i=i<<15|i>>>17,i=(65535&i)*h+(((i>>>16)*h&65535)<<16)&4294967295,e^=i}return e^=b.length,e^=e>>>16,e=2246822507*(65535&e)+((2246822507*(e>>>16)&65535)<<16)&4294967295,e^=e>>>13,e=3266489909*(65535&e)+((3266489909*(e>>>16)&65535)<<16)&4294967295,e^=e>>>16,e>>>0},a}();c.exports=f},{70:70}],22:[function(a,b,c){"use strict";c.BloomFilter=a(21)},{21:21}],23:[function(a,c,d){"use strict";var e=a(32),f=(a(36),function(){function a(c,d,e,f){b.classCallCheck(this,a),this.host=c,this.port=d,this.secure=e,this.basePath=f,this.origin=a.toUri(c,d,e,"")}return a.create=function(b,c,d,e){if("undefined"!=typeof window&&(b||(b=window.location.hostname,c=Number(window.location.port)),void 0===d&&(d="https:"==window.location.protocol)),d=!!d,void 0===e&&(e=a.DEFAULT_BASE_PATH),b.indexOf("/")!=-1){var f=/^(https?):\/\/([^\/:]+|\[[^\]]+])(:(\d*))?(\/\w+)?\/?$/.exec(b);if(!f)throw new Error("The connection uri host "+b+" seems not to be valid");d="https"==f[1],b=f[2].replace(/(\[|])/g,""),c=f[4],e=f[5]||""}else"localhost"!=b&&/^[a-z0-9-]*$/.test(b)&&(b+=d?a.SSL_DOMAIN:a.HTTP_DOMAIN);c||(c=d?443:80);var g=a.toUri(b,c,d,e),h=this.connections[g];if(!h){for(var i in this.connectors){var j=this.connectors[i];if(j.isUsable&&j.isUsable(b,c,d,e)){h=new j(b,c,d,e);break}}if(!h)throw new Error("No connector is usable for the requested connection.");this.connections[g]=h}return h},a.toUri=function(a,b,c,d){var e=(c?"https://":"http://")+(a.indexOf(":")!=-1?"["+a+"]":a);return e+=c&&443!=b||!c&&80!=b?":"+b:"",e+=d},a.prototype.send=function(a){var b=this;"OAUTH"==a.request.method&&a.addRedirectOrigin(this.origin+this.basePath);var c={status:0};return new Promise(function(c){b.prepareRequest(a),b.doSend(a,a.request,c)}).then(function(a){return c=a}).then(function(){return b.prepareResponse(a,c)}).then(function(){return a.doReceive(c),c}).catch(function(a){throw c.entity=null,e.of(a)})},a.prototype.doSend=function(a,b,c){},a.prototype.prepareRequest=function(a){var b=a.mimeType();if(!b){var c=a.request.type;"json"==c?a.mimeType("application/json;charset=utf-8"):"text"==c&&a.mimeType("text/plain;charset=utf-8")}this.toFormat(a);var d=void 0;switch(a.responseType()){case"json":d="application/json";break;case"text":d="text/*";break;default:d="application/json,text/*;q=0.5,*/*;q=0.1"}if(a.accept()||a.accept(d),this.gzip){var e=a.ifNoneMatch();e&&'""'!==e&&"*"!=e&&a.ifNoneMatch(e.slice(0,-1)+'--gzip"')}if("/connect"==a.request.path)a.request.path=a.tokenStorage.signPath(this.basePath+a.request.path).substring(this.basePath.length),a.cacheControl()&&(a.request.path+=(a.tokenStorage.token?"&":"?")+"BCB");else if(a.tokenStorage){var f=a.tokenStorage.token;f&&a.header("authorization","BAT "+f)}},a.prototype.toFormat=function(a){},a.prototype.prepareResponse=function(a,b){var c=this;b.status=1223==b.status?204:b.status;var d=void 0,e=b.headers||{},f=b.entity;if(f&&(d=a.responseType(),!d||b.status>=400)){var g=e["content-type"]||e["Content-Type"];g&&g.indexOf("application/json")>-1&&(d="json")}if(e.etag&&(e.etag=e.etag.replace("--gzip","")),a.tokenStorage){var h=e["baqend-authorization-token"]||e["Baqend-Authorization-Token"];h&&a.tokenStorage.update(h)}return new Promise(function(a){a(f&&c.fromFormat(b,f,d))}).then(function(d){b.entity=d,a.request.path.indexOf("/connect")!=-1&&d&&(c.gzip=!!d.gzip)},function(a){throw new Error("Response was not valid "+d+": "+a.message)})},a.prototype.fromFormat=function(a,b,c){},a}());Object.assign(f,{DEFAULT_BASE_PATH:"/v1",HTTP_DOMAIN:".app.baqend.com",SSL_DOMAIN:"-bq.global.ssl.fastly.net",RESPONSE_HEADERS:["baqend-authorization-token","content-type","baqend-size","baqend-acl","etag","last-modified"],connectors:[],connections:{},gzip:!1}),c.exports=f},{32:32,36:36}],24:[function(a,c,d){"use strict";var e=a(23),f=a(27),g=function(a){function c(d,e,f,g){b.classCallCheck(this,c);var h=b.possibleConstructorReturn(this,a.call(this,d,e,f,g));return h.mid=0,h.messages={},h.doReceive=h.doReceive.bind(h),addEventListener("message",h.doReceive,!1),h}return b.inherits(c,a),c.isUsable=function(a,b,c){return"undefined"!=typeof window},c.prototype.load=function(a){this.iframe=document.createElement("iframe"),this.iframe.src=this.origin+this.basePath+a,this.iframe.setAttribute("style",c.style),document.body.appendChild(this.iframe),this.queue=[],this.iframe.addEventListener("load",this.onLoad.bind(this),!1)},c.prototype.onLoad=function(){for(var a=this.queue,b=0;b=400&&(g="json"),"stream"==g)return void c({status:e,headers:a.headers,entity:a});var f=g&&"text"!=g&&"json"!=g,h=[];f||a.setEncoding("utf-8"),a.on("data",function(a){h.push(a)}),a.on("end",function(){c({status:e,headers:a.headers,entity:f?Buffer.concat(h):h.join("")})})});h.on("error",function(a){c({status:0,error:a})}),"stream"==f?e.pipe(h):"buffer"==f?h.end(e):f?h.end(e,"utf8"):h.end()},d.prototype.parseCookie=function(a){for(var b,c=a.split(";"),d=0;b=c[d];++d)if(0==b.indexOf("Expires=")){var e=Date.parse(b.substring(8));if(e=400&&(g.responseType="text"),4==g.readyState){var a={headers:{},status:g.status,entity:g.response||g.responseText};e.RESPONSE_HEADERS.forEach(function(b){a.headers[b]=g.getResponseHeader(b)}),c(a)}},g.upload.onprogress=a.progress(),g.open(b.method,h,!0);var i=b.entity,j=b.headers;for(var k in j)g.setRequestHeader(k,j[k]);switch(g.withCredentials=a.withCredentials,a.responseType()){case"arraybuffer":g.responseType="arraybuffer";break;case"blob":case"data-url":case"base64":g.responseType="blob"}g.send(i)},c.prototype.fromFormat=function(a,c,d){if("json"==d)c=JSON.parse(c);else if("data-url"==d||"base64"==d){var e=function(){var a=new FileReader;return a.readAsDataURL(c),{v:new Promise(function(b,c){a.onload=b,a.onerror=c}).then(function(){var b=a.result;return"base64"==d&&(b=b.substring(b.indexOf(",")+1)),b})}}();if("object"===("undefined"==typeof e?"undefined":b.typeof(e)))return e.v}return c},c.prototype.toFormat=function(a){var b=a.request.type;if(b){var c=a.request.entity,d=a.mimeType();switch(b){case"blob":d=d||c.type;break;case"arraybuffer":case"form":break;case"data-url":var e=c.match(/^data:(.+?)(;base64)?,(.*)$/),f=e[2];if(c=e[3],b="blob",d=d||e[1],!f){c=decodeURIComponent(c);break}case"base64":for(var g=atob(c),h=g.length,i=new Uint8Array(h),j=0;ja.PersistentAttributeType.EMBEDDED}},{key:"isCollection",get:function(){return this.persistentAttributeType==a.PersistentAttributeType.ELEMENT_COLLECTION}}]),a.prototype.init=function(a,b){if(this.declaringType)throw new Error("The attribute is already initialized.");this.order=b,this.accessor=new e,this.declaringType=a},a.prototype.getValue=function(a){return this.accessor.getValue(a,this)},a.prototype.setValue=function(a,b){this.accessor.setValue(a,this,b)},a.prototype.getJsonValue=function(a,b){},a.prototype.setJsonValue=function(a,b,c){},a.prototype.toJSON=function(){},a}();f.PersistentAttributeType={BASIC:0,ELEMENT_COLLECTION:1,EMBEDDED:2,MANY_TO_MANY:3,MANY_TO_ONE:4,ONE_TO_MANY:5,ONE_TO_ONE:6},c.exports=f},{7:7}],38:[function(a,c,d){"use strict";function e(a){return a instanceof Date?a.toISOString().replace(/\.?0*Z/,"Z"):null}function f(a,b){var c="string"==typeof a?new Date(a):null;return b&&c&&b.toISOString()==c.toISOString()?b:c}var g=a(51),h=a(5),i=function(a){function c(d,e,f){b.classCallCheck(this,c),0!=d.indexOf("/db/")&&(d="/db/"+d);var g=b.possibleConstructorReturn(this,a.call(this,d,e));return g.noResolving=f,g}return b.inherits(c,a),b.createClass(c,[{key:"persistenceType",get:function(){return g.PersistenceType.BASIC}}]),c.prototype.toJsonValue=function(a,b){return null===b||void 0===b?null:this.typeConstructor(b)},c.prototype.fromJsonValue=function(a,b,c){return null===b||void 0===b?null:b},c.prototype.toString=function(){return"BasicType("+this.ref+")"},c}(g);Object.assign(i,{Boolean:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.fromJsonValue=function(b,c,d){return"string"==typeof c?"false"!==c:a.prototype.fromJsonValue.call(this,b,c,d)},c}(i))("Boolean",Boolean),Double:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.fromJsonValue=function(b,c,d){return"string"==typeof c?parseFloat(c):a.prototype.fromJsonValue.call(this,b,c,d)},c}(i))("Double",Number),Integer:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.fromJsonValue=function(b,c,d){return"string"==typeof c?parseInt(c):a.prototype.fromJsonValue.call(this,b,c,d)},c}(i))("Integer",Number),String:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c}(i))("String",String),DateTime:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.toJsonValue=function(a,b){return e(b)},c.prototype.fromJsonValue=function(a,b,c){return f(b,c)},c}(i))("DateTime",Date),Date:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.toJsonValue=function(a,b){var c=e(b);return c?c.substring(0,c.indexOf("T")):null},c.prototype.fromJsonValue=function(a,b,c){return f(b,c)},c}(i))("Date",Date),Time:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.toJsonValue=function(a,b){var c=e(b);return c?c.substring(c.indexOf("T")+1):null},c.prototype.fromJsonValue=function(a,b,c){return"string"==typeof b?f("1970-01-01T"+b,c):b},c}(i))("Time",Date),GeoPoint:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.toJsonValue=function(a,b){return b instanceof h?b:null},c.prototype.fromJsonValue=function(a,b){return b?new h(b):null},c}(i))("GeoPoint",h),JsonArray:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.init=function(a){this._enhancer=a},c.prototype.toJsonValue=function(a,b){return Array.isArray(b)?b:null},c.prototype.fromJsonValue=function(a,b){return Array.isArray(b)?b:null},c}(i))("JsonArray",Array),JsonObject:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.init=function(a){this._enhancer=a},c.prototype.toJsonValue=function(a,b){return b&&b.constructor==Object?b:null},c}(i))("JsonObject",Object)}),c.exports=i},{5:5,51:51}],39:[function(a,c,d){"use strict";var e=a(48),f=function(a){function c(d,e){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this,d,e));return f.typeConstructor=null,f}return b.inherits(c,a),b.createClass(c,[{key:"collectionType",get:function(){return e.CollectionType.COLLECTION}}]),c}(e);c.exports=f},{48:48}],40:[function(a,c,d){"use strict";var e=function(){function a(c,d){if(b.classCallCheck(this,a),Object(c)instanceof String){var e={};e[c]=a.ASC,this.keys=[e]}else if(Object(c)instanceof Array)this.keys=c;else{if(!c)throw new Error("The keys parameter must be an String, Object or Array.");this.keys=[c]}this.drop=!1,this.unique=d===!0}return a.prototype.hasKey=function(a){for(var b=0;b1}},{key:"isUnique",get:function(){return this.unique}}]),a}();Object.assign(e,{ASC:"asc",DESC:"desc",GEO:"geo",fromJSON:function(a){return new e(a.keys,a.unique)}}),c.exports=e},{}],41:[function(a,c,d){"use strict";var e=a(44),f=a(51),g=a(20),h=function(a){function c(d,e){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.call(this,d,e))}return b.inherits(c,a),b.createClass(c,[{key:"persistenceType",get:function(){return f.PersistenceType.EMBEDDABLE}}]),c.prototype.createProxyClass=function(){return this._enhancer.createProxy(g.Managed)},c.prototype.createObjectFactory=function(a){return g.ManagedFactory.create(this,a)},c.prototype.toJsonValue=function(b,c){return b._root&&c instanceof this.typeConstructor&&!c._metadata._root&&(c._metadata._root=b._root),a.prototype.toJsonValue.call(this,b,c)},c.prototype.fromJsonValue=function(b,c,d){return c&&(d instanceof this.typeConstructor||(d=this.create()),b._root&&!d._metadata._root&&(d._metadata._root=b._root)),a.prototype.fromJsonValue.call(this,b,c,d)},c.prototype.toString=function(){return"EmbeddableType("+this.ref+")"},c}(e);c.exports=h},{20:20,44:44,51:51}],42:[function(a,c,d){"use strict";var e=a(20),f=a(50),g=a(38),h=a(51),i=a(44),j=a(70),k=function(a){function c(d,e,f){b.classCallCheck(this,c);var g=b.possibleConstructorReturn(this,a.call(this,d,f));return g.declaredId=null,g.declaredVersion=null,g.declaredAcl=null,g.superType=e,g.loadPermission=new j.Permission,g.updatePermission=new j.Permission,g.deletePermission=new j.Permission,g.queryPermission=new j.Permission,g.schemaSubclassPermission=new j.Permission,g.insertPermission=new j.Permission,g}return b.inherits(c,a),b.createClass(c,[{key:"persistenceType",get:function(){return h.PersistenceType.ENTITY}},{key:"id",get:function(){return this.declaredId||this.superType.id}},{key:"version",get:function(){return this.declaredVersion||this.superType.version}},{key:"acl",get:function(){return this.declaredAcl||this.superType.acl}}]),c.prototype.createProxyClass=function(){var a=this.superType.typeConstructor;if(a===Object)switch(this.name){case"User":a=e.User;break;case"Role":a=e.Role;break;default:a=e.Entity}return this._enhancer.createProxy(a)},c.prototype.createObjectFactory=function(a){switch(this.name){case"User":return e.UserFactory.create(this,a);case"Device":return e.DeviceFactory.create(this,a);case"Object":return}return e.EntityFactory.create(this,a)},c.prototype.fromJsonValue=function(b,c,d,e){return e?a.prototype.fromJsonValue.call(this,b,c,d):c?b.db.getReference(c):null},c.prototype.toJsonValue=function(b,c,d){return d?a.prototype.toJsonValue.call(this,b,c):c instanceof this.typeConstructor?(c.attach(b.db),c.id):null},c.prototype.toString=function(){return"EntityType("+this.ref+")"},c.prototype.toJSON=function(){var b=a.prototype.toJSON.call(this);return b.acl.schemaSubclass=this.schemaSubclassPermission,b.acl.insert=this.insertPermission,b.acl.update=this.updatePermission,b.acl.delete=this.deletePermission,b.acl.query=this.queryPermission,b},c}(i),l=function(a){function c(){b.classCallCheck(this,c);var d=b.possibleConstructorReturn(this,a.call(this,k.Object.ref,null,Object));return d.declaredId=new f("id",g.String,!0),d.declaredId.init(d,0),d.declaredId.isId=!0,d.declaredVersion=new f("version",g.Double,!0),d.declaredVersion.init(d,1),d.declaredVersion.isVersion=!0,d.declaredAcl=new f("acl",g.JsonObject,!0),d.declaredAcl.init(d,2),d.declaredAcl.isAcl=!0,d.declaredAttributes=[d.declaredId,d.declaredVersion,d.declaredAcl],d}return b.inherits(c,a),b.createClass(c,null,[{key:"ref",get:function(){return"/db/Object"}}]),c}(k);k.Object=l,c.exports=k},{20:20,38:38,44:44,50:50,51:51,70:70}],43:[function(a,c,d){"use strict";var e=a(48),f=function(a){function c(d,e){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this,d,e));return f.typeConstructor=Array,f}return b.inherits(c,a),b.createClass(c,[{key:"collectionType",get:function(){return e.CollectionType.LIST}}],[{key:"ref",get:function(){return"/db/collection.List"}}]),c.prototype.getJsonValue=function(a,b){var c=this.getValue(b);if(c instanceof this.typeConstructor){for(var d=c.length,e=new Array(d),f=c.__persistedState__||[],g=!c.__persistedState__||f.length!=d,h=new Array(d),i=0;i=b.length)break;e=b[d++]}else{if(d=b.next(),d.done)break;e=d.value}var f=e;if(f.name===a||f.order===a)return f}return null},c.prototype.fromJsonValue=function(a,b,c){if(b)for(var d=this.attributes(),e=Array.isArray(d),f=0,d=e?d:d[Symbol.iterator]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;h.isMetadata||h.setJsonValue(a,c,b[h.name])}else c=null;return c},c.prototype.toJsonValue=function(a,b){var c=null;if(b instanceof this.typeConstructor){c={};for(var d=this.attributes(),e=Array.isArray(d),f=0,d=e?d:d[Symbol.iterator]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;h.isMetadata||(c[h.name]=h.getJsonValue(a,b))}}return c},c.prototype.toJSON=function(){var a={};a.class=this.ref,this.superType&&(a.superClass=this.superType.ref),this.isEmbeddable&&(a.embedded=!0),a.acl={load:this.loadPermission,schemaAdd:this.schemaAddPermission,schemaReplace:this.schemaReplacePermission};for(var b=a.fields={},c=this.declaredAttributes,d=Array.isArray(c),e=0,c=d?c:c[Symbol.iterator]();;){var f;if(d){if(e>=c.length)break;f=c[e++]}else{if(e=c.next(),e.done)break;f=e.value}var g=f;g.isMetadata||(b[g.name]=g)}return a},c.prototype.references=function(){var a,b=this.attributes(),c=[];return a={},a[Symbol.iterator]=function(){return this},a.next=function(){for(var a=b,d=Array.isArray(a),e=0,a=d?a:a[Symbol.iterator]();;){var f;if(d){if(e>=a.length)break;f=a[e++]}else{if(e=a.next(),e.done)break;f=e.value}var g=f,h=g.isCollection?g.elementType:g.type;if(h.isEntity)return{done:!1,value:{path:[g.name]}};if(h.isEmbeddable)for(var i=h.references(),j=Array.isArray(i),k=0,i=j?i:i[Symbol.iterator]();;){var l;if(j){if(k>=i.length)break;l=i[k++]}else{if(k=i.next(),k.done)break;l=k.value}var m=l;c.push({done:!1,value:{path:[g.name].concat(m.path)}})}}return c.length?c.pop():{done:!0}},a},c}(e);c.exports=i},{20:20,51:51,65:65,69:69}],45:[function(a,c,d){"use strict";var e=a(48),f=a(32),g=function(a){function c(d,e,f){b.classCallCheck(this,c);var g=b.possibleConstructorReturn(this,a.call(this,d,f));return g.keyType=e,g.typeConstructor=Map,g}return b.inherits(c,a),b.createClass(c,[{key:"collectionType",get:function(){return e.CollectionType.MAP}}],[{key:"ref",get:function(){return"/db/collection.Map"}}]),c.prototype.getJsonValue=function(a,b){var c=this.getValue(b);if(c instanceof this.typeConstructor){for(var d={},e=c.__persistedState__||{},g=!c.__persistedState__||c.__persistedSize__!==c.size,h={},i=c.entries(),j=Array.isArray(i),k=0,i=j?i:i[Symbol.iterator]();;){var l;if(j){if(k>=i.length)break;l=i[k++]}else{if(k=i.next(),k.done)break;l=k.value}var m=l;if(null===m[0]||void 0===m[0])throw new f("Map keys can't be null nor undefined.");var n=this.keyType.toJsonValue(a,m[0]);h[n]=this.elementType.toJsonValue(a,m[1]),d[n]=[m[0],m[1]],g|=(e[n]||[])[1]!==m[1]}return a.persisting&&Object.defineProperties(c,{__persistedState__:{value:d,configurable:!0},__persistedSize__:{value:c.size,configurable:!0}}),a.isPersistent&&g&&a.setDirty(),h}return null},c.prototype.setJsonValue=function(a,b,c){var d=null;if(c){d=this.getValue(b),d instanceof this.typeConstructor||(d=new this.typeConstructor);var e={},f=d.__persistedState__||{};d.clear();for(var g in c){var h=f[g]||[],i=this.keyType.fromJsonValue(a,g,h[0]),j=this.elementType.fromJsonValue(a,c[g],h[1]);e[g]=[i,j],d.set(i,j)}a.persisting&&Object.defineProperties(d,{__persistedState__:{value:e,configurable:!0},__persistedSize__:{value:d.size,configurable:!0}})}this.setValue(b,d)},c.prototype.toJSON=function(){return{name:this.name,type:c.ref+"["+this.keyType.ref+","+this.elementType.ref+"]",order:this.order}},c}(e);c.exports=g},{32:32,48:48}],46:[function(a,c,d){"use strict";var e=(a(38),a(44)),f=a(42),g=a(9),h=a(47),i=a(40),j=a(61),k=a(25).StatusCode,l=a(36),m=function(a){function c(d){b.classCallCheck(this,c);var e=b.possibleConstructorReturn(this,a.call(this));return e.isInitialized=!1,e.entityManagerFactory=d,e.entities=null,e.embeddables=null,e.baseTypes=null,e._enhancer=new g,e}return b.inherits(c,a),c.prototype.init=function(a){if(this.isInitialized)throw new Error("Metamodel is already initialized.");this.fromJSON(a||[]),this.isInitialized=!0},c.prototype._getRef=function(a){var b;return Object(a)instanceof String?(b=a,0!=b.indexOf("/db/")&&(b="/db/"+a)):b=this._enhancer.getIdentifier(a),b},c.prototype.entity=function(a){var b=this._getRef(a);return b?this.entities[b]:null},c.prototype.baseType=function(a){var b=null;if(Object(a)instanceof String)b=this._getRef(a);else for(var c in this.baseTypes){var d=this.baseTypes[c];if(!d.noResolving&&d.typeConstructor==a){b=c;break}}return b?this.baseTypes[b]:null},c.prototype.embeddable=function(a){var b=this._getRef(a);return b?this.embeddables[b]:null},c.prototype.managedType=function(a){return this.baseType(a)||this.entity(a)||this.embeddable(a)},c.prototype.addType=function(a){var b;if(a.isBasic?b=this.baseTypes:a.isEmbeddable?(a.init(this._enhancer),b=this.embeddables):a.isEntity&&(a.init(this._enhancer),b=this.entities,null==a.superType&&a.ref!=f.Object.ref&&(a.superType=this.entity(f.Object.ref))),b[a.ref])throw new Error("The type "+a.ref+" is already declared.");return b[a.ref]=a},c.prototype.load=function(){var a=this;if(this.isInitialized)throw new Error("Metamodel is already initialized.");return this.withLock(function(){var b=new l.GetAllSchemas;return a.entityManagerFactory.send(b).then(function(b){return a.init(b.entity),a})})},c.prototype.save=function(a){var b=this;return this._send(a||this.toJSON()).then(function(){return b})},c.prototype.update=function(a){var b=this;return this._send(a).then(function(a){return b.fromJSON(a.entity),b})},c.prototype._send=function(a){var b=this;if(!this.isInitialized)throw new Error("Metamodel is not initialized.");return this.withLock(function(){var c;return c=a instanceof e?new l.UpdateSchema(a.name,a.toJSON()):new l.UpdateAllSchemas(a),b.entityManagerFactory.send(c)})},c.prototype.toJSON=function(){var a=[];for(var b in this.entities)a.push(this.entities[b]);for(b in this.embeddables)a.push(this.embeddables[b]);return a},c.prototype.fromJSON=function(a){var b=new h,c=b.buildModels(a);this.baseTypes={},this.embeddables={},this.entities={};for(var d in c){var e=c[d];this.addType(e)}},c.prototype.createIndex=function(a,b){b.drop=!1;var c=new l.CreateDropIndex(a,b.toJSON());return this.entityManagerFactory.send(c)},c.prototype.dropIndex=function(a,b){b.drop=!0;var c=new l.CreateDropIndex(a,b.toJSON());return this.entityManagerFactory.send(c)},c.prototype.dropAllIndexes=function(a){var b=new l.DropAllIndexes(a);return this.entityManagerFactory.send(b)},c.prototype.getIndexes=function(a){var b=new l.ListIndexes(a);return this.entityManagerFactory.send(b).then(function(a){return a.entity.map(function(a){return new i(a.keys,a.unique)})},function(a){if(a.status==k.BUCKET_NOT_FOUND||a.status==k.OBJECT_NOT_FOUND)return null;throw a})},c}(j);c.exports=m},{25:25,36:36,38:38,40:40,42:42,44:44,47:47,61:61,9:9}],47:[function(a,c,d){"use strict";var e=a(38),f=a(42),g=a(41),h=a(43),i=a(45),j=a(49),k=a(50),l=a(32),m=function(){function a(){b.classCallCheck(this,a),this.models={},this.modelDescriptors=null;for(var c=Object.keys(e),d=Array.isArray(c),f=0,c=d?c:c[Symbol.iterator]();;){var g;if(d){if(f>=c.length)break;g=c[f++]}else{if(f=c.next(),f.done)break;g=f.value}var h=g,i=e[h];i instanceof e&&(this.models[i.ref]=i)}}return a.prototype.getModel=function(a){return a in this.models?this.models[a]:this.models[a]=this.buildModel(a)},a.prototype.buildModels=function(a){this.modelDescriptors={};for(var b,c=0;b=a[c];++c)this.modelDescriptors[b.class]=b;for(var d in this.modelDescriptors)try{var e=this.getModel(d);this.buildAttributes(e)}catch(a){throw new l("Can't create model for entity class "+d,a)}return this.getModel(f.Object.ref),this.models},a.prototype.buildModel=function(a){var b,c=this.modelDescriptors[a];if(a==f.Object.ref)b=new f.Object;else{if(!c)throw new TypeError("No model available for "+a);if(c.embedded)b=new g(a);else{var d=c.superClass||f.Object.ref;b=new f(a,this.getModel(d))}}if(c){var e=c.acl;for(var h in e)b[h+"Permission"].fromJSON(e[h])}return b},a.prototype.buildAttributes=function(a){var b=this.modelDescriptors[a.ref],c=b.fields;for(var d in c){var e=c[d];a.getAttribute(d)||a.addAttribute(this.buildAttribute(e.name,e.type),e.order)}b.validationCode&&(a.validationCode=b.validationCode)},a.prototype.buildAttribute=function(a,b){if(0!=b.indexOf("/db/collection."))return new k(a,this.getModel(b));var c=b.substring(0,b.indexOf("[")),d=b.substring(b.indexOf("[")+1,b.indexOf("]")).trim();switch(c){case h.ref:return new h(a,this.getModel(d));case j.ref:return new j(a,this.getModel(d));case i.ref:var e=d.substring(0,d.indexOf(",")).trim();return d=d.substring(d.indexOf(",")+1).trim(),new i(a,this.getModel(e),this.getModel(d));default:throw new TypeError("No collection available for "+b)}},a}();c.exports=m},{32:32,38:38,41:41,42:42,43:43,45:45,49:49,50:50}],48:[function(a,c,d){"use strict";var e=a(37),f=function(a){function c(d,e){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this,d));return f.elementType=e,f.typeConstructor=null,f}return b.inherits(c,a),b.createClass(c,[{key:"persistentAttributeType",get:function(){return e.PersistentAttributeType.ELEMENT_COLLECTION}}]),c}(e);f.CollectionType={COLLECTION:0,LIST:1,MAP:2,SET:3},c.exports=f},{37:37}],49:[function(a,c,d){"use strict";var e=a(48),f=function(a){function c(d,e){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this,d,e));return f.typeConstructor=Set,f}return b.inherits(c,a),b.createClass(c,[{key:"collectionType",get:function(){return e.CollectionType.SET}}],[{key:"ref",get:function(){return"/db/collection.Set"}}]),c.prototype.getJsonValue=function(a,b){var c=this.getValue(b);if(c instanceof this.typeConstructor){for(var d={},e=c.__persistedState__||{},f=!c.__persistedState__||c.__persistedSize__!==c.size,g=[],h=c,i=Array.isArray(h),j=0,h=i?h:h[Symbol.iterator]();;){var k;if(i){if(j>=h.length)break;k=h[j++]}else{if(j=h.next(),j.done)break;k=j.value}var l=k,m=this.elementType.toJsonValue(a,l);g.push(m),d[m]=l,f|=e[m]!==l}return a.persisting&&Object.defineProperties(c,{__persistedState__:{value:d,configurable:!0},__persistedSize__:{value:c.size,configurable:!0}}),a.isPersistent&&f&&a.setDirty(),g}return null},c.prototype.setJsonValue=function(a,b,c){var d=null;if(c){d=this.getValue(b),d instanceof this.typeConstructor||(d=new this.typeConstructor);var e={},f=d.__persistedState__||{};d.clear();for(var g=0,h=c.length;ge.MAX_URI_SIZE?new f.AdhocQueryPOST(g.name,this.firstResult,this.maxResults,j).entity(i,"text"):new f.AdhocQuery(g.name,i,this.firstResult,this.maxResults,j),this.entityManager.send(h).then(function(b){return d._createResultList(b.entity,a)}).then(b,c)},c.prototype.singleResult=function(a,b,c){ +var d=this;a instanceof Function&&(c=b,b=a,a={});var g=this.resultClass?this.entityManager.metamodel.entity(this.resultClass):null;if(!g)throw new Error("Only typed queries can be executed.");var h,i=this._serializeQuery(),j=this._serializeSort(),k=this.entityManager._connector.host.length+i.length;return h=k>e.MAX_URI_SIZE?new f.AdhocQueryPOST(g.name,i,this.firstResult,1,j).entity(i,"text"):new f.AdhocQuery(g.name,i,this.firstResult,1,j),this.entityManager.send(h).then(function(b){return d._createResultList(b.entity,a)}).then(function(a){return a.length?a[0]:null}).then(b,c)},c.prototype.count=function(a,b){var c=this.resultClass?this.entityManager.metamodel.entity(this.resultClass):null;if(!c)throw new Error("Only typed queries can be executed.");var d,g=this._serializeQuery(),h=this.entityManager._connector.host.length+g.length;return d=h>e.MAX_URI_SIZE?new f.AdhocCountQueryPOST(c.name).entity(g,"text"):new f.AdhocCountQuery(c.name,g),this.entityManager.send(d).then(function(a){return a.entity.count}).then(a,b)},c.prototype._serializeQuery=function(){return JSON.stringify(this,function(a,b){var c=this[a];return Object(c)instanceof Date?{$date:b}:c instanceof h?c.id:b})},c.prototype._serializeSort=function(){return JSON.stringify(this._sort)},c.prototype._createResultList=function(a,b){return a.length?Promise.all(a.map(function(a){if(a.id){var c=this.entityManager.getReference(this.resultClass,a.id),d=g.get(c);return d.setJson(a,!0),this.entityManager.resolveDepth(c,b)}return this.entityManager.load(Object.keys(a)[0])},this)).then(function(a){return a.filter(function(a){return!!a})}):Promise.resolve([])},c.prototype._addOrder=function(a,b){return b?this._sort[a]=b:this._sort=a,this},c.prototype._addOffset=function(a){return this.firstResult=a,this},c.prototype._addLimit=function(a){return this.maxResults=a,this},c}(e);c.exports=i},{10:10,36:36,58:58,63:63}],57:[function(a,c,d){"use strict";var e=a(56),f=function(a){function c(d,e,f,g){b.classCallCheck(this,c);var h=b.possibleConstructorReturn(this,a.call(this,d,e));return h._operator=f,h._childs=g,h}return b.inherits(c,a),c.prototype.toJSON=function(){var a={};return a[this._operator]=this._childs,a},c}(e);c.exports=f},{56:56}],58:[function(a,c,d){"use strict";var e=function(){function a(c,d){b.classCallCheck(this,a),this.entityManager=c,this.resultClass=d}return a.prototype.ascending=function(a){return this._addOrder(a,1)},a.prototype.descending=function(a){return this._addOrder(a,-1)},a.prototype.sort=function(a){if(!(a instanceof Object)||Object.getPrototypeOf(a)!=Object.prototype)throw new Error("sort must be an object.");return this._addOrder(a)},a.prototype.offset=function(a){if(a<0)throw new Error("The offset can't be nagative.");return this._addOffset(a)},a.prototype.limit=function(a){if(a<0)throw new Error("The limit can't be nagative.");return this._addLimit(a)},a.prototype.resultList=function(a,b,c){},a.prototype.singleResult=function(a,b,c){},a.prototype.stream=function(a){},a.prototype.count=function(a,b){},a}();e.MAX_URI_SIZE=2e3,e.varargs=function(a,b){return Array.prototype.concat.apply([],Array.prototype.slice.call(b,a))},c.exports=e},{}],59:[function(a,b,c){"use strict";c.Builder=a(53),c.Condition=a(54),c.Filter=a(55),c.Node=a(56),c.Operator=a(57),c.Query=a(58)},{53:53,54:54,55:55,56:56,57:57,58:58}],60:[function(a,c,d){"use strict";var e=a(36),f=a(25).StatusCode,g=function(){function a(c,d){b.classCallCheck(this,a),this._metamodel=c,this.entityManagerFactory=d}return a.prototype.functionToString=function(a){if(!a)return"";var b=a.toString();return b=b.substring(b.indexOf("{")+1,b.lastIndexOf("}")),"\n"==b.charAt(0)&&(b=b.substring(1)),"\n"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1)),b},a.prototype.stringToFunction=function(a,b){return new Function(a,b)},a.prototype.loadModules=function(){var a=new e.GetAllModules;return this.entityManagerFactory.send(a).then(function(a){return a.entity})},a.prototype.loadCode=function(a,b,c){var d=this,g=Object(a)instanceof String?a:a.name,h=new e.GetBaqendCode(g,b).responseType("text");return this.entityManagerFactory.send(h).then(function(a){return d._parseCode(g,b,c,a.entity)},function(a){if(a.status==f.OBJECT_NOT_FOUND)return null;throw a})},a.prototype.saveCode=function(a,b,c){var d=this,f=Object(a)instanceof String?a:a.name,g=c instanceof Function,h=new e.SetBaqendCode(f,b).entity(g?this.functionToString(c):c,"text").responseType("text");return this.entityManagerFactory.send(h).then(function(a){return d._parseCode(f,b,g,a.entity)})},a.prototype.deleteCode=function(a,b){var c=this,d=Object(a)instanceof String?a:a.name,f=new e.DeleteBaqendCode(d,b);return this.entityManagerFactory.send(f).then(function(){return c._parseCode(d,b,!1,null)})},a.prototype._parseCode=function(a,b,c,d){if("validate"==b){var e=this._metamodel.entity(a);return e.validationCode=d,c?e.validationCode:d}return c?this.stringToFunction(["module","exports"],d):d},a}();c.exports=g},{25:25,36:36}],61:[function(a,c,d){"use strict";var e=function(){function a(){b.classCallCheck(this,a),this._isLocked=!1,this._readyPromise=Promise.resolve(this),this._deferred=null}return a.prototype.ready=function(a,b){return this._readyPromise.then(a,b)},a.prototype.withLock=function(a,b){if(this._isLocked)throw new Error("Current operation has not been finished.");var c=this;try{this._isLocked=!0;var d=a().then(function(a){return c._isLocked=!1,a},function(a){throw b||(c._isLocked=!1),a});return this._readyPromise=d.then(function(){return c},function(a){if(!b)return c;throw a}),d}catch(a){throw b?this._readyPromise=Promise.reject(a):this._isLocked=!1,a}},b.createClass(a,[{key:"isReady",get:function(){return!this._isLocked}}]),a}();c.exports=e},{}],62:[function(a,c,d){"use strict";var e=a(36),f=(a(25).StatusCode,function(){function a(){b.classCallCheck(this,a)}return a.create=function(a){function b(){c.log.apply(b,arguments)}for(var c=this.prototype,d=Object.getOwnPropertyNames(c),e=Array.isArray(d),f=0,d=e?d:d[Symbol.iterator]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;Object.defineProperty(b,h,Object.getOwnPropertyDescriptor(c,h))}return b._init(a),b},a.prototype.log=function(c,d,e){var f=Array.prototype.slice.call(arguments);if(c=a.LEVELS.indexOf(f[0])==-1?"info":f.shift(),!(this.levelIndex>a.LEVELS.indexOf(c)))return d="string"==typeof f[0]?this._format(f.shift(),f):"[no message]",e=null,f.length&&"object"===b.typeof(f[f.length-1])&&(e=f.pop(),Array.isArray(e)&&(e={data:e})),f.length&&(d+=", "+f.join(", ")),this._log({date:new Date,message:d,level:c,user:this.entityManager.me&&this.entityManager.me.id,data:e})},a.prototype._format=function(b,c){if(0==c.length)return b;var d=String(b).replace(a.FORMAT_REGEXP,function(a){if("%%"===a)return"%";if(!c.length)return a;switch(a){case"%s":return String(c.shift());case"%d":return Number(c.shift());case"%j":try{return JSON.stringify(c.shift())}catch(a){return"[Circular]"}default:return a}});return d},a.prototype._init=function(b){var c=this;this.entityManager=b,this.levelIndex=2,a.LEVELS.forEach(function(a){c[a]=c.log.bind(c,a)})},a.prototype._log=function(a){return this.entityManager.isReady?this.entityManager.send(new e.CreateObject("logs.AppLog",a)):this.entityManager.ready(this._log.bind(this,a))},b.createClass(a,[{key:"level",get:function(){return a.LEVELS[this.levelIndex]},set:function(b){var c=a.LEVELS.indexOf(b);if(c==-1)throw new Error("Unknown logging level "+b);this.levelIndex=c}}]),a}());Object.assign(f,{LEVELS:["trace","debug","info","warn","error"],FORMAT_REGEXP:/%[sdj%]/g}),c.exports=f},{25:25,36:36}],63:[function(a,c,d){"use strict";var e=a(34),f=a(1),g=a(61),h=(a(20),function(c){function d(a,e){b.classCallCheck(this,d);var g=b.possibleConstructorReturn(this,c.call(this));return g._root=a,g._state=d.Type.DIRTY,g._enabled=!0,g.persisting=!1,g.id=null,g.version=null,g.type=e,g.acl=new f(g),g}return b.inherits(d,c),d.create=function(a,b){var c;if(a.isEntity)c=new d(b,a);else{if(!a.isEmbeddable)throw new Error("Illegal type "+a);c={type:a,readAccess:function(){var a=this._root&&this._root._metadata;a&&a.readAccess()},writeAccess:function(){var a=this._root&&this._root._metadata;a&&a.writeAccess()}}}return c},d.get=function(a){return a._metadata},b.createClass(d,[{key:"db",get:function(){return this._db?this._db:this._db=a(6)},set:function(a){if(this._db)throw new Error("DB has already been set.");this._db=a}},{key:"bucket",get:function(){return this.type.name}},{key:"key",get:function(){if(!this._key&&this.id){var a=this.id.lastIndexOf("/");this._key=decodeURIComponent(this.id.substring(a+1))}return this._key},set:function(a){if(a+="",this.id)throw new Error("The id can't be set twice.");this.id="/db/"+this.bucket+"/"+encodeURIComponent(a),this._key=a}},{key:"isAttached",get:function(){return!!this._db}},{key:"isAvailable",get:function(){return this._state>d.Type.UNAVAILABLE}},{key:"isPersistent",get:function(){return this._state==d.Type.PERSISTENT}},{key:"isDirty",get:function(){return this._state==d.Type.DIRTY}}]),d.prototype.readAccess=function(){if(this._enabled&&!this.isAvailable)throw new e.PersistentError("This object "+this.id+" is not available.")},d.prototype.writeAccess=function(){if(this._enabled){if(!this.isAvailable)throw new e.PersistentError("This object "+this.id+" is not available.");this.setDirty()}},d.prototype.setUnavailable=function(){this._state=d.Type.UNAVAILABLE},d.prototype.setPersistent=function(){this._state=d.Type.PERSISTENT},d.prototype.setDirty=function(){this._state=d.Type.DIRTY},d.prototype.setRemoved=function(){this.isAvailable&&(this.setDirty(),this.version=null)},d.prototype.getJsonMetadata=function(){var a={};return this.id&&(a.id=this.id),this.version&&(a.version=this.version),a.acl=this.acl,a},d.prototype.setJsonMetadata=function(a){this.id||(this.id=a.id),a.version&&(this.version=a.version),this.acl.fromJSON(a.acl||{})},d.prototype.getJson=function(a,b){this._enabled=!1,this.persisting=!!b;var c=this.type.toJsonValue(this,this._root,!0);return this._enabled=!0,this.persisting=!1,this.isAttached&&!a&&Object.assign(c,this.getJsonMetadata()),c},d.prototype.setJson=function(a,b){(a.id||a.version||a.acl)&&this.setJsonMetadata(a),this._enabled=!1,this.persisting=!!b,this.type.fromJsonValue(this,a,this._root,!0),this._enabled=!0,this.persisting=!1,b?this.setPersistent():this.setDirty()},d}(g));h.Type={UNAVAILABLE:-1,PERSISTENT:0,DIRTY:1},c.exports=h},{1:1,20:20,34:34,6:6,61:61}],64:[function(a,c,d){"use strict";var e=a(36),f=function(){function a(c,d){b.classCallCheck(this,a),this._entityManager=c,this._connector=d}return a.prototype.get=function(a,b,c,d,f){b instanceof Function&&(f=c,d=b,c={},b=null),c instanceof Function&&(f=d,d=c,c={}),c=c||{};var g=new e.GetBaqendModule(a).addQueryString(b).responseType(c.responseType||null);return this._send(g,d,f)},a.prototype.post=function(a,b,c,d,f){c instanceof Function&&(f=d,d=c,c={}),c=c||{};var g=new e.PostBaqendModule(a).entity(b,c.requestType).mimeType(c.mimeType||null).responseType(c.responseType||null);return this._send(g,d,f)},a.prototype._send=function(a,b,c){return this._entityManager.send(a).then(function(a){return a.entity}).then(b,c)},a}();c.exports=f},{36:36}],65:[function(a,c,d){"use strict";var e=function(){function a(c){b.classCallCheck(this,a),this._rules={},this._metadata=c}return a.prototype.allRules=function(){return Object.keys(this._rules)},a.prototype.clear=function(){this._metadata&&this._metadata.writeAccess(),this._rules={}},a.prototype.copy=function(a){return this._metadata&&this._metadata.writeAccess(),this._rules=Object.assign({},a._rules),this},a.prototype.isPublicAllowed=function(){if("*"in this._rules)return!1;for(var a in this._rules)if("allow"==this._rules[a])return!1;return!0},a.prototype.setPublicAllowed=function(){this._metadata&&this._metadata.writeAccess();for(var a in this._rules)"allow"==this._rules[a]&&delete this._rules[a]},a.prototype.getRule=function(a){return this._rules[this._getRef(a)]},a.prototype.isAllowed=function(a){return"allow"==this._rules[this._getRef(a)]},a.prototype.isDenied=function(a){return"deny"==this._rules[this._getRef(a)]},a.prototype.allowAccess=function(a){var b=arguments;this._metadata&&this._metadata.writeAccess();for(var c=0;c=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;c.push(h.name)}var i=new Function(c,b);return function(a){var b=c.map(function(b){return a[b]});return i.apply({},b)}},a.prototype.is=function(a,b){return a instanceof Function&&(b=a,a="is"),b(this.value,e)===!1&&this.errors.push(a),this},b.createClass(a,[{key:"value",get:function(){return this._entity[this.key]}},{key:"isValid",get:function(){return 0==this.errors.length}}]),a.prototype._callMethod=function(a,b,c){return c=c||[],c.unshift(this.value),e[a].apply(this,c)===!1&&this.errors.push(b),this},a.prototype.toString=function(){return this.value},a.prototype.toJSON=function(){return{isValid:this.isValid,errors:this.errors}},a}());Object.keys(e).forEach(function(a){"function"==typeof e[a]&&"toString"!==a&&"toDate"!==a&&"extend"!==a&&"init"!==a&&(f.prototype[a]=function(b){return this._callMethod(a,b||a,Array.prototype.slice.call(arguments,b?1:0))})}),c.exports=f},{162:162,68:68}],70:[function(a,b,c){"use strict";b.exports=c=a(71),c.Metadata=a(63),c.Permission=a(65),c.Validator=a(69),c.ValidationResult=a(68),c.Code=a(60),c.Modules=a(64),c.Lockable=a(61),c.Logger=a(62),c.PushMessage=a(66),c.TokenStorage=a(67),c.uuid=a(160).v4},{160:160,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,71:71}],71:[function(a,b,c){"use strict";c.hmac=a(157),c.atob=window.atob,c.isNode=!1},{157:157}],72:[function(a,b,c){b.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},{}],73:[function(a,b,c){var d=a(144)("unscopables"),e=Array.prototype;void 0==e[d]&&a(94)(e,d,{}),b.exports=function(a){e[d][a]=!0}},{144:144,94:94}],74:[function(a,b,c){b.exports=function(a,b,c,d){if(!(a instanceof b)||void 0!==d&&d in a)throw TypeError(c+": incorrect invocation!");return a}},{}],75:[function(a,b,c){var d=a(102);b.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},{102:102}],76:[function(a,b,c){var d=a(137),e=a(138),f=a(135);b.exports=function(a){return function(b,c,g){var h,i=d(b),j=e(i.length),k=f(g,j);if(a&&c!=c){for(;j>k;)if(h=i[k++],h!=h)return!0}else for(;j>k;k++)if((a||k in i)&&i[k]===c)return a||k||0;return!a&&-1}}},{135:135,137:137,138:138}],77:[function(a,b,c){var d=a(78),e=a(144)("toStringTag"),f="Arguments"==d(function(){return arguments}()),g=function(a,b){try{return a[b]}catch(a){}};b.exports=function(a){var b,c,h;return void 0===a?"Undefined":null===a?"Null":"string"==typeof(c=g(b=Object(a),e))?c:f?d(b):"Object"==(h=d(b))&&"function"==typeof b.callee?"Arguments":h}},{144:144,78:78}],78:[function(a,b,c){var d={}.toString;b.exports=function(a){return d.call(a).slice(8,-1)}},{}],79:[function(a,b,c){"use strict";var d=a(115).f,e=a(114),f=a(126),g=a(83),h=a(74),i=a(84),j=a(91),k=a(105),l=a(107),m=a(129),n=a(85),o=a(111).fastKey,p=n?"_s":"size",q=function(a,b){var c,d=o(b);if("F"!==d)return a._i[d];for(c=a._f;c;c=c.n)if(c.k==b)return c};b.exports={getConstructor:function(a,b,c,k){var l=a(function(a,d){h(a,l,b,"_i"),a._i=e(null),a._f=void 0,a._l=void 0,a[p]=0,void 0!=d&&j(d,c,a[k],a)});return f(l.prototype,{clear:function(){for(var a=this,b=a._i,c=a._f;c;c=c.n)c.r=!0,c.p&&(c.p=c.p.n=void 0),delete b[c.i];a._f=a._l=void 0,a[p]=0},delete:function(a){var b=this,c=q(b,a);if(c){var d=c.n,e=c.p;delete b._i[c.i],c.r=!0,e&&(e.n=d),d&&(d.p=e),b._f==c&&(b._f=d),b._l==c&&(b._l=e),b[p]--}return!!c},forEach:function(a){h(this,l,"forEach");for(var b,c=g(a,arguments.length>1?arguments[1]:void 0,3);b=b?b.n:this._f;)for(c(b.v,b.k,this);b&&b.r;)b=b.p},has:function(a){return!!q(this,a)}}),n&&d(l.prototype,"size",{get:function(){return i(this[p])}}),l},def:function(a,b,c){var d,e,f=q(a,b);return f?f.v=c:(a._l=f={i:e=o(b,!0),k:b,v:c,p:d=a._l,n:void 0,r:!1},a._f||(a._f=f),d&&(d.n=f),a[p]++,"F"!==e&&(a._i[e]=f)),a},getEntry:q,setStrong:function(a,b,c){k(a,b,function(a,b){this._t=a,this._k=b,this._l=void 0},function(){for(var a=this,b=a._k,c=a._l;c&&c.r;)c=c.p;return a._t&&(a._l=c=c?c.n:a._t._f)?"keys"==b?l(0,c.k):"values"==b?l(0,c.v):l(0,[c.k,c.v]):(a._t=void 0,l(1))},c?"entries":"values",!c,!0),m(b)}}},{105:105,107:107,111:111,114:114,115:115,126:126,129:129,74:74,83:83,84:84,85:85,91:91}],80:[function(a,b,c){"use strict";var d=a(92),e=a(89),f=a(127),g=a(126),h=a(111),i=a(91),j=a(74),k=a(102),l=a(90),m=a(106),n=a(130),o=a(97);b.exports=function(a,b,c,p,q,r){var s=d[a],t=s,u=q?"set":"add",v=t&&t.prototype,w={},x=function(a){var b=v[a];f(v,a,"delete"==a?function(a){return!(r&&!k(a))&&b.call(this,0===a?0:a)}:"has"==a?function(a){return!(r&&!k(a))&&b.call(this,0===a?0:a)}:"get"==a?function(a){return r&&!k(a)?void 0:b.call(this,0===a?0:a)}:"add"==a?function(a){return b.call(this,0===a?0:a),this}:function(a,c){return b.call(this,0===a?0:a,c),this})};if("function"==typeof t&&(r||v.forEach&&!l(function(){(new t).entries().next()}))){var y=new t,z=y[u](r?{}:-0,1)!=y,A=l(function(){y.has(1)}),B=m(function(a){new t(a)}),C=!r&&l(function(){for(var a=new t,b=5;b--;)a[u](b,b);return!a.has(-0)});B||(t=b(function(b,c){j(b,t,a);var d=o(new s,b,t);return void 0!=c&&i(c,q,d[u],d),d}),t.prototype=v,v.constructor=t),(A||C)&&(x("delete"),x("has"),q&&x("get")),(C||z)&&x(u),r&&v.clear&&delete v.clear}else t=p.getConstructor(b,a,q,u),g(t.prototype,c),h.NEED=!0;return n(t,a),w[a]=t,e(e.G+e.W+e.F*(t!=s),w),r||p.setStrong(t,a,q),t}},{102:102,106:106,111:111,126:126,127:127,130:130,74:74,89:89,90:90,91:91,92:92,97:97}],81:[function(a,b,c){var d=b.exports={version:"2.4.0"};"number"==typeof __e&&(__e=d)},{}],82:[function(a,b,c){"use strict";var d=a(115),e=a(125);b.exports=function(a,b,c){b in a?d.f(a,b,e(0,c)):a[b]=c}},{115:115,125:125}],83:[function(a,b,c){var d=a(72);b.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},{72:72}],84:[function(a,b,c){b.exports=function(a){if(void 0==a)throw TypeError("Can't call method on "+a);return a}},{}],85:[function(a,b,c){b.exports=!a(90)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{90:90}],86:[function(a,b,c){var d=a(102),e=a(92).document,f=d(e)&&d(e.createElement);b.exports=function(a){return f?e.createElement(a):{}}},{102:102,92:92}],87:[function(a,b,c){b.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],88:[function(a,b,c){var d=a(123),e=a(120),f=a(124);b.exports=function(a){var b=d(a),c=e.f;if(c)for(var g,h=c(a),i=f.f,j=0;h.length>j;)i.call(a,g=h[j++])&&b.push(g);return b}},{120:120,123:123,124:124}],89:[function(a,b,c){var d=a(92),e=a(81),f=a(94),g=a(127),h=a(83),i="prototype",j=function(a,b,c){var k,l,m,n,o=a&j.F,p=a&j.G,q=a&j.S,r=a&j.P,s=a&j.B,t=p?d:q?d[b]||(d[b]={}):(d[b]||{})[i],u=p?e:e[b]||(e[b]={}),v=u[i]||(u[i]={});p&&(c=b);for(k in c)l=!o&&t&&void 0!==t[k],m=(l?t:c)[k],n=s&&l?h(m,d):r&&"function"==typeof m?h(Function.call,m):m,t&&g(t,k,m,a&j.U),u[k]!=m&&f(u,k,n),r&&v[k]!=m&&(v[k]=m)};d.core=e,j.F=1,j.G=2,j.S=4,j.P=8,j.B=16,j.W=32,j.U=64,j.R=128,b.exports=j},{127:127,81:81,83:83,92:92,94:94}],90:[function(a,b,c){b.exports=function(a){try{return!!a()}catch(a){return!0}}},{}],91:[function(a,b,c){var d=a(83),e=a(103),f=a(100),g=a(75),h=a(138),i=a(145),j={},k={},c=b.exports=function(a,b,c,l,m){var n,o,p,q,r=m?function(){return a}:i(a),s=d(c,l,b?2:1),t=0;if("function"!=typeof r)throw TypeError(a+" is not iterable!");if(f(r)){for(n=h(a.length);n>t;t++)if(q=b?s(g(o=a[t])[0],o[1]):s(a[t]),q===j||q===k)return q}else for(p=r.call(a);!(o=p.next()).done;)if(q=e(p,s,o.value,b),q===j||q===k)return q};c.BREAK=j,c.RETURN=k},{100:100,103:103,138:138,145:145,75:75,83:83}],92:[function(a,b,c){var d=b.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=d)},{}],93:[function(a,b,c){var d={}.hasOwnProperty;b.exports=function(a,b){return d.call(a,b)}},{}],94:[function(a,b,c){var d=a(115),e=a(125);b.exports=a(85)?function(a,b,c){return d.f(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},{115:115,125:125,85:85}],95:[function(a,b,c){b.exports=a(92).document&&document.documentElement},{92:92}],96:[function(a,b,c){b.exports=!a(85)&&!a(90)(function(){return 7!=Object.defineProperty(a(86)("div"),"a",{get:function(){return 7}}).a})},{85:85,86:86,90:90}],97:[function(a,b,c){var d=a(102),e=a(128).set;b.exports=function(a,b,c){var f,g=b.constructor;return g!==c&&"function"==typeof g&&(f=g.prototype)!==c.prototype&&d(f)&&e&&e(a,f),a}},{102:102,128:128}],98:[function(a,b,c){b.exports=function(a,b,c){var d=void 0===c;switch(b.length){case 0:return d?a():a.call(c);case 1:return d?a(b[0]):a.call(c,b[0]);case 2:return d?a(b[0],b[1]):a.call(c,b[0],b[1]);case 3:return d?a(b[0],b[1],b[2]):a.call(c,b[0],b[1],b[2]);case 4:return d?a(b[0],b[1],b[2],b[3]):a.call(c,b[0],b[1],b[2],b[3])}return a.apply(c,b)}},{}],99:[function(a,b,c){var d=a(78);b.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},{78:78}],100:[function(a,b,c){var d=a(108),e=a(144)("iterator"),f=Array.prototype;b.exports=function(a){return void 0!==a&&(d.Array===a||f[e]===a)}},{108:108,144:144}],101:[function(a,b,c){var d=a(78);b.exports=Array.isArray||function(a){return"Array"==d(a)}},{78:78}],102:[function(a,b,c){b.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},{}],103:[function(a,b,c){var d=a(75);b.exports=function(a,b,c,e){try{return e?b(d(c)[0],c[1]):b(c)}catch(b){var f=a.return;throw void 0!==f&&d(f.call(a)),b}}},{75:75}],104:[function(a,b,c){"use strict";var d=a(114),e=a(125),f=a(130),g={};a(94)(g,a(144)("iterator"),function(){return this}),b.exports=function(a,b,c){a.prototype=d(g,{next:e(1,c)}),f(a,b+" Iterator")}},{114:114,125:125,130:130,144:144,94:94}],105:[function(a,b,c){"use strict";var d=a(110),e=a(89),f=a(127),g=a(94),h=a(93),i=a(108),j=a(104),k=a(130),l=a(121),m=a(144)("iterator"),n=!([].keys&&"next"in[].keys()),o="@@iterator",p="keys",q="values",r=function(){return this};b.exports=function(a,b,c,s,t,u,v){j(c,b,s);var w,x,y,z=function(a){if(!n&&a in D)return D[a];switch(a){case p:return function(){return new c(this,a)};case q:return function(){return new c(this,a)}}return function(){return new c(this,a)}},A=b+" Iterator",B=t==q,C=!1,D=a.prototype,E=D[m]||D[o]||t&&D[t],F=E||z(t),G=t?B?z("entries"):F:void 0,H="Array"==b?D.entries||E:E;if(H&&(y=l(H.call(new a)),y!==Object.prototype&&(k(y,A,!0),d||h(y,m)||g(y,m,r))),B&&E&&E.name!==q&&(C=!0,F=function(){return E.call(this)}),d&&!v||!n&&!C&&D[m]||g(D,m,F),i[b]=F,i[A]=r,t)if(w={values:B?F:z(q),keys:u?F:z(p),entries:G},v)for(x in w)x in D||f(D,x,w[x]);else e(e.P+e.F*(n||C),b,w);return w}},{104:104,108:108,110:110,121:121,127:127,130:130,144:144,89:89,93:93,94:94}],106:[function(a,b,c){var d=a(144)("iterator"),e=!1;try{var f=[7][d]();f.return=function(){e=!0},Array.from(f,function(){throw 2})}catch(a){}b.exports=function(a,b){if(!b&&!e)return!1;var c=!1;try{var f=[7],g=f[d]();g.next=function(){return{done:c=!0}},f[d]=function(){return g},a(f)}catch(a){}return c}},{144:144}],107:[function(a,b,c){b.exports=function(a,b){return{value:b,done:!!a}}},{}],108:[function(a,b,c){b.exports={}},{}],109:[function(a,b,c){var d=a(123),e=a(137);b.exports=function(a,b){for(var c,f=e(a),g=d(f),h=g.length,i=0;h>i;)if(f[c=g[i++]]===b)return c}},{123:123,137:137}],110:[function(a,b,c){b.exports=!1},{}],111:[function(a,b,c){var d=a(141)("meta"),e=a(102),f=a(93),g=a(115).f,h=0,i=Object.isExtensible||function(){return!0},j=!a(90)(function(){return i(Object.preventExtensions({}))}),k=function(a){g(a,d,{value:{i:"O"+ ++h,w:{}}})},l=function(a,b){if(!e(a))return"symbol"==typeof a?a:("string"==typeof a?"S":"P")+a;if(!f(a,d)){if(!i(a))return"F";if(!b)return"E";k(a)}return a[d].i},m=function(a,b){if(!f(a,d)){if(!i(a))return!0;if(!b)return!1;k(a)}return a[d].w},n=function(a){return j&&o.NEED&&i(a)&&!f(a,d)&&k(a),a},o=b.exports={KEY:d,NEED:!1,fastKey:l,getWeak:m,onFreeze:n}},{102:102,115:115,141:141,90:90,93:93}],112:[function(a,b,c){var d=a(92),e=a(134).set,f=d.MutationObserver||d.WebKitMutationObserver,g=d.process,h=d.Promise,i="process"==a(78)(g);b.exports=function(){var a,b,c,j=function(){var d,e;for(i&&(d=g.domain)&&d.exit();a;){e=a.fn,a=a.next;try{e()}catch(d){throw a?c():b=void 0,d}}b=void 0,d&&d.enter()};if(i)c=function(){g.nextTick(j)};else if(f){var k=!0,l=document.createTextNode("");new f(j).observe(l,{characterData:!0}),c=function(){l.data=k=!k}}else if(h&&h.resolve){var m=h.resolve();c=function(){m.then(j)}}else c=function(){e.call(d,j)};return function(d){var e={fn:d,next:void 0};b&&(b.next=e),a||(a=e,c()),b=e}}},{134:134,78:78,92:92}],113:[function(a,b,c){"use strict";var d=a(123),e=a(120),f=a(124),g=a(139),h=a(99),i=Object.assign;b.exports=!i||a(90)(function(){var a={},b={},c=Symbol(),d="abcdefghijklmnopqrst";return a[c]=7,d.split("").forEach(function(a){b[a]=a}),7!=i({},a)[c]||Object.keys(i({},b)).join("")!=d})?function(a,b){for(var c=g(a),i=arguments.length,j=1,k=e.f,l=f.f;i>j;)for(var m,n=h(arguments[j++]),o=k?d(n).concat(k(n)):d(n),p=o.length,q=0;p>q;)l.call(n,m=o[q++])&&(c[m]=n[m]);return c}:i},{120:120,123:123,124:124,139:139,90:90,99:99}],114:[function(a,b,c){var d=a(75),e=a(116),f=a(87),g=a(131)("IE_PROTO"),h=function(){},i="prototype",j=function(){var b,c=a(86)("iframe"),d=f.length,e="<",g=">";for(c.style.display="none",a(95).appendChild(c),c.src="javascript:",b=c.contentWindow.document,b.open(),b.write(e+"script"+g+"document.F=Object"+e+"/script"+g),b.close(),j=b.F;d--;)delete j[i][f[d]];return j()};b.exports=Object.create||function(a,b){var c;return null!==a?(h[i]=d(a),c=new h,h[i]=null,c[g]=a):c=j(),void 0===b?c:e(c,b)}},{116:116,131:131,75:75,86:86,87:87,95:95}],115:[function(a,b,c){var d=a(75),e=a(96),f=a(140),g=Object.defineProperty;c.f=a(85)?Object.defineProperty:function(a,b,c){if(d(a),b=f(b,!0),d(c),e)try{return g(a,b,c)}catch(a){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a}},{140:140,75:75,85:85,96:96}],116:[function(a,b,c){var d=a(115),e=a(75),f=a(123);b.exports=a(85)?Object.defineProperties:function(a,b){e(a);for(var c,g=f(b),h=g.length,i=0;h>i;)d.f(a,c=g[i++],b[c]);return a}},{115:115,123:123,75:75,85:85}],117:[function(a,b,c){var d=a(124),e=a(125),f=a(137),g=a(140),h=a(93),i=a(96),j=Object.getOwnPropertyDescriptor;c.f=a(85)?j:function(a,b){if(a=f(a),b=g(b,!0),i)try{return j(a,b)}catch(a){}if(h(a,b))return e(!d.f.call(a,b),a[b])}},{124:124,125:125,137:137,140:140,85:85,93:93,96:96}],118:[function(a,b,c){var d=a(137),e=a(119).f,f={}.toString,g="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return e(a)}catch(a){return g.slice()}};b.exports.f=function(a){return g&&"[object Window]"==f.call(a)?h(a):e(d(a))}},{119:119,137:137}],119:[function(a,b,c){var d=a(122),e=a(87).concat("length","prototype");c.f=Object.getOwnPropertyNames||function(a){return d(a,e)}},{122:122,87:87}],120:[function(a,b,c){c.f=Object.getOwnPropertySymbols},{}],121:[function(a,b,c){var d=a(93),e=a(139),f=a(131)("IE_PROTO"),g=Object.prototype;b.exports=Object.getPrototypeOf||function(a){return a=e(a),d(a,f)?a[f]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?g:null}},{131:131,139:139,93:93}],122:[function(a,b,c){var d=a(93),e=a(137),f=a(76)(!1),g=a(131)("IE_PROTO");b.exports=function(a,b){var c,h=e(a),i=0,j=[];for(c in h)c!=g&&d(h,c)&&j.push(c);for(;b.length>i;)d(h,c=b[i++])&&(~f(j,c)||j.push(c));return j}},{131:131,137:137,76:76,93:93}],123:[function(a,b,c){var d=a(122),e=a(87);b.exports=Object.keys||function(a){return d(a,e)}},{122:122,87:87}],124:[function(a,b,c){c.f={}.propertyIsEnumerable},{}], +125:[function(a,b,c){b.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},{}],126:[function(a,b,c){var d=a(127);b.exports=function(a,b,c){for(var e in b)d(a,e,b[e],c);return a}},{127:127}],127:[function(a,b,c){var d=a(92),e=a(94),f=a(93),g=a(141)("src"),h="toString",i=Function[h],j=(""+i).split(h);a(81).inspectSource=function(a){return i.call(a)},(b.exports=function(a,b,c,h){var i="function"==typeof c;i&&(f(c,"name")||e(c,"name",b)),a[b]!==c&&(i&&(f(c,g)||e(c,g,a[b]?""+a[b]:j.join(String(b)))),a===d?a[b]=c:h?a[b]?a[b]=c:e(a,b,c):(delete a[b],e(a,b,c)))})(Function.prototype,h,function(){return"function"==typeof this&&this[g]||i.call(this)})},{141:141,81:81,92:92,93:93,94:94}],128:[function(a,b,c){var d=a(102),e=a(75),f=function(a,b){if(e(a),!d(b)&&null!==b)throw TypeError(b+": can't set as prototype!")};b.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(b,c,d){try{d=a(83)(Function.call,a(117).f(Object.prototype,"__proto__").set,2),d(b,[]),c=!(b instanceof Array)}catch(a){c=!0}return function(a,b){return f(a,b),c?a.__proto__=b:d(a,b),a}}({},!1):void 0),check:f}},{102:102,117:117,75:75,83:83}],129:[function(a,b,c){"use strict";var d=a(92),e=a(115),f=a(85),g=a(144)("species");b.exports=function(a){var b=d[a];f&&b&&!b[g]&&e.f(b,g,{configurable:!0,get:function(){return this}})}},{115:115,144:144,85:85,92:92}],130:[function(a,b,c){var d=a(115).f,e=a(93),f=a(144)("toStringTag");b.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},{115:115,144:144,93:93}],131:[function(a,b,c){var d=a(132)("keys"),e=a(141);b.exports=function(a){return d[a]||(d[a]=e(a))}},{132:132,141:141}],132:[function(a,b,c){var d=a(92),e="__core-js_shared__",f=d[e]||(d[e]={});b.exports=function(a){return f[a]||(f[a]={})}},{92:92}],133:[function(a,b,c){var d=a(75),e=a(72),f=a(144)("species");b.exports=function(a,b){var c,g=d(a).constructor;return void 0===g||void 0==(c=d(g)[f])?b:e(c)}},{144:144,72:72,75:75}],134:[function(a,b,c){var d,e,f,g=a(83),h=a(98),i=a(95),j=a(86),k=a(92),l=k.process,m=k.setImmediate,n=k.clearImmediate,o=k.MessageChannel,p=0,q={},r="onreadystatechange",s=function(){var a=+this;if(q.hasOwnProperty(a)){var b=q[a];delete q[a],b()}},t=function(a){s.call(a.data)};m&&n||(m=function(a){for(var b=[],c=1;arguments.length>c;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function(a){delete q[a]},"process"==a(78)(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(e=new o,f=e.port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),b.exports={set:m,clear:n}},{78:78,83:83,86:86,92:92,95:95,98:98}],135:[function(a,b,c){var d=a(136),e=Math.max,f=Math.min;b.exports=function(a,b){return a=d(a),a<0?e(a+b,0):f(a,b)}},{136:136}],136:[function(a,b,c){var d=Math.ceil,e=Math.floor;b.exports=function(a){return isNaN(a=+a)?0:(a>0?e:d)(a)}},{}],137:[function(a,b,c){var d=a(99),e=a(84);b.exports=function(a){return d(e(a))}},{84:84,99:99}],138:[function(a,b,c){var d=a(136),e=Math.min;b.exports=function(a){return a>0?e(d(a),9007199254740991):0}},{136:136}],139:[function(a,b,c){var d=a(84);b.exports=function(a){return Object(d(a))}},{84:84}],140:[function(a,b,c){var d=a(102);b.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},{102:102}],141:[function(a,b,c){var d=0,e=Math.random();b.exports=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++d+e).toString(36))}},{}],142:[function(a,b,c){var d=a(92),e=a(81),f=a(110),g=a(143),h=a(115).f;b.exports=function(a){var b=e.Symbol||(e.Symbol=f?{}:d.Symbol||{});"_"==a.charAt(0)||a in b||h(b,a,{value:g.f(a)})}},{110:110,115:115,143:143,81:81,92:92}],143:[function(a,b,c){c.f=a(144)},{144:144}],144:[function(a,b,c){var d=a(132)("wks"),e=a(141),f=a(92).Symbol,g="function"==typeof f,h=b.exports=function(a){return d[a]||(d[a]=g&&f[a]||(g?f:e)("Symbol."+a))};h.store=d},{132:132,141:141,92:92}],145:[function(a,b,c){var d=a(77),e=a(144)("iterator"),f=a(108);b.exports=a(81).getIteratorMethod=function(a){if(void 0!=a)return a[e]||a["@@iterator"]||f[d(a)]}},{108:108,144:144,77:77,81:81}],146:[function(a,b,c){"use strict";var d=a(83),e=a(89),f=a(139),g=a(103),h=a(100),i=a(138),j=a(82),k=a(145);e(e.S+e.F*!a(106)(function(a){Array.from(a)}),"Array",{from:function(a){var b,c,e,l,m=f(a),n="function"==typeof this?this:Array,o=arguments.length,p=o>1?arguments[1]:void 0,q=void 0!==p,r=0,s=k(m);if(q&&(p=d(p,o>2?arguments[2]:void 0,2)),void 0==s||n==Array&&h(s))for(b=i(m.length),c=new n(b);b>r;r++)j(c,r,q?p(m[r],r):m[r]);else for(l=s.call(m),c=new n;!(e=l.next()).done;r++)j(c,r,q?g(l,p,[e.value,r],!0):e.value);return c.length=r,c}})},{100:100,103:103,106:106,138:138,139:139,145:145,82:82,83:83,89:89}],147:[function(a,b,c){"use strict";var d=a(73),e=a(107),f=a(108),g=a(137);b.exports=a(105)(Array,"Array",function(a,b){this._t=g(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,c=this._i++;return!a||c>=a.length?(this._t=void 0,e(1)):"keys"==b?e(0,c):"values"==b?e(0,a[c]):e(0,[c,a[c]])},"values"),f.Arguments=f.Array,d("keys"),d("values"),d("entries")},{105:105,107:107,108:108,137:137,73:73}],148:[function(a,b,c){"use strict";var d=a(79);b.exports=a(80)("Map",function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0)}},{get:function(a){var b=d.getEntry(this,a);return b&&b.v},set:function(a,b){return d.def(this,0===a?0:a,b)}},d,!0)},{79:79,80:80}],149:[function(a,b,c){var d=a(89);d(d.S+d.F,"Object",{assign:a(113)})},{113:113,89:89}],150:[function(a,b,c){var d=a(89);d(d.S,"Object",{setPrototypeOf:a(128).set})},{128:128,89:89}],151:[function(a,b,c){"use strict";var d,e,f,g=a(110),h=a(92),i=a(83),j=a(77),k=a(89),l=a(102),m=a(72),n=a(74),o=a(91),p=a(133),q=a(134).set,r=a(112)(),s="Promise",t=h.TypeError,u=h.process,v=h[s],u=h.process,w="process"==j(u),x=function(){},y=!!function(){try{var b=v.resolve(1),c=(b.constructor={})[a(144)("species")]=function(a){a(x,x)};return(w||"function"==typeof PromiseRejectionEvent)&&b.then(x)instanceof c}catch(a){}}(),z=function(a,b){return a===b||a===v&&b===f},A=function(a){var b;return!(!l(a)||"function"!=typeof(b=a.then))&&b},B=function(a){return z(v,a)?new C(a):new e(a)},C=e=function(a){var b,c;this.promise=new a(function(a,d){if(void 0!==b||void 0!==c)throw t("Bad Promise constructor");b=a,c=d}),this.resolve=m(b),this.reject=m(c)},D=function(a){try{a()}catch(a){return{error:a}}},E=function(a,b){if(!a._n){a._n=!0;var c=a._c;r(function(){for(var d=a._v,e=1==a._s,f=0,g=function(b){var c,f,g=e?b.ok:b.fail,h=b.resolve,i=b.reject,j=b.domain;try{g?(e||(2==a._h&&H(a),a._h=1),g===!0?c=d:(j&&j.enter(),c=g(d),j&&j.exit()),c===b.promise?i(t("Promise-chain cycle")):(f=A(c))?f.call(c,h,i):h(c)):i(d)}catch(a){i(a)}};c.length>f;)g(c[f++]);a._c=[],a._n=!1,b&&!a._h&&F(a)})}},F=function(a){q.call(h,function(){var b,c,d,e=a._v;if(G(a)&&(b=D(function(){w?u.emit("unhandledRejection",e,a):(c=h.onunhandledrejection)?c({promise:a,reason:e}):(d=h.console)&&d.error&&d.error("Unhandled promise rejection",e)}),a._h=w||G(a)?2:1),a._a=void 0,b)throw b.error})},G=function(a){if(1==a._h)return!1;for(var b,c=a._a||a._c,d=0;c.length>d;)if(b=c[d++],b.fail||!G(b.promise))return!1;return!0},H=function(a){q.call(h,function(){var b;w?u.emit("rejectionHandled",a):(b=h.onrejectionhandled)&&b({promise:a,reason:a._v})})},I=function(a){var b=this;b._d||(b._d=!0,b=b._w||b,b._v=a,b._s=2,b._a||(b._a=b._c.slice()),E(b,!0))},J=function(a){var b,c=this;if(!c._d){c._d=!0,c=c._w||c;try{if(c===a)throw t("Promise can't be resolved itself");(b=A(a))?r(function(){var d={_w:c,_d:!1};try{b.call(a,i(J,d,1),i(I,d,1))}catch(a){I.call(d,a)}}):(c._v=a,c._s=1,E(c,!1))}catch(a){I.call({_w:c,_d:!1},a)}}};y||(v=function(a){n(this,v,s,"_h"),m(a),d.call(this);try{a(i(J,this,1),i(I,this,1))}catch(a){I.call(this,a)}},d=function(a){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},d.prototype=a(126)(v.prototype,{then:function(a,b){var c=B(p(this,v));return c.ok="function"!=typeof a||a,c.fail="function"==typeof b&&b,c.domain=w?u.domain:void 0,this._c.push(c),this._a&&this._a.push(c),this._s&&E(this,!1),c.promise},catch:function(a){return this.then(void 0,a)}}),C=function(){var a=new d;this.promise=a,this.resolve=i(J,a,1),this.reject=i(I,a,1)}),k(k.G+k.W+k.F*!y,{Promise:v}),a(130)(v,s),a(129)(s),f=a(81)[s],k(k.S+k.F*!y,s,{reject:function(a){var b=B(this),c=b.reject;return c(a),b.promise}}),k(k.S+k.F*(g||!y),s,{resolve:function(a){if(a instanceof v&&z(a.constructor,this))return a;var b=B(this),c=b.resolve;return c(a),b.promise}}),k(k.S+k.F*!(y&&a(106)(function(a){v.all(a).catch(x)})),s,{all:function(a){var b=this,c=B(b),d=c.resolve,e=c.reject,f=D(function(){var c=[],f=0,g=1;o(a,!1,function(a){var h=f++,i=!1;c.push(void 0),g++,b.resolve(a).then(function(a){i||(i=!0,c[h]=a,--g||d(c))},e)}),--g||d(c)});return f&&e(f.error),c.promise},race:function(a){var b=this,c=B(b),d=c.reject,e=D(function(){o(a,!1,function(a){b.resolve(a).then(c.resolve,d)})});return e&&d(e.error),c.promise}})},{102:102,106:106,110:110,112:112,126:126,129:129,130:130,133:133,134:134,144:144,72:72,74:74,77:77,81:81,83:83,89:89,91:91,92:92}],152:[function(a,b,c){"use strict";var d=a(79);b.exports=a(80)("Set",function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0)}},{add:function(a){return d.def(this,a=0===a?0:a,a)}},d)},{79:79,80:80}],153:[function(a,b,c){"use strict";var d=a(92),e=a(93),f=a(85),g=a(89),h=a(127),i=a(111).KEY,j=a(90),k=a(132),l=a(130),m=a(141),n=a(144),o=a(143),p=a(142),q=a(109),r=a(88),s=a(101),t=a(75),u=a(137),v=a(140),w=a(125),x=a(114),y=a(118),z=a(117),A=a(115),B=a(123),C=z.f,D=A.f,E=y.f,F=d.Symbol,G=d.JSON,H=G&&G.stringify,I="prototype",J=n("_hidden"),K=n("toPrimitive"),L={}.propertyIsEnumerable,M=k("symbol-registry"),N=k("symbols"),O=k("op-symbols"),P=Object[I],Q="function"==typeof F,R=d.QObject,S=!R||!R[I]||!R[I].findChild,T=f&&j(function(){return 7!=x(D({},"a",{get:function(){return D(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=C(P,b);d&&delete P[b],D(a,b,c),d&&a!==P&&D(P,b,d)}:D,U=function(a){var b=N[a]=x(F[I]);return b._k=a,b},V=Q&&"symbol"==typeof F.iterator?function(a){return"symbol"==typeof a}:function(a){return a instanceof F},W=function(a,b,c){return a===P&&W(O,b,c),t(a),b=v(b,!0),t(c),e(N,b)?(c.enumerable?(e(a,J)&&a[J][b]&&(a[J][b]=!1),c=x(c,{enumerable:w(0,!1)})):(e(a,J)||D(a,J,w(1,{})),a[J][b]=!0),T(a,b,c)):D(a,b,c)},X=function(a,b){t(a);for(var c,d=r(b=u(b)),e=0,f=d.length;f>e;)W(a,c=d[e++],b[c]);return a},Y=function(a,b){return void 0===b?x(a):X(x(a),b)},Z=function(a){var b=L.call(this,a=v(a,!0));return!(this===P&&e(N,a)&&!e(O,a))&&(!(b||!e(this,a)||!e(N,a)||e(this,J)&&this[J][a])||b)},$=function(a,b){if(a=u(a),b=v(b,!0),a!==P||!e(N,b)||e(O,b)){var c=C(a,b);return!c||!e(N,b)||e(a,J)&&a[J][b]||(c.enumerable=!0),c}},_=function(a){for(var b,c=E(u(a)),d=[],f=0;c.length>f;)e(N,b=c[f++])||b==J||b==i||d.push(b);return d},aa=function(a){for(var b,c=a===P,d=E(c?O:u(a)),f=[],g=0;d.length>g;)!e(N,b=d[g++])||c&&!e(P,b)||f.push(N[b]);return f};Q||(F=function(){if(this instanceof F)throw TypeError("Symbol is not a constructor!");var a=m(arguments.length>0?arguments[0]:void 0),b=function(c){this===P&&b.call(O,c),e(this,J)&&e(this[J],a)&&(this[J][a]=!1),T(this,a,w(1,c))};return f&&S&&T(P,a,{configurable:!0,set:b}),U(a)},h(F[I],"toString",function(){return this._k}),z.f=$,A.f=W,a(119).f=y.f=_,a(124).f=Z,a(120).f=aa,f&&!a(110)&&h(P,"propertyIsEnumerable",Z,!0),o.f=function(a){return U(n(a))}),g(g.G+g.W+g.F*!Q,{Symbol:F});for(var ba="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ca=0;ba.length>ca;)n(ba[ca++]);for(var ba=B(n.store),ca=0;ba.length>ca;)p(ba[ca++]);g(g.S+g.F*!Q,"Symbol",{for:function(a){return e(M,a+="")?M[a]:M[a]=F(a)},keyFor:function(a){if(V(a))return q(M,a);throw TypeError(a+" is not a symbol!")},useSetter:function(){S=!0},useSimple:function(){S=!1}}),g(g.S+g.F*!Q,"Object",{create:Y,defineProperty:W,defineProperties:X,getOwnPropertyDescriptor:$,getOwnPropertyNames:_,getOwnPropertySymbols:aa}),G&&g(g.S+g.F*(!Q||j(function(){var a=F();return"[null]"!=H([a])||"{}"!=H({a:a})||"{}"!=H(Object(a))})),"JSON",{stringify:function(a){if(void 0!==a&&!V(a)){for(var b,c,d=[a],e=1;arguments.length>e;)d.push(arguments[e++]);return b=d[1],"function"==typeof b&&(c=b),!c&&s(b)||(b=function(a,b){if(c&&(b=c.call(this,a,b)),!V(b))return b}),d[1]=b,H.apply(G,d)}}}),F[I][K]||a(94)(F[I],K,F[I].valueOf),l(F,"Symbol"),l(Math,"Math",!0),l(d.JSON,"JSON",!0)},{101:101,109:109,110:110,111:111,114:114,115:115,117:117,118:118,119:119,120:120,123:123,124:124,125:125,127:127,130:130,132:132,137:137,140:140,141:141,142:142,143:143,144:144,75:75,85:85,88:88,89:89,90:90,92:92,93:93,94:94}],154:[function(a,b,c){"use strict";var d=a(89),e=a(92),f=a(81),g=a(112)(),h=a(144)("observable"),i=a(72),j=a(75),k=a(74),l=a(126),m=a(94),n=a(91),o=n.RETURN,p=function(a){return null==a?void 0:i(a)},q=function(a){var b=a._c;b&&(a._c=void 0,b())},r=function(a){return void 0===a._o},s=function(a){r(a)||(a._o=void 0,q(a))},t=function(a,b){j(a),this._c=void 0,this._o=a,a=new u(this);try{var c=b(a),d=c;null!=c&&("function"==typeof c.unsubscribe?c=function(){d.unsubscribe()}:i(c),this._c=c)}catch(b){return void a.error(b)}r(this)&&q(this)};t.prototype=l({},{unsubscribe:function(){s(this)}});var u=function(a){this._s=a};u.prototype=l({},{next:function(a){var b=this._s;if(!r(b)){var c=b._o;try{var d=p(c.next);if(d)return d.call(c,a)}catch(a){try{s(b)}finally{throw a}}}},error:function(a){var b=this._s;if(r(b))throw a;var c=b._o;b._o=void 0;try{var d=p(c.error);if(!d)throw a;a=d.call(c,a)}catch(a){try{q(b)}finally{throw a}}return q(b),a},complete:function(a){var b=this._s;if(!r(b)){var c=b._o;b._o=void 0;try{var d=p(c.complete);a=d?d.call(c,a):void 0}catch(a){try{q(b)}finally{throw a}}return q(b),a}}});var v=function(a){k(this,v,"Observable","_f")._f=i(a)};l(v.prototype,{subscribe:function(a){return new t(a,this._f)},forEach:function(a){var b=this;return new(f.Promise||e.Promise)(function(c,d){i(a);var e=b.subscribe({next:function(b){try{return a(b)}catch(a){d(a),e.unsubscribe()}},error:d,complete:c})})}}),l(v,{from:function(a){var b="function"==typeof this?this:v,c=p(j(a)[h]);if(c){var d=j(c.call(a));return d.constructor===b?d:new b(function(a){return d.subscribe(a)})}return new b(function(b){var c=!1;return g(function(){if(!c){try{if(n(a,!1,function(a){if(b.next(a),c)return o})===o)return}catch(a){if(c)throw a;return void b.error(a)}b.complete()}}),function(){c=!0}})},of:function(){for(var a=0,b=arguments.length,c=Array(b);a>>2]>>>24-f%4*8&255;b[d+f>>>2]|=g<<24-(d+f)%4*8}else for(var f=0;f>>2]=c[f>>>2];return this.sigBytes+=e,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-c%4*8,b.length=a.ceil(c/4)},clone:function(){var a=f.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c,d=[],e=function(b){var b=b,c=987654321,d=4294967295;return function(){c=36969*(65535&c)+(c>>16)&d,b=18e3*(65535&b)+(b>>16)&d;var e=(c<<16)+b&d;return e/=4294967296,e+=.5,e*(a.random()>.5?1:-1)}},f=0;f>>2]>>>24-e%4*8&255;d.push((f>>>4).toString(16)),d.push((15&f).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new g.init(c,b/2)}},j=h.Latin1={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;e>>2]>>>24-e%4*8&255;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(255&a.charCodeAt(d))<<24-d%4*8;return new g.init(c,b)}},k=h.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(a){throw new Error("Malformed UTF-8 data")}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},l=e.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,f=this.blockSize,h=4*f,i=e/h;i=b?a.ceil(i):a.max((0|i)-this._minBufferSize,0);var j=i*f,k=a.min(4*j,e);if(j){for(var l=0;ld&&(b=a.finalize(b)),b.clamp();for(var e=this._oKey=b.clone(),g=this._iKey=b.clone(),h=e.words,i=g.words,j=0;j>>31}var l=(d<<5|d>>>27)+i+g[j];l+=j<20?(e&f|~e&h)+1518500249:j<40?(e^f^h)+1859775393:j<60?(e&f|e&h|f&h)-1894007588:(e^f^h)-899497514,i=h,h=f,f=e<<30|e>>>2,e=d,d=l}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a}});b.SHA1=e._createHelper(h),b.HmacSHA1=e._createHmacHelper(h)}(),a.SHA1})},{156:156}],160:[function(b,c,d){!function(d){"use strict";function e(){var a=d.crypto||d.msCrypto;if(!k&&a&&a.getRandomValues)try{var b=new Uint8Array(16);n=k=function(){return a.getRandomValues(b),b},k()}catch(a){}if(!k){var c=new Array(16);l=k=function(){for(var a,b=0;b<16;b++)0===(3&b)&&(a=4294967296*Math.random()),c[b]=a>>>((3&b)<<3)&255;return c},"undefined"!=typeof console&&console.warn&&console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()")}}function f(){if("function"==typeof b)try{var a=b("crypto").randomBytes;m=k=a&&function(){return a(16)},k()}catch(a){}}function g(a,b,c){var d=b&&c||0,e=0;for(b=b||[],a.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){e<16&&(b[d+e++]=r[a])});e<16;)b[d+e++]=0;return b}function h(a,b){var c=b||0,d=q;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function i(a,b,c){var d=b&&c||0,e=b||[];a=a||{};var f=null!=a.clockseq?a.clockseq:v,g=null!=a.msecs?a.msecs:(new Date).getTime(),i=null!=a.nsecs?a.nsecs:x+1,j=g-w+(i-x)/1e4;if(j<0&&null==a.clockseq&&(f=f+1&16383),(j<0||g>w)&&null==a.nsecs&&(i=0),i>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");w=g,x=i,v=f,g+=122192928e5;var k=(1e4*(268435455&g)+i)%4294967296;e[d++]=k>>>24&255,e[d++]=k>>>16&255,e[d++]=k>>>8&255,e[d++]=255&k;var l=g/4294967296*1e4&268435455;e[d++]=l>>>8&255,e[d++]=255&l,e[d++]=l>>>24&15|16,e[d++]=l>>>16&255,e[d++]=f>>>8|128,e[d++]=255&f;for(var m=a.node||u,n=0;n<6;n++)e[d+n]=m[n];return b?b:h(e)}function j(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"===a?new p(16):null,a=null),a=a||{};var e=a.random||(a.rng||k)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,b)for(var f=0;f<16;f++)b[d+f]=e[f];return b||h(e)}var k,l,m,n,o;d?e():f();for(var p="function"==typeof Buffer?Buffer:Array,q=[],r={},s=0;s<256;s++)q[s]=(s+256).toString(16).substr(1),r[q[s]]=s;var t=k(),u=[1|t[0],t[1],t[2],t[3],t[4],t[5]],v=16383&(t[6]<<8|t[7]),w=0,x=0,y=j;y.v1=i,y.v4=j,y.parse=g,y.unparse=h,y.BufferClass=p,y._rng=k,y._mathRNG=l,y._nodeRNG=m,y._whatwgRNG=n,"undefined"!=typeof c&&c.exports?c.exports=y:"function"==typeof a&&a.amd?a(function(){return y}):(o=d.uuid,y.noConflict=function(){return d.uuid=o,y},d.uuid=y)}("undefined"!=typeof window?window:null)},{undefined:void 0}],161:[function(a,b,c){"use strict";function d(a){function b(a){}if(!a)throw new TypeError("argument namespace is required");return b._file=void 0,b._ignored=!0,b._namespace=a,b._traced=!1,b._warned=Object.create(null),b.function=e,b.property=f,b}function e(a,b){if("function"!=typeof a)throw new TypeError("argument fn must be a function");return a}function f(a,b,c){if(!a||"object"!=typeof a&&"function"!=typeof a)throw new TypeError("argument obj must be object");var d=Object.getOwnPropertyDescriptor(a,b);if(!d)throw new TypeError("must call property on owner object");if(!d.configurable)throw new TypeError("property must be configurable")}b.exports=d},{}],162:[function(b,c,d){!function(b,e){"undefined"!=typeof d&&"undefined"!=typeof c?c.exports=e():"function"==typeof a&&"object"==typeof a.amd?a(e):"function"==typeof a&&"object"==typeof a.petal?a(b,[],e):this[b]=e()}("validator",function(a){"use strict";function d(a){var b,c,d,e,f=a.match(L);if(f){if(b=f[21],!b)return f[12]?null:0;if("z"===b||"Z"===b)return 0;c=f[22],b.indexOf(":")!==-1?(d=parseInt(f[23]),e=parseInt(f[24])):(d=0,e=parseInt(f[23]))}else{if(a=a.toLowerCase(),b=a.match(/(?:\s|gmt\s*)(-|\+)(\d{1,4})(\s|$)/),!b)return a.indexOf("gmt")!==-1?0:null;c=b[1];var g=b[2];3===g.length&&(g="0"+g),g.length<=2?(d=0,e=parseInt(g)):(d=parseInt(g.slice(0,2)),e=parseInt(g.slice(2,4)))}return(60*d+e)*("-"===c?1:-1)}function e(a,b){a=a||{};for(var c in b)"undefined"==typeof a[c]&&(a[c]=b[c]);return a}function f(a){var b="(\\"+a.symbol.replace(/\./g,"\\.")+")"+(a.require_symbol?"":"?"),c="-?",d="[1-9]\\d*",e="[1-9]\\d{0,2}(\\"+a.thousands_separator+"\\d{3})*",f=["0",d,e],g="("+f.join("|")+")?",h="(\\"+a.decimal_separator+"\\d{2})?",i=g+h;return a.allow_negatives&&!a.parens_for_negatives&&(a.negative_sign_after_digits?i+=c:a.negative_sign_before_digits&&(i=c+i)),a.allow_negative_sign_placeholder?i="( (?!\\-))?"+i:a.allow_space_after_symbol?i=" ?"+i:a.allow_space_after_digits&&(i+="( (?!$))?"),a.symbol_after_digits?i+=b:i=b+i,a.allow_negatives&&(a.parens_for_negatives?i="(\\("+i+"\\)|"+i+")":a.negative_sign_before_digits||a.negative_sign_after_digits||(i=c+i)),new RegExp("^(?!-? )(?=.*\\d)"+i+"$")}a={version:"4.9.0",coerce:!0};for(var g,h=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,i=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,j=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,k=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,l=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i,m=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,n=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/,o=/^(?:[0-9]{9}X|[0-9]{10})$/,p=/^(?:[0-9]{13})$/,q=/^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/,r=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,s=/^[0-9A-F]{1,4}$/i,t={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i},u={"en-US":/^[A-Z]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"nl-NL":/^[A-ZÉËÏÓÖÜ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,"ru-RU":/^[А-ЯЁа-яё]+$/i},v={"en-US":/^[0-9A-Z]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"nl-NL":/^[0-9A-ZÉËÏÓÖÜ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁа-яё]+$/i},w=["AU","GB","HK","IN","NZ","ZA","ZM"],x=0;x=0},a.matches=function(a,b,c){return"[object RegExp]"!==Object.prototype.toString.call(b)&&(b=new RegExp(b,c)),b.test(a)};var N={allow_display_name:!1,allow_utf8_local_part:!0,require_tld:!0};a.isEmail=function(b,c){if(c=e(c,N),c.allow_display_name){var d=b.match(l);d&&(b=d[1])}var f=b.split("@"),g=f.pop(),m=f.join("@"),n=g.toLowerCase();if("gmail.com"!==n&&"googlemail.com"!==n||(m=m.replace(/\./g,"").toLowerCase()),!a.isByteLength(m,{max:64})||!a.isByteLength(g,{max:256}))return!1;if(!a.isFQDN(g,{require_tld:c.require_tld}))return!1;if('"'===m[0])return m=m.slice(1,m.length-1),c.allow_utf8_local_part?k.test(m):i.test(m);for(var o=c.allow_utf8_local_part?j:h,p=m.split("."),q=0;q=2083||/\s/.test(b))return!1;if(0===b.indexOf("mailto:"))return!1;c=e(c,O);var d,f,g,h,i,j,k;if(k=b.split("://"),k.length>1){if(d=k.shift(),c.require_valid_protocol&&c.protocols.indexOf(d)===-1)return!1}else{if(c.require_protocol)return!1;c.allow_protocol_relative_urls&&"//"===b.substr(0,2)&&(k[0]=b.substr(2)); +}return b=k.join("://"),k=b.split("#"),b=k.shift(),k=b.split("?"),b=k.shift(),k=b.split("/"),b=k.shift(),k=b.split("@"),!(k.length>1&&(f=k.shift(),f.indexOf(":")>=0&&f.split(":").length>2))&&(h=k.join("@"),k=h.split(":"),g=k.shift(),!(k.length&&(j=k.join(":"),i=parseInt(j,10),!/^[0-9]+$/.test(j)||i<=0||i>65535))&&(!(!a.isIP(g)&&!a.isFQDN(g,c)&&"localhost"!==g)&&((!c.host_whitelist||c.host_whitelist.indexOf(g)!==-1)&&(!c.host_blacklist||c.host_blacklist.indexOf(g)===-1))))},a.isMACAddress=function(a){return q.test(a)},a.isIP=function(b,c){if(c=c?c+"":"",!c)return a.isIP(b,4)||a.isIP(b,6);if("4"===c){if(!r.test(b))return!1;var d=b.split(".").sort(function(a,b){return a-b});return d[3]<=255}if("6"===c){var e=b.split(":"),f=!1,g=a.isIP(e[e.length-1],4),h=g?7:8;if(e.length>h)return!1;if("::"===b)return!0;"::"===b.substr(0,2)?(e.shift(),e.shift(),f=!0):"::"===b.substr(b.length-2)&&(e.pop(),e.pop(),f=!0);for(var i=0;i0&&i=1:e.length===h}return!1};var P={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1};a.isFQDN=function(a,b){b=e(b,P),b.allow_trailing_dot&&"."===a[a.length-1]&&(a=a.substring(0,a.length-1));var c=a.split(".");if(b.require_tld){var d=c.pop();if(!c.length||!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(d))return!1}for(var f,g=0;g=0)return!1;f=f.replace(/_/g,"")}if(!/^[a-z\u00a1-\uffff0-9-]+$/i.test(f))return!1;if(/[\uff01-\uff5e]/.test(f))return!1;if("-"===f[0]||"-"===f[f.length-1])return!1}return!0},a.isBoolean=function(a){return["true","false","1","0"].indexOf(a)>=0},a.isAlpha=function(a,b){if(b=b||"en-US",b in u)return u[b].test(a);throw new Error("Invalid locale '"+b+"'")},a.isAlphanumeric=function(a,b){if(b=b||"en-US",b in v)return v[b].test(a);throw new Error("Invalid locale '"+b+"'")},a.isNumeric=function(a){return y.test(a)},a.isDecimal=function(a){return""!==a&&C.test(a)},a.isHexadecimal=function(a){return B.test(a)},a.isHexColor=function(a){return D.test(a)},a.isLowercase=function(a){return a===a.toLowerCase()},a.isUppercase=function(a){return a===a.toUpperCase()},a.isInt=function(a,b){return b=b||{},z.test(a)&&(!b.hasOwnProperty("min")||a>=b.min)&&(!b.hasOwnProperty("max")||a<=b.max)},a.isFloat=function(a,b){return b=b||{},""!==a&&"."!==a&&(A.test(a)&&(!b.hasOwnProperty("min")||a>=b.min)&&(!b.hasOwnProperty("max")||a<=b.max))},a.isDivisibleBy=function(b,c){return a.toFloat(b)%parseInt(c,10)===0},a.isNull=function(a){return 0===a.length},a.isLength=function(a,b){var c,d;"object"==typeof b?(c=b.min||0,d=b.max):(c=arguments[1],d=arguments[2]);var e=a.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],f=a.length-e.length;return f>=c&&("undefined"==typeof d||f<=d)},a.isByteLength=function(a,b){var c,d;"object"==typeof b?(c=b.min||0,d=b.max):(c=arguments[1],d=arguments[2]);var e=encodeURI(a).split(/%..|./).length-1;return e>=c&&("undefined"==typeof d||e<=d)},a.isUUID=function(a,b){var c=t[b?b:"all"];return c&&c.test(a)},a.isDate=function(a){var b=new Date(Date.parse(a));if(isNaN(b))return!1;var c=d(a);if(null!==c){var e=b.getTimezoneOffset()-c;b=new Date(b.getTime()+6e4*e)}var f,g,h,i=String(b.getDate());return!(g=a.match(/(^|[^:\d])[23]\d([^:\d]|$)/g))||(f=g.map(function(a){return a.match(/\d+/g)[0]}).join("/"),h=String(b.getFullYear()).slice(-2),f===i||f===h||(f===i+"/"+h||f===h+"/"+i))},a.isAfter=function(b,c){var d=a.toDate(c||new Date),e=a.toDate(b);return!!(e&&d&&e>d)},a.isBefore=function(b,c){var d=a.toDate(c||new Date),e=a.toDate(b);return!!(e&&d&&e=0}return"object"==typeof c?c.hasOwnProperty(b):!(!c||"function"!=typeof c.indexOf)&&c.indexOf(b)>=0},a.isWhitelisted=function(a,b){for(var c=a.length-1;c>=0;c--)if(b.indexOf(a[c])===-1)return!1;return!0},a.isCreditCard=function(a){var b=a.replace(/[^0-9]+/g,"");if(!m.test(b))return!1;for(var c,d,e,f=0,g=b.length-1;g>=0;g--)c=b.substring(g,g+1),d=parseInt(c,10),e?(d*=2,f+=d>=10?d%10+1:d):f+=d,e=!e;return!(f%10!==0||!b)},a.isISIN=function(a){if(!n.test(a))return!1;for(var b,c,d=a.replace(/[A-Z]/g,function(a){return parseInt(a,36)}),e=0,f=!0,g=d.length-2;g>=0;g--)b=d.substring(g,g+1),c=parseInt(b,10),f?(c*=2,e+=c>=10?c+1:c):e+=c,f=!f;return parseInt(a.substr(a.length-1),10)===(1e4-e)%10},a.isISBN=function(b,c){if(c=c?c+"":"",!c)return a.isISBN(b,10)||a.isISBN(b,13);var d,e=b.replace(/[\s-]+/g,""),f=0;if("10"===c){if(!o.test(e))return!1;for(d=0;d<9;d++)f+=(d+1)*e.charAt(d);if(f+="X"===e.charAt(9)?100:10*e.charAt(9),f%11===0)return!!e}else if("13"===c){if(!p.test(e))return!1;var g=[1,3];for(d=0;d<12;d++)f+=g[d%2]*e.charAt(d);if(e.charAt(12)-(10-f%10)%10===0)return!!e}return!1},a.isMobilePhone=function(a,b){return b in K&&K[b].test(a)};var Q={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_space_after_digits:!1};a.isCurrency=function(a,b){return b=e(b,Q),f(b).test(a)},a.isJSON=function(a){try{var b=JSON.parse(a);return!!b&&"object"==typeof b}catch(a){}return!1},a.isMultibyte=function(a){return F.test(a)},a.isAscii=function(a){return E.test(a)},a.isFullWidth=function(a){return G.test(a)},a.isHalfWidth=function(a){return H.test(a)},a.isVariableWidth=function(a){return G.test(a)&&H.test(a)},a.isSurrogatePair=function(a){return I.test(a)},a.isBase64=function(a){return J.test(a)},a.isMongoId=function(b){return a.isHexadecimal(b)&&24===b.length},a.isISO8601=function(a){return L.test(a)},a.ltrim=function(a,b){var c=b?new RegExp("^["+b+"]+","g"):/^\s+/g;return a.replace(c,"")},a.rtrim=function(a,b){var c=b?new RegExp("["+b+"]+$","g"):/\s+$/g;return a.replace(c,"")},a.trim=function(a,b){var c=b?new RegExp("^["+b+"]+|["+b+"]+$","g"):/^\s+|\s+$/g;return a.replace(c,"")},a.escape=function(a){return a.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\//g,"/").replace(/\`/g,"`")},a.stripLow=function(b,c){var d=c?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return a.blacklist(b,d)},a.whitelist=function(a,b){return a.replace(new RegExp("[^"+b+"]+","g"),"")},a.blacklist=function(a,b){return a.replace(new RegExp("["+b+"]+","g"),"")};var R={lowercase:!0,remove_dots:!0,remove_extension:!0};return a.normalizeEmail=function(b,c){if(c=e(c,R),!a.isEmail(b))return!1;var d=b.split("@",2);if(d[1]=d[1].toLowerCase(),"gmail.com"===d[1]||"googlemail.com"===d[1]){if(c.remove_extension&&(d[0]=d[0].split("+")[0]),c.remove_dots&&(d[0]=d[0].replace(/\./g,"")),!d[0].length)return!1;d[0]=d[0].toLowerCase(),d[1]="gmail.com"}else c.lowercase&&(d[0]=d[0].toLowerCase());return d.join("@")},a.init(),a})},{161:161}],163:[function(a,b,c){"use strict";a(152),a(148),Object.assign||a(149),Object.setPrototypeOf||a(150),"undefined"==typeof Promise&&a(151),Array.from||(a(146),a(147)),"undefined"==typeof Symbol&&a(153)},{146:146,147:147,148:148,149:149,150:150,151:151,152:152,153:153}],164:[function(a,c,d){"use strict";var e=(a(23),a(36)),f=a(165).WebSocket,g=function(){function a(c){b.classCallCheck(this,a),this.host=c.host,this.port=c.port,this.secure=c.secure,this.basePath=c.basePath,this.connector=c,this.listeners={}}return a.create=function(b){if(!b)throw new Error("No connector was provided, but connector is required for websocket connection!");var c=this.websockets[b.origin];return c||(c=new a(b),this.websockets[b.origin]=c),c},a.prototype.subscribe=function(a,b){a=Object(a)instanceof String?a:JSON.stringify(a),this.listeners[a]?this.listeners[a].indexOf(b)==-1&&this.listeners[a].push(b):this.listeners[a]=[b]},a.prototype.unsubscribe=function(a,b){if(a=Object(a)instanceof String?a:JSON.stringify(a),this.listeners[a]){var c=this.listeners[a].indexOf(b);c!=-1&&this.listeners[a].splice(c,1)}},a.prototype.socketListener=function(a){var b=JSON.parse(a.data),c=b.topic;c=Object(c)instanceof String?c:JSON.stringify(c),this.listeners[c]&&this.listeners[c].forEach(function(a){a(b)})},a.prototype.sendOverSocket=function(a){var b=this;this.socketOpen||(this.socketOpen=new Promise(function(a,c){b.connector.send(new e.EventsUrl).then(function(a){return a.entity.urls},function(){return null}).then(function(d){var e=void 0;d?!function(){var a=b.secure?"wss://":"ws://";d=d.filter(function(b){return 0==b.indexOf(a)});var c=d.length;e=d[Math.floor(Math.random()*c)]}():e=(b.secure?"wss://":"ws://")+b.host+":"+b.port+b.basePath+"/events",b.socket=b.createWebSocket(e),b.socket.onmessage=b.socketListener.bind(b),b.socket.onopen=a,b.socket.onerror=c,b.socket.onclose=function(){b.socket=null,b.socketOpen=null}}).catch(c)})),this.socketOpen.then(function(){var c=JSON.stringify(a);b.socket.send(c)})},a.prototype.createWebSocket=function(a){return new f(a)},a}();Object.assign(g,{websockets:{}}),c.exports=g},{165:165,23:23,36:36}],165:[function(a,b,c){"use strict";c.WebSocket=window.WebSocket},{}],166:[function(a,b,c){"use strict";var d=a(35);b.exports=c=d,c.Observable=a(167),c.connector.WebSocketConnector=a(164),c.query.Node=a(168),c.query.Stream=a(169)},{164:164,167:167,168:168,169:169,35:35}],167:[function(a,b,c){"use strict";if("undefined"!=typeof Rx)b.exports=Rx.Observable;else try{b.exports=a("rxjs/Observable").Observable}catch(c){if("undefined"==typeof Observable){a(155),a(154);var d=Observable.prototype.subscribe;Observable.prototype.subscribe=function(a,b,c){return a instanceof Function?d.call(this,{next:a,error:b,complete:c}):d.call(this,a)}}b.exports=Observable}},{154:154,155:155,undefined:void 0}],168:[function(a,b,c){"use strict";var d=a(169),e=a(56);e.prototype._stream=function(a,b){var c=this.resultClass?this.entityManager.metamodel.entity(this.resultClass):null;if(!c)throw new Error("Only typed queries can be executed.");return b||(b=this),new d(this.entityManager,c.name,this._serializeQuery(),a,this._serializeSort(),this.maxResults,this.firstResult,b).observable()},b.exports=e},{169:169,56:56}],169:[function(a,c,d){"use strict";var e=a(63),f=a(164),g=a(35),h=function(){function a(c,d,e,g,h,i,j,k){b.classCallCheck(this,a);var l=a.parseOptions(g);this.entityManager=c,this.query={bucket:d,matchTypes:l.matchTypes,operations:l.operations,initial:l.initial,query:e,sort:h,start:j,count:i},this.callbacks=[],this.topic=a.getTopic(this.query.bucket,this.query.query,this.query.start,this.query.count,this.query.sort,this.query.matchTypes,this.query.operations),this.target=k,this.socket=f.create(c._connector)}return a.prototype.observable=function(){var a=this;return new g.Observable(function(b){var c=function(a){a.errorMessage?b.error(a):b.next(a)};return a.on(a.query.matchTypes,c),function(){a.off(a.query.matchTypes,c)}})},a.prototype.on=function(a,b){var c=this._wrapQueryCallback(b);this.socket.subscribe(this.topic,c);var d={register:!0,topic:this.topic,query:this.query};this.query.initial===!0&&(d.fromstart=!0),this.socket.sendOverSocket(d),this.callbacks.push({matchTypes:a,callback:b,topic:this.topic,wrappedCallback:c,queryMessage:d})},a.prototype.off=function(a,b){var c=this;this.callbacks=this.callbacks.reduce(function(d,e){return b&&e.callback!=b||a&&e.matchTypes!=a?d.push(e):(c.socket.unsubscribe(e.topic,e.wrappedCallback),e.queryMessage.register=!1,c.socket.sendOverSocket(e.queryMessage)),d},[])},a.getCachableQueryString=function(b,c,d,e){var f=b;return a.isEmptyJSONString(b)&&(f="{}"),c>0&&(f+="&start="+c),d>0&&(f+="&count="+d),a.isEmptyJSONString(e)||(f+="&sort="+e),f},a.getTopic=function(b,c,d,e,f,g,h){return[b,a.getCachableQueryString(c,d,e,f),a.normalizeMatchTypes(g).join("_"),a.normalizeOperations(h).join("_")].join("/")},a.isEmptyJSONString=function(a){return void 0===a||null===a||/^\s*(\{\s*\})?\s*$/.test(a)},a.parseOptions=function(b){var c={matchTypes:["all"],operations:["any"]};if(b){if(null!==b.initial&&void 0!==b.initial){if("boolean"!=typeof b.initial)throw new Error('Option "initial" only permits Boolean values!');c.initial=b.initial}if(b.matchTypes&&(Array.isArray(b.matchTypes)?c.matchTypes=b.matchTypes:c.matchTypes=[b.matchTypes],c.matchTypes=a.normalizeMatchTypes(c.matchTypes)),b.operations&&(Array.isArray(b.operations)?c.operations=b.operations:c.operations=[b.operations],c.operations=a.normalizeOperations(c.operations)),c.matchTypes.indexOf("all")==-1&&c.operations.indexOf("any")==-1)throw new Error("Only subscriptions for either operations or matchTypes are allowed. You cannot subscribe to a query using matchTypes and operations at the same time!")}return null!==c.initial&&void 0!==c.initial||(c.initial=!0),c.matchTypes||(c.matchTypes=["all"]),c.operations||(c.operations=["any"]),c},a.normalizeMatchTypes=function(b){return a.normalizeSortedSet(b,"all","match types",["add","change","changeIndex","match","remove"])},a.normalizeOperations=function(b){return a.normalizeSortedSet(b,"any","operations",["delete","insert","none","update"])},a.normalizeSortedSet=function(a,b,c,d){if(a&&0!=a.length){a.sort();for(var e,f=void 0,g=a.length-1;g>=0;g--){if(e=a[g],!e)throw new Error("undefined and null not allowed!");if(e===f&&a.splice(g,1),e===b)return[b];if(d.indexOf(e)==-1)throw new Error(e+" not allowed for "+c+"! (permitted: "+d+".)");f=e}return a}},a.prototype._wrapQueryCallback=function(a){return function(b){var c=this;if(b.query=this.query,b.result){var d={matchType:"add",operation:"none"},e=0;b.result.forEach(function(f){var g=c._createObject(f,!1);b.ordered&&(d.index=e++);var h=c.createCallback(b,d,g,!0);a(h)},this)}if(b.match){var f=b.match.object,g=this._createObject(f,"delete"===b.match.operation),h=this.createCallback(b,b.match,g,!1);a(h)}if(b.errorMessage){var i=this.createError(b);a(i)}}.bind(this)},a.prototype.createCallback=function(a,b,c,d){var e={matchType:b.matchType,operation:b.operation,data:c,date:new Date(a.date),target:this.target,initial:d};return void 0!==b.index&&(e.index=b.index),e},a.prototype.createError=function(a){var b={errorMessage:a.errorMessage,date:new Date(a.date),target:this.target};return b},a.prototype._createObject=function(a,b){var c;if(a&&(c=this.entityManager.getReference(a.id),c.version +* +* core.js - https://github.com/zloirock/core-js +* Copyright (c) 2014-2016 Denis Pushkarev +* +* node-uuid - http://github.com/broofa/node-uuid +* Copyright (c) 2010-2012 Robert Kieffer +* +* validator - http://github.com/chriso/validator.js +* Copyright (c) 2015 Chris O'Hara +* +* Released under the MIT license +* +* Date: Mon, 28 Nov 2016 19:17:54 GMT +*/ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.DB = f()}})(function(){var define,module,exports;var babelHelpers = {}; +babelHelpers.typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; +} : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; +}; + +babelHelpers.classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } +}; + +babelHelpers.createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; +}(); + +babelHelpers.defaults = function (obj, defaults) { + var keys = Object.getOwnPropertyNames(defaults); + + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = Object.getOwnPropertyDescriptor(defaults, key); + + if (value && value.configurable && obj[key] === undefined) { + Object.defineProperty(obj, key, value); + } + } + + return obj; +}; + +babelHelpers.inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : babelHelpers.defaults(subClass, superClass); +}; + +babelHelpers.possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; +}; + +return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;otrue If public access is allowed + */ + + + Acl.prototype.isPublicReadAllowed = function isPublicReadAllowed() { + return this.read.isPublicAllowed(); + }; + + /** + * Sets whenever all users and roles should have the permission to read the object. + * Note: All other allow read rules will be removed. + */ + + + Acl.prototype.setPublicReadAllowed = function setPublicReadAllowed() { + return this.read.setPublicAllowed(); + }; + + /** + * Checks whenever the user or role is explicit allowed to read the object. + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {boolean} true if read access is explicitly allowed for the given user or role + */ + + + Acl.prototype.isReadAllowed = function isReadAllowed(userOrRole) { + return this.read.isAllowed(userOrRole); + }; + + /** + * Checks whenever the user or role is explicit denied to read the object + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {boolean} true if read access is explicitly denied for the given user or role + */ + + + Acl.prototype.isReadDenied = function isReadDenied(userOrRole) { + return this.read.isDenied(userOrRole); + }; + + /** + * Allows the given user or rule to read the object + * @param {...(model.User|model.Role|string)} userOrRole The user or role to allow + * @return {Acl} this acl object + */ + + + Acl.prototype.allowReadAccess = function allowReadAccess(userOrRole) { + Permission.prototype.allowAccess.apply(this.read, arguments); + return this; + }; + + /** + * Denies the given user or rule to read the object + * @param {...(model.User|model.Role|string)} userOrRole The user or role to deny + * @return {Acl} this acl object + */ + + + Acl.prototype.denyReadAccess = function denyReadAccess(userOrRole) { + Permission.prototype.denyAccess.apply(this.read, arguments); + return this; + }; + + /** + * Deletes any read allow/deny rule for the given user or role + * @param {...(model.User|model.Role|string)} userOrRole The user or role + * @return {Acl} this acl object + */ + + + Acl.prototype.deleteReadAccess = function deleteReadAccess(userOrRole) { + Permission.prototype.deleteAccess.apply(this.read, arguments); + return this; + }; + + /** + * Gets whenever all users and roles have the permission to write the object + * @return {boolean} true If public access is allowed + */ + + + Acl.prototype.isPublicWriteAllowed = function isPublicWriteAllowed() { + return this.write.isPublicAllowed(); + }; + + /** + * Sets whenever all users and roles should have the permission to write the object. + * Note: All other allow write rules will be removed. + */ + + + Acl.prototype.setPublicWriteAllowed = function setPublicWriteAllowed() { + return this.write.setPublicAllowed(); + }; + + /** + * Checks whenever the user or role is explicit allowed to write the object. + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {boolean} true if write access is explicitly allowed for the given user or role + */ + + + Acl.prototype.isWriteAllowed = function isWriteAllowed(userOrRole) { + return this.write.isAllowed(userOrRole); + }; + + /** + * Checks whenever the user or role is explicit denied to write the object + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {boolean} true if write access is explicitly denied for the given user or role + */ + + + Acl.prototype.isWriteDenied = function isWriteDenied(userOrRole) { + return this.write.isDenied(userOrRole); + }; + + /** + * Allows the given user or rule to write the object + * @param {...(model.User|model.Role|string)} userOrRole The user or role to allow + * @return {Acl} this acl object + */ + + + Acl.prototype.allowWriteAccess = function allowWriteAccess(userOrRole) { + Permission.prototype.allowAccess.apply(this.write, arguments); + return this; + }; + + /** + * Denies the given user or rule to write the object + * @param {...(model.User|model.Role|string)} userOrRole The user or role to deny + * @return {Acl} this acl object + */ + + + Acl.prototype.denyWriteAccess = function denyWriteAccess(userOrRole) { + Permission.prototype.denyAccess.apply(this.write, arguments); + return this; + }; + + /** + * Deletes any write allow/deny rule for the given user or role + * @param {...(model.User|model.Role|string)} userOrRole The user or role + * @return {Acl} this acl object + */ + + + Acl.prototype.deleteWriteAccess = function deleteWriteAccess(userOrRole) { + Permission.prototype.deleteAccess.apply(this.write, arguments); + return this; + }; + + /** + * A Json representation of the set of rules + * @return {json} + */ + + + Acl.prototype.toJSON = function toJSON() { + return { + read: this.read, + write: this.write + }; + }; + + /** + * Sets the acl rules form json + * @param {json} json The json encoded acls + */ + + + Acl.prototype.fromJSON = function fromJSON(json) { + this.read.fromJSON(json.read || {}); + this.write.fromJSON(json.write || {}); + }; + + return Acl; +}(); + +module.exports = Acl; + +},{"65":65}],2:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var error = _dereq_(34); +var binding = _dereq_(20); +var util = _dereq_(70); +var query = _dereq_(59); + +var UserFactory = _dereq_(19); +var EntityTransaction = _dereq_(4); +var Metadata = _dereq_(63); +var Message = _dereq_(25); +var BloomFilter = _dereq_(21); +var StatusCode = Message.StatusCode; + +/** + * @alias EntityManager + * @extends util.Lockable + */ + +var EntityManager = function (_util$Lockable) { + babelHelpers.inherits(EntityManager, _util$Lockable); + babelHelpers.createClass(EntityManager, [{ + key: 'isOpen', + + + /** + * Determine whether the entity manager is open. + * true until the entity manager has been closed + * @type boolean + */ + get: function get() { + return !!this._connector; + } + + /** + * The authentication token if the user is logged in currently + * @type String + */ + + }, { + key: 'token', + get: function get() { + return this.tokenStorage.token; + }, + + + /** + * The authentication token if the user is logged in currently + * @param {String} value + */ + set: function set(value) { + this.tokenStorage.update(value); + } + + /** + * @param {EntityManagerFactory} entityManagerFactory The factory which of this entityManager instance + */ + + }, { + key: 'isCachingDisabled', + get: function get() { + return !this.bloomFilter; + } + }]); + + function EntityManager(entityManagerFactory) { + babelHelpers.classCallCheck(this, EntityManager); + + /** + * Log messages can created by calling log directly as function, with a specific log level or with the helper + * methods, which a members of the log method. + * + * Logs will be filtered by the client logger and the before they persisted. The default log level is + * 'info' therefore all log messages below the given message aren't persisted. + * + * Examples: + *
+     // default log level ist info
+     db.log('test message %s', 'my string');
+     // info: test message my string
+      // pass a explicit log level as the first argument, one of ('trace', 'debug', 'info', 'warn', 'error')
+     db.log('warn', 'test message %d', 123);
+     // warn: test message 123
+      // debug log level will not be persisted by default, since the default logging level is info
+     db.log('debug', 'test message %j', {number: 123}, {});
+     // debug: test message {"number":123}
+     // data = {}
+      // One additional json object can be provided, which will be persisted together with the log entry
+     db.log('info', 'test message %s, %s', 'first', 'second', {number: 123});
+     // info: test message first, second
+     // data = {number: 123}
+      //use the log level helper
+     db.log.info('test message', 'first', 'second', {number: 123});
+     // info: test message first second
+     // data = {number: 123}
+      //change the default log level to trace, i.e. all log levels will be persisted, note that the log level can be
+     //additionally configured in the baqend
+     db.log.level = 'trace';
+      //trace will be persisted now
+     db.log.trace('test message', 'first', 'second', {number: 123});
+     // info: test message first second
+     // data = {number: 123}
+     * 
+ * + * @type util.Logger + */ + var _this = babelHelpers.possibleConstructorReturn(this, _util$Lockable.call(this)); + + _this.log = util.Logger.create(_this); + + /** + * The connector used for requests + * @type connector.Connector + * @private + */ + _this._connector = null; + + /** + * All managed and cached entity instances + * @type Map + */ + _this._entities = null; + + /** @type EntityManagerFactory */ + _this.entityManagerFactory = entityManagerFactory; + + /** @type metamodel.Metamodel */ + _this.metamodel = entityManagerFactory.metamodel; + + /** @type util.Code */ + _this.code = entityManagerFactory.code; + + /** @type util.Modules */ + _this.modules = null; + + /** + * The current logged in user object + * @type model.User + */ + _this.me = null; + + /** + * Returns true if the device token is already registered, otherwise false. + * @type boolean + */ + _this.isDeviceRegistered = false; + + /** + * Returns the tokenStorage which will be used to authorize all requests. + * @type {util.TokenStorage} + */ + _this.tokenStorage = null; + + /** + * @type {caching.BloomFilter} + */ + _this.bloomFilter = null; + + /** + * Set of object ids that were revalidated after the Bloom filter was loaded. + */ + _this.cacheWhiteList = null; + + /** + * Set of object ids that were updated but are not yet included in the bloom filter. + * This set essentially implements revalidation by side effect which does not work in Chrome. + */ + _this.cacheBlackList = null; + + /** + * Bloom filter refresh interval in seconds. + * + * @type {number} + */ + _this.bloomFilterRefresh = 60; + + /** + * Bloom filter refresh Promise + * + */ + _this._bloomFilterLock = new util.Lockable(); + return _this; + } + + /** + * Connects this entityManager, used for synchronous and asynchronous initialization + * @param {connector.Connector} connector + * @param {Object} connectData + * @param {util.TokenStorage} tokenStorage The used tokenStorage for token persistence + */ + + + EntityManager.prototype.connected = function connected(connector, connectData, tokenStorage) { + this._connector = connector; + this.tokenStorage = tokenStorage; + this.bloomFilterRefresh = this.entityManagerFactory.staleness; + this._entities = {}; + + this.File = binding.FileFactory.create(this); + this._createObjectFactory(this.metamodel.embeddables); + this._createObjectFactory(this.metamodel.entities); + + this.transaction = new EntityTransaction(this); + this.modules = new util.Modules(this, connector); + + if (connectData) { + this.isDeviceRegistered = !!connectData.device; + if (connectData.user && connectData.token == tokenStorage.token) this._updateUser(connectData.user, true); + + if (this.bloomFilterRefresh > 0 && connectData.bloomFilter && util.atob && !util.isNode) { + this.updateBloomFilter(connectData.bloomFilter); + } + } + }; + + /** + * @param {metamodel.ManagedType[]} types + * @return {binding.ManagedFactory} + * @private + */ + + + EntityManager.prototype._createObjectFactory = function _createObjectFactory(types) { + Object.keys(types).forEach(function (ref) { + var type = this.metamodel.managedType(ref); + var name = type.name; + + if (this[name]) { + type.typeConstructor = this[name]; + Object.defineProperty(this, name, { + value: type.createObjectFactory(this) + }); + } else { + Object.defineProperty(this, name, { + get: function get() { + Object.defineProperty(this, name, { + value: type.createObjectFactory(this) + }); + + return this[name]; + }, + set: function set(typeConstructor) { + type.typeConstructor = typeConstructor; + }, + + configurable: true + }); + } + }, this); + }; + + EntityManager.prototype.send = function send(message) { + var _this2 = this; + + message.tokenStorage = this.tokenStorage; + return this._connector.send(message).catch(function (e) { + if (e.status == StatusCode.BAD_CREDENTIALS) { + _this2._logout(); + } + throw e; + }); + }; + + /** + * Get an instance, whose state may be lazily fetched. If the requested instance does not exist + * in the database, the EntityNotFoundError is thrown when the instance state is first accessed. + * The application should not expect that the instance state will be available upon detachment, + * unless it was accessed by the application while the entity manager was open. + * + * @param {(Class|string)} entityClass + * @param {string=} key + */ + + + EntityManager.prototype.getReference = function getReference(entityClass, key) { + var id, type; + if (key) { + type = this.metamodel.entity(entityClass); + if (key.indexOf('/db/') == 0) { + id = key; + } else { + id = type.ref + '/' + encodeURIComponent(key); + } + } else { + id = entityClass; + type = this.metamodel.entity(id.substring(0, id.indexOf('/', 4))); //skip /db/ + } + + var entity = this._entities[id]; + if (!entity) { + entity = type.create(); + var metadata = Metadata.get(entity); + metadata.id = id; + metadata.setUnavailable(); + + this._attach(entity); + } + + return entity; + }; + + /** + * Creates an instance of Query.Builder for query creation and execution. The Query results are instances of the + * resultClass argument. + * @param {Class<*>=} resultClass - the type of the query result + * @return {query.Builder<*>} A query builder to create one ore more queries for the specified class + */ + + + EntityManager.prototype.createQueryBuilder = function createQueryBuilder(resultClass) { + return new query.Builder(this, resultClass); + }; + + /** + * Clear the persistence context, causing all managed entities to become detached. + * Changes made to entities that have not been flushed to the database will not be persisted. + */ + + + EntityManager.prototype.clear = function clear() { + this._entities = {}; + }; + + /** + * Close an application-managed entity manager. After the close method has been invoked, + * all methods on the EntityManager instance and any Query and TypedQuery objects obtained from it + * will throw the IllegalStateError except for transaction, and isOpen (which will return false). + * If this method is called when the entity manager is associated with an active transaction, + * the persistence context remains managed until the transaction completes. + */ + + + EntityManager.prototype.close = function close() { + this._connector = null; + + return this.clear(); + }; + + /** + * Check if the instance is a managed entity instance belonging to the current persistence context. + * @param {binding.Entity} entity - entity instance + * @returns {boolean} boolean indicating if entity is in persistence context + */ + + + EntityManager.prototype.contains = function contains(entity) { + return !!entity && this._entities[entity.id] === entity; + }; + + /** + * Check if an object with the id from the given entity is already attached. + * @param {binding.Entity} entity - entity instance + * @returns {boolean} boolean indicating if entity with same id is attached + */ + + + EntityManager.prototype.containsById = function containsById(entity) { + return !!(entity && this._entities[entity.id]); + }; + + /** + * Remove the given entity from the persistence context, causing a managed entity to become detached. + * Unflushed changes made to the entity if any (including removal of the entity), + * will not be synchronized to the database. Entities which previously referenced the detached entity will continue to reference it. + * @param {binding.Entity} entity - entity instance + */ + + + EntityManager.prototype.detach = function detach(entity) { + var _this3 = this; + + var state = Metadata.get(entity); + return state.withLock(function () { + _this3.removeReference(entity); + return Promise.resolve(entity); + }); + }; + + /** + * Resolve the depth by loading the referenced objects of the given entity. + * + * @param {binding.Entity} entity - entity instance + * @param {Object} [options] The load options + * @return {Promise} + */ + + + EntityManager.prototype.resolveDepth = function resolveDepth(entity, options) { + var _this4 = this; + + if (!options || !options.depth) return Promise.resolve(entity); + + options.resolved = options.resolved || []; + var promises = []; + var subOptions = Object.assign({}, options, { + depth: options.depth === true ? true : options.depth - 1 + }); + this.getSubEntities(entity, 1).forEach(function (subEntity) { + if (subEntity != null && !~options.resolved.indexOf(subEntity)) { + options.resolved.push(subEntity); + promises.push(_this4.load(subEntity.id, null, subOptions)); + } + }); + + return Promise.all(promises).then(function () { + return entity; + }); + }; + + /** + * Search for an entity of the specified oid. + * If the entity instance is contained in the persistence context, it is returned from there. + * @param {(Class|string)} entityClass - entity class + * @param {String} oid - Object ID + * @param {Object} [options] The load options. + * @return {Promise} the loaded entity or null + */ + + + EntityManager.prototype.load = function load(entityClass, oid, options) { + var _this5 = this; + + options = options || {}; + var entity = this.getReference(entityClass, oid); + var state = Metadata.get(entity); + + if (!options.refresh && options.local && state.isAvailable) { + return this.resolveDepth(entity, options); + } + + var msg = new message.GetObject(state.bucket, state.key); + + this.ensureCacheHeader(entity.id, msg, options.refresh); + + return this.send(msg).then(function (response) { + // refresh object if loaded older version from cache + // chrome doesn't using cache when ifNoneMatch is set + if (entity.version > response.entity.version) { + options.refresh = true; + return _this5.load(entityClass, oid, options); + } + + _this5.addToWhiteList(response.entity.id); + + if (response.status != StatusCode.NOT_MODIFIED) { + state.setJson(response.entity, true); + } + + return _this5.resolveDepth(entity, options); + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + _this5.removeReference(entity); + state.setRemoved(); + return null; + } else { + throw e; + } + }); + }; + + /** + * @param {binding.Entity} entity + * @param {Object} options + * @return {Promise} + */ + + + EntityManager.prototype.insert = function insert(entity, options) { + var _this6 = this; + + options = options || {}; + var isNew; + + return this._save(entity, options, function (state, json) { + if (state.version) throw new error.PersistentError('Existing objects can\'t be inserted.'); + + isNew = !state.id; + + return new message.CreateObject(state.bucket, json); + }).then(function (val) { + if (isNew) _this6._attach(entity); + + return val; + }); + }; + + /** + * @param {binding.Entity} entity + * @param {Object} options + * @return {Promise} + */ + + + EntityManager.prototype.update = function update(entity, options) { + options = options || {}; + + return this._save(entity, options, function (state, json) { + if (!state.version) throw new error.PersistentError("New objects can't be inserted."); + + if (options.force) { + delete json.version; + return new message.ReplaceObject(state.bucket, state.key, json).ifMatch('*'); + } else { + return new message.ReplaceObject(state.bucket, state.key, json).ifMatch(state.version); + } + }); + }; + + /** + * @param {binding.Entity} entity + * @param {Object} options The save options + * @param {boolean=} withoutLock Set true to save the entity without locking + * @return {Promise} + */ + + + EntityManager.prototype.save = function save(entity, options, withoutLock) { + options = options || {}; + + var msgFactory = function msgFactory(state, json) { + if (options.force) { + if (!state.id) throw new error.PersistentError("New special objects can't be forcedly saved."); + + delete json.version; + return new message.ReplaceObject(state.bucket, state.key, json); + } else if (state.version) { + return new message.ReplaceObject(state.bucket, state.key, json).ifMatch(state.version); + } else { + return new message.CreateObject(state.bucket, json); + } + }; + + return withoutLock ? this._locklessSave(entity, options, msgFactory) : this._save(entity, options, msgFactory); + }; + + /** + * @param {binding.Entity} entity + * @param {Function} cb pre-safe callback + * @return {Promise} + */ + + + EntityManager.prototype.optimisticSave = function optimisticSave(entity, cb) { + var _this7 = this; + + return Metadata.get(entity).withLock(function () { + return _this7._optimisticSave(entity, cb); + }); + }; + + /** + * @param {binding.Entity} entity + * @param {Function} cb pre-safe callback + * @return {Promise} + * @private + */ + + + EntityManager.prototype._optimisticSave = function _optimisticSave(entity, cb) { + var _this8 = this; + + var abort = false; + var abortFn = function abortFn() { + abort = true; + }; + var promise = Promise.resolve(cb(entity, abortFn)); + + if (abort) return Promise.resolve(entity); + + return promise.then(function () { + return _this8.save(entity, {}, true).catch(function (e) { + if (e.status == 412) { + return _this8.refresh(entity, {}).then(function () { + return _this8._optimisticSave(entity, cb); + }); + } else { + throw e; + } + }); + }); + }; + + /** + * Save the object state without locking + * @param {binding.Entity} entity + * @param {Object} options + * @param {Function} msgFactory + * @return {Promise.} + * @private + */ + + + EntityManager.prototype._locklessSave = function _locklessSave(entity, options, msgFactory) { + var _this9 = this; + + this.attach(entity); + var state = Metadata.get(entity); + var refPromises; + + var json; + if (state.isAvailable) { + //getting json will check all collections changes, therefore we must do it before proofing the dirty state + json = state.getJson(false, true); + } + + if (state.isDirty) { + if (!options.refresh) { + state.setPersistent(); + } + + var sendPromise = this.send(msgFactory(state, json)).then(function (response) { + if (options.refresh) { + state.setJson(response.entity, true); + } else { + state.setJsonMetadata(response.entity); + } + return entity; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + _this9.removeReference(entity); + state.setRemoved(); + return null; + } else { + state.setDirty(); + throw e; + } + }); + + refPromises = [sendPromise]; + } else { + refPromises = [Promise.resolve(entity)]; + } + + var subOptions = Object.assign({}, options); + subOptions.depth = 0; + this.getSubEntities(entity, options.depth).forEach(function (sub) { + refPromises.push(_this9._save(sub, subOptions, msgFactory)); + }); + + return Promise.all(refPromises).then(function () { + return entity; + }); + }; + + /** + * Save and lock the object state + * @param {binding.Entity} entity + * @param {Object} options + * @param {Function} msgFactory + * @return {Promise.} + * @private + */ + + + EntityManager.prototype._save = function _save(entity, options, msgFactory) { + var _this10 = this; + + this.ensureBloomFilterFreshness(); + + var state = Metadata.get(entity); + if (state.version) { + this.addToBlackList(entity.id); + } + + return state.withLock(function () { + return _this10._locklessSave(entity, options, msgFactory); + }); + }; + + /** + * Returns all referenced sub entities for the given depth and root entity + * @param {binding.Entity} entity + * @param {boolean|number} depth + * @param {binding.Entity[]} [resolved] + * @param {binding.Entity=} initialEntity + * @returns {binding.Entity[]} + */ + + + EntityManager.prototype.getSubEntities = function getSubEntities(entity, depth, resolved, initialEntity) { + var _this11 = this; + + resolved = resolved || []; + if (!depth) { + return resolved; + } + initialEntity = initialEntity || entity; + + var state = Metadata.get(entity); + for (var _iterator = state.type.references(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var value = _ref; + + this.getSubEntitiesByPath(entity, value.path).forEach(function (subEntity) { + if (!~resolved.indexOf(subEntity) && subEntity != initialEntity) { + resolved.push(subEntity); + resolved = _this11.getSubEntities(subEntity, depth === true ? depth : depth - 1, resolved, initialEntity); + } + }); + } + + return resolved; + }; + + /** + * Returns all referenced one level sub entities for the given path + * @param {binding.Entity} entity + * @param {Array} path + * @returns {binding.Entity[]} + */ + + + EntityManager.prototype.getSubEntitiesByPath = function getSubEntitiesByPath(entity, path) { + var _this12 = this; + + var subEntities = [entity]; + + path.forEach(function (attributeName) { + + var tmpSubEntities = []; + subEntities.forEach(function (subEntity) { + var curEntity = subEntity[attributeName]; + if (!curEntity) return; + + var attribute = _this12.metamodel.managedType(subEntity.constructor).getAttribute(attributeName); + if (attribute.isCollection) { + for (var _iterator2 = curEntity.entries(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var entry = _ref2; + + tmpSubEntities.push(entry[1]); + attribute.keyType && attribute.keyType.isEntity && tmpSubEntities.push(entry[0]); + } + } else { + tmpSubEntities.push(curEntity); + } + }); + subEntities = tmpSubEntities; + }); + + return subEntities; + }; + + /** + * Delete the entity instance. + * @param {binding.Entity} entity + * @param {Object} options The delete options + * @return {Promise} + */ + + + EntityManager.prototype['delete'] = function _delete(entity, options) { + var _this13 = this; + + options = options || {}; + + this.attach(entity); + var state = Metadata.get(entity); + + return state.withLock(function () { + if (!state.version && !options.force) throw new error.IllegalEntityError(entity); + + var msg = new message.DeleteObject(state.bucket, state.key); + + _this13.addToBlackList(entity.id); + + if (!options.force) msg.ifMatch(state.version); + + var refPromises = [_this13.send(msg).then(function () { + _this13.removeReference(entity); + state.setRemoved(); + return entity; + })]; + + var subOptions = Object.assign({}, options); + subOptions.depth = 0; + _this13.getSubEntities(entity, options.depth).forEach(function (sub) { + refPromises.push(_this13.delete(sub, subOptions)); + }); + + return Promise.all(refPromises).then(function () { + return entity; + }); + }); + }; + + /** + * Synchronize the persistence context to the underlying database. + * + * @returns {Promise<*>} + */ + + + EntityManager.prototype.flush = function flush(doneCallback, failCallback) {} + // TODO: implement this + + + /** + * Make an instance managed and persistent. + * @param {binding.Entity} entity - entity instance + */ + ; + + EntityManager.prototype.persist = function persist(entity) { + this.attach(entity); + }; + + /** + * Refresh the state of the instance from the database, overwriting changes made to the entity, if any. + * @param {binding.Entity} entity - entity instance + * @param {Object} options The refresh options + * @return {Promise} + */ + + + EntityManager.prototype.refresh = function refresh(entity, options) { + options = options || {}; + options.refresh = true; + + return this.load(entity.id, null, options); + }; + + /** + * Attach the instance to this database context, if it is not already attached + * @param {binding.Entity} entity The entity to attach + */ + + + EntityManager.prototype.attach = function attach(entity) { + if (!this.contains(entity)) { + var type = this.metamodel.entity(entity.constructor); + if (!type) throw new error.IllegalEntityError(entity); + + if (this.containsById(entity)) throw new error.EntityExistsError(entity); + + this._attach(entity); + } + }; + + EntityManager.prototype._attach = function _attach(entity) { + var metadata = Metadata.get(entity); + if (metadata.isAttached) { + if (metadata.db != this) { + throw new error.EntityExistsError(entity); + } + } else { + metadata.db = this; + } + + if (!metadata.id) { + if (metadata.type.name != 'User' && metadata.type.name != 'Role' && metadata.type.name != 'logs.AppLog') { + metadata.id = '/db/' + metadata.type.name + '/' + util.uuid(); + } + } + + if (metadata.id) { + this._entities[metadata.id] = entity; + } + }; + + EntityManager.prototype.removeReference = function removeReference(entity) { + var state = Metadata.get(entity); + if (!state) throw new error.IllegalEntityError(entity); + + delete this._entities[state.id]; + }; + + EntityManager.prototype.register = function register(user, password, loginOption) { + var _this14 = this; + + var login = loginOption > UserFactory.LoginOption.NO_LOGIN; + if (this.me && login) { + throw new error.PersistentError('User is already logged in.'); + } + + return this.withLock(function () { + var msg = new message.Register({ + user: user, + password: password, + login: login + }); + return _this14._userRequest(msg, loginOption); + }); + }; + + EntityManager.prototype.login = function login(username, password, loginOption) { + var _this15 = this; + + if (this.me) throw new error.PersistentError('User is already logged in.'); + + return this.withLock(function () { + var msg = new message.Login({ + username: username, + password: password + }); + + return _this15._userRequest(msg, loginOption); + }); + }; + + EntityManager.prototype.logout = function logout() { + var _this16 = this; + + return this.withLock(function () { + return _this16.send(new message.Logout()).then(_this16._logout.bind(_this16)); + }); + }; + + EntityManager.prototype.loginWithOAuth = function loginWithOAuth(provider, clientID, options) { + if (this.me) throw new error.PersistentError('User is already logged in.'); + + options = Object.assign({ + title: "Login with " + provider, + timeout: 5 * 60 * 1000, + state: {}, + loginOption: true + }, options); + + var msg; + if (Message[provider + 'OAuth']) { + msg = new Message[provider + 'OAuth'](clientID, options.scope, JSON.stringify(options.state)); + } else { + throw new Error('OAuth provider ' + provider + ' not supported.'); + } + + var req = this._userRequest(msg, options.loginOption); + var w = open(msg.request.path, options.title, 'width=' + options.width + ',height=' + options.height); + + return new Promise(function (resolve, reject) { + var timeout = setTimeout(function () { + reject(new error.PersistentError('OAuth login timeout.')); + }, options.timeout); + + req.then(resolve, reject).then(function () { + clearTimeout(timeout); + }); + }); + }; + + EntityManager.prototype.renew = function renew() { + var _this17 = this; + + return this.withLock(function () { + var msg = new message.Me(); + return _this17._userRequest(msg, true); + }); + }; + + EntityManager.prototype.newPassword = function newPassword(username, password, _newPassword) { + var _this18 = this; + + return this.withLock(function () { + var msg = new message.NewPassword({ + username: username, + password: password, + newPassword: _newPassword + }); + + return _this18.send(msg).then(function (response) { + return _this18._updateUser(response.entity); + }); + }); + }; + + EntityManager.prototype._updateUser = function _updateUser(obj, updateMe) { + var user = this.getReference(obj.id); + var metadata = Metadata.get(user); + metadata.setJson(obj, true); + + if (updateMe) this.me = user; + + return user; + }; + + EntityManager.prototype._logout = function _logout() { + this.me = null; + this.token = null; + }; + + EntityManager.prototype._userRequest = function _userRequest(msg, loginOption) { + var _this19 = this; + + var login = loginOption > UserFactory.LoginOption.NO_LOGIN; + if (login) { + this.tokenStorage.temporary = loginOption < UserFactory.LoginOption.PERSIST_LOGIN; + } + + return this.send(msg).then(function (response) { + if (response.entity) { + return _this19._updateUser(response.entity, login); + } + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + if (login) _this19._logout(); + return null; + } else { + throw e; + } + }); + }; + + EntityManager.prototype.registerDevice = function registerDevice(os, token, device) { + var msg = new message.DeviceRegister({ + token: token, + devicetype: os, + device: device + }); + + msg.withCredentials = true; + return this.send(msg); + }; + + EntityManager.prototype.checkDeviceRegistration = function checkDeviceRegistration() { + var _this20 = this; + + return this.send(new message.DeviceRegistered()).then(function () { + return _this20.isDeviceRegistered = true; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + return _this20.isDeviceRegistered = false; + } else { + throw e; + } + }); + }; + + EntityManager.prototype.pushDevice = function pushDevice(pushMessage) { + return this.send(new message.DevicePush(pushMessage)); + }; + + /** + * The given entity will be checked by the validation code of the entity type. + * + * @param {binding.Entity} entity + * @returns {util.ValidationResult} result + */ + + + EntityManager.prototype.validate = function validate(entity) { + var type = Metadata.get(entity).type; + + var result = new util.ValidationResult(); + for (var iter = type.attributes(), item; !(item = iter.next()).done;) { + var validate = new util.Validator(item.value.name, entity); + result.fields[validate.key] = validate; + } + + var validationCode = type.validationCode; + if (validationCode) { + validationCode(result.fields); + } + + return result; + }; + + /** + * Adds the given object id to the cacheWhiteList if needed. + * @param {string} objectId The id to add. + */ + + + EntityManager.prototype.addToWhiteList = function addToWhiteList(objectId) { + if (!this.isCachingDisabled) { + if (this.bloomFilter.contains(objectId)) { + this.cacheWhiteList.add(objectId); + } + this.cacheBlackList.delete(objectId); + } + }; + + /** + * Adds the given object id to the cacheBlackList if needed. + * @param {string} objectId The id to add. + */ + + + EntityManager.prototype.addToBlackList = function addToBlackList(objectId) { + if (!this.isCachingDisabled) { + if (!this.bloomFilter.contains(objectId)) { + this.cacheBlackList.add(objectId); + } + this.cacheWhiteList.delete(objectId); + } + }; + + EntityManager.prototype.refreshBloomFilter = function refreshBloomFilter() { + var _this21 = this; + + if (this.isCachingDisabled) return Promise.resolve(); + + var msg = new message.GetBloomFilter(); + return this.send(msg).then(function (response) { + _this21.updateBloomFilter(response.entity); + return _this21.bloomFilter; + }); + }; + + EntityManager.prototype.updateBloomFilter = function updateBloomFilter(bloomFilter) { + this.bloomFilter = new BloomFilter(bloomFilter); + this.cacheWhiteList = new Set(); + this.cacheBlackList = new Set(); + }; + + /** + * Checks the freshness of the bloom filter and does a reload if necessary + */ + + + EntityManager.prototype.ensureBloomFilterFreshness = function ensureBloomFilterFreshness() { + var _this22 = this; + + if (this.isCachingDisabled) return; + + var now = new Date().getTime(); + var refreshRate = this.bloomFilterRefresh * 1000; + + if (this._bloomFilterLock.isReady && now - this.bloomFilter.creation > refreshRate) { + this._bloomFilterLock.withLock(function () { + return _this22.refreshBloomFilter(); + }); + } + }; + + /** + * Checks for a given id, if revalidation is required, the resource is stale or caching was disabled + * @param {string} id The object id to check + * @returns {boolean} Indicates if the resource must be revalidated + */ + + + EntityManager.prototype.mustRevalidate = function mustRevalidate(id) { + if (util.isNode) return false; + + this.ensureBloomFilterFreshness(); + + var refresh = this.isCachingDisabled || !this._bloomFilterLock.isReady; + refresh = refresh || !this.cacheWhiteList.has(id) && (this.cacheBlackList.has(id) || this.bloomFilter.contains(id)); + return refresh; + }; + + /** + * + * @param {string} id To check the bloom filter + * @param {connector.Message} message To attach the headers + * @param {boolean} refresh To force the reload headers + */ + + + EntityManager.prototype.ensureCacheHeader = function ensureCacheHeader(id, message, refresh) { + refresh = refresh || this.mustRevalidate(id); + + if (refresh) { + message.noCache(); + } + }; + + /** + * Creates a absolute url for the given relative one + * @param {string} relativePath the relative url + * @param {boolean=} authorize indicates if authorization credentials should be generated and be attached to the url + * @return {string} a absolute url wich is optionaly signed with a resource token which authenticates the currently + * logged in user + */ + + + EntityManager.prototype.createURL = function createURL(relativePath, authorize) { + var path = this._connector.basePath + relativePath; + + var append = false; + if (authorize && this.me) { + path = this.tokenStorage.signPath(path); + append = true; + } else { + path = path.split('/').map(encodeURIComponent).join('/'); + } + + if (this.mustRevalidate(relativePath)) { + path = path + (append ? '&' : '?') + 'BCB'; + } + + return this._connector.origin + path; + }; + + return EntityManager; +}(util.Lockable); + +/** + * Constructor for a new List collection + * @function + * @param {...*} args Same arguments can be passed as the Array constructor takes + * @return {void} The new created List + */ + + +EntityManager.prototype.List = Array; + +/** + * Constructor for a new Set collection + * @function + * @param {Iterable<*>=} collection The initial array or collection to initialize the new Set + * @return {void} The new created Set + */ +EntityManager.prototype.Set = Set; + +/** + * Constructor for a new Map collection + * @function + * @param {Iterable<*>=} collection The initial array or collection to initialize the new Map + * @return {void} The new created Map + */ +EntityManager.prototype.Map = Map; + +/** + * Constructor for a new GeoPoint + * @function + * @param {string|number|Object|Array} [latitude] A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude + * @param {number=} longitude The GeoPoint's longitude + * @return {void} The new created GeoPoint + */ +EntityManager.prototype.GeoPoint = _dereq_(5); + +/** + * An User factory for user objects. + * The User factory can be called to create new instances of users or can be used to register/login/logout users. + * The created instances implements the {@link model.User} interface + * @name User + * @type binding.UserFactory + * @memberOf EntityManager.prototype + */ + +/** + * An Role factory for role objects. + * The Role factory can be called to create new instances of roles, later on users can be attached to roles to manage the + * access permissions through this role + * The created instances implements the {@link model.Role} interface + * @name Role + * @memberOf EntityManager.prototype + * @type binding.EntityFactory + */ + +/** + * An Device factory for user objects. + * The Device factory can be called to create new instances of devices or can be used to register, push to and + * check registration status of devices. + * @name Device + * @memberOf EntityManager.prototype + * @type binding.DeviceFactory + */ + +/** + * An Object factory for entity or embedded objects, + * that can be accessed by the type name of the entity type. + * An object factory can be called to create new instances of the type. + * The created instances implements the {@link binding.Entity} or the {@link binding.Managed} interface + * whenever the class is an entity or embedded object + * @name [YourEntityClass: string] + * @memberOf EntityManager.prototype + * @type {*} + */ + +/** + * A File factory for file objects. + * The file factory can be called to create new instances for files. + * The created instances implements the {@link binding.File} interface + * @name File + * @memberOf EntityManager.prototype + * @type binding.FileFactory + */ + +module.exports = EntityManager; + +},{"19":19,"20":20,"21":21,"25":25,"34":34,"36":36,"4":4,"5":5,"59":59,"63":63,"70":70}],3:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var metamodel = _dereq_(52); + +var util = _dereq_(70); +var caching = _dereq_(22); +var Connector = _dereq_(23); +var EntityManager = _dereq_(2); + +/** + * @alias EntityManagerFactory + * @extends util.Lockable + */ + +var EntityManagerFactory = function (_util$Lockable) { + babelHelpers.inherits(EntityManagerFactory, _util$Lockable); + + EntityManagerFactory.prototype._connected = function _connected() {}; + + /** + * Creates a new EntityManagerFactory connected to the given destination + * @param {string|Object} [options] The destination to connect with, or an options object + * @param {string} [options.host] The destination to connect with + * @param {number} [options.port=80|443] The optional destination port to connect with + * @param {boolean} [options.secure=false] true To use a secure ssl encrypted connection + * @param {string} [options.basePath="/v1"] The base path of the api + * @param {Object} [options.schema=null] The serialized schema as json used to initialize the metamodel + * @param {util.TokenStorage} [options.tokenStorage] The tokenStorage which should be used by this emf + * @param {util.TokenStorageFactory} [options.tokenStorageFactory] The tokenStorage factory implementation which should + * be used for token storage + * @param {number} [options.staleness=60] The maximum staleness of objects that are acceptable while reading cached data + */ + + + function EntityManagerFactory(options) { + babelHelpers.classCallCheck(this, EntityManagerFactory); + + var _this = babelHelpers.possibleConstructorReturn(this, _util$Lockable.call(this)); + + options = Object(options) instanceof String ? { host: options } : options || {}; + + /** @type connector.Connector */ + _this._connector = null; + /** @type metamodel.Metamodel */ + _this.metamodel = _this.createMetamodel(); + /** @type util.Code */ + _this.code = new util.Code(_this.metamodel, _this); + /** @type util.TokenStorageFactory */ + _this.tokenStorageFactory = util.TokenStorage.WEB_STORAGE || util.TokenStorage.GLOBAL; + + _this.configure(options); + + var isReady = true; + var ready = new Promise(function (success) { + _this._connected = success; + }); + + if (options.host) { + _this.connect(options.host, options.port, options.secure, options.basePath); + } else { + isReady = false; + } + + if (!_this.tokenStorage) { + isReady = false; + ready = ready.then(function () { + return _this.tokenStorageFactory.create(_this._connector.origin); + }).then(function (tokenStorage) { + _this.tokenStorage = tokenStorage; + }); + } + + if (options.schema) { + _this._connectData = options; + _this.metamodel.init(options.schema); + } else { + isReady = false; + ready = ready.then(function () { + var msg = new message.Connect(); + msg.withCredentials = true; //used for registered devices + + if (_this.staleness === 0) msg.noCache(); + + return _this.send(msg); + }).then(function (response) { + _this._connectData = response.entity; + + if (_this.staleness === undefined) { + _this.staleness = _this._connectData.bloomFilterRefresh || 60; + } + + if (!_this.metamodel.isInitialized) _this.metamodel.init(_this._connectData.schema); + + _this.tokenStorage.update(_this._connectData.token); + }); + } + + if (!isReady) { + _this.withLock(function () { + return ready; + }, true); + } + return _this; + } + + /** + * Apply additional configurations to this EntityManagerFactory + * @param {Object} options The additional configuration options + * @param {util.TokenStorage} [options.tokenStorage] The tokenStorage which should be used by this emf + * @param {util.TokenStorageFactory} [options.tokenStorageFactory] The tokenStorage factory implementation which should + * be used for token storage + * @param {number} [options.staleness=60] The maximum staleness of objects that are acceptable while reading cached data, + * 0 to always bypass the browser cache + */ + + + EntityManagerFactory.prototype.configure = function configure(options) { + if (this._connector) throw new Error('The EntityManagerFactory can only be configured before is is connected.'); + + if (options.tokenStorage) { + /** @type util.TokenStorage */ + this.tokenStorage = options.tokenStorage; + } + + if (options.tokenStorageFactory) { + this.tokenStorageFactory = options.tokenStorageFactory; + } + + if (options.staleness !== undefined) { + /** @type number */ + this.staleness = options.staleness; + } + }; + + /** + * Connects this EntityManager to the given destination + * @param {string} hostOrApp The host or the app name to connect with + * @param {number} [port=80|443] The port to connect to + * @param {boolean} [secure=false] true To use a secure connection + * @param {string} [basePath="/v1"] The base path of the api + */ + + + EntityManagerFactory.prototype.connect = function connect(hostOrApp, port, secure, basePath) { + if (this._connector) throw new Error('The EntityManagerFactory is already connected.'); + + if (Object(port) instanceof Boolean) { + secure = port; + port = 0; + } + + this._connector = Connector.create(hostOrApp, port, secure, basePath); + + this._connected(); + return this.ready(); + }; + + /** + * Connects this EntityManager to the given destination + * @param {string} hostOrApp The host or the app name to connect with + * @param {boolean} [secure=false] true To use a secure connection + * @name connect + * @memberOf EntityManagerFactory.prototype + * @method + */ + + /** + * Creates a new Metamodel instance, which is not connected + * @return {metamodel.Metamodel} A new Metamodel instance + */ + + + EntityManagerFactory.prototype.createMetamodel = function createMetamodel() { + return new metamodel.Metamodel(this); + }; + + /** + * Create a new application-managed EntityManager. + * + * @param {boolean=} useSharedTokenStorage The token storage to persist the authorization token, or + * true To use the shared token storage of the emf. + * false To use a instance based storage. + * + * @returns {EntityManager} a new entityManager + */ + + + EntityManagerFactory.prototype.createEntityManager = function createEntityManager(useSharedTokenStorage) { + var _this2 = this; + + var em = new EntityManager(this); + + if (this.isReady) { + em.connected(this._connector, this._connectData, useSharedTokenStorage ? this.tokenStorage : new util.TokenStorage(this._connector.origin)); + } else { + em.withLock(function () { + return _this2.ready().then(function () { + em.connected(_this2._connector, _this2._connectData, useSharedTokenStorage ? _this2.tokenStorage : new util.TokenStorage(_this2._connector.origin)); + }); + }, true); + } + + return em; + }; + + EntityManagerFactory.prototype.send = function send(message) { + if (!message.tokenStorage) message.tokenStorage = this.tokenStorage; + return this._connector.send(message); + }; + + return EntityManagerFactory; +}(util.Lockable); + +module.exports = EntityManagerFactory; + +},{"2":2,"22":22,"23":23,"36":36,"52":52,"70":70}],4:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var error = _dereq_(34); + +/** + * @alias EntityTransaction + */ + +var EntityTransaction = function () { + babelHelpers.createClass(EntityTransaction, [{ + key: 'isActive', + + + /** + * Indicate whether a resource transaction is in progress. + * @returns {boolean} indicating whether transaction is in progress + */ + get: function get() { + return Boolean(this.tid); + } + + /** + * @param {EntityManager} entityManager + */ + + }]); + + function EntityTransaction(entityManager) { + babelHelpers.classCallCheck(this, EntityTransaction); + + this._connector = entityManager.connector; + this.entityManager = entityManager; + + this.tid = null; + this.rollbackOnly = false; + + this.readSet = null; + this.changeSet = null; + } + + /** + * Start a resource transaction. + */ + + + EntityTransaction.prototype.begin = function begin(doneCallback, failCallback) { + return this.yield().then(function () { + var result = this.send(new message.PostTransaction()).done(function (msg) { + this.tid = msg.tid; + + this.rollbackOnly = false; + this.readSet = {}; + this.changeSet = {}; + }); + + return this.wait(result); + }).then(doneCallback, failCallback); + }; + + /** + * Commit the current resource transaction, writing any unflushed changes to the database. + */ + + + EntityTransaction.prototype.commit = function commit(doneCallback, failCallback) { + return this.yield().then(function () { + if (this.getRollbackOnly()) { + return this.rollback().then(function () { + throw new error.RollbackError(); + }); + } else { + return this.wait(this.entityManager.flush()).then(function () { + var readSet = []; + for (var ref in this.readSet) { + readSet.push({ + "oid": ref, + "version": this.readSet[ref] + }); + } + + var result = this.send(new message.PutTransactionCommitted(this.tid, readSet)); + + return this.wait(result).then(function (msg) { + this.tid = null; + this.readSet = null; + this.changeSet = null; + + var oids = msg.oids; + for (var oid in oids) { + var version = oids[oid]; + var entity = this.entityManager.entities[oid]; + + if (entity) { + var state = util.Metadata.get(entity); + if (version == 'DELETED' || state.isDeleted) { + this.entityManager.removeReference(entity); + } else { + state.setJsonValue(state.type.version, version); + } + } + } + }); + }); + } + }).then(doneCallback, failCallback); + }; + + /** + * Determine whether the current resource transaction has been marked for rollback. + * @returns {boolean} indicating whether the transaction has been marked for rollback + */ + + + EntityTransaction.prototype.getRollbackOnly = function getRollbackOnly() { + return this.rollbackOnly; + }; + + /** + * Roll back the current resource transaction. + */ + + + EntityTransaction.prototype.rollback = function rollback(doneCallback, failCallback) { + return this.yield().then(function () { + var result = this.send(new message.PutTransactionAborted(this.tid)); + + this.wait(result).then(function () { + this.tid = null; + this.readSet = null; + this.changeSet = null; + return this.entityManager.clear(); + }, function () { + return this.entityManager.clear(); + }); + }).then(doneCallback, failCallback); + }; + + /** + * Mark the current resource transaction so that the only possible outcome of the transaction is for the transaction to be rolled back. + */ + + + EntityTransaction.prototype.setRollbackOnly = function setRollbackOnly(context, onSuccess) { + return this.yield().done(function () { + this.rollbackOnly = true; + }); + }; + + EntityTransaction.prototype.isRead = function isRead(identifier) { + return this.isActive && identifier in this.readSet; + }; + + EntityTransaction.prototype.setRead = function setRead(identifier, version) { + if (this.isActive && !this.isChanged(identifier)) { + this.readSet[identifier] = version; + } + }; + + EntityTransaction.prototype.isChanged = function isChanged(identifier) { + return this.isActive && identifier in this.changeSet; + }; + + EntityTransaction.prototype.setChanged = function setChanged(identifier) { + if (this.isActive) { + delete this.readSet[identifier]; + this.changeSet[identifier] = true; + } + }; + + return EntityTransaction; +}(); + +module.exports = EntityTransaction; + +},{"34":34,"36":36}],5:[function(_dereq_,module,exports){ +"use strict"; + +/** + * Creates a new GeoPoint instance + * From latitude and longitude + * From a json object + * Or an tuple of latitude and longitude + * + * @alias GeoPoint + */ + +var GeoPoint = function () { + + /** + * Creates a GeoPoint with the user's current location, if available. + * @return {Promise} A promise that will be resolved with a GeoPoint + */ + GeoPoint.current = function current() { + return new Promise(function (resolve, reject) { + navigator.geolocation.getCurrentPosition(function (location) { + resolve(new GeoPoint(location.coords.latitude, location.coords.longitude)); + }, function (error) { + reject(error); + }); + }); + }; + + /** + * @param {string|number|Object|Array} [latitude] A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude + * @param {number=} longitude The GeoPoint's longitude + */ + + + function GeoPoint(latitude, longitude) { + babelHelpers.classCallCheck(this, GeoPoint); + + var lat = void 0, + lng = void 0; + if (Object(latitude) instanceof String) { + var index = latitude.indexOf(';'); + lat = latitude.substring(0, index); + lng = latitude.substring(index + 1); + } else if (Object(latitude) instanceof Number) { + lat = latitude; + lng = longitude; + } else if (Object(latitude) instanceof Array) { + lat = latitude[0]; + lng = latitude[1]; + } else if (latitude instanceof Object) { + lat = latitude.latitude; + lng = latitude.longitude; + } else { + lat = 0; + lng = 0; + } + + /** + * Longitude of the given point + * @type {number} + */ + this.longitude = lng; + + /** + * Latitude of the given point + * @type {number} + */ + this.latitude = lat; + + if (this.latitude < -90 || this.latitude > 90) { + throw new Error("Latitude " + this.latitude + " is not in bound of -90 <= latitude <= 90"); + } + + if (this.longitude < -180 || this.longitude > 180) { + throw new Error("Longitude " + this.longitude + " is not in bound of -180 <= longitude <= 180"); + } + } + + /** + * Returns the distance from this GeoPoint to another in kilometers. + * @param {GeoPoint} point another GeoPoint + * @return {number} The distance in kilometers + * + * @see GeoPoint#radiansTo + */ + + + GeoPoint.prototype.kilometersTo = function kilometersTo(point) { + return Number((GeoPoint.EARTH_RADIUS_IN_KILOMETERS * this.radiansTo(point)).toFixed(3)); + }; + + /** + * Returns the distance from this GeoPoint to another in miles. + * @param {GeoPoint} point another GeoPoint + * @return {number} The distance in miles + * + * @see GeoPoint#radiansTo + */ + + + GeoPoint.prototype.milesTo = function milesTo(point) { + return Number((GeoPoint.EARTH_RADIUS_IN_MILES * this.radiansTo(point)).toFixed(3)); + }; + + /** + * Computes the arc, in radian, between two WGS-84 positions. + * + * The haversine formula implementation is taken from: + * {@link http://www.movable-type.co.uk/scripts/latlong.html} + * + * Returns the distance from this GeoPoint to another in radians. + * @param {GeoPoint} point another GeoPoint + * @return {number} the arc, in radian, between two WGS-84 positions + * + * @see http://en.wikipedia.org/wiki/Haversine_formula + */ + + + GeoPoint.prototype.radiansTo = function radiansTo(point) { + var from = this, + to = point; + var rad1 = from.latitude * GeoPoint.DEG_TO_RAD, + rad2 = to.latitude * GeoPoint.DEG_TO_RAD, + dLng = (to.longitude - from.longitude) * GeoPoint.DEG_TO_RAD; + + return Math.acos(Math.sin(rad1) * Math.sin(rad2) + Math.cos(rad1) * Math.cos(rad2) * Math.cos(dLng)); + }; + + /** + * A String representation in latitude, longitude format + * @return {string} The string representation of this class + */ + + + GeoPoint.prototype.toString = function toString() { + return this.latitude + ';' + this.longitude; + }; + + /** + * Returns a JSON representation of the GeoPoint + * @return {json} A GeoJson object of this GeoPoint + */ + + + GeoPoint.prototype.toJSON = function toJSON() { + return { latitude: this.latitude, longitude: this.longitude }; + }; + + return GeoPoint; +}(); + +GeoPoint.DEG_TO_RAD = Math.PI / 180; + +/** + * The Earth radius in kilometers used by {@link GeoPoint#kilometersTo} + * @type {number} + */ +GeoPoint.EARTH_RADIUS_IN_KILOMETERS = 6371; + +/** + * The Earth radius in miles used by {@link GeoPoint#milesTo} + * @type {number} + */ +GeoPoint.EARTH_RADIUS_IN_MILES = 3956; + +module.exports = GeoPoint; + +},{}],6:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @interface baqend + * @extends EntityManager + */ +var EntityManagerFactory = _dereq_(3); +var EntityManager = _dereq_(2); + +EntityManager.prototype.binding = _dereq_(20); +EntityManager.prototype.connector = _dereq_(28); +EntityManager.prototype.error = _dereq_(34); +EntityManager.prototype.message = _dereq_(36); +EntityManager.prototype.metamodel = _dereq_(52); +EntityManager.prototype.util = _dereq_(70); +EntityManager.prototype.caching = _dereq_(22); +EntityManager.prototype.query = _dereq_(59); + +EntityManager.prototype.EntityManager = _dereq_(2); +EntityManager.prototype.EntityManagerFactory = _dereq_(3); +EntityManager.prototype.EntityTransaction = _dereq_(4); +EntityManager.prototype.Acl = _dereq_(1); + +var emf = new EntityManagerFactory(); +var db = emf.createEntityManager(true); + +/** + * Configures the DB with additional config options + * @param {Object} options The additional configuration options + * @param {util.TokenStorage} [options.tokenStorage] The tokenStorage which should be used by this emf + * @param {util.TokenStorageFactory} [options.tokenStorageFactory] The tokenStorage factory implementation which should + * be used for token storage + * @param {number} [options.staleness=60] The maximum staleness of objects that are acceptable while reading cached data, + * 0 to always bypass the browser cache + * @function + * @return {baqend} + * @alias baqend#configure + */ +db.configure = function (options) { + emf.configure(options); + return this; +}; + +/** + * Connects the DB with the server and calls the callback on success + * @param {string} hostOrApp The host or the app name to connect with + * @param {boolean} [secure=false] true To use a secure connection + * @param {util.Lockable~callback=} doneCallback The callback, called when a connection is established and the + * SDK is ready to use + * @param {util.Lockable~callback=} failCallback When an error occurred while initializing the SDK + * @function + * @return {Promise} + * @alias baqend#connect + */ +db.connect = function (hostOrApp, secure, doneCallback, failCallback) { + if (secure instanceof Function) { + failCallback = doneCallback; + doneCallback = secure; + secure = undefined; + } + + emf.connect(hostOrApp, secure); + return this.ready(doneCallback, failCallback); +}; + +exports = module.exports = db; +//import {db} from 'baqend'; +exports.db = db; +//import db from 'baqend'; +exports.default = db; + +},{"1":1,"2":2,"20":20,"22":22,"28":28,"3":3,"34":34,"36":36,"4":4,"52":52,"59":59,"70":70}],7:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias binding.Accessor + */ + +var Accessor = function () { + function Accessor() { + babelHelpers.classCallCheck(this, Accessor); + } + + /** + * @param {Object} object + * @param {metamodel.Attribute} attribute + * @returns {*} + */ + Accessor.prototype.getValue = function getValue(object, attribute) { + return object[attribute.name]; + }; + + /** + * @param {Object} object + * @param {metamodel.Attribute} attribute + * @param {*} value + */ + + + Accessor.prototype.setValue = function setValue(object, attribute, value) { + object[attribute.name] = value; + }; + + return Accessor; +}(); + +module.exports = Accessor; + +},{}],8:[function(_dereq_,module,exports){ +"use strict"; + +var EntityFactory = _dereq_(11); + +/** + * @class binding.DeviceFactory + * @extends binding.EntityFactory + * + * @param {Object=} properties initial properties to set on the instance + * @param {...*} arguments Additional constructor params passed through the type constructor + * @return {model.Device} The new managed instance + */ +var DeviceFactory = EntityFactory.extend( /** @lends binding.DeviceFactory.prototype */{ + + /** + * Returns true if the devices is already registered, otherwise false. + * @returns {boolean} Status of the device registration + */ + get isRegistered() { + return this._db.isDeviceRegistered; + }, + + /** + * Register a new device with the given device token and OS. + * @param {string} os The OS of the device (IOS/Android) + * @param {string} token The GCM or APNS device token + * @param {model.Device=} device A optional device entity to set custom field values + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + */ + register: function register(os, token, device, doneCallback, failCallback) { + if (device instanceof Function) { + failCallback = doneCallback; + doneCallback = device; + device = null; + } + + return this._db.registerDevice(os, token, device).then(doneCallback, failCallback); + }, + + + /** + * Uses the info from the given {util.PushMessage} message to send an push notification. + * @param {util.PushMessage} pushMessage to send an push notification. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + */ + push: function push(pushMessage, doneCallback, failCallback) { + return this._db.pushDevice(pushMessage).then(doneCallback, failCallback); + } +}); + +DeviceFactory.PushMessage = _dereq_(66); + +module.exports = DeviceFactory; + +},{"11":11,"66":66}],9:[function(_dereq_,module,exports){ +"use strict"; + +var Metadata = _dereq_(63); +var Lockable = _dereq_(61); + +/** + * @alias binding.Enhancer + */ + +var Enhancer = function () { + function Enhancer() { + babelHelpers.classCallCheck(this, Enhancer); + } + + /** + * @param {Class<*>} superClass + * @returns {Class<*>} typeConstructor + */ + Enhancer.prototype.createProxy = function createProxy(superClass) { + return function (_superClass) { + babelHelpers.inherits(Proxy, _superClass); + + function Proxy() { + babelHelpers.classCallCheck(this, Proxy); + return babelHelpers.possibleConstructorReturn(this, _superClass.apply(this, arguments)); + } + + return Proxy; + }(superClass); + }; + + /** + * @param {Class<*>} typeConstructor + * @returns {string} + */ + + + Enhancer.prototype.getIdentifier = function getIdentifier(typeConstructor) { + return typeConstructor.__d__; + }; + + /** + * @param {Class<*>} typeConstructor + * @param {string} identifier + */ + + + Enhancer.prototype.setIdentifier = function setIdentifier(typeConstructor, identifier) { + Object.defineProperty(typeConstructor, '__d__', { + value: identifier + }); + }; + + /** + * @param {metamodel.ManagedType} type + * @param {Class<*>} typeConstructor + */ + + + Enhancer.prototype.enhance = function enhance(type, typeConstructor) { + if (typeConstructor.__ype__ == type) return; + + if (typeConstructor.hasOwnProperty('__ype__')) throw new Error('Type is already used by a different manager'); + + Object.defineProperty(typeConstructor, '__ype__', { + value: type + }); + + this.setIdentifier(typeConstructor, type.ref); + this.enhancePrototype(typeConstructor.prototype, type); + }; + + /** + * Enhance the prototype of the type + * @param {Object} proto + * @param {metamodel.ManagedType} type + */ + + + Enhancer.prototype.enhancePrototype = function enhancePrototype(proto, type) { + if (proto.toString === Object.prototype.toString) { + // implements a better convenience toString method + Object.defineProperty(proto, 'toString', { + value: function toString() { + return this._metadata.id || this._metadata.bucket; + }, + enumerable: false + }); + } + + // enhance all persistent object properties + if (type.superType && type.superType.name == 'Object') { + for (var _iterator = type.superType.declaredAttributes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var attr = _ref; + + if (!attr.isMetadata) this.enhanceProperty(proto, attr); + } + } + + // enhance all persistent properties + for (var _iterator2 = type.declaredAttributes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + var _attr = _ref2; + + this.enhanceProperty(proto, _attr); + } + }; + + /** + * @param {Object} proto + * @param {metamodel.Attribute} attribute + */ + + + Enhancer.prototype.enhanceProperty = function enhanceProperty(proto, attribute) { + var name = '$' + attribute.name; + Object.defineProperty(proto, attribute.name, { + get: function get() { + var metadata = this._metadata; + metadata.readAccess(); + return metadata[name]; + }, + set: function set(value) { + var metadata = this._metadata; + metadata.writeAccess(); + metadata[name] = value; + }, + + configurable: true, + enumerable: true + }); + }; + + return Enhancer; +}(); + +module.exports = Enhancer; + +},{"61":61,"63":63}],10:[function(_dereq_,module,exports){ +"use strict"; + +var Managed = _dereq_(15); + +/** + * @alias binding.Entity + * @extends binding.Managed + */ + +var Entity = function (_Managed) { + babelHelpers.inherits(Entity, _Managed); + + /** + * The default constructor, copy all given properties to this object + * @param {Object=} properties - The optional properties to copy + */ + function Entity(properties) { + babelHelpers.classCallCheck(this, Entity); + return babelHelpers.possibleConstructorReturn(this, _Managed.call(this, properties)); + } + + return Entity; +}(Managed); + +Object.defineProperties(Entity.prototype, /** @lends binding.Entity.prototype */{ + /** + * The unique id of this object + * + * Sets the unique id of this object, if the id is not formatted as an valid id, + * it will be used as the key component of the id has the same affect as setting the key + * + * @type string + */ + id: { + get: function get() { + return this._metadata.id; + }, + set: function set(value) { + if (this._metadata.id) throw new Error('The id can\'t be set twice: ' + value); + + value += ''; + if (value.indexOf('/db/' + this._metadata.bucket + '/') == 0) { + this._metadata.id = value; + } else { + this.key = value; + } + }, + + enumerable: true + }, + + /** + * The unique key part of the id + * When the key of the unique id is set an error will be thrown if an id is already set. + * @type string + */ + key: { + get: function get() { + return this._metadata.key; + }, + set: function set(value) { + this._metadata.key = value; + } + }, + + /** + * The version of this object + * @type number + */ + version: { + get: function get() { + return this._metadata.version; + }, + + enumerable: true + }, + + /** + * The object read/write permissions + * @type Acl + */ + acl: { + get: function get() { + return this._metadata.acl; + }, + + enumerable: true + }, + + /** + * Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled + * @param {util.Lockable~callback=} doneCallback The callback which will be invoked when the previously + * operations on this object is completed. + * @return {Promise} A promise which completes successfully, when the previously requested + * operation completes + * @method + */ + ready: { + value: function ready(doneCallback) { + return this._metadata.ready(doneCallback); + } + }, + + /** + * Attach this object to the given db + * @param {EntityManager} db The db which will be used for future crud operations + * @method + */ + attach: { + value: function attach(db) { + db.attach(this); + } + }, + + /** + * Saves the object. Inserts the object if it doesn't exists and updates the object if the object exist. + * @param {Object} [options] The save options + * @param {boolean} [options.force=false] Force the save operation, the version will not be validated. + * @param {number|boolean} [options.depth=0] The object depth which will be saved. Depth 0 save this object only, + * true saves the objects by reachability. + * @param {boolean} [options.refresh=false] Refresh the local object state from remote. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + save: { + value: function save(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._metadata.db.save(this, options).then(doneCallback, failCallback); + } + }, + + /** + * Inserts a new object. Inserts the object if it doesn't exists and raise an error if the object already exist. + * @param {Object} [options] The insertion options + * @param {number|boolean} [options.depth=0] The object depth which will be inserted. Depth 0 insert this object only, + * true inserts objects by reachability. + * @param {boolean} [options.refresh=false] Refresh the local object state from remote. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + insert: { + value: function insert(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._metadata.db.insert(this, options).then(doneCallback, failCallback); + } + }, + + /** + * Updates an existing object. + * Updates the object if it exists and raise an error if the object doesn't exist. + * @param {Object} [options] The update options + * @param {boolean} [options.force=false] Force the update operation, the version will not be validated, only existence will be checked. + * @param {number|boolean} [options.depth=0] The object depth which will be updated. Depth 0 updates this object only, + * true updates objects by reachability. + * @param {boolean} [options.refresh=false] Refresh the local object state from remote. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + update: { + value: function update(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._metadata.db.update(this, options).then(doneCallback, failCallback); + } + }, + + /** + * Resolves the referenced object in the specified depth. Only unresolved objects will be loaded unless the refresh option is specified. + * Removed objects will be marked as removed. + * @param {Object} [options] The load options + * @param {number|boolean} [options.depth=0] The object depth which will be loaded. Depth set to true + * loads objects by reachability. + * @param {boolean} [options.refresh=false] Refresh the local object state from remote. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + load: { + value: function load(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + options = options || {}; + options.local = true; + + return this._metadata.db.load(this.id, null, options).then(doneCallback, failCallback); + } + }, + + /** + * Delete an existing object. + * @param {Object} [options] The remove options + * @param {boolean} [options.force=false] Force the remove operation, the version will not be validated. + * @param {number|boolean} [options.depth=0] The object depth which will be removed. Depth 0 removes this object only, + * true removes objects by reachability. + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + 'delete': { + value: function value(options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._metadata.db.delete(this, options).then(doneCallback, failCallback); + } + }, + + /** + * Saves the object and repeats the operation if the object is out of date. + * In each pass the callback will be called. Ths first parameter of the callback is the entity and the second one + * is a function to abort the process. + * + * @param {Function} cb Will be called in each pass + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + * @method + */ + optimisticSave: { + value: function optimisticSave(cb, doneCallback, failCallback) { + return this._metadata.db.optimisticSave(this, cb).then(doneCallback, failCallback); + } + }, + + attr: { + value: function attr() { + throw new Error("Attr is not yet implemented."); + } + }, + + /** + * Validates the entity by using the validation code of the entity type + * + * @returns {util.ValidationResult} Contains the result of the Validation + * @method + */ + validate: { + value: function validate() { + return this._metadata.db.validate(this); + } + }, + + /** + * Converts the entity to an JSON-Object. + * @param {boolean=} excludeMetadata Indicates if the metadata i.e. id, version and acls should not be included into the json + * @return {json} JSON-Object + * @method + */ + toJSON: { + value: function toJSON(excludeMetadata) { + return this._metadata.getJson(excludeMetadata); + } + } +}); + +module.exports = Entity; + +/** + * The done callback is called, when the asynchronous operation completes successfully + * @callback binding.Entity~doneCallback + * @param {binding.Entity} entity This entity + * @return {Promise<*>|*} A Promise, result or undefined + */ + +/** + * The fail callback is called, when the asynchronous operation is rejected by an error + * @callback binding.Entity~failCallback + * @param {error.PersistentError} error The error which reject the operation + * @return {Promise<*>|*} A Promise, result or undefined + */ + +},{"15":15}],11:[function(_dereq_,module,exports){ +"use strict"; + +var ManagedFactory = _dereq_(16); + +/** + * @class binding.EntityFactory + * @extends binding.ManagedFactory + * + * @param {Object=} properties initial properties to set on the instance + * @param {...*} arguments Additional constructor params passed through the type constructor + * @return {T} The new managed instance + */ +var EntityFactory = ManagedFactory.extend( /** @lends binding.EntityFactory.prototype */{ + /** + * Loads the instance for the given id, or null if the id does not exists. + * @param {string} id The id to query + * @param {Object} [options] The load options + * @param {number|boolean} [options.depth=0] The object depth which will be saved. Depth 0 saves only this object, + * true saves the objects by reachability. + * @param {boolean} [options.refresh=false] Indicates whether the object should be revalidated (cache bypass). + * @param {boolean} [options.local=false] Indicates whether the local copy (from the entity manager) + * of an object should be returned if it exists. This value might be stale. + * @param {binding.EntityFactory~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.EntityFactory~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A Promise that will be fulfilled when the asynchronous operation completes. + */ + load: function load(id, options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + return this._db.load(this._managedType.typeConstructor, id, options).then(doneCallback, failCallback); + }, + + + /** + * Creates a new instance and sets the DatabaseObject to the given json + * @param {json} json + * @returns {T} instance + */ + fromJSON: function fromJSON(json) { + var instance = json.id ? this._db.getReference(this._managedType.typeConstructor, json.id) : this.newInstance(); + var metadata = instance._metadata; + metadata.setJson(json); + return instance; + }, + + + /** + * Creates a new query for this class + * @return {query.Builder} The query builder + */ + find: function find() { + return this._db.createQueryBuilder(this._managedType.typeConstructor); + }, + partialUpdate: function partialUpdate() { + throw new Error("partialUpdate is not yet implemented."); + } + + /** + * Creates a new instance of the of this type + * @function + * @name new + * @param {Object} properties Additional properties which will be applied to the created instance + * @return {binding.Entity} A new created instance of this class + * @memberOf binding.EntityFactory.prototype + */ + +}); + +module.exports = EntityFactory; + +/** + * The entity callback is called, when the asynchronous operation completes successfully + * @callback binding.EntityFactory~doneCallback + * @param {T} entity The entity + * @return {Promise<*>|*} A Promise or result + */ + +/** + * The fail callback is called, when the asynchronous operation is rejected by an error + * @callback binding.EntityFactory~failCallback + * @param {error.PersistentError} error The error which reject the operation + * @return {Promise<*>|*} A Promise or result + */ + +},{"16":16}],12:[function(_dereq_,module,exports){ +"use strict"; + +/** + * This factory creates instances of type T, by invoking the {@link #new()} method or by instanciating this factory directly + * @class binding.Factory + * + * @param {...any} args constructor params passed to the type constructor + * @return {T} The new instance + */ + +var Factory = _extend( /** @lends binding.Factory.prototype */{ + + /** + * Creates a child factory of this factory + * @param {Object} factoryMembers additional members applied to the child factory + * @returns {Object} The new created child Factory + * @static + * @ignore + */ + extend: function extend(factoryMembers) { + //copy all factory members to the child factory + return _extend({}, this, factoryMembers); + }, + + + /** + * Creates a new Factory for the given type + * @param {Class<*>} type the type constructor of T + * @return {binding.Factory} A new object factory to created instances of T + * @static + * @ignore + */ + create: function create(type) { + var factory = function Factory(properties) { + return factory.newInstance(arguments); + }; + + _extend(factory, this); + + //lets instanceof work properly + factory.prototype = type.prototype; + factory._type = type; + + return factory; + }, + + + /** + * Creates a new instance of the factory type + * @param {...any} args Constructor arguments used for instantiation + * @return {*} A new created instance of * + * @instance + */ + new: function _new() { + return this.newInstance(arguments); + }, + + + /** + * Creates a new instance of the factory type + * @param {Array<*>=} a Constructor arguments used for instantiation + * @return {*} A new created instance of * + * @instance + */ + newInstance: function newInstance(a) { + var instance; + if (!a || a.length == 0) { + instance = new this._type(); + } else { + //es6 constructors can't be called, therfore we must provide all arguments separately + //TODO: uggly! replace this with the spread operator if node support it + instance = new this._type(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9]); + } + + return instance; + } +}); + +function _extend(target) { + for (var i = 1, source; source = arguments[i]; ++i) { + for (var _iterator = Object.getOwnPropertyNames(source), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var prop = _ref; + + Object.defineProperty(target, prop, Object.getOwnPropertyDescriptor(source, prop)); + } + }return target; +} + +module.exports = Factory; + +},{}],13:[function(_dereq_,module,exports){ +"use strict"; + +var error = _dereq_(34); +var Acl = _dereq_(1); +var util = _dereq_(71); +var message = _dereq_(36); +var StatusCode = _dereq_(25).StatusCode; + +var PREFIX = '/file'; +var LEN = PREFIX.length; + +/** + * Creates a file object, which represents one specific file reference. + * This File object can afterwards be used to up- and download the file contents or to retrieves and change the files + * metadata. + * + * The file data can be uploaded and downloaded as: + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
typeJavaScript typeDescription
'arraybuffer'ArrayBufferThe content is represented as a fixed-length raw binary data buffer
'blob' + * BlobThe content is represented as a simple blob
'json'object|array|stringThe file content is represented as json
'text'stringThe file content is represented through the string
'base64'stringThe file content as base64 encoded string
'data-url'stringA data url which represents the file content
+ * + * + * @alias binding.File + */ + +var File = function () { + babelHelpers.createClass(File, [{ + key: 'id', + + + /** + * The complete id of the file, including folder and name + * @type string + */ + get: function get() { + return this._id; + } + + /** + * The fully url to the file, can be directly used to link the file, i.e. in link tags ot image sources + * @type string + */ + + }, { + key: 'url', + get: function get() { + if (this.isFolder) { + throw new Error("Url can not be created for folders."); + } + if (!this._url) { + this._url = this._db.createURL(this.id, this.bucket != 'www'); + } + return this._url; + } + + /** + * The name of the file + * @type string + */ + + }, { + key: 'name', + get: function get() { + if (!this._name) this._name = this._id.substring(this._id.lastIndexOf('/', this._id.length - 2) + 1); + return this._name; + } + + /** + * The mimeType of the file, only accessible after fetching the metadata or downloading/uploading/providing the file + * @type string + */ + + }, { + key: 'mimeType', + get: function get() { + if (this.isFolder) { + throw new Error("A folder has no mimeType"); + } + this._checkAvailable(); + return this._mimeType; + } + + /** + * The current file acl, only accessible after fetching the metadata or downloading/uploading/providing the file + * @type string + */ + + }, { + key: 'acl', + get: function get() { + this._checkAvailable(); + return this._acl; + } + + /** + * The last modified date of the file, only accessible after fetching the metadata or downloading/uploading/providing the eTag + * @type string + */ + + }, { + key: 'lastModified', + get: function get() { + if (this.isFolder) { + throw new Error("A folder has no lastModified"); + } + this._checkAvailable(); + return this._lastModified; + } + + /** + * The eTag of the file, only accessible after fetching the metadata or downloading/uploading/providing the file + * @type string + */ + + }, { + key: 'eTag', + get: function get() { + if (this.isFolder) { + throw new Error("A folder has no eTag"); + } + this._checkAvailable(); + return this._eTag; + } + + /** + * The size of the file, only accessible after fetching the metadata or downloading/uploading/providing the file + * @type string + */ + + }, { + key: 'size', + get: function get() { + if (this.isFolder) { + throw new Error("A folder has no size"); + } + this._checkAvailable(); + return this._size; + } + }, { + key: 'bucket', + get: function get() { + return this.id.substring(LEN + 1, this.id.indexOf('/', LEN + 1)); + } + }, { + key: 'key', + get: function get() { + return this.id.substring(this.id.indexOf('/', LEN + 1) + 1); + } + + /** + * The full path of the file. + * @type string + */ + + }, { + key: 'path', + get: function get() { + return this.id.substring(LEN); + } + + /** + * The parent folder of the file. + * @type string + */ + + }, { + key: 'parent', + get: function get() { + return this.id.substring(LEN, this.id.lastIndexOf('/', this.id.length - 2)); + } + + /** + * Indicates if the metadata are loaded. + * @type boolean + */ + + }, { + key: 'isMetadataLoaded', + get: function get() { + return this._available; + } + + /** + * Creates a new file object which represents the a file at the given id. Data are provided to the constructor will + * be uploaded by invoking {@link upload()} + * @param {object|string} fileOptions The fileOptions used to create a new file object, or just the id of the + * file object + * @param {string=} fileOptions.id The id of the file. + * @param {string=} fileOptions.name The filename without the id. If omitted and data is provided as a file object, the + * {@link File#name} will be used otherwise a uuid will be generated. + * @param {string} [fileOptions.parent="/www"] The parent folder which contains the file + * @param {string} [fileOptions.path="/www"] The full path of the file. You might either specifiy the path of the file or a combination of parent and file name. + * @param {string|Blob|File|ArrayBuffer|json=} fileOptions.data The initial file content, which will be uploaded by + * invoking {@link #upload} later on. + * @param {string=} fileOptions.type A optional type hint used to correctly interpret the provided data + * @param {string=} fileOptions.mimeType The mimType of the file. Defaults to the mimeType of the provided data if + * it is a file object, blob or data-url + * @param {string=} fileOptions.eTag The optional current ETag of the file + * @param {string=} fileOptions.lastModified The optional last modified date + * @param {Acl=} fileOptions.acl The file acl which will be set, if the file is uploaded afterwards + */ + + }]); + + function File(fileOptions) { + babelHelpers.classCallCheck(this, File); + + fileOptions = fileOptions || {}; + + this._available = false; + + if (Object(fileOptions) instanceof String) { + var id = fileOptions; + var nameSeparator = id.indexOf('/', '/file/'.length); + if (nameSeparator == -1 || id.indexOf('/file/') != 0) { + throw new Error('Invalid file reference ' + id); + } + + this._id = id; + } else if (fileOptions.id) { + this._id = fileOptions.id; + this._setMetadata(fileOptions); + } else { + var path = void 0; + if (fileOptions.path) { + path = fileOptions.path; + } else { + var parent = fileOptions.parent || '/www'; + if (parent.charAt(parent.length - 1) != '/') parent = parent + '/'; + + if (parent.length < 3) { + throw new Error('Invalid parent name: ' + parent); + } + + var name = fileOptions.name || fileOptions.data && fileOptions.data.name || util.uuid(); + path = parent + name; + } + + if (path.charAt(0) != '/') path = '/' + path; + + if (path.indexOf('//') != -1 || path.length < 3) throw new Error('Invalid path: ' + path); + + this._id = PREFIX + path; + this._setMetadata(fileOptions); + } + + /** + * Specifies whether this file is a folder. + * @type {boolean} + */ + this.isFolder = this._id.charAt(this._id.length - 1) == '/'; + } + + /** + * Uploads the file content which was provided in the constructor or by uploadOptions.data + * @param {object=} uploadOptions The upload options + * @param {string|Blob|File|ArrayBuffer|json=} uploadOptions.data The initial file content, which will be uploaded by + * invoking {@link #upload} later on. + * @param {string=} uploadOptions.type A optional type hint used to correctly interpret the provided data + * @param {string=} uploadOptions.mimeType The mimType of the file. Defaults to the mimeType of the provided data if + * it is a file object, blob or data-url + * @param {string=} uploadOptions.eTag The optional current ETag of the file + * @param {string=} uploadOptions.lastModified The optional last modified date + * @param {Acl=} uploadOptions.acl The file acl which will be set, if the file is uploaded afterwards + * @param {boolean} [uploadOptions.force=false] force the upload and overwrite any existing files without validating it + * @param {connector.Message~progressCallback} [uploadOptions.progress] listen to progress changes during upload + * @param {binding.File~fileCallback=} doneCallback The callback is invoked after the upload succeed successfully + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error is occurred + * @return {Promise} A promise which will be fulfilled with this file object where the metadata is updated + */ + + + File.prototype.upload = function upload(uploadOptions, doneCallback, failCallback) { + var _this = this; + + uploadOptions = uploadOptions || {}; + + if (this.isFolder) { + throw new Error("A folder cannot be uploaded"); + } + + this._setMetadata(uploadOptions); + + var uploadMessage = new message.UploadFile(this.bucket, this.key).entity(this._data, this._type).acl(this._acl); + + uploadMessage.progress(uploadOptions.progress); + + if (this._size) { + uploadMessage.contentLength(this._size); + } + + if (this._mimeType) { + uploadMessage.mimeType(this._mimeType); + } + + this._conditional(uploadMessage, uploadOptions); + + this._db.addToBlackList(this.id); + return this._db.send(uploadMessage).then(function (response) { + _this._data = null; + _this._type = null; + + _this.fromJSON(response.entity); + return _this; + }).then(doneCallback, failCallback); + }; + + /** + * Download a file and providing it in the requested type + * @param {object=} downloadOptions The download options + * @param {string} [downloadOptions.type="blob"] The type used to provide the file + * @param {string} [downloadOptions.refresh=false] Indicates to make a revalidation request and not use the cache + * @param {binding.File~downloadCallback=} doneCallback The callback is invoked after the download succeed successfully + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error is occurred + * @return {Promise} A promise which will be fulfilled with the downloaded file content + */ + + + File.prototype.download = function download(downloadOptions, doneCallback, failCallback) { + var _this2 = this; + + downloadOptions = downloadOptions || {}; + + if (this.isFolder) { + throw new Error("A folder cannot be downloaded"); + } + + var type = downloadOptions.type || 'blob'; + + var downloadMessage = new message.DownloadFile(this.bucket, this.key).responseType(type); + + this._db.ensureCacheHeader(this.id, downloadMessage, downloadOptions.refresh); + + return this._db.send(downloadMessage).then(function (response) { + _this2._db.addToWhiteList(_this2.id); + _this2._fromHeaders(response.headers); + return response.entity; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + return null; + } else { + throw e; + } + }).then(doneCallback, failCallback); + }; + + /** + * Deletes a file + * @param {object=} deleteOptions The delete options + * @param {boolean} [deleteOptions.force=false] force the deletion without verifying any version + * @param {binding.File~deleteCallback=} doneCallback The callback is invoked after the deletion succeed successfully + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error is occurred + * @return {Promise} A promise which will be fulfilled with this file object + */ + + + File.prototype.delete = function _delete(deleteOptions, doneCallback, failCallback) { + deleteOptions = deleteOptions || {}; + + if (this.isFolder) { + throw new Error("A folder cannot be deleted"); + } + + var deleteMessage = new message.DeleteFile(this.bucket, this.key); + this._conditional(deleteMessage, deleteOptions); + + this._db.addToBlackList(this.id); + return this._db.send(deleteMessage).then(function () { + return this; + }).then(doneCallback, failCallback); + }; + + File.prototype._conditional = function _conditional(message, options) { + if (!options.force) { + if (this._lastModified) message.ifUnmodifiedSince(this._lastModified); + if (this._eTag) message.ifMatch(this._eTag); + if (!this._lastModified && !this._eTag) message.ifNoneMatch('*'); + } + }; + + /** + * Gets the file metadata of a file + * @param {Object} options The load metadata options + * @param {Object} [options.refresh=false] Force a revalidation while fetching the metadata + * @param {binding.File~fileCallback=} doneCallback The callback is invoked after the metadata is fetched + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise} A promise which will be fulfilled with this file + */ + + + File.prototype.loadMetadata = function loadMetadata(options, doneCallback, failCallback) { + var _this3 = this; + + options = options || {}; + + if (this.isFolder) { + throw new Error("A folder has no matadata"); + } + + var msg = new message.GetFileMetadata(this.bucket, this.key); + this._db.ensureCacheHeader(this.id, msg, options.refresh); + return this._db.send(msg).then(function (response) { + // do not white list the file, because head-request does not revalidate the cache. + _this3._fromHeaders(response.headers); + return _this3; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + return null; + } else { + throw e; + } + }).then(doneCallback, failCallback); + }; + + /** + * Updates the matadata of this file. + * @param {boolean} [options.force=false] force the update and overwrite the existing metadata without validating it + * @return {Promise} A promise which will be fulfilled with this file + */ + + + File.prototype.saveMetadata = function saveMetadata(options, doneCallback, failCallback) { + var _this4 = this; + + options = options || {}; + + var metadata = this.toJSON(); + metadata.id = this._id; + + var msg = new message.UpdateFileMetadata(this.bucket, this.key).entity(metadata); + + this._conditional(msg, options); + + return this._db.send(msg).then(function (response) { + _this4.fromJSON(response); + return _this4; + }); + }; + + /** + * Validates and sets the file metadata based on the given options + * @param {Object} options + * @private + */ + + + File.prototype._setMetadata = function _setMetadata(options) { + var data = options.data; + var type = options.type; + var eTag = options.eTag; + var acl = options.acl; + var size = options.size; + var mimeType = options.mimeType; + var lastModified = options.lastModified; + + if (!data) { + this._available = false; + } else { + if (typeof Blob !== "undefined" && data instanceof Blob) { + mimeType = mimeType || data.type; + } else if (type == 'data-url') { + var match = data.match(/^data:(.+?)(;base64)?,.*$/); + mimeType = mimeType || match[1]; + } + + this._data = data; + this._type = type; + this._size = size; + + this._mimeType = mimeType; + this._acl = acl || this._acl || new Acl(); + this._available = true; + } + + this._eTag = eTag || this._eTag; + + if (lastModified) { + this._lastModified = new Date(lastModified); + } + }; + + File.prototype._fromHeaders = function _fromHeaders(headers) { + this.fromJSON({ + eTag: headers.etag ? headers.etag.substring(1, headers.etag.length - 1) : null, + lastModified: headers['last-modified'], + mimeType: headers['content-type'], + acl: headers['baqend-acl'] && JSON.parse(headers['baqend-acl']), + contentLength: +headers['baqend-size'] + }); + }; + + File.prototype.fromJSON = function fromJSON(metadata) { + if (metadata.mimeType) this._mimeType = metadata.mimeType; + + if (metadata.lastModified) this._lastModified = new Date(metadata.lastModified); + + if (metadata.eTag) this._eTag = metadata.eTag; + + this._acl = this._acl || new Acl(); + if (metadata.acl) this._acl.fromJSON(metadata.acl); + + if (metadata.contentLength) this._size = metadata.contentLength; + + this._available = true; + }; + + File.prototype.toJSON = function toJSON() { + var result = { + mimeType: this._mimeType, + eTag: this._eTag, + acl: this._acl, + contentLength: this._size + }; + + if (this._lastModified) { + result.lastModified = this._lastModified.toISOString(); + } + return result; + }; + + File.prototype._checkAvailable = function _checkAvailable() { + if (!this._available) { + throw new error.PersistentError('The file metadata of ' + this.id + ' is not available.'); + } + }; + + /** + * The database connection to use + * @member {EntityManager} _db + * @private + */ + + + return File; +}(); + +/** + * The file callback is called, when the asynchronous operation completes successfully + * @callback binding.File~fileCallback + * @param {binding.File} file The updated file metadata + * @return {any} A Promise, result or undefined + */ + +/** + * The download callback is called, when the asynchronous download completes successfully + * @callback binding.File~downloadCallback + * @param {string|Blob|File|ArrayBuffer|json} data The download file content in the requested format + * @return {any} A Promise, result or undefined + */ + +/** + * The delete callback is called, when the asynchronous deletion completes successfully + * @callback binding.File~deleteCallback + * @param {binding.File} data The file metadata + * @return {any} A Promise, result or undefined + */ + +/** + * The fail callback is called, when the asynchronous operation is rejected by an error + * @callback binding.File~failCallback + * @param {error.PersistentError} error The error which reject the operation + * @return {any} A Promise, result or undefined + */ + +module.exports = File; + +},{"1":1,"25":25,"34":34,"36":36,"71":71}],14:[function(_dereq_,module,exports){ +"use strict"; + +var Factory = _dereq_(12); +var File = _dereq_(13); +var message = _dereq_(36); +var Permission = _dereq_(65); + +/** + * @class binding.FileFactory + * @extends binding.Factory + * + * @param {Object=} properties initial properties to set on the file + * @param {...*} arguments Additional constructor params passed through the type constructor + * @return {binding.File} The new managed instance + */ +var FileFactory = Factory.extend( /** @lends binding.FileFactory.prototype */{ + + /** + * Creates a new FileFactory for the given type + * @param {EntityManager} db + * @return {binding.FileFactory} A new file factory + * @static + */ + create: function create(db) { + //invoke super method + var factory = Factory.create.call(this, File); + factory._db = db; + return factory; + }, + + + /** + * Creates a new file + * @param {Array<*>=} args Constructor arguments used for instantiation, the constructor will not be called + * when no arguments are passed + * @return {binding.File} A new created file + */ + newInstance: function newInstance(args) { + var instance = Factory.newInstance.call(this, args); + instance._db = this._db; + return instance; + }, + + + /** + * Updates the metadata of the root file directory formally the file "bucket" + * @param {string} bucket The name of the root file directory + * @param {Object} metadata The new metadata for the bucket + * @param {util.Permission} metadata.loadPermission The load permission which grants read access to all stored + * files under the specified bucket + * @param {util.Permission} metadata.insertPermission The insert permission which is required to insert new + * files into the bucket + * @param {util.Permission} metadata.updatePermission The update permission which is required to update existing + * files within the bucket + * @param {util.Permission} metadata.deletePermission The delete permission which is required to delete existing + * files within the bucket + * @param {util.Permission} metadata.queryPermission The query permission which is required to list all files + * within a bucket + * @param {binding.FileFactory~bucketMetadataCallback=} doneCallback Invoked if the operation succeeds + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise} A promise which will fulfilled with the updated metadata + */ + saveMetadata: function saveMetadata(bucket, metadata, doneCallback, failCallback) { + var msg = new message.SetFileBucketMetadata(bucket, metadata); + return this._db.send(msg).then(doneCallback, failCallback); + }, + + + /** + * Gets the metadata of the root folder (formally the file "bucket") + * @param {string} bucket The name of the root file directory + * @param {Object} options The load metadata options + * @param {Object} [options.refresh=false] Force a revalidation while fetching the metadata + * @param {binding.FileFactory~bucketMetadataCallback=} doneCallback The callback is invoked after the metadata is fetched + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise} A promise which will be fulfilled with the bucket acls + */ + loadMetadata: function loadMetadata(bucket, options, doneCallback, failCallback) { + options = options || {}; + + var msg = new message.GetFileBucketMetadata(bucket); + // this._db.ensureCacheHeader(this.id, msg, options.refresh); + // do not white list the file, because head-request does not revalidate the cache. + return this._db.send(msg).then(function (response) { + var result = {}; + Permission.BASE_PERMISSIONS.forEach(function (key) { + result[key] = Permission.fromJSON(response.entity[key] || {}); + }); + return result; + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) { + return null; + } else { + throw e; + } + }).then(doneCallback, failCallback); + }, + + + /** + * Lists all the buckets. + * @param {binding.FileFactory~fileListCallback=} doneCallback The callback is invoked with the listed buckets + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise>} The listed buckets. + */ + listBuckets: function listBuckets(doneCallback, failCallback) { + var _this = this; + + return this._db.send(new message.ListBuckets()).then(function (response) { + return response.entity.map(function (bucket) { + return _this.new(bucket + '/'); + }); + }).then(doneCallback, failCallback); + }, + + + /** + * Lists the files (and folders) in the given folder. + * + * @param {binding.File|string} folder The folder/path to list. + * @param {binding.File} start The file/folder from where to start listing (not included) + * @param {number} count The maximum number of files to return. + * @param {binding.FileFactory~fileListCallback=} doneCallback The callback is invoked with the listed files + * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred + * @return {Promise>} The listed files/folders. + */ + listFiles: function listFiles(folder, start, count, doneCallback, failCallback) { + var _this2 = this; + + if (Object(folder) instanceof String) { + if (folder.charAt(folder.length - 1) != '/') { + folder += '/'; + } + folder = this.new({ path: folder }); + } + + var path = folder.key; + var bucket = folder.bucket; + start = start ? start.key : null; + return this._db.send(new message.ListFiles(bucket, path, start, count)).then(function (response) { + return response.entity.map(function (file) { + return _this2.new(file); + }); + }).then(doneCallback, failCallback); + } + + /** + * Creates a new file object which represents the a file at the given id. Data are provided to the constructor will + * be uploaded by invoking {@link upload()} + * @param {object|string} fileOptions The fileOptions used to create a new file object, or just the id of the + * file object + * @param {string=} fileOptions.name The filename without the id. If omitted and data is provided as a file object, the + * {@link File#name} will be used otherwise a uuid will be generated. + * @param {string} [fileOptions.parent="/www"] The parent folder which contains the file + * @param {string|Blob|File|ArrayBuffer|json=} fileOptions.data The initial file content, which will be uploaded by + * invoking {@link #upload} later on. + * @param {string=} fileOptions.type A optional type hint used to correctly interpret the provided data + * @param {string=} fileOptions.mimeType The mimType of the file. Defaults to the mimeType of the provided data if + * it is a file object, blob or data-url + * @param {string=} fileOptions.eTag The optional current ETag of the file + * @param {string=} fileOptions.lastModified The optional last modified date + * @param {Acl=} fileOptions.acl The file acl which will be set, if the file is uploaded afterwards + * @return {binding.File} A new file instance + * + * @function + * @name new + * @memberOf binding.FileFactory.prototype + */ + +}); + +/** + * The list files callback is called, with the bucket metadata + * @callback binding.FileFactory~bucketMetadataCallback + * @param {Array} bucketMetadata the bucket metadata + * @return {any} A Promise, result or undefined + */ + +/** + * The list files callback is called, with the loaded files + * @callback binding.FileFactory~fileListCallback + * @param {Array} files The listed files + * @return {any} A Promise, result or undefined + */ + +module.exports = FileFactory; + +},{"12":12,"13":13,"36":36,"65":65}],15:[function(_dereq_,module,exports){ +"use strict"; + +var Metadata = _dereq_(63); + +/** + * @alias binding.Managed + */ + +var Managed = function () { + + /** + * Initialize the given instance + * @param {binding.Managed} instance The managed instance to initialize + * @param {Object=} properties The optional properties to set on the instance + */ + Managed.init = function init(instance, properties) { + var type = instance.constructor.__ype__; + if (type) { + Object.defineProperty(instance, '_metadata', { + value: Metadata.create(type, instance), + configurable: true + }); + } + + if (properties) Object.assign(instance, properties); + }; + + /** + * Creates a subclass of this class + * @param {Class<*>} childClass + * @return {Class<*>} The extended child class + */ + + + Managed.extend = function extend(childClass) { + childClass.prototype = Object.create(this.prototype, { + constructor: { + value: childClass, + configurable: true, + writable: true + } + }); + childClass.extend = Managed.extend; + return childClass; + }; + + /** + * The default constructor, copy all given properties to this object + * @param {Object=} properties - The optional properties to copy + */ + + + function Managed(properties) { + babelHelpers.classCallCheck(this, Managed); + + Managed.init(this, properties); + } + + return Managed; +}(); + +Object.defineProperties(Managed.prototype, /** @lends binding.Managed.prototype */{ + /** + * Converts the managed object to an JSON-Object. + * @return {json} JSON-Object + * @method + */ + toJSON: { + value: function toJSON() { + return this._metadata.type.toJsonValue(this._metadata, this); + } + } +}); + +/** + * Contains the metadata of this managed object + * @type util.Metadata + * @name _metadata + * @memberOf binding.Managed + * @private + */ + +module.exports = Managed; + +},{"63":63}],16:[function(_dereq_,module,exports){ +"use strict"; + +var Factory = _dereq_(12); +var Managed = _dereq_(15); + +/** + * @class binding.ManagedFactory + * @extends binding.Factory + * + * @param {Object=} properties initial properties to set on the instance + * @param {...*} args Additional constructor params passed through the type constructor + * @return {T} The new managed instance + */ +var ManagedFactory = Factory.extend( /** @lends binding.ManagedFactory.prototype */{ + + /** + * Creates a new ManagedFactory for the given type + * @param {metamodel.ManagedType} managedType The metadata of type T + * @param {EntityManager} db + * @return {binding.ManagedFactory<*>} A new object factory to created instances of T + * @static + * @ignore + */ + create: function create(managedType, db) { + //invoke super method + var factory = Factory.create.call(this, managedType.typeConstructor); + factory.methods = factory.prototype; + + factory._managedType = managedType; + factory._db = db; + + return factory; + }, + + + /** + * Creates a new instance of the factory type + * @param {Array<*>=} args Constructor arguments used for instantiation, the constructor will not be called + * when no arguments are passed + * @return {T} A new created instance of T + */ + newInstance: function newInstance(args) { + var instance = args ? Factory.newInstance.call(this, args) : this._managedType.create(args); + instance._metadata.db = this._db; + return instance; + }, + + + /** + * Creates a new instance and sets the Managed Object to the given json + * @param {json} json + * @returns {T} instance + */ + fromJSON: function fromJSON(json) { + var instance = this.newInstance(); + var metadata = instance._metadata; + this._managedType.fromJsonValue(metadata, json, instance); + return instance; + }, + + + /** + * Adds methods to instances of this factories type + * @param {Object} methods The methods to add + */ + addMethods: function addMethods(methods) { + Object.assign(this.methods, methods); + }, + + + /** + * Add a method to instances of this factories type + * @param {string} name The method name to add + * @param {Function} fn The Method to add + */ + addMethod: function addMethod(name, fn) { + this.methods[name] = fn; + } + + /** + * Methods that are added to object instances + * This property is an alias for this factory type prototype + * @name methods + * @type {Object} + * @memberOf binding.ManagedFactory.prototype + */ + + /** + * The managed type of this factory + * @name _managedType + * @type metamodel.ManagedType + * @protected + * @memberOf binding.ManagedFactory.prototype + */ + + /** + * The owning EntityManager where this factory belongs to + * @name _db + * @type EntityManager + * @protected + * @memberOf binding.ManagedFactory.prototype + */ + + /** + * Creates a new instance of the of this type + * @function + * @name new + * @param {Object} properties Additional properties which will be applied to the created instance + * @return {T} A new created instance of this class + * @memberOf binding.ManagedFactory.prototype + */ + +}); + +module.exports = ManagedFactory; + +},{"12":12,"15":15}],17:[function(_dereq_,module,exports){ +"use strict"; + +var Entity = _dereq_(10); +var User = _dereq_(18); + +/** + * @alias binding.Role + * @extends binding.Entity + */ + +var Role = function (_Entity) { + babelHelpers.inherits(Role, _Entity); + + /** + * The default constructor, copy all given properties to this object + * @param {Object=} properties - The optional properties to copy + */ + function Role(properties) { + babelHelpers.classCallCheck(this, Role); + return babelHelpers.possibleConstructorReturn(this, _Entity.call(this, properties)); + } + + return Role; +}(Entity); + +Object.defineProperties(Role.prototype, /** @lends binding.Role.prototype */{ + /** + * Test if the given user has this role + * @return {boolean} true if the given user has this role, + * otherwise false + * @method + */ + hasUser: { + value: function hasUser(user) { + return this.users && this.users.has(user); + } + }, + + /** + * Add the given user to this role + * @param {model.User} user The user to add + * @method + */ + addUser: { + value: function addUser(user) { + if (user instanceof User) { + if (!this.users) this.users = new Set(); + + this.users.add(user); + } else { + throw new Error('Only user instances can be added to a role.'); + } + } + }, + + /** + * Remove the given user from this role + * @param {model.User} user The user to remove + * @method + */ + removeUser: { + value: function removeUser(user) { + if (user instanceof User) { + if (this.users) this.users.delete(user); + } else { + throw new Error('Only user instances can be removed from a role.'); + } + } + } + + /** + * A set of users which have this role + * @type Set + * @name users + * @memberOf binding.Role.prototype + */ + + /** + * The name of the role + * @type string + * @name name + * @memberOf binding.Role.prototype + */ +}); + +module.exports = Role; + +},{"10":10,"18":18}],18:[function(_dereq_,module,exports){ +"use strict"; + +var Entity = _dereq_(10); + +/** + * @alias binding.User + * @extends binding.Entity + */ + +var User = function (_Entity) { + babelHelpers.inherits(User, _Entity); + + /** + * The default constructor, copy all given properties to this object + * @param {Object=} properties - The optional properties to copy + */ + function User(properties) { + babelHelpers.classCallCheck(this, User); + return babelHelpers.possibleConstructorReturn(this, _Entity.call(this, properties)); + } + + return User; +}(Entity); + +Object.defineProperties(User.prototype, /** @lends binding.User.prototype */{ + + /** + * Change the password of the given user + * + * @param {string} currentPassword Current password of the user + * @param {string} password New password of the user + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * @method + */ + newPassword: { + value: function newPassword(currentPassword, password, doneCallback, failCallback) { + return this._metadata.db.newPassword(this.username, currentPassword, password).then(doneCallback, failCallback); + } + } + + /** + * The users username or email address + * @type string + * @name username + * @memberOf binding.User.prototype + */ + + /** + * Indicates if the user is currently inactive, which disallow user login + * @type boolean + * @name inactive + * @memberOf binding.User.prototype + */ +}); + +module.exports = User; + +},{"10":10}],19:[function(_dereq_,module,exports){ +"use strict"; + +var EntityFactory = _dereq_(11); + +/** + * @class binding.UserFactory + * @extends binding.EntityFactory + * + * Creates a new instance of the managed type of this factory + * @param {Object=} properties initial properties to set on the instance + * @param {...*} arguments Additional constructor params passed through the type constructor + * @return {model.User} The new managed instance + */ +var UserFactory = EntityFactory.extend( /** @lends binding.UserFactory.prototype */{ + /** + * The current logged in user, or null if the user is not logged in + * @type model.User + */ + get me() { + return this._db.me; + }, + + /** + * Register a new user with the given username and password, if the username is not used by an another user. + * @param {string|model.User} user The username as a string or a Object, which must contain the username. + * @param {string} password The password for the given user + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default logs the user in after a successful registration and keeps the user logged in over multiple sessions + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} The created user object, for the new registered user. + */ + register: function register(user, password, loginOption, doneCallback, failCallback) { + if (loginOption instanceof Function) { + failCallback = doneCallback; + doneCallback = loginOption; + loginOption = true; + } + + user = Object(user) instanceof String ? this.fromJSON({ username: user }) : user; + return this._db.register(user, password, loginOption === undefined ? true : loginOption).then(doneCallback, failCallback); + }, + + + /** + * Log in the user with the given username and password and starts a user session + * @param {string} username The username of the user + * @param {string} password The password of the user + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + */ + login: function login(username, password, loginOption, doneCallback, failCallback) { + if (loginOption instanceof Function) { + failCallback = doneCallback; + doneCallback = loginOption; + loginOption = true; + } + + return this._db.login(username, password, loginOption === undefined ? true : loginOption).then(doneCallback, failCallback); + }, + + + /** + * Log out the current logged in user and ends the active user session + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise<*>} + */ + logout: function logout(doneCallback, failCallback) { + return this._db.logout().then(doneCallback, failCallback); + }, + + + /** + * Change the password of the given user + * + * @param {string} username Username to identify the user + * @param {string} password Current password of the user + * @param {string} newPassword New password of the user + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + */ + newPassword: function newPassword(username, password, _newPassword, doneCallback, failCallback) { + return this._db.newPassword(username, password, _newPassword).then(doneCallback, failCallback); + } + + /** + * Prompts the user for the Google login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/google and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=585] defines the width of the popup window + * @param {number} [options.height=545] defines the height of the popup window + * @param {string} [options.scope="email"] the range of rights requested from the user + * @param {Object} [options.state={}] + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithGoogle + * @memberOf binding.UserFactory.prototype + */ + + /** + * Prompts the user for the Facebook login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/facebook and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=1140] defines the width of the popup window + * @param {number} [options.height=640] defines the height of the popup window + * @param {string} [options.scope="email"] the range of rights requested from the user + * @param {Object} [options.state={}] + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithFacebook + * @memberOf binding.UserFactory.prototype + */ + + /** + * Prompts the user for the GitHub login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/github and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=1040] defines the width of the popup window + * @param {number} [options.height=580] defines the height of the popup window + * @param {string} [options.scope="user:email"] the range of rights requested from the user + * @param {Object} [options.state={}] + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithGitHub + * @memberOf binding.UserFactory.prototype + */ + + /** + * Prompts the user for the Twitter login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/twitter and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=740] defines the width of the popup window + * @param {number} [options.height=730] defines the height of the popup window + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithTwitter + * @memberOf binding.UserFactory.prototype + */ + + /** + * Prompts the user for the LinkedIn login in a new window. Before using OAuth you need to setup your application + * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/linkedin and copy the client id + * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in. + * + * @param {string} clientID + * @param {Object=} options + * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions + * @param {string} [options.title="Login"] sets the title of the popup window + * @param {number} [options.width=630] defines the width of the popup window + * @param {number} [options.height=530] defines the height of the popup window + * @param {string} [options.scope=""] the range of rights requested from the user + * @param {Object} [options.state={}] + * @param {number} [options.timeout=5 * 60 * 1000] + * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed. + * @param {binding.Entity~failCallback=} failCallback Called when the operation failed. + * @return {Promise} + * + * @function + * @name loginWithLinkedIn + * @memberOf binding.UserFactory.prototype + */ + + /** + * Creates a new user object + * @function + * @name new + * @param {Object} properties Additional properties which will be applied to the created instance + * @return {model.User} A new created user + * @memberOf binding.UserFactory.prototype + */ + +}); + +/** + * @alias binding.UserFactory.LoginOption + * @enum {number} + */ +UserFactory.LoginOption = { + /** + * Do not login the user after a successful registration + */ + NO_LOGIN: -1, + /** + * Login in after a successful registration and keep the token in a nonpermanent storage, i.e SessionStorage + */ + SESSION_LOGIN: 0, + /** + * Login in after a successful registration and keep the token in a persistent storage, i.e LocalStorage + */ + PERSIST_LOGIN: 1 +}; + +/** + * @alias binding.UserFactory.DefaultOptions + * @property {Object} oauth default properties + * @property {Object} oauth.google default oauth properties for Google + * @property {Object} oauth.facebook default oauth properties for Facebook + * @property {Object} oauth.github default oauth properties for GitHub + * @property {Object} oauth.twitter default oauth properties for Twitter + * @property {Object} oauth.linkedin default oauth properties for LinkedIn + */ +UserFactory.DefaultOptions = { + google: { + width: 585, + height: 545, + scope: 'email' + }, + facebook: { + width: 1140, + height: 640, + scope: 'email' + }, + github: { + width: 1040, + height: 580, + scope: 'user:email' + }, + twitter: { + width: 740, + height: 730 + }, + linkedin: { + width: 630, + height: 530, + scope: '' + } +}; + +["Google", "Facebook", "GitHub", "Twitter", "LinkedIn"].forEach(function (name) { + UserFactory["loginWith" + name] = function (clientID, options, doneCallback, failCallback) { + //noinspection JSPotentiallyInvalidUsageOfThis + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + options = Object.assign({}, UserFactory.DefaultOptions[name.toLowerCase()], options || {}); + + return this._db.loginWithOAuth(name, clientID, options).then(doneCallback, failCallback); + }; +}); + +module.exports = UserFactory; + +},{"11":11}],20:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace binding + */ + +exports.Accessor = _dereq_(7); +exports.Enhancer = _dereq_(9); +exports.Factory = _dereq_(12); +exports.ManagedFactory = _dereq_(16); +exports.EntityFactory = _dereq_(11); +exports.UserFactory = _dereq_(19); +exports.DeviceFactory = _dereq_(8); +exports.FileFactory = _dereq_(14); +exports.Managed = _dereq_(15); +exports.Entity = _dereq_(10); +exports.Role = _dereq_(17); +exports.User = _dereq_(18); +exports.File = _dereq_(13); + +},{"10":10,"11":11,"12":12,"13":13,"14":14,"15":15,"16":16,"17":17,"18":18,"19":19,"7":7,"8":8,"9":9}],21:[function(_dereq_,module,exports){ +"use strict"; + +var atob = _dereq_(70).atob; + +/** + * @alias caching.BloomFilter + */ + +var BloomFilter = function () { + function BloomFilter(rawBF) { + babelHelpers.classCallCheck(this, BloomFilter); + + this.bytes = atob(rawBF.b); + this.bits = rawBF.m; + this.hashes = rawBF.h; + this.creation = new Date().getTime(); + } + + BloomFilter.prototype.contains = function contains(element) { + for (var _iterator = BloomFilter._getHashes(element, this.bits, this.hashes), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var hash = _ref; + + if (!this._isSet(hash)) { + return false; + } + } + return true; + }; + + BloomFilter.prototype._isSet = function _isSet(index) { + var pos = Math.floor(index / 8); + var bit = 1 << index % 8; + //Extract byte as int or NaN if out of range + var byte = this.bytes.charCodeAt(pos); + //Bit-wise AND should be non-zero (NaN always yields false) + return (byte & bit) != 0; + }; + + BloomFilter._getHashes = function _getHashes(element, bits, hashes) { + var hashValues = new Array(this.hashes); + var hash1 = BloomFilter._murmur3(0, element); + var hash2 = BloomFilter._murmur3(hash1, element); + for (var i = 0; i < hashes; i++) { + hashValues[i] = (hash1 + i * hash2) % bits; + } + return hashValues; + }; + + BloomFilter._murmur3 = function _murmur3(seed, key) { + var remainder, bytes, h1, h1b, c1, c2, k1, i; + remainder = key.length & 3; + bytes = key.length - remainder; + h1 = seed; + c1 = 0xcc9e2d51; + c2 = 0x1b873593; + i = 0; + + while (i < bytes) { + k1 = key.charCodeAt(i) & 0xff | (key.charCodeAt(++i) & 0xff) << 8 | (key.charCodeAt(++i) & 0xff) << 16 | (key.charCodeAt(++i) & 0xff) << 24; + ++i; + + k1 = (k1 & 0xffff) * c1 + (((k1 >>> 16) * c1 & 0xffff) << 16) & 0xffffffff; + k1 = k1 << 15 | k1 >>> 17; + k1 = (k1 & 0xffff) * c2 + (((k1 >>> 16) * c2 & 0xffff) << 16) & 0xffffffff; + + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1b = (h1 & 0xffff) * 5 + (((h1 >>> 16) * 5 & 0xffff) << 16) & 0xffffffff; + h1 = (h1b & 0xffff) + 0x6b64 + (((h1b >>> 16) + 0xe654 & 0xffff) << 16); + } + + k1 = 0; + + switch (remainder) { + case 3: + k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16; + case 2: + k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8; + case 1: + k1 ^= key.charCodeAt(i) & 0xff; + + k1 = (k1 & 0xffff) * c1 + (((k1 >>> 16) * c1 & 0xffff) << 16) & 0xffffffff; + k1 = k1 << 15 | k1 >>> 17; + k1 = (k1 & 0xffff) * c2 + (((k1 >>> 16) * c2 & 0xffff) << 16) & 0xffffffff; + h1 ^= k1; + } + + h1 ^= key.length; + + h1 ^= h1 >>> 16; + h1 = (h1 & 0xffff) * 0x85ebca6b + (((h1 >>> 16) * 0x85ebca6b & 0xffff) << 16) & 0xffffffff; + h1 ^= h1 >>> 13; + h1 = (h1 & 0xffff) * 0xc2b2ae35 + (((h1 >>> 16) * 0xc2b2ae35 & 0xffff) << 16) & 0xffffffff; + h1 ^= h1 >>> 16; + + return h1 >>> 0; + }; + + return BloomFilter; +}(); + +module.exports = BloomFilter; + +},{"70":70}],22:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace caching + */ +exports.BloomFilter = _dereq_(21); + +},{"21":21}],23:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); +var message = _dereq_(36); + +/** + * @alias connector.Connector + */ + +var Connector = function () { + + /** + * @param {string} host or location + * @param {number=} port + * @param {boolean=} secure true for an secure connection + * @param {string=} basePath The basepath of the api + * @return {connector.Connector} + */ + Connector.create = function create(host, port, secure, basePath) { + if (typeof window !== 'undefined') { + if (!host) { + host = window.location.hostname; + port = Number(window.location.port); + } + + if (secure === undefined) { + secure = window.location.protocol == 'https:'; + } + } + + //ensure right type + secure = !!secure; + if (basePath === undefined) basePath = Connector.DEFAULT_BASE_PATH; + + if (host.indexOf('/') != -1) { + var matches = /^(https?):\/\/([^\/:]+|\[[^\]]+])(:(\d*))?(\/\w+)?\/?$/.exec(host); + if (matches) { + secure = matches[1] == 'https'; + host = matches[2].replace(/(\[|])/g, ''); + port = matches[4]; + basePath = matches[5] || ''; + } else { + throw new Error('The connection uri host ' + host + ' seems not to be valid'); + } + } else if (host != 'localhost' && /^[a-z0-9-]*$/.test(host)) { + //handle app names as hostname + host += secure ? Connector.SSL_DOMAIN : Connector.HTTP_DOMAIN; + } + + if (!port) port = secure ? 443 : 80; + + var url = Connector.toUri(host, port, secure, basePath); + var connection = this.connections[url]; + + if (!connection) { + for (var name in this.connectors) { + var connector = this.connectors[name]; + if (connector.isUsable && connector.isUsable(host, port, secure, basePath)) { + connection = new connector(host, port, secure, basePath); + break; + } + } + + if (!connection) throw new Error('No connector is usable for the requested connection.'); + + this.connections[url] = connection; + } + + return connection; + }; + + Connector.toUri = function toUri(host, port, secure, basePath) { + var uri = (secure ? 'https://' : 'http://') + (host.indexOf(':') != -1 ? '[' + host + ']' : host); + uri += secure && port != 443 || !secure && port != 80 ? ':' + port : ''; + uri += basePath; + return uri; + }; + + /** + * @param {string} host + * @param {number} port + * @param {boolean} secure + * @param {string} basePath + */ + + + function Connector(host, port, secure, basePath) { + babelHelpers.classCallCheck(this, Connector); + + this.host = host; + this.port = port; + this.secure = secure; + this.basePath = basePath; + + //the origin do not contains the basepath + this.origin = Connector.toUri(host, port, secure, ""); + } + + /** + * @param {connector.Message} message + * @returns {Promise} + */ + + + Connector.prototype.send = function send(message) { + var _this = this; + + if (message.request.method == 'OAUTH') { + message.addRedirectOrigin(this.origin + this.basePath); + } + + var response = { status: 0 }; + return new Promise(function (resolve) { + _this.prepareRequest(message); + _this.doSend(message, message.request, resolve); + }).then(function (res) { + return response = res; + }).then(function () { + return _this.prepareResponse(message, response); + }).then(function () { + message.doReceive(response); + return response; + }).catch(function (e) { + response.entity = null; + throw PersistentError.of(e); + }); + }; + + /** + * Handle the actual message send + * @param {connector.Message} message + * @param {Object} request + * @param {Function} receive + * @abstract + */ + + + Connector.prototype.doSend = function doSend(message, request, receive) {}; + + /** + * @param {connector.Message} message + */ + + + Connector.prototype.prepareRequest = function prepareRequest(message) { + var mimeType = message.mimeType(); + if (!mimeType) { + var type = message.request.type; + if (type == 'json') { + message.mimeType('application/json;charset=utf-8'); + } else if (type == 'text') { + message.mimeType('text/plain;charset=utf-8'); + } + } + + this.toFormat(message); + + var accept = void 0; + switch (message.responseType()) { + case 'json': + accept = 'application/json'; + break; + case 'text': + accept = 'text/*'; + break; + default: + accept = 'application/json,text/*;q=0.5,*/*;q=0.1'; + } + + if (!message.accept()) { + message.accept(accept); + } + + if (this.gzip) { + var ifNoneMatch = message.ifNoneMatch(); + if (ifNoneMatch && ifNoneMatch !== '""' && ifNoneMatch != '*') { + message.ifNoneMatch(ifNoneMatch.slice(0, -1) + '--gzip"'); + } + } + + if (message.request.path == '/connect') { + message.request.path = message.tokenStorage.signPath(this.basePath + message.request.path).substring(this.basePath.length); + if (message.cacheControl()) { + message.request.path += (message.tokenStorage.token ? '&' : '?') + 'BCB'; + } + } else if (message.tokenStorage) { + var token = message.tokenStorage.token; + if (token) { + message.header('authorization', 'BAT ' + token); + } + } + }; + + /** + * Convert the message entity to the sendable representation + * @param {connector.Message} message The message to send + * @protected + * @abstract + */ + + + Connector.prototype.toFormat = function toFormat(message) {}; + + /** + * @param {connector.Message} message + * @param {Object} response The received response headers and data + */ + + + Connector.prototype.prepareResponse = function prepareResponse(message, response) { + var _this2 = this; + + // IE9 returns status code 1223 instead of 204 + response.status = response.status == 1223 ? 204 : response.status; + + var type = void 0; + var headers = response.headers || {}; + var entity = response.entity; + + if (entity) { + type = message.responseType(); + if (!type || response.status >= 400) { + var contentType = headers['content-type'] || headers['Content-Type']; + if (contentType && contentType.indexOf("application/json") > -1) { + type = 'json'; + } + } + } + + if (headers.etag) { + headers.etag = headers.etag.replace('--gzip', ''); + } + + if (message.tokenStorage) { + var token = headers['baqend-authorization-token'] || headers['Baqend-Authorization-Token']; + if (token) { + message.tokenStorage.update(token); + } + } + + return new Promise(function (resolve) { + resolve(entity && _this2.fromFormat(response, entity, type)); + }).then(function (entity) { + response.entity = entity; + + if (message.request.path.indexOf('/connect') != -1 && entity) { + _this2.gzip = !!entity.gzip; + } + }, function (e) { + throw new Error('Response was not valid ' + type + ': ' + e.message); + }); + }; + + /** + * Convert received data to the requested response entity type + * @param {Object} response The response object + * @param {*} entity The received data + * @param {string} type The requested response format + * @protected + * @abstract + */ + + + Connector.prototype.fromFormat = function fromFormat(response, entity, type) {}; + + return Connector; +}(); + +Object.assign(Connector, /** @lends connector.Connector */{ + DEFAULT_BASE_PATH: '/v1', + HTTP_DOMAIN: '.app.baqend.com', + SSL_DOMAIN: '-bq.global.ssl.fastly.net', + + /** + * An array of all exposed response headers + * @type string[] + */ + RESPONSE_HEADERS: ['baqend-authorization-token', 'content-type', 'baqend-size', 'baqend-acl', 'etag', 'last-modified'], + + /** + * Array of all available connector implementations + * @type connector.Connector[] + */ + connectors: [], + + /** + * Array of all created connections + * @type Object + */ + connections: {}, + + /** + * The connector will detect if gzip is supports. + * Returns true if supported otherwise false. + * @returns {boolean} gzip + */ + gzip: false +}); + +module.exports = Connector; + +},{"32":32,"36":36}],24:[function(_dereq_,module,exports){ +"use strict"; + +var Connector = _dereq_(23); +var XMLHttpConnector = _dereq_(27); + +/** + * @alias connector.IFrameConnector + * @extends connector.XMLHttpConnector + */ + +var IFrameConnector = function (_XMLHttpConnector) { + babelHelpers.inherits(IFrameConnector, _XMLHttpConnector); + + /** + * Indicates if this connector implementation is usable for the given host and port + * @param {string} host + * @param {number} port + * @param {boolean} secure + * @returns {boolean} + */ + IFrameConnector.isUsable = function isUsable(host, port, secure) { + return typeof window != 'undefined'; + }; + + function IFrameConnector(host, port, secure, basePath) { + babelHelpers.classCallCheck(this, IFrameConnector); + + var _this = babelHelpers.possibleConstructorReturn(this, _XMLHttpConnector.call(this, host, port, secure, basePath)); + + _this.mid = 0; + _this.messages = {}; + _this.doReceive = _this.doReceive.bind(_this); + + addEventListener('message', _this.doReceive, false); + return _this; + } + + IFrameConnector.prototype.load = function load(path) { + this.iframe = document.createElement('iframe'); + this.iframe.src = this.origin + this.basePath + path; + this.iframe.setAttribute("style", IFrameConnector.style); + document.body.appendChild(this.iframe); + + this.queue = []; + this.iframe.addEventListener('load', this.onLoad.bind(this), false); + }; + + IFrameConnector.prototype.onLoad = function onLoad() { + var queue = this.queue; + + for (var i = 0; i < queue.length; ++i) { + this.postMessage(queue[i]); + } + + this.queue = null; + }; + + /** + * @inheritDoc + */ + + + IFrameConnector.prototype.doSend = function doSend(message, request, receive) { + var _this2 = this; + + //binary data will be send and received directly + if (message.isBinary) { + return _XMLHttpConnector.prototype.doSend.call(this, message, request, receive); + } + + if (!this.iframe) { + this.load(message.request.path); + } + + var msg = { + mid: ++this.mid, + method: request.method, + path: request.path, + headers: request.headers, + entity: request.entity, + responseHeaders: Connector.RESPONSE_HEADERS + }; + + this.messages[msg.mid] = receive; + + var strMsg = JSON.stringify(msg); + if (this.queue) { + this.queue.push(strMsg); + } else { + this.postMessage(strMsg); + } + + if (!this.connected) { + setTimeout(function () { + if (_this2.messages[msg.mid]) { + delete _this2.messages[msg.mid]; + receive({ + status: 0, + error: new Error('Connection refused.') + }); + } + }, 10000); + } + }; + + IFrameConnector.prototype.postMessage = function postMessage(msg) { + this.iframe.contentWindow.postMessage(msg, this.origin); + }; + + IFrameConnector.prototype.doReceive = function doReceive(event) { + if (event.origin !== this.origin || event.data[0] != '{') { + return; + } + + var msg = JSON.parse(event.data); + + var receive = this.messages[msg.mid]; + if (receive) { + delete this.messages[msg.mid]; + this.connected = true; + + receive({ + status: msg.status, + headers: msg.headers, + entity: msg.entity + }); + } + }; + + return IFrameConnector; +}(XMLHttpConnector); + +IFrameConnector.style = 'width:1px;height:1px;position:absolute;top:-10px;left:-10px;'; + +Connector.connectors.push(IFrameConnector); + +module.exports = IFrameConnector; + +},{"23":23,"27":27}],25:[function(_dereq_,module,exports){ +"use strict"; + +var CommunicationError = _dereq_(29); + +/** + * Checks whether the user uses google chrome. + */ +var isChrome = typeof window != 'undefined' && (!!window.chrome && /google/i.test(navigator.vendor) || /cros i686/i.test(window.navigator.platform)); + +/** + * @alias connector.Message + */ + +var Message = function () { + /** + * Creates a new message class with the given message specification + * @param {Object} specification + * @return {Class} + */ + Message.create = function create(specification) { + var parts = specification.path.split('?'); + var path = parts[0].split(/[:\*]\w*/); + + var query = []; + if (parts[1]) { + parts[1].split('&').forEach(function (arg) { + var part = arg.split('='); + query.push(part[0]); + }); + } + + specification.dynamic = specification.path.indexOf('*') != -1; + specification.path = path; + specification.query = query; + + return function (_Message) { + babelHelpers.inherits(_class, _Message); + + function _class() { + babelHelpers.classCallCheck(this, _class); + return babelHelpers.possibleConstructorReturn(this, _Message.apply(this, arguments)); + } + + babelHelpers.createClass(_class, [{ + key: 'spec', + get: function get() { + return specification; + } + }]); + return _class; + }(Message); + }; + + /** + * Creates a new message class with the given message specification and a full path + * @param {Object} specification + * @param {Object} members additional members applied to the created message + * @return {Class} + */ + + + Message.createExternal = function createExternal(specification, members) { + specification.path = [specification.path]; + + /** + * @ignore + */ + var cls = function (_Message2) { + babelHelpers.inherits(cls, _Message2); + + function cls() { + babelHelpers.classCallCheck(this, cls); + return babelHelpers.possibleConstructorReturn(this, _Message2.apply(this, arguments)); + } + + babelHelpers.createClass(cls, [{ + key: 'spec', + get: function get() { + return specification; + } + }]); + return cls; + }(Message); + + Object.assign(cls.prototype, members); + + return cls; + }; + + babelHelpers.createClass(Message, [{ + key: 'isBinary', + get: function get() { + return this.request.type in Message.BINARY || this._responseType in Message.BINARY; + } + + /** + * @param {string} arguments... The path arguments + */ + + }]); + + function Message() { + babelHelpers.classCallCheck(this, Message); + + /** @type boolean */ + this.withCredentials = false; + + /** @type util.TokenStorage */ + this.tokenStorage = null; + + /** @type connector.Message~progressCallback */ + this._progress = null; + + var args = arguments; + var index = 0; + var path = this.spec.path; + if (Object(path) instanceof Array) { + path = this.spec.path[0]; + var len = this.spec.path.length; + for (var i = 1; i < len; ++i) { + if (this.spec.dynamic && len - 1 == i) { + path += args[index].split('/').map(encodeURIComponent).join('/'); + index += 1; + } else { + path += encodeURIComponent(args[index++]) + this.spec.path[i]; + } + } + } + + var query = ""; + for (var _i = 0; _i < this.spec.query.length; ++_i) { + var arg = args[index++]; + if (arg !== undefined && arg !== null) { + query += query || ~path.indexOf("?") ? "&" : "?"; + query += this.spec.query[_i] + '=' + encodeURIComponent(arg); + } + } + + this.request = { + method: this.spec.method, + path: path + query, + entity: null, + headers: {} + }; + + if (args[index]) { + this.entity(args[index], 'json'); + } + + this.responseType('json'); + } + + /** + * Get/Sets the value of a the specified request header + * @param {string} name The header name + * @param {string=} value The header value if omitted the value will be returned + * @return {connector.Message|string} This message object + */ + + + Message.prototype.header = function header(name, value) { + if (value !== undefined) { + this.request.headers[name] = value; + return this; + } else { + return this.request.headers[name]; + } + }; + + /** + * sets the entity type + * @param {any} data The data to send + * @param {string} [type="json"] the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json' + * @return {connector.Message} This message object + */ + + + Message.prototype.entity = function entity(data, type) { + if (!type) { + if (typeof data === 'string') { + if (/^data:(.+?)(;base64)?,.*$/.test(data)) { + type = 'data-url'; + } else { + type = 'text'; + } + } else if (typeof Blob != 'undefined' && data instanceof Blob) { + type = 'blob'; + } else if (typeof Buffer != 'undefined' && data instanceof Buffer) { + type = 'buffer'; + } else if (typeof ArrayBuffer != 'undefined' && data instanceof ArrayBuffer) { + type = 'arraybuffer'; + } else if (typeof FormData != 'undefined' && data instanceof FormData) { + type = 'form'; + } else { + type = 'json'; + } + } + + this.request.type = type; + this.request.entity = data; + return this; + }; + + /** + * Get/Sets the mimeType + * @param {string=} mimeType the mimeType of the data + * @return {connector.Message} This message object + */ + + + Message.prototype.mimeType = function mimeType(_mimeType) { + return this.header('content-type', _mimeType); + }; + + /** + * Get/Sets the contentLength + * @param {number=} contentLength the content length of the data + * @return {connector.Message} This message object + */ + + + Message.prototype.contentLength = function contentLength(_contentLength) { + return this.header('content-length', _contentLength); + }; + + /** + * Get/Sets the request conditional If-Match header + * @param {string=} eTag the If-Match ETag value + * @return {connector.Message} This message object + */ + + + Message.prototype.ifMatch = function ifMatch(eTag) { + return this.header('If-Match', this._formatETag(eTag)); + }; + + /** + * Get/Sets the request a ETag based conditional header + * @param {string=} eTag The ETag value + * @return {connector.Message} This message object + */ + + + Message.prototype.ifNoneMatch = function ifNoneMatch(eTag) { + return this.header('If-None-Match', this._formatETag(eTag)); + }; + + /** + * Get/Sets the request date based conditional header + * @param {Date=} date The date value + * @return {connector.Message} This message object + */ + + + Message.prototype.ifUnmodifiedSince = function ifUnmodifiedSince(date) { + //IE 10 returns UTC strings and not an RFC-1123 GMT date string + return this.header('if-unmodified-since', date && date.toUTCString().replace('UTC', 'GMT')); + }; + + /** + * Indicates that the request should not be served by a local cache + */ + + + Message.prototype.noCache = function noCache() { + if (!isChrome) { + this.ifMatch('') // is needed for firefox or safari (but forbidden for chrome) + .ifNoneMatch('-'); // is needed for edge and ie (but forbidden for chrome) + } + + return this.cacheControl('max-age=0, no-cache'); + }; + + /** + * Get/Sets the cache control header + * @param {string=} value The cache control flags + * @return {connector.Message} This message object + */ + + + Message.prototype.cacheControl = function cacheControl(value) { + return this.header('cache-control', value); + }; + + /** + * Get/Sets and encodes the acl of a file into the Baqend-Acl header + * @param {Acl=} acl the file acls + * @return {connector.Message} This message object + */ + + + Message.prototype.acl = function acl(_acl) { + return this.header('baqend-acl', _acl && JSON.stringify(_acl)); + }; + + /** + * Get/Sets the request accept header + * @param {string=} accept the accept header value + * @return {connector.Message} This message object + */ + + + Message.prototype.accept = function accept(_accept) { + return this.header('accept', _accept); + }; + + /** + * Get/Sets the response type which should be returned + * @param {string=} type The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json' + * @return {connector.Message} This message object + */ + + + Message.prototype.responseType = function responseType(type) { + if (type !== undefined) { + this._responseType = type; + return this; + } + + return this._responseType; + }; + + /** + * Get/Sets the progress callback + * @param {connector.Message~progressCallback} callback + * @return {connector.Message} This message object + */ + + + Message.prototype.progress = function progress(callback) { + if (callback !== undefined) { + this._progress = callback; + return this; + } + + return this._progress; + }; + + /** + * Adds the given String to the request path. + * If the parameter is an object the query string will be created. + * + * @param {string|Object} query which will added to the request path + */ + + + Message.prototype.addQueryString = function addQueryString(query) { + var _this3 = this; + + if (Object(query) instanceof String) { + this.request.path += query; + } else if (query) { + var sep = ~this.request.path.indexOf("?") ? "&" : "?"; + Object.keys(query).forEach(function (key, i) { + _this3.request.path += sep + key + "=" + encodeURIComponent(query[key]); + if (i == 0) { + sep = "&"; + } + }); + } + return this; + }; + + Message.prototype._formatETag = function _formatETag(eTag) { + if (eTag && eTag != '*') { + eTag = '' + eTag; + if (eTag.indexOf('"') == -1) eTag = '"' + eTag + '"'; + } + + return eTag; + }; + + /** + * Handle the receive + * @param {Object} response The received response headers and data + */ + + + Message.prototype.doReceive = function doReceive(response) { + if (this.spec.status.indexOf(response.status) == -1) { + throw new CommunicationError(this, response); + } + }; + + return Message; +}(); + +/** + * The message specification + * @name spec + * @memberOf connector.Message.prototype + * @type {Object} + */ + +Object.assign(Message, { + /** + * @alias connector.Message.StatusCode + * @enum {number} + */ + StatusCode: { + NOT_MODIFIED: 304, + BAD_CREDENTIALS: 460, + BUCKET_NOT_FOUND: 461, + INVALID_PERMISSION_MODIFICATION: 462, + INVALID_TYPE_VALUE: 463, + OBJECT_NOT_FOUND: 404, + OBJECT_OUT_OF_DATE: 412, + PERMISSION_DENIED: 466, + QUERY_DISPOSED: 467, + QUERY_NOT_SUPPORTED: 468, + SCHEMA_NOT_COMPATIBLE: 469, + SCHEMA_STILL_EXISTS: 470, + SYNTAX_ERROR: 471, + TRANSACTION_INACTIVE: 472, + TYPE_ALREADY_EXISTS: 473, + TYPE_STILL_REFERENCED: 474, + SCRIPT_ABORTION: 475 + }, + + BINARY: { + blob: true, + buffer: true, + stream: true, + arraybuffer: true, + 'data-url': true, + 'base64': true + }, + + GoogleOAuth: Message.createExternal({ + method: 'OAUTH', + path: 'https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=online', + query: ["client_id", "scope", "state"], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.addQueryString({ + redirect_uri: baseUri + '/db/User/OAuth/google' + }); + } + }), + + FacebookOAuth: Message.createExternal({ + method: 'OAUTH', + path: 'https://www.facebook.com/dialog/oauth?response_type=code', + query: ["client_id", "scope", "state"], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.addQueryString({ + redirect_uri: baseUri + '/db/User/OAuth/facebook' + }); + } + }), + + GitHubOAuth: Message.createExternal({ + method: 'OAUTH', + path: 'https://github.com/login/oauth/authorize?response_type=code&access_type=online', + query: ["client_id", "scope", "state"], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.addQueryString({ + redirect_uri: baseUri + '/db/User/OAuth/github' + }); + } + }), + + LinkedInOAuth: Message.createExternal({ + method: 'OAUTH', + path: 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&access_type=online', + query: ["client_id", "scope", "state"], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.addQueryString({ + redirect_uri: baseUri + '/db/User/OAuth/linkedin' + }); + } + }), + + TwitterOAuth: Message.createExternal({ + method: 'OAUTH', + path: '', + query: [], + status: [200] + }, { + addRedirectOrigin: function addRedirectOrigin(baseUri) { + this.request.path = baseUri + '/db/User/OAuth1/twitter'; + } + }) +}); + +module.exports = Message; + +/** + * The progress callback is called, when you send a message to the server and a progress is noticed + * @callback connector.Message~progressCallback + * @param {ProgressEvent} event The Progress Event + * @return {*} unused + */ + +},{"29":29}],26:[function(_dereq_,module,exports){ +"use strict"; + +var Connector = _dereq_(23); +var PersistentError = _dereq_(32); +var http; +var https; +var stream; + +/** + * @alias connector.NodeConnector + * @extends connector.Connector + */ + +var NodeConnector = function (_Connector) { + babelHelpers.inherits(NodeConnector, _Connector); + + NodeConnector.isUsable = function isUsable(host, port, secure) { + if (!http) { + try { + http = _dereq_('http'); + https = _dereq_('https'); + stream = _dereq_('stream'); + } catch (e) {} + } + //prevent using when it is shimmed + return http && http.Server; + }; + + function NodeConnector(host, port, secure, basePath) { + babelHelpers.classCallCheck(this, NodeConnector); + + var _this = babelHelpers.possibleConstructorReturn(this, _Connector.call(this, host, port, secure, basePath)); + + _this.cookie = null; + _this.http = secure ? https : http; + return _this; + } + + /** + * @inheritDoc + */ + + + NodeConnector.prototype.doSend = function doSend(message, request, receive) { + var _this2 = this; + + request.host = this.host; + request.port = this.port; + request.path = this.basePath + request.path; + + var entity = request.entity; + var type = request.type; + var responseType = message.responseType(); + + if (this.cookie && message.withCredentials) request.headers['cookie'] = this.cookie; + + var req = this.http.request(request, function (res) { + var cookie = res.headers['set-cookie']; + if (cookie) { + // cookie may be an array, convert it to a string + _this2.cookie = _this2.parseCookie(cookie + ''); + } + + var status = res.statusCode; + if (status >= 400) { + responseType = 'json'; + } + + if (responseType == 'stream') { + receive({ + status: status, + headers: res.headers, + entity: res + }); + return; + } + + var binary = responseType && responseType != 'text' && responseType != 'json'; + var chunks = []; + if (!binary) { + res.setEncoding('utf-8'); + } + + res.on('data', function (chunk) { + chunks.push(chunk); + }); + + res.on('end', function () { + receive({ + status: status, + headers: res.headers, + entity: binary ? Buffer.concat(chunks) : chunks.join('') + }); + }); + }); + + req.on('error', function (e) { + receive({ + status: 0, + error: e + }); + }); + + if (type == 'stream') { + entity.pipe(req); + } else if (type == 'buffer') { + req.end(entity); + } else if (type) { + req.end(entity, 'utf8'); + } else { + req.end(); + } + }; + + /** + * Parse the cookie header + * @param {string} header + */ + + + NodeConnector.prototype.parseCookie = function parseCookie(header) { + var parts = header.split(';'); + + for (var i = 0, part; part = parts[i]; ++i) { + if (part.indexOf('Expires=') == 0) { + var date = Date.parse(part.substring(8)); + if (date < Date.now()) { + return null; + } + } + } + + return parts[0]; + }; + + /** + * @inheritDoc + */ + + + NodeConnector.prototype.toFormat = function toFormat(message) { + var type = message.request.type; + + if (type) { + var entity = message.request.entity; + var mimeType = message.mimeType(); + + switch (type) { + case 'stream': + if (!message.contentLength()) { + throw new PersistentError('You must specify a content length while making a stream based upload.'); + } + break; + case 'buffer': + break; + case 'arraybuffer': + type = 'buffer'; + entity = new Buffer(entity); + break; + case 'data-url': + var match = entity.match(/^data:(.+?)(;base64)?,(.*)$/); + var isBase64 = match[2]; + entity = match[3]; + + type = 'buffer'; + mimeType = mimeType || match[1]; + if (isBase64) { + entity = new Buffer(entity, 'base64'); + } else { + entity = new Buffer(decodeURIComponent(entity), 'utf8'); + } + + break; + case 'base64': + type = 'buffer'; + entity = new Buffer(entity, 'base64'); + break; + case 'json': + if (typeof entity != 'string') { + entity = JSON.stringify(entity); + } + break; + case 'text': + break; + default: + throw new Error('The request type ' + type + ' is not supported'); + } + + message.entity(entity, type).mimeType(mimeType); + } + }; + + /** + * @inheritDoc + */ + + + NodeConnector.prototype.fromFormat = function fromFormat(response, entity, type) { + if (type == 'json') { + entity = JSON.parse(entity); + } else if (type == 'data-url' || type == 'base64') { + entity = entity.toString('base64'); + + if (type == 'data-url') { + entity = 'data:' + response.headers['content-type'] + ';base64,' + entity; + } + } else if (type == 'arraybuffer') { + entity = entity.buffer.slice(entity.byteOffset, entity.byteOffset + entity.byteLength); + } + + return entity; + }; + + return NodeConnector; +}(Connector); + +Connector.connectors.push(NodeConnector); + +module.exports = NodeConnector; + +},{"23":23,"32":32,"undefined":undefined}],27:[function(_dereq_,module,exports){ +"use strict"; + +var Connector = _dereq_(23); + +/** + * @alias connector.XMLHttpConnector + * @extends connector.Connector + */ + +var XMLHttpConnector = function (_Connector) { + babelHelpers.inherits(XMLHttpConnector, _Connector); + + function XMLHttpConnector() { + babelHelpers.classCallCheck(this, XMLHttpConnector); + return babelHelpers.possibleConstructorReturn(this, _Connector.apply(this, arguments)); + } + + /** + * Indicates if this connector implementation is usable for the given host and port + * @param {string} host + * @param {number} port + * @param {boolean} secure + * @returns {boolean} + */ + XMLHttpConnector.isUsable = function isUsable(host, port, secure) { + if (typeof window == 'undefined') return false; + + var locationSecure = location.protocol == 'https:'; + var locationPort = location.port || (locationSecure ? 443 : 80); + + return location.hostname == host && locationPort == port && locationSecure == secure; + }; + + /** + * @inheritDoc + */ + + + XMLHttpConnector.prototype.doSend = function doSend(message, request, receive) { + var _this2 = this; + + if (request.method == 'OAUTH') { + if (this.oAuthHandle) this.oAuthHandle({ status: 409, entity: '{"message": "A new OAuth request was sent."}' }); + + localStorage.removeItem('oauth-response'); + + var handler = function handler(event) { + if (event.key == 'oauth-response') { + _this2.oAuthHandle(JSON.parse(event.newValue)); + } + }; + + this.oAuthHandle = function (msg) { + receive(msg); + localStorage.removeItem('oauth-response'); + removeEventListener("storage", handler, false); + }; + + addEventListener("storage", handler, false); + return; + } + + var xhr = new XMLHttpRequest(); + + var url = this.origin + this.basePath + request.path; + + xhr.onreadystatechange = function () { + //if we receive an error switch the response type to json + if (xhr.readyState == 2 && xhr.status >= 400) xhr.responseType = 'text'; + + if (xhr.readyState == 4) { + var response = { + headers: {}, + status: xhr.status, + entity: xhr.response || xhr.responseText + }; + + Connector.RESPONSE_HEADERS.forEach(function (name) { + response.headers[name] = xhr.getResponseHeader(name); + }); + + receive(response); + } + }; + + // Set the message progress callback + xhr.upload.onprogress = message.progress(); + + xhr.open(request.method, url, true); + + var entity = request.entity; + var headers = request.headers; + for (var name in headers) { + xhr.setRequestHeader(name, headers[name]); + }xhr.withCredentials = message.withCredentials; + + switch (message.responseType()) { + case 'arraybuffer': + xhr.responseType = 'arraybuffer'; + break; + case 'blob': + case 'data-url': + case 'base64': + xhr.responseType = 'blob'; + break; + } + + xhr.send(entity); + }; + + /** + * @inheritDoc + */ + + + XMLHttpConnector.prototype.fromFormat = function fromFormat(response, entity, type) { + if (type == 'json') { + entity = JSON.parse(entity); + } else if (type == 'data-url' || type == 'base64') { + var _ret = function () { + var reader = new FileReader(); + reader.readAsDataURL(entity); + + return { + v: new Promise(function (resolve, reject) { + reader.onload = resolve; + reader.onerror = reject; + }).then(function () { + var result = reader.result; + + if (type == 'base64') result = result.substring(result.indexOf(',') + 1); + + return result; + }) + }; + }(); + + if ((typeof _ret === 'undefined' ? 'undefined' : babelHelpers.typeof(_ret)) === "object") return _ret.v; + } + + return entity; + }; + + /** + * @inheritDoc + */ + + + XMLHttpConnector.prototype.toFormat = function toFormat(message) { + var type = message.request.type; + + if (type) { + var entity = message.request.entity; + var mimeType = message.mimeType(); + switch (type) { + case 'blob': + mimeType = mimeType || entity.type; + break; + case 'arraybuffer': + case 'form': + break; + case 'data-url': + var match = entity.match(/^data:(.+?)(;base64)?,(.*)$/); + var isBase64 = match[2]; + entity = match[3]; + + type = 'blob'; + mimeType = mimeType || match[1]; + if (!isBase64) { + entity = decodeURIComponent(entity); + break; + } + + //fallthrough + case 'base64': + var binaryStr = atob(entity), + len = binaryStr.length; + var array = new Uint8Array(len); + for (var i = 0; i < len; ++i) { + array[i] = binaryStr.charCodeAt(i); + } + type = 'blob'; + entity = new Blob([array], { type: mimeType }); + break; + case 'json': + if (typeof entity != 'string') { + entity = JSON.stringify(entity); + } + break; + case 'text': + break; + } + + message.entity(entity, type).mimeType(mimeType); + } + }; + + return XMLHttpConnector; +}(Connector); + +Connector.connectors.push(XMLHttpConnector); + +module.exports = XMLHttpConnector; + +},{"23":23}],28:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace connector + */ + +exports.Message = _dereq_(25); +exports.Connector = _dereq_(23); +exports.NodeConnector = _dereq_(26); +exports.XMLHttpConnector = _dereq_(27); +exports.IFrameConnector = _dereq_(24); + +},{"23":23,"24":24,"25":25,"26":26,"27":27}],29:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); + +/** + * @alias error.CommunicationError + * @extends error.PersistentError + */ + +var CommunicationError = function (_PersistentError) { + babelHelpers.inherits(CommunicationError, _PersistentError); + + /** + * @param {connector.Message} httpMessage The http message which was send + * @param {Object} response The received entity headers and content + */ + function CommunicationError(httpMessage, response) { + babelHelpers.classCallCheck(this, CommunicationError); + + var entity = response.entity || response.error || {}; + var state = response.status == 0 ? 'Request' : 'Response'; + var message = entity.message || 'Handling the ' + state + ' for ' + httpMessage.request.method + ' ' + httpMessage.request.path; + + var _this = babelHelpers.possibleConstructorReturn(this, _PersistentError.call(this, message, entity)); + + _this.name = entity.className || 'CommunicationError'; + _this.reason = entity.reason || 'Communication failed'; + _this.status = response.status; + + if (entity.data) _this.data = entity.data; + + var cause = entity; + while (cause && cause.stackTrace) { + _this.stack += '\nServerside Caused by: ' + cause.className + ' ' + cause.message; + + var stackTrace = cause.stackTrace; + for (var i = 0; i < stackTrace.length; ++i) { + var el = stackTrace[i]; + + _this.stack += '\n at ' + el.className + '.' + el.methodName; + _this.stack += ' (' + el.fileName + ':' + el.lineNumber + ')'; + } + + cause = cause.cause; + } + return _this; + } + + return CommunicationError; +}(PersistentError); + +module.exports = CommunicationError; + +},{"32":32}],30:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); + +/** + * @alias error.EntityExistsError + * @extends error.PersistentError + */ + +var EntityExistsError = function (_PersistentError) { + babelHelpers.inherits(EntityExistsError, _PersistentError); + + /** + * @param {string} entity + */ + function EntityExistsError(entity) { + babelHelpers.classCallCheck(this, EntityExistsError); + + var _this = babelHelpers.possibleConstructorReturn(this, _PersistentError.call(this, 'The entity ' + entity + ' is managed by a different db.')); + + _this.entity = entity; + return _this; + } + + return EntityExistsError; +}(PersistentError); + +module.exports = EntityExistsError; + +},{"32":32}],31:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); + +/** + * @alias error.IllegalEntityError + * @extends error.PersistentError + */ + +var IllegalEntityError = function (_PersistentError) { + babelHelpers.inherits(IllegalEntityError, _PersistentError); + + /** + * @param {binding.Entity} entity + */ + function IllegalEntityError(entity) { + babelHelpers.classCallCheck(this, IllegalEntityError); + + var _this = babelHelpers.possibleConstructorReturn(this, _PersistentError.call(this, 'Entity ' + entity + ' is not a valid entity')); + + _this.entity = entity; + return _this; + } + + return IllegalEntityError; +}(PersistentError); + +module.exports = IllegalEntityError; + +},{"32":32}],32:[function(_dereq_,module,exports){ +"use strict"; +/** + * @class error.PersistentError + * @extends Error + * + * @param {string} message + * @param {Error=} cause + */ + +//do not use class here, since we can't change the class prototype + +function PersistentError(message, cause) { + message = message ? message : 'An unexpected persistent error occured.'; + + if (Error.hasOwnProperty('captureStackTrace')) { + Error.captureStackTrace(this, this.constructor); + } else { + this.stack = new Error().stack; + } + + this.message = message; + this.name = this.constructor.name; + + if (cause) { + this.cause = cause; + if (cause.stack) { + this.stack += '\nCaused By: ' + cause.stack; + } + } +} + +PersistentError.of = function of(error) { + if (error instanceof PersistentError) { + return error; + } else { + return new PersistentError(null, error); + } +}; + +//custom errors must be manually extended for babel, otherwise the super call destroys the origin 'this' reference +PersistentError.prototype = Object.create(Error.prototype, { + constructor: { + value: PersistentError, + enumerable: false, + configurable: true + } +}); + +module.exports = PersistentError; + +},{}],33:[function(_dereq_,module,exports){ +"use strict"; + +var PersistentError = _dereq_(32); + +/** + * @alias error.RollbackError + * @extends error.PersistentError + */ + +var RollbackError = function (_PersistentError) { + babelHelpers.inherits(RollbackError, _PersistentError); + + /** + * @param {Error} cause + */ + function RollbackError(cause) { + babelHelpers.classCallCheck(this, RollbackError); + return babelHelpers.possibleConstructorReturn(this, _PersistentError.call(this, 'The transaction has been rollbacked', cause)); + } + + return RollbackError; +}(PersistentError); + +module.exports = RollbackError; + +},{"32":32}],34:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace error + */ + +exports.CommunicationError = _dereq_(29); +exports.IllegalEntityError = _dereq_(31); +exports.EntityExistsError = _dereq_(30); +exports.PersistentError = _dereq_(32); +exports.RollbackError = _dereq_(33); + +},{"29":29,"30":30,"31":31,"32":32,"33":33}],35:[function(_dereq_,module,exports){ +'use strict'; + +_dereq_(161); + +module.exports = _dereq_(6); + +},{"161":161,"6":6}],36:[function(_dereq_,module,exports){ +'use strict'; + +var Message = _dereq_(25); + +/** + * Get the list of all available subresources + * + * @class message.ListAllResources + * @extends connector.Message + * + */ +exports.ListAllResources = Message.create({ + method: 'GET', + path: '/', + status: [200] +}); + +/** + * Get the API version of the Orestes-Server + * + * @class message.ApiVersion + * @extends connector.Message + * + */ +exports.ApiVersion = Message.create({ + method: 'GET', + path: '/version', + status: [200] +}); + +/** + * Gets the event Endpoint + * + * @class message.Events + * @extends connector.Message + * + */ +exports.EventsUrl = Message.create({ + method: 'GET', + path: '/events-url', + status: [200] +}); + +/** + * The Swagger specification of the Orestes-Server + * + * @class message.Specification + * @extends connector.Message + * + */ +exports.Specification = Message.create({ + method: 'GET', + path: '/spec', + status: [200] +}); + +/** + * Returns all changed objects + * + * @class message.GetBloomFilter + * @extends connector.Message + * + */ +exports.GetBloomFilter = Message.create({ + method: 'GET', + path: '/bloomfilter', + status: [200] +}); + +/** + * Get the current Orestes config + * + * @class message.GetOrestesConfig + * @extends connector.Message + * + */ +exports.GetOrestesConfig = Message.create({ + method: 'GET', + path: '/config', + status: [200] +}); + +/** + * Updates the current Orestes config + * + * @class message.UpdateOrestesConfig + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.UpdateOrestesConfig = Message.create({ + method: 'PUT', + path: '/config', + status: [200, 202] +}); + +/** + * Connects a browser to this server + * + * @class message.Connect + * @extends connector.Message + * + */ +exports.Connect = Message.create({ + method: 'GET', + path: '/connect', + status: [200] +}); + +/** + * Gets the status of the server health + * + * @class message.Status + * @extends connector.Message + * + */ +exports.Status = Message.create({ + method: 'GET', + path: '/status', + status: [200] +}); + +/** + * Determines whether the IP has exceeded its rate limit + * + * @class message.BannedIp + * @extends connector.Message + * + * @param ip {Object} The ip to test + */ +exports.BannedIp = Message.create({ + method: 'GET', + path: '/banned/:ip', + status: [204] +}); + +/** + * Always returns banned status for proper CDN handling + * + * @class message.Banned + * @extends connector.Message + * + */ +exports.Banned = Message.create({ + method: 'GET', + path: '/banned', + status: [] +}); + +/** + * Clears all rate-limiting information for all IPs + * + * @class message.Unban + * @extends connector.Message + * + */ +exports.Unban = Message.create({ + method: 'DELETE', + path: '/banned', + status: [204] +}); + +/** + * Clears rate-limiting information for given IPs + * + * @class message.UnbanIp + * @extends connector.Message + * + * @param ip {Object} The ip to reset + */ +exports.UnbanIp = Message.create({ + method: 'DELETE', + path: '/banned/:ip', + status: [204] +}); + +/** + * List all available bucket names + * List all bucket + * + * @class message.GetBucketNames + * @extends connector.Message + * + */ +exports.GetBucketNames = Message.create({ + method: 'GET', + path: '/db', + status: [200] +}); + +/** + * List all bucket objects + * List all object ids of the bucket + * + * @class message.GetBucketIds + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param start {Object} The offset to skip + * @param count {Object} The upper limit to return + */ +exports.GetBucketIds = Message.create({ + method: 'GET', + path: '/db/:bucket/ids?start=0&count=-1', + status: [200] +}); + +/** + * Dumps all objects of the bucket + * Exports the complete Bucket content + * + * @class message.ExportBucket + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.ExportBucket = Message.create({ + method: 'GET', + path: '/db/:bucket', + status: [200] +}); + +/** + * Upload all objects to the bucket + * Imports the complete Bucket content + * + * @class message.ImportBucket + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.ImportBucket = Message.create({ + method: 'PUT', + path: '/db/:bucket', + status: [200] +}); + +/** + * Deletes all objects of the bucket + * Deletes all objects of the bucket + * + * @class message.TruncateBucket + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.TruncateBucket = Message.create({ + method: 'DELETE', + path: '/db/:bucket', + status: [200] +}); + +/** + * Create object + * Create the given Object. + * The object will be created and gets a unique oid. + * + * @class message.CreateObject + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.CreateObject = Message.create({ + method: 'POST', + path: '/db/:bucket', + status: [201, 202] +}); + +/** + * Get object + * Returns the specified object. Each object has one unique identifier and therefore only one location. + * + * @class message.GetObject + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + */ +exports.GetObject = Message.create({ + method: 'GET', + path: '/db/:bucket/:oid', + status: [200, 304] +}); + +/** + * Replace object + * Replace the current object with the updated one. + * To update a specific version of the object a version Number can be provided in the If-Match header. + * The update will only be accepted, if the current version matchesToBeForwarded the provided one, otherwise the update + * will be rejected. + * You can use the * wildcard to match any existing object, but prevents a insertion if the object doesn't exists. + * + * @class message.ReplaceObject + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + * @param body {Object} The massage Content + */ +exports.ReplaceObject = Message.create({ + method: 'PUT', + path: '/db/:bucket/:oid', + status: [200, 202] +}); + +/** + * Deletes the object + * Deletes the object. The If-Match Header can be used to specify an expected version. The object will + * only be deleted if the version matchesToBeForwarded the provided one. The * wildcard can be used to match any existing + * version but results in an error if the object doesn't exists. + * + * @class message.DeleteObject + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + */ +exports.DeleteObject = Message.create({ + method: 'DELETE', + path: '/db/:bucket/:oid', + status: [202, 204] +}); + +/** + * Get all available class schemas + * Gets the complete schema + * + * @class message.GetAllSchemas + * @extends connector.Message + * + */ +exports.GetAllSchemas = Message.create({ + method: 'GET', + path: '/schema', + status: [200] +}); + +/** + * Create new class schemas and update existing class schemas + * Updates the complete schema, merge all changes, reject the schema update if the schema changes aren't compatible + * + * @class message.UpdateAllSchemas + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.UpdateAllSchemas = Message.create({ + method: 'POST', + path: '/schema', + status: [200] +}); + +/** + * Replace all currently created schemas with the new ones + * Replace the complete schema, with the new one. + * + * @class message.ReplaceAllSchemas + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.ReplaceAllSchemas = Message.create({ + method: 'PUT', + path: '/schema', + status: [200] +}); + +/** + * Get the class schema + * Returns the schema definition of the class + * The class definition contains a link to its parent class and all persistable fields with there types of the class + * + * @class message.GetSchema + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.GetSchema = Message.create({ + method: 'GET', + path: '/schema/:bucket', + status: [200] +}); + +/** + * Update the class schema + * Modify the schema definition of the class by adding all missing fields + * + * @class message.UpdateSchema + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.UpdateSchema = Message.create({ + method: 'POST', + path: '/schema/:bucket', + status: [200] +}); + +/** + * Replace the class schema + * Replace the schema definition of the class + * + * @class message.ReplaceSchema + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.ReplaceSchema = Message.create({ + method: 'PUT', + path: '/schema/:bucket', + status: [200] +}); + +/** + * Delete the class schema + * Delete the schema definition of the class + * + * @class message.DeleteSchema + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.DeleteSchema = Message.create({ + method: 'DELETE', + path: '/schema/:bucket', + status: [204] +}); + +/** + * Executes a basic ad-hoc query + * Executes the given query and returns a list of matching objects. + * + * @class message.AdhocQuery + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param q {Object} The query + * @param eager {Object} indicates if the query result should be send back as ids or as objects + * @param start {Object} The offset to start from + * @param count {Object} The number of objects to list + * @param sort {Object} The sort object + */ +exports.AdhocQuery = Message.create({ + method: 'GET', + path: '/db/:bucket/query?q&start=0&count=-1&sort=&eager=', + status: [200] +}); + +/** + * Executes a basic ad-hoc query + * Executes the given query and returns a list of matching objects. + * + * @class message.AdhocQueryPOST + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param start {Object} The offset to start from + * @param count {Object} The number of objects to list + * @param sort {Object} The sort object + * @param body {Object} The massage Content + */ +exports.AdhocQueryPOST = Message.create({ + method: 'POST', + path: '/db/:bucket/query?start=0&count=-1&sort=', + status: [200] +}); + +/** + * Executes a count query + * Executes the given query and returns the number of objects that match the query + * + * @class message.AdhocCountQuery + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param q {Object} The query + */ +exports.AdhocCountQuery = Message.create({ + method: 'GET', + path: '/db/:bucket/count?q', + status: [200] +}); + +/** + * Executes a count query + * Executes the given query and returns the number of objects that match the query + * + * @class message.AdhocCountQueryPOST + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.AdhocCountQueryPOST = Message.create({ + method: 'POST', + path: '/db/:bucket/count', + status: [200] +}); + +/** + * List all Query subresources + * + * @class message.ListQueryResources + * @extends connector.Message + * + */ +exports.ListQueryResources = Message.create({ + method: 'GET', + path: '/query', + status: [200] +}); + +/** + * Creates a prepared query + * + * @class message.CreateQuery + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.CreateQuery = Message.create({ + method: 'POST', + path: '/query', + status: [201] +}); + +/** + * List all subresources of a query + * + * @class message.ListThisQueryResources + * @extends connector.Message + * + * @param qid {Object} The query id + */ +exports.ListThisQueryResources = Message.create({ + method: 'GET', + path: '/query/:qid', + status: [200] +}); + +/** + * Get the query string + * + * @class message.GetQueryCode + * @extends connector.Message + * + * @param qid {Object} The query id + */ +exports.GetQueryCode = Message.create({ + method: 'GET', + path: '/query/:qid/source', + status: [200] +}); + +/** + * Executes a prepared query + * + * @class message.RunQuery + * @extends connector.Message + * + * @param start {Object} The offset from where to start from + * @param count {Object} The number of objects to enlist + * @param qid {Object} The query id + */ +exports.RunQuery = Message.create({ + method: 'GET', + path: '/query/:qid/result?start=0&count=-1', + status: [200] +}); + +/** + * Get the declared query parameters + * + * @class message.GetQueryParameters + * @extends connector.Message + * + * @param qid {Object} The query id + */ +exports.GetQueryParameters = Message.create({ + method: 'GET', + path: '/query/:qid/parameters', + status: [200] +}); + +/** + * Starts a new Transaction + * + * @class message.NewTransaction + * @extends connector.Message + * + */ +exports.NewTransaction = Message.create({ + method: 'POST', + path: '/transaction', + status: [201] +}); + +/** + * Commits the transaction + * If the transaction can be completed a list of all changed objects with their updated versions are returned. + * + * @class message.CommitTransaction + * @extends connector.Message + * + * @param tid {Object} The transaction id + * @param body {Object} The massage Content + */ +exports.CommitTransaction = Message.create({ + method: 'PUT', + path: '/transaction/:tid/committed', + status: [200] +}); + +/** + * Returns the object in the given version or the newest version if the given does not exist. + * + * @class message.GetObjectInExplicitVersion + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + * @param version {Object} The version to load + */ +exports.GetObjectInExplicitVersion = Message.create({ + method: 'GET', + path: '/db/:bucket/:oid/:version', + status: [200] +}); + +/** + * Update the object + * Executes the partial updates on the object. + * To update an object an explicit version must be provided in the If-Match header. + * If the version is not equal to the current object version the update will be aborted. + * The version identifier Any (*) can be used to skip the version validation and therefore + * the update will always be applied. + * + * @class message.UpdatePartially + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {Object} The unique object identifier + * @param body {Object} The massage Content + */ +exports.UpdatePartially = Message.create({ + method: 'POST', + path: '/db/:bucket/:oid', + status: [204] +}); + +/** + * Update the object field + * Executes the partial update on a object field. + * To update an object an explicit version must be provided in the If-Match header. + * If the version is not equal to the current object version the update will be aborted. + * The version identifier Any (*) can be used to skip the version validation and therefore + * the update will always be applied. + * + * @class message.UpdateField + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param field {Object} The field name + * @param oid {Object} The unique object identifier + * @param body {Object} The massage Content + */ +exports.UpdateField = Message.create({ + method: 'POST', + path: '/db/:bucket/:oid/:field', + status: [204] +}); + +/** + * Method to login a user + * Log in a user by it's credentials + * + * @class message.Login + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.Login = Message.create({ + method: 'POST', + path: '/db/User/login', + status: [200] +}); + +/** + * Method to register a user + * Register and creates a new user + * + * @class message.Register + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.Register = Message.create({ + method: 'POST', + path: '/db/User/register', + status: [200, 204] +}); + +/** + * Method to load the current user object + * Gets the user object of the currently logged in user + * + * @class message.Me + * @extends connector.Message + * + */ +exports.Me = Message.create({ + method: 'GET', + path: '/db/User/me', + status: [200] +}); + +/** + * Method to validate a user token + * Validates if a given token is still valid + * + * @class message.ValidateUser + * @extends connector.Message + * + */ +exports.ValidateUser = Message.create({ + method: 'GET', + path: '/db/User/validate', + status: [200] +}); + +/** + * Method to remove token cookie + * Log out a user by removing the cookie token + * + * @class message.Logout + * @extends connector.Message + * + */ +exports.Logout = Message.create({ + method: 'GET', + path: '/db/User/logout', + status: [204] +}); + +/** + * Method to change the password + * + * @class message.NewPassword + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.NewPassword = Message.create({ + method: 'POST', + path: '/db/User/password', + status: [200] +}); + +/** + * Method to verify user by a given token + * + * @class message.Verify + * @extends connector.Message + * + * @param token {Object} Token to verify the user + */ +exports.Verify = Message.create({ + method: 'GET', + path: '/db/User/verify?token=', + status: [204] +}); + +/** + * Method to register or login using an OAuth provider. + * This resource is invoked by the provider with a redirect after the user granted permission. + * + * @class message.OAuth2 + * @extends connector.Message + * + * @param oauth_verifier {Object} OAuth 1.0 code + * @param code {Object} The code written by the provider + * @param provider {Object} The OAuth provider + * @param oauth_token {Object} OAuth 1.0 identifier + * @param error_description {Object} The error description of the oauth provider + * @param state {Object} On true a token will be returned + */ +exports.OAuth2 = Message.create({ + method: 'GET', + path: '/db/User/OAuth/:provider?state=&code=&oauth_verifier=&oauth_token=&error_description=', + status: [200] +}); + +/** + * Method to invoke a OAuth-1.0 login/register + * The resource requests a request-token and redirects the user to the provider page to log-in and grant permission for + * your application. + * + * @class message.OAuth1 + * @extends connector.Message + * + * @param provider {Object} The OAuth provider + */ +exports.OAuth1 = Message.create({ + method: 'GET', + path: '/db/User/OAuth1/:provider', + status: [200] +}); + +/** + * Gets the code of the the given bucket and type + * + * @class message.GetBaqendCode + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param type {Object} The type of the script + */ +exports.GetBaqendCode = Message.create({ + method: 'GET', + path: '/code/:bucket/:type', + status: [200] +}); + +/** + * Sets the code of the bucket and type + * + * @class message.SetBaqendCode + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param type {Object} The type of the script + * @param body {Object} The massage Content + */ +exports.SetBaqendCode = Message.create({ + method: 'PUT', + path: '/code/:bucket/:type', + status: [200, 202] +}); + +/** + * Delete the code of the given bucket and type + * + * @class message.DeleteBaqendCode + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param type {Object} The type of the script + */ +exports.DeleteBaqendCode = Message.create({ + method: 'DELETE', + path: '/code/:bucket/:type', + status: [202, 204] +}); + +/** + * Calls the module of the specific bucket + * + * @class message.PostBaqendModule + * @extends connector.Message + * + * @param bucket {Object} The method name + */ +exports.PostBaqendModule = Message.create({ + method: 'POST', + path: '/code/:bucket', + status: [200, 204] +}); + +/** + * Calls the module of the specific bucket + * + * @class message.GetBaqendModule + * @extends connector.Message + * + * @param bucket {Object} The module name + */ +exports.GetBaqendModule = Message.create({ + method: 'GET', + path: '/code/:bucket', + status: [200, 204] +}); + +/** + * List all available modules + * + * @class message.GetAllModules + * @extends connector.Message + * + */ +exports.GetAllModules = Message.create({ + method: 'GET', + path: '/code', + status: [200] +}); + +/** + * Get all file ID's in the given folder + * Retrieve meta-information about all accessible Files and folders in a specified folder. + * + * @class message.ListFiles + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param path {Object} The folder to list + * @param start {Object} The file/folder name from where to start listing + * @param count {Object} The upper limit to return. + */ +exports.ListFiles = Message.create({ + method: 'GET', + path: '/file/:bucket/ids?path=/&start=&count=-1', + status: [200] +}); + +/** + * Get all buckets + * Get all buckets. + * + * @class message.ListBuckets + * @extends connector.Message + * + */ +exports.ListBuckets = Message.create({ + method: 'GET', + path: '/file/buckets', + status: [200] +}); + +/** + * Retrieves the bucket Metadata + * The bucket metadata object contains the bucketAcl + * + * @class message.GetFileBucketMetadata + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.GetFileBucketMetadata = Message.create({ + method: 'GET', + path: '/file/:bucket', + status: [200] +}); + +/** + * Sets the Bucket Metadata + * Creates or replaces the bucket Metadata to control permission access to all included Files. + * + * @class message.SetFileBucketMetadata + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.SetFileBucketMetadata = Message.create({ + method: 'PUT', + path: '/file/:bucket', + status: [204] +}); + +/** + * deletes all files of a file Bucket + * Deletes the bucket and all its content + * + * @class message.DeleteFileBucket + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.DeleteFileBucket = Message.create({ + method: 'DELETE', + path: '/file/:bucket', + status: [204] +}); + +/** + * Creates a new file with a random UUID + * Creates a File with a random ID, only Insert permissions are required + * + * @class message.CreateFile + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.CreateFile = Message.create({ + method: 'POST', + path: '/file/:bucket', + status: [200] +}); + +/** + * Download a file + * Download a file. + * + * @class message.DownloadFile + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique object identifier + */ +exports.DownloadFile = Message.create({ + method: 'GET', + path: '/file/:bucket/*oid', + status: [200, 304] +}); + +/** + * Upload a new file + * Upload and replace any existing File with the new one. + * The If-Match or If-Unmodified-Since header can be used to make a conditional update + * + * @class message.UploadFile + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique file identifier + */ +exports.UploadFile = Message.create({ + method: 'PUT', + path: '/file/:bucket/*oid', + status: [200] +}); + +/** + * Gets the file metadata + * Gets the file Acl and metadata. + * + * @class message.GetFileMetadata + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique object identifier + */ +exports.GetFileMetadata = Message.create({ + method: 'HEAD', + path: '/file/:bucket/*oid', + status: [200] +}); + +/** + * update File Metadata + * Updates the file Metadata. + * + * @class message.UpdateFileMetadata + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique object identifier + * @param body {Object} The massage Content + */ +exports.UpdateFileMetadata = Message.create({ + method: 'POST', + path: '/file/:bucket/*oid', + status: [200] +}); + +/** + * Delete a file + * Deletes a file. + * The If-Match or If-Unmodified-Since header can be used to make a conditional deletion + * + * @class message.DeleteFile + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param oid {String} The unique file identifier + */ +exports.DeleteFile = Message.create({ + method: 'DELETE', + path: '/file/:bucket/*oid', + status: [204] +}); + +/** + * List bucket indexes + * List all indexes of the given bucket + * + * @class message.ListIndexes + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.ListIndexes = Message.create({ + method: 'GET', + path: '/index/:bucket', + status: [200] +}); + +/** + * Create or drop bucket index + * Create or drop a index for the given bucket + * + * @class message.CreateDropIndex + * @extends connector.Message + * + * @param bucket {Object} The bucket name + * @param body {Object} The massage Content + */ +exports.CreateDropIndex = Message.create({ + method: 'POST', + path: '/index/:bucket', + status: [202] +}); + +/** + * Drop all indexes + * Drop all indexes on the given bucket + * + * @class message.DropAllIndexes + * @extends connector.Message + * + * @param bucket {Object} The bucket name + */ +exports.DropAllIndexes = Message.create({ + method: 'DELETE', + path: '/index/:bucket', + status: [202] +}); + +/** + * Method to register a new device + * Registers a new devices + * + * @class message.DeviceRegister + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.DeviceRegister = Message.create({ + method: 'POST', + path: '/db/Device/register', + status: [204] +}); + +/** + * Method to push a message to devices + * Pushes a message to devices + * + * @class message.DevicePush + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.DevicePush = Message.create({ + method: 'POST', + path: '/db/Device/push', + status: [204] +}); + +/** + * Check if device is registered + * Checks if the device is already registered + * + * @class message.DeviceRegistered + * @extends connector.Message + * + */ +exports.DeviceRegistered = Message.create({ + method: 'GET', + path: '/db/Device/registered', + status: [200] +}); + +/** + * Upload APNS certificate + * Upload APNS certificate + * + * @class message.UploadAPNSCertificate + * @extends connector.Message + * + */ +exports.UploadAPNSCertificate = Message.create({ + method: 'POST', + path: '/config/APNSCert', + status: [204] +}); + +/** + * Set GCM-API-Key + * Sets the GCM-API-Key + * + * @class message.GCMAKey + * @extends connector.Message + * + * @param body {Object} The massage Content + */ +exports.GCMAKey = Message.create({ + method: 'POST', + path: '/config/GCMKey', + status: [204] +}); + +},{"25":25}],37:[function(_dereq_,module,exports){ +"use strict"; + +var Accessor = _dereq_(7); + +/** + * @alias metamodel.Attribute + */ + +var Attribute = function () { + babelHelpers.createClass(Attribute, [{ + key: 'persistentAttributeType', + + /** + * @type number + */ + get: function get() { + return -1; + } + + /** + * @type boolean + */ + + }, { + key: 'isAssociation', + get: function get() { + return this.persistentAttributeType > Attribute.PersistentAttributeType.EMBEDDED; + } + + /** + * @type boolean + */ + + }, { + key: 'isCollection', + get: function get() { + return this.persistentAttributeType == Attribute.PersistentAttributeType.ELEMENT_COLLECTION; + } + + /** + * @param {string} name The attribute name + * @param {boolean=} isMetadata true if the attribute is an metadata attribute + */ + + }]); + + function Attribute(name, isMetadata) { + babelHelpers.classCallCheck(this, Attribute); + + /** @type boolean */ + this.isMetadata = !!isMetadata; + /** @type boolean */ + this.isId = false; + /** @type boolean */ + this.isVersion = false; + /** @type boolean */ + this.isAcl = false; + + /** @type string */ + this.name = name; + /** @type number */ + this.order = null; + /** @type binding.Accessor */ + this.accessor = null; + /** @type metamodel.ManagedType */ + this.declaringType = null; + } + + /** + * @param {metamodel.ManagedType} declaringType The type that owns this attribute + * @param {number} order Position of the attribute + */ + + + Attribute.prototype.init = function init(declaringType, order) { + if (this.declaringType) throw new Error('The attribute is already initialized.'); + + this.order = order; + this.accessor = new Accessor(); + this.declaringType = declaringType; + }; + + /** + * @param {Object} entity + * @returns {*} + */ + + + Attribute.prototype.getValue = function getValue(entity) { + return this.accessor.getValue(entity, this); + }; + + /** + * @param {Object} entity + * @param {*} value + */ + + + Attribute.prototype.setValue = function setValue(entity, value) { + this.accessor.setValue(entity, this, value); + }; + + /** + * Gets this attribute value form the object as json + * @param {util.Metadata} state The root object state + * @param {*} object The object which contains the value of this attribute + * @return {*} The converted json value + * @abstract + */ + + + Attribute.prototype.getJsonValue = function getJsonValue(state, object) {}; + + /** + * Sets this attribute value from json to the object + * @param {util.Metadata} state The root state + * @param {*} object The object which contains the attribute + * @param {*} jsonValue The json value to convert an set + * @abstract + */ + + + Attribute.prototype.setJsonValue = function setJsonValue(state, object, jsonValue) {}; + + /** + * Converts this attribute field to json + * @abstract + * @returns {json} The attribute description as json + */ + + + Attribute.prototype.toJSON = function toJSON() {}; + + return Attribute; +}(); + +/** + * @enum {number} + */ + + +Attribute.PersistentAttributeType = { + BASIC: 0, + ELEMENT_COLLECTION: 1, + EMBEDDED: 2, + MANY_TO_MANY: 3, + MANY_TO_ONE: 4, + ONE_TO_MANY: 5, + ONE_TO_ONE: 6 +}; + +module.exports = Attribute; + +},{"7":7}],38:[function(_dereq_,module,exports){ +"use strict"; + +var Type = _dereq_(51); +var GeoPoint = _dereq_(5); + +/** + * @alias metamodel.BasicType + * @extends metamodel.Type + */ + +var BasicType = function (_Type) { + babelHelpers.inherits(BasicType, _Type); + babelHelpers.createClass(BasicType, [{ + key: 'persistenceType', + + + /** + * The persistent type of this type + * @type number + */ + get: function get() { + return Type.PersistenceType.BASIC; + } + + /** + * Creates a new instance of a native db type + * @param {string} ref The db ref of this type + * @param {Class<*>} typeConstructor The javascript class of this type + * @param {boolean=} noResolving Indicates if this type is not the main type of the constructor + */ + + }]); + + function BasicType(ref, typeConstructor, noResolving) { + babelHelpers.classCallCheck(this, BasicType); + + if (ref.indexOf('/db/') != 0) ref = '/db/' + ref; + + /** + * Indicates if this type is not the main type of the constructor + * @type {boolean} + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Type.call(this, ref, typeConstructor)); + + _this.noResolving = noResolving; + return _this; + } + + /** + * @inheritDoc + */ + + + BasicType.prototype.toJsonValue = function toJsonValue(state, currentValue) { + return currentValue === null || currentValue === undefined ? null : this.typeConstructor(currentValue); + }; + + /** + * @inheritDoc + */ + + + BasicType.prototype.fromJsonValue = function fromJsonValue(state, jsonValue, currentValue) { + return jsonValue === null || jsonValue === undefined ? null : jsonValue; + }; + + BasicType.prototype.toString = function toString() { + return "BasicType(" + this.ref + ")"; + }; + + return BasicType; +}(Type); + +function dateToJson(value) { + //remove trailing zeros + return value instanceof Date ? value.toISOString().replace(/\.?0*Z/, 'Z') : null; +} + +function jsonToDate(json, currentValue) { + var date = typeof json === 'string' ? new Date(json) : null; + if (currentValue && date) { + //compare normalized date strings instead of plain strings + return currentValue.toISOString() == date.toISOString() ? currentValue : date; + } else { + return date; + } +} + +Object.assign(BasicType, /** @lends metamodel.BasicType */{ + Boolean: new (function (_BasicType) { + babelHelpers.inherits(BooleanType, _BasicType); + + function BooleanType() { + babelHelpers.classCallCheck(this, BooleanType); + return babelHelpers.possibleConstructorReturn(this, _BasicType.apply(this, arguments)); + } + + BooleanType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return typeof json === 'string' ? json !== "false" : _BasicType.prototype.fromJsonValue.call(this, state, json, currentValue); + }; + + return BooleanType; + }(BasicType))('Boolean', Boolean), + + Double: new (function (_BasicType2) { + babelHelpers.inherits(DoubleType, _BasicType2); + + function DoubleType() { + babelHelpers.classCallCheck(this, DoubleType); + return babelHelpers.possibleConstructorReturn(this, _BasicType2.apply(this, arguments)); + } + + DoubleType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return typeof json === 'string' ? parseFloat(json) : _BasicType2.prototype.fromJsonValue.call(this, state, json, currentValue); + }; + + return DoubleType; + }(BasicType))('Double', Number), + + Integer: new (function (_BasicType3) { + babelHelpers.inherits(IntegerType, _BasicType3); + + function IntegerType() { + babelHelpers.classCallCheck(this, IntegerType); + return babelHelpers.possibleConstructorReturn(this, _BasicType3.apply(this, arguments)); + } + + IntegerType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return typeof json === 'string' ? parseInt(json) : _BasicType3.prototype.fromJsonValue.call(this, state, json, currentValue); + }; + + return IntegerType; + }(BasicType))('Integer', Number), + + String: new (function (_BasicType4) { + babelHelpers.inherits(StringType, _BasicType4); + + function StringType() { + babelHelpers.classCallCheck(this, StringType); + return babelHelpers.possibleConstructorReturn(this, _BasicType4.apply(this, arguments)); + } + + return StringType; + }(BasicType))('String', String), + + DateTime: new (function (_BasicType5) { + babelHelpers.inherits(DateTimeType, _BasicType5); + + function DateTimeType() { + babelHelpers.classCallCheck(this, DateTimeType); + return babelHelpers.possibleConstructorReturn(this, _BasicType5.apply(this, arguments)); + } + + DateTimeType.prototype.toJsonValue = function toJsonValue(state, value) { + return dateToJson(value); + }; + + DateTimeType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return jsonToDate(json, currentValue); + }; + + return DateTimeType; + }(BasicType))('DateTime', Date), + + Date: new (function (_BasicType6) { + babelHelpers.inherits(DateType, _BasicType6); + + function DateType() { + babelHelpers.classCallCheck(this, DateType); + return babelHelpers.possibleConstructorReturn(this, _BasicType6.apply(this, arguments)); + } + + DateType.prototype.toJsonValue = function toJsonValue(state, value) { + var json = dateToJson(value); + return json ? json.substring(0, json.indexOf('T')) : null; + }; + + DateType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return jsonToDate(json, currentValue); + }; + + return DateType; + }(BasicType))('Date', Date), + + Time: new (function (_BasicType7) { + babelHelpers.inherits(TimeType, _BasicType7); + + function TimeType() { + babelHelpers.classCallCheck(this, TimeType); + return babelHelpers.possibleConstructorReturn(this, _BasicType7.apply(this, arguments)); + } + + TimeType.prototype.toJsonValue = function toJsonValue(state, value) { + var json = dateToJson(value); + return json ? json.substring(json.indexOf('T') + 1) : null; + }; + + TimeType.prototype.fromJsonValue = function fromJsonValue(state, json, currentValue) { + return typeof json === 'string' ? jsonToDate('1970-01-01T' + json, currentValue) : json; + }; + + return TimeType; + }(BasicType))('Time', Date), + + GeoPoint: new (function (_BasicType8) { + babelHelpers.inherits(GeoPointType, _BasicType8); + + function GeoPointType() { + babelHelpers.classCallCheck(this, GeoPointType); + return babelHelpers.possibleConstructorReturn(this, _BasicType8.apply(this, arguments)); + } + + GeoPointType.prototype.toJsonValue = function toJsonValue(state, value) { + return value instanceof GeoPoint ? value : null; + }; + + GeoPointType.prototype.fromJsonValue = function fromJsonValue(state, json) { + return json ? new GeoPoint(json) : null; + }; + + return GeoPointType; + }(BasicType))('GeoPoint', GeoPoint), + + JsonArray: new (function (_BasicType9) { + babelHelpers.inherits(JsonArrayType, _BasicType9); + + function JsonArrayType() { + babelHelpers.classCallCheck(this, JsonArrayType); + return babelHelpers.possibleConstructorReturn(this, _BasicType9.apply(this, arguments)); + } + + JsonArrayType.prototype.init = function init(classFactory) { + //do not manipulate array properties + this._enhancer = classFactory; + }; + + JsonArrayType.prototype.toJsonValue = function toJsonValue(state, value) { + return Array.isArray(value) ? value : null; + }; + + JsonArrayType.prototype.fromJsonValue = function fromJsonValue(state, json) { + return Array.isArray(json) ? json : null; + }; + + return JsonArrayType; + }(BasicType))('JsonArray', Array), + + JsonObject: new (function (_BasicType10) { + babelHelpers.inherits(JsonObjectType, _BasicType10); + + function JsonObjectType() { + babelHelpers.classCallCheck(this, JsonObjectType); + return babelHelpers.possibleConstructorReturn(this, _BasicType10.apply(this, arguments)); + } + + JsonObjectType.prototype.init = function init(classFactory) { + //do not manipulate object properties + this._enhancer = classFactory; + }; + + JsonObjectType.prototype.toJsonValue = function toJsonValue(state, value) { + if (value && value.constructor == Object) { + return value; + } + + return null; + }; + + return JsonObjectType; + }(BasicType))('JsonObject', Object) +}); + +module.exports = BasicType; + +},{"5":5,"51":51}],39:[function(_dereq_,module,exports){ +"use strict"; + +var PluralAttribute = _dereq_(48); + +/** + * @alias metamodel.CollectionAttribute + * @extends metamodel.PluralAttribute + */ + +var CollectionAttribute = function (_PluralAttribute) { + babelHelpers.inherits(CollectionAttribute, _PluralAttribute); + babelHelpers.createClass(CollectionAttribute, [{ + key: "collectionType", + + + /** + * @inheritDoc + */ + get: function get() { + return PluralAttribute.CollectionType.COLLECTION; + } + + /** + * @param {string} name + * @param {metamodel.Type} elementType + */ + + }]); + + function CollectionAttribute(name, elementType) { + babelHelpers.classCallCheck(this, CollectionAttribute); + + var _this = babelHelpers.possibleConstructorReturn(this, _PluralAttribute.call(this, name, elementType)); + + _this.typeConstructor = null; + return _this; + } + + return CollectionAttribute; +}(PluralAttribute); + +module.exports = CollectionAttribute; + +},{"48":48}],40:[function(_dereq_,module,exports){ +"use strict"; +/** + * Creates a new index instance which is needed to create an + * database index. + * + * @alias metamodel.DbIndex + */ + +var DbIndex = function () { + + /** + * @param {string|Object|Array} keys The name of the field which will be used for the index, + * an object of an field and index type combination or + * an array of objects to create an compound index + * @param {boolean=} unique Indicates if the index will be unique + */ + function DbIndex(keys, unique) { + babelHelpers.classCallCheck(this, DbIndex); + + if (Object(keys) instanceof String) { + var key = {}; + key[keys] = DbIndex.ASC; + this.keys = [key]; + } else if (Object(keys) instanceof Array) { + this.keys = keys; + } else if (keys) { + this.keys = [keys]; + } else { + throw new Error("The keys parameter must be an String, Object or Array."); + } + + /** @type boolean */ + this.drop = false; + this.unique = unique === true; + } + + DbIndex.prototype.hasKey = function hasKey(name) { + for (var i = 0; i < this.keys.length; i++) { + if (this.keys[i][name]) { + return true; + } + } + return false; + }; + + /** + * Returns a JSON representation of the Index object + * + * @return {json} A Json of this Index object + */ + DbIndex.prototype.toJSON = function toJSON() { + return { + unique: this.unique, + keys: this.keys, + drop: this.drop + }; + }; + + babelHelpers.createClass(DbIndex, [{ + key: "isCompound", + get: function get() { + return this.keys.length > 1; + } + }, { + key: "isUnique", + get: function get() { + return this.unique; + } + }]); + return DbIndex; +}(); + +Object.assign(DbIndex, /** @lends metamodel.DbIndex */{ + /** + * @type string + */ + ASC: 'asc', + + /** + * @type string + */ + DESC: 'desc', + + /** + * @type string + */ + GEO: 'geo', + + /** + * Returns DbIndex Object created from the given JSON + * @param {json} json + */ + fromJSON: function fromJSON(json) { + return new DbIndex(json.keys, json.unique); + } +}); + +module.exports = DbIndex; + +},{}],41:[function(_dereq_,module,exports){ +"use strict"; + +var ManagedType = _dereq_(44); +var Type = _dereq_(51); +var binding = _dereq_(20); + +/** + * @alias metamodel.EmbeddableType + * @extends metamodel.ManagedType + */ + +var EmbeddableType = function (_ManagedType) { + babelHelpers.inherits(EmbeddableType, _ManagedType); + babelHelpers.createClass(EmbeddableType, [{ + key: 'persistenceType', + get: function get() { + return Type.PersistenceType.EMBEDDABLE; + } + }]); + + function EmbeddableType(name, typeConstructor) { + babelHelpers.classCallCheck(this, EmbeddableType); + return babelHelpers.possibleConstructorReturn(this, _ManagedType.call(this, name, typeConstructor)); + } + + /** + * {@inheritDoc} + */ + + + EmbeddableType.prototype.createProxyClass = function createProxyClass() { + return this._enhancer.createProxy(binding.Managed); + }; + + /** + * {@inheritDoc} + * @param {EntityManager} db {@inheritDoc} + * @return {binding.ManagedFactory<*>} A factory which creates embeddable objects + */ + + + EmbeddableType.prototype.createObjectFactory = function createObjectFactory(db) { + return binding.ManagedFactory.create(this, db); + }; + + /** + * @inheritDoc + */ + + + EmbeddableType.prototype.toJsonValue = function toJsonValue(state, object) { + if (state._root && object instanceof this.typeConstructor && !object._metadata._root) { + object._metadata._root = state._root; + } + + return _ManagedType.prototype.toJsonValue.call(this, state, object); + }; + + /** + * @inheritDoc + */ + + + EmbeddableType.prototype.fromJsonValue = function fromJsonValue(state, jsonObject, currentObject) { + if (jsonObject) { + if (!(currentObject instanceof this.typeConstructor)) currentObject = this.create(); + + if (state._root && !currentObject._metadata._root) currentObject._metadata._root = state._root; + } + + return _ManagedType.prototype.fromJsonValue.call(this, state, jsonObject, currentObject); + }; + + EmbeddableType.prototype.toString = function toString() { + return "EmbeddableType(" + this.ref + ")"; + }; + + return EmbeddableType; +}(ManagedType); + +module.exports = EmbeddableType; + +},{"20":20,"44":44,"51":51}],42:[function(_dereq_,module,exports){ +"use strict"; + +var binding = _dereq_(20); + +var SingularAttribute = _dereq_(50); +var BasicType = _dereq_(38); +var Type = _dereq_(51); +var ManagedType = _dereq_(44); +var util = _dereq_(70); + +/** + * @alias metamodel.EntityType + * @extends metamodel.ManagedType + */ + +var EntityType = function (_ManagedType) { + babelHelpers.inherits(EntityType, _ManagedType); + babelHelpers.createClass(EntityType, [{ + key: 'persistenceType', + get: function get() { + return Type.PersistenceType.ENTITY; + } + + /** + * @type metamodel.SingularAttribute + */ + + }, { + key: 'id', + get: function get() { + return this.declaredId || this.superType.id; + } + + /** + * @type metamodel.SingularAttribute + */ + + }, { + key: 'version', + get: function get() { + return this.declaredVersion || this.superType.version; + } + + /** + * @type metamodel.SingularAttribute + */ + + }, { + key: 'acl', + get: function get() { + return this.declaredAcl || this.superType.acl; + } + + /** + * @param {string} ref + * @param {metamodel.EntityType} superType + * @param {Class} typeConstructor + */ + + }]); + + function EntityType(ref, superType, typeConstructor) { + babelHelpers.classCallCheck(this, EntityType); + + /** @type metamodel.SingularAttribute */ + var _this = babelHelpers.possibleConstructorReturn(this, _ManagedType.call(this, ref, typeConstructor)); + + _this.declaredId = null; + /** @type metamodel.SingularAttribute */ + _this.declaredVersion = null; + /** @type metamodel.SingularAttribute */ + _this.declaredAcl = null; + /** @type metamodel.EntityType */ + _this.superType = superType; + + /** @type util.Permission */ + _this.loadPermission = new util.Permission(); + /** @type util.Permission */ + _this.updatePermission = new util.Permission(); + /** @type util.Permission */ + _this.deletePermission = new util.Permission(); + /** @type util.Permission */ + _this.queryPermission = new util.Permission(); + /** @type util.Permission */ + _this.schemaSubclassPermission = new util.Permission(); + /** @type util.Permission */ + _this.insertPermission = new util.Permission(); + return _this; + } + + /** + * {@inheritDoc} + */ + + + EntityType.prototype.createProxyClass = function createProxyClass() { + var Class = this.superType.typeConstructor; + if (Class === Object) { + switch (this.name) { + case 'User': + Class = binding.User; + break; + case 'Role': + Class = binding.Role; + break; + default: + Class = binding.Entity; + break; + } + } + + return this._enhancer.createProxy(Class); + }; + + /** + * {@inheritDoc} + * Creates an ObjectFactory for this type and the given EntityManager + * @return {binding.EntityFactory} A factory which creates entity objects + */ + + + EntityType.prototype.createObjectFactory = function createObjectFactory(db) { + switch (this.name) { + case 'User': + return binding.UserFactory.create(this, db); + case 'Device': + return binding.DeviceFactory.create(this, db); + case 'Object': + return undefined; + } + + return binding.EntityFactory.create(this, db); + }; + + /** + * @inheritDoc + */ + + + EntityType.prototype.fromJsonValue = function fromJsonValue(state, jsonObject, currentObject, isRoot) { + if (isRoot) { + return _ManagedType.prototype.fromJsonValue.call(this, state, jsonObject, currentObject); + } else if (jsonObject) { + return state.db.getReference(jsonObject); + } else { + return null; + } + }; + + /** + * @inheritDoc + */ + + + EntityType.prototype.toJsonValue = function toJsonValue(state, object, isRoot) { + if (isRoot) { + return _ManagedType.prototype.toJsonValue.call(this, state, object); + } else if (object instanceof this.typeConstructor) { + object.attach(state.db); + return object.id; + } else { + return null; + } + }; + + EntityType.prototype.toString = function toString() { + return "EntityType(" + this.ref + ")"; + }; + + EntityType.prototype.toJSON = function toJSON() { + var json = _ManagedType.prototype.toJSON.call(this); + + json.acl.schemaSubclass = this.schemaSubclassPermission; + json.acl.insert = this.insertPermission; + json.acl.update = this.updatePermission; + json.acl.delete = this.deletePermission; + json.acl.query = this.queryPermission; + + return json; + }; + + return EntityType; +}(ManagedType); + +/** + * @alias metamodel.EntityType.Object + * @extends metamodel.EntityType + */ + + +var ObjectType = function (_EntityType) { + babelHelpers.inherits(ObjectType, _EntityType); + babelHelpers.createClass(ObjectType, null, [{ + key: 'ref', + get: function get() { + return '/db/Object'; + } + }]); + + function ObjectType() { + babelHelpers.classCallCheck(this, ObjectType); + + var _this2 = babelHelpers.possibleConstructorReturn(this, _EntityType.call(this, EntityType.Object.ref, null, Object)); + + _this2.declaredId = new SingularAttribute('id', BasicType.String, true); + _this2.declaredId.init(_this2, 0); + _this2.declaredId.isId = true; + _this2.declaredVersion = new SingularAttribute('version', BasicType.Double, true); + _this2.declaredVersion.init(_this2, 1); + _this2.declaredVersion.isVersion = true; + _this2.declaredAcl = new SingularAttribute('acl', BasicType.JsonObject, true); + _this2.declaredAcl.init(_this2, 2); + _this2.declaredAcl.isAcl = true; + + _this2.declaredAttributes = [_this2.declaredId, _this2.declaredVersion, _this2.declaredAcl]; + return _this2; + } + + return ObjectType; +}(EntityType); + +EntityType.Object = ObjectType; + +module.exports = EntityType; + +},{"20":20,"38":38,"44":44,"50":50,"51":51,"70":70}],43:[function(_dereq_,module,exports){ +"use strict"; + +var PluralAttribute = _dereq_(48); + +/** + * @alias metamodel.ListAttribute + * @extends metamodel.PluralAttribute + */ + +var ListAttribute = function (_PluralAttribute) { + babelHelpers.inherits(ListAttribute, _PluralAttribute); + babelHelpers.createClass(ListAttribute, [{ + key: 'collectionType', + get: function get() { + return PluralAttribute.CollectionType.LIST; + } + + /** + * @param {string} name + * @param {metamodel.Type} elementType + */ + + }], [{ + key: 'ref', + get: function get() { + return '/db/collection.List'; + } + }]); + + function ListAttribute(name, elementType) { + babelHelpers.classCallCheck(this, ListAttribute); + + var _this = babelHelpers.possibleConstructorReturn(this, _PluralAttribute.call(this, name, elementType)); + + _this.typeConstructor = Array; + return _this; + } + + /** + * @inheritDoc + */ + + + ListAttribute.prototype.getJsonValue = function getJsonValue(state, object) { + var value = this.getValue(object); + + if (value instanceof this.typeConstructor) { + var len = value.length; + var persisting = new Array(len), + persistedState = value.__persistedState__ || []; + var changed = !value.__persistedState__ || persistedState.length != len; + + var json = new Array(len); + for (var i = 0; i < len; ++i) { + var el = value[i]; + json[i] = this.elementType.toJsonValue(state, el); + persisting[i] = el; + + changed |= persistedState[i] !== el; + } + + if (state.persisting) { + Object.defineProperty(value, '__persistedState__', { value: persisting, configurable: true }); + } + + if (state.isPersistent && changed) state.setDirty(); + + return json; + } else { + return null; + } + }; + + /** + * {@inheritDoc} + */ + + + ListAttribute.prototype.setJsonValue = function setJsonValue(state, obj, json) { + var value = null; + + if (json) { + value = this.getValue(obj); + + var len = json.length; + if (!(value instanceof this.typeConstructor)) { + value = new this.typeConstructor(len); + } + + var persisting = new Array(len), + persistedState = value.__persistedState__ || []; + + //clear additional items + if (len < value.length) value.splice(len, value.length - len); + + for (var i = 0; i < len; ++i) { + var el = this.elementType.fromJsonValue(state, json[i], persistedState[i]); + persisting[i] = value[i] = el; + } + + if (state.persisting) { + Object.defineProperty(value, '__persistedState__', { value: persisting, configurable: true }); + } + } + + this.setValue(obj, value); + }; + + /** + * {@inheritDoc} + * @returns {json} {@inheritDoc} + */ + + + ListAttribute.prototype.toJSON = function toJSON() { + return { + name: this.name, + type: ListAttribute.ref + '[' + this.elementType.ref + ']', + order: this.order + }; + }; + + return ListAttribute; +}(PluralAttribute); + +module.exports = ListAttribute; + +},{"48":48}],44:[function(_dereq_,module,exports){ +"use strict"; + +var Type = _dereq_(51); +var Permission = _dereq_(65); +var Validator = _dereq_(69); +var binding = _dereq_(20); + +/** + * @alias metamodel.ManagedType + * @extends metamodel.Type + */ + +var ManagedType = function (_Type) { + babelHelpers.inherits(ManagedType, _Type); + babelHelpers.createClass(ManagedType, [{ + key: 'validationCode', + + + /** + * @type Function + */ + get: function get() { + return this._validationCode; + }, + set: function set(code) { + if (!code) { + this._validationCode = null; + } else { + this._validationCode = Validator.compile(this, code); + } + } + + /** + * The Managed class + * @type Class + */ + + }, { + key: 'typeConstructor', + get: function get() { + if (!this._typeConstructor) { + this.typeConstructor = this.createProxyClass(); + } + return this._typeConstructor; + } + + /** + * The Managed class constructor + * @param {Class} typeConstructor The managed class constructor + */ + , + set: function set(typeConstructor) { + if (this._typeConstructor) { + throw new Error("Type constructor has already been set."); + } + + var isEntity = typeConstructor.prototype instanceof binding.Entity; + if (this.isEntity) { + if (!isEntity) throw new TypeError("Entity classes must extends the Entity class."); + } else { + if (!(typeConstructor.prototype instanceof binding.Managed) || isEntity) throw new TypeError("Embeddable classes must extends the Managed class."); + } + + this._enhancer.enhance(this, typeConstructor); + this._typeConstructor = typeConstructor; + } + + /** + * @param {string} ref or full class name + * @param {Class} typeConstructor + */ + + }]); + + function ManagedType(ref, typeConstructor) { + babelHelpers.classCallCheck(this, ManagedType); + + /** @type binding.Enhancer */ + var _this = babelHelpers.possibleConstructorReturn(this, _Type.call(this, ref.indexOf('/db/') != 0 ? '/db/' + ref : ref, typeConstructor)); + + _this._enhancer = null; + /** @type {metamodel.Attribute[]} */ + _this.declaredAttributes = []; + + /** @type util.Permission */ + _this.schemaAddPermission = new Permission(); + /** @type util.Permission */ + _this.schemaReplacePermission = new Permission(); + return _this; + } + + /** + * Initialize this type + * @param {binding.Enhancer} enhancer The class enhancer + * used to enhance and instantiate instance of this managed class + */ + + + ManagedType.prototype.init = function init(enhancer) { + this._enhancer = enhancer; + + if (this._typeConstructor && !this._enhancer.getIdentifier(this._typeConstructor)) this._enhancer.setIdentifier(this._typeConstructor, this.ref); + }; + + /** + * Creates an ProxyClass for this type + * @return {Class<*>} the crated proxy class for this type + * @abstract + */ + + + ManagedType.prototype.createProxyClass = function createProxyClass() {}; + + /** + * Creates an ObjectFactory for this type and the given EntityManager + * @param {EntityManager} db The created instances will be attached to this EntityManager + * @return {binding.ManagedFactory<*>} the crated object factory for the given EntityManager + * @abstract + */ + + + ManagedType.prototype.createObjectFactory = function createObjectFactory(db) {}; + + /** + * Creates a new instance of the managed type, without invoking any constructors + * This method is used to create object instances which are loaded form the backend + * @returns {Object} The created instance + */ + + + ManagedType.prototype.create = function create() { + var instance; + instance = Object.create(this.typeConstructor.prototype); + binding.Managed.init(instance); + + return instance; + }; + + /** + * An iterator which returns all attributes declared by this type and inherited form all super types + * @return {Iterator} + */ + + + ManagedType.prototype.attributes = function attributes() { + var _ref; + + var iter = void 0, + index = 0, + type = this; + if (this.superType) { + iter = this.superType.attributes(); + } + + return _ref = {}, _ref[Symbol.iterator] = function () { + return this; + }, _ref.next = function next() { + if (iter) { + var item = iter.next(); + if (item.done) { + iter = null; + } else { + return item; + } + } + + if (index < type.declaredAttributes.length) { + return { + value: type.declaredAttributes[index++], + done: false + }; + } else { + return { done: true }; + } + }, _ref; + }; + + /** + * Adds an attribute to this type + * @param {metamodel.Attribute} attr The attribute to add + * @param {number=} order Position of the attribute + */ + + + ManagedType.prototype.addAttribute = function addAttribute(attr, order) { + if (this.getAttribute(attr.name)) throw new Error("An attribute with the name " + attr.name + " is already declared."); + + if (attr.order == null) { + order = typeof order == 'undefined' ? this.declaredAttributes.length : order; + } else { + order = attr.order; + } + attr.init(this, order); + + this.declaredAttributes.push(attr); + if (this._typeConstructor && this.name != 'Object') this._enhancer.enhanceProperty(this._typeConstructor, attr); + }; + + /** + * Removes an attribute from this type + * @param {string} name The Name of the attribute which will be removed + */ + + + ManagedType.prototype.removeAttribute = function removeAttribute(name) { + var length = this.declaredAttributes.length; + this.declaredAttributes = this.declaredAttributes.filter(function (val) { + return val.name != name; + }); + + if (length == this.declaredAttributes.length) throw new Error("An Attribute with the name " + name + " is not declared."); + }; + + /** + * @param {!string} name + * @returns {metamodel.Attribute} + */ + + + ManagedType.prototype.getAttribute = function getAttribute(name) { + var attr = this.getDeclaredAttribute(name); + + if (!attr && this.superType) { + attr = this.superType.getAttribute(name); + } + + return attr; + }; + + /** + * @param {string|number} val Name or order of the attribute + * @returns {metamodel.Attribute} + */ + + + ManagedType.prototype.getDeclaredAttribute = function getDeclaredAttribute(val) { + for (var _iterator = this.declaredAttributes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + var attr = _ref2; + + if (attr.name === val || attr.order === val) { + return attr; + } + } + + return null; + }; + + /** + * @inheritDoc + */ + + + ManagedType.prototype.fromJsonValue = function fromJsonValue(state, jsonObject, currentObject) { + if (jsonObject) { + for (var _iterator2 = this.attributes(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } + + var attribute = _ref3; + + if (!attribute.isMetadata) attribute.setJsonValue(state, currentObject, jsonObject[attribute.name]); + } + } else { + currentObject = null; + } + + return currentObject; + }; + + /** + * @inheritDoc + */ + + + ManagedType.prototype.toJsonValue = function toJsonValue(state, object) { + var value = null; + + if (object instanceof this.typeConstructor) { + value = {}; + for (var _iterator3 = this.attributes(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + + var attribute = _ref4; + + if (!attribute.isMetadata) value[attribute.name] = attribute.getJsonValue(state, object); + } + } + + return value; + }; + + /** + * Converts ths type schema to json + * @returns {json} + */ + + + ManagedType.prototype.toJSON = function toJSON() { + var json = {}; + json['class'] = this.ref; + + if (this.superType) json['superClass'] = this.superType.ref; + + if (this.isEmbeddable) json['embedded'] = true; + + json['acl'] = { + load: this.loadPermission, + schemaAdd: this.schemaAddPermission, + schemaReplace: this.schemaReplacePermission + }; + + var fields = json['fields'] = {}; + for (var _iterator4 = this.declaredAttributes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref5; + + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } + + var attribute = _ref5; + + if (!attribute.isMetadata) fields[attribute.name] = attribute; + } + + return json; + }; + + /** + * Returns iterator to get all referenced entities + * @return {Iterator} + */ + + + ManagedType.prototype.references = function references() { + var _ref8; + + var attributes = this.attributes(); + var embedded = []; + + return _ref8 = {}, _ref8[Symbol.iterator] = function () { + return this; + }, _ref8.next = function next() { + for (var _iterator5 = attributes, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref6; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref6 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref6 = _i5.value; + } + + var attribute = _ref6; + + var type = attribute.isCollection ? attribute.elementType : attribute.type; + if (type.isEntity) { + return { done: false, value: { path: [attribute.name] } }; + } else if (type.isEmbeddable) { + for (var _iterator6 = type.references(), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref7; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref7 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref7 = _i6.value; + } + + var emItem = _ref7; + + embedded.push({ done: false, value: { path: [attribute.name].concat(emItem.path) } }); + } + } + } + + return embedded.length ? embedded.pop() : { done: true }; + }, _ref8; + }; + + return ManagedType; +}(Type); + +module.exports = ManagedType; + +},{"20":20,"51":51,"65":65,"69":69}],45:[function(_dereq_,module,exports){ +"use strict"; + +var PluralAttribute = _dereq_(48); +var PersistentError = _dereq_(32); + +/** + * @alias metamodel.MapAttribute + * @extends metamodel.PluralAttribute + */ + +var MapAttribute = function (_PluralAttribute) { + babelHelpers.inherits(MapAttribute, _PluralAttribute); + babelHelpers.createClass(MapAttribute, [{ + key: 'collectionType', + get: function get() { + return PluralAttribute.CollectionType.MAP; + } + + /** + * @param {string} name + * @param {metamodel.Type} keyType + * @param {metamodel.Type} elementType + */ + + }], [{ + key: 'ref', + get: function get() { + return '/db/collection.Map'; + } + }]); + + function MapAttribute(name, keyType, elementType) { + babelHelpers.classCallCheck(this, MapAttribute); + + /** @type metamodel.Type */ + var _this = babelHelpers.possibleConstructorReturn(this, _PluralAttribute.call(this, name, elementType)); + + _this.keyType = keyType; + _this.typeConstructor = Map; + return _this; + } + + /** + * @inheritDoc + */ + + + MapAttribute.prototype.getJsonValue = function getJsonValue(state, object) { + var value = this.getValue(object); + + if (value instanceof this.typeConstructor) { + var persisting = {}, + persistedState = value.__persistedState__ || {}; + var changed = !value.__persistedState__ || value.__persistedSize__ !== value.size; + + var json = {}; + for (var _iterator = value.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var entry = _ref; + + if (entry[0] === null || entry[0] === undefined) throw new PersistentError('Map keys can\'t be null nor undefined.'); + + var jsonKey = this.keyType.toJsonValue(state, entry[0]); + json[jsonKey] = this.elementType.toJsonValue(state, entry[1]); + + persisting[jsonKey] = [entry[0], entry[1]]; + changed |= (persistedState[jsonKey] || [])[1] !== entry[1]; + } + + if (state.persisting) { + Object.defineProperties(value, { + '__persistedState__': { value: persisting, configurable: true }, + '__persistedSize__': { value: value.size, configurable: true } + }); + } + + if (state.isPersistent && changed) state.setDirty(); + + return json; + } else { + return null; + } + }; + + /** + * @inheritDoc + */ + + + MapAttribute.prototype.setJsonValue = function setJsonValue(state, obj, json) { + var value = null; + if (json) { + value = this.getValue(obj); + + if (!(value instanceof this.typeConstructor)) { + value = new this.typeConstructor(); + } + + var persisting = {}, + persistedState = value.__persistedState__ || {}; + + value.clear(); + for (var jsonKey in json) { + var persistedEntry = persistedState[jsonKey] || []; + // ensure that "false" keys will be converted to false + var key = this.keyType.fromJsonValue(state, jsonKey, persistedEntry[0]); + var val = this.elementType.fromJsonValue(state, json[jsonKey], persistedEntry[1]); + + persisting[jsonKey] = [key, val]; + value.set(key, val); + } + + if (state.persisting) { + Object.defineProperties(value, { + '__persistedState__': { value: persisting, configurable: true }, + '__persistedSize__': { value: value.size, configurable: true } + }); + } + } + + this.setValue(obj, value); + }; + + /** + * {@inheritDoc} + * @returns {json} {@inheritDoc} + */ + + + MapAttribute.prototype.toJSON = function toJSON() { + return { + name: this.name, + type: MapAttribute.ref + '[' + this.keyType.ref + ',' + this.elementType.ref + ']', + order: this.order + }; + }; + + return MapAttribute; +}(PluralAttribute); + +module.exports = MapAttribute; + +},{"32":32,"48":48}],46:[function(_dereq_,module,exports){ +"use strict"; + +var BasicType = _dereq_(38); +var ManagedType = _dereq_(44); +var EntityType = _dereq_(42); +var Enhancer = _dereq_(9); +var ModelBuilder = _dereq_(47); +var DbIndex = _dereq_(40); +var Lockable = _dereq_(61); +var StatusCode = _dereq_(25).StatusCode; + +var message = _dereq_(36); + +/** + * @alias metamodel.Metamodel + * @extends util.Lockable + */ + +var Metamodel = function (_Lockable) { + babelHelpers.inherits(Metamodel, _Lockable); + + function Metamodel(entityManagerFactory) { + babelHelpers.classCallCheck(this, Metamodel); + + /** + * Defines if the Metamodel has been finalized + * @type boolean + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Lockable.call(this)); + + _this.isInitialized = false; + + /** + * @type EntityManagerFactory + */ + _this.entityManagerFactory = entityManagerFactory; + + /** + * @type Array. + */ + _this.entities = null; + + /** + * @type Array. + */ + _this.embeddables = null; + + /** + * @type Array. + */ + _this.baseTypes = null; + + _this._enhancer = new Enhancer(); + return _this; + } + + /** + * Prepare the Metamodel for custom schema creation + * @param {Object=} jsonMetamodel initialize the metamodel with the serialized json schema + */ + + + Metamodel.prototype.init = function init(jsonMetamodel) { + if (this.isInitialized) { + throw new Error('Metamodel is already initialized.'); + } + + this.fromJSON(jsonMetamodel || []); + this.isInitialized = true; + }; + + /** + * @param {(Class|string)} arg + * @return {string} + */ + + + Metamodel.prototype._getRef = function _getRef(arg) { + var ref; + if (Object(arg) instanceof String) { + ref = arg; + + if (ref.indexOf('/db/') != 0) { + ref = '/db/' + arg; + } + } else { + ref = this._enhancer.getIdentifier(arg); + } + + return ref; + }; + + /** + * Return the metamodel entity type representing the entity. + * + * @param {(Class|string)} typeConstructor - the type of the represented entity + * @returns {metamodel.EntityType} the metamodel entity type + */ + + + Metamodel.prototype.entity = function entity(typeConstructor) { + var ref = this._getRef(typeConstructor); + return ref ? this.entities[ref] : null; + }; + + /** + * Return the metamodel basic type representing the native class. + * @param {(Class<*>|string)} typeConstructor - the type of the represented native class + * @returns {metamodel.BasicType} the metamodel basic type + */ + + + Metamodel.prototype.baseType = function baseType(typeConstructor) { + var ref = null; + if (Object(typeConstructor) instanceof String) { + ref = this._getRef(typeConstructor); + } else { + for (var name in this.baseTypes) { + var type = this.baseTypes[name]; + if (!type.noResolving && type.typeConstructor == typeConstructor) { + ref = name; + break; + } + } + } + + return ref ? this.baseTypes[ref] : null; + }; + + /** + * Return the metamodel embeddable type representing the embeddable class. + * @param {Class|string} typeConstructor - the type of the represented embeddable class + * @returns {metamodel.EmbeddableType} the metamodel embeddable type + */ + + + Metamodel.prototype.embeddable = function embeddable(typeConstructor) { + var ref = this._getRef(typeConstructor); + return ref ? this.embeddables[ref] : null; + }; + + /** + * Return the metamodel managed type representing the entity, mapped superclass, or embeddable class. + * + * @param {(Class|string)} typeConstructor - the type of the represented managed class + * @returns {metamodel.Type} the metamodel managed type + */ + + + Metamodel.prototype.managedType = function managedType(typeConstructor) { + return this.baseType(typeConstructor) || this.entity(typeConstructor) || this.embeddable(typeConstructor); + }; + + /** + * @param {metamodel.Type} type + * @return {metamodel.Type} the added type + */ + + + Metamodel.prototype.addType = function addType(type) { + var types; + + if (type.isBasic) { + types = this.baseTypes; + } else if (type.isEmbeddable) { + type.init(this._enhancer); + types = this.embeddables; + } else if (type.isEntity) { + type.init(this._enhancer); + types = this.entities; + + if (type.superType == null && type.ref != EntityType.Object.ref) { + type.superType = this.entity(EntityType.Object.ref); + } + } + + if (types[type.ref]) { + throw new Error("The type " + type.ref + " is already declared."); + } + + return types[type.ref] = type; + }; + + /** + * Load all schema data from the server + * @returns {Promise} + */ + + + Metamodel.prototype.load = function load() { + var _this2 = this; + + if (!this.isInitialized) { + return this.withLock(function () { + var msg = new message.GetAllSchemas(); + + return _this2.entityManagerFactory.send(msg).then(function (response) { + _this2.init(response.entity); + return _this2; + }); + }); + } else { + throw new Error("Metamodel is already initialized."); + } + }; + + /** + * Store all local schema data on the server, or the provided one + * + * Note: The schema must be initialized, by init or load + * + * @param {metamodel.ManagedType=} managedType The specific type to persist, if omitted the complete schema will be updated + * @returns {Promise} + */ + + + Metamodel.prototype.save = function save(managedType) { + var _this3 = this; + + return this._send(managedType || this.toJSON()).then(function () { + return _this3; + }); + }; + + /** + * The provided options object will be forwarded to the UpdateAllSchemas resource. + * The underlying schema of this Metamodel object will be replaced by the result. + * + * @param {json} data The JSON which will be send to the UpdateAllSchemas resource. + * @returns {Promise} + */ + + + Metamodel.prototype.update = function update(data) { + var _this4 = this; + + return this._send(data).then(function (response) { + _this4.fromJSON(response.entity); + return _this4; + }); + }; + + Metamodel.prototype._send = function _send(data) { + var _this5 = this; + + if (!this.isInitialized) throw new Error("Metamodel is not initialized."); + + return this.withLock(function () { + var msg; + if (data instanceof ManagedType) { + msg = new message.UpdateSchema(data.name, data.toJSON()); + } else { + msg = new message.UpdateAllSchemas(data); + } + + return _this5.entityManagerFactory.send(msg); + }); + }; + + /** + * Get the current schema types as json + * @returns {json} the json data + */ + + + Metamodel.prototype.toJSON = function toJSON() { + var json = []; + + for (var ref in this.entities) { + json.push(this.entities[ref]); + } + + for (ref in this.embeddables) { + json.push(this.embeddables[ref]); + } + + return json; + }; + + /** + * Replace the current schema by the provided one in json + * @param {json} json The json schema data + */ + + + Metamodel.prototype.fromJSON = function fromJSON(json) { + var builder = new ModelBuilder(); + var models = builder.buildModels(json); + + this.baseTypes = {}; + this.embeddables = {}; + this.entities = {}; + + for (var ref in models) { + var type = models[ref]; + this.addType(type); + } + }; + + /** + * Creates an index + * + * @param {string} bucket Name of the Bucket + * @param {metamodel.DbIndex} index Will be applied for the given bucket + * @return {Promise<*>} + */ + + + Metamodel.prototype.createIndex = function createIndex(bucket, index) { + index.drop = false; + var msg = new message.CreateDropIndex(bucket, index.toJSON()); + return this.entityManagerFactory.send(msg); + }; + + /** + * Drops an index + * + * @param {string} bucket Name of the Bucket + * @param {metamodel.DbIndex} index Will be dropped for the given bucket + * @return {Promise<*>} + */ + + + Metamodel.prototype.dropIndex = function dropIndex(bucket, index) { + index.drop = true; + var msg = new message.CreateDropIndex(bucket, index.toJSON()); + return this.entityManagerFactory.send(msg); + }; + + /** + * Drops all indexes + * + * @param {string} bucket Indexes will be dropped for the given bucket + * @returns {Promise<*>} + */ + + + Metamodel.prototype.dropAllIndexes = function dropAllIndexes(bucket) { + var msg = new message.DropAllIndexes(bucket); + return this.entityManagerFactory.send(msg); + }; + + /** + * Loads all indexes for the given bucket + * + * @param {string} bucket Current indexes will be loaded for the given bucket + * @returns {Promise>} + */ + + + Metamodel.prototype.getIndexes = function getIndexes(bucket) { + var msg = new message.ListIndexes(bucket); + return this.entityManagerFactory.send(msg).then(function (response) { + return response.entity.map(function (el) { + return new DbIndex(el.keys, el.unique); + }); + }, function (e) { + if (e.status == StatusCode.BUCKET_NOT_FOUND || e.status == StatusCode.OBJECT_NOT_FOUND) { + return null; + } else { + throw e; + } + }); + }; + + return Metamodel; +}(Lockable); + +module.exports = Metamodel; + +},{"25":25,"36":36,"38":38,"40":40,"42":42,"44":44,"47":47,"61":61,"9":9}],47:[function(_dereq_,module,exports){ +"use strict"; + +var BasicType = _dereq_(38); +var EntityType = _dereq_(42); +var EmbeddableType = _dereq_(41); + +var ListAttribute = _dereq_(43); +var MapAttribute = _dereq_(45); +var SetAttribute = _dereq_(49); +var SingularAttribute = _dereq_(50); + +var PersistentError = _dereq_(32); + +/** + * @alias metamodel.ModelBuilder + */ + +var ModelBuilder = function () { + /** + * @param {metamodel.Metamodel} metamodel + */ + function ModelBuilder() { + babelHelpers.classCallCheck(this, ModelBuilder); + + /** @type Object */ + this.models = {}; + + /** @type Object */ + this.modelDescriptors = null; + + for (var _iterator = Object.keys(BasicType), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var typeName = _ref; + + var basicType = BasicType[typeName]; + if (basicType instanceof BasicType) { + this.models[basicType.ref] = basicType; + } + } + } + + /** + * @param {string} ref + * @returns {metamodel.ManagedType} + */ + + + ModelBuilder.prototype.getModel = function getModel(ref) { + if (ref in this.models) { + return this.models[ref]; + } else { + return this.models[ref] = this.buildModel(ref); + } + }; + + /** + * @param {Object[]} modelDescriptors + * @returns {Object} + */ + + + ModelBuilder.prototype.buildModels = function buildModels(modelDescriptors) { + this.modelDescriptors = {}; + for (var i = 0, modelDescriptor; modelDescriptor = modelDescriptors[i]; ++i) { + this.modelDescriptors[modelDescriptor['class']] = modelDescriptor; + } + + for (var ref in this.modelDescriptors) { + try { + var model = this.getModel(ref); + this.buildAttributes(model); + } catch (e) { + throw new PersistentError('Can\'t create model for entity class ' + ref, e); + } + } + + //ensure at least an object entity + this.getModel(EntityType.Object.ref); + + return this.models; + }; + + /** + * @param {string} ref + * @returns {metamodel.ManagedType} + */ + + + ModelBuilder.prototype.buildModel = function buildModel(ref) { + var modelDescriptor = this.modelDescriptors[ref]; + var type; + if (ref == EntityType.Object.ref) { + type = new EntityType.Object(); + } else if (modelDescriptor) { + if (modelDescriptor.embedded) { + type = new EmbeddableType(ref); + } else { + var superTypeIdentifier = modelDescriptor['superClass'] || EntityType.Object.ref; + type = new EntityType(ref, this.getModel(superTypeIdentifier)); + } + } else { + throw new TypeError('No model available for ' + ref); + } + + if (modelDescriptor) { + var permissions = modelDescriptor['acl']; + for (var permission in permissions) { + type[permission + 'Permission'].fromJSON(permissions[permission]); + } + } + + return type; + }; + + /** + * @param {metamodel.EntityType} model + */ + + + ModelBuilder.prototype.buildAttributes = function buildAttributes(model) { + var modelDescriptor = this.modelDescriptors[model.ref]; + var fields = modelDescriptor['fields']; + + for (var name in fields) { + var field = fields[name]; + if (!model.getAttribute(name)) //skip predefined attributes + model.addAttribute(this.buildAttribute(field.name, field.type), field.order); + } + + if (modelDescriptor.validationCode) { + model.validationCode = modelDescriptor.validationCode; + } + }; + + /** + * @param {metamodel.EntityType} model + * @param {string} name + * @param {string} ref + * @returns {metamodel.Attribute} + */ + + + ModelBuilder.prototype.buildAttribute = function buildAttribute(name, ref) { + if (ref.indexOf('/db/collection.') == 0) { + var collectionType = ref.substring(0, ref.indexOf('[')); + + var elementType = ref.substring(ref.indexOf('[') + 1, ref.indexOf(']')).trim(); + switch (collectionType) { + case ListAttribute.ref: + return new ListAttribute(name, this.getModel(elementType)); + case SetAttribute.ref: + return new SetAttribute(name, this.getModel(elementType)); + case MapAttribute.ref: + var keyType = elementType.substring(0, elementType.indexOf(',')).trim(); + elementType = elementType.substring(elementType.indexOf(',') + 1).trim(); + + return new MapAttribute(name, this.getModel(keyType), this.getModel(elementType)); + default: + throw new TypeError('No collection available for ' + ref); + } + } else { + return new SingularAttribute(name, this.getModel(ref)); + } + }; + + return ModelBuilder; +}(); + +module.exports = ModelBuilder; + +},{"32":32,"38":38,"41":41,"42":42,"43":43,"45":45,"49":49,"50":50}],48:[function(_dereq_,module,exports){ +"use strict"; + +var Attribute = _dereq_(37); + +/** + * @alias metamodel.PluralAttribute + * @extends metamodel.Attribute + */ + +var PluralAttribute = function (_Attribute) { + babelHelpers.inherits(PluralAttribute, _Attribute); + babelHelpers.createClass(PluralAttribute, [{ + key: "persistentAttributeType", + get: function get() { + return Attribute.PersistentAttributeType.ELEMENT_COLLECTION; + } + + /** + * @param {string} name + * @param {metamodel.Type} elementType + */ + + }]); + + function PluralAttribute(name, elementType) { + babelHelpers.classCallCheck(this, PluralAttribute); + + /** @type metamodel.Type */ + var _this = babelHelpers.possibleConstructorReturn(this, _Attribute.call(this, name)); + + _this.elementType = elementType; + /** @type Class<*> */ + _this.typeConstructor = null; + return _this; + } + + return PluralAttribute; +}(Attribute); + +/** + * @enum {number} + */ + + +PluralAttribute.CollectionType = { + COLLECTION: 0, + LIST: 1, + MAP: 2, + SET: 3 +}; + +module.exports = PluralAttribute; + +},{"37":37}],49:[function(_dereq_,module,exports){ +"use strict"; + +var PluralAttribute = _dereq_(48); + +/** + * @alias metamodel.SetAttribute + * @extends metamodel.PluralAttribute + */ + +var SetAttribute = function (_PluralAttribute) { + babelHelpers.inherits(SetAttribute, _PluralAttribute); + babelHelpers.createClass(SetAttribute, [{ + key: 'collectionType', + get: function get() { + return PluralAttribute.CollectionType.SET; + } + + /** + * @param {string} name + * @param {metamodel.Type} elementType + */ + + }], [{ + key: 'ref', + get: function get() { + return '/db/collection.Set'; + } + }]); + + function SetAttribute(name, elementType) { + babelHelpers.classCallCheck(this, SetAttribute); + + var _this = babelHelpers.possibleConstructorReturn(this, _PluralAttribute.call(this, name, elementType)); + + _this.typeConstructor = Set; + return _this; + } + + /** + * @inheritDoc + */ + + + SetAttribute.prototype.getJsonValue = function getJsonValue(state, object) { + var value = this.getValue(object); + + if (value instanceof this.typeConstructor) { + var persisting = {}, + persistedState = value.__persistedState__ || {}; + var changed = !value.__persistedState__ || value.__persistedSize__ !== value.size; + + var json = []; + for (var _iterator = value, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var el = _ref; + + var jsonValue = this.elementType.toJsonValue(state, el); + json.push(jsonValue); + + persisting[jsonValue] = el; + changed |= persistedState[jsonValue] !== el; + } + + if (state.persisting) { + Object.defineProperties(value, { + '__persistedState__': { value: persisting, configurable: true }, + '__persistedSize__': { value: value.size, configurable: true } + }); + } + + if (state.isPersistent && changed) state.setDirty(); + + return json; + } else { + return null; + } + }; + + /** + * {@inheritDoc} + */ + + + SetAttribute.prototype.setJsonValue = function setJsonValue(state, obj, json) { + var value = null; + + if (json) { + value = this.getValue(obj); + + if (!(value instanceof this.typeConstructor)) { + value = new this.typeConstructor(); + } + + var persisting = {}, + persistedState = value.__persistedState__ || {}; + + value.clear(); + for (var i = 0, len = json.length; i < len; ++i) { + var jsonValue = json[i]; + var el = this.elementType.fromJsonValue(state, jsonValue, persistedState[jsonValue]); + value.add(el); + + persisting[jsonValue] = el; + } + + if (state.persisting) { + Object.defineProperties(value, { + '__persistedState__': { value: persisting, configurable: true }, + '__persistedSize__': { value: value.size, configurable: true } + }); + } + } + + this.setValue(obj, value); + }; + + /** + * {@inheritDoc} + * @returns {json} {@inheritDoc} + */ + + + SetAttribute.prototype.toJSON = function toJSON() { + return { + name: this.name, + type: SetAttribute.ref + '[' + this.elementType.ref + ']', + order: this.order + }; + }; + + return SetAttribute; +}(PluralAttribute); + +module.exports = SetAttribute; + +},{"48":48}],50:[function(_dereq_,module,exports){ +"use strict"; + +var Attribute = _dereq_(37); +var Type = _dereq_(51); + +/** + * @alias metamodel.SingularAttribute + * @extends metamodel.Attribute + */ + +var SingularAttribute = function (_Attribute) { + babelHelpers.inherits(SingularAttribute, _Attribute); + babelHelpers.createClass(SingularAttribute, [{ + key: 'typeConstructor', + get: function get() { + return this.type.typeConstructor; + } + }, { + key: 'persistentAttributeType', + get: function get() { + switch (this.type.persistenceType) { + case Type.PersistenceType.BASIC: + return Attribute.PersistentAttributeType.BASIC; + case Type.PersistenceType.EMBEDDABLE: + return Attribute.PersistentAttributeType.EMBEDDED; + case Type.PersistenceType.ENTITY: + return Attribute.PersistentAttributeType.ONE_TO_MANY; + } + } + + /** + * @param {string} name + * @param {metamodel.Type} type + * @param {boolean=} isMetadata + */ + + }]); + + function SingularAttribute(name, type, isMetadata) { + babelHelpers.classCallCheck(this, SingularAttribute); + + /** @type metamodel.Type */ + var _this = babelHelpers.possibleConstructorReturn(this, _Attribute.call(this, name, isMetadata)); + + _this.type = type; + return _this; + } + + /** + * @inheritDoc + */ + + + SingularAttribute.prototype.getJsonValue = function getJsonValue(state, object) { + return this.type.toJsonValue(state, this.getValue(object)); + }; + + /** + * @inheritDoc + */ + + + SingularAttribute.prototype.setJsonValue = function setJsonValue(state, object, jsonValue) { + this.setValue(object, this.type.fromJsonValue(state, jsonValue, this.getValue(object))); + }; + + /** + * @inheritDoc + */ + + + SingularAttribute.prototype.toJSON = function toJSON() { + return { + name: this.name, + type: this.type.ref, + order: this.order + }; + }; + + return SingularAttribute; +}(Attribute); + +module.exports = SingularAttribute; + +},{"37":37,"51":51}],51:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias metamodel.Type + */ + +var Type = function () { + babelHelpers.createClass(Type, [{ + key: "persistenceType", + + /** + * The persistent type of this type + * @type number + * @abstract + */ + get: function get() { + return -1; + } + + /** + * @type boolean + */ + + }, { + key: "isBasic", + get: function get() { + return this.persistenceType == Type.PersistenceType.BASIC; + } + + /** + * @type boolean + */ + + }, { + key: "isEmbeddable", + get: function get() { + return this.persistenceType == Type.PersistenceType.EMBEDDABLE; + } + + /** + * @type boolean + */ + + }, { + key: "isEntity", + get: function get() { + return this.persistenceType == Type.PersistenceType.ENTITY; + } + + /** + * @type boolean + */ + + }, { + key: "isMappedSuperclass", + get: function get() { + return this.persistenceType == Type.PersistenceType.MAPPED_SUPERCLASS; + } + + /** + * @return {Class<*>} + */ + + }, { + key: "typeConstructor", + get: function get() { + return this._typeConstructor; + } + + /** + * @param {Class<*>} typeConstructor + */ + , + set: function set(typeConstructor) { + if (this._typeConstructor) { + throw new Error("typeConstructor has already been set."); + } + this._typeConstructor = typeConstructor; + } + + /** + * @param {string} ref + * @param {Class<*>} typeConstructor + */ + + }]); + + function Type(ref, typeConstructor) { + babelHelpers.classCallCheck(this, Type); + + if (ref.indexOf("/db/") != 0) { + throw new SyntaxError("Type ref " + ref + " is invalid."); + } + + /** @type string */ + this.ref = ref; + /** @type string */ + this.name = ref.substring(4); + this._typeConstructor = typeConstructor; + } + + /** + * Merge the json data into the current object instance and returns the merged object + * @param {util.Metadata} state The root object state + * @param {json} jsonValue The json data to merge + * @param {*=} currentValue The object where the jsonObject will be merged into, if the current object is null, + * a new instance will be created + * @return {*} The merged object instance + * @abstract + */ + + + Type.prototype.fromJsonValue = function fromJsonValue(state, jsonValue, currentValue) {}; + + /** + * Converts the given object to json + * @param {util.Metadata} state The root object state + * @param {*} object The object to convert + * @return {json} The converted object as json + * @abstract + */ + + + Type.prototype.toJsonValue = function toJsonValue(state, object) {}; + + return Type; +}(); + +/** + * @enum {number} + */ + + +Type.PersistenceType = { + BASIC: 0, + EMBEDDABLE: 1, + ENTITY: 2, + MAPPED_SUPERCLASS: 3 +}; + +module.exports = Type; + +},{}],52:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace metamodel + */ + +var Metamodel = _dereq_(46); + +Metamodel.prototype.Attribute = _dereq_(37); +Metamodel.prototype.BasicType = _dereq_(38); +Metamodel.prototype.CollectionAttribute = _dereq_(39); +Metamodel.prototype.EmbeddableType = _dereq_(41); +Metamodel.prototype.EntityType = _dereq_(42); +Metamodel.prototype.ListAttribute = _dereq_(43); +Metamodel.prototype.ManagedType = _dereq_(44); +Metamodel.prototype.MapAttribute = _dereq_(45); +Metamodel.prototype.Metamodel = _dereq_(46); +Metamodel.prototype.ModelBuilder = _dereq_(47); +Metamodel.prototype.PluralAttribute = _dereq_(48); +Metamodel.prototype.SetAttribute = _dereq_(49); +Metamodel.prototype.SingularAttribute = _dereq_(50); +Metamodel.prototype.Type = _dereq_(51); +Metamodel.prototype.DbIndex = _dereq_(40); + +exports = module.exports = new Metamodel(); + +},{"37":37,"38":38,"39":39,"40":40,"41":41,"42":42,"43":43,"44":44,"45":45,"46":46,"47":47,"48":48,"49":49,"50":50,"51":51}],53:[function(_dereq_,module,exports){ +"use strict"; + +var Filter = _dereq_(55); +var Condition = _dereq_(54); +var Operator = _dereq_(57); +var Query = _dereq_(58); +var varargs = Query.varargs; + +/** + * @alias query.Builder + * @extends query.Query + * @extends query.Condition + */ + +var Builder = function (_Query) { + babelHelpers.inherits(Builder, _Query); + + /** + * @param {EntityManager} entityManager The owning entity manager of this query + * @param {Class} resultClass The query result class + */ + function Builder(entityManager, resultClass) { + babelHelpers.classCallCheck(this, Builder); + return babelHelpers.possibleConstructorReturn(this, _Query.call(this, entityManager, resultClass)); + } + + /** + * Joins the conditions by an logical AND + * @param {...(query.Query|Array>)} args The query nodes to join + * @return {query.Query} Returns a new query which joins the given queries by a logical AND + */ + + + Builder.prototype.and = function and(args) { + return this._addOperator('$and', varargs(0, arguments)); + }; + + /** + * Joins the conditions by an logical OR + * @param {...(query.Query|Array>)} args The query nodes to join + * @return {query.Query} Returns a new query which joins the given queries by a logical OR + */ + + + Builder.prototype.or = function or(args) { + return this._addOperator('$or', varargs(0, arguments)); + }; + + /** + * Joins the conditions by an logical NOR + * @param {...(query.Query|Array>)} args The query nodes to join + * @return {query.Query} Returns a new query which joins the given queries by a logical NOR + */ + + + Builder.prototype.nor = function nor(args) { + return this._addOperator('$nor', varargs(0, arguments)); + }; + + /** + * @inheritDoc + */ + + + Builder.prototype.stream = function stream(options) { + return this.where({})._stream(options, this); + }; + + /** + * @inheritDoc + */ + + + Builder.prototype.resultList = function resultList(options, doneCallback, failCallback) { + return this.where({}).resultList(options, doneCallback, failCallback); + }; + + /** + * @inheritDoc + */ + + + Builder.prototype.singleResult = function singleResult(options, doneCallback, failCallback) { + return this.where({}).singleResult(options, doneCallback, failCallback); + }; + + /** + * @inheritDoc + */ + + + Builder.prototype.count = function count(doneCallback, failCallback) { + return this.where({}).count(doneCallback, failCallback); + }; + + Builder.prototype._addOperator = function _addOperator(operator, args) { + if (args.length < 2) { + throw new Error('Only two or more queries can be joined with an ' + operator + ' operator.'); + } + + args.forEach(function (arg, index) { + if (!(arg instanceof Query)) { + throw new Error('Argument at index ' + index + ' is not a query.'); + } + }); + + return new Operator(this.entityManager, this.resultClass, operator, args); + }; + + Builder.prototype._addOrder = function _addOrder(fieldOrSort, order) { + return new Filter(this.entityManager, this.resultClass)._addOrder(fieldOrSort, order); + }; + + Builder.prototype._addFilter = function _addFilter(field, filter, value) { + return new Filter(this.entityManager, this.resultClass)._addFilter(field, filter, value); + }; + + Builder.prototype._addOffset = function _addOffset(offset) { + return new Filter(this.entityManager, this.resultClass)._addOffset(offset); + }; + + Builder.prototype._addLimit = function _addLimit(limit) { + return new Filter(this.entityManager, this.resultClass)._addLimit(limit); + }; + + return Builder; +}(Query); + +Object.assign(Builder.prototype, Condition); + +module.exports = Builder; + +},{"54":54,"55":55,"57":57,"58":58}],54:[function(_dereq_,module,exports){ +"use strict"; + +var varargs = _dereq_(58).varargs; + +/** + * @class query.Condition + */ +var Condition = {}; + +Object.assign(Condition, /** @lends query.Condition.prototype */{ + + /** + * An object, that contains filter rules which will be merged with the current filters of this query. + * @param {json} conditions - Additional filters for this query + * @return {query.Filter} The resulting Query + * @instance + */ + where: function where(conditions) { + return this._addFilter(null, null, conditions); + }, + + + /** + * Adds a equal filter to the field. All other other filters on the field will be discarded + * @param {string} field The field to filter + * @param {*} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + */ + equal: function equal(field, value) { + return this._addFilter(field, null, value); + }, + + + /** + * Adds a not equal filter to the field. + * @param {string} field The field to filter + * @param {*} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/ne/ + */ + notEqual: function notEqual(field, value) { + return this._addFilter(field, "$ne", value); + }, + + + /** + * Adds a greater than filter to the field. + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/gt/ + */ + greaterThan: function greaterThan(field, value) { + return this._addFilter(field, "$gt", value); + }, + + + /** + * Adds a greater than or equal to filter to the field. + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/gte/ + */ + greaterThanOrEqualTo: function greaterThanOrEqualTo(field, value) { + return this._addFilter(field, "$gte", value); + }, + + + /** + * Adds a less than filter to the field. + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/lt/ + */ + lessThan: function lessThan(field, value) { + return this._addFilter(field, "$lt", value); + }, + + + /** + * Adds a less than or equal to filter to the field. + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/lte/ + */ + lessThanOrEqualTo: function lessThanOrEqualTo(field, value) { + return this._addFilter(field, "$lte", value); + }, + + + /** + * Adds a between filter to the field. This is a shorthand for an less than and greater than filter. + * @param {string} field The field to filter + * @param {number|string|Date} lessValue The field value must be greater than this value + * @param {number|string|Date} greaterValue The field value must be less than this value + * @return {query.Filter} The resulting Query + * @instance + */ + between: function between(field, lessValue, greaterValue) { + return this._addFilter(field, "$gt", lessValue)._addFilter(field, "$lt", greaterValue); + }, + + + /** + * Adds a in filter to the field. The field value must be equal to one of the given values + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/in/ + */ + 'in': function _in(field, args) { + return this._addFilter(field, "$in", varargs(1, arguments)); + }, + + + /** + * Adds a in filter to the field. The field value must be equal to one of the given values + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * @instance + * @memberOf query.Condition.prototype + * @name in + * + * @see http://docs.mongodb.org/manual/reference/operator/query/in/ + */ + + /** + * Adds a not in filter to the field. The field value must not be equal to any of the given values + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/nin/ + */ + notIn: function notIn(field, args) { + return this._addFilter(field, "$nin", varargs(1, arguments)); + }, + + + /** + * Adds a null filter to the field. The field value must be null + * @param {string} field The field to filter + * @return {query.Filter} The resulting Query + * @instance + */ + isNull: function isNull(field) { + return this.equal(field, null); + }, + + + /** + * Adds a not null filter to the field. The field value must not be null + * @param {string} field The field to filter + * @return {query.Filter} The resulting Query + * @instance + */ + isNotNull: function isNotNull(field) { + return this._addFilter(field, "$exists", true)._addFilter(field, "$ne", null); + }, + + + /** + * Adds a contains all filter to the collection field. The collection must contain all the given values. + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/all/ + */ + containsAll: function containsAll(field, args) { + return this._addFilter(field, "$all", varargs(1, arguments)); + }, + + + /** + * Adds a modulo filter to the field. The field value divided by divisor must be equal to the remainder. + * @param {string} field The field to filter + * @param {number} divisor The divisor of the modulo filter + * @param {number} remainder The remainder of the modulo filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/mod/ + */ + mod: function mod(field, divisor, remainder) { + return this._addFilter(field, "$mod", [divisor, remainder]); + }, + + + /** + * Adds a regular expression filter to the field. The field value must matches the regular expression. + *

Note: Only anchored expressions (Expressions that starts with an ^) and the multiline flag are supported.

+ * @param {string} field The field to filter + * @param {string|RegExp} regExp The regular expression of the filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/regex/ + */ + matches: function matches(field, regExp) { + if (!(Object(regExp) instanceof RegExp)) { + regExp = new RegExp(regExp); + } + + if (regExp.ignoreCase) { + throw new Error('RegExp.ignoreCase flag is not supported.'); + } + + if (regExp.global) { + throw new Error('RegExp.global flag is not supported.'); + } + + if (regExp.source.indexOf('^') != 0) { + throw new Error('regExp must be an anchored expression, i.e. it must be started with a ^.'); + } + + var result = this._addFilter(field, '$regex', regExp.source); + if (regExp.multiline) { + result._addFilter(field, '$options', 'm'); + } + + return result; + }, + + + /** + * Adds a size filter to the collection field. The collection must have exactly size members. + * @param {string} field The field to filter + * @param {number} size The collections size to filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/size/ + */ + size: function size(field, _size) { + return this._addFilter(field, "$size", _size); + }, + + + /** + * Adds a geopoint based near filter to the GeoPoint field. The GeoPoint must be within the maximum distance + * to the given GeoPoint. Returns from nearest to farthest. + * @param {string} field The field to filter + * @param {GeoPoint} geoPoint The GeoPoint to filter + * @param {number} maxDistance Tha maximum distance to filter in meters + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/nearSphere/ + */ + near: function near(field, geoPoint, maxDistance) { + return this._addFilter(field, "$nearSphere", { + $geometry: { + type: "Point", + coordinates: [geoPoint.longitude, geoPoint.latitude] + }, + $maxDistance: maxDistance + }); + }, + + + /** + * Adds a GeoPoint based polygon filter to the GeoPoint field. The GeoPoint must be contained within the polygon. + * @param {string} field The field to filter + * @param {...(GeoPoint|Array)} geoPoints The geoPoints that describes the polygon of the filter + * @return {query.Filter} The resulting Query + * @instance + * + * @see http://docs.mongodb.org/manual/reference/operator/query/geoWithin/ + */ + withinPolygon: function withinPolygon(field, geoPoints) { + geoPoints = varargs(1, arguments); + return this._addFilter(field, "$geoWithin", { + $geometry: { + type: "Polygon", + coordinates: [geoPoints.map(function (geoPoint) { + return [geoPoint.longitude, geoPoint.latitude]; + })] + } + }); + } +}); + +// aliases +Object.assign(Condition, /** @lends query.Condition.prototype */{ + /** + * Adds a equal filter to the field. All other other filters on the field will be discarded + * @method + * @param {string} field The field to filter + * @param {*} value The value used to filter + * @return {query.Filter} The resulting Query + */ + eq: Condition.equal, + + /** + * Adds a not equal filter to the field. + * @method + * @param {string} field The field to filter + * @param {*} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/ne/ + */ + ne: Condition.notEqual, + + /** + * Adds a less than filter to the field. Shorthand for {@link query.Condition#lessThan}. + * @method + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/lt/ + */ + lt: Condition.lessThan, + + /** + * Adds a less than or equal to filter to the field. Shorthand for {@link query.Condition#lessThanOrEqualTo}. + * @method + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/lte/ + */ + le: Condition.lessThanOrEqualTo, + + /** + * Adds a greater than filter to the field. Shorthand for {@link query.Condition#greaterThan}. + * @method + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/gt/ + */ + gt: Condition.greaterThan, + + /** + * Adds a greater than or equal to filter to the field. Shorthand for {@link query.Condition#greaterThanOrEqualTo}. + * @method + * @param {string} field The field to filter + * @param {number|string|Date} value The value used to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/gte/ + */ + ge: Condition.greaterThanOrEqualTo, + + /** + * Adds a contains any filter to the collection field. The collection must contains one the given values. + * Alias for {@link query.Condition#in} + * @method + * @param {string} field The field to filter + * @param {...(*|Array<*>)} args The field value or values to filter + * @return {query.Filter} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/operator/query/in/ + */ + containsAny: Condition.in +}); + +module.exports = Condition; + +},{"58":58}],55:[function(_dereq_,module,exports){ +"use strict"; + +var Node = _dereq_(56); +var Condition = _dereq_(54); + +/** + * @alias query.Filter + * @extends query.Node + * @extends query.Condition + */ + +var Filter = function (_Node) { + babelHelpers.inherits(Filter, _Node); + + /** + * @param {EntityManager} entityManager The owning entity manager of this query + * @param {Class} resultClass The query result class + */ + function Filter(entityManager, resultClass) { + babelHelpers.classCallCheck(this, Filter); + + /** + * The actual filters of this node + * @type Object + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Node.call(this, entityManager, resultClass)); + + _this._filter = {}; + return _this; + } + + Filter.prototype._addFilter = function _addFilter(field, filter, value) { + if (field !== null) { + if (!(Object(field) instanceof String)) throw new Error('Field must be a string.'); + + if (filter) { + var fieldFilter = this._filter[field]; + if (!(fieldFilter instanceof Object) || Object.getPrototypeOf(fieldFilter) != Object.prototype) { + this._filter[field] = fieldFilter = {}; + } + + fieldFilter[filter] = value; + } else { + this._filter[field] = value; + } + } else { + Object.assign(this._filter, value); + } + + return this; + }; + + Filter.prototype.toJSON = function toJSON() { + return this._filter; + }; + + return Filter; +}(Node); + +Object.assign(Filter.prototype, Condition); +module.exports = Filter; + +},{"54":54,"56":56}],56:[function(_dereq_,module,exports){ +"use strict"; + +var Query = _dereq_(58); +var message = _dereq_(36); +var Metadata = _dereq_(63); +var Entity = _dereq_(10); + +/** + * @alias query.Node + * @extends query.Query + */ + +var Node = function (_Query) { + babelHelpers.inherits(Node, _Query); + + /** + * @param {EntityManager} entityManager The owning entity manager of this query + * @param {Class} resultClass The query result class + */ + function Node(entityManager, resultClass) { + babelHelpers.classCallCheck(this, Node); + + /** + * The offset how many results should be skipped + * @type number + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Query.call(this, entityManager, resultClass)); + + _this.firstResult = 0; + + /** + * The limit how many objects should be returned + * @type number + */ + _this.maxResults = -1; + + _this._sort = {}; + return _this; + } + + /** + * @inheritDoc + */ + + + Node.prototype.stream = function stream(options) { + return this._stream(options, this); + }; + + /** + * Only available in streaming SDK! + * @ignore + */ + + + Node.prototype._stream = function _stream(options, target) { + throw new Error('Streaming features not available! Please use Streaming SDK!'); + }; + + /** + * @inheritDoc + */ + + + Node.prototype.resultList = function resultList(options, doneCallback, failCallback) { + var _this2 = this; + + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null; + + if (!type) { + throw new Error('Only typed queries can be executed.'); + } + + var query = this._serializeQuery(); + var sort = this._serializeSort(); + + var uriSize = this.entityManager._connector.host.length + query.length; + var msg; + if (uriSize > Query.MAX_URI_SIZE) { + msg = new message.AdhocQueryPOST(type.name, this.firstResult, this.maxResults, sort).entity(query, 'text'); + } else { + msg = new message.AdhocQuery(type.name, query, this.firstResult, this.maxResults, sort); + } + + return this.entityManager.send(msg).then(function (response) { + return _this2._createResultList(response.entity, options); + }).then(doneCallback, failCallback); + }; + + /** + * @inheritDoc + */ + + + Node.prototype.singleResult = function singleResult(options, doneCallback, failCallback) { + var _this3 = this; + + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null; + + if (!type) { + throw new Error('Only typed queries can be executed.'); + } + + var query = this._serializeQuery(); + var sort = this._serializeSort(); + + var uriSize = this.entityManager._connector.host.length + query.length; + var msg; + if (uriSize > Query.MAX_URI_SIZE) { + msg = new message.AdhocQueryPOST(type.name, query, this.firstResult, 1, sort).entity(query, 'text'); + } else { + msg = new message.AdhocQuery(type.name, query, this.firstResult, 1, sort); + } + + return this.entityManager.send(msg).then(function (response) { + return _this3._createResultList(response.entity, options); + }).then(function (list) { + return list.length ? list[0] : null; + }).then(doneCallback, failCallback); + }; + + /** + * @inheritDoc + */ + + + Node.prototype.count = function count(doneCallback, failCallback) { + var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null; + + if (!type) { + throw new Error('Only typed queries can be executed.'); + } + + var query = this._serializeQuery(); + + var uriSize = this.entityManager._connector.host.length + query.length; + var msg; + if (uriSize > Query.MAX_URI_SIZE) { + msg = new message.AdhocCountQueryPOST(type.name).entity(query, 'text'); + } else { + msg = new message.AdhocCountQuery(type.name, query); + } + + return this.entityManager.send(msg).then(function (response) { + return response.entity.count; + }).then(doneCallback, failCallback); + }; + + Node.prototype._serializeQuery = function _serializeQuery() { + return JSON.stringify(this, function (k, v) { + var typedValue = this[k]; + if (Object(typedValue) instanceof Date) { + return { $date: v }; + } else if (typedValue instanceof Entity) { + return typedValue.id; + } else { + return v; + } + }); + }; + + Node.prototype._serializeSort = function _serializeSort() { + return JSON.stringify(this._sort); + }; + + Node.prototype._createResultList = function _createResultList(result, options) { + if (result.length) { + return Promise.all(result.map(function (el) { + if (el.id) { + var entity = this.entityManager.getReference(this.resultClass, el.id); + var metadata = Metadata.get(entity); + metadata.setJson(el, true); + return this.entityManager.resolveDepth(entity, options); + } else { + return this.entityManager.load(Object.keys(el)[0]); + } + }, this)).then(function (result) { + return result.filter(function (val) { + return !!val; + }); + }); + } else { + return Promise.resolve([]); + } + }; + + Node.prototype._addOrder = function _addOrder(fieldOrSort, order) { + if (order) { + this._sort[fieldOrSort] = order; + } else { + this._sort = fieldOrSort; + } + return this; + }; + + Node.prototype._addOffset = function _addOffset(offset) { + this.firstResult = offset; + return this; + }; + + Node.prototype._addLimit = function _addLimit(limit) { + this.maxResults = limit; + return this; + }; + + return Node; +}(Query); + +module.exports = Node; + +},{"10":10,"36":36,"58":58,"63":63}],57:[function(_dereq_,module,exports){ +"use strict"; + +var Node = _dereq_(56); + +/** + * @alias query.Operator + * @extends query.Node + */ + +var Operator = function (_Node) { + babelHelpers.inherits(Operator, _Node); + + /** + * @param {EntityManager} entityManager The owning entity manager of this query + * @param {Class} resultClass The query result class + * @param {string} operator The operator used to join the childs + * @param {Array>} childs The childs to join + */ + function Operator(entityManager, resultClass, operator, childs) { + babelHelpers.classCallCheck(this, Operator); + + /** + * The operator used to join the child queries + * @type string + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Node.call(this, entityManager, resultClass)); + + _this._operator = operator; + /** + * The child Node of this query, it is always one + * @type Array + */ + _this._childs = childs; + return _this; + } + + Operator.prototype.toJSON = function toJSON() { + var json = {}; + json[this._operator] = this._childs; + return json; + }; + + return Operator; +}(Node); + +module.exports = Operator; + +},{"56":56}],58:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias query.Query + */ + +var Query = function () { + function Query(entityManager, resultClass) { + babelHelpers.classCallCheck(this, Query); + + /** + * The owning EntityManager of this query + * @type EntityManager + */ + this.entityManager = entityManager; + + /** + * The result class of this query + * @type Class + */ + this.resultClass = resultClass; + } + + /** + * Add an ascending sort for the specified field to this query + * @param {string} field The field to sort + * @return {query.Query} The resulting Query + */ + + + Query.prototype.ascending = function ascending(field) { + return this._addOrder(field, 1); + }; + + /** + * Add an decending sort for the specified field to this query + * @param {string} field The field to sort + * @return {query.Query} The resulting Query + */ + + + Query.prototype.descending = function descending(field) { + return this._addOrder(field, -1); + }; + + /** + * Sets the sort of the query and discard all existing paramaters + * @param {Object} sort The new sort of the query + * @return {query.Query} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/method/cursor.sort/ + */ + + + Query.prototype.sort = function sort(_sort) { + if (!(_sort instanceof Object) || Object.getPrototypeOf(_sort) != Object.prototype) throw new Error('sort must be an object.'); + + return this._addOrder(_sort); + }; + + /** + * Sets the offset of the query, i.e. how many elements should be skipped + * @param {number} offset The offset of this query + * @return {query.Query} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/method/cursor.skip/ + */ + + + Query.prototype.offset = function offset(_offset) { + if (_offset < 0) throw new Error("The offset can't be nagative."); + + return this._addOffset(_offset); + }; + + /** + * Sets the limit of this query, i.e hox many objects should be returnd + * @param {number} limit The limit of this query + * @return {query.Query} The resulting Query + * + * @see http://docs.mongodb.org/manual/reference/method/cursor.limit/ + */ + + + Query.prototype.limit = function limit(_limit) { + if (_limit < 0) throw new Error("The limit can't be nagative."); + + return this._addLimit(_limit); + }; + + /** + * Execute the query and return the query results as a List. + * Note: All local unsaved changes on matching objects, will be discarded. + * @param {Object} [options] The query options + * @param {number|boolean} [options.depth=0] The object depth which will be loaded. Depth 0 load only the found + * objects, true loads the objects by reachability. + * @param {query.Query~resultListCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise>} A promise that will be resolved with the query result as a list + */ + + + Query.prototype.resultList = function resultList(options, doneCallback, failCallback) {}; + + /** + * Execute the query and return the query results as a List. + * Note: All local unsaved changes on matching objects, will be discarded. + * @param {query.Query~resultListCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise>} A promise that will be resolved with the query result as a list + * @name resultList + * @memberOf query.Query.prototype + * @method + */ + + /** + * Execute the query that returns a single result. + * Note: All local unsaved changes on the matched object, will be discarded. + * @param {Object} [options] The query options + * @param {number|boolean} [options.depth=0] The object depth which will be loaded. Depth 0 load only the found + * object, true loads the objects by reachability. + * @param {query.Query~singleResultCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A promise that will be resolved with the query result as a single result + */ + + + Query.prototype.singleResult = function singleResult(options, doneCallback, failCallback) {}; + + /** + * Execute the query that returns a single result. + * Note: All local unsaved changes on the matched object, will be discarded. + * @param {query.Query~singleResultCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise} A promise that will be resolved with the query result as a single result + * @name singleResult + * @memberOf query.Query.prototype + * @method + */ + + /** + * Returns an RxJS observable that receives events for streaming query. + * @param {Object} [options] options on whether an initial result and what kind of events (w.r.t. match types and operations) are requested + * @param {boolean} [options.initial=true] whether or not you want to receive the initial result set (i.e. the entities matching the query at subscription time) + * @param {(string|Array)} [options.matchTypes=['all']] the match types you are interested in; accepts the default ('all'/['all']) or any combination of 'match', 'add', 'change', 'changeIndex' and 'remove' + * @param {(string|Array)} [options.operations=['any']] the operations you are interested in; accepts the default ('any'/['any']) or any combination of 'insert', 'update', 'delete' and 'none' + * @return {Observable>} an RxJS observable + */ + + + Query.prototype.stream = function stream(options) {}; + + /** + * Execute the query that returns the matching objects count. + * @param {query.Query~countCallback=} doneCallback Called when the operation succeed. + * @param {query.Query~failCallback=} failCallback Called when the operation failed. + * @return {Promise} The total number of matched objects + */ + + + Query.prototype.count = function count(doneCallback, failCallback) {}; + + return Query; +}(); + +Query.MAX_URI_SIZE = 2000; + +Query.varargs = function varargs(offset, args) { + return Array.prototype.concat.apply([], Array.prototype.slice.call(args, offset)); +}; + +module.exports = Query; + +/** + * The resultList callback is called, when the asynchronous query operation completes successfully + * @callback query.Query~resultListCallback + * @param {Array} result The query result list, an empty list if no match was found + * @return {Promise<*>|*} A Promise, result or undefined + */ + +/** + * The singleResult callback is called, when the asynchronous query operation completes successfully + * @callback query.Query~singleResultCallback + * @param {T} entity The matching object or null id no matching object was found + * @return {Promise<*>|*} A Promise, result or undefined + */ + +/** + * The count callback is called, when the asynchronous query operation completes successfully + * @callback query.Query~countCallback + * @param {number} count the matching object count + * @return {Promise<*>|*} A Promise, result or undefined + */ + +/** + * The fail callback is called, when the asynchronous query operation is rejected by an error + * @callback query.Query~failCallback + * @param {error.PersistentError} error The error which reject the operation + * @return {Promise<*>|*} A Promise, result or undefined + */ + +},{}],59:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace query + */ + +exports.Builder = _dereq_(53); +exports.Condition = _dereq_(54); +exports.Filter = _dereq_(55); +exports.Node = _dereq_(56); +exports.Operator = _dereq_(57); +exports.Query = _dereq_(58); + +},{"53":53,"54":54,"55":55,"56":56,"57":57,"58":58}],60:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var StatusCode = _dereq_(25).StatusCode; + +/** + * @alias util.Code + * @param {metamodel.Metamodel} metamodel + */ + +var Code = function () { + function Code(metamodel, entityManagerFactory) { + babelHelpers.classCallCheck(this, Code); + + /** + * @private + * @type metamodel.Metamodel + */ + this._metamodel = metamodel; + /** @type EntityManagerFactory */ + this.entityManagerFactory = entityManagerFactory; + } + + /** + * Converts the given function to a string + * @param {Function} fn The JavaScript function to serialize + * @return {string} The serialized function + */ + + + Code.prototype.functionToString = function functionToString(fn) { + if (!fn) return ""; + + var str = fn.toString(); + str = str.substring(str.indexOf("{") + 1, str.lastIndexOf("}")); + if (str.charAt(0) == '\n') str = str.substring(1); + + if (str.charAt(str.length - 1) == '\n') str = str.substring(0, str.length - 1); + + return str; + }; + + /** + * Converts the given string to a module wrapper function + * @param {Array} signature The expected parameters of the function + * @param {string} code The JavaScript function to deserialize + * @return {Function} The deserialized function + */ + + + Code.prototype.stringToFunction = function stringToFunction(signature, code) { + return new Function(signature, code); + }; + + /** + * Loads a list of all available modules + * Does not include handlers + * + * @returns {Promise>} + */ + + + Code.prototype.loadModules = function loadModules() { + var msg = new message.GetAllModules(); + return this.entityManagerFactory.send(msg).then(function (response) { + return response.entity; + }); + }; + + /** + * Loads Baqend code which will be identified by the given bucket and code codeType + * + * @param {metamodel.ManagedType|string} type The entity type for the handler or the Name of the + * Baqend code + * @param {string} codeType The type of the code + * @param {boolean} [asFunction=false] set it to true, to parse the code as a function and return it + * instead of a string + * @returns {Promise} The code as string or as a parsed function + */ + + + Code.prototype.loadCode = function loadCode(type, codeType, asFunction) { + var _this = this; + + var bucket = Object(type) instanceof String ? type : type.name; + var msg = new message.GetBaqendCode(bucket, codeType).responseType('text'); + + return this.entityManagerFactory.send(msg).then(function (response) { + return _this._parseCode(bucket, codeType, asFunction, response.entity); + }, function (e) { + if (e.status == StatusCode.OBJECT_NOT_FOUND) return null; + + throw e; + }); + }; + + /** + * Saves Baqend code which will be identified by the given bucket and code type + * + * @param {metamodel.ManagedType|string} type The entity type for the handler or the Name of the + * Baqend code + * @param {string} codeType The type of the code + * @param {string|Function} fn Baqend code as a string or function + * @return {Promise} The stored code as a string or as a parsed function + */ + + + Code.prototype.saveCode = function saveCode(type, codeType, fn) { + var _this2 = this; + + var bucket = Object(type) instanceof String ? type : type.name; + var asFunction = fn instanceof Function; + + var msg = new message.SetBaqendCode(bucket, codeType).entity(asFunction ? this.functionToString(fn) : fn, 'text').responseType('text'); + + return this.entityManagerFactory.send(msg).then(function (response) { + return _this2._parseCode(bucket, codeType, asFunction, response.entity); + }); + }; + + /** + * Deletes Baqend code identified by the given bucket and code type + * + * @param {metamodel.ManagedType|string} type The entity type for the handler or the Name of the + * Baqend code + * @param {string} codeType The type of the code + * @returns {Promise<*>} succeed if the code was deleted + */ + + + Code.prototype.deleteCode = function deleteCode(type, codeType) { + var _this3 = this; + + var bucket = Object(type) instanceof String ? type : type.name; + var msg = new message.DeleteBaqendCode(bucket, codeType); + return this.entityManagerFactory.send(msg).then(function () { + return _this3._parseCode(bucket, codeType, false, null); + }); + }; + + Code.prototype._parseCode = function _parseCode(bucket, codeType, asFunction, code) { + if (codeType == 'validate') { + var type = this._metamodel.entity(bucket); + type.validationCode = code; + return asFunction ? type.validationCode : code; + } else { + return asFunction ? this.stringToFunction(['module', 'exports'], code) : code; + } + }; + + return Code; +}(); + +module.exports = Code; + +},{"25":25,"36":36}],61:[function(_dereq_,module,exports){ +"use strict"; + +/** + * This base class provides an lock interface to execute exclusive operations + * @alias util.Lockable + */ + +var Lockable = function () { + function Lockable() { + babelHelpers.classCallCheck(this, Lockable); + + /** + * Indicates if there is currently an onging exclusive operation + * @type boolean + * @private + */ + this._isLocked = false; + + /** + * A promise which represents the state of the least exclusive operation + * @type Promise + * @private + */ + this._readyPromise = Promise.resolve(this); + + /** + * A deferred used to explicit lock and unlock this instance + * @private + */ + this._deferred = null; + } + + /** + * Indicates if there is currently no exclusive operation executed + * true If no exclusive lock is hold + * @type {boolean} + */ + + + /** + * Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled + * @param {util.Lockable~callback=} doneCallback The callback which will be invoked when the previously + * operations on this object is completed. + * @param {util.Lockable~callback=} failCallback When the lock can't be released caused by a none + * recoverable error + * @return {Promise} A promise which completes successfully, when the previously requested + * operation completes + */ + Lockable.prototype.ready = function ready(doneCallback, failCallback) { + return this._readyPromise.then(doneCallback, failCallback); + }; + + /** + * Try to aquire an exclusive lock and executes the given callback. + * @param {util.Lockable~callback} callback The exclusive operation to execute + * @param {boolean} [critical=false] Indicates if the operation is critical. If the operation is critical and the + * operation fails, then the lock will not be released + * @return {Promise} A promise + * @throws {Error} If the lock can't be aquired + * @protected + */ + + + Lockable.prototype.withLock = function withLock(callback, critical) { + if (this._isLocked) throw new Error('Current operation has not been finished.'); + + var self = this; + try { + this._isLocked = true; + var result = callback().then(function (result) { + self._isLocked = false; + return result; + }, function (e) { + if (!critical) self._isLocked = false; + throw e; + }); + + this._readyPromise = result.then(function () { + return self; + }, function (e) { + if (!critical) return self; + throw e; + }); + + return result; + } catch (e) { + if (critical) { + this._readyPromise = Promise.reject(e); + } else { + this._isLocked = false; + } + throw e; + } + }; + + babelHelpers.createClass(Lockable, [{ + key: "isReady", + get: function get() { + return !this._isLocked; + } + }]); + return Lockable; +}(); + +module.exports = Lockable; + +/** + * The operation callback is used by the {@link util.Lockable#withLock} method, + * to perform an exclusive operation on the + * @callback util.Lockable~callback + * @return {Promise<*>} A Promise, which reflects the result of the operation + */ + +},{}],62:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); +var StatusCode = _dereq_(25).StatusCode; + +/** + * @alias util.Logger + */ + +var Logger = function () { + function Logger() { + babelHelpers.classCallCheck(this, Logger); + } + + Logger.create = function create(entityManager) { + var proto = this.prototype; + + function Logger() { + proto.log.apply(Logger, arguments); + } + + for (var _iterator = Object.getOwnPropertyNames(proto), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var key = _ref; + + Object.defineProperty(Logger, key, Object.getOwnPropertyDescriptor(proto, key)); + }Logger._init(entityManager); + + return Logger; + }; + + /** + * The log level which will be logged + * + * The log level can be one of 'trace', 'debug', 'info', 'warn', 'error' + * @type string + */ + + + /** + * Logs a message in the default level 'info' + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * + * @name log + * @memberOf util.Logger.prototype + * @function + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Logs a message in the default level 'info' + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * + * @name log + * @memberOf util.Logger.prototype + * @function + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Logs a message with the given log level + * @param {string} level The level used to log the message + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @name log + * @memberOf util.Logger.prototype + * @function + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Logs a message with the given log level + * @param {string} level The level used to log the message + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + Logger.prototype.log = function log(level, message, data) { + var args = Array.prototype.slice.call(arguments); + + if (Logger.LEVELS.indexOf(args[0]) == -1) { + level = 'info'; + } else { + level = args.shift(); + } + + if (this.levelIndex > Logger.LEVELS.indexOf(level)) return; + + message = typeof args[0] === 'string' ? this._format(args.shift(), args) : '[no message]'; + data = null; + if (args.length && babelHelpers.typeof(args[args.length - 1]) === 'object') { + data = args.pop(); + if (Array.isArray(data)) data = { data: data }; + } + + if (args.length) { + message += ", " + args.join(", "); + } + + return this._log({ + date: new Date(), + message: message, + level: level, + user: this.entityManager.me && this.entityManager.me.id, + data: data + }); + }; + + Logger.prototype._format = function _format(f, args) { + if (args.length == 0) return f; + + var str = String(f).replace(Logger.FORMAT_REGEXP, function (x) { + if (x === '%%') return '%'; + if (!args.length) return x; + switch (x) { + case '%s': + return String(args.shift()); + case '%d': + return Number(args.shift()); + case '%j': + try { + return JSON.stringify(args.shift()); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + + return str; + }; + + Logger.prototype._init = function _init(entityManager) { + var _this = this; + + /** @type EntityManager */ + this.entityManager = entityManager; + this.levelIndex = 2; + + Logger.LEVELS.forEach(function (level) { + _this[level] = _this.log.bind(_this, level); + }); + }; + + Logger.prototype._log = function _log(json) { + if (!this.entityManager.isReady) { + return this.entityManager.ready(this._log.bind(this, json)); + } else { + return this.entityManager.send(new message.CreateObject('logs.AppLog', json)); + } + }; + + /** + * Log message at trace level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function trace + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at trace level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function trace + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at debug level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function debug + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at debug level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function debug + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at info level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function info + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at info level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function info + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at warn level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function warn + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at warn level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function warn + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at error level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will + * be included in the log entry + * @function error + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + /** + * Log message at error level + * @param {string} message The message to log, the message string can be interpolated like the node util.format method + * @param {Object} [data=null] An optional object which will be included in the log entry + * @function error + * @memberOf util.Logger.prototype + * + * @see https://nodejs.org/api/util.html#util_util_format_format + */ + + + babelHelpers.createClass(Logger, [{ + key: 'level', + get: function get() { + return Logger.LEVELS[this.levelIndex]; + } + + /** + * Sets the log level which will be logged + * @param {string} value + */ + , + set: function set(value) { + var index = Logger.LEVELS.indexOf(value); + if (index == -1) throw new Error("Unknown logging level " + value); + + this.levelIndex = index; + } + }]); + return Logger; +}(); + +Object.assign(Logger, { + LEVELS: ['trace', 'debug', 'info', 'warn', 'error'], + FORMAT_REGEXP: /%[sdj%]/g +}); + +module.exports = Logger; + +},{"25":25,"36":36}],63:[function(_dereq_,module,exports){ +"use strict"; + +var error = _dereq_(34); +var Acl = _dereq_(1); +var Lockable = _dereq_(61); +var binding = _dereq_(20); + +/** + * @alias util.Metadata + * @extends util.Lockable + */ + +var Metadata = function (_Lockable) { + babelHelpers.inherits(Metadata, _Lockable); + + Metadata.create = function create(type, object) { + var metadata; + if (type.isEntity) { + metadata = new Metadata(object, type); + } else if (type.isEmbeddable) { + metadata = { + type: type, + readAccess: function readAccess() { + var metadata = this._root && this._root._metadata; + if (metadata) metadata.readAccess(); + }, + writeAccess: function writeAccess() { + var metadata = this._root && this._root._metadata; + if (metadata) metadata.writeAccess(); + } + }; + } else { + throw new Error('Illegal type ' + type); + } + + return metadata; + }; + + /** + * Returns the metadata of the managed object + * @param {binding.Managed} managed + * @return {util.Metadata} + */ + + + Metadata.get = function get(managed) { + return managed._metadata; + }; + + /** + * @type EntityManager + */ + + + babelHelpers.createClass(Metadata, [{ + key: 'db', + get: function get() { + if (this._db) return this._db; + + return this._db = _dereq_(6); + } + + /** + * @param db {EntityManager} + */ + , + set: function set(db) { + if (!this._db) { + this._db = db; + } else { + throw new Error("DB has already been set."); + } + } + + /** + * @type string + */ + + }, { + key: 'bucket', + get: function get() { + return this.type.name; + } + + /** + * @type string + */ + + }, { + key: 'key', + get: function get() { + if (!this._key && this.id) { + var index = this.id.lastIndexOf('/'); + this._key = decodeURIComponent(this.id.substring(index + 1)); + } + return this._key; + } + + /** + * @param {string} value + */ + , + set: function set(value) { + value += ''; + + if (this.id) throw new Error('The id can\'t be set twice.'); + + this.id = '/db/' + this.bucket + '/' + encodeURIComponent(value); + this._key = value; + } + + /** + * Indicates if this object already belongs to an db + * true if this object belongs already to an db otherwise false + * @type boolean + */ + + }, { + key: 'isAttached', + get: function get() { + return !!this._db; + } + + /** + * Indicates if this object is represents a db object, but was not loaded up to now + * @type boolean + */ + + }, { + key: 'isAvailable', + get: function get() { + return this._state > Metadata.Type.UNAVAILABLE; + } + + /** + * Indicates if this object represents the state of the db and was not modified in any manner + * @type boolean + */ + + }, { + key: 'isPersistent', + get: function get() { + return this._state == Metadata.Type.PERSISTENT; + } + + /** + * Indicates that this object was modified and the object was not written back to the db + * @type boolean + */ + + }, { + key: 'isDirty', + get: function get() { + return this._state == Metadata.Type.DIRTY; + } + + /** + * @param {binding.Entity} entity + * @param {metamodel.ManagedType} type + */ + + }]); + + function Metadata(entity, type) { + babelHelpers.classCallCheck(this, Metadata); + + /** + * @type binding.Entity + * @private + */ + var _this = babelHelpers.possibleConstructorReturn(this, _Lockable.call(this)); + + _this._root = entity; + _this._state = Metadata.Type.DIRTY; + _this._enabled = true; + _this.persisting = false; + /** @type string */ + _this.id = null; + /** @type number */ + _this.version = null; + /** @type metamodel.ManagedType */ + _this.type = type; + /** @type Acl */ + _this.acl = new Acl(_this); + return _this; + } + + /** + * Signals that the object will be access by a read access + * Ensures that the object was loaded already + */ + + + Metadata.prototype.readAccess = function readAccess() { + if (this._enabled) { + if (!this.isAvailable) { + throw new error.PersistentError('This object ' + this.id + ' is not available.'); + } + } + }; + + /** + * Signals that the object will be access by a write access + * Ensures that the object was loaded already and marks the object as dirty + */ + + + Metadata.prototype.writeAccess = function writeAccess() { + if (this._enabled) { + if (!this.isAvailable) { + throw new error.PersistentError('This object ' + this.id + ' is not available.'); + } + + this.setDirty(); + } + }; + + /** + * Indicates that the associated object isn't available + */ + + + Metadata.prototype.setUnavailable = function setUnavailable() { + this._state = Metadata.Type.UNAVAILABLE; + }; + + /** + * Indicates that the associated object isn't stale, i.e. + * the object correlate the database state and is not modified by the user + */ + + + Metadata.prototype.setPersistent = function setPersistent() { + this._state = Metadata.Type.PERSISTENT; + }; + + /** + * Indicates the the object is modified by the user + */ + + + Metadata.prototype.setDirty = function setDirty() { + this._state = Metadata.Type.DIRTY; + }; + + /** + * Indicates the the object is removed + */ + + + Metadata.prototype.setRemoved = function setRemoved() { + //mark the object only as dirty if it was already available + if (this.isAvailable) { + this.setDirty(); + this.version = null; + } + }; + + Metadata.prototype.getJsonMetadata = function getJsonMetadata() { + var info = {}; + + if (this.id) { + info.id = this.id; + } + + if (this.version) { + info.version = this.version; + } + + info.acl = this.acl; + + return info; + }; + + /** + * Sets the object metadata from the object + * @param {Object} json + */ + + + Metadata.prototype.setJsonMetadata = function setJsonMetadata(json) { + if (!this.id) { + this.id = json.id; + } + + if (json.version) this.version = json.version; + + this.acl.fromJSON(json.acl || {}); + }; + + /** + * Converts the object to an JSON-Object + * @param {boolean} [excludeMetadata=false] + * @param {boolean} [persisting=false] indicates if the current state will be persisted. + * Used to update the internal change tracking state of collections and mark the object persistent if its true + * @returns {json} JSON-Object + */ + + + Metadata.prototype.getJson = function getJson(excludeMetadata, persisting) { + this._enabled = false; + this.persisting = !!persisting; + var json = this.type.toJsonValue(this, this._root, true); + this._enabled = true; + this.persisting = false; + + if (this.isAttached && !excludeMetadata) { + Object.assign(json, this.getJsonMetadata()); + } + + return json; + }; + + /** + * Sets the object content from json + * @param {json} json The updated json content + * @param {boolean} [persisting=false] indicates if the current state will be persisted. + * Used to update the internal change tracking state of collections and mark the object persistent or dirty afterwards + */ + + + Metadata.prototype.setJson = function setJson(json, persisting) { + if (json.id || json.version || json.acl) { + this.setJsonMetadata(json); + } + + this._enabled = false; + this.persisting = !!persisting; + this.type.fromJsonValue(this, json, this._root, true); + this._enabled = true; + this.persisting = false; + + if (persisting) { + this.setPersistent(); + } else { + this.setDirty(); + } + }; + + return Metadata; +}(Lockable); + +/** + * @enum {number} + */ + + +Metadata.Type = { + UNAVAILABLE: -1, + PERSISTENT: 0, + DIRTY: 1 +}; + +module.exports = Metadata; + +},{"1":1,"20":20,"34":34,"6":6,"61":61}],64:[function(_dereq_,module,exports){ +"use strict"; + +var message = _dereq_(36); + +/** + * @alias util.Modules + */ + +var Modules = function () { + + /** + * @param {EntityManager} entityManager + * @param {connector.Connector} connector + */ + function Modules(entityManager, connector) { + babelHelpers.classCallCheck(this, Modules); + + /** + * @type EntityManager + */ + this._entityManager = entityManager; + /** + * The connector used for requests + * @type connector.Connector + */ + this._connector = connector; + } + + /** + * Calls the module, which is identified by the given bucket. + * The optional query parameter will be attached as GET-parameters. + * + * @param {string} bucket Name of the module + * @param {Object|string=} query GET-Parameter as key-value-pairs or query string + * @param {Object=} options Additional request options + * @param {string=} options.responseType The type used to provide the response data, defaults to text oder json depends + * on the received data, can be one of arraybuffer, blob, json, text, base64, data-url + * @param {Function=} doneCallback + * @param {Function=} failCallback + * @returns {Promise} + */ + + + Modules.prototype.get = function get(bucket, query, options, doneCallback, failCallback) { + if (query instanceof Function) { + failCallback = options; + doneCallback = query; + options = {}; + query = null; + } + + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + options = options || {}; + + var msg = new message.GetBaqendModule(bucket).addQueryString(query).responseType(options.responseType || null); + + return this._send(msg, doneCallback, failCallback); + }; + + /** + * Calls the module, which is identified by the given bucket. + * + * @param {string} bucket Name of the module + * @param body {string|Blob|File|ArrayBuffer|FormData|json=} The POST-body data to send + * @param {Object=} options Additional request options + * @param {string=} options.requestType A optional type hint used to correctly interpret the provided data, can be one of + * arraybuffer, blob, json, text, base64, data-url, form + * @param {string=} options.mimeType The mimType of the body. Defaults to the mimeType of the provided data if + * it is a file object, blob or data-url + * @param {string=} options.responseType The type used to provide the response data, defaults to text oder json depends + * on the received data, can be one of arraybuffer, blob, json, text, base64, data-url + * @param {Function=} doneCallback + * @param {Function=} failCallback + * @returns {Promise} + */ + + + Modules.prototype.post = function post(bucket, body, options, doneCallback, failCallback) { + if (options instanceof Function) { + failCallback = doneCallback; + doneCallback = options; + options = {}; + } + + options = options || {}; + + var msg = new message.PostBaqendModule(bucket).entity(body, options.requestType).mimeType(options.mimeType || null).responseType(options.responseType || null); + + return this._send(msg, doneCallback, failCallback); + }; + + Modules.prototype._send = function _send(msg, doneCallback, failCallback) { + return this._entityManager.send(msg).then(function (response) { + return response.entity; + }).then(doneCallback, failCallback); + }; + + return Modules; +}(); + +module.exports = Modules; + +},{"36":36}],65:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias util.Permission + */ + +var Permission = function () { + + /** + * Creates a new Permission object, with an empty rule set + * @param {util.Metadata} metadata The metadata of the object + */ + function Permission(metadata) { + babelHelpers.classCallCheck(this, Permission); + + /** @type {Object.} */ + this._rules = {}; + /** @type util.Metadata */ + this._metadata = metadata; + } + + /** + * Returns a list of user and role references of all rules + * @return {Array} a list of references + */ + + + Permission.prototype.allRules = function allRules() { + return Object.keys(this._rules); + }; + + /** + * Removes all rules from this permission object + */ + + + Permission.prototype.clear = function clear() { + this._metadata && this._metadata.writeAccess(); + this._rules = {}; + }; + + /** + * Copies permissions from another permission object + * @param {util.Permission} permission The permission to copy from + * @return {util.Permission} + */ + + + Permission.prototype.copy = function copy(permission) { + this._metadata && this._metadata.writeAccess(); + this._rules = Object.assign({}, permission._rules); + return this; + }; + + /** + * Gets whenever all users and roles have the permission to perform the operation + * @return {boolean} true If public access is allowed + */ + + + Permission.prototype.isPublicAllowed = function isPublicAllowed() { + if ('*' in this._rules) return false; + + for (var ref in this._rules) { + if (this._rules[ref] == 'allow') { + return false; + } + } + + return true; + }; + + /** + * Sets whenever all users and roles should have the permission to perform the operation. + * Note: All other allow rules will be removed. + */ + + + Permission.prototype.setPublicAllowed = function setPublicAllowed() { + this._metadata && this._metadata.writeAccess(); + for (var ref in this._rules) { + if (this._rules[ref] == 'allow') { + delete this._rules[ref]; + } + } + }; + + /** + * Returns the actual rule of the given user or role. + * @param {model.User|model.Role|string} userOrRole The user or role to check for + * @return {string} The actual access rule or undefined if no rule was found + */ + + + Permission.prototype.getRule = function getRule(userOrRole) { + return this._rules[this._getRef(userOrRole)]; + }; + + /** + * Checks whenever the user or role is explicit allowed to perform the operation. + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + */ + + + Permission.prototype.isAllowed = function isAllowed(userOrRole) { + return this._rules[this._getRef(userOrRole)] == 'allow'; + }; + + /** + * Checks whenever the user or role is explicit denied to perform the operation. + * + * @param {model.User|model.Role|string} userOrRole The user or role to check for + */ + + + Permission.prototype.isDenied = function isDenied(userOrRole) { + return this._rules[this._getRef(userOrRole)] == 'deny'; + }; + + /** + * Allows the given users or rules to perform the operation + * @param {...(model.User|model.Role|string)} userOrRole The users or roles to allow + * @return {util.Permission} this permission object + */ + + + Permission.prototype.allowAccess = function allowAccess(userOrRole) { + var rules = arguments; + this._metadata && this._metadata.writeAccess(); + for (var i = 0; i < rules.length; i++) { + this._rules[this._getRef(rules[i])] = 'allow'; + } + return this; + }; + + /** + * Denies the given users or rules to perform the operation + * @param {...(model.User|model.Role|string)} userOrRole The users or roles to deny + * @return {util.Permission} this permission object + */ + + + Permission.prototype.denyAccess = function denyAccess(userOrRole) { + var rules = arguments; + this._metadata && this._metadata.writeAccess(); + for (var i = 0; i < rules.length; i++) { + this._rules[this._getRef(rules[i])] = 'deny'; + } + return this; + }; + + /** + * Deletes any allow/deny rules for the given users or roles + * @param {...(model.User|model.Role|string)} userOrRole The users or roles to delete rules for + * @return {util.Permission} this permission object + */ + + + Permission.prototype.deleteAccess = function deleteAccess(userOrRole) { + var rules = arguments; + this._metadata && this._metadata.writeAccess(); + for (var i = 0; i < rules.length; i++) { + delete this._rules[this._getRef(rules[i])]; + } + return this; + }; + + /** + * A Json representation of the set of rules + * @return {json} + */ + + + Permission.prototype.toJSON = function toJSON() { + return this._rules; + }; + + /** + * Sets the permission rules from json + * @param {json} json The permission json representation + */ + + + Permission.prototype.fromJSON = function fromJSON(json) { + this._rules = json; + }; + + /** + * Creates a permission from the given rules. + * @param {json} json The rules. + * @return {util.Permission} The permission. + */ + + + Permission.fromJSON = function fromJSON(json) { + var permission = new this(); + permission.fromJSON(json); + return permission; + }; + + /** + * Resolves user and role references and validate given references + * @param {model.User|model.Role|string} userOrRole The user, role or reference + * @return {string} The resolved and validated reference + * @private + */ + + + Permission.prototype._getRef = function _getRef(userOrRole) { + if (typeof userOrRole !== 'string') { + userOrRole = userOrRole._metadata.id; + } + + if (userOrRole.indexOf('/db/User/') == 0 || userOrRole.indexOf('/db/Role/') == 0) { + return userOrRole; + } + + throw new TypeError('The given object isn\'t a user, role or a valid reference.'); + }; + + return Permission; +}(); + +Permission.BASE_PERMISSIONS = ['load', 'update', 'delete', 'query', 'insert']; +module.exports = Permission; + +},{}],66:[function(_dereq_,module,exports){ +"use strict"; + +var Entity = _dereq_(10); + +/** + * @alias util.PushMessage + */ + +var PushMessage = function () { + + /** + * Push message will be used to send a push notification to a set of devices + * + * @param {Set|Array} [devices] The Set of device references which + * will receive this push notification. + * @param {string=} message The message of the push notification. + * @param {string=} subject The subject of the push notification. + * @param {string=} sound The file reference of the sound file as a string. The device uses this file as the + * notification sound. + * @param {number=} badge The badge count. + * @param {Object=} data The data object which can contain additional information. + */ + function PushMessage(devices, message, subject, sound, badge, data) { + babelHelpers.classCallCheck(this, PushMessage); + + /** + * Set of devices + * @type Set + */ + this.devices = null; + + if (devices instanceof Set) { + this.devices = devices; + } else if (!devices || devices[Symbol.iterator]) { + this.devices = new Set(devices); + } else if (devices instanceof Entity) { + this.devices = new Set(); + this.devices.add(devices); + } else { + throw new Error("Only Sets, Lists and Arrays can be used as devices."); + } + + /** + * push notification message + * @type string + */ + this.message = message; + + /** + * push notification subject + * @type string + */ + this.subject = subject; + + /** + * push notification sound + * @type string + */ + this.sound = sound; + + /** + * badge count + * @type number + */ + this.badge = badge; + + /** + * data object + * @type json + */ + this.data = data; + } + + /** + * Adds a new object to the set of devices + * + * @param {binding.Entity} device will be added to the device set to receive the push notification + */ + + + PushMessage.prototype.addDevice = function addDevice(device) { + if (!this.devices) { + this.devices = new Set(); + } + + this.devices.add(device); + }; + + PushMessage.prototype.toJSON = function toJSON() { + if (!this.devices || !this.devices.size) throw new Error("Set of devices is empty."); + + return Object.assign({}, this, { + devices: Array.from(this.devices, function (device) { + return device.id; + }) + }); + }; + + return PushMessage; +}(); + +module.exports = PushMessage; + +},{"10":10}],67:[function(_dereq_,module,exports){ +"use strict"; + +var hmac = _dereq_(71).hmac; + +/** + * @interface util.TokenStorageFactory + */ + +/** + * Creates a new tokenStorage which persist tokens for the given origin + * @param {string} origin The origin where the token contains to + * @return {Promise} The initialized token storage + * @name create + * @memberOf util.TokenStorageFactory.prototype + * @method + */ + +/** + * @alias util.TokenStorage + */ + +var TokenStorage = function () { + TokenStorage.create = function create(origin) { + return Promise.resolve(new TokenStorage(origin)); + }; + + /** + * @param {string} origin The origin where the token belongs to + * @param {string} token The initial token + * @param {boolean=} temporary If the token should be saved temporary or permanently + */ + + + babelHelpers.createClass(TokenStorage, [{ + key: 'token', + + /** + * Get the stored token + * @returns {string} The token or undefined, if no token is available + */ + get: function get() { + return this._token; + } + }]); + + function TokenStorage(origin, token, temporary) { + babelHelpers.classCallCheck(this, TokenStorage); + + /** + * The actual stored token + */ + this._token = token || null; + this._origin = origin; + /** + * Indicates if the token should keep temporary only or should be persisted for later sessions + * @type boolean + */ + this.temporary = temporary; + } + + /** + * Use the underlying storage implementation to save the token + * @param {string} origin The origin where the token belongs to + * @param {string} token The initial token + * @param {boolean} temporary If the token should be saved temporary or permanently + * @protected + * @abstract + */ + + + TokenStorage.prototype._saveToken = function _saveToken(origin, token, temporary) {}; + + /** + * Update the token for the givin origin, the operation may be asynchronous + * @param {String} token The token to store or null to remove the token + */ + + + TokenStorage.prototype.update = function update(token) { + this._token = token; + this._saveToken(this._origin, this._token, this.temporary); + }; + + /** + * Derived a resource token from the the stored origin token for the resource and signs the resource with the + * generated resource token + * @param {string} resource The resource which will be accessible with the returned token + * @returns {string} A resource token which can only be used to access the specified resource + */ + + + TokenStorage.prototype.signPath = function signPath(resource) { + var token = this.token; + if (token) { + var data = token.substring(0, token.length - 40); + var sig = token.substring(data.length); + + var path = resource.split('/').map(encodeURIComponent).join('/'); + return path + '?BAT=' + (data + hmac(resource + data, sig)); + } + return resource; + }; + + return TokenStorage; +}(); + +var tokens = {}; +/** + * @ignore + */ + +var GlobalStorage = function (_TokenStorage) { + babelHelpers.inherits(GlobalStorage, _TokenStorage); + + function GlobalStorage() { + babelHelpers.classCallCheck(this, GlobalStorage); + return babelHelpers.possibleConstructorReturn(this, _TokenStorage.apply(this, arguments)); + } + + GlobalStorage.create = function create(origin) { + return Promise.resolve(new GlobalStorage(origin, tokens[origin])); + }; + + /** + * @inheritDoc + */ + + + GlobalStorage.prototype._saveToken = function _saveToken(origin, token, temporary) { + if (!temporary) { + if (token) { + tokens[origin] = token; + } else { + delete tokens[origin]; + } + } + }; + + return GlobalStorage; +}(TokenStorage); + +/** + * @alias util.TokenStorage.GLOBAL + * @type {util.TokenStorageFactory} + */ + + +TokenStorage.GLOBAL = GlobalStorage; + +/** + * @ignore + */ + +var WebStorage = function (_TokenStorage2) { + babelHelpers.inherits(WebStorage, _TokenStorage2); + + function WebStorage() { + babelHelpers.classCallCheck(this, WebStorage); + return babelHelpers.possibleConstructorReturn(this, _TokenStorage2.apply(this, arguments)); + } + + WebStorage.isAvailable = function isAvailable() { + try { + //firefox throws an exception if cookies are disabled + if (typeof localStorage === 'undefined') { + return false; + } + + localStorage.setItem('bq_webstorage_test', 'bq'); + localStorage.removeItem('bq_webstorage_test'); + return true; + } catch (e) {} + return false; + }; + + WebStorage.create = function create(origin) { + var temporary = false; + var token = localStorage.getItem('BAT:' + origin); + if (!token) { + token = sessionStorage.getItem('BAT:' + origin); + temporary = !!token; + } + + return Promise.resolve(new WebStorage(origin, token, temporary)); + }; + + /** + * @inheritDoc + */ + + + WebStorage.prototype._saveToken = function _saveToken(origin, token, temporary) { + var webStorage = temporary ? sessionStorage : localStorage; + if (token) { + webStorage.setItem('BAT:' + origin, token); + } else { + webStorage.removeItem('BAT:' + origin); + } + }; + + return WebStorage; +}(TokenStorage); + +if (WebStorage.isAvailable()) { + /** + * @alias util.TokenStorage.WEB_STORAGE + * @type {util.TokenStorageFactory} + */ + TokenStorage.WEB_STORAGE = WebStorage; +} + +module.exports = TokenStorage; + +},{"71":71}],68:[function(_dereq_,module,exports){ +"use strict"; + +/** + * @alias util.ValidationResult + */ + +var ValidationResult = function () { + babelHelpers.createClass(ValidationResult, [{ + key: "isValid", + get: function get() { + for (var key in this.fields) { + if (!this.fields[key].isValid) { + return false; + } + } + return true; + } + }]); + + function ValidationResult() { + babelHelpers.classCallCheck(this, ValidationResult); + + this.fields = {}; + } + + ValidationResult.prototype.toJSON = function toJSON() { + var json = {}; + for (var key in this.fields) { + json[key] = this.fields[key].toJSON(); + } + return json; + }; + + return ValidationResult; +}(); + +module.exports = ValidationResult; + +},{}],69:[function(_dereq_,module,exports){ +"use strict"; + +var valLib = _dereq_(160); +var ValidationResult = _dereq_(68); + +/** + * @alias util.Validator + */ + +var Validator = function () { + + /** + * Compiles the given validation code for the managedType + * @param {metamodel.ManagedType} managedType The managedType of the code + * @param {string} validationCode The validation code + */ + Validator.compile = function compile(managedType, validationCode) { + var keys = []; + for (var _iterator = managedType.attributes(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + var attr = _ref; + + keys.push(attr.name); + } + + var fn = new Function(keys, validationCode); + return function onValidate(argObj) { + var args = keys.map(function (name) { + return argObj[name]; + }); + + return fn.apply({}, args); + }; + }; + + /** + * Gets the value of the attribute + * @return {*} Value + */ + + + /** + * Executes the given validation function to validate the value. + * + * The value will be passed as the first parameter to the validation function and + * the library {@link https://github.com/chriso/validator.js} as the second one. + * If the function returns true the value is valid, otherwise it's invalid. + * + * @name is + * @memberOf util.Validator.prototype + * @function + * @param {Function} fn will be used to validate the value + * @returns {util.Validator} + */ + + /** + * Executes the given validation function to validate the value. + * + * The value will be passed as the first parameter to the validation function and + * the library {@link https://github.com/chriso/validator.js} as the second one. + * If the function returns true the value is valid, otherwise it's invalid. + * + * @param {string} error The error message which will be used if the value is invalid + * @param {Function} fn will be used to validate the value + * @returns {util.Validator} + */ + Validator.prototype.is = function is(error, fn) { + if (error instanceof Function) { + fn = error; + error = 'is'; + } + if (fn(this.value, valLib) === false) { + this.errors.push(error); + } + return this; + }; + + babelHelpers.createClass(Validator, [{ + key: 'value', + get: function get() { + return this._entity[this.key]; + } + + /** + * Checks if the attribute is valid + * @return {boolean} + */ + + }, { + key: 'isValid', + get: function get() { + return this.errors.length == 0; + } + }]); + + function Validator(key, entity) { + babelHelpers.classCallCheck(this, Validator); + + /** + * Name of the attribute + * @type string + */ + this.key = key; + + /** + * Entity to get the value of the attribute + * @type {binding.Entity} + * @private + */ + this._entity = entity; + + /** + * Entity to get the value of the attribute + * @type {binding.Entity} + * @private + */ + this.errors = []; + } + + Validator.prototype._callMethod = function _callMethod(method, error, args) { + args = args || []; + args.unshift(this.value); + if (valLib[method].apply(this, args) === false) { + this.errors.push(error); + } + return this; + }; + + Validator.prototype.toString = function toString() { + return this.value; + }; + + Validator.prototype.toJSON = function toJSON() { + return { + isValid: this.isValid, + errors: this.errors + }; + }; + + return Validator; +}(); + +Object.keys(valLib).forEach(function (name) { + if (typeof valLib[name] == 'function' && name !== 'toString' && name !== 'toDate' && name !== 'extend' && name !== 'init') { + + /** + * @ignore + */ + Validator.prototype[name] = function (error) { + //noinspection JSPotentiallyInvalidUsageOfThis + return this._callMethod(name, error || name, Array.prototype.slice.call(arguments, error ? 1 : 0)); + }; + } +}); + +module.exports = Validator; + +},{"160":160,"68":68}],70:[function(_dereq_,module,exports){ +'use strict'; + +/** + * @namespace util + */ +module.exports = exports = _dereq_(71); +exports.Metadata = _dereq_(63); +exports.Permission = _dereq_(65); +exports.Validator = _dereq_(69); +exports.ValidationResult = _dereq_(68); +exports.Code = _dereq_(60); +exports.Modules = _dereq_(64); +exports.Lockable = _dereq_(61); +exports.Logger = _dereq_(62); +exports.PushMessage = _dereq_(66); +exports.TokenStorage = _dereq_(67); + +/** + * @function + * @name uuid + * @memberOf util.prototype + * @return {string} A generated version 4 UUID. + */ +exports.uuid = _dereq_(158).v4; + +},{"158":158,"60":60,"61":61,"62":62,"63":63,"64":64,"65":65,"66":66,"67":67,"68":68,"69":69,"71":71}],71:[function(_dereq_,module,exports){ +'use strict'; + +exports.hmac = _dereq_(155); +exports.atob = window.atob; +exports.isNode = false; + +},{"155":155}],72:[function(_dereq_,module,exports){ +module.exports = function(it){ + if(typeof it != 'function')throw TypeError(it + ' is not a function!'); + return it; +}; +},{}],73:[function(_dereq_,module,exports){ +// 22.1.3.31 Array.prototype[@@unscopables] +var UNSCOPABLES = _dereq_(144)('unscopables') + , ArrayProto = Array.prototype; +if(ArrayProto[UNSCOPABLES] == undefined)_dereq_(94)(ArrayProto, UNSCOPABLES, {}); +module.exports = function(key){ + ArrayProto[UNSCOPABLES][key] = true; +}; +},{"144":144,"94":94}],74:[function(_dereq_,module,exports){ +module.exports = function(it, Constructor, name, forbiddenField){ + if(!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)){ + throw TypeError(name + ': incorrect invocation!'); + } return it; +}; +},{}],75:[function(_dereq_,module,exports){ +var isObject = _dereq_(102); +module.exports = function(it){ + if(!isObject(it))throw TypeError(it + ' is not an object!'); + return it; +}; +},{"102":102}],76:[function(_dereq_,module,exports){ +// false -> Array#indexOf +// true -> Array#includes +var toIObject = _dereq_(137) + , toLength = _dereq_(138) + , toIndex = _dereq_(135); +module.exports = function(IS_INCLUDES){ + return function($this, el, fromIndex){ + var O = toIObject($this) + , length = toLength(O.length) + , index = toIndex(fromIndex, length) + , value; + // Array#includes uses SameValueZero equality algorithm + if(IS_INCLUDES && el != el)while(length > index){ + value = O[index++]; + if(value != value)return true; + // Array#toIndex ignores holes, Array#includes - not + } else for(;length > index; index++)if(IS_INCLUDES || index in O){ + if(O[index] === el)return IS_INCLUDES || index || 0; + } return !IS_INCLUDES && -1; + }; +}; +},{"135":135,"137":137,"138":138}],77:[function(_dereq_,module,exports){ +// getting tag from 19.1.3.6 Object.prototype.toString() +var cof = _dereq_(78) + , TAG = _dereq_(144)('toStringTag') + // ES3 wrong here + , ARG = cof(function(){ return arguments; }()) == 'Arguments'; + +// fallback for IE11 Script Access Denied error +var tryGet = function(it, key){ + try { + return it[key]; + } catch(e){ /* empty */ } +}; + +module.exports = function(it){ + var O, T, B; + return it === undefined ? 'Undefined' : it === null ? 'Null' + // @@toStringTag case + : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T + // builtinTag case + : ARG ? cof(O) + // ES3 arguments fallback + : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B; +}; +},{"144":144,"78":78}],78:[function(_dereq_,module,exports){ +var toString = {}.toString; + +module.exports = function(it){ + return toString.call(it).slice(8, -1); +}; +},{}],79:[function(_dereq_,module,exports){ +'use strict'; +var dP = _dereq_(115).f + , create = _dereq_(114) + , redefineAll = _dereq_(126) + , ctx = _dereq_(83) + , anInstance = _dereq_(74) + , defined = _dereq_(84) + , forOf = _dereq_(91) + , $iterDefine = _dereq_(105) + , step = _dereq_(107) + , setSpecies = _dereq_(129) + , DESCRIPTORS = _dereq_(85) + , fastKey = _dereq_(111).fastKey + , SIZE = DESCRIPTORS ? '_s' : 'size'; + +var getEntry = function(that, key){ + // fast case + var index = fastKey(key), entry; + if(index !== 'F')return that._i[index]; + // frozen object case + for(entry = that._f; entry; entry = entry.n){ + if(entry.k == key)return entry; + } +}; + +module.exports = { + getConstructor: function(wrapper, NAME, IS_MAP, ADDER){ + var C = wrapper(function(that, iterable){ + anInstance(that, C, NAME, '_i'); + that._i = create(null); // index + that._f = undefined; // first entry + that._l = undefined; // last entry + that[SIZE] = 0; // size + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + }); + redefineAll(C.prototype, { + // 23.1.3.1 Map.prototype.clear() + // 23.2.3.2 Set.prototype.clear() + clear: function clear(){ + for(var that = this, data = that._i, entry = that._f; entry; entry = entry.n){ + entry.r = true; + if(entry.p)entry.p = entry.p.n = undefined; + delete data[entry.i]; + } + that._f = that._l = undefined; + that[SIZE] = 0; + }, + // 23.1.3.3 Map.prototype.delete(key) + // 23.2.3.4 Set.prototype.delete(value) + 'delete': function(key){ + var that = this + , entry = getEntry(that, key); + if(entry){ + var next = entry.n + , prev = entry.p; + delete that._i[entry.i]; + entry.r = true; + if(prev)prev.n = next; + if(next)next.p = prev; + if(that._f == entry)that._f = next; + if(that._l == entry)that._l = prev; + that[SIZE]--; + } return !!entry; + }, + // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined) + // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined) + forEach: function forEach(callbackfn /*, that = undefined */){ + anInstance(this, C, 'forEach'); + var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3) + , entry; + while(entry = entry ? entry.n : this._f){ + f(entry.v, entry.k, this); + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + } + }, + // 23.1.3.7 Map.prototype.has(key) + // 23.2.3.7 Set.prototype.has(value) + has: function has(key){ + return !!getEntry(this, key); + } + }); + if(DESCRIPTORS)dP(C.prototype, 'size', { + get: function(){ + return defined(this[SIZE]); + } + }); + return C; + }, + def: function(that, key, value){ + var entry = getEntry(that, key) + , prev, index; + // change existing entry + if(entry){ + entry.v = value; + // create new entry + } else { + that._l = entry = { + i: index = fastKey(key, true), // <- index + k: key, // <- key + v: value, // <- value + p: prev = that._l, // <- previous entry + n: undefined, // <- next entry + r: false // <- removed + }; + if(!that._f)that._f = entry; + if(prev)prev.n = entry; + that[SIZE]++; + // add to index + if(index !== 'F')that._i[index] = entry; + } return that; + }, + getEntry: getEntry, + setStrong: function(C, NAME, IS_MAP){ + // add .keys, .values, .entries, [@@iterator] + // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11 + $iterDefine(C, NAME, function(iterated, kind){ + this._t = iterated; // target + this._k = kind; // kind + this._l = undefined; // previous + }, function(){ + var that = this + , kind = that._k + , entry = that._l; + // revert to the last existing entry + while(entry && entry.r)entry = entry.p; + // get next entry + if(!that._t || !(that._l = entry = entry ? entry.n : that._t._f)){ + // or finish the iteration + that._t = undefined; + return step(1); + } + // return step by kind + if(kind == 'keys' )return step(0, entry.k); + if(kind == 'values')return step(0, entry.v); + return step(0, [entry.k, entry.v]); + }, IS_MAP ? 'entries' : 'values' , !IS_MAP, true); + + // add [@@species], 23.1.2.2, 23.2.2.2 + setSpecies(NAME); + } +}; +},{"105":105,"107":107,"111":111,"114":114,"115":115,"126":126,"129":129,"74":74,"83":83,"84":84,"85":85,"91":91}],80:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(92) + , $export = _dereq_(89) + , redefine = _dereq_(127) + , redefineAll = _dereq_(126) + , meta = _dereq_(111) + , forOf = _dereq_(91) + , anInstance = _dereq_(74) + , isObject = _dereq_(102) + , fails = _dereq_(90) + , $iterDetect = _dereq_(106) + , setToStringTag = _dereq_(130) + , inheritIfRequired = _dereq_(97); + +module.exports = function(NAME, wrapper, methods, common, IS_MAP, IS_WEAK){ + var Base = global[NAME] + , C = Base + , ADDER = IS_MAP ? 'set' : 'add' + , proto = C && C.prototype + , O = {}; + var fixMethod = function(KEY){ + var fn = proto[KEY]; + redefine(proto, KEY, + KEY == 'delete' ? function(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'has' ? function has(a){ + return IS_WEAK && !isObject(a) ? false : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'get' ? function get(a){ + return IS_WEAK && !isObject(a) ? undefined : fn.call(this, a === 0 ? 0 : a); + } : KEY == 'add' ? function add(a){ fn.call(this, a === 0 ? 0 : a); return this; } + : function set(a, b){ fn.call(this, a === 0 ? 0 : a, b); return this; } + ); + }; + if(typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function(){ + new C().entries().next(); + }))){ + // create collection constructor + C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER); + redefineAll(C.prototype, methods); + meta.NEED = true; + } else { + var instance = new C + // early implementations not supports chaining + , HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) != instance + // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false + , THROWS_ON_PRIMITIVES = fails(function(){ instance.has(1); }) + // most early implementations doesn't supports iterables, most modern - not close it correctly + , ACCEPT_ITERABLES = $iterDetect(function(iter){ new C(iter); }) // eslint-disable-line no-new + // for early implementations -0 and +0 not the same + , BUGGY_ZERO = !IS_WEAK && fails(function(){ + // V8 ~ Chromium 42- fails only with 5+ elements + var $instance = new C() + , index = 5; + while(index--)$instance[ADDER](index, index); + return !$instance.has(-0); + }); + if(!ACCEPT_ITERABLES){ + C = wrapper(function(target, iterable){ + anInstance(target, C, NAME); + var that = inheritIfRequired(new Base, target, C); + if(iterable != undefined)forOf(iterable, IS_MAP, that[ADDER], that); + return that; + }); + C.prototype = proto; + proto.constructor = C; + } + if(THROWS_ON_PRIMITIVES || BUGGY_ZERO){ + fixMethod('delete'); + fixMethod('has'); + IS_MAP && fixMethod('get'); + } + if(BUGGY_ZERO || HASNT_CHAINING)fixMethod(ADDER); + // weak collections should not contains .clear method + if(IS_WEAK && proto.clear)delete proto.clear; + } + + setToStringTag(C, NAME); + + O[NAME] = C; + $export($export.G + $export.W + $export.F * (C != Base), O); + + if(!IS_WEAK)common.setStrong(C, NAME, IS_MAP); + + return C; +}; +},{"102":102,"106":106,"111":111,"126":126,"127":127,"130":130,"74":74,"89":89,"90":90,"91":91,"92":92,"97":97}],81:[function(_dereq_,module,exports){ +var core = module.exports = {version: '2.4.0'}; +if(typeof __e == 'number')__e = core; // eslint-disable-line no-undef +},{}],82:[function(_dereq_,module,exports){ +'use strict'; +var $defineProperty = _dereq_(115) + , createDesc = _dereq_(125); + +module.exports = function(object, index, value){ + if(index in object)$defineProperty.f(object, index, createDesc(0, value)); + else object[index] = value; +}; +},{"115":115,"125":125}],83:[function(_dereq_,module,exports){ +// optional / simple context binding +var aFunction = _dereq_(72); +module.exports = function(fn, that, length){ + aFunction(fn); + if(that === undefined)return fn; + switch(length){ + case 1: return function(a){ + return fn.call(that, a); + }; + case 2: return function(a, b){ + return fn.call(that, a, b); + }; + case 3: return function(a, b, c){ + return fn.call(that, a, b, c); + }; + } + return function(/* ...args */){ + return fn.apply(that, arguments); + }; +}; +},{"72":72}],84:[function(_dereq_,module,exports){ +// 7.2.1 RequireObjectCoercible(argument) +module.exports = function(it){ + if(it == undefined)throw TypeError("Can't call method on " + it); + return it; +}; +},{}],85:[function(_dereq_,module,exports){ +// Thank's IE8 for his funny defineProperty +module.exports = !_dereq_(90)(function(){ + return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7; +}); +},{"90":90}],86:[function(_dereq_,module,exports){ +var isObject = _dereq_(102) + , document = _dereq_(92).document + // in old IE typeof document.createElement is 'object' + , is = isObject(document) && isObject(document.createElement); +module.exports = function(it){ + return is ? document.createElement(it) : {}; +}; +},{"102":102,"92":92}],87:[function(_dereq_,module,exports){ +// IE 8- don't enum bug keys +module.exports = ( + 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf' +).split(','); +},{}],88:[function(_dereq_,module,exports){ +// all enumerable object keys, includes symbols +var getKeys = _dereq_(123) + , gOPS = _dereq_(120) + , pIE = _dereq_(124); +module.exports = function(it){ + var result = getKeys(it) + , getSymbols = gOPS.f; + if(getSymbols){ + var symbols = getSymbols(it) + , isEnum = pIE.f + , i = 0 + , key; + while(symbols.length > i)if(isEnum.call(it, key = symbols[i++]))result.push(key); + } return result; +}; +},{"120":120,"123":123,"124":124}],89:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , core = _dereq_(81) + , hide = _dereq_(94) + , redefine = _dereq_(127) + , ctx = _dereq_(83) + , PROTOTYPE = 'prototype'; + +var $export = function(type, name, source){ + var IS_FORCED = type & $export.F + , IS_GLOBAL = type & $export.G + , IS_STATIC = type & $export.S + , IS_PROTO = type & $export.P + , IS_BIND = type & $export.B + , target = IS_GLOBAL ? global : IS_STATIC ? global[name] || (global[name] = {}) : (global[name] || {})[PROTOTYPE] + , exports = IS_GLOBAL ? core : core[name] || (core[name] = {}) + , expProto = exports[PROTOTYPE] || (exports[PROTOTYPE] = {}) + , key, own, out, exp; + if(IS_GLOBAL)source = name; + for(key in source){ + // contains in native + own = !IS_FORCED && target && target[key] !== undefined; + // export native or passed + out = (own ? target : source)[key]; + // bind timers to global for call from export context + exp = IS_BIND && own ? ctx(out, global) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out; + // extend global + if(target)redefine(target, key, out, type & $export.U); + // export + if(exports[key] != out)hide(exports, key, exp); + if(IS_PROTO && expProto[key] != out)expProto[key] = out; + } +}; +global.core = core; +// type bitmap +$export.F = 1; // forced +$export.G = 2; // global +$export.S = 4; // static +$export.P = 8; // proto +$export.B = 16; // bind +$export.W = 32; // wrap +$export.U = 64; // safe +$export.R = 128; // real proto method for `library` +module.exports = $export; +},{"127":127,"81":81,"83":83,"92":92,"94":94}],90:[function(_dereq_,module,exports){ +module.exports = function(exec){ + try { + return !!exec(); + } catch(e){ + return true; + } +}; +},{}],91:[function(_dereq_,module,exports){ +var ctx = _dereq_(83) + , call = _dereq_(103) + , isArrayIter = _dereq_(100) + , anObject = _dereq_(75) + , toLength = _dereq_(138) + , getIterFn = _dereq_(145) + , BREAK = {} + , RETURN = {}; +var exports = module.exports = function(iterable, entries, fn, that, ITERATOR){ + var iterFn = ITERATOR ? function(){ return iterable; } : getIterFn(iterable) + , f = ctx(fn, that, entries ? 2 : 1) + , index = 0 + , length, step, iterator, result; + if(typeof iterFn != 'function')throw TypeError(iterable + ' is not iterable!'); + // fast case for arrays with default iterator + if(isArrayIter(iterFn))for(length = toLength(iterable.length); length > index; index++){ + result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]); + if(result === BREAK || result === RETURN)return result; + } else for(iterator = iterFn.call(iterable); !(step = iterator.next()).done; ){ + result = call(iterator, f, step.value, entries); + if(result === BREAK || result === RETURN)return result; + } +}; +exports.BREAK = BREAK; +exports.RETURN = RETURN; +},{"100":100,"103":103,"138":138,"145":145,"75":75,"83":83}],92:[function(_dereq_,module,exports){ +// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 +var global = module.exports = typeof window != 'undefined' && window.Math == Math + ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')(); +if(typeof __g == 'number')__g = global; // eslint-disable-line no-undef +},{}],93:[function(_dereq_,module,exports){ +var hasOwnProperty = {}.hasOwnProperty; +module.exports = function(it, key){ + return hasOwnProperty.call(it, key); +}; +},{}],94:[function(_dereq_,module,exports){ +var dP = _dereq_(115) + , createDesc = _dereq_(125); +module.exports = _dereq_(85) ? function(object, key, value){ + return dP.f(object, key, createDesc(1, value)); +} : function(object, key, value){ + object[key] = value; + return object; +}; +},{"115":115,"125":125,"85":85}],95:[function(_dereq_,module,exports){ +module.exports = _dereq_(92).document && document.documentElement; +},{"92":92}],96:[function(_dereq_,module,exports){ +module.exports = !_dereq_(85) && !_dereq_(90)(function(){ + return Object.defineProperty(_dereq_(86)('div'), 'a', {get: function(){ return 7; }}).a != 7; +}); +},{"85":85,"86":86,"90":90}],97:[function(_dereq_,module,exports){ +var isObject = _dereq_(102) + , setPrototypeOf = _dereq_(128).set; +module.exports = function(that, target, C){ + var P, S = target.constructor; + if(S !== C && typeof S == 'function' && (P = S.prototype) !== C.prototype && isObject(P) && setPrototypeOf){ + setPrototypeOf(that, P); + } return that; +}; +},{"102":102,"128":128}],98:[function(_dereq_,module,exports){ +// fast apply, http://jsperf.lnkit.com/fast-apply/5 +module.exports = function(fn, args, that){ + var un = that === undefined; + switch(args.length){ + case 0: return un ? fn() + : fn.call(that); + case 1: return un ? fn(args[0]) + : fn.call(that, args[0]); + case 2: return un ? fn(args[0], args[1]) + : fn.call(that, args[0], args[1]); + case 3: return un ? fn(args[0], args[1], args[2]) + : fn.call(that, args[0], args[1], args[2]); + case 4: return un ? fn(args[0], args[1], args[2], args[3]) + : fn.call(that, args[0], args[1], args[2], args[3]); + } return fn.apply(that, args); +}; +},{}],99:[function(_dereq_,module,exports){ +// fallback for non-array-like ES3 and non-enumerable old V8 strings +var cof = _dereq_(78); +module.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){ + return cof(it) == 'String' ? it.split('') : Object(it); +}; +},{"78":78}],100:[function(_dereq_,module,exports){ +// check on default Array iterator +var Iterators = _dereq_(108) + , ITERATOR = _dereq_(144)('iterator') + , ArrayProto = Array.prototype; + +module.exports = function(it){ + return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it); +}; +},{"108":108,"144":144}],101:[function(_dereq_,module,exports){ +// 7.2.2 IsArray(argument) +var cof = _dereq_(78); +module.exports = Array.isArray || function isArray(arg){ + return cof(arg) == 'Array'; +}; +},{"78":78}],102:[function(_dereq_,module,exports){ +module.exports = function(it){ + return typeof it === 'object' ? it !== null : typeof it === 'function'; +}; +},{}],103:[function(_dereq_,module,exports){ +// call something on iterator step with safe closing on error +var anObject = _dereq_(75); +module.exports = function(iterator, fn, value, entries){ + try { + return entries ? fn(anObject(value)[0], value[1]) : fn(value); + // 7.4.6 IteratorClose(iterator, completion) + } catch(e){ + var ret = iterator['return']; + if(ret !== undefined)anObject(ret.call(iterator)); + throw e; + } +}; +},{"75":75}],104:[function(_dereq_,module,exports){ +'use strict'; +var create = _dereq_(114) + , descriptor = _dereq_(125) + , setToStringTag = _dereq_(130) + , IteratorPrototype = {}; + +// 25.1.2.1.1 %IteratorPrototype%[@@iterator]() +_dereq_(94)(IteratorPrototype, _dereq_(144)('iterator'), function(){ return this; }); + +module.exports = function(Constructor, NAME, next){ + Constructor.prototype = create(IteratorPrototype, {next: descriptor(1, next)}); + setToStringTag(Constructor, NAME + ' Iterator'); +}; +},{"114":114,"125":125,"130":130,"144":144,"94":94}],105:[function(_dereq_,module,exports){ +'use strict'; +var LIBRARY = _dereq_(110) + , $export = _dereq_(89) + , redefine = _dereq_(127) + , hide = _dereq_(94) + , has = _dereq_(93) + , Iterators = _dereq_(108) + , $iterCreate = _dereq_(104) + , setToStringTag = _dereq_(130) + , getPrototypeOf = _dereq_(121) + , ITERATOR = _dereq_(144)('iterator') + , BUGGY = !([].keys && 'next' in [].keys()) // Safari has buggy iterators w/o `next` + , FF_ITERATOR = '@@iterator' + , KEYS = 'keys' + , VALUES = 'values'; + +var returnThis = function(){ return this; }; + +module.exports = function(Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED){ + $iterCreate(Constructor, NAME, next); + var getMethod = function(kind){ + if(!BUGGY && kind in proto)return proto[kind]; + switch(kind){ + case KEYS: return function keys(){ return new Constructor(this, kind); }; + case VALUES: return function values(){ return new Constructor(this, kind); }; + } return function entries(){ return new Constructor(this, kind); }; + }; + var TAG = NAME + ' Iterator' + , DEF_VALUES = DEFAULT == VALUES + , VALUES_BUG = false + , proto = Base.prototype + , $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT] + , $default = $native || getMethod(DEFAULT) + , $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined + , $anyNative = NAME == 'Array' ? proto.entries || $native : $native + , methods, key, IteratorPrototype; + // Fix native + if($anyNative){ + IteratorPrototype = getPrototypeOf($anyNative.call(new Base)); + if(IteratorPrototype !== Object.prototype){ + // Set @@toStringTag to native iterators + setToStringTag(IteratorPrototype, TAG, true); + // fix for some old engines + if(!LIBRARY && !has(IteratorPrototype, ITERATOR))hide(IteratorPrototype, ITERATOR, returnThis); + } + } + // fix Array#{values, @@iterator}.name in V8 / FF + if(DEF_VALUES && $native && $native.name !== VALUES){ + VALUES_BUG = true; + $default = function values(){ return $native.call(this); }; + } + // Define iterator + if((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])){ + hide(proto, ITERATOR, $default); + } + // Plug for library + Iterators[NAME] = $default; + Iterators[TAG] = returnThis; + if(DEFAULT){ + methods = { + values: DEF_VALUES ? $default : getMethod(VALUES), + keys: IS_SET ? $default : getMethod(KEYS), + entries: $entries + }; + if(FORCED)for(key in methods){ + if(!(key in proto))redefine(proto, key, methods[key]); + } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods); + } + return methods; +}; +},{"104":104,"108":108,"110":110,"121":121,"127":127,"130":130,"144":144,"89":89,"93":93,"94":94}],106:[function(_dereq_,module,exports){ +var ITERATOR = _dereq_(144)('iterator') + , SAFE_CLOSING = false; + +try { + var riter = [7][ITERATOR](); + riter['return'] = function(){ SAFE_CLOSING = true; }; + Array.from(riter, function(){ throw 2; }); +} catch(e){ /* empty */ } + +module.exports = function(exec, skipClosing){ + if(!skipClosing && !SAFE_CLOSING)return false; + var safe = false; + try { + var arr = [7] + , iter = arr[ITERATOR](); + iter.next = function(){ return {done: safe = true}; }; + arr[ITERATOR] = function(){ return iter; }; + exec(arr); + } catch(e){ /* empty */ } + return safe; +}; +},{"144":144}],107:[function(_dereq_,module,exports){ +module.exports = function(done, value){ + return {value: value, done: !!done}; +}; +},{}],108:[function(_dereq_,module,exports){ +module.exports = {}; +},{}],109:[function(_dereq_,module,exports){ +var getKeys = _dereq_(123) + , toIObject = _dereq_(137); +module.exports = function(object, el){ + var O = toIObject(object) + , keys = getKeys(O) + , length = keys.length + , index = 0 + , key; + while(length > index)if(O[key = keys[index++]] === el)return key; +}; +},{"123":123,"137":137}],110:[function(_dereq_,module,exports){ +module.exports = false; +},{}],111:[function(_dereq_,module,exports){ +var META = _dereq_(141)('meta') + , isObject = _dereq_(102) + , has = _dereq_(93) + , setDesc = _dereq_(115).f + , id = 0; +var isExtensible = Object.isExtensible || function(){ + return true; +}; +var FREEZE = !_dereq_(90)(function(){ + return isExtensible(Object.preventExtensions({})); +}); +var setMeta = function(it){ + setDesc(it, META, {value: { + i: 'O' + ++id, // object ID + w: {} // weak collections IDs + }}); +}; +var fastKey = function(it, create){ + // return primitive with prefix + if(!isObject(it))return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return 'F'; + // not necessary to add metadata + if(!create)return 'E'; + // add missing metadata + setMeta(it); + // return object ID + } return it[META].i; +}; +var getWeak = function(it, create){ + if(!has(it, META)){ + // can't set metadata to uncaught frozen object + if(!isExtensible(it))return true; + // not necessary to add metadata + if(!create)return false; + // add missing metadata + setMeta(it); + // return hash weak collections IDs + } return it[META].w; +}; +// add metadata on freeze-family methods calling +var onFreeze = function(it){ + if(FREEZE && meta.NEED && isExtensible(it) && !has(it, META))setMeta(it); + return it; +}; +var meta = module.exports = { + KEY: META, + NEED: false, + fastKey: fastKey, + getWeak: getWeak, + onFreeze: onFreeze +}; +},{"102":102,"115":115,"141":141,"90":90,"93":93}],112:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , macrotask = _dereq_(134).set + , Observer = global.MutationObserver || global.WebKitMutationObserver + , process = global.process + , Promise = global.Promise + , isNode = _dereq_(78)(process) == 'process'; + +module.exports = function(){ + var head, last, notify; + + var flush = function(){ + var parent, fn; + if(isNode && (parent = process.domain))parent.exit(); + while(head){ + fn = head.fn; + head = head.next; + try { + fn(); + } catch(e){ + if(head)notify(); + else last = undefined; + throw e; + } + } last = undefined; + if(parent)parent.enter(); + }; + + // Node.js + if(isNode){ + notify = function(){ + process.nextTick(flush); + }; + // browsers with MutationObserver + } else if(Observer){ + var toggle = true + , node = document.createTextNode(''); + new Observer(flush).observe(node, {characterData: true}); // eslint-disable-line no-new + notify = function(){ + node.data = toggle = !toggle; + }; + // environments with maybe non-completely correct, but existent Promise + } else if(Promise && Promise.resolve){ + var promise = Promise.resolve(); + notify = function(){ + promise.then(flush); + }; + // for other environments - macrotask based on: + // - setImmediate + // - MessageChannel + // - window.postMessag + // - onreadystatechange + // - setTimeout + } else { + notify = function(){ + // strange IE + webpack dev server bug - use .call(global) + macrotask.call(global, flush); + }; + } + + return function(fn){ + var task = {fn: fn, next: undefined}; + if(last)last.next = task; + if(!head){ + head = task; + notify(); + } last = task; + }; +}; +},{"134":134,"78":78,"92":92}],113:[function(_dereq_,module,exports){ +'use strict'; +// 19.1.2.1 Object.assign(target, source, ...) +var getKeys = _dereq_(123) + , gOPS = _dereq_(120) + , pIE = _dereq_(124) + , toObject = _dereq_(139) + , IObject = _dereq_(99) + , $assign = Object.assign; + +// should work with symbols and should have deterministic property order (V8 bug) +module.exports = !$assign || _dereq_(90)(function(){ + var A = {} + , B = {} + , S = Symbol() + , K = 'abcdefghijklmnopqrst'; + A[S] = 7; + K.split('').forEach(function(k){ B[k] = k; }); + return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K; +}) ? function assign(target, source){ // eslint-disable-line no-unused-vars + var T = toObject(target) + , aLen = arguments.length + , index = 1 + , getSymbols = gOPS.f + , isEnum = pIE.f; + while(aLen > index){ + var S = IObject(arguments[index++]) + , keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S) + , length = keys.length + , j = 0 + , key; + while(length > j)if(isEnum.call(S, key = keys[j++]))T[key] = S[key]; + } return T; +} : $assign; +},{"120":120,"123":123,"124":124,"139":139,"90":90,"99":99}],114:[function(_dereq_,module,exports){ +// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) +var anObject = _dereq_(75) + , dPs = _dereq_(116) + , enumBugKeys = _dereq_(87) + , IE_PROTO = _dereq_(131)('IE_PROTO') + , Empty = function(){ /* empty */ } + , PROTOTYPE = 'prototype'; + +// Create object with fake `null` prototype: use iframe Object with cleared prototype +var createDict = function(){ + // Thrash, waste and sodomy: IE GC bug + var iframe = _dereq_(86)('iframe') + , i = enumBugKeys.length + , lt = '<' + , gt = '>' + , iframeDocument; + iframe.style.display = 'none'; + _dereq_(95).appendChild(iframe); + iframe.src = 'javascript:'; // eslint-disable-line no-script-url + // createDict = iframe.contentWindow.Object; + // html.removeChild(iframe); + iframeDocument = iframe.contentWindow.document; + iframeDocument.open(); + iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt); + iframeDocument.close(); + createDict = iframeDocument.F; + while(i--)delete createDict[PROTOTYPE][enumBugKeys[i]]; + return createDict(); +}; + +module.exports = Object.create || function create(O, Properties){ + var result; + if(O !== null){ + Empty[PROTOTYPE] = anObject(O); + result = new Empty; + Empty[PROTOTYPE] = null; + // add "__proto__" for Object.getPrototypeOf polyfill + result[IE_PROTO] = O; + } else result = createDict(); + return Properties === undefined ? result : dPs(result, Properties); +}; + +},{"116":116,"131":131,"75":75,"86":86,"87":87,"95":95}],115:[function(_dereq_,module,exports){ +var anObject = _dereq_(75) + , IE8_DOM_DEFINE = _dereq_(96) + , toPrimitive = _dereq_(140) + , dP = Object.defineProperty; + +exports.f = _dereq_(85) ? Object.defineProperty : function defineProperty(O, P, Attributes){ + anObject(O); + P = toPrimitive(P, true); + anObject(Attributes); + if(IE8_DOM_DEFINE)try { + return dP(O, P, Attributes); + } catch(e){ /* empty */ } + if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!'); + if('value' in Attributes)O[P] = Attributes.value; + return O; +}; +},{"140":140,"75":75,"85":85,"96":96}],116:[function(_dereq_,module,exports){ +var dP = _dereq_(115) + , anObject = _dereq_(75) + , getKeys = _dereq_(123); + +module.exports = _dereq_(85) ? Object.defineProperties : function defineProperties(O, Properties){ + anObject(O); + var keys = getKeys(Properties) + , length = keys.length + , i = 0 + , P; + while(length > i)dP.f(O, P = keys[i++], Properties[P]); + return O; +}; +},{"115":115,"123":123,"75":75,"85":85}],117:[function(_dereq_,module,exports){ +var pIE = _dereq_(124) + , createDesc = _dereq_(125) + , toIObject = _dereq_(137) + , toPrimitive = _dereq_(140) + , has = _dereq_(93) + , IE8_DOM_DEFINE = _dereq_(96) + , gOPD = Object.getOwnPropertyDescriptor; + +exports.f = _dereq_(85) ? gOPD : function getOwnPropertyDescriptor(O, P){ + O = toIObject(O); + P = toPrimitive(P, true); + if(IE8_DOM_DEFINE)try { + return gOPD(O, P); + } catch(e){ /* empty */ } + if(has(O, P))return createDesc(!pIE.f.call(O, P), O[P]); +}; +},{"124":124,"125":125,"137":137,"140":140,"85":85,"93":93,"96":96}],118:[function(_dereq_,module,exports){ +// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window +var toIObject = _dereq_(137) + , gOPN = _dereq_(119).f + , toString = {}.toString; + +var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames + ? Object.getOwnPropertyNames(window) : []; + +var getWindowNames = function(it){ + try { + return gOPN(it); + } catch(e){ + return windowNames.slice(); + } +}; + +module.exports.f = function getOwnPropertyNames(it){ + return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it)); +}; + +},{"119":119,"137":137}],119:[function(_dereq_,module,exports){ +// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O) +var $keys = _dereq_(122) + , hiddenKeys = _dereq_(87).concat('length', 'prototype'); + +exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O){ + return $keys(O, hiddenKeys); +}; +},{"122":122,"87":87}],120:[function(_dereq_,module,exports){ +exports.f = Object.getOwnPropertySymbols; +},{}],121:[function(_dereq_,module,exports){ +// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) +var has = _dereq_(93) + , toObject = _dereq_(139) + , IE_PROTO = _dereq_(131)('IE_PROTO') + , ObjectProto = Object.prototype; + +module.exports = Object.getPrototypeOf || function(O){ + O = toObject(O); + if(has(O, IE_PROTO))return O[IE_PROTO]; + if(typeof O.constructor == 'function' && O instanceof O.constructor){ + return O.constructor.prototype; + } return O instanceof Object ? ObjectProto : null; +}; +},{"131":131,"139":139,"93":93}],122:[function(_dereq_,module,exports){ +var has = _dereq_(93) + , toIObject = _dereq_(137) + , arrayIndexOf = _dereq_(76)(false) + , IE_PROTO = _dereq_(131)('IE_PROTO'); + +module.exports = function(object, names){ + var O = toIObject(object) + , i = 0 + , result = [] + , key; + for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key); + // Don't enum bug & hidden keys + while(names.length > i)if(has(O, key = names[i++])){ + ~arrayIndexOf(result, key) || result.push(key); + } + return result; +}; +},{"131":131,"137":137,"76":76,"93":93}],123:[function(_dereq_,module,exports){ +// 19.1.2.14 / 15.2.3.14 Object.keys(O) +var $keys = _dereq_(122) + , enumBugKeys = _dereq_(87); + +module.exports = Object.keys || function keys(O){ + return $keys(O, enumBugKeys); +}; +},{"122":122,"87":87}],124:[function(_dereq_,module,exports){ +exports.f = {}.propertyIsEnumerable; +},{}],125:[function(_dereq_,module,exports){ +module.exports = function(bitmap, value){ + return { + enumerable : !(bitmap & 1), + configurable: !(bitmap & 2), + writable : !(bitmap & 4), + value : value + }; +}; +},{}],126:[function(_dereq_,module,exports){ +var redefine = _dereq_(127); +module.exports = function(target, src, safe){ + for(var key in src)redefine(target, key, src[key], safe); + return target; +}; +},{"127":127}],127:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , hide = _dereq_(94) + , has = _dereq_(93) + , SRC = _dereq_(141)('src') + , TO_STRING = 'toString' + , $toString = Function[TO_STRING] + , TPL = ('' + $toString).split(TO_STRING); + +_dereq_(81).inspectSource = function(it){ + return $toString.call(it); +}; + +(module.exports = function(O, key, val, safe){ + var isFunction = typeof val == 'function'; + if(isFunction)has(val, 'name') || hide(val, 'name', key); + if(O[key] === val)return; + if(isFunction)has(val, SRC) || hide(val, SRC, O[key] ? '' + O[key] : TPL.join(String(key))); + if(O === global){ + O[key] = val; + } else { + if(!safe){ + delete O[key]; + hide(O, key, val); + } else { + if(O[key])O[key] = val; + else hide(O, key, val); + } + } +// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative +})(Function.prototype, TO_STRING, function toString(){ + return typeof this == 'function' && this[SRC] || $toString.call(this); +}); +},{"141":141,"81":81,"92":92,"93":93,"94":94}],128:[function(_dereq_,module,exports){ +// Works with __proto__ only. Old v8 can't work with null proto objects. +/* eslint-disable no-proto */ +var isObject = _dereq_(102) + , anObject = _dereq_(75); +var check = function(O, proto){ + anObject(O); + if(!isObject(proto) && proto !== null)throw TypeError(proto + ": can't set as prototype!"); +}; +module.exports = { + set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line + function(test, buggy, set){ + try { + set = _dereq_(83)(Function.call, _dereq_(117).f(Object.prototype, '__proto__').set, 2); + set(test, []); + buggy = !(test instanceof Array); + } catch(e){ buggy = true; } + return function setPrototypeOf(O, proto){ + check(O, proto); + if(buggy)O.__proto__ = proto; + else set(O, proto); + return O; + }; + }({}, false) : undefined), + check: check +}; +},{"102":102,"117":117,"75":75,"83":83}],129:[function(_dereq_,module,exports){ +'use strict'; +var global = _dereq_(92) + , dP = _dereq_(115) + , DESCRIPTORS = _dereq_(85) + , SPECIES = _dereq_(144)('species'); + +module.exports = function(KEY){ + var C = global[KEY]; + if(DESCRIPTORS && C && !C[SPECIES])dP.f(C, SPECIES, { + configurable: true, + get: function(){ return this; } + }); +}; +},{"115":115,"144":144,"85":85,"92":92}],130:[function(_dereq_,module,exports){ +var def = _dereq_(115).f + , has = _dereq_(93) + , TAG = _dereq_(144)('toStringTag'); + +module.exports = function(it, tag, stat){ + if(it && !has(it = stat ? it : it.prototype, TAG))def(it, TAG, {configurable: true, value: tag}); +}; +},{"115":115,"144":144,"93":93}],131:[function(_dereq_,module,exports){ +var shared = _dereq_(132)('keys') + , uid = _dereq_(141); +module.exports = function(key){ + return shared[key] || (shared[key] = uid(key)); +}; +},{"132":132,"141":141}],132:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , SHARED = '__core-js_shared__' + , store = global[SHARED] || (global[SHARED] = {}); +module.exports = function(key){ + return store[key] || (store[key] = {}); +}; +},{"92":92}],133:[function(_dereq_,module,exports){ +// 7.3.20 SpeciesConstructor(O, defaultConstructor) +var anObject = _dereq_(75) + , aFunction = _dereq_(72) + , SPECIES = _dereq_(144)('species'); +module.exports = function(O, D){ + var C = anObject(O).constructor, S; + return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S); +}; +},{"144":144,"72":72,"75":75}],134:[function(_dereq_,module,exports){ +var ctx = _dereq_(83) + , invoke = _dereq_(98) + , html = _dereq_(95) + , cel = _dereq_(86) + , global = _dereq_(92) + , process = global.process + , setTask = global.setImmediate + , clearTask = global.clearImmediate + , MessageChannel = global.MessageChannel + , counter = 0 + , queue = {} + , ONREADYSTATECHANGE = 'onreadystatechange' + , defer, channel, port; +var run = function(){ + var id = +this; + if(queue.hasOwnProperty(id)){ + var fn = queue[id]; + delete queue[id]; + fn(); + } +}; +var listener = function(event){ + run.call(event.data); +}; +// Node.js 0.9+ & IE10+ has setImmediate, otherwise: +if(!setTask || !clearTask){ + setTask = function setImmediate(fn){ + var args = [], i = 1; + while(arguments.length > i)args.push(arguments[i++]); + queue[++counter] = function(){ + invoke(typeof fn == 'function' ? fn : Function(fn), args); + }; + defer(counter); + return counter; + }; + clearTask = function clearImmediate(id){ + delete queue[id]; + }; + // Node.js 0.8- + if(_dereq_(78)(process) == 'process'){ + defer = function(id){ + process.nextTick(ctx(run, id, 1)); + }; + // Browsers with MessageChannel, includes WebWorkers + } else if(MessageChannel){ + channel = new MessageChannel; + port = channel.port2; + channel.port1.onmessage = listener; + defer = ctx(port.postMessage, port, 1); + // Browsers with postMessage, skip WebWorkers + // IE8 has postMessage, but it's sync & typeof its postMessage is 'object' + } else if(global.addEventListener && typeof postMessage == 'function' && !global.importScripts){ + defer = function(id){ + global.postMessage(id + '', '*'); + }; + global.addEventListener('message', listener, false); + // IE8- + } else if(ONREADYSTATECHANGE in cel('script')){ + defer = function(id){ + html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function(){ + html.removeChild(this); + run.call(id); + }; + }; + // Rest old browsers + } else { + defer = function(id){ + setTimeout(ctx(run, id, 1), 0); + }; + } +} +module.exports = { + set: setTask, + clear: clearTask +}; +},{"78":78,"83":83,"86":86,"92":92,"95":95,"98":98}],135:[function(_dereq_,module,exports){ +var toInteger = _dereq_(136) + , max = Math.max + , min = Math.min; +module.exports = function(index, length){ + index = toInteger(index); + return index < 0 ? max(index + length, 0) : min(index, length); +}; +},{"136":136}],136:[function(_dereq_,module,exports){ +// 7.1.4 ToInteger +var ceil = Math.ceil + , floor = Math.floor; +module.exports = function(it){ + return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it); +}; +},{}],137:[function(_dereq_,module,exports){ +// to indexed object, toObject with fallback for non-array-like ES3 strings +var IObject = _dereq_(99) + , defined = _dereq_(84); +module.exports = function(it){ + return IObject(defined(it)); +}; +},{"84":84,"99":99}],138:[function(_dereq_,module,exports){ +// 7.1.15 ToLength +var toInteger = _dereq_(136) + , min = Math.min; +module.exports = function(it){ + return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991 +}; +},{"136":136}],139:[function(_dereq_,module,exports){ +// 7.1.13 ToObject(argument) +var defined = _dereq_(84); +module.exports = function(it){ + return Object(defined(it)); +}; +},{"84":84}],140:[function(_dereq_,module,exports){ +// 7.1.1 ToPrimitive(input [, PreferredType]) +var isObject = _dereq_(102); +// instead of the ES6 spec version, we didn't implement @@toPrimitive case +// and the second argument - flag - preferred type is a string +module.exports = function(it, S){ + if(!isObject(it))return it; + var fn, val; + if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val; + if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val; + throw TypeError("Can't convert object to primitive value"); +}; +},{"102":102}],141:[function(_dereq_,module,exports){ +var id = 0 + , px = Math.random(); +module.exports = function(key){ + return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36)); +}; +},{}],142:[function(_dereq_,module,exports){ +var global = _dereq_(92) + , core = _dereq_(81) + , LIBRARY = _dereq_(110) + , wksExt = _dereq_(143) + , defineProperty = _dereq_(115).f; +module.exports = function(name){ + var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {}); + if(name.charAt(0) != '_' && !(name in $Symbol))defineProperty($Symbol, name, {value: wksExt.f(name)}); +}; +},{"110":110,"115":115,"143":143,"81":81,"92":92}],143:[function(_dereq_,module,exports){ +exports.f = _dereq_(144); +},{"144":144}],144:[function(_dereq_,module,exports){ +var store = _dereq_(132)('wks') + , uid = _dereq_(141) + , Symbol = _dereq_(92).Symbol + , USE_SYMBOL = typeof Symbol == 'function'; + +var $exports = module.exports = function(name){ + return store[name] || (store[name] = + USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name)); +}; + +$exports.store = store; +},{"132":132,"141":141,"92":92}],145:[function(_dereq_,module,exports){ +var classof = _dereq_(77) + , ITERATOR = _dereq_(144)('iterator') + , Iterators = _dereq_(108); +module.exports = _dereq_(81).getIteratorMethod = function(it){ + if(it != undefined)return it[ITERATOR] + || it['@@iterator'] + || Iterators[classof(it)]; +}; +},{"108":108,"144":144,"77":77,"81":81}],146:[function(_dereq_,module,exports){ +'use strict'; +var ctx = _dereq_(83) + , $export = _dereq_(89) + , toObject = _dereq_(139) + , call = _dereq_(103) + , isArrayIter = _dereq_(100) + , toLength = _dereq_(138) + , createProperty = _dereq_(82) + , getIterFn = _dereq_(145); + +$export($export.S + $export.F * !_dereq_(106)(function(iter){ Array.from(iter); }), 'Array', { + // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined) + from: function from(arrayLike/*, mapfn = undefined, thisArg = undefined*/){ + var O = toObject(arrayLike) + , C = typeof this == 'function' ? this : Array + , aLen = arguments.length + , mapfn = aLen > 1 ? arguments[1] : undefined + , mapping = mapfn !== undefined + , index = 0 + , iterFn = getIterFn(O) + , length, result, step, iterator; + if(mapping)mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2); + // if object isn't iterable or it's array with default iterator - use simple case + if(iterFn != undefined && !(C == Array && isArrayIter(iterFn))){ + for(iterator = iterFn.call(O), result = new C; !(step = iterator.next()).done; index++){ + createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value); + } + } else { + length = toLength(O.length); + for(result = new C(length); length > index; index++){ + createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]); + } + } + result.length = index; + return result; + } +}); + +},{"100":100,"103":103,"106":106,"138":138,"139":139,"145":145,"82":82,"83":83,"89":89}],147:[function(_dereq_,module,exports){ +'use strict'; +var addToUnscopables = _dereq_(73) + , step = _dereq_(107) + , Iterators = _dereq_(108) + , toIObject = _dereq_(137); + +// 22.1.3.4 Array.prototype.entries() +// 22.1.3.13 Array.prototype.keys() +// 22.1.3.29 Array.prototype.values() +// 22.1.3.30 Array.prototype[@@iterator]() +module.exports = _dereq_(105)(Array, 'Array', function(iterated, kind){ + this._t = toIObject(iterated); // target + this._i = 0; // next index + this._k = kind; // kind +// 22.1.5.2.1 %ArrayIteratorPrototype%.next() +}, function(){ + var O = this._t + , kind = this._k + , index = this._i++; + if(!O || index >= O.length){ + this._t = undefined; + return step(1); + } + if(kind == 'keys' )return step(0, index); + if(kind == 'values')return step(0, O[index]); + return step(0, [index, O[index]]); +}, 'values'); + +// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7) +Iterators.Arguments = Iterators.Array; + +addToUnscopables('keys'); +addToUnscopables('values'); +addToUnscopables('entries'); +},{"105":105,"107":107,"108":108,"137":137,"73":73}],148:[function(_dereq_,module,exports){ +'use strict'; +var strong = _dereq_(79); + +// 23.1 Map Objects +module.exports = _dereq_(80)('Map', function(get){ + return function Map(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.1.3.6 Map.prototype.get(key) + get: function get(key){ + var entry = strong.getEntry(this, key); + return entry && entry.v; + }, + // 23.1.3.9 Map.prototype.set(key, value) + set: function set(key, value){ + return strong.def(this, key === 0 ? 0 : key, value); + } +}, strong, true); +},{"79":79,"80":80}],149:[function(_dereq_,module,exports){ +// 19.1.3.1 Object.assign(target, source) +var $export = _dereq_(89); + +$export($export.S + $export.F, 'Object', {assign: _dereq_(113)}); +},{"113":113,"89":89}],150:[function(_dereq_,module,exports){ +// 19.1.3.19 Object.setPrototypeOf(O, proto) +var $export = _dereq_(89); +$export($export.S, 'Object', {setPrototypeOf: _dereq_(128).set}); +},{"128":128,"89":89}],151:[function(_dereq_,module,exports){ +'use strict'; +var LIBRARY = _dereq_(110) + , global = _dereq_(92) + , ctx = _dereq_(83) + , classof = _dereq_(77) + , $export = _dereq_(89) + , isObject = _dereq_(102) + , aFunction = _dereq_(72) + , anInstance = _dereq_(74) + , forOf = _dereq_(91) + , speciesConstructor = _dereq_(133) + , task = _dereq_(134).set + , microtask = _dereq_(112)() + , PROMISE = 'Promise' + , TypeError = global.TypeError + , process = global.process + , $Promise = global[PROMISE] + , process = global.process + , isNode = classof(process) == 'process' + , empty = function(){ /* empty */ } + , Internal, GenericPromiseCapability, Wrapper; + +var USE_NATIVE = !!function(){ + try { + // correct subclassing with @@species support + var promise = $Promise.resolve(1) + , FakePromise = (promise.constructor = {})[_dereq_(144)('species')] = function(exec){ exec(empty, empty); }; + // unhandled rejections tracking support, NodeJS Promise without it fails @@species test + return (isNode || typeof PromiseRejectionEvent == 'function') && promise.then(empty) instanceof FakePromise; + } catch(e){ /* empty */ } +}(); + +// helpers +var sameConstructor = function(a, b){ + // with library wrapper special case + return a === b || a === $Promise && b === Wrapper; +}; +var isThenable = function(it){ + var then; + return isObject(it) && typeof (then = it.then) == 'function' ? then : false; +}; +var newPromiseCapability = function(C){ + return sameConstructor($Promise, C) + ? new PromiseCapability(C) + : new GenericPromiseCapability(C); +}; +var PromiseCapability = GenericPromiseCapability = function(C){ + var resolve, reject; + this.promise = new C(function($$resolve, $$reject){ + if(resolve !== undefined || reject !== undefined)throw TypeError('Bad Promise constructor'); + resolve = $$resolve; + reject = $$reject; + }); + this.resolve = aFunction(resolve); + this.reject = aFunction(reject); +}; +var perform = function(exec){ + try { + exec(); + } catch(e){ + return {error: e}; + } +}; +var notify = function(promise, isReject){ + if(promise._n)return; + promise._n = true; + var chain = promise._c; + microtask(function(){ + var value = promise._v + , ok = promise._s == 1 + , i = 0; + var run = function(reaction){ + var handler = ok ? reaction.ok : reaction.fail + , resolve = reaction.resolve + , reject = reaction.reject + , domain = reaction.domain + , result, then; + try { + if(handler){ + if(!ok){ + if(promise._h == 2)onHandleUnhandled(promise); + promise._h = 1; + } + if(handler === true)result = value; + else { + if(domain)domain.enter(); + result = handler(value); + if(domain)domain.exit(); + } + if(result === reaction.promise){ + reject(TypeError('Promise-chain cycle')); + } else if(then = isThenable(result)){ + then.call(result, resolve, reject); + } else resolve(result); + } else reject(value); + } catch(e){ + reject(e); + } + }; + while(chain.length > i)run(chain[i++]); // variable length - can't use forEach + promise._c = []; + promise._n = false; + if(isReject && !promise._h)onUnhandled(promise); + }); +}; +var onUnhandled = function(promise){ + task.call(global, function(){ + var value = promise._v + , abrupt, handler, console; + if(isUnhandled(promise)){ + abrupt = perform(function(){ + if(isNode){ + process.emit('unhandledRejection', value, promise); + } else if(handler = global.onunhandledrejection){ + handler({promise: promise, reason: value}); + } else if((console = global.console) && console.error){ + console.error('Unhandled promise rejection', value); + } + }); + // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should + promise._h = isNode || isUnhandled(promise) ? 2 : 1; + } promise._a = undefined; + if(abrupt)throw abrupt.error; + }); +}; +var isUnhandled = function(promise){ + if(promise._h == 1)return false; + var chain = promise._a || promise._c + , i = 0 + , reaction; + while(chain.length > i){ + reaction = chain[i++]; + if(reaction.fail || !isUnhandled(reaction.promise))return false; + } return true; +}; +var onHandleUnhandled = function(promise){ + task.call(global, function(){ + var handler; + if(isNode){ + process.emit('rejectionHandled', promise); + } else if(handler = global.onrejectionhandled){ + handler({promise: promise, reason: promise._v}); + } + }); +}; +var $reject = function(value){ + var promise = this; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + promise._v = value; + promise._s = 2; + if(!promise._a)promise._a = promise._c.slice(); + notify(promise, true); +}; +var $resolve = function(value){ + var promise = this + , then; + if(promise._d)return; + promise._d = true; + promise = promise._w || promise; // unwrap + try { + if(promise === value)throw TypeError("Promise can't be resolved itself"); + if(then = isThenable(value)){ + microtask(function(){ + var wrapper = {_w: promise, _d: false}; // wrap + try { + then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1)); + } catch(e){ + $reject.call(wrapper, e); + } + }); + } else { + promise._v = value; + promise._s = 1; + notify(promise, false); + } + } catch(e){ + $reject.call({_w: promise, _d: false}, e); // wrap + } +}; + +// constructor polyfill +if(!USE_NATIVE){ + // 25.4.3.1 Promise(executor) + $Promise = function Promise(executor){ + anInstance(this, $Promise, PROMISE, '_h'); + aFunction(executor); + Internal.call(this); + try { + executor(ctx($resolve, this, 1), ctx($reject, this, 1)); + } catch(err){ + $reject.call(this, err); + } + }; + Internal = function Promise(executor){ + this._c = []; // <- awaiting reactions + this._a = undefined; // <- checked in isUnhandled reactions + this._s = 0; // <- state + this._d = false; // <- done + this._v = undefined; // <- value + this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled + this._n = false; // <- notify + }; + Internal.prototype = _dereq_(126)($Promise.prototype, { + // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) + then: function then(onFulfilled, onRejected){ + var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); + reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true; + reaction.fail = typeof onRejected == 'function' && onRejected; + reaction.domain = isNode ? process.domain : undefined; + this._c.push(reaction); + if(this._a)this._a.push(reaction); + if(this._s)notify(this, false); + return reaction.promise; + }, + // 25.4.5.1 Promise.prototype.catch(onRejected) + 'catch': function(onRejected){ + return this.then(undefined, onRejected); + } + }); + PromiseCapability = function(){ + var promise = new Internal; + this.promise = promise; + this.resolve = ctx($resolve, promise, 1); + this.reject = ctx($reject, promise, 1); + }; +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Promise: $Promise}); +_dereq_(130)($Promise, PROMISE); +_dereq_(129)(PROMISE); +Wrapper = _dereq_(81)[PROMISE]; + +// statics +$export($export.S + $export.F * !USE_NATIVE, PROMISE, { + // 25.4.4.5 Promise.reject(r) + reject: function reject(r){ + var capability = newPromiseCapability(this) + , $$reject = capability.reject; + $$reject(r); + return capability.promise; + } +}); +$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { + // 25.4.4.6 Promise.resolve(x) + resolve: function resolve(x){ + // instanceof instead of internal slot check because we should fix it without replacement native Promise core + if(x instanceof $Promise && sameConstructor(x.constructor, this))return x; + var capability = newPromiseCapability(this) + , $$resolve = capability.resolve; + $$resolve(x); + return capability.promise; + } +}); +$export($export.S + $export.F * !(USE_NATIVE && _dereq_(106)(function(iter){ + $Promise.all(iter)['catch'](empty); +})), PROMISE, { + // 25.4.4.1 Promise.all(iterable) + all: function all(iterable){ + var C = this + , capability = newPromiseCapability(C) + , resolve = capability.resolve + , reject = capability.reject; + var abrupt = perform(function(){ + var values = [] + , index = 0 + , remaining = 1; + forOf(iterable, false, function(promise){ + var $index = index++ + , alreadyCalled = false; + values.push(undefined); + remaining++; + C.resolve(promise).then(function(value){ + if(alreadyCalled)return; + alreadyCalled = true; + values[$index] = value; + --remaining || resolve(values); + }, reject); + }); + --remaining || resolve(values); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + }, + // 25.4.4.4 Promise.race(iterable) + race: function race(iterable){ + var C = this + , capability = newPromiseCapability(C) + , reject = capability.reject; + var abrupt = perform(function(){ + forOf(iterable, false, function(promise){ + C.resolve(promise).then(capability.resolve, reject); + }); + }); + if(abrupt)reject(abrupt.error); + return capability.promise; + } +}); +},{"102":102,"106":106,"110":110,"112":112,"126":126,"129":129,"130":130,"133":133,"134":134,"144":144,"72":72,"74":74,"77":77,"81":81,"83":83,"89":89,"91":91,"92":92}],152:[function(_dereq_,module,exports){ +'use strict'; +var strong = _dereq_(79); + +// 23.2 Set Objects +module.exports = _dereq_(80)('Set', function(get){ + return function Set(){ return get(this, arguments.length > 0 ? arguments[0] : undefined); }; +}, { + // 23.2.3.1 Set.prototype.add(value) + add: function add(value){ + return strong.def(this, value = value === 0 ? 0 : value, value); + } +}, strong); +},{"79":79,"80":80}],153:[function(_dereq_,module,exports){ +'use strict'; +// ECMAScript 6 symbols shim +var global = _dereq_(92) + , has = _dereq_(93) + , DESCRIPTORS = _dereq_(85) + , $export = _dereq_(89) + , redefine = _dereq_(127) + , META = _dereq_(111).KEY + , $fails = _dereq_(90) + , shared = _dereq_(132) + , setToStringTag = _dereq_(130) + , uid = _dereq_(141) + , wks = _dereq_(144) + , wksExt = _dereq_(143) + , wksDefine = _dereq_(142) + , keyOf = _dereq_(109) + , enumKeys = _dereq_(88) + , isArray = _dereq_(101) + , anObject = _dereq_(75) + , toIObject = _dereq_(137) + , toPrimitive = _dereq_(140) + , createDesc = _dereq_(125) + , _create = _dereq_(114) + , gOPNExt = _dereq_(118) + , $GOPD = _dereq_(117) + , $DP = _dereq_(115) + , $keys = _dereq_(123) + , gOPD = $GOPD.f + , dP = $DP.f + , gOPN = gOPNExt.f + , $Symbol = global.Symbol + , $JSON = global.JSON + , _stringify = $JSON && $JSON.stringify + , PROTOTYPE = 'prototype' + , HIDDEN = wks('_hidden') + , TO_PRIMITIVE = wks('toPrimitive') + , isEnum = {}.propertyIsEnumerable + , SymbolRegistry = shared('symbol-registry') + , AllSymbols = shared('symbols') + , OPSymbols = shared('op-symbols') + , ObjectProto = Object[PROTOTYPE] + , USE_NATIVE = typeof $Symbol == 'function' + , QObject = global.QObject; +// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173 +var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; + +// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687 +var setSymbolDesc = DESCRIPTORS && $fails(function(){ + return _create(dP({}, 'a', { + get: function(){ return dP(this, 'a', {value: 7}).a; } + })).a != 7; +}) ? function(it, key, D){ + var protoDesc = gOPD(ObjectProto, key); + if(protoDesc)delete ObjectProto[key]; + dP(it, key, D); + if(protoDesc && it !== ObjectProto)dP(ObjectProto, key, protoDesc); +} : dP; + +var wrap = function(tag){ + var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]); + sym._k = tag; + return sym; +}; + +var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function(it){ + return typeof it == 'symbol'; +} : function(it){ + return it instanceof $Symbol; +}; + +var $defineProperty = function defineProperty(it, key, D){ + if(it === ObjectProto)$defineProperty(OPSymbols, key, D); + anObject(it); + key = toPrimitive(key, true); + anObject(D); + if(has(AllSymbols, key)){ + if(!D.enumerable){ + if(!has(it, HIDDEN))dP(it, HIDDEN, createDesc(1, {})); + it[HIDDEN][key] = true; + } else { + if(has(it, HIDDEN) && it[HIDDEN][key])it[HIDDEN][key] = false; + D = _create(D, {enumerable: createDesc(0, false)}); + } return setSymbolDesc(it, key, D); + } return dP(it, key, D); +}; +var $defineProperties = function defineProperties(it, P){ + anObject(it); + var keys = enumKeys(P = toIObject(P)) + , i = 0 + , l = keys.length + , key; + while(l > i)$defineProperty(it, key = keys[i++], P[key]); + return it; +}; +var $create = function create(it, P){ + return P === undefined ? _create(it) : $defineProperties(_create(it), P); +}; +var $propertyIsEnumerable = function propertyIsEnumerable(key){ + var E = isEnum.call(this, key = toPrimitive(key, true)); + if(this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return false; + return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true; +}; +var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key){ + it = toIObject(it); + key = toPrimitive(key, true); + if(it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key))return; + var D = gOPD(it, key); + if(D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key]))D.enumerable = true; + return D; +}; +var $getOwnPropertyNames = function getOwnPropertyNames(it){ + var names = gOPN(toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META)result.push(key); + } return result; +}; +var $getOwnPropertySymbols = function getOwnPropertySymbols(it){ + var IS_OP = it === ObjectProto + , names = gOPN(IS_OP ? OPSymbols : toIObject(it)) + , result = [] + , i = 0 + , key; + while(names.length > i){ + if(has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true))result.push(AllSymbols[key]); + } return result; +}; + +// 19.4.1.1 Symbol([description]) +if(!USE_NATIVE){ + $Symbol = function Symbol(){ + if(this instanceof $Symbol)throw TypeError('Symbol is not a constructor!'); + var tag = uid(arguments.length > 0 ? arguments[0] : undefined); + var $set = function(value){ + if(this === ObjectProto)$set.call(OPSymbols, value); + if(has(this, HIDDEN) && has(this[HIDDEN], tag))this[HIDDEN][tag] = false; + setSymbolDesc(this, tag, createDesc(1, value)); + }; + if(DESCRIPTORS && setter)setSymbolDesc(ObjectProto, tag, {configurable: true, set: $set}); + return wrap(tag); + }; + redefine($Symbol[PROTOTYPE], 'toString', function toString(){ + return this._k; + }); + + $GOPD.f = $getOwnPropertyDescriptor; + $DP.f = $defineProperty; + _dereq_(119).f = gOPNExt.f = $getOwnPropertyNames; + _dereq_(124).f = $propertyIsEnumerable; + _dereq_(120).f = $getOwnPropertySymbols; + + if(DESCRIPTORS && !_dereq_(110)){ + redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true); + } + + wksExt.f = function(name){ + return wrap(wks(name)); + } +} + +$export($export.G + $export.W + $export.F * !USE_NATIVE, {Symbol: $Symbol}); + +for(var symbols = ( + // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14 + 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables' +).split(','), i = 0; symbols.length > i; )wks(symbols[i++]); + +for(var symbols = $keys(wks.store), i = 0; symbols.length > i; )wksDefine(symbols[i++]); + +$export($export.S + $export.F * !USE_NATIVE, 'Symbol', { + // 19.4.2.1 Symbol.for(key) + 'for': function(key){ + return has(SymbolRegistry, key += '') + ? SymbolRegistry[key] + : SymbolRegistry[key] = $Symbol(key); + }, + // 19.4.2.5 Symbol.keyFor(sym) + keyFor: function keyFor(key){ + if(isSymbol(key))return keyOf(SymbolRegistry, key); + throw TypeError(key + ' is not a symbol!'); + }, + useSetter: function(){ setter = true; }, + useSimple: function(){ setter = false; } +}); + +$export($export.S + $export.F * !USE_NATIVE, 'Object', { + // 19.1.2.2 Object.create(O [, Properties]) + create: $create, + // 19.1.2.4 Object.defineProperty(O, P, Attributes) + defineProperty: $defineProperty, + // 19.1.2.3 Object.defineProperties(O, Properties) + defineProperties: $defineProperties, + // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P) + getOwnPropertyDescriptor: $getOwnPropertyDescriptor, + // 19.1.2.7 Object.getOwnPropertyNames(O) + getOwnPropertyNames: $getOwnPropertyNames, + // 19.1.2.8 Object.getOwnPropertySymbols(O) + getOwnPropertySymbols: $getOwnPropertySymbols +}); + +// 24.3.2 JSON.stringify(value [, replacer [, space]]) +$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function(){ + var S = $Symbol(); + // MS Edge converts symbol values to JSON as {} + // WebKit converts symbol values to JSON as null + // V8 throws on boxed symbols + return _stringify([S]) != '[null]' || _stringify({a: S}) != '{}' || _stringify(Object(S)) != '{}'; +})), 'JSON', { + stringify: function stringify(it){ + if(it === undefined || isSymbol(it))return; // IE8 returns string on undefined + var args = [it] + , i = 1 + , replacer, $replacer; + while(arguments.length > i)args.push(arguments[i++]); + replacer = args[1]; + if(typeof replacer == 'function')$replacer = replacer; + if($replacer || !isArray(replacer))replacer = function(key, value){ + if($replacer)value = $replacer.call(this, key, value); + if(!isSymbol(value))return value; + }; + args[1] = replacer; + return _stringify.apply($JSON, args); + } +}); + +// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint) +$Symbol[PROTOTYPE][TO_PRIMITIVE] || _dereq_(94)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf); +// 19.4.3.5 Symbol.prototype[@@toStringTag] +setToStringTag($Symbol, 'Symbol'); +// 20.2.1.9 Math[@@toStringTag] +setToStringTag(Math, 'Math', true); +// 24.3.3 JSON[@@toStringTag] +setToStringTag(global.JSON, 'JSON', true); +},{"101":101,"109":109,"110":110,"111":111,"114":114,"115":115,"117":117,"118":118,"119":119,"120":120,"123":123,"124":124,"125":125,"127":127,"130":130,"132":132,"137":137,"140":140,"141":141,"142":142,"143":143,"144":144,"75":75,"85":85,"88":88,"89":89,"90":90,"92":92,"93":93,"94":94}],154:[function(_dereq_,module,exports){ +;(function (root, factory) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(); + } + else if (typeof define === "function" && define.amd) { + // AMD + define([], factory); + } + else { + // Global (browser) + root.CryptoJS = factory(); + } +}(this, function () { + + /** + * CryptoJS core components. + */ + var CryptoJS = CryptoJS || (function (Math, undefined) { + /* + * Local polyfil of Object.create + */ + var create = Object.create || (function () { + function F() {}; + + return function (obj) { + var subtype; + + F.prototype = obj; + + subtype = new F(); + + F.prototype = null; + + return subtype; + }; + }()) + + /** + * CryptoJS namespace. + */ + var C = {}; + + /** + * Library namespace. + */ + var C_lib = C.lib = {}; + + /** + * Base object for prototypal inheritance. + */ + var Base = C_lib.Base = (function () { + + + return { + /** + * Creates a new object that inherits from this object. + * + * @param {Object} overrides Properties to copy into the new object. + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * field: 'value', + * + * method: function () { + * } + * }); + */ + extend: function (overrides) { + // Spawn + var subtype = create(this); + + // Augment + if (overrides) { + subtype.mixIn(overrides); + } + + // Create default initializer + if (!subtype.hasOwnProperty('init') || this.init === subtype.init) { + subtype.init = function () { + subtype.$super.init.apply(this, arguments); + }; + } + + // Initializer's prototype is the subtype object + subtype.init.prototype = subtype; + + // Reference supertype + subtype.$super = this; + + return subtype; + }, + + /** + * Extends this object and runs the init method. + * Arguments to create() will be passed to init(). + * + * @return {Object} The new object. + * + * @static + * + * @example + * + * var instance = MyType.create(); + */ + create: function () { + var instance = this.extend(); + instance.init.apply(instance, arguments); + + return instance; + }, + + /** + * Initializes a newly created object. + * Override this method to add some logic when your objects are created. + * + * @example + * + * var MyType = CryptoJS.lib.Base.extend({ + * init: function () { + * // ... + * } + * }); + */ + init: function () { + }, + + /** + * Copies properties into this object. + * + * @param {Object} properties The properties to mix in. + * + * @example + * + * MyType.mixIn({ + * field: 'value' + * }); + */ + mixIn: function (properties) { + for (var propertyName in properties) { + if (properties.hasOwnProperty(propertyName)) { + this[propertyName] = properties[propertyName]; + } + } + + // IE won't copy toString using the loop above + if (properties.hasOwnProperty('toString')) { + this.toString = properties.toString; + } + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = instance.clone(); + */ + clone: function () { + return this.init.prototype.extend(this); + } + }; + }()); + + /** + * An array of 32-bit words. + * + * @property {Array} words The array of 32-bit words. + * @property {number} sigBytes The number of significant bytes in this word array. + */ + var WordArray = C_lib.WordArray = Base.extend({ + /** + * Initializes a newly created word array. + * + * @param {Array} words (Optional) An array of 32-bit words. + * @param {number} sigBytes (Optional) The number of significant bytes in the words. + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.create(); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]); + * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6); + */ + init: function (words, sigBytes) { + words = this.words = words || []; + + if (sigBytes != undefined) { + this.sigBytes = sigBytes; + } else { + this.sigBytes = words.length * 4; + } + }, + + /** + * Converts this word array to a string. + * + * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex + * + * @return {string} The stringified word array. + * + * @example + * + * var string = wordArray + ''; + * var string = wordArray.toString(); + * var string = wordArray.toString(CryptoJS.enc.Utf8); + */ + toString: function (encoder) { + return (encoder || Hex).stringify(this); + }, + + /** + * Concatenates a word array to this word array. + * + * @param {WordArray} wordArray The word array to append. + * + * @return {WordArray} This word array. + * + * @example + * + * wordArray1.concat(wordArray2); + */ + concat: function (wordArray) { + // Shortcuts + var thisWords = this.words; + var thatWords = wordArray.words; + var thisSigBytes = this.sigBytes; + var thatSigBytes = wordArray.sigBytes; + + // Clamp excess bits + this.clamp(); + + // Concat + if (thisSigBytes % 4) { + // Copy one byte at a time + for (var i = 0; i < thatSigBytes; i++) { + var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8); + } + } else { + // Copy one word at a time + for (var i = 0; i < thatSigBytes; i += 4) { + thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2]; + } + } + this.sigBytes += thatSigBytes; + + // Chainable + return this; + }, + + /** + * Removes insignificant bits. + * + * @example + * + * wordArray.clamp(); + */ + clamp: function () { + // Shortcuts + var words = this.words; + var sigBytes = this.sigBytes; + + // Clamp + words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8); + words.length = Math.ceil(sigBytes / 4); + }, + + /** + * Creates a copy of this word array. + * + * @return {WordArray} The clone. + * + * @example + * + * var clone = wordArray.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone.words = this.words.slice(0); + + return clone; + }, + + /** + * Creates a word array filled with random bytes. + * + * @param {number} nBytes The number of random bytes to generate. + * + * @return {WordArray} The random word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.lib.WordArray.random(16); + */ + random: function (nBytes) { + var words = []; + + var r = (function (m_w) { + var m_w = m_w; + var m_z = 0x3ade68b1; + var mask = 0xffffffff; + + return function () { + m_z = (0x9069 * (m_z & 0xFFFF) + (m_z >> 0x10)) & mask; + m_w = (0x4650 * (m_w & 0xFFFF) + (m_w >> 0x10)) & mask; + var result = ((m_z << 0x10) + m_w) & mask; + result /= 0x100000000; + result += 0.5; + return result * (Math.random() > .5 ? 1 : -1); + } + }); + + for (var i = 0, rcache; i < nBytes; i += 4) { + var _r = r((rcache || Math.random()) * 0x100000000); + + rcache = _r() * 0x3ade67b7; + words.push((_r() * 0x100000000) | 0); + } + + return new WordArray.init(words, nBytes); + } + }); + + /** + * Encoder namespace. + */ + var C_enc = C.enc = {}; + + /** + * Hex encoding strategy. + */ + var Hex = C_enc.Hex = { + /** + * Converts a word array to a hex string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The hex string. + * + * @static + * + * @example + * + * var hexString = CryptoJS.enc.Hex.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var hexChars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + hexChars.push((bite >>> 4).toString(16)); + hexChars.push((bite & 0x0f).toString(16)); + } + + return hexChars.join(''); + }, + + /** + * Converts a hex string to a word array. + * + * @param {string} hexStr The hex string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Hex.parse(hexString); + */ + parse: function (hexStr) { + // Shortcut + var hexStrLength = hexStr.length; + + // Convert + var words = []; + for (var i = 0; i < hexStrLength; i += 2) { + words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4); + } + + return new WordArray.init(words, hexStrLength / 2); + } + }; + + /** + * Latin1 encoding strategy. + */ + var Latin1 = C_enc.Latin1 = { + /** + * Converts a word array to a Latin1 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The Latin1 string. + * + * @static + * + * @example + * + * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray); + */ + stringify: function (wordArray) { + // Shortcuts + var words = wordArray.words; + var sigBytes = wordArray.sigBytes; + + // Convert + var latin1Chars = []; + for (var i = 0; i < sigBytes; i++) { + var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff; + latin1Chars.push(String.fromCharCode(bite)); + } + + return latin1Chars.join(''); + }, + + /** + * Converts a Latin1 string to a word array. + * + * @param {string} latin1Str The Latin1 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Latin1.parse(latin1String); + */ + parse: function (latin1Str) { + // Shortcut + var latin1StrLength = latin1Str.length; + + // Convert + var words = []; + for (var i = 0; i < latin1StrLength; i++) { + words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8); + } + + return new WordArray.init(words, latin1StrLength); + } + }; + + /** + * UTF-8 encoding strategy. + */ + var Utf8 = C_enc.Utf8 = { + /** + * Converts a word array to a UTF-8 string. + * + * @param {WordArray} wordArray The word array. + * + * @return {string} The UTF-8 string. + * + * @static + * + * @example + * + * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray); + */ + stringify: function (wordArray) { + try { + return decodeURIComponent(escape(Latin1.stringify(wordArray))); + } catch (e) { + throw new Error('Malformed UTF-8 data'); + } + }, + + /** + * Converts a UTF-8 string to a word array. + * + * @param {string} utf8Str The UTF-8 string. + * + * @return {WordArray} The word array. + * + * @static + * + * @example + * + * var wordArray = CryptoJS.enc.Utf8.parse(utf8String); + */ + parse: function (utf8Str) { + return Latin1.parse(unescape(encodeURIComponent(utf8Str))); + } + }; + + /** + * Abstract buffered block algorithm template. + * + * The property blockSize must be implemented in a concrete subtype. + * + * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0 + */ + var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({ + /** + * Resets this block algorithm's data buffer to its initial state. + * + * @example + * + * bufferedBlockAlgorithm.reset(); + */ + reset: function () { + // Initial values + this._data = new WordArray.init(); + this._nDataBytes = 0; + }, + + /** + * Adds new data to this block algorithm's buffer. + * + * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8. + * + * @example + * + * bufferedBlockAlgorithm._append('data'); + * bufferedBlockAlgorithm._append(wordArray); + */ + _append: function (data) { + // Convert string to WordArray, else assume WordArray already + if (typeof data == 'string') { + data = Utf8.parse(data); + } + + // Append + this._data.concat(data); + this._nDataBytes += data.sigBytes; + }, + + /** + * Processes available data blocks. + * + * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype. + * + * @param {boolean} doFlush Whether all blocks and partial blocks should be processed. + * + * @return {WordArray} The processed data. + * + * @example + * + * var processedData = bufferedBlockAlgorithm._process(); + * var processedData = bufferedBlockAlgorithm._process(!!'flush'); + */ + _process: function (doFlush) { + // Shortcuts + var data = this._data; + var dataWords = data.words; + var dataSigBytes = data.sigBytes; + var blockSize = this.blockSize; + var blockSizeBytes = blockSize * 4; + + // Count blocks ready + var nBlocksReady = dataSigBytes / blockSizeBytes; + if (doFlush) { + // Round up to include partial blocks + nBlocksReady = Math.ceil(nBlocksReady); + } else { + // Round down to include only full blocks, + // less the number of blocks that must remain in the buffer + nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0); + } + + // Count words ready + var nWordsReady = nBlocksReady * blockSize; + + // Count bytes ready + var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes); + + // Process blocks + if (nWordsReady) { + for (var offset = 0; offset < nWordsReady; offset += blockSize) { + // Perform concrete-algorithm logic + this._doProcessBlock(dataWords, offset); + } + + // Remove processed words + var processedWords = dataWords.splice(0, nWordsReady); + data.sigBytes -= nBytesReady; + } + + // Return processed words + return new WordArray.init(processedWords, nBytesReady); + }, + + /** + * Creates a copy of this object. + * + * @return {Object} The clone. + * + * @example + * + * var clone = bufferedBlockAlgorithm.clone(); + */ + clone: function () { + var clone = Base.clone.call(this); + clone._data = this._data.clone(); + + return clone; + }, + + _minBufferSize: 0 + }); + + /** + * Abstract hasher template. + * + * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits) + */ + var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({ + /** + * Configuration options. + */ + cfg: Base.extend(), + + /** + * Initializes a newly created hasher. + * + * @param {Object} cfg (Optional) The configuration options to use for this hash computation. + * + * @example + * + * var hasher = CryptoJS.algo.SHA256.create(); + */ + init: function (cfg) { + // Apply config defaults + this.cfg = this.cfg.extend(cfg); + + // Set initial values + this.reset(); + }, + + /** + * Resets this hasher to its initial state. + * + * @example + * + * hasher.reset(); + */ + reset: function () { + // Reset data buffer + BufferedBlockAlgorithm.reset.call(this); + + // Perform concrete-hasher logic + this._doReset(); + }, + + /** + * Updates this hasher with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {Hasher} This hasher. + * + * @example + * + * hasher.update('message'); + * hasher.update(wordArray); + */ + update: function (messageUpdate) { + // Append + this._append(messageUpdate); + + // Update the hash + this._process(); + + // Chainable + return this; + }, + + /** + * Finalizes the hash computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The hash. + * + * @example + * + * var hash = hasher.finalize(); + * var hash = hasher.finalize('message'); + * var hash = hasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Final message update + if (messageUpdate) { + this._append(messageUpdate); + } + + // Perform concrete-hasher logic + var hash = this._doFinalize(); + + return hash; + }, + + blockSize: 512/32, + + /** + * Creates a shortcut function to a hasher's object interface. + * + * @param {Hasher} hasher The hasher to create a helper for. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256); + */ + _createHelper: function (hasher) { + return function (message, cfg) { + return new hasher.init(cfg).finalize(message); + }; + }, + + /** + * Creates a shortcut function to the HMAC's object interface. + * + * @param {Hasher} hasher The hasher to use in this HMAC helper. + * + * @return {Function} The shortcut function. + * + * @static + * + * @example + * + * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256); + */ + _createHmacHelper: function (hasher) { + return function (message, key) { + return new C_algo.HMAC.init(hasher, key).finalize(message); + }; + } + }); + + /** + * Algorithm namespace. + */ + var C_algo = C.algo = {}; + + return C; + }(Math)); + + + return CryptoJS; + +})); +},{}],155:[function(_dereq_,module,exports){ +;(function (root, factory, undef) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(_dereq_(154), _dereq_(157), _dereq_(156)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core", "./sha1", "./hmac"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } +}(this, function (CryptoJS) { + + return CryptoJS.HmacSHA1; + +})); +},{"154":154,"156":156,"157":157}],156:[function(_dereq_,module,exports){ +;(function (root, factory) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(_dereq_(154)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var Base = C_lib.Base; + var C_enc = C.enc; + var Utf8 = C_enc.Utf8; + var C_algo = C.algo; + + /** + * HMAC algorithm. + */ + var HMAC = C_algo.HMAC = Base.extend({ + /** + * Initializes a newly created HMAC. + * + * @param {Hasher} hasher The hash algorithm to use. + * @param {WordArray|string} key The secret key. + * + * @example + * + * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key); + */ + init: function (hasher, key) { + // Init hasher + hasher = this._hasher = new hasher.init(); + + // Convert string to WordArray, else assume WordArray already + if (typeof key == 'string') { + key = Utf8.parse(key); + } + + // Shortcuts + var hasherBlockSize = hasher.blockSize; + var hasherBlockSizeBytes = hasherBlockSize * 4; + + // Allow arbitrary length keys + if (key.sigBytes > hasherBlockSizeBytes) { + key = hasher.finalize(key); + } + + // Clamp excess bits + key.clamp(); + + // Clone key for inner and outer pads + var oKey = this._oKey = key.clone(); + var iKey = this._iKey = key.clone(); + + // Shortcuts + var oKeyWords = oKey.words; + var iKeyWords = iKey.words; + + // XOR keys with pad constants + for (var i = 0; i < hasherBlockSize; i++) { + oKeyWords[i] ^= 0x5c5c5c5c; + iKeyWords[i] ^= 0x36363636; + } + oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes; + + // Set initial values + this.reset(); + }, + + /** + * Resets this HMAC to its initial state. + * + * @example + * + * hmacHasher.reset(); + */ + reset: function () { + // Shortcut + var hasher = this._hasher; + + // Reset + hasher.reset(); + hasher.update(this._iKey); + }, + + /** + * Updates this HMAC with a message. + * + * @param {WordArray|string} messageUpdate The message to append. + * + * @return {HMAC} This HMAC instance. + * + * @example + * + * hmacHasher.update('message'); + * hmacHasher.update(wordArray); + */ + update: function (messageUpdate) { + this._hasher.update(messageUpdate); + + // Chainable + return this; + }, + + /** + * Finalizes the HMAC computation. + * Note that the finalize operation is effectively a destructive, read-once operation. + * + * @param {WordArray|string} messageUpdate (Optional) A final message update. + * + * @return {WordArray} The HMAC. + * + * @example + * + * var hmac = hmacHasher.finalize(); + * var hmac = hmacHasher.finalize('message'); + * var hmac = hmacHasher.finalize(wordArray); + */ + finalize: function (messageUpdate) { + // Shortcut + var hasher = this._hasher; + + // Compute HMAC + var innerHash = hasher.finalize(messageUpdate); + hasher.reset(); + var hmac = hasher.finalize(this._oKey.clone().concat(innerHash)); + + return hmac; + } + }); + }()); + + +})); +},{"154":154}],157:[function(_dereq_,module,exports){ +;(function (root, factory) { + if (typeof exports === "object") { + // CommonJS + module.exports = exports = factory(_dereq_(154)); + } + else if (typeof define === "function" && define.amd) { + // AMD + define(["./core"], factory); + } + else { + // Global (browser) + factory(root.CryptoJS); + } +}(this, function (CryptoJS) { + + (function () { + // Shortcuts + var C = CryptoJS; + var C_lib = C.lib; + var WordArray = C_lib.WordArray; + var Hasher = C_lib.Hasher; + var C_algo = C.algo; + + // Reusable object + var W = []; + + /** + * SHA-1 hash algorithm. + */ + var SHA1 = C_algo.SHA1 = Hasher.extend({ + _doReset: function () { + this._hash = new WordArray.init([ + 0x67452301, 0xefcdab89, + 0x98badcfe, 0x10325476, + 0xc3d2e1f0 + ]); + }, + + _doProcessBlock: function (M, offset) { + // Shortcut + var H = this._hash.words; + + // Working variables + var a = H[0]; + var b = H[1]; + var c = H[2]; + var d = H[3]; + var e = H[4]; + + // Computation + for (var i = 0; i < 80; i++) { + if (i < 16) { + W[i] = M[offset + i] | 0; + } else { + var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; + W[i] = (n << 1) | (n >>> 31); + } + + var t = ((a << 5) | (a >>> 27)) + e + W[i]; + if (i < 20) { + t += ((b & c) | (~b & d)) + 0x5a827999; + } else if (i < 40) { + t += (b ^ c ^ d) + 0x6ed9eba1; + } else if (i < 60) { + t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; + } else /* if (i < 80) */ { + t += (b ^ c ^ d) - 0x359d3e2a; + } + + e = d; + d = c; + c = (b << 30) | (b >>> 2); + b = a; + a = t; + } + + // Intermediate hash value + H[0] = (H[0] + a) | 0; + H[1] = (H[1] + b) | 0; + H[2] = (H[2] + c) | 0; + H[3] = (H[3] + d) | 0; + H[4] = (H[4] + e) | 0; + }, + + _doFinalize: function () { + // Shortcuts + var data = this._data; + var dataWords = data.words; + + var nBitsTotal = this._nDataBytes * 8; + var nBitsLeft = data.sigBytes * 8; + + // Add padding + dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); + dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; + data.sigBytes = dataWords.length * 4; + + // Hash final blocks + this._process(); + + // Return final computed hash + return this._hash; + }, + + clone: function () { + var clone = Hasher.clone.call(this); + clone._hash = this._hash.clone(); + + return clone; + } + }); + + /** + * Shortcut function to the hasher's object interface. + * + * @param {WordArray|string} message The message to hash. + * + * @return {WordArray} The hash. + * + * @static + * + * @example + * + * var hash = CryptoJS.SHA1('message'); + * var hash = CryptoJS.SHA1(wordArray); + */ + C.SHA1 = Hasher._createHelper(SHA1); + + /** + * Shortcut function to the HMAC's object interface. + * + * @param {WordArray|string} message The message to hash. + * @param {WordArray|string} key The secret key. + * + * @return {WordArray} The HMAC. + * + * @static + * + * @example + * + * var hmac = CryptoJS.HmacSHA1(message, key); + */ + C.HmacSHA1 = Hasher._createHmacHelper(SHA1); + }()); + + + return CryptoJS.SHA1; + +})); +},{"154":154}],158:[function(_dereq_,module,exports){ +// uuid.js +// +// Copyright (c) 2010-2012 Robert Kieffer +// MIT License - http://opensource.org/licenses/mit-license.php + +/*global window, require, define */ +(function(_window) { + 'use strict'; + + // Unique ID creation requires a high quality random # generator. We feature + // detect to determine the best RNG source, normalizing to a function that + // returns 128-bits of randomness, since that's what's usually required + var _rng, _mathRNG, _nodeRNG, _whatwgRNG, _previousRoot; + + function setupBrowser() { + // Allow for MSIE11 msCrypto + var _crypto = _window.crypto || _window.msCrypto; + + if (!_rng && _crypto && _crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // + // Moderately fast, high quality + try { + var _rnds8 = new Uint8Array(16); + _whatwgRNG = _rng = function whatwgRNG() { + _crypto.getRandomValues(_rnds8); + return _rnds8; + }; + _rng(); + } catch(e) {} + } + + if (!_rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var _rnds = new Array(16); + _mathRNG = _rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) { r = Math.random() * 0x100000000; } + _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return _rnds; + }; + if ('undefined' !== typeof console && console.warn) { + console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()"); + } + } + } + + function setupNode() { + // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html + // + // Moderately fast, high quality + if ('function' === typeof _dereq_) { + try { + var _rb = _dereq_('crypto').randomBytes; + _nodeRNG = _rng = _rb && function() {return _rb(16);}; + _rng(); + } catch(e) {} + } + } + + if (_window) { + setupBrowser(); + } else { + setupNode(); + } + + // Buffer class to use + var BufferClass = ('function' === typeof Buffer) ? Buffer : Array; + + // Maps for number <-> hex string conversion + var _byteToHex = []; + var _hexToByte = {}; + for (var i = 0; i < 256; i++) { + _byteToHex[i] = (i + 0x100).toString(16).substr(1); + _hexToByte[_byteToHex[i]] = i; + } + + // **`parse()` - Parse a UUID into it's component bytes** + function parse(s, buf, offset) { + var i = (buf && offset) || 0, ii = 0; + + buf = buf || []; + s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { + if (ii < 16) { // Don't overflow! + buf[i + ii++] = _hexToByte[oct]; + } + }); + + // Zero out remaining bytes if string was short + while (ii < 16) { + buf[i + ii++] = 0; + } + + return buf; + } + + // **`unparse()` - Convert UUID byte array (ala parse()) into a string** + function unparse(buf, offset) { + var i = offset || 0, bth = _byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; + } + + // **`v1()` - Generate time-based UUID** + // + // Inspired by https://github.com/LiosK/UUID.js + // and http://docs.python.org/library/uuid.html + + // random #'s we need to init node and clockseq + var _seedBytes = _rng(); + + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + var _nodeId = [ + _seedBytes[0] | 0x01, + _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] + ]; + + // Per 4.2.2, randomize (14 bit) clockseq + var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; + + // Previous uuid creation time + var _lastMSecs = 0, _lastNSecs = 0; + + // See https://github.com/broofa/node-uuid for API details + function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + + var clockseq = (options.clockseq != null) ? options.clockseq : _clockseq; + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = (options.msecs != null) ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = (options.nsecs != null) ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq == null) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + var node = options.node || _nodeId; + for (var n = 0; n < 6; n++) { + b[i + n] = node[n]; + } + + return buf ? buf : unparse(b); + } + + // **`v4()` - Generate random UUID** + + // See https://github.com/broofa/node-uuid for API details + function v4(options, buf, offset) { + // Deprecated - 'format' argument, as supported in v1.2 + var i = buf && offset || 0; + + if (typeof(options) === 'string') { + buf = (options === 'binary') ? new BufferClass(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || _rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ii++) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || unparse(rnds); + } + + // Export public API + var uuid = v4; + uuid.v1 = v1; + uuid.v4 = v4; + uuid.parse = parse; + uuid.unparse = unparse; + uuid.BufferClass = BufferClass; + uuid._rng = _rng; + uuid._mathRNG = _mathRNG; + uuid._nodeRNG = _nodeRNG; + uuid._whatwgRNG = _whatwgRNG; + + if (('undefined' !== typeof module) && module.exports) { + // Publish as node.js module + module.exports = uuid; + } else if (typeof define === 'function' && define.amd) { + // Publish as AMD module + define(function() {return uuid;}); + + + } else { + // Publish as global (in browsers) + _previousRoot = _window.uuid; + + // **`noConflict()` - (browser only) to reset global 'uuid' var** + uuid.noConflict = function() { + _window.uuid = _previousRoot; + return uuid; + }; + + _window.uuid = uuid; + } +})('undefined' !== typeof window ? window : null); + +},{"undefined":undefined}],159:[function(_dereq_,module,exports){ +/*! + * depd + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = depd + +/** + * Create deprecate for namespace in caller. + */ + +function depd(namespace) { + if (!namespace) { + throw new TypeError('argument namespace is required') + } + + function deprecate(message) { + // no-op in browser + } + + deprecate._file = undefined + deprecate._ignored = true + deprecate._namespace = namespace + deprecate._traced = false + deprecate._warned = Object.create(null) + + deprecate.function = wrapfunction + deprecate.property = wrapproperty + + return deprecate +} + +/** + * Return a wrapped function in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapfunction(fn, message) { + if (typeof fn !== 'function') { + throw new TypeError('argument fn must be a function') + } + + return fn +} + +/** + * Wrap property in a deprecation message. + * + * This is a no-op version of the wrapper, which does nothing but call + * validation. + */ + +function wrapproperty(obj, prop, message) { + if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) { + throw new TypeError('argument obj must be object') + } + + var descriptor = Object.getOwnPropertyDescriptor(obj, prop) + + if (!descriptor) { + throw new TypeError('must call property on owner object') + } + + if (!descriptor.configurable) { + throw new TypeError('property must be configurable') + } + + return +} + +},{}],160:[function(_dereq_,module,exports){ +/*! + * Copyright (c) 2015 Chris O'Hara + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +(function (name, definition) { + if (typeof exports !== 'undefined' && typeof module !== 'undefined') { + module.exports = definition(); + } else if (typeof define === 'function' && typeof define.amd === 'object') { + define(definition); + } else if (typeof define === 'function' && typeof define.petal === 'object') { + define(name, [], definition); + } else { + this[name] = definition(); + } +})('validator', function (validator) { + + 'use strict'; + + validator = { version: '4.9.0', coerce: true }; + + var emailUserPart = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i; + var quotedEmailUser = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i; + + var emailUserUtf8Part = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i; + var quotedEmailUserUtf8 = /^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i; + + var displayName = /^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i; + + var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/; + + var isin = /^[A-Z]{2}[0-9A-Z]{9}[0-9]$/; + + var isbn10Maybe = /^(?:[0-9]{9}X|[0-9]{10})$/ + , isbn13Maybe = /^(?:[0-9]{13})$/; + + var macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/; + + var ipv4Maybe = /^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/ + , ipv6Block = /^[0-9A-F]{1,4}$/i; + + var uuid = { + '3': /^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i + , '4': /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i + , '5': /^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i + , all: /^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i + }; + + var alpha = { + 'en-US': /^[A-Z]+$/i, + 'de-DE': /^[A-ZÄÖÜß]+$/i, + 'es-ES': /^[A-ZÁÉÍÑÓÚÜ]+$/i, + 'fr-FR': /^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i, + 'nl-NL': /^[A-ZÉËÏÓÖÜ]+$/i, + 'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i, + 'ru-RU': /^[А-ЯЁа-яё]+$/i + } + , alphanumeric = { + 'en-US': /^[0-9A-Z]+$/i, + 'de-DE': /^[0-9A-ZÄÖÜß]+$/i, + 'es-ES': /^[0-9A-ZÁÉÍÑÓÚÜ]+$/i, + 'fr-FR': /^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i, + 'nl-NL': /^[0-9A-ZÉËÏÓÖÜ]+$/i, + 'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i, + 'ru-RU': /^[0-9А-ЯЁа-яё]+$/i + }; + + var englishLocales = ['AU', 'GB', 'HK', 'IN', 'NZ', 'ZA', 'ZM']; + for (var locale, i = 0; i < englishLocales.length; i++) { + locale = 'en-' + englishLocales[i]; + alpha[locale] = alpha['en-US']; + alphanumeric[locale] = alphanumeric['en-US']; + } + + var numeric = /^[-+]?[0-9]+$/ + , int = /^(?:[-+]?(?:0|[1-9][0-9]*))$/ + , float = /^(?:[-+]?(?:[0-9]+))?(?:\.[0-9]*)?(?:[eE][\+\-]?(?:[0-9]+))?$/ + , hexadecimal = /^[0-9A-F]+$/i + , decimal = /^[-+]?([0-9]+|\.[0-9]+|[0-9]+\.[0-9]+)$/ + , hexcolor = /^#?([0-9A-F]{3}|[0-9A-F]{6})$/i; + + var ascii = /^[\x00-\x7F]+$/ + , multibyte = /[^\x00-\x7F]/ + , fullWidth = /[^\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/ + , halfWidth = /[\u0020-\u007E\uFF61-\uFF9F\uFFA0-\uFFDC\uFFE8-\uFFEE0-9a-zA-Z]/; + + var surrogatePair = /[\uD800-\uDBFF][\uDC00-\uDFFF]/; + + var base64 = /^(?:[A-Z0-9+\/]{4})*(?:[A-Z0-9+\/]{2}==|[A-Z0-9+\/]{3}=|[A-Z0-9+\/]{4})$/i; + + var phones = { + 'en-US': /^(\+?1)?[2-9]\d{2}[2-9](?!11)\d{6}$/, + 'de-DE': /^(\+?49[ \.\-])?([\(]{1}[0-9]{1,6}[\)])?([0-9 \.\-\/]{3,20})((x|ext|extension)[ ]?[0-9]{1,4})?$/, + 'el-GR': /^(\+?30)?(69\d{8})$/, + 'en-AU': /^(\+?61|0)4\d{8}$/, + 'en-GB': /^(\+?44|0)7\d{9}$/, + 'en-HK': /^(\+?852\-?)?[569]\d{3}\-?\d{4}$/, + 'en-IN': /^(\+?91|0)?[789]\d{9}$/, + 'en-NZ': /^(\+?64|0)2\d{7,9}$/, + 'en-ZA': /^(\+?27|0)\d{9}$/, + 'en-ZM': /^(\+?26)?09[567]\d{7}$/, + 'es-ES': /^(\+?34)?(6\d{1}|7[1234])\d{7}$/, + 'fi-FI': /^(\+?358|0)\s?(4(0|1|2|4|5)?|50)\s?(\d\s?){4,8}\d$/, + 'fr-FR': /^(\+?33|0)[67]\d{8}$/, + 'nb-NO': /^(\+?47)?[49]\d{7}$/, + 'nn-NO': /^(\+?47)?[49]\d{7}$/, + 'pt-BR': /^(\+?55|0)\-?[1-9]{2}\-?[2-9]{1}\d{3,4}\-?\d{4}$/, + 'pt-PT': /^(\+?351)?9[1236]\d{7}$/, + 'ru-RU': /^(\+?7|8)?9\d{9}$/, + 'vi-VN': /^(\+?84|0)?((1(2([0-9])|6([2-9])|88|99))|(9((?!5)[0-9])))([0-9]{7})$/, + 'zh-CN': /^(\+?0?86\-?)?((13\d|14[57]|15[^4,\D]|17[678]|18\d)\d{8}|170[059]\d{7})$/, + 'zh-TW': /^(\+?886\-?|0)?9\d{8}$/ + }; + + // from http://goo.gl/0ejHHW + var iso8601 = /^([\+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/; + + validator.extend = function (name, fn) { + validator[name] = function () { + var args = Array.prototype.slice.call(arguments); + args[0] = validator.toString(args[0]); + return fn.apply(validator, args); + }; + }; + + //Right before exporting the validator object, pass each of the builtins + //through extend() so that their first argument is coerced to a string + validator.init = function () { + for (var name in validator) { + if (typeof validator[name] !== 'function' || name === 'toString' || + name === 'toDate' || name === 'extend' || name === 'init' || + name === 'isServerSide') { + continue; + } + validator.extend(name, validator[name]); + } + }; + + validator.isServerSide = function () { + return typeof module === 'object' && module && + typeof module.exports === 'object' && + typeof process === 'object' && + typeof _dereq_ === 'function'; + }; + + var depd = null; + validator.deprecation = function (msg) { + if (depd === null) { + if (!validator.isServerSide()) { + return; + } + depd = _dereq_(159)('validator'); + } + depd(msg); + }; + + validator.toString = function (input) { + if (typeof input !== 'string') { + // The library validates strings only. Currently it coerces all input to a string, but this + // will go away in an upcoming major version change. Print a deprecation notice for now + if (!validator.coerce) { + throw new Error('this library validates strings only'); + } + validator.deprecation('you tried to validate a ' + typeof input + ' but this library ' + + '(validator.js) validates strings only. Please update your code as this will ' + + 'be an error soon.'); + } + if (typeof input === 'object' && input !== null) { + if (typeof input.toString === 'function') { + input = input.toString(); + } else { + input = '[object Object]'; + } + } else if (input === null || typeof input === 'undefined' || (isNaN(input) && !input.length)) { + input = ''; + } + return '' + input; + }; + + validator.toDate = function (date) { + if (Object.prototype.toString.call(date) === '[object Date]') { + return date; + } + date = Date.parse(date); + return !isNaN(date) ? new Date(date) : null; + }; + + validator.toFloat = function (str) { + return parseFloat(str); + }; + + validator.toInt = function (str, radix) { + return parseInt(str, radix || 10); + }; + + validator.toBoolean = function (str, strict) { + if (strict) { + return str === '1' || str === 'true'; + } + return str !== '0' && str !== 'false' && str !== ''; + }; + + validator.equals = function (str, comparison) { + return str === validator.toString(comparison); + }; + + validator.contains = function (str, elem) { + return str.indexOf(validator.toString(elem)) >= 0; + }; + + validator.matches = function (str, pattern, modifiers) { + if (Object.prototype.toString.call(pattern) !== '[object RegExp]') { + pattern = new RegExp(pattern, modifiers); + } + return pattern.test(str); + }; + + var default_email_options = { + allow_display_name: false, + allow_utf8_local_part: true, + require_tld: true + }; + + validator.isEmail = function (str, options) { + options = merge(options, default_email_options); + + if (options.allow_display_name) { + var display_email = str.match(displayName); + if (display_email) { + str = display_email[1]; + } + } + + var parts = str.split('@') + , domain = parts.pop() + , user = parts.join('@'); + + var lower_domain = domain.toLowerCase(); + if (lower_domain === 'gmail.com' || lower_domain === 'googlemail.com') { + user = user.replace(/\./g, '').toLowerCase(); + } + + if (!validator.isByteLength(user, {max: 64}) || + !validator.isByteLength(domain, {max: 256})) { + return false; + } + + if (!validator.isFQDN(domain, {require_tld: options.require_tld})) { + return false; + } + + if (user[0] === '"') { + user = user.slice(1, user.length - 1); + return options.allow_utf8_local_part ? + quotedEmailUserUtf8.test(user) : + quotedEmailUser.test(user); + } + + var pattern = options.allow_utf8_local_part ? + emailUserUtf8Part : emailUserPart; + + var user_parts = user.split('.'); + for (var i = 0; i < user_parts.length; i++) { + if (!pattern.test(user_parts[i])) { + return false; + } + } + + return true; + }; + + var default_url_options = { + protocols: [ 'http', 'https', 'ftp' ] + , require_tld: true + , require_protocol: false + , require_valid_protocol: true + , allow_underscores: false + , allow_trailing_dot: false + , allow_protocol_relative_urls: false + }; + + validator.isURL = function (url, options) { + if (!url || url.length >= 2083 || /\s/.test(url)) { + return false; + } + if (url.indexOf('mailto:') === 0) { + return false; + } + options = merge(options, default_url_options); + var protocol, auth, host, hostname, port, + port_str, split; + split = url.split('://'); + if (split.length > 1) { + protocol = split.shift(); + if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) { + return false; + } + } else if (options.require_protocol) { + return false; + } else if (options.allow_protocol_relative_urls && url.substr(0, 2) === '//') { + split[0] = url.substr(2); + } + url = split.join('://'); + split = url.split('#'); + url = split.shift(); + + split = url.split('?'); + url = split.shift(); + + split = url.split('/'); + url = split.shift(); + split = url.split('@'); + if (split.length > 1) { + auth = split.shift(); + if (auth.indexOf(':') >= 0 && auth.split(':').length > 2) { + return false; + } + } + hostname = split.join('@'); + split = hostname.split(':'); + host = split.shift(); + if (split.length) { + port_str = split.join(':'); + port = parseInt(port_str, 10); + if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) { + return false; + } + } + if (!validator.isIP(host) && !validator.isFQDN(host, options) && + host !== 'localhost') { + return false; + } + if (options.host_whitelist && + options.host_whitelist.indexOf(host) === -1) { + return false; + } + if (options.host_blacklist && + options.host_blacklist.indexOf(host) !== -1) { + return false; + } + return true; + }; + + validator.isMACAddress = function (str) { + return macAddress.test(str); + }; + + validator.isIP = function (str, version) { + version = version ? version + '' : ''; + if (!version) { + return validator.isIP(str, 4) || validator.isIP(str, 6); + } else if (version === '4') { + if (!ipv4Maybe.test(str)) { + return false; + } + var parts = str.split('.').sort(function (a, b) { + return a - b; + }); + return parts[3] <= 255; + } else if (version === '6') { + var blocks = str.split(':'); + var foundOmissionBlock = false; // marker to indicate :: + + // At least some OS accept the last 32 bits of an IPv6 address + // (i.e. 2 of the blocks) in IPv4 notation, and RFC 3493 says + // that '::ffff:a.b.c.d' is valid for IPv4-mapped IPv6 addresses, + // and '::a.b.c.d' is deprecated, but also valid. + var foundIPv4TransitionBlock = validator.isIP(blocks[blocks.length - 1], 4); + var expectedNumberOfBlocks = foundIPv4TransitionBlock ? 7 : 8; + + if (blocks.length > expectedNumberOfBlocks) + return false; + + // initial or final :: + if (str === '::') { + return true; + } else if (str.substr(0, 2) === '::') { + blocks.shift(); + blocks.shift(); + foundOmissionBlock = true; + } else if (str.substr(str.length - 2) === '::') { + blocks.pop(); + blocks.pop(); + foundOmissionBlock = true; + } + + for (var i = 0; i < blocks.length; ++i) { + // test for a :: which can not be at the string start/end + // since those cases have been handled above + if (blocks[i] === '' && i > 0 && i < blocks.length -1) { + if (foundOmissionBlock) + return false; // multiple :: in address + foundOmissionBlock = true; + } else if (foundIPv4TransitionBlock && i == blocks.length - 1) { + // it has been checked before that the last + // block is a valid IPv4 address + } else if (!ipv6Block.test(blocks[i])) { + return false; + } + } + + if (foundOmissionBlock) { + return blocks.length >= 1; + } else { + return blocks.length === expectedNumberOfBlocks; + } + } + return false; + }; + + var default_fqdn_options = { + require_tld: true + , allow_underscores: false + , allow_trailing_dot: false + }; + + validator.isFQDN = function (str, options) { + options = merge(options, default_fqdn_options); + + /* Remove the optional trailing dot before checking validity */ + if (options.allow_trailing_dot && str[str.length - 1] === '.') { + str = str.substring(0, str.length - 1); + } + var parts = str.split('.'); + if (options.require_tld) { + var tld = parts.pop(); + if (!parts.length || !/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) { + return false; + } + } + for (var part, i = 0; i < parts.length; i++) { + part = parts[i]; + if (options.allow_underscores) { + if (part.indexOf('__') >= 0) { + return false; + } + part = part.replace(/_/g, ''); + } + if (!/^[a-z\u00a1-\uffff0-9-]+$/i.test(part)) { + return false; + } + if (/[\uff01-\uff5e]/.test(part)) { + // disallow full-width chars + return false; + } + if (part[0] === '-' || part[part.length - 1] === '-') { + return false; + } + } + return true; + }; + + validator.isBoolean = function(str) { + return (['true', 'false', '1', '0'].indexOf(str) >= 0); + }; + + validator.isAlpha = function (str, locale) { + locale = locale || 'en-US'; + if (locale in alpha) { + return alpha[locale].test(str); + } + throw new Error('Invalid locale \'' + locale + '\''); + }; + + validator.isAlphanumeric = function (str, locale) { + locale = locale || 'en-US'; + if (locale in alphanumeric) { + return alphanumeric[locale].test(str); + } + throw new Error('Invalid locale \'' + locale + '\''); + }; + + validator.isNumeric = function (str) { + return numeric.test(str); + }; + + validator.isDecimal = function (str) { + return str !== '' && decimal.test(str); + }; + + validator.isHexadecimal = function (str) { + return hexadecimal.test(str); + }; + + validator.isHexColor = function (str) { + return hexcolor.test(str); + }; + + validator.isLowercase = function (str) { + return str === str.toLowerCase(); + }; + + validator.isUppercase = function (str) { + return str === str.toUpperCase(); + }; + + validator.isInt = function (str, options) { + options = options || {}; + return int.test(str) && (!options.hasOwnProperty('min') || str >= options.min) && (!options.hasOwnProperty('max') || str <= options.max); + }; + + validator.isFloat = function (str, options) { + options = options || {}; + if (str === '' || str === '.') { + return false; + } + return float.test(str) && (!options.hasOwnProperty('min') || str >= options.min) && (!options.hasOwnProperty('max') || str <= options.max); + }; + + validator.isDivisibleBy = function (str, num) { + return validator.toFloat(str) % parseInt(num, 10) === 0; + }; + + validator.isNull = function (str) { + return str.length === 0; + }; + + validator.isLength = function (str, options) { + var min, max; + if (typeof(options) === 'object') { + min = options.min || 0; + max = options.max; + } else { // backwards compatibility: isLength(str, min [, max]) + min = arguments[1]; + max = arguments[2]; + } + var surrogatePairs = str.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g) || []; + var len = str.length - surrogatePairs.length; + return len >= min && (typeof max === 'undefined' || len <= max); + }; + validator.isByteLength = function (str, options) { + var min, max; + if (typeof(options) === 'object') { + min = options.min || 0; + max = options.max; + } else { // backwards compatibility: isByteLength(str, min [, max]) + min = arguments[1]; + max = arguments[2]; + } + var len = encodeURI(str).split(/%..|./).length - 1; + return len >= min && (typeof max === 'undefined' || len <= max); + }; + + validator.isUUID = function (str, version) { + var pattern = uuid[version ? version : 'all']; + return pattern && pattern.test(str); + }; + + function getTimezoneOffset(str) { + var iso8601Parts = str.match(iso8601) + , timezone, sign, hours, minutes; + if (!iso8601Parts) { + str = str.toLowerCase(); + timezone = str.match(/(?:\s|gmt\s*)(-|\+)(\d{1,4})(\s|$)/); + if (!timezone) { + return str.indexOf('gmt') !== -1 ? 0 : null; + } + sign = timezone[1]; + var offset = timezone[2]; + if (offset.length === 3) { + offset = '0' + offset; + } + if (offset.length <= 2) { + hours = 0; + minutes = parseInt(offset); + } else { + hours = parseInt(offset.slice(0, 2)); + minutes = parseInt(offset.slice(2, 4)); + } + } else { + timezone = iso8601Parts[21]; + if (!timezone) { + // if no hour/minute was provided, the date is GMT + return !iso8601Parts[12] ? 0 : null; + } + if (timezone === 'z' || timezone === 'Z') { + return 0; + } + sign = iso8601Parts[22]; + if (timezone.indexOf(':') !== -1) { + hours = parseInt(iso8601Parts[23]); + minutes = parseInt(iso8601Parts[24]); + } else { + hours = 0; + minutes = parseInt(iso8601Parts[23]); + } + } + return (hours * 60 + minutes) * (sign === '-' ? 1 : -1); + } + + validator.isDate = function (str) { + var normalizedDate = new Date(Date.parse(str)); + if (isNaN(normalizedDate)) { + return false; + } + + // normalizedDate is in the user's timezone. Apply the input + // timezone offset to the date so that the year and day match + // the input + var timezoneOffset = getTimezoneOffset(str); + if (timezoneOffset !== null) { + var timezoneDifference = normalizedDate.getTimezoneOffset() - + timezoneOffset; + normalizedDate = new Date(normalizedDate.getTime() + + 60000 * timezoneDifference); + } + + var day = String(normalizedDate.getDate()); + var dayOrYear, dayOrYearMatches, year; + //check for valid double digits that could be late days + //check for all matches since a string like '12/23' is a valid date + //ignore everything with nearby colons + dayOrYearMatches = str.match(/(^|[^:\d])[23]\d([^:\d]|$)/g); + if (!dayOrYearMatches) { + return true; + } + dayOrYear = dayOrYearMatches.map(function(digitString) { + return digitString.match(/\d+/g)[0]; + }).join('/'); + + year = String(normalizedDate.getFullYear()).slice(-2); + if (dayOrYear === day || dayOrYear === year) { + return true; + } else if ((dayOrYear === (day + '/' + year)) || (dayOrYear === (year + '/' + day))) { + return true; + } + return false; + }; + + validator.isAfter = function (str, date) { + var comparison = validator.toDate(date || new Date()) + , original = validator.toDate(str); + return !!(original && comparison && original > comparison); + }; + + validator.isBefore = function (str, date) { + var comparison = validator.toDate(date || new Date()) + , original = validator.toDate(str); + return !!(original && comparison && original < comparison); + }; + + validator.isIn = function (str, options) { + var i; + if (Object.prototype.toString.call(options) === '[object Array]') { + var array = []; + for (i in options) { + array[i] = validator.toString(options[i]); + } + return array.indexOf(str) >= 0; + } else if (typeof options === 'object') { + return options.hasOwnProperty(str); + } else if (options && typeof options.indexOf === 'function') { + return options.indexOf(str) >= 0; + } + return false; + }; + + validator.isWhitelisted = function (str, chars) { + for (var i = str.length - 1; i >= 0; i--) { + if (chars.indexOf(str[i]) === -1) { + return false; + } + } + + return true; + }; + + validator.isCreditCard = function (str) { + var sanitized = str.replace(/[^0-9]+/g, ''); + if (!creditCard.test(sanitized)) { + return false; + } + var sum = 0, digit, tmpNum, shouldDouble; + for (var i = sanitized.length - 1; i >= 0; i--) { + digit = sanitized.substring(i, (i + 1)); + tmpNum = parseInt(digit, 10); + if (shouldDouble) { + tmpNum *= 2; + if (tmpNum >= 10) { + sum += ((tmpNum % 10) + 1); + } else { + sum += tmpNum; + } + } else { + sum += tmpNum; + } + shouldDouble = !shouldDouble; + } + return !!((sum % 10) === 0 ? sanitized : false); + }; + + validator.isISIN = function (str) { + if (!isin.test(str)) { + return false; + } + + var checksumStr = str.replace(/[A-Z]/g, function(character) { + return parseInt(character, 36); + }); + + var sum = 0, digit, tmpNum, shouldDouble = true; + for (var i = checksumStr.length - 2; i >= 0; i--) { + digit = checksumStr.substring(i, (i + 1)); + tmpNum = parseInt(digit, 10); + if (shouldDouble) { + tmpNum *= 2; + if (tmpNum >= 10) { + sum += tmpNum + 1; + } else { + sum += tmpNum; + } + } else { + sum += tmpNum; + } + shouldDouble = !shouldDouble; + } + + return parseInt(str.substr(str.length - 1), 10) === (10000 - sum) % 10; + }; + + validator.isISBN = function (str, version) { + version = version ? version + '' : ''; + if (!version) { + return validator.isISBN(str, 10) || validator.isISBN(str, 13); + } + var sanitized = str.replace(/[\s-]+/g, '') + , checksum = 0, i; + if (version === '10') { + if (!isbn10Maybe.test(sanitized)) { + return false; + } + for (i = 0; i < 9; i++) { + checksum += (i + 1) * sanitized.charAt(i); + } + if (sanitized.charAt(9) === 'X') { + checksum += 10 * 10; + } else { + checksum += 10 * sanitized.charAt(9); + } + if ((checksum % 11) === 0) { + return !!sanitized; + } + } else if (version === '13') { + if (!isbn13Maybe.test(sanitized)) { + return false; + } + var factor = [ 1, 3 ]; + for (i = 0; i < 12; i++) { + checksum += factor[i % 2] * sanitized.charAt(i); + } + if (sanitized.charAt(12) - ((10 - (checksum % 10)) % 10) === 0) { + return !!sanitized; + } + } + return false; + }; + + validator.isMobilePhone = function(str, locale) { + if (locale in phones) { + return phones[locale].test(str); + } + return false; + }; + + var default_currency_options = { + symbol: '$' + , require_symbol: false + , allow_space_after_symbol: false + , symbol_after_digits: false + , allow_negatives: true + , parens_for_negatives: false + , negative_sign_before_digits: false + , negative_sign_after_digits: false + , allow_negative_sign_placeholder: false + , thousands_separator: ',' + , decimal_separator: '.' + , allow_space_after_digits: false + }; + + validator.isCurrency = function (str, options) { + options = merge(options, default_currency_options); + + return currencyRegex(options).test(str); + }; + + validator.isJSON = function (str) { + try { + var obj = JSON.parse(str); + return !!obj && typeof obj === 'object'; + } catch (e) {} + return false; + }; + + validator.isMultibyte = function (str) { + return multibyte.test(str); + }; + + validator.isAscii = function (str) { + return ascii.test(str); + }; + + validator.isFullWidth = function (str) { + return fullWidth.test(str); + }; + + validator.isHalfWidth = function (str) { + return halfWidth.test(str); + }; + + validator.isVariableWidth = function (str) { + return fullWidth.test(str) && halfWidth.test(str); + }; + + validator.isSurrogatePair = function (str) { + return surrogatePair.test(str); + }; + + validator.isBase64 = function (str) { + return base64.test(str); + }; + + validator.isMongoId = function (str) { + return validator.isHexadecimal(str) && str.length === 24; + }; + + validator.isISO8601 = function (str) { + return iso8601.test(str); + }; + + validator.ltrim = function (str, chars) { + var pattern = chars ? new RegExp('^[' + chars + ']+', 'g') : /^\s+/g; + return str.replace(pattern, ''); + }; + + validator.rtrim = function (str, chars) { + var pattern = chars ? new RegExp('[' + chars + ']+$', 'g') : /\s+$/g; + return str.replace(pattern, ''); + }; + + validator.trim = function (str, chars) { + var pattern = chars ? new RegExp('^[' + chars + ']+|[' + chars + ']+$', 'g') : /^\s+|\s+$/g; + return str.replace(pattern, ''); + }; + + validator.escape = function (str) { + return (str.replace(/&/g, '&') + .replace(/"/g, '"') + .replace(/'/g, ''') + .replace(//g, '>') + .replace(/\//g, '/') + .replace(/\`/g, '`')); + }; + + validator.stripLow = function (str, keep_new_lines) { + var chars = keep_new_lines ? '\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F' : '\\x00-\\x1F\\x7F'; + return validator.blacklist(str, chars); + }; + + validator.whitelist = function (str, chars) { + return str.replace(new RegExp('[^' + chars + ']+', 'g'), ''); + }; + + validator.blacklist = function (str, chars) { + return str.replace(new RegExp('[' + chars + ']+', 'g'), ''); + }; + + var default_normalize_email_options = { + lowercase: true, + remove_dots: true, + remove_extension: true + }; + + validator.normalizeEmail = function (email, options) { + options = merge(options, default_normalize_email_options); + if (!validator.isEmail(email)) { + return false; + } + var parts = email.split('@', 2); + parts[1] = parts[1].toLowerCase(); + if (parts[1] === 'gmail.com' || parts[1] === 'googlemail.com') { + if (options.remove_extension) { + parts[0] = parts[0].split('+')[0]; + } + if (options.remove_dots) { + parts[0] = parts[0].replace(/\./g, ''); + } + if (!parts[0].length) { + return false; + } + parts[0] = parts[0].toLowerCase(); + parts[1] = 'gmail.com'; + } else if (options.lowercase) { + parts[0] = parts[0].toLowerCase(); + } + return parts.join('@'); + }; + + function merge(obj, defaults) { + obj = obj || {}; + for (var key in defaults) { + if (typeof obj[key] === 'undefined') { + obj[key] = defaults[key]; + } + } + return obj; + } + + function currencyRegex(options) { + var symbol = '(\\' + options.symbol.replace(/\./g, '\\.') + ')' + (options.require_symbol ? '' : '?') + , negative = '-?' + , whole_dollar_amount_without_sep = '[1-9]\\d*' + , whole_dollar_amount_with_sep = '[1-9]\\d{0,2}(\\' + options.thousands_separator + '\\d{3})*' + , valid_whole_dollar_amounts = ['0', whole_dollar_amount_without_sep, whole_dollar_amount_with_sep] + , whole_dollar_amount = '(' + valid_whole_dollar_amounts.join('|') + ')?' + , decimal_amount = '(\\' + options.decimal_separator + '\\d{2})?'; + var pattern = whole_dollar_amount + decimal_amount; + // default is negative sign before symbol, but there are two other options (besides parens) + if (options.allow_negatives && !options.parens_for_negatives) { + if (options.negative_sign_after_digits) { + pattern += negative; + } + else if (options.negative_sign_before_digits) { + pattern = negative + pattern; + } + } + // South African Rand, for example, uses R 123 (space) and R-123 (no space) + if (options.allow_negative_sign_placeholder) { + pattern = '( (?!\\-))?' + pattern; + } + else if (options.allow_space_after_symbol) { + pattern = ' ?' + pattern; + } + else if (options.allow_space_after_digits) { + pattern += '( (?!$))?'; + } + if (options.symbol_after_digits) { + pattern += symbol; + } else { + pattern = symbol + pattern; + } + if (options.allow_negatives) { + if (options.parens_for_negatives) { + pattern = '(\\(' + pattern + '\\)|' + pattern + ')'; + } + else if (!(options.negative_sign_before_digits || options.negative_sign_after_digits)) { + pattern = negative + pattern; + } + } + return new RegExp( + '^' + + // ensure there's a dollar and/or decimal amount, and that it doesn't start with a space or a negative sign followed by a space + '(?!-? )(?=.*\\d)' + + pattern + + '$' + ); + } + + validator.init(); + + return validator; + +}); + +},{"159":159}],161:[function(_dereq_,module,exports){ +'use strict'; + +_dereq_(152); +_dereq_(148); + +if (!Object.assign) { + _dereq_(149); +} + +if (!Object.setPrototypeOf) { + _dereq_(150); +} + +if (typeof Promise === "undefined") { + _dereq_(151); +} + +if (!Array.from) { + _dereq_(146); + _dereq_(147); +} + +if (typeof Symbol === "undefined") { + _dereq_(153); +} + +},{"146":146,"147":147,"148":148,"149":149,"150":150,"151":151,"152":152,"153":153}]},{},[35])(35) +}); \ No newline at end of file diff --git a/dist/baqend.min.js b/dist/baqend.min.js new file mode 100644 index 00000000..c63951d4 --- /dev/null +++ b/dist/baqend.min.js @@ -0,0 +1,7 @@ +/*! baqend 2.4.3 | Copyright (c) 2015 Baqend GmbH | MIT */ +!function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;b="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,b.DB=a()}}(function(){var a,b={};return b.typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},b.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},b.createClass=function(){function a(a,b){for(var c=0;c0&&b.bloomFilter&&h.atob&&!h.isNode&&this.updateBloomFilter(b.bloomFilter))},c.prototype._createObjectFactory=function(a){Object.keys(a).forEach(function(a){var b=this.metamodel.managedType(a),c=b.name;this[c]?(b.typeConstructor=this[c],Object.defineProperty(this,c,{value:b.createObjectFactory(this)})):Object.defineProperty(this,c,{get:function(){return Object.defineProperty(this,c,{value:b.createObjectFactory(this)}),this[c]},set:function(a){b.typeConstructor=a},configurable:!0})},this)},c.prototype.send=function(a){var b=this;return a.tokenStorage=this.tokenStorage,this._connector.send(a).catch(function(a){throw a.status==o.BAD_CREDENTIALS&&b._logout(),a})},c.prototype.getReference=function(a,b){var c,d;b?(d=this.metamodel.entity(a),c=0==b.indexOf("/db/")?b:d.ref+"/"+encodeURIComponent(b)):(c=a,d=this.metamodel.entity(c.substring(0,c.indexOf("/",4))));var e=this._entities[c];if(!e){e=d.create();var f=l.get(e);f.id=c,f.setUnavailable(),this._attach(e)}return e},c.prototype.createQueryBuilder=function(a){return new i.Builder(this,a)},c.prototype.clear=function(){this._entities={}},c.prototype.close=function(){return this._connector=null,this.clear()},c.prototype.contains=function(a){return!!a&&this._entities[a.id]===a},c.prototype.containsById=function(a){return!(!a||!this._entities[a.id])},c.prototype.detach=function(a){var b=this,c=l.get(a);return c.withLock(function(){return b.removeReference(a),Promise.resolve(a)})},c.prototype.resolveDepth=function(a,b){var c=this;if(!b||!b.depth)return Promise.resolve(a);b.resolved=b.resolved||[];var d=[],e=Object.assign({},b,{depth:b.depth===!0||b.depth-1});return this.getSubEntities(a,1).forEach(function(a){null==a||~b.resolved.indexOf(a)||(b.resolved.push(a),d.push(c.load(a.id,null,e)))}),Promise.all(d).then(function(){return a})},c.prototype.load=function(a,b,c){var d=this;c=c||{};var f=this.getReference(a,b),g=l.get(f);if(!c.refresh&&c.local&&g.isAvailable)return this.resolveDepth(f,c);var h=new e.GetObject(g.bucket,g.key);return this.ensureCacheHeader(f.id,h,c.refresh),this.send(h).then(function(e){return f.version>e.entity.version?(c.refresh=!0,d.load(a,b,c)):(d.addToWhiteList(e.entity.id),e.status!=o.NOT_MODIFIED&&g.setJson(e.entity,!0),d.resolveDepth(f,c))},function(a){if(a.status==o.OBJECT_NOT_FOUND)return d.removeReference(f),g.setRemoved(),null;throw a})},c.prototype.insert=function(a,b){var c=this;b=b||{};var d;return this._save(a,b,function(a,b){if(a.version)throw new f.PersistentError("Existing objects can't be inserted.");return d=!a.id,new e.CreateObject(a.bucket,b)}).then(function(b){return d&&c._attach(a),b})},c.prototype.update=function(a,b){return b=b||{},this._save(a,b,function(a,c){if(!a.version)throw new f.PersistentError("New objects can't be inserted.");return b.force?(delete c.version,new e.ReplaceObject(a.bucket,a.key,c).ifMatch("*")):new e.ReplaceObject(a.bucket,a.key,c).ifMatch(a.version)})},c.prototype.save=function(a,b,c){b=b||{};var d=function(a,c){if(b.force){if(!a.id)throw new f.PersistentError("New special objects can't be forcedly saved.");return delete c.version,new e.ReplaceObject(a.bucket,a.key,c)}return a.version?new e.ReplaceObject(a.bucket,a.key,c).ifMatch(a.version):new e.CreateObject(a.bucket,c)};return c?this._locklessSave(a,b,d):this._save(a,b,d)},c.prototype.optimisticSave=function(a,b){var c=this;return l.get(a).withLock(function(){return c._optimisticSave(a,b)})},c.prototype._optimisticSave=function(a,b){var c=this,d=!1,e=function(){d=!0},f=Promise.resolve(b(a,e));return d?Promise.resolve(a):f.then(function(){return c.save(a,{},!0).catch(function(d){if(412==d.status)return c.refresh(a,{}).then(function(){return c._optimisticSave(a,b)});throw d})})},c.prototype._locklessSave=function(a,b,c){var d=this;this.attach(a);var e,f,g=l.get(a);if(g.isAvailable&&(f=g.getJson(!1,!0)),g.isDirty){b.refresh||g.setPersistent();var h=this.send(c(g,f)).then(function(c){return b.refresh?g.setJson(c.entity,!0):g.setJsonMetadata(c.entity),a},function(b){if(b.status==o.OBJECT_NOT_FOUND)return d.removeReference(a),g.setRemoved(),null;throw g.setDirty(),b});e=[h]}else e=[Promise.resolve(a)];var i=Object.assign({},b);return i.depth=0,this.getSubEntities(a,b.depth).forEach(function(a){e.push(d._save(a,i,c))}),Promise.all(e).then(function(){return a})},c.prototype._save=function(a,b,c){var d=this;this.ensureBloomFilterFreshness();var e=l.get(a);return e.version&&this.addToBlackList(a.id),e.withLock(function(){return d._locklessSave(a,b,c)})},c.prototype.getSubEntities=function(a,b,c,d){var e=this;if(c=c||[],!b)return c;d=d||a;for(var f=l.get(a),g=f.type.references(),h=Array.isArray(g),i=0,g=h?g:g[Symbol.iterator]();;){var j;if(h){if(i>=g.length)break;j=g[i++]}else{if(i=g.next(),i.done)break;j=i.value}var k=j;this.getSubEntitiesByPath(a,k.path).forEach(function(a){~c.indexOf(a)||a==d||(c.push(a),c=e.getSubEntities(a,b===!0?b:b-1,c,d))})}return c},c.prototype.getSubEntitiesByPath=function(a,b){var c=this,d=[a];return b.forEach(function(a){var b=[];d.forEach(function(d){var e=d[a];if(e){var f=c.metamodel.managedType(d.constructor).getAttribute(a);if(f.isCollection)for(var g=e.entries(),h=Array.isArray(g),i=0,g=h?g:g[Symbol.iterator]();;){var j;if(h){if(i>=g.length)break;j=g[i++]}else{if(i=g.next(),i.done)break;j=i.value}var k=j;b.push(k[1]),f.keyType&&f.keyType.isEntity&&b.push(k[0])}else b.push(e)}}),d=b}),d},c.prototype.delete=function(a,b){var c=this;b=b||{},this.attach(a);var d=l.get(a);return d.withLock(function(){if(!d.version&&!b.force)throw new f.IllegalEntityError(a);var g=new e.DeleteObject(d.bucket,d.key);c.addToBlackList(a.id),b.force||g.ifMatch(d.version);var h=[c.send(g).then(function(){return c.removeReference(a),d.setRemoved(),a})],i=Object.assign({},b);return i.depth=0,c.getSubEntities(a,b.depth).forEach(function(a){h.push(c.delete(a,i))}),Promise.all(h).then(function(){return a})})},c.prototype.flush=function(a,b){},c.prototype.persist=function(a){this.attach(a)},c.prototype.refresh=function(a,b){return b=b||{},b.refresh=!0,this.load(a.id,null,b)},c.prototype.attach=function(a){if(!this.contains(a)){var b=this.metamodel.entity(a.constructor);if(!b)throw new f.IllegalEntityError(a);if(this.containsById(a))throw new f.EntityExistsError(a);this._attach(a)}},c.prototype._attach=function(a){var b=l.get(a);if(b.isAttached){if(b.db!=this)throw new f.EntityExistsError(a)}else b.db=this;b.id||"User"!=b.type.name&&"Role"!=b.type.name&&"logs.AppLog"!=b.type.name&&(b.id="/db/"+b.type.name+"/"+h.uuid()),b.id&&(this._entities[b.id]=a)},c.prototype.removeReference=function(a){var b=l.get(a);if(!b)throw new f.IllegalEntityError(a);delete this._entities[b.id]},c.prototype.register=function(a,b,c){var d=this,g=c>j.LoginOption.NO_LOGIN;if(this.me&&g)throw new f.PersistentError("User is already logged in.");return this.withLock(function(){var f=new e.Register({user:a,password:b,login:g});return d._userRequest(f,c)})},c.prototype.login=function(a,b,c){var d=this;if(this.me)throw new f.PersistentError("User is already logged in.");return this.withLock(function(){var f=new e.Login({username:a,password:b});return d._userRequest(f,c)})},c.prototype.logout=function(){var a=this;return this.withLock(function(){return a.send(new e.Logout).then(a._logout.bind(a))})},c.prototype.loginWithOAuth=function(a,b,c){if(this.me)throw new f.PersistentError("User is already logged in.");c=Object.assign({title:"Login with "+a,timeout:3e5,state:{},loginOption:!0},c);var d;if(!m[a+"OAuth"])throw new Error("OAuth provider "+a+" not supported.");d=new m[a+"OAuth"](b,c.scope,JSON.stringify(c.state));var e=this._userRequest(d,c.loginOption);open(d.request.path,c.title,"width="+c.width+",height="+c.height);return new Promise(function(a,b){var d=setTimeout(function(){b(new f.PersistentError("OAuth login timeout."))},c.timeout);e.then(a,b).then(function(){clearTimeout(d)})})},c.prototype.renew=function(){var a=this;return this.withLock(function(){var b=new e.Me;return a._userRequest(b,!0)})},c.prototype.newPassword=function(a,b,c){var d=this;return this.withLock(function(){var f=new e.NewPassword({username:a,password:b,newPassword:c});return d.send(f).then(function(a){return d._updateUser(a.entity)})})},c.prototype._updateUser=function(a,b){var c=this.getReference(a.id),d=l.get(c);return d.setJson(a,!0),b&&(this.me=c),c},c.prototype._logout=function(){this.me=null,this.token=null},c.prototype._userRequest=function(a,b){var c=this,d=b>j.LoginOption.NO_LOGIN;return d&&(this.tokenStorage.temporary=bc&&this._bloomFilterLock.withLock(function(){return a.refreshBloomFilter()})}},c.prototype.mustRevalidate=function(a){if(h.isNode)return!1;this.ensureBloomFilterFreshness();var b=this.isCachingDisabled||!this._bloomFilterLock.isReady;return b=b||!this.cacheWhiteList.has(a)&&(this.cacheBlackList.has(a)||this.bloomFilter.contains(a))},c.prototype.ensureCacheHeader=function(a,b,c){c=c||this.mustRevalidate(a),c&&b.noCache()},c.prototype.createURL=function(a,b){var c=this._connector.basePath+a,d=!1;return b&&this.me?(c=this.tokenStorage.signPath(c),d=!0):c=c.split("/").map(encodeURIComponent).join("/"),this.mustRevalidate(a)&&(c=c+(d?"&":"?")+"BCB"),this._connector.origin+c},c}(h.Lockable);p.prototype.List=Array,p.prototype.Set=Set,p.prototype.Map=Map,p.prototype.GeoPoint=a(5),c.exports=p},{19:19,20:20,21:21,25:25,34:34,36:36,4:4,5:5,59:59,63:63,70:70}],3:[function(a,c,d){"use strict";var e=a(36),f=a(52),g=a(70),h=(a(22),a(23)),i=a(2),j=function(a){function c(d){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this));d=Object(d)instanceof String?{host:d}:d||{},f._connector=null,f.metamodel=f.createMetamodel(),f.code=new g.Code(f.metamodel,f),f.tokenStorageFactory=g.TokenStorage.WEB_STORAGE||g.TokenStorage.GLOBAL,f.configure(d);var h=!0,i=new Promise(function(a){f._connected=a});return d.host?f.connect(d.host,d.port,d.secure,d.basePath):h=!1,f.tokenStorage||(h=!1,i=i.then(function(){return f.tokenStorageFactory.create(f._connector.origin)}).then(function(a){f.tokenStorage=a})),d.schema?(f._connectData=d,f.metamodel.init(d.schema)):(h=!1,i=i.then(function(){var a=new e.Connect;return a.withCredentials=!0,0===f.staleness&&a.noCache(),f.send(a)}).then(function(a){f._connectData=a.entity,void 0===f.staleness&&(f.staleness=f._connectData.bloomFilterRefresh||60),f.metamodel.isInitialized||f.metamodel.init(f._connectData.schema),f.tokenStorage.update(f._connectData.token)})),h||f.withLock(function(){return i},!0),f}return b.inherits(c,a),c.prototype._connected=function(){},c.prototype.configure=function(a){if(this._connector)throw new Error("The EntityManagerFactory can only be configured before is is connected.");a.tokenStorage&&(this.tokenStorage=a.tokenStorage),a.tokenStorageFactory&&(this.tokenStorageFactory=a.tokenStorageFactory),void 0!==a.staleness&&(this.staleness=a.staleness)},c.prototype.connect=function(a,b,c,d){if(this._connector)throw new Error("The EntityManagerFactory is already connected.");return Object(b)instanceof Boolean&&(c=b,b=0),this._connector=h.create(a,b,c,d),this._connected(),this.ready()},c.prototype.createMetamodel=function(){return new f.Metamodel(this)},c.prototype.createEntityManager=function(a){var b=this,c=new i(this);return this.isReady?c.connected(this._connector,this._connectData,a?this.tokenStorage:new g.TokenStorage(this._connector.origin)):c.withLock(function(){return b.ready().then(function(){c.connected(b._connector,b._connectData,a?b.tokenStorage:new g.TokenStorage(b._connector.origin))})},!0),c},c.prototype.send=function(a){return a.tokenStorage||(a.tokenStorage=this.tokenStorage),this._connector.send(a)},c}(g.Lockable);c.exports=j},{2:2,22:22,23:23,36:36,52:52,70:70}],4:[function(a,c,d){"use strict";var e=a(36),f=a(34),g=function(){function a(c){b.classCallCheck(this,a),this._connector=c.connector,this.entityManager=c,this.tid=null,this.rollbackOnly=!1,this.readSet=null,this.changeSet=null}return b.createClass(a,[{key:"isActive",get:function(){return Boolean(this.tid)}}]),a.prototype.begin=function(a,b){return this.yield().then(function(){var a=this.send(new e.PostTransaction).done(function(a){this.tid=a.tid,this.rollbackOnly=!1,this.readSet={},this.changeSet={}});return this.wait(a)}).then(a,b)},a.prototype.commit=function(a,b){return this.yield().then(function(){return this.getRollbackOnly()?this.rollback().then(function(){throw new f.RollbackError}):this.wait(this.entityManager.flush()).then(function(){var a=[];for(var b in this.readSet)a.push({oid:b,version:this.readSet[b]});var c=this.send(new e.PutTransactionCommitted(this.tid,a));return this.wait(c).then(function(a){this.tid=null,this.readSet=null,this.changeSet=null;var b=a.oids;for(var c in b){var d=b[c],e=this.entityManager.entities[c];if(e){var f=util.Metadata.get(e);"DELETED"==d||f.isDeleted?this.entityManager.removeReference(e):f.setJsonValue(f.type.version,d)}}})})}).then(a,b)},a.prototype.getRollbackOnly=function(){return this.rollbackOnly},a.prototype.rollback=function(a,b){return this.yield().then(function(){var a=this.send(new e.PutTransactionAborted(this.tid));this.wait(a).then(function(){return this.tid=null,this.readSet=null,this.changeSet=null,this.entityManager.clear()},function(){return this.entityManager.clear()})}).then(a,b)},a.prototype.setRollbackOnly=function(a,b){return this.yield().done(function(){this.rollbackOnly=!0})},a.prototype.isRead=function(a){return this.isActive&&a in this.readSet},a.prototype.setRead=function(a,b){this.isActive&&!this.isChanged(a)&&(this.readSet[a]=b)},a.prototype.isChanged=function(a){return this.isActive&&a in this.changeSet},a.prototype.setChanged=function(a){this.isActive&&(delete this.readSet[a],this.changeSet[a]=!0)},a}();c.exports=g},{34:34,36:36}],5:[function(a,c,d){"use strict";var e=function(){function a(c,d){b.classCallCheck(this,a);var e=void 0,f=void 0;if(Object(c)instanceof String){var g=c.indexOf(";");e=c.substring(0,g),f=c.substring(g+1)}else Object(c)instanceof Number?(e=c,f=d):Object(c)instanceof Array?(e=c[0],f=c[1]):c instanceof Object?(e=c.latitude,f=c.longitude):(e=0,f=0);if(this.longitude=f,this.latitude=e,this.latitude<-90||this.latitude>90)throw new Error("Latitude "+this.latitude+" is not in bound of -90 <= latitude <= 90");if(this.longitude<-180||this.longitude>180)throw new Error("Longitude "+this.longitude+" is not in bound of -180 <= longitude <= 180")}return a.current=function(){return new Promise(function(b,c){navigator.geolocation.getCurrentPosition(function(c){b(new a(c.coords.latitude,c.coords.longitude))},function(a){c(a)})})},a.prototype.kilometersTo=function(b){return Number((a.EARTH_RADIUS_IN_KILOMETERS*this.radiansTo(b)).toFixed(3))},a.prototype.milesTo=function(b){return Number((a.EARTH_RADIUS_IN_MILES*this.radiansTo(b)).toFixed(3))},a.prototype.radiansTo=function(b){var c=this,d=b,e=c.latitude*a.DEG_TO_RAD,f=d.latitude*a.DEG_TO_RAD,g=(d.longitude-c.longitude)*a.DEG_TO_RAD;return Math.acos(Math.sin(e)*Math.sin(f)+Math.cos(e)*Math.cos(f)*Math.cos(g))},a.prototype.toString=function(){return this.latitude+";"+this.longitude},a.prototype.toJSON=function(){return{latitude:this.latitude,longitude:this.longitude}},a}();e.DEG_TO_RAD=Math.PI/180,e.EARTH_RADIUS_IN_KILOMETERS=6371,e.EARTH_RADIUS_IN_MILES=3956,c.exports=e},{}],6:[function(a,b,c){"use strict";var d=a(3),e=a(2);e.prototype.binding=a(20),e.prototype.connector=a(28),e.prototype.error=a(34),e.prototype.message=a(36),e.prototype.metamodel=a(52),e.prototype.util=a(70),e.prototype.caching=a(22),e.prototype.query=a(59),e.prototype.EntityManager=a(2),e.prototype.EntityManagerFactory=a(3),e.prototype.EntityTransaction=a(4),e.prototype.Acl=a(1);var f=new d,g=f.createEntityManager(!0);g.configure=function(a){return f.configure(a),this},g.connect=function(a,b,c,d){return b instanceof Function&&(d=c,c=b,b=void 0),f.connect(a,b),this.ready(c,d)},c=b.exports=g,c.db=g,c.default=g},{1:1,2:2,20:20,22:22,28:28,3:3,34:34,36:36,4:4,52:52,59:59,70:70}],7:[function(a,c,d){"use strict";var e=function(){function a(){b.classCallCheck(this,a)}return a.prototype.getValue=function(a,b){return a[b.name]},a.prototype.setValue=function(a,b,c){a[b.name]=c},a}();c.exports=e},{}],8:[function(a,b,c){"use strict";var d=a(11),e=d.extend({get isRegistered(){return this._db.isDeviceRegistered},register:function(a,b,c,d,e){return c instanceof Function&&(e=d,d=c,c=null),this._db.registerDevice(a,b,c).then(d,e)},push:function(a,b,c){return this._db.pushDevice(a).then(b,c)}});e.PushMessage=a(66),b.exports=e},{11:11,66:66}],9:[function(a,c,d){"use strict";var e=(a(63),a(61),function(){function a(){b.classCallCheck(this,a)}return a.prototype.createProxy=function(a){return function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c}(a)},a.prototype.getIdentifier=function(a){return a.__d__},a.prototype.setIdentifier=function(a,b){Object.defineProperty(a,"__d__",{value:b})},a.prototype.enhance=function(a,b){if(b.__ype__!=a){if(b.hasOwnProperty("__ype__"))throw new Error("Type is already used by a different manager");Object.defineProperty(b,"__ype__",{value:a}),this.setIdentifier(b,a.ref),this.enhancePrototype(b.prototype,a)}},a.prototype.enhancePrototype=function(a,b){if(a.toString===Object.prototype.toString&&Object.defineProperty(a,"toString",{value:function(){return this._metadata.id||this._metadata.bucket},enumerable:!1}),b.superType&&"Object"==b.superType.name)for(var c=b.superType.declaredAttributes,d=Array.isArray(c),e=0,c=d?c:c[Symbol.iterator]();;){var f;if(d){if(e>=c.length)break;f=c[e++]}else{if(e=c.next(),e.done)break;f=e.value}var g=f;g.isMetadata||this.enhanceProperty(a,g)}for(var h=b.declaredAttributes,i=Array.isArray(h),j=0,h=i?h:h[Symbol.iterator]();;){var k;if(i){if(j>=h.length)break;k=h[j++]}else{if(j=h.next(),j.done)break;k=j.value}var l=k;this.enhanceProperty(a,l)}},a.prototype.enhanceProperty=function(a,b){var c="$"+b.name;Object.defineProperty(a,b.name,{get:function(){var a=this._metadata;return a.readAccess(),a[c]},set:function(a){var b=this._metadata;b.writeAccess(),b[c]=a},configurable:!0,enumerable:!0})},a}());c.exports=e},{61:61,63:63}],10:[function(a,c,d){"use strict";var e=a(15),f=function(a){function c(d){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.call(this,d))}return b.inherits(c,a),c}(e);Object.defineProperties(f.prototype,{id:{get:function(){return this._metadata.id},set:function(a){if(this._metadata.id)throw new Error("The id can't be set twice: "+a);a+="",0==a.indexOf("/db/"+this._metadata.bucket+"/")?this._metadata.id=a:this.key=a},enumerable:!0},key:{get:function(){return this._metadata.key},set:function(a){this._metadata.key=a}},version:{get:function(){return this._metadata.version},enumerable:!0},acl:{get:function(){return this._metadata.acl},enumerable:!0},ready:{value:function(a){return this._metadata.ready(a)}},attach:{value:function(a){a.attach(this)}},save:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),this._metadata.db.save(this,a).then(b,c)}},insert:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),this._metadata.db.insert(this,a).then(b,c)}},update:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),this._metadata.db.update(this,a).then(b,c)}},load:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),a=a||{},a.local=!0,this._metadata.db.load(this.id,null,a).then(b,c)}},delete:{value:function(a,b,c){return a instanceof Function&&(c=b,b=a,a={}),this._metadata.db.delete(this,a).then(b,c)}},optimisticSave:{value:function(a,b,c){return this._metadata.db.optimisticSave(this,a).then(b,c)}},attr:{value:function(){throw new Error("Attr is not yet implemented.")}},validate:{value:function(){return this._metadata.db.validate(this)}},toJSON:{value:function(a){return this._metadata.getJson(a)}}}),c.exports=f},{15:15}],11:[function(a,b,c){"use strict";var d=a(16),e=d.extend({load:function(a,b,c,d){return b instanceof Function&&(d=c,c=b,b={}),this._db.load(this._managedType.typeConstructor,a,b).then(c,d)},fromJSON:function(a){var b=a.id?this._db.getReference(this._managedType.typeConstructor,a.id):this.newInstance(),c=b._metadata;return c.setJson(a),b},find:function(){return this._db.createQueryBuilder(this._managedType.typeConstructor)},partialUpdate:function(){throw new Error("partialUpdate is not yet implemented.")}});b.exports=e},{16:16}],12:[function(a,b,c){"use strict";function d(a){for(var b,c=1;b=arguments[c];++c)for(var d=Object.getOwnPropertyNames(b),e=Array.isArray(d),f=0,d=e?d:d[Symbol.iterator]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;Object.defineProperty(a,h,Object.getOwnPropertyDescriptor(b,h))}return a}var e=d({extend:function(a){return d({},this,a)},create:function(a){var b=function(a){return b.newInstance(arguments)};return d(b,this),b.prototype=a.prototype,b._type=a,b},new:function(){return this.newInstance(arguments)},newInstance:function(a){var b;return b=a&&0!=a.length?new this._type(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]):new this._type}});b.exports=e},{}],13:[function(a,c,d){"use strict";var e=a(34),f=a(1),g=a(71),h=a(36),i=a(25).StatusCode,j="/file",k=j.length,l=function(){function a(c){if(b.classCallCheck(this,a),c=c||{},this._available=!1,Object(c)instanceof String){var d=c,e=d.indexOf("/","/file/".length);if(e==-1||0!=d.indexOf("/file/"))throw new Error("Invalid file reference "+d);this._id=d}else if(c.id)this._id=c.id,this._setMetadata(c);else{var f=void 0;if(c.path)f=c.path;else{var h=c.parent||"/www";if("/"!=h.charAt(h.length-1)&&(h+="/"),h.length<3)throw new Error("Invalid parent name: "+h);var i=c.name||c.data&&c.data.name||g.uuid();f=h+i}if("/"!=f.charAt(0)&&(f="/"+f),f.indexOf("//")!=-1||f.length<3)throw new Error("Invalid path: "+f);this._id=j+f,this._setMetadata(c)}this.isFolder="/"==this._id.charAt(this._id.length-1)}return b.createClass(a,[{key:"id",get:function(){return this._id}},{key:"url",get:function(){if(this.isFolder)throw new Error("Url can not be created for folders.");return this._url||(this._url=this._db.createURL(this.id,"www"!=this.bucket)),this._url}},{key:"name",get:function(){return this._name||(this._name=this._id.substring(this._id.lastIndexOf("/",this._id.length-2)+1)),this._name}},{key:"mimeType",get:function(){if(this.isFolder)throw new Error("A folder has no mimeType");return this._checkAvailable(),this._mimeType}},{key:"acl",get:function(){return this._checkAvailable(),this._acl}},{key:"lastModified",get:function(){if(this.isFolder)throw new Error("A folder has no lastModified");return this._checkAvailable(),this._lastModified}},{key:"eTag",get:function(){if(this.isFolder)throw new Error("A folder has no eTag");return this._checkAvailable(),this._eTag}},{key:"size",get:function(){if(this.isFolder)throw new Error("A folder has no size");return this._checkAvailable(),this._size}},{key:"bucket",get:function(){return this.id.substring(k+1,this.id.indexOf("/",k+1))}},{key:"key",get:function(){return this.id.substring(this.id.indexOf("/",k+1)+1)}},{key:"path",get:function(){return this.id.substring(k)}},{key:"parent",get:function(){return this.id.substring(k,this.id.lastIndexOf("/",this.id.length-2))}},{key:"isMetadataLoaded",get:function(){return this._available}}]),a.prototype.upload=function(a,b,c){var d=this;if(a=a||{},this.isFolder)throw new Error("A folder cannot be uploaded");this._setMetadata(a);var e=new h.UploadFile(this.bucket,this.key).entity(this._data,this._type).acl(this._acl);return e.progress(a.progress),this._size&&e.contentLength(this._size),this._mimeType&&e.mimeType(this._mimeType),this._conditional(e,a),this._db.addToBlackList(this.id),this._db.send(e).then(function(a){return d._data=null,d._type=null,d.fromJSON(a.entity),d}).then(b,c)},a.prototype.download=function(a,b,c){var d=this;if(a=a||{},this.isFolder)throw new Error("A folder cannot be downloaded");var e=a.type||"blob",f=new h.DownloadFile(this.bucket,this.key).responseType(e);return this._db.ensureCacheHeader(this.id,f,a.refresh),this._db.send(f).then(function(a){return d._db.addToWhiteList(d.id),d._fromHeaders(a.headers),a.entity},function(a){if(a.status==i.OBJECT_NOT_FOUND)return null;throw a}).then(b,c)},a.prototype.delete=function(a,b,c){if(a=a||{},this.isFolder)throw new Error("A folder cannot be deleted");var d=new h.DeleteFile(this.bucket,this.key);return this._conditional(d,a),this._db.addToBlackList(this.id),this._db.send(d).then(function(){return this}).then(b,c)},a.prototype._conditional=function(a,b){b.force||(this._lastModified&&a.ifUnmodifiedSince(this._lastModified),this._eTag&&a.ifMatch(this._eTag),this._lastModified||this._eTag||a.ifNoneMatch("*"))},a.prototype.loadMetadata=function(a,b,c){var d=this;if(a=a||{},this.isFolder)throw new Error("A folder has no matadata");var e=new h.GetFileMetadata(this.bucket,this.key);return this._db.ensureCacheHeader(this.id,e,a.refresh),this._db.send(e).then(function(a){return d._fromHeaders(a.headers),d},function(a){if(a.status==i.OBJECT_NOT_FOUND)return null;throw a}).then(b,c)},a.prototype.saveMetadata=function(a,b,c){var d=this;a=a||{};var e=this.toJSON();e.id=this._id;var f=new h.UpdateFileMetadata(this.bucket,this.key).entity(e); +return this._conditional(f,a),this._db.send(f).then(function(a){return d.fromJSON(a),d})},a.prototype._setMetadata=function(a){var b=a.data,c=a.type,d=a.eTag,e=a.acl,g=a.size,h=a.mimeType,i=a.lastModified;if(b){if("undefined"!=typeof Blob&&b instanceof Blob)h=h||b.type;else if("data-url"==c){var j=b.match(/^data:(.+?)(;base64)?,.*$/);h=h||j[1]}this._data=b,this._type=c,this._size=g,this._mimeType=h,this._acl=e||this._acl||new f,this._available=!0}else this._available=!1;this._eTag=d||this._eTag,i&&(this._lastModified=new Date(i))},a.prototype._fromHeaders=function(a){this.fromJSON({eTag:a.etag?a.etag.substring(1,a.etag.length-1):null,lastModified:a["last-modified"],mimeType:a["content-type"],acl:a["baqend-acl"]&&JSON.parse(a["baqend-acl"]),contentLength:+a["baqend-size"]})},a.prototype.fromJSON=function(a){a.mimeType&&(this._mimeType=a.mimeType),a.lastModified&&(this._lastModified=new Date(a.lastModified)),a.eTag&&(this._eTag=a.eTag),this._acl=this._acl||new f,a.acl&&this._acl.fromJSON(a.acl),a.contentLength&&(this._size=a.contentLength),this._available=!0},a.prototype.toJSON=function(){var a={mimeType:this._mimeType,eTag:this._eTag,acl:this._acl,contentLength:this._size};return this._lastModified&&(a.lastModified=this._lastModified.toISOString()),a},a.prototype._checkAvailable=function(){if(!this._available)throw new e.PersistentError("The file metadata of "+this.id+" is not available.")},a}();c.exports=l},{1:1,25:25,34:34,36:36,71:71}],14:[function(a,b,c){"use strict";var d=a(12),e=a(13),f=a(36),g=a(65),h=d.extend({create:function(a){var b=d.create.call(this,e);return b._db=a,b},newInstance:function(a){var b=d.newInstance.call(this,a);return b._db=this._db,b},saveMetadata:function(a,b,c,d){var e=new f.SetFileBucketMetadata(a,b);return this._db.send(e).then(c,d)},loadMetadata:function(a,b,c,d){b=b||{};var e=new f.GetFileBucketMetadata(a);return this._db.send(e).then(function(a){var b={};return g.BASE_PERMISSIONS.forEach(function(c){b[c]=g.fromJSON(a.entity[c]||{})}),b},function(a){if(a.status==StatusCode.OBJECT_NOT_FOUND)return null;throw a}).then(c,d)},listBuckets:function(a,b){var c=this;return this._db.send(new f.ListBuckets).then(function(a){return a.entity.map(function(a){return c.new(a+"/")})}).then(a,b)},listFiles:function(a,b,c,d,e){var g=this;Object(a)instanceof String&&("/"!=a.charAt(a.length-1)&&(a+="/"),a=this.new({path:a}));var h=a.key,i=a.bucket;return b=b?b.key:null,this._db.send(new f.ListFiles(i,h,b,c)).then(function(a){return a.entity.map(function(a){return g.new(a)})}).then(d,e)}});b.exports=h},{12:12,13:13,36:36,65:65}],15:[function(a,c,d){"use strict";var e=a(63),f=function(){function a(c){b.classCallCheck(this,a),a.init(this,c)}return a.init=function(a,b){var c=a.constructor.__ype__;c&&Object.defineProperty(a,"_metadata",{value:e.create(c,a),configurable:!0}),b&&Object.assign(a,b)},a.extend=function(b){return b.prototype=Object.create(this.prototype,{constructor:{value:b,configurable:!0,writable:!0}}),b.extend=a.extend,b},a}();Object.defineProperties(f.prototype,{toJSON:{value:function(){return this._metadata.type.toJsonValue(this._metadata,this)}}}),c.exports=f},{63:63}],16:[function(a,b,c){"use strict";var d=a(12),e=(a(15),d.extend({create:function(a,b){var c=d.create.call(this,a.typeConstructor);return c.methods=c.prototype,c._managedType=a,c._db=b,c},newInstance:function(a){var b=a?d.newInstance.call(this,a):this._managedType.create(a);return b._metadata.db=this._db,b},fromJSON:function(a){var b=this.newInstance(),c=b._metadata;return this._managedType.fromJsonValue(c,a,b),b},addMethods:function(a){Object.assign(this.methods,a)},addMethod:function(a,b){this.methods[a]=b}}));b.exports=e},{12:12,15:15}],17:[function(a,c,d){"use strict";var e=a(10),f=a(18),g=function(a){function c(d){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.call(this,d))}return b.inherits(c,a),c}(e);Object.defineProperties(g.prototype,{hasUser:{value:function(a){return this.users&&this.users.has(a)}},addUser:{value:function(a){if(!(a instanceof f))throw new Error("Only user instances can be added to a role.");this.users||(this.users=new Set),this.users.add(a)}},removeUser:{value:function(a){if(!(a instanceof f))throw new Error("Only user instances can be removed from a role.");this.users&&this.users.delete(a)}}}),c.exports=g},{10:10,18:18}],18:[function(a,c,d){"use strict";var e=a(10),f=function(a){function c(d){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.call(this,d))}return b.inherits(c,a),c}(e);Object.defineProperties(f.prototype,{newPassword:{value:function(a,b,c,d){return this._metadata.db.newPassword(this.username,a,b).then(c,d)}}}),c.exports=f},{10:10}],19:[function(a,b,c){"use strict";var d=a(11),e=d.extend({get me(){return this._db.me},register:function(a,b,c,d,e){return c instanceof Function&&(e=d,d=c,c=!0),a=Object(a)instanceof String?this.fromJSON({username:a}):a,this._db.register(a,b,void 0===c||c).then(d,e)},login:function(a,b,c,d,e){return c instanceof Function&&(e=d,d=c,c=!0),this._db.login(a,b,void 0===c||c).then(d,e)},logout:function(a,b){return this._db.logout().then(a,b)},newPassword:function(a,b,c,d,e){return this._db.newPassword(a,b,c).then(d,e)}});e.LoginOption={NO_LOGIN:-1,SESSION_LOGIN:0,PERSIST_LOGIN:1},e.DefaultOptions={google:{width:585,height:545,scope:"email"},facebook:{width:1140,height:640,scope:"email"},github:{width:1040,height:580,scope:"user:email"},twitter:{width:740,height:730},linkedin:{width:630,height:530,scope:""}},["Google","Facebook","GitHub","Twitter","LinkedIn"].forEach(function(a){e["loginWith"+a]=function(b,c,d,f){return c instanceof Function&&(f=d,d=c,c={}),c=Object.assign({},e.DefaultOptions[a.toLowerCase()],c||{}),this._db.loginWithOAuth(a,b,c).then(d,f)}}),b.exports=e},{11:11}],20:[function(a,b,c){"use strict";c.Accessor=a(7),c.Enhancer=a(9),c.Factory=a(12),c.ManagedFactory=a(16),c.EntityFactory=a(11),c.UserFactory=a(19),c.DeviceFactory=a(8),c.FileFactory=a(14),c.Managed=a(15),c.Entity=a(10),c.Role=a(17),c.User=a(18),c.File=a(13)},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18,19:19,7:7,8:8,9:9}],21:[function(a,c,d){"use strict";var e=a(70).atob,f=function(){function a(c){b.classCallCheck(this,a),this.bytes=e(c.b),this.bits=c.m,this.hashes=c.h,this.creation=(new Date).getTime()}return a.prototype.contains=function(b){for(var c=a._getHashes(b,this.bits,this.hashes),d=Array.isArray(c),e=0,c=d?c:c[Symbol.iterator]();;){var f;if(d){if(e>=c.length)break;f=c[e++]}else{if(e=c.next(),e.done)break;f=e.value}var g=f;if(!this._isSet(g))return!1}return!0},a.prototype._isSet=function(a){var b=Math.floor(a/8),c=1<>>16)*g&65535)<<16)&4294967295,i=i<<15|i>>>17,i=(65535&i)*h+(((i>>>16)*h&65535)<<16)&4294967295,e^=i,e=e<<13|e>>>19,f=5*(65535&e)+((5*(e>>>16)&65535)<<16)&4294967295,e=(65535&f)+27492+(((f>>>16)+58964&65535)<<16);switch(i=0,c){case 3:i^=(255&b.charCodeAt(j+2))<<16;case 2:i^=(255&b.charCodeAt(j+1))<<8;case 1:i^=255&b.charCodeAt(j),i=(65535&i)*g+(((i>>>16)*g&65535)<<16)&4294967295,i=i<<15|i>>>17,i=(65535&i)*h+(((i>>>16)*h&65535)<<16)&4294967295,e^=i}return e^=b.length,e^=e>>>16,e=2246822507*(65535&e)+((2246822507*(e>>>16)&65535)<<16)&4294967295,e^=e>>>13,e=3266489909*(65535&e)+((3266489909*(e>>>16)&65535)<<16)&4294967295,e^=e>>>16,e>>>0},a}();c.exports=f},{70:70}],22:[function(a,b,c){"use strict";c.BloomFilter=a(21)},{21:21}],23:[function(a,c,d){"use strict";var e=a(32),f=(a(36),function(){function a(c,d,e,f){b.classCallCheck(this,a),this.host=c,this.port=d,this.secure=e,this.basePath=f,this.origin=a.toUri(c,d,e,"")}return a.create=function(b,c,d,e){if("undefined"!=typeof window&&(b||(b=window.location.hostname,c=Number(window.location.port)),void 0===d&&(d="https:"==window.location.protocol)),d=!!d,void 0===e&&(e=a.DEFAULT_BASE_PATH),b.indexOf("/")!=-1){var f=/^(https?):\/\/([^\/:]+|\[[^\]]+])(:(\d*))?(\/\w+)?\/?$/.exec(b);if(!f)throw new Error("The connection uri host "+b+" seems not to be valid");d="https"==f[1],b=f[2].replace(/(\[|])/g,""),c=f[4],e=f[5]||""}else"localhost"!=b&&/^[a-z0-9-]*$/.test(b)&&(b+=d?a.SSL_DOMAIN:a.HTTP_DOMAIN);c||(c=d?443:80);var g=a.toUri(b,c,d,e),h=this.connections[g];if(!h){for(var i in this.connectors){var j=this.connectors[i];if(j.isUsable&&j.isUsable(b,c,d,e)){h=new j(b,c,d,e);break}}if(!h)throw new Error("No connector is usable for the requested connection.");this.connections[g]=h}return h},a.toUri=function(a,b,c,d){var e=(c?"https://":"http://")+(a.indexOf(":")!=-1?"["+a+"]":a);return e+=c&&443!=b||!c&&80!=b?":"+b:"",e+=d},a.prototype.send=function(a){var b=this;"OAUTH"==a.request.method&&a.addRedirectOrigin(this.origin+this.basePath);var c={status:0};return new Promise(function(c){b.prepareRequest(a),b.doSend(a,a.request,c)}).then(function(a){return c=a}).then(function(){return b.prepareResponse(a,c)}).then(function(){return a.doReceive(c),c}).catch(function(a){throw c.entity=null,e.of(a)})},a.prototype.doSend=function(a,b,c){},a.prototype.prepareRequest=function(a){var b=a.mimeType();if(!b){var c=a.request.type;"json"==c?a.mimeType("application/json;charset=utf-8"):"text"==c&&a.mimeType("text/plain;charset=utf-8")}this.toFormat(a);var d=void 0;switch(a.responseType()){case"json":d="application/json";break;case"text":d="text/*";break;default:d="application/json,text/*;q=0.5,*/*;q=0.1"}if(a.accept()||a.accept(d),this.gzip){var e=a.ifNoneMatch();e&&'""'!==e&&"*"!=e&&a.ifNoneMatch(e.slice(0,-1)+'--gzip"')}if("/connect"==a.request.path)a.request.path=a.tokenStorage.signPath(this.basePath+a.request.path).substring(this.basePath.length),a.cacheControl()&&(a.request.path+=(a.tokenStorage.token?"&":"?")+"BCB");else if(a.tokenStorage){var f=a.tokenStorage.token;f&&a.header("authorization","BAT "+f)}},a.prototype.toFormat=function(a){},a.prototype.prepareResponse=function(a,b){var c=this;b.status=1223==b.status?204:b.status;var d=void 0,e=b.headers||{},f=b.entity;if(f&&(d=a.responseType(),!d||b.status>=400)){var g=e["content-type"]||e["Content-Type"];g&&g.indexOf("application/json")>-1&&(d="json")}if(e.etag&&(e.etag=e.etag.replace("--gzip","")),a.tokenStorage){var h=e["baqend-authorization-token"]||e["Baqend-Authorization-Token"];h&&a.tokenStorage.update(h)}return new Promise(function(a){a(f&&c.fromFormat(b,f,d))}).then(function(d){b.entity=d,a.request.path.indexOf("/connect")!=-1&&d&&(c.gzip=!!d.gzip)},function(a){throw new Error("Response was not valid "+d+": "+a.message)})},a.prototype.fromFormat=function(a,b,c){},a}());Object.assign(f,{DEFAULT_BASE_PATH:"/v1",HTTP_DOMAIN:".app.baqend.com",SSL_DOMAIN:"-bq.global.ssl.fastly.net",RESPONSE_HEADERS:["baqend-authorization-token","content-type","baqend-size","baqend-acl","etag","last-modified"],connectors:[],connections:{},gzip:!1}),c.exports=f},{32:32,36:36}],24:[function(a,c,d){"use strict";var e=a(23),f=a(27),g=function(a){function c(d,e,f,g){b.classCallCheck(this,c);var h=b.possibleConstructorReturn(this,a.call(this,d,e,f,g));return h.mid=0,h.messages={},h.doReceive=h.doReceive.bind(h),addEventListener("message",h.doReceive,!1),h}return b.inherits(c,a),c.isUsable=function(a,b,c){return"undefined"!=typeof window},c.prototype.load=function(a){this.iframe=document.createElement("iframe"),this.iframe.src=this.origin+this.basePath+a,this.iframe.setAttribute("style",c.style),document.body.appendChild(this.iframe),this.queue=[],this.iframe.addEventListener("load",this.onLoad.bind(this),!1)},c.prototype.onLoad=function(){for(var a=this.queue,b=0;b=400&&(g="json"),"stream"==g)return void c({status:e,headers:a.headers,entity:a});var f=g&&"text"!=g&&"json"!=g,h=[];f||a.setEncoding("utf-8"),a.on("data",function(a){h.push(a)}),a.on("end",function(){c({status:e,headers:a.headers,entity:f?Buffer.concat(h):h.join("")})})});h.on("error",function(a){c({status:0,error:a})}),"stream"==f?e.pipe(h):"buffer"==f?h.end(e):f?h.end(e,"utf8"):h.end()},d.prototype.parseCookie=function(a){for(var b,c=a.split(";"),d=0;b=c[d];++d)if(0==b.indexOf("Expires=")){var e=Date.parse(b.substring(8));if(e=400&&(g.responseType="text"),4==g.readyState){var a={headers:{},status:g.status,entity:g.response||g.responseText};e.RESPONSE_HEADERS.forEach(function(b){a.headers[b]=g.getResponseHeader(b)}),c(a)}},g.upload.onprogress=a.progress(),g.open(b.method,h,!0);var i=b.entity,j=b.headers;for(var k in j)g.setRequestHeader(k,j[k]);switch(g.withCredentials=a.withCredentials,a.responseType()){case"arraybuffer":g.responseType="arraybuffer";break;case"blob":case"data-url":case"base64":g.responseType="blob"}g.send(i)},c.prototype.fromFormat=function(a,c,d){if("json"==d)c=JSON.parse(c);else if("data-url"==d||"base64"==d){var e=function(){var a=new FileReader;return a.readAsDataURL(c),{v:new Promise(function(b,c){a.onload=b,a.onerror=c}).then(function(){var b=a.result;return"base64"==d&&(b=b.substring(b.indexOf(",")+1)),b})}}();if("object"===("undefined"==typeof e?"undefined":b.typeof(e)))return e.v}return c},c.prototype.toFormat=function(a){var b=a.request.type;if(b){var c=a.request.entity,d=a.mimeType();switch(b){case"blob":d=d||c.type;break;case"arraybuffer":case"form":break;case"data-url":var e=c.match(/^data:(.+?)(;base64)?,(.*)$/),f=e[2];if(c=e[3],b="blob",d=d||e[1],!f){c=decodeURIComponent(c);break}case"base64":for(var g=atob(c),h=g.length,i=new Uint8Array(h),j=0;ja.PersistentAttributeType.EMBEDDED}},{key:"isCollection",get:function(){return this.persistentAttributeType==a.PersistentAttributeType.ELEMENT_COLLECTION}}]),a.prototype.init=function(a,b){if(this.declaringType)throw new Error("The attribute is already initialized.");this.order=b,this.accessor=new e,this.declaringType=a},a.prototype.getValue=function(a){return this.accessor.getValue(a,this)},a.prototype.setValue=function(a,b){this.accessor.setValue(a,this,b)},a.prototype.getJsonValue=function(a,b){},a.prototype.setJsonValue=function(a,b,c){},a.prototype.toJSON=function(){},a}();f.PersistentAttributeType={BASIC:0,ELEMENT_COLLECTION:1,EMBEDDED:2,MANY_TO_MANY:3,MANY_TO_ONE:4,ONE_TO_MANY:5,ONE_TO_ONE:6},c.exports=f},{7:7}],38:[function(a,c,d){"use strict";function e(a){return a instanceof Date?a.toISOString().replace(/\.?0*Z/,"Z"):null}function f(a,b){var c="string"==typeof a?new Date(a):null;return b&&c&&b.toISOString()==c.toISOString()?b:c}var g=a(51),h=a(5),i=function(a){function c(d,e,f){b.classCallCheck(this,c),0!=d.indexOf("/db/")&&(d="/db/"+d);var g=b.possibleConstructorReturn(this,a.call(this,d,e));return g.noResolving=f,g}return b.inherits(c,a),b.createClass(c,[{key:"persistenceType",get:function(){return g.PersistenceType.BASIC}}]),c.prototype.toJsonValue=function(a,b){return null===b||void 0===b?null:this.typeConstructor(b)},c.prototype.fromJsonValue=function(a,b,c){return null===b||void 0===b?null:b},c.prototype.toString=function(){return"BasicType("+this.ref+")"},c}(g);Object.assign(i,{Boolean:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.fromJsonValue=function(b,c,d){return"string"==typeof c?"false"!==c:a.prototype.fromJsonValue.call(this,b,c,d)},c}(i))("Boolean",Boolean),Double:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.fromJsonValue=function(b,c,d){return"string"==typeof c?parseFloat(c):a.prototype.fromJsonValue.call(this,b,c,d)},c}(i))("Double",Number),Integer:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.fromJsonValue=function(b,c,d){return"string"==typeof c?parseInt(c):a.prototype.fromJsonValue.call(this,b,c,d)},c}(i))("Integer",Number),String:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c}(i))("String",String),DateTime:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.toJsonValue=function(a,b){return e(b)},c.prototype.fromJsonValue=function(a,b,c){return f(b,c)},c}(i))("DateTime",Date),Date:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.toJsonValue=function(a,b){var c=e(b);return c?c.substring(0,c.indexOf("T")):null},c.prototype.fromJsonValue=function(a,b,c){return f(b,c)},c}(i))("Date",Date),Time:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.toJsonValue=function(a,b){var c=e(b);return c?c.substring(c.indexOf("T")+1):null},c.prototype.fromJsonValue=function(a,b,c){return"string"==typeof b?f("1970-01-01T"+b,c):b},c}(i))("Time",Date),GeoPoint:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.toJsonValue=function(a,b){return b instanceof h?b:null},c.prototype.fromJsonValue=function(a,b){return b?new h(b):null},c}(i))("GeoPoint",h),JsonArray:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.init=function(a){this._enhancer=a},c.prototype.toJsonValue=function(a,b){return Array.isArray(b)?b:null},c.prototype.fromJsonValue=function(a,b){return Array.isArray(b)?b:null},c}(i))("JsonArray",Array),JsonObject:new(function(a){function c(){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.apply(this,arguments))}return b.inherits(c,a),c.prototype.init=function(a){this._enhancer=a},c.prototype.toJsonValue=function(a,b){return b&&b.constructor==Object?b:null},c}(i))("JsonObject",Object)}),c.exports=i},{5:5,51:51}],39:[function(a,c,d){"use strict";var e=a(48),f=function(a){function c(d,e){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this,d,e));return f.typeConstructor=null,f}return b.inherits(c,a),b.createClass(c,[{key:"collectionType",get:function(){return e.CollectionType.COLLECTION}}]),c}(e);c.exports=f},{48:48}],40:[function(a,c,d){"use strict";var e=function(){function a(c,d){if(b.classCallCheck(this,a),Object(c)instanceof String){var e={};e[c]=a.ASC,this.keys=[e]}else if(Object(c)instanceof Array)this.keys=c;else{if(!c)throw new Error("The keys parameter must be an String, Object or Array.");this.keys=[c]}this.drop=!1,this.unique=d===!0}return a.prototype.hasKey=function(a){for(var b=0;b1}},{key:"isUnique",get:function(){return this.unique}}]),a}();Object.assign(e,{ASC:"asc",DESC:"desc",GEO:"geo",fromJSON:function(a){return new e(a.keys,a.unique)}}),c.exports=e},{}],41:[function(a,c,d){"use strict";var e=a(44),f=a(51),g=a(20),h=function(a){function c(d,e){return b.classCallCheck(this,c),b.possibleConstructorReturn(this,a.call(this,d,e))}return b.inherits(c,a),b.createClass(c,[{key:"persistenceType",get:function(){return f.PersistenceType.EMBEDDABLE}}]),c.prototype.createProxyClass=function(){return this._enhancer.createProxy(g.Managed)},c.prototype.createObjectFactory=function(a){return g.ManagedFactory.create(this,a)},c.prototype.toJsonValue=function(b,c){return b._root&&c instanceof this.typeConstructor&&!c._metadata._root&&(c._metadata._root=b._root),a.prototype.toJsonValue.call(this,b,c)},c.prototype.fromJsonValue=function(b,c,d){return c&&(d instanceof this.typeConstructor||(d=this.create()),b._root&&!d._metadata._root&&(d._metadata._root=b._root)),a.prototype.fromJsonValue.call(this,b,c,d)},c.prototype.toString=function(){return"EmbeddableType("+this.ref+")"},c}(e);c.exports=h},{20:20,44:44,51:51}],42:[function(a,c,d){"use strict";var e=a(20),f=a(50),g=a(38),h=a(51),i=a(44),j=a(70),k=function(a){function c(d,e,f){b.classCallCheck(this,c);var g=b.possibleConstructorReturn(this,a.call(this,d,f));return g.declaredId=null,g.declaredVersion=null,g.declaredAcl=null,g.superType=e,g.loadPermission=new j.Permission,g.updatePermission=new j.Permission,g.deletePermission=new j.Permission,g.queryPermission=new j.Permission,g.schemaSubclassPermission=new j.Permission,g.insertPermission=new j.Permission,g}return b.inherits(c,a),b.createClass(c,[{key:"persistenceType",get:function(){return h.PersistenceType.ENTITY}},{key:"id",get:function(){return this.declaredId||this.superType.id}},{key:"version",get:function(){return this.declaredVersion||this.superType.version}},{key:"acl",get:function(){return this.declaredAcl||this.superType.acl}}]),c.prototype.createProxyClass=function(){var a=this.superType.typeConstructor;if(a===Object)switch(this.name){case"User":a=e.User;break;case"Role":a=e.Role;break;default:a=e.Entity}return this._enhancer.createProxy(a)},c.prototype.createObjectFactory=function(a){switch(this.name){case"User":return e.UserFactory.create(this,a);case"Device":return e.DeviceFactory.create(this,a);case"Object":return}return e.EntityFactory.create(this,a)},c.prototype.fromJsonValue=function(b,c,d,e){return e?a.prototype.fromJsonValue.call(this,b,c,d):c?b.db.getReference(c):null},c.prototype.toJsonValue=function(b,c,d){return d?a.prototype.toJsonValue.call(this,b,c):c instanceof this.typeConstructor?(c.attach(b.db),c.id):null},c.prototype.toString=function(){return"EntityType("+this.ref+")"},c.prototype.toJSON=function(){var b=a.prototype.toJSON.call(this);return b.acl.schemaSubclass=this.schemaSubclassPermission,b.acl.insert=this.insertPermission,b.acl.update=this.updatePermission,b.acl.delete=this.deletePermission,b.acl.query=this.queryPermission,b},c}(i),l=function(a){function c(){b.classCallCheck(this,c);var d=b.possibleConstructorReturn(this,a.call(this,k.Object.ref,null,Object));return d.declaredId=new f("id",g.String,!0),d.declaredId.init(d,0),d.declaredId.isId=!0,d.declaredVersion=new f("version",g.Double,!0),d.declaredVersion.init(d,1),d.declaredVersion.isVersion=!0,d.declaredAcl=new f("acl",g.JsonObject,!0),d.declaredAcl.init(d,2),d.declaredAcl.isAcl=!0,d.declaredAttributes=[d.declaredId,d.declaredVersion,d.declaredAcl],d}return b.inherits(c,a),b.createClass(c,null,[{key:"ref",get:function(){return"/db/Object"}}]),c}(k);k.Object=l,c.exports=k},{20:20,38:38,44:44,50:50,51:51,70:70}],43:[function(a,c,d){"use strict";var e=a(48),f=function(a){function c(d,e){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this,d,e));return f.typeConstructor=Array,f}return b.inherits(c,a),b.createClass(c,[{key:"collectionType",get:function(){return e.CollectionType.LIST}}],[{key:"ref",get:function(){return"/db/collection.List"}}]),c.prototype.getJsonValue=function(a,b){var c=this.getValue(b);if(c instanceof this.typeConstructor){for(var d=c.length,e=new Array(d),f=c.__persistedState__||[],g=!c.__persistedState__||f.length!=d,h=new Array(d),i=0;i=b.length)break;e=b[d++]}else{if(d=b.next(),d.done)break;e=d.value}var f=e;if(f.name===a||f.order===a)return f}return null},c.prototype.fromJsonValue=function(a,b,c){if(b)for(var d=this.attributes(),e=Array.isArray(d),f=0,d=e?d:d[Symbol.iterator]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;h.isMetadata||h.setJsonValue(a,c,b[h.name])}else c=null;return c},c.prototype.toJsonValue=function(a,b){var c=null;if(b instanceof this.typeConstructor){c={};for(var d=this.attributes(),e=Array.isArray(d),f=0,d=e?d:d[Symbol.iterator]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;h.isMetadata||(c[h.name]=h.getJsonValue(a,b))}}return c},c.prototype.toJSON=function(){var a={};a.class=this.ref,this.superType&&(a.superClass=this.superType.ref),this.isEmbeddable&&(a.embedded=!0),a.acl={load:this.loadPermission,schemaAdd:this.schemaAddPermission,schemaReplace:this.schemaReplacePermission};for(var b=a.fields={},c=this.declaredAttributes,d=Array.isArray(c),e=0,c=d?c:c[Symbol.iterator]();;){var f;if(d){if(e>=c.length)break;f=c[e++]}else{if(e=c.next(),e.done)break;f=e.value}var g=f;g.isMetadata||(b[g.name]=g)}return a},c.prototype.references=function(){var a,b=this.attributes(),c=[];return a={},a[Symbol.iterator]=function(){return this},a.next=function(){for(var a=b,d=Array.isArray(a),e=0,a=d?a:a[Symbol.iterator]();;){var f;if(d){if(e>=a.length)break;f=a[e++]}else{if(e=a.next(),e.done)break;f=e.value}var g=f,h=g.isCollection?g.elementType:g.type;if(h.isEntity)return{done:!1,value:{path:[g.name]}};if(h.isEmbeddable)for(var i=h.references(),j=Array.isArray(i),k=0,i=j?i:i[Symbol.iterator]();;){var l;if(j){if(k>=i.length)break;l=i[k++]}else{if(k=i.next(),k.done)break;l=k.value}var m=l;c.push({done:!1,value:{path:[g.name].concat(m.path)}})}}return c.length?c.pop():{done:!0}},a},c}(e);c.exports=i},{20:20,51:51,65:65,69:69}],45:[function(a,c,d){"use strict";var e=a(48),f=a(32),g=function(a){function c(d,e,f){b.classCallCheck(this,c);var g=b.possibleConstructorReturn(this,a.call(this,d,f));return g.keyType=e,g.typeConstructor=Map,g}return b.inherits(c,a),b.createClass(c,[{key:"collectionType",get:function(){return e.CollectionType.MAP}}],[{key:"ref",get:function(){return"/db/collection.Map"}}]),c.prototype.getJsonValue=function(a,b){var c=this.getValue(b);if(c instanceof this.typeConstructor){for(var d={},e=c.__persistedState__||{},g=!c.__persistedState__||c.__persistedSize__!==c.size,h={},i=c.entries(),j=Array.isArray(i),k=0,i=j?i:i[Symbol.iterator]();;){var l;if(j){if(k>=i.length)break;l=i[k++]}else{if(k=i.next(),k.done)break;l=k.value}var m=l;if(null===m[0]||void 0===m[0])throw new f("Map keys can't be null nor undefined.");var n=this.keyType.toJsonValue(a,m[0]);h[n]=this.elementType.toJsonValue(a,m[1]),d[n]=[m[0],m[1]],g|=(e[n]||[])[1]!==m[1]}return a.persisting&&Object.defineProperties(c,{__persistedState__:{value:d,configurable:!0},__persistedSize__:{value:c.size,configurable:!0}}),a.isPersistent&&g&&a.setDirty(),h}return null},c.prototype.setJsonValue=function(a,b,c){var d=null;if(c){d=this.getValue(b),d instanceof this.typeConstructor||(d=new this.typeConstructor);var e={},f=d.__persistedState__||{};d.clear();for(var g in c){var h=f[g]||[],i=this.keyType.fromJsonValue(a,g,h[0]),j=this.elementType.fromJsonValue(a,c[g],h[1]);e[g]=[i,j],d.set(i,j)}a.persisting&&Object.defineProperties(d,{__persistedState__:{value:e,configurable:!0},__persistedSize__:{value:d.size,configurable:!0}})}this.setValue(b,d)},c.prototype.toJSON=function(){return{name:this.name,type:c.ref+"["+this.keyType.ref+","+this.elementType.ref+"]",order:this.order}},c}(e);c.exports=g},{32:32,48:48}],46:[function(a,c,d){"use strict";var e=(a(38),a(44)),f=a(42),g=a(9),h=a(47),i=a(40),j=a(61),k=a(25).StatusCode,l=a(36),m=function(a){function c(d){b.classCallCheck(this,c);var e=b.possibleConstructorReturn(this,a.call(this));return e.isInitialized=!1,e.entityManagerFactory=d,e.entities=null,e.embeddables=null,e.baseTypes=null,e._enhancer=new g,e}return b.inherits(c,a),c.prototype.init=function(a){if(this.isInitialized)throw new Error("Metamodel is already initialized.");this.fromJSON(a||[]),this.isInitialized=!0},c.prototype._getRef=function(a){var b;return Object(a)instanceof String?(b=a,0!=b.indexOf("/db/")&&(b="/db/"+a)):b=this._enhancer.getIdentifier(a),b},c.prototype.entity=function(a){var b=this._getRef(a);return b?this.entities[b]:null},c.prototype.baseType=function(a){var b=null;if(Object(a)instanceof String)b=this._getRef(a);else for(var c in this.baseTypes){var d=this.baseTypes[c];if(!d.noResolving&&d.typeConstructor==a){b=c;break}}return b?this.baseTypes[b]:null},c.prototype.embeddable=function(a){var b=this._getRef(a);return b?this.embeddables[b]:null},c.prototype.managedType=function(a){return this.baseType(a)||this.entity(a)||this.embeddable(a)},c.prototype.addType=function(a){var b;if(a.isBasic?b=this.baseTypes:a.isEmbeddable?(a.init(this._enhancer),b=this.embeddables):a.isEntity&&(a.init(this._enhancer),b=this.entities,null==a.superType&&a.ref!=f.Object.ref&&(a.superType=this.entity(f.Object.ref))),b[a.ref])throw new Error("The type "+a.ref+" is already declared.");return b[a.ref]=a},c.prototype.load=function(){var a=this;if(this.isInitialized)throw new Error("Metamodel is already initialized.");return this.withLock(function(){var b=new l.GetAllSchemas;return a.entityManagerFactory.send(b).then(function(b){return a.init(b.entity),a})})},c.prototype.save=function(a){var b=this;return this._send(a||this.toJSON()).then(function(){return b})},c.prototype.update=function(a){var b=this;return this._send(a).then(function(a){return b.fromJSON(a.entity),b})},c.prototype._send=function(a){var b=this;if(!this.isInitialized)throw new Error("Metamodel is not initialized.");return this.withLock(function(){var c;return c=a instanceof e?new l.UpdateSchema(a.name,a.toJSON()):new l.UpdateAllSchemas(a),b.entityManagerFactory.send(c)})},c.prototype.toJSON=function(){var a=[];for(var b in this.entities)a.push(this.entities[b]);for(b in this.embeddables)a.push(this.embeddables[b]);return a},c.prototype.fromJSON=function(a){var b=new h,c=b.buildModels(a);this.baseTypes={},this.embeddables={},this.entities={};for(var d in c){var e=c[d];this.addType(e)}},c.prototype.createIndex=function(a,b){b.drop=!1;var c=new l.CreateDropIndex(a,b.toJSON());return this.entityManagerFactory.send(c)},c.prototype.dropIndex=function(a,b){b.drop=!0;var c=new l.CreateDropIndex(a,b.toJSON());return this.entityManagerFactory.send(c)},c.prototype.dropAllIndexes=function(a){var b=new l.DropAllIndexes(a);return this.entityManagerFactory.send(b)},c.prototype.getIndexes=function(a){var b=new l.ListIndexes(a);return this.entityManagerFactory.send(b).then(function(a){return a.entity.map(function(a){return new i(a.keys,a.unique)})},function(a){if(a.status==k.BUCKET_NOT_FOUND||a.status==k.OBJECT_NOT_FOUND)return null;throw a})},c}(j);c.exports=m},{25:25,36:36,38:38,40:40,42:42,44:44,47:47,61:61,9:9}],47:[function(a,c,d){"use strict";var e=a(38),f=a(42),g=a(41),h=a(43),i=a(45),j=a(49),k=a(50),l=a(32),m=function(){function a(){b.classCallCheck(this,a),this.models={},this.modelDescriptors=null;for(var c=Object.keys(e),d=Array.isArray(c),f=0,c=d?c:c[Symbol.iterator]();;){var g;if(d){if(f>=c.length)break;g=c[f++]}else{if(f=c.next(),f.done)break;g=f.value}var h=g,i=e[h];i instanceof e&&(this.models[i.ref]=i)}}return a.prototype.getModel=function(a){return a in this.models?this.models[a]:this.models[a]=this.buildModel(a)},a.prototype.buildModels=function(a){this.modelDescriptors={};for(var b,c=0;b=a[c];++c)this.modelDescriptors[b.class]=b;for(var d in this.modelDescriptors)try{var e=this.getModel(d);this.buildAttributes(e)}catch(a){throw new l("Can't create model for entity class "+d,a)}return this.getModel(f.Object.ref),this.models},a.prototype.buildModel=function(a){var b,c=this.modelDescriptors[a];if(a==f.Object.ref)b=new f.Object;else{if(!c)throw new TypeError("No model available for "+a);if(c.embedded)b=new g(a);else{var d=c.superClass||f.Object.ref;b=new f(a,this.getModel(d))}}if(c){var e=c.acl;for(var h in e)b[h+"Permission"].fromJSON(e[h])}return b},a.prototype.buildAttributes=function(a){var b=this.modelDescriptors[a.ref],c=b.fields;for(var d in c){var e=c[d];a.getAttribute(d)||a.addAttribute(this.buildAttribute(e.name,e.type),e.order)}b.validationCode&&(a.validationCode=b.validationCode)},a.prototype.buildAttribute=function(a,b){if(0!=b.indexOf("/db/collection."))return new k(a,this.getModel(b));var c=b.substring(0,b.indexOf("[")),d=b.substring(b.indexOf("[")+1,b.indexOf("]")).trim();switch(c){case h.ref:return new h(a,this.getModel(d));case j.ref:return new j(a,this.getModel(d));case i.ref:var e=d.substring(0,d.indexOf(",")).trim();return d=d.substring(d.indexOf(",")+1).trim(),new i(a,this.getModel(e),this.getModel(d));default:throw new TypeError("No collection available for "+b)}},a}();c.exports=m},{32:32,38:38,41:41,42:42,43:43,45:45,49:49,50:50}],48:[function(a,c,d){"use strict";var e=a(37),f=function(a){function c(d,e){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this,d));return f.elementType=e,f.typeConstructor=null,f}return b.inherits(c,a),b.createClass(c,[{key:"persistentAttributeType",get:function(){return e.PersistentAttributeType.ELEMENT_COLLECTION}}]),c}(e);f.CollectionType={COLLECTION:0,LIST:1,MAP:2,SET:3},c.exports=f},{37:37}],49:[function(a,c,d){"use strict";var e=a(48),f=function(a){function c(d,e){b.classCallCheck(this,c);var f=b.possibleConstructorReturn(this,a.call(this,d,e));return f.typeConstructor=Set,f}return b.inherits(c,a),b.createClass(c,[{key:"collectionType",get:function(){return e.CollectionType.SET}}],[{key:"ref",get:function(){return"/db/collection.Set"}}]),c.prototype.getJsonValue=function(a,b){var c=this.getValue(b);if(c instanceof this.typeConstructor){for(var d={},e=c.__persistedState__||{},f=!c.__persistedState__||c.__persistedSize__!==c.size,g=[],h=c,i=Array.isArray(h),j=0,h=i?h:h[Symbol.iterator]();;){var k;if(i){if(j>=h.length)break;k=h[j++]}else{if(j=h.next(),j.done)break;k=j.value}var l=k,m=this.elementType.toJsonValue(a,l);g.push(m),d[m]=l,f|=e[m]!==l}return a.persisting&&Object.defineProperties(c,{__persistedState__:{value:d,configurable:!0},__persistedSize__:{value:c.size,configurable:!0}}),a.isPersistent&&f&&a.setDirty(),g}return null},c.prototype.setJsonValue=function(a,b,c){var d=null;if(c){d=this.getValue(b),d instanceof this.typeConstructor||(d=new this.typeConstructor);var e={},f=d.__persistedState__||{};d.clear();for(var g=0,h=c.length;ge.MAX_URI_SIZE?new f.AdhocQueryPOST(g.name,this.firstResult,this.maxResults,j).entity(i,"text"):new f.AdhocQuery(g.name,i,this.firstResult,this.maxResults,j),this.entityManager.send(h).then(function(b){return d._createResultList(b.entity,a)}).then(b,c)},c.prototype.singleResult=function(a,b,c){ +var d=this;a instanceof Function&&(c=b,b=a,a={});var g=this.resultClass?this.entityManager.metamodel.entity(this.resultClass):null;if(!g)throw new Error("Only typed queries can be executed.");var h,i=this._serializeQuery(),j=this._serializeSort(),k=this.entityManager._connector.host.length+i.length;return h=k>e.MAX_URI_SIZE?new f.AdhocQueryPOST(g.name,i,this.firstResult,1,j).entity(i,"text"):new f.AdhocQuery(g.name,i,this.firstResult,1,j),this.entityManager.send(h).then(function(b){return d._createResultList(b.entity,a)}).then(function(a){return a.length?a[0]:null}).then(b,c)},c.prototype.count=function(a,b){var c=this.resultClass?this.entityManager.metamodel.entity(this.resultClass):null;if(!c)throw new Error("Only typed queries can be executed.");var d,g=this._serializeQuery(),h=this.entityManager._connector.host.length+g.length;return d=h>e.MAX_URI_SIZE?new f.AdhocCountQueryPOST(c.name).entity(g,"text"):new f.AdhocCountQuery(c.name,g),this.entityManager.send(d).then(function(a){return a.entity.count}).then(a,b)},c.prototype._serializeQuery=function(){return JSON.stringify(this,function(a,b){var c=this[a];return Object(c)instanceof Date?{$date:b}:c instanceof h?c.id:b})},c.prototype._serializeSort=function(){return JSON.stringify(this._sort)},c.prototype._createResultList=function(a,b){return a.length?Promise.all(a.map(function(a){if(a.id){var c=this.entityManager.getReference(this.resultClass,a.id),d=g.get(c);return d.setJson(a,!0),this.entityManager.resolveDepth(c,b)}return this.entityManager.load(Object.keys(a)[0])},this)).then(function(a){return a.filter(function(a){return!!a})}):Promise.resolve([])},c.prototype._addOrder=function(a,b){return b?this._sort[a]=b:this._sort=a,this},c.prototype._addOffset=function(a){return this.firstResult=a,this},c.prototype._addLimit=function(a){return this.maxResults=a,this},c}(e);c.exports=i},{10:10,36:36,58:58,63:63}],57:[function(a,c,d){"use strict";var e=a(56),f=function(a){function c(d,e,f,g){b.classCallCheck(this,c);var h=b.possibleConstructorReturn(this,a.call(this,d,e));return h._operator=f,h._childs=g,h}return b.inherits(c,a),c.prototype.toJSON=function(){var a={};return a[this._operator]=this._childs,a},c}(e);c.exports=f},{56:56}],58:[function(a,c,d){"use strict";var e=function(){function a(c,d){b.classCallCheck(this,a),this.entityManager=c,this.resultClass=d}return a.prototype.ascending=function(a){return this._addOrder(a,1)},a.prototype.descending=function(a){return this._addOrder(a,-1)},a.prototype.sort=function(a){if(!(a instanceof Object)||Object.getPrototypeOf(a)!=Object.prototype)throw new Error("sort must be an object.");return this._addOrder(a)},a.prototype.offset=function(a){if(a<0)throw new Error("The offset can't be nagative.");return this._addOffset(a)},a.prototype.limit=function(a){if(a<0)throw new Error("The limit can't be nagative.");return this._addLimit(a)},a.prototype.resultList=function(a,b,c){},a.prototype.singleResult=function(a,b,c){},a.prototype.stream=function(a){},a.prototype.count=function(a,b){},a}();e.MAX_URI_SIZE=2e3,e.varargs=function(a,b){return Array.prototype.concat.apply([],Array.prototype.slice.call(b,a))},c.exports=e},{}],59:[function(a,b,c){"use strict";c.Builder=a(53),c.Condition=a(54),c.Filter=a(55),c.Node=a(56),c.Operator=a(57),c.Query=a(58)},{53:53,54:54,55:55,56:56,57:57,58:58}],60:[function(a,c,d){"use strict";var e=a(36),f=a(25).StatusCode,g=function(){function a(c,d){b.classCallCheck(this,a),this._metamodel=c,this.entityManagerFactory=d}return a.prototype.functionToString=function(a){if(!a)return"";var b=a.toString();return b=b.substring(b.indexOf("{")+1,b.lastIndexOf("}")),"\n"==b.charAt(0)&&(b=b.substring(1)),"\n"==b.charAt(b.length-1)&&(b=b.substring(0,b.length-1)),b},a.prototype.stringToFunction=function(a,b){return new Function(a,b)},a.prototype.loadModules=function(){var a=new e.GetAllModules;return this.entityManagerFactory.send(a).then(function(a){return a.entity})},a.prototype.loadCode=function(a,b,c){var d=this,g=Object(a)instanceof String?a:a.name,h=new e.GetBaqendCode(g,b).responseType("text");return this.entityManagerFactory.send(h).then(function(a){return d._parseCode(g,b,c,a.entity)},function(a){if(a.status==f.OBJECT_NOT_FOUND)return null;throw a})},a.prototype.saveCode=function(a,b,c){var d=this,f=Object(a)instanceof String?a:a.name,g=c instanceof Function,h=new e.SetBaqendCode(f,b).entity(g?this.functionToString(c):c,"text").responseType("text");return this.entityManagerFactory.send(h).then(function(a){return d._parseCode(f,b,g,a.entity)})},a.prototype.deleteCode=function(a,b){var c=this,d=Object(a)instanceof String?a:a.name,f=new e.DeleteBaqendCode(d,b);return this.entityManagerFactory.send(f).then(function(){return c._parseCode(d,b,!1,null)})},a.prototype._parseCode=function(a,b,c,d){if("validate"==b){var e=this._metamodel.entity(a);return e.validationCode=d,c?e.validationCode:d}return c?this.stringToFunction(["module","exports"],d):d},a}();c.exports=g},{25:25,36:36}],61:[function(a,c,d){"use strict";var e=function(){function a(){b.classCallCheck(this,a),this._isLocked=!1,this._readyPromise=Promise.resolve(this),this._deferred=null}return a.prototype.ready=function(a,b){return this._readyPromise.then(a,b)},a.prototype.withLock=function(a,b){if(this._isLocked)throw new Error("Current operation has not been finished.");var c=this;try{this._isLocked=!0;var d=a().then(function(a){return c._isLocked=!1,a},function(a){throw b||(c._isLocked=!1),a});return this._readyPromise=d.then(function(){return c},function(a){if(!b)return c;throw a}),d}catch(a){throw b?this._readyPromise=Promise.reject(a):this._isLocked=!1,a}},b.createClass(a,[{key:"isReady",get:function(){return!this._isLocked}}]),a}();c.exports=e},{}],62:[function(a,c,d){"use strict";var e=a(36),f=(a(25).StatusCode,function(){function a(){b.classCallCheck(this,a)}return a.create=function(a){function b(){c.log.apply(b,arguments)}for(var c=this.prototype,d=Object.getOwnPropertyNames(c),e=Array.isArray(d),f=0,d=e?d:d[Symbol.iterator]();;){var g;if(e){if(f>=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;Object.defineProperty(b,h,Object.getOwnPropertyDescriptor(c,h))}return b._init(a),b},a.prototype.log=function(c,d,e){var f=Array.prototype.slice.call(arguments);if(c=a.LEVELS.indexOf(f[0])==-1?"info":f.shift(),!(this.levelIndex>a.LEVELS.indexOf(c)))return d="string"==typeof f[0]?this._format(f.shift(),f):"[no message]",e=null,f.length&&"object"===b.typeof(f[f.length-1])&&(e=f.pop(),Array.isArray(e)&&(e={data:e})),f.length&&(d+=", "+f.join(", ")),this._log({date:new Date,message:d,level:c,user:this.entityManager.me&&this.entityManager.me.id,data:e})},a.prototype._format=function(b,c){if(0==c.length)return b;var d=String(b).replace(a.FORMAT_REGEXP,function(a){if("%%"===a)return"%";if(!c.length)return a;switch(a){case"%s":return String(c.shift());case"%d":return Number(c.shift());case"%j":try{return JSON.stringify(c.shift())}catch(a){return"[Circular]"}default:return a}});return d},a.prototype._init=function(b){var c=this;this.entityManager=b,this.levelIndex=2,a.LEVELS.forEach(function(a){c[a]=c.log.bind(c,a)})},a.prototype._log=function(a){return this.entityManager.isReady?this.entityManager.send(new e.CreateObject("logs.AppLog",a)):this.entityManager.ready(this._log.bind(this,a))},b.createClass(a,[{key:"level",get:function(){return a.LEVELS[this.levelIndex]},set:function(b){var c=a.LEVELS.indexOf(b);if(c==-1)throw new Error("Unknown logging level "+b);this.levelIndex=c}}]),a}());Object.assign(f,{LEVELS:["trace","debug","info","warn","error"],FORMAT_REGEXP:/%[sdj%]/g}),c.exports=f},{25:25,36:36}],63:[function(a,c,d){"use strict";var e=a(34),f=a(1),g=a(61),h=(a(20),function(c){function d(a,e){b.classCallCheck(this,d);var g=b.possibleConstructorReturn(this,c.call(this));return g._root=a,g._state=d.Type.DIRTY,g._enabled=!0,g.persisting=!1,g.id=null,g.version=null,g.type=e,g.acl=new f(g),g}return b.inherits(d,c),d.create=function(a,b){var c;if(a.isEntity)c=new d(b,a);else{if(!a.isEmbeddable)throw new Error("Illegal type "+a);c={type:a,readAccess:function(){var a=this._root&&this._root._metadata;a&&a.readAccess()},writeAccess:function(){var a=this._root&&this._root._metadata;a&&a.writeAccess()}}}return c},d.get=function(a){return a._metadata},b.createClass(d,[{key:"db",get:function(){return this._db?this._db:this._db=a(6)},set:function(a){if(this._db)throw new Error("DB has already been set.");this._db=a}},{key:"bucket",get:function(){return this.type.name}},{key:"key",get:function(){if(!this._key&&this.id){var a=this.id.lastIndexOf("/");this._key=decodeURIComponent(this.id.substring(a+1))}return this._key},set:function(a){if(a+="",this.id)throw new Error("The id can't be set twice.");this.id="/db/"+this.bucket+"/"+encodeURIComponent(a),this._key=a}},{key:"isAttached",get:function(){return!!this._db}},{key:"isAvailable",get:function(){return this._state>d.Type.UNAVAILABLE}},{key:"isPersistent",get:function(){return this._state==d.Type.PERSISTENT}},{key:"isDirty",get:function(){return this._state==d.Type.DIRTY}}]),d.prototype.readAccess=function(){if(this._enabled&&!this.isAvailable)throw new e.PersistentError("This object "+this.id+" is not available.")},d.prototype.writeAccess=function(){if(this._enabled){if(!this.isAvailable)throw new e.PersistentError("This object "+this.id+" is not available.");this.setDirty()}},d.prototype.setUnavailable=function(){this._state=d.Type.UNAVAILABLE},d.prototype.setPersistent=function(){this._state=d.Type.PERSISTENT},d.prototype.setDirty=function(){this._state=d.Type.DIRTY},d.prototype.setRemoved=function(){this.isAvailable&&(this.setDirty(),this.version=null)},d.prototype.getJsonMetadata=function(){var a={};return this.id&&(a.id=this.id),this.version&&(a.version=this.version),a.acl=this.acl,a},d.prototype.setJsonMetadata=function(a){this.id||(this.id=a.id),a.version&&(this.version=a.version),this.acl.fromJSON(a.acl||{})},d.prototype.getJson=function(a,b){this._enabled=!1,this.persisting=!!b;var c=this.type.toJsonValue(this,this._root,!0);return this._enabled=!0,this.persisting=!1,this.isAttached&&!a&&Object.assign(c,this.getJsonMetadata()),c},d.prototype.setJson=function(a,b){(a.id||a.version||a.acl)&&this.setJsonMetadata(a),this._enabled=!1,this.persisting=!!b,this.type.fromJsonValue(this,a,this._root,!0),this._enabled=!0,this.persisting=!1,b?this.setPersistent():this.setDirty()},d}(g));h.Type={UNAVAILABLE:-1,PERSISTENT:0,DIRTY:1},c.exports=h},{1:1,20:20,34:34,6:6,61:61}],64:[function(a,c,d){"use strict";var e=a(36),f=function(){function a(c,d){b.classCallCheck(this,a),this._entityManager=c,this._connector=d}return a.prototype.get=function(a,b,c,d,f){b instanceof Function&&(f=c,d=b,c={},b=null),c instanceof Function&&(f=d,d=c,c={}),c=c||{};var g=new e.GetBaqendModule(a).addQueryString(b).responseType(c.responseType||null);return this._send(g,d,f)},a.prototype.post=function(a,b,c,d,f){c instanceof Function&&(f=d,d=c,c={}),c=c||{};var g=new e.PostBaqendModule(a).entity(b,c.requestType).mimeType(c.mimeType||null).responseType(c.responseType||null);return this._send(g,d,f)},a.prototype._send=function(a,b,c){return this._entityManager.send(a).then(function(a){return a.entity}).then(b,c)},a}();c.exports=f},{36:36}],65:[function(a,c,d){"use strict";var e=function(){function a(c){b.classCallCheck(this,a),this._rules={},this._metadata=c}return a.prototype.allRules=function(){return Object.keys(this._rules)},a.prototype.clear=function(){this._metadata&&this._metadata.writeAccess(),this._rules={}},a.prototype.copy=function(a){return this._metadata&&this._metadata.writeAccess(),this._rules=Object.assign({},a._rules),this},a.prototype.isPublicAllowed=function(){if("*"in this._rules)return!1;for(var a in this._rules)if("allow"==this._rules[a])return!1;return!0},a.prototype.setPublicAllowed=function(){this._metadata&&this._metadata.writeAccess();for(var a in this._rules)"allow"==this._rules[a]&&delete this._rules[a]},a.prototype.getRule=function(a){return this._rules[this._getRef(a)]},a.prototype.isAllowed=function(a){return"allow"==this._rules[this._getRef(a)]},a.prototype.isDenied=function(a){return"deny"==this._rules[this._getRef(a)]},a.prototype.allowAccess=function(a){var b=arguments;this._metadata&&this._metadata.writeAccess();for(var c=0;c=d.length)break;g=d[f++]}else{if(f=d.next(),f.done)break;g=f.value}var h=g;c.push(h.name)}var i=new Function(c,b);return function(a){var b=c.map(function(b){return a[b]});return i.apply({},b)}},a.prototype.is=function(a,b){return a instanceof Function&&(b=a,a="is"),b(this.value,e)===!1&&this.errors.push(a),this},b.createClass(a,[{key:"value",get:function(){return this._entity[this.key]}},{key:"isValid",get:function(){return 0==this.errors.length}}]),a.prototype._callMethod=function(a,b,c){return c=c||[],c.unshift(this.value),e[a].apply(this,c)===!1&&this.errors.push(b),this},a.prototype.toString=function(){return this.value},a.prototype.toJSON=function(){return{isValid:this.isValid,errors:this.errors}},a}());Object.keys(e).forEach(function(a){"function"==typeof e[a]&&"toString"!==a&&"toDate"!==a&&"extend"!==a&&"init"!==a&&(f.prototype[a]=function(b){return this._callMethod(a,b||a,Array.prototype.slice.call(arguments,b?1:0))})}),c.exports=f},{160:160,68:68}],70:[function(a,b,c){"use strict";b.exports=c=a(71),c.Metadata=a(63),c.Permission=a(65),c.Validator=a(69),c.ValidationResult=a(68),c.Code=a(60),c.Modules=a(64),c.Lockable=a(61),c.Logger=a(62),c.PushMessage=a(66),c.TokenStorage=a(67),c.uuid=a(158).v4},{158:158,60:60,61:61,62:62,63:63,64:64,65:65,66:66,67:67,68:68,69:69,71:71}],71:[function(a,b,c){"use strict";c.hmac=a(155),c.atob=window.atob,c.isNode=!1},{155:155}],72:[function(a,b,c){b.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},{}],73:[function(a,b,c){var d=a(144)("unscopables"),e=Array.prototype;void 0==e[d]&&a(94)(e,d,{}),b.exports=function(a){e[d][a]=!0}},{144:144,94:94}],74:[function(a,b,c){b.exports=function(a,b,c,d){if(!(a instanceof b)||void 0!==d&&d in a)throw TypeError(c+": incorrect invocation!");return a}},{}],75:[function(a,b,c){var d=a(102);b.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},{102:102}],76:[function(a,b,c){var d=a(137),e=a(138),f=a(135);b.exports=function(a){return function(b,c,g){var h,i=d(b),j=e(i.length),k=f(g,j);if(a&&c!=c){for(;j>k;)if(h=i[k++],h!=h)return!0}else for(;j>k;k++)if((a||k in i)&&i[k]===c)return a||k||0;return!a&&-1}}},{135:135,137:137,138:138}],77:[function(a,b,c){var d=a(78),e=a(144)("toStringTag"),f="Arguments"==d(function(){return arguments}()),g=function(a,b){try{return a[b]}catch(a){}};b.exports=function(a){var b,c,h;return void 0===a?"Undefined":null===a?"Null":"string"==typeof(c=g(b=Object(a),e))?c:f?d(b):"Object"==(h=d(b))&&"function"==typeof b.callee?"Arguments":h}},{144:144,78:78}],78:[function(a,b,c){var d={}.toString;b.exports=function(a){return d.call(a).slice(8,-1)}},{}],79:[function(a,b,c){"use strict";var d=a(115).f,e=a(114),f=a(126),g=a(83),h=a(74),i=a(84),j=a(91),k=a(105),l=a(107),m=a(129),n=a(85),o=a(111).fastKey,p=n?"_s":"size",q=function(a,b){var c,d=o(b);if("F"!==d)return a._i[d];for(c=a._f;c;c=c.n)if(c.k==b)return c};b.exports={getConstructor:function(a,b,c,k){var l=a(function(a,d){h(a,l,b,"_i"),a._i=e(null),a._f=void 0,a._l=void 0,a[p]=0,void 0!=d&&j(d,c,a[k],a)});return f(l.prototype,{clear:function(){for(var a=this,b=a._i,c=a._f;c;c=c.n)c.r=!0,c.p&&(c.p=c.p.n=void 0),delete b[c.i];a._f=a._l=void 0,a[p]=0},delete:function(a){var b=this,c=q(b,a);if(c){var d=c.n,e=c.p;delete b._i[c.i],c.r=!0,e&&(e.n=d),d&&(d.p=e),b._f==c&&(b._f=d),b._l==c&&(b._l=e),b[p]--}return!!c},forEach:function(a){h(this,l,"forEach");for(var b,c=g(a,arguments.length>1?arguments[1]:void 0,3);b=b?b.n:this._f;)for(c(b.v,b.k,this);b&&b.r;)b=b.p},has:function(a){return!!q(this,a)}}),n&&d(l.prototype,"size",{get:function(){return i(this[p])}}),l},def:function(a,b,c){var d,e,f=q(a,b);return f?f.v=c:(a._l=f={i:e=o(b,!0),k:b,v:c,p:d=a._l,n:void 0,r:!1},a._f||(a._f=f),d&&(d.n=f),a[p]++,"F"!==e&&(a._i[e]=f)),a},getEntry:q,setStrong:function(a,b,c){k(a,b,function(a,b){this._t=a,this._k=b,this._l=void 0},function(){for(var a=this,b=a._k,c=a._l;c&&c.r;)c=c.p;return a._t&&(a._l=c=c?c.n:a._t._f)?"keys"==b?l(0,c.k):"values"==b?l(0,c.v):l(0,[c.k,c.v]):(a._t=void 0,l(1))},c?"entries":"values",!c,!0),m(b)}}},{105:105,107:107,111:111,114:114,115:115,126:126,129:129,74:74,83:83,84:84,85:85,91:91}],80:[function(a,b,c){"use strict";var d=a(92),e=a(89),f=a(127),g=a(126),h=a(111),i=a(91),j=a(74),k=a(102),l=a(90),m=a(106),n=a(130),o=a(97);b.exports=function(a,b,c,p,q,r){var s=d[a],t=s,u=q?"set":"add",v=t&&t.prototype,w={},x=function(a){var b=v[a];f(v,a,"delete"==a?function(a){return!(r&&!k(a))&&b.call(this,0===a?0:a)}:"has"==a?function(a){return!(r&&!k(a))&&b.call(this,0===a?0:a)}:"get"==a?function(a){return r&&!k(a)?void 0:b.call(this,0===a?0:a)}:"add"==a?function(a){return b.call(this,0===a?0:a),this}:function(a,c){return b.call(this,0===a?0:a,c),this})};if("function"==typeof t&&(r||v.forEach&&!l(function(){(new t).entries().next()}))){var y=new t,z=y[u](r?{}:-0,1)!=y,A=l(function(){y.has(1)}),B=m(function(a){new t(a)}),C=!r&&l(function(){for(var a=new t,b=5;b--;)a[u](b,b);return!a.has(-0)});B||(t=b(function(b,c){j(b,t,a);var d=o(new s,b,t);return void 0!=c&&i(c,q,d[u],d),d}),t.prototype=v,v.constructor=t),(A||C)&&(x("delete"),x("has"),q&&x("get")),(C||z)&&x(u),r&&v.clear&&delete v.clear}else t=p.getConstructor(b,a,q,u),g(t.prototype,c),h.NEED=!0;return n(t,a),w[a]=t,e(e.G+e.W+e.F*(t!=s),w),r||p.setStrong(t,a,q),t}},{102:102,106:106,111:111,126:126,127:127,130:130,74:74,89:89,90:90,91:91,92:92,97:97}],81:[function(a,b,c){var d=b.exports={version:"2.4.0"};"number"==typeof __e&&(__e=d)},{}],82:[function(a,b,c){"use strict";var d=a(115),e=a(125);b.exports=function(a,b,c){b in a?d.f(a,b,e(0,c)):a[b]=c}},{115:115,125:125}],83:[function(a,b,c){var d=a(72);b.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},{72:72}],84:[function(a,b,c){b.exports=function(a){if(void 0==a)throw TypeError("Can't call method on "+a);return a}},{}],85:[function(a,b,c){b.exports=!a(90)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{90:90}],86:[function(a,b,c){var d=a(102),e=a(92).document,f=d(e)&&d(e.createElement);b.exports=function(a){return f?e.createElement(a):{}}},{102:102,92:92}],87:[function(a,b,c){b.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],88:[function(a,b,c){var d=a(123),e=a(120),f=a(124);b.exports=function(a){var b=d(a),c=e.f;if(c)for(var g,h=c(a),i=f.f,j=0;h.length>j;)i.call(a,g=h[j++])&&b.push(g);return b}},{120:120,123:123,124:124}],89:[function(a,b,c){var d=a(92),e=a(81),f=a(94),g=a(127),h=a(83),i="prototype",j=function(a,b,c){var k,l,m,n,o=a&j.F,p=a&j.G,q=a&j.S,r=a&j.P,s=a&j.B,t=p?d:q?d[b]||(d[b]={}):(d[b]||{})[i],u=p?e:e[b]||(e[b]={}),v=u[i]||(u[i]={});p&&(c=b);for(k in c)l=!o&&t&&void 0!==t[k],m=(l?t:c)[k],n=s&&l?h(m,d):r&&"function"==typeof m?h(Function.call,m):m,t&&g(t,k,m,a&j.U),u[k]!=m&&f(u,k,n),r&&v[k]!=m&&(v[k]=m)};d.core=e,j.F=1,j.G=2,j.S=4,j.P=8,j.B=16,j.W=32,j.U=64,j.R=128,b.exports=j},{127:127,81:81,83:83,92:92,94:94}],90:[function(a,b,c){b.exports=function(a){try{return!!a()}catch(a){return!0}}},{}],91:[function(a,b,c){var d=a(83),e=a(103),f=a(100),g=a(75),h=a(138),i=a(145),j={},k={},c=b.exports=function(a,b,c,l,m){var n,o,p,q,r=m?function(){return a}:i(a),s=d(c,l,b?2:1),t=0;if("function"!=typeof r)throw TypeError(a+" is not iterable!");if(f(r)){for(n=h(a.length);n>t;t++)if(q=b?s(g(o=a[t])[0],o[1]):s(a[t]),q===j||q===k)return q}else for(p=r.call(a);!(o=p.next()).done;)if(q=e(p,s,o.value,b),q===j||q===k)return q};c.BREAK=j,c.RETURN=k},{100:100,103:103,138:138,145:145,75:75,83:83}],92:[function(a,b,c){var d=b.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=d)},{}],93:[function(a,b,c){var d={}.hasOwnProperty;b.exports=function(a,b){return d.call(a,b)}},{}],94:[function(a,b,c){var d=a(115),e=a(125);b.exports=a(85)?function(a,b,c){return d.f(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},{115:115,125:125,85:85}],95:[function(a,b,c){b.exports=a(92).document&&document.documentElement},{92:92}],96:[function(a,b,c){b.exports=!a(85)&&!a(90)(function(){return 7!=Object.defineProperty(a(86)("div"),"a",{get:function(){return 7}}).a})},{85:85,86:86,90:90}],97:[function(a,b,c){var d=a(102),e=a(128).set;b.exports=function(a,b,c){var f,g=b.constructor;return g!==c&&"function"==typeof g&&(f=g.prototype)!==c.prototype&&d(f)&&e&&e(a,f),a}},{102:102,128:128}],98:[function(a,b,c){b.exports=function(a,b,c){var d=void 0===c;switch(b.length){case 0:return d?a():a.call(c);case 1:return d?a(b[0]):a.call(c,b[0]);case 2:return d?a(b[0],b[1]):a.call(c,b[0],b[1]);case 3:return d?a(b[0],b[1],b[2]):a.call(c,b[0],b[1],b[2]);case 4:return d?a(b[0],b[1],b[2],b[3]):a.call(c,b[0],b[1],b[2],b[3])}return a.apply(c,b)}},{}],99:[function(a,b,c){var d=a(78);b.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},{78:78}],100:[function(a,b,c){var d=a(108),e=a(144)("iterator"),f=Array.prototype;b.exports=function(a){return void 0!==a&&(d.Array===a||f[e]===a)}},{108:108,144:144}],101:[function(a,b,c){var d=a(78);b.exports=Array.isArray||function(a){return"Array"==d(a)}},{78:78}],102:[function(a,b,c){b.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},{}],103:[function(a,b,c){var d=a(75);b.exports=function(a,b,c,e){try{return e?b(d(c)[0],c[1]):b(c)}catch(b){var f=a.return;throw void 0!==f&&d(f.call(a)),b}}},{75:75}],104:[function(a,b,c){"use strict";var d=a(114),e=a(125),f=a(130),g={};a(94)(g,a(144)("iterator"),function(){return this}),b.exports=function(a,b,c){a.prototype=d(g,{next:e(1,c)}),f(a,b+" Iterator")}},{114:114,125:125,130:130,144:144,94:94}],105:[function(a,b,c){"use strict";var d=a(110),e=a(89),f=a(127),g=a(94),h=a(93),i=a(108),j=a(104),k=a(130),l=a(121),m=a(144)("iterator"),n=!([].keys&&"next"in[].keys()),o="@@iterator",p="keys",q="values",r=function(){return this};b.exports=function(a,b,c,s,t,u,v){j(c,b,s);var w,x,y,z=function(a){if(!n&&a in D)return D[a];switch(a){case p:return function(){return new c(this,a)};case q:return function(){return new c(this,a)}}return function(){return new c(this,a)}},A=b+" Iterator",B=t==q,C=!1,D=a.prototype,E=D[m]||D[o]||t&&D[t],F=E||z(t),G=t?B?z("entries"):F:void 0,H="Array"==b?D.entries||E:E;if(H&&(y=l(H.call(new a)),y!==Object.prototype&&(k(y,A,!0),d||h(y,m)||g(y,m,r))),B&&E&&E.name!==q&&(C=!0,F=function(){return E.call(this)}),d&&!v||!n&&!C&&D[m]||g(D,m,F),i[b]=F,i[A]=r,t)if(w={values:B?F:z(q),keys:u?F:z(p),entries:G},v)for(x in w)x in D||f(D,x,w[x]);else e(e.P+e.F*(n||C),b,w);return w}},{104:104,108:108,110:110,121:121,127:127,130:130,144:144,89:89,93:93,94:94}],106:[function(a,b,c){var d=a(144)("iterator"),e=!1;try{var f=[7][d]();f.return=function(){e=!0},Array.from(f,function(){throw 2})}catch(a){}b.exports=function(a,b){if(!b&&!e)return!1;var c=!1;try{var f=[7],g=f[d]();g.next=function(){return{done:c=!0}},f[d]=function(){return g},a(f)}catch(a){}return c}},{144:144}],107:[function(a,b,c){b.exports=function(a,b){return{value:b,done:!!a}}},{}],108:[function(a,b,c){b.exports={}},{}],109:[function(a,b,c){var d=a(123),e=a(137);b.exports=function(a,b){for(var c,f=e(a),g=d(f),h=g.length,i=0;h>i;)if(f[c=g[i++]]===b)return c}},{123:123,137:137}],110:[function(a,b,c){b.exports=!1},{}],111:[function(a,b,c){var d=a(141)("meta"),e=a(102),f=a(93),g=a(115).f,h=0,i=Object.isExtensible||function(){return!0},j=!a(90)(function(){return i(Object.preventExtensions({}))}),k=function(a){g(a,d,{value:{i:"O"+ ++h,w:{}}})},l=function(a,b){if(!e(a))return"symbol"==typeof a?a:("string"==typeof a?"S":"P")+a;if(!f(a,d)){if(!i(a))return"F";if(!b)return"E";k(a)}return a[d].i},m=function(a,b){if(!f(a,d)){if(!i(a))return!0;if(!b)return!1;k(a)}return a[d].w},n=function(a){return j&&o.NEED&&i(a)&&!f(a,d)&&k(a),a},o=b.exports={KEY:d,NEED:!1,fastKey:l,getWeak:m,onFreeze:n}},{102:102,115:115,141:141,90:90,93:93}],112:[function(a,b,c){var d=a(92),e=a(134).set,f=d.MutationObserver||d.WebKitMutationObserver,g=d.process,h=d.Promise,i="process"==a(78)(g);b.exports=function(){var a,b,c,j=function(){var d,e;for(i&&(d=g.domain)&&d.exit();a;){e=a.fn,a=a.next;try{e()}catch(d){throw a?c():b=void 0,d}}b=void 0,d&&d.enter()};if(i)c=function(){g.nextTick(j)};else if(f){var k=!0,l=document.createTextNode("");new f(j).observe(l,{characterData:!0}),c=function(){l.data=k=!k}}else if(h&&h.resolve){var m=h.resolve();c=function(){m.then(j)}}else c=function(){e.call(d,j)};return function(d){var e={fn:d,next:void 0};b&&(b.next=e),a||(a=e,c()),b=e}}},{134:134,78:78,92:92}],113:[function(a,b,c){"use strict";var d=a(123),e=a(120),f=a(124),g=a(139),h=a(99),i=Object.assign;b.exports=!i||a(90)(function(){var a={},b={},c=Symbol(),d="abcdefghijklmnopqrst";return a[c]=7,d.split("").forEach(function(a){b[a]=a}),7!=i({},a)[c]||Object.keys(i({},b)).join("")!=d})?function(a,b){for(var c=g(a),i=arguments.length,j=1,k=e.f,l=f.f;i>j;)for(var m,n=h(arguments[j++]),o=k?d(n).concat(k(n)):d(n),p=o.length,q=0;p>q;)l.call(n,m=o[q++])&&(c[m]=n[m]);return c}:i},{120:120,123:123,124:124,139:139,90:90,99:99}],114:[function(a,b,c){var d=a(75),e=a(116),f=a(87),g=a(131)("IE_PROTO"),h=function(){},i="prototype",j=function(){var b,c=a(86)("iframe"),d=f.length,e="<",g=">";for(c.style.display="none",a(95).appendChild(c),c.src="javascript:",b=c.contentWindow.document,b.open(),b.write(e+"script"+g+"document.F=Object"+e+"/script"+g),b.close(),j=b.F;d--;)delete j[i][f[d]];return j()};b.exports=Object.create||function(a,b){var c;return null!==a?(h[i]=d(a),c=new h,h[i]=null,c[g]=a):c=j(),void 0===b?c:e(c,b)}},{116:116,131:131,75:75,86:86,87:87,95:95}],115:[function(a,b,c){var d=a(75),e=a(96),f=a(140),g=Object.defineProperty;c.f=a(85)?Object.defineProperty:function(a,b,c){if(d(a),b=f(b,!0),d(c),e)try{return g(a,b,c)}catch(a){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a}},{140:140,75:75,85:85,96:96}],116:[function(a,b,c){var d=a(115),e=a(75),f=a(123);b.exports=a(85)?Object.defineProperties:function(a,b){e(a);for(var c,g=f(b),h=g.length,i=0;h>i;)d.f(a,c=g[i++],b[c]);return a}},{115:115,123:123,75:75,85:85}],117:[function(a,b,c){var d=a(124),e=a(125),f=a(137),g=a(140),h=a(93),i=a(96),j=Object.getOwnPropertyDescriptor;c.f=a(85)?j:function(a,b){if(a=f(a),b=g(b,!0),i)try{return j(a,b)}catch(a){}if(h(a,b))return e(!d.f.call(a,b),a[b])}},{124:124,125:125,137:137,140:140,85:85,93:93,96:96}],118:[function(a,b,c){var d=a(137),e=a(119).f,f={}.toString,g="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],h=function(a){try{return e(a)}catch(a){return g.slice()}};b.exports.f=function(a){return g&&"[object Window]"==f.call(a)?h(a):e(d(a))}},{119:119,137:137}],119:[function(a,b,c){var d=a(122),e=a(87).concat("length","prototype");c.f=Object.getOwnPropertyNames||function(a){return d(a,e)}},{122:122,87:87}],120:[function(a,b,c){c.f=Object.getOwnPropertySymbols},{}],121:[function(a,b,c){var d=a(93),e=a(139),f=a(131)("IE_PROTO"),g=Object.prototype;b.exports=Object.getPrototypeOf||function(a){return a=e(a),d(a,f)?a[f]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?g:null}},{131:131,139:139,93:93}],122:[function(a,b,c){var d=a(93),e=a(137),f=a(76)(!1),g=a(131)("IE_PROTO");b.exports=function(a,b){var c,h=e(a),i=0,j=[];for(c in h)c!=g&&d(h,c)&&j.push(c);for(;b.length>i;)d(h,c=b[i++])&&(~f(j,c)||j.push(c));return j}},{131:131,137:137,76:76,93:93}],123:[function(a,b,c){var d=a(122),e=a(87);b.exports=Object.keys||function(a){return d(a,e)}},{122:122,87:87}],124:[function(a,b,c){c.f={}.propertyIsEnumerable},{}], +125:[function(a,b,c){b.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},{}],126:[function(a,b,c){var d=a(127);b.exports=function(a,b,c){for(var e in b)d(a,e,b[e],c);return a}},{127:127}],127:[function(a,b,c){var d=a(92),e=a(94),f=a(93),g=a(141)("src"),h="toString",i=Function[h],j=(""+i).split(h);a(81).inspectSource=function(a){return i.call(a)},(b.exports=function(a,b,c,h){var i="function"==typeof c;i&&(f(c,"name")||e(c,"name",b)),a[b]!==c&&(i&&(f(c,g)||e(c,g,a[b]?""+a[b]:j.join(String(b)))),a===d?a[b]=c:h?a[b]?a[b]=c:e(a,b,c):(delete a[b],e(a,b,c)))})(Function.prototype,h,function(){return"function"==typeof this&&this[g]||i.call(this)})},{141:141,81:81,92:92,93:93,94:94}],128:[function(a,b,c){var d=a(102),e=a(75),f=function(a,b){if(e(a),!d(b)&&null!==b)throw TypeError(b+": can't set as prototype!")};b.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(b,c,d){try{d=a(83)(Function.call,a(117).f(Object.prototype,"__proto__").set,2),d(b,[]),c=!(b instanceof Array)}catch(a){c=!0}return function(a,b){return f(a,b),c?a.__proto__=b:d(a,b),a}}({},!1):void 0),check:f}},{102:102,117:117,75:75,83:83}],129:[function(a,b,c){"use strict";var d=a(92),e=a(115),f=a(85),g=a(144)("species");b.exports=function(a){var b=d[a];f&&b&&!b[g]&&e.f(b,g,{configurable:!0,get:function(){return this}})}},{115:115,144:144,85:85,92:92}],130:[function(a,b,c){var d=a(115).f,e=a(93),f=a(144)("toStringTag");b.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},{115:115,144:144,93:93}],131:[function(a,b,c){var d=a(132)("keys"),e=a(141);b.exports=function(a){return d[a]||(d[a]=e(a))}},{132:132,141:141}],132:[function(a,b,c){var d=a(92),e="__core-js_shared__",f=d[e]||(d[e]={});b.exports=function(a){return f[a]||(f[a]={})}},{92:92}],133:[function(a,b,c){var d=a(75),e=a(72),f=a(144)("species");b.exports=function(a,b){var c,g=d(a).constructor;return void 0===g||void 0==(c=d(g)[f])?b:e(c)}},{144:144,72:72,75:75}],134:[function(a,b,c){var d,e,f,g=a(83),h=a(98),i=a(95),j=a(86),k=a(92),l=k.process,m=k.setImmediate,n=k.clearImmediate,o=k.MessageChannel,p=0,q={},r="onreadystatechange",s=function(){var a=+this;if(q.hasOwnProperty(a)){var b=q[a];delete q[a],b()}},t=function(a){s.call(a.data)};m&&n||(m=function(a){for(var b=[],c=1;arguments.length>c;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function(a){delete q[a]},"process"==a(78)(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(e=new o,f=e.port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),b.exports={set:m,clear:n}},{78:78,83:83,86:86,92:92,95:95,98:98}],135:[function(a,b,c){var d=a(136),e=Math.max,f=Math.min;b.exports=function(a,b){return a=d(a),a<0?e(a+b,0):f(a,b)}},{136:136}],136:[function(a,b,c){var d=Math.ceil,e=Math.floor;b.exports=function(a){return isNaN(a=+a)?0:(a>0?e:d)(a)}},{}],137:[function(a,b,c){var d=a(99),e=a(84);b.exports=function(a){return d(e(a))}},{84:84,99:99}],138:[function(a,b,c){var d=a(136),e=Math.min;b.exports=function(a){return a>0?e(d(a),9007199254740991):0}},{136:136}],139:[function(a,b,c){var d=a(84);b.exports=function(a){return Object(d(a))}},{84:84}],140:[function(a,b,c){var d=a(102);b.exports=function(a,b){if(!d(a))return a;var c,e;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;if("function"==typeof(c=a.valueOf)&&!d(e=c.call(a)))return e;if(!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},{102:102}],141:[function(a,b,c){var d=0,e=Math.random();b.exports=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++d+e).toString(36))}},{}],142:[function(a,b,c){var d=a(92),e=a(81),f=a(110),g=a(143),h=a(115).f;b.exports=function(a){var b=e.Symbol||(e.Symbol=f?{}:d.Symbol||{});"_"==a.charAt(0)||a in b||h(b,a,{value:g.f(a)})}},{110:110,115:115,143:143,81:81,92:92}],143:[function(a,b,c){c.f=a(144)},{144:144}],144:[function(a,b,c){var d=a(132)("wks"),e=a(141),f=a(92).Symbol,g="function"==typeof f,h=b.exports=function(a){return d[a]||(d[a]=g&&f[a]||(g?f:e)("Symbol."+a))};h.store=d},{132:132,141:141,92:92}],145:[function(a,b,c){var d=a(77),e=a(144)("iterator"),f=a(108);b.exports=a(81).getIteratorMethod=function(a){if(void 0!=a)return a[e]||a["@@iterator"]||f[d(a)]}},{108:108,144:144,77:77,81:81}],146:[function(a,b,c){"use strict";var d=a(83),e=a(89),f=a(139),g=a(103),h=a(100),i=a(138),j=a(82),k=a(145);e(e.S+e.F*!a(106)(function(a){Array.from(a)}),"Array",{from:function(a){var b,c,e,l,m=f(a),n="function"==typeof this?this:Array,o=arguments.length,p=o>1?arguments[1]:void 0,q=void 0!==p,r=0,s=k(m);if(q&&(p=d(p,o>2?arguments[2]:void 0,2)),void 0==s||n==Array&&h(s))for(b=i(m.length),c=new n(b);b>r;r++)j(c,r,q?p(m[r],r):m[r]);else for(l=s.call(m),c=new n;!(e=l.next()).done;r++)j(c,r,q?g(l,p,[e.value,r],!0):e.value);return c.length=r,c}})},{100:100,103:103,106:106,138:138,139:139,145:145,82:82,83:83,89:89}],147:[function(a,b,c){"use strict";var d=a(73),e=a(107),f=a(108),g=a(137);b.exports=a(105)(Array,"Array",function(a,b){this._t=g(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,c=this._i++;return!a||c>=a.length?(this._t=void 0,e(1)):"keys"==b?e(0,c):"values"==b?e(0,a[c]):e(0,[c,a[c]])},"values"),f.Arguments=f.Array,d("keys"),d("values"),d("entries")},{105:105,107:107,108:108,137:137,73:73}],148:[function(a,b,c){"use strict";var d=a(79);b.exports=a(80)("Map",function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0)}},{get:function(a){var b=d.getEntry(this,a);return b&&b.v},set:function(a,b){return d.def(this,0===a?0:a,b)}},d,!0)},{79:79,80:80}],149:[function(a,b,c){var d=a(89);d(d.S+d.F,"Object",{assign:a(113)})},{113:113,89:89}],150:[function(a,b,c){var d=a(89);d(d.S,"Object",{setPrototypeOf:a(128).set})},{128:128,89:89}],151:[function(a,b,c){"use strict";var d,e,f,g=a(110),h=a(92),i=a(83),j=a(77),k=a(89),l=a(102),m=a(72),n=a(74),o=a(91),p=a(133),q=a(134).set,r=a(112)(),s="Promise",t=h.TypeError,u=h.process,v=h[s],u=h.process,w="process"==j(u),x=function(){},y=!!function(){try{var b=v.resolve(1),c=(b.constructor={})[a(144)("species")]=function(a){a(x,x)};return(w||"function"==typeof PromiseRejectionEvent)&&b.then(x)instanceof c}catch(a){}}(),z=function(a,b){return a===b||a===v&&b===f},A=function(a){var b;return!(!l(a)||"function"!=typeof(b=a.then))&&b},B=function(a){return z(v,a)?new C(a):new e(a)},C=e=function(a){var b,c;this.promise=new a(function(a,d){if(void 0!==b||void 0!==c)throw t("Bad Promise constructor");b=a,c=d}),this.resolve=m(b),this.reject=m(c)},D=function(a){try{a()}catch(a){return{error:a}}},E=function(a,b){if(!a._n){a._n=!0;var c=a._c;r(function(){for(var d=a._v,e=1==a._s,f=0,g=function(b){var c,f,g=e?b.ok:b.fail,h=b.resolve,i=b.reject,j=b.domain;try{g?(e||(2==a._h&&H(a),a._h=1),g===!0?c=d:(j&&j.enter(),c=g(d),j&&j.exit()),c===b.promise?i(t("Promise-chain cycle")):(f=A(c))?f.call(c,h,i):h(c)):i(d)}catch(a){i(a)}};c.length>f;)g(c[f++]);a._c=[],a._n=!1,b&&!a._h&&F(a)})}},F=function(a){q.call(h,function(){var b,c,d,e=a._v;if(G(a)&&(b=D(function(){w?u.emit("unhandledRejection",e,a):(c=h.onunhandledrejection)?c({promise:a,reason:e}):(d=h.console)&&d.error&&d.error("Unhandled promise rejection",e)}),a._h=w||G(a)?2:1),a._a=void 0,b)throw b.error})},G=function(a){if(1==a._h)return!1;for(var b,c=a._a||a._c,d=0;c.length>d;)if(b=c[d++],b.fail||!G(b.promise))return!1;return!0},H=function(a){q.call(h,function(){var b;w?u.emit("rejectionHandled",a):(b=h.onrejectionhandled)&&b({promise:a,reason:a._v})})},I=function(a){var b=this;b._d||(b._d=!0,b=b._w||b,b._v=a,b._s=2,b._a||(b._a=b._c.slice()),E(b,!0))},J=function(a){var b,c=this;if(!c._d){c._d=!0,c=c._w||c;try{if(c===a)throw t("Promise can't be resolved itself");(b=A(a))?r(function(){var d={_w:c,_d:!1};try{b.call(a,i(J,d,1),i(I,d,1))}catch(a){I.call(d,a)}}):(c._v=a,c._s=1,E(c,!1))}catch(a){I.call({_w:c,_d:!1},a)}}};y||(v=function(a){n(this,v,s,"_h"),m(a),d.call(this);try{a(i(J,this,1),i(I,this,1))}catch(a){I.call(this,a)}},d=function(a){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},d.prototype=a(126)(v.prototype,{then:function(a,b){var c=B(p(this,v));return c.ok="function"!=typeof a||a,c.fail="function"==typeof b&&b,c.domain=w?u.domain:void 0,this._c.push(c),this._a&&this._a.push(c),this._s&&E(this,!1),c.promise},catch:function(a){return this.then(void 0,a)}}),C=function(){var a=new d;this.promise=a,this.resolve=i(J,a,1),this.reject=i(I,a,1)}),k(k.G+k.W+k.F*!y,{Promise:v}),a(130)(v,s),a(129)(s),f=a(81)[s],k(k.S+k.F*!y,s,{reject:function(a){var b=B(this),c=b.reject;return c(a),b.promise}}),k(k.S+k.F*(g||!y),s,{resolve:function(a){if(a instanceof v&&z(a.constructor,this))return a;var b=B(this),c=b.resolve;return c(a),b.promise}}),k(k.S+k.F*!(y&&a(106)(function(a){v.all(a).catch(x)})),s,{all:function(a){var b=this,c=B(b),d=c.resolve,e=c.reject,f=D(function(){var c=[],f=0,g=1;o(a,!1,function(a){var h=f++,i=!1;c.push(void 0),g++,b.resolve(a).then(function(a){i||(i=!0,c[h]=a,--g||d(c))},e)}),--g||d(c)});return f&&e(f.error),c.promise},race:function(a){var b=this,c=B(b),d=c.reject,e=D(function(){o(a,!1,function(a){b.resolve(a).then(c.resolve,d)})});return e&&d(e.error),c.promise}})},{102:102,106:106,110:110,112:112,126:126,129:129,130:130,133:133,134:134,144:144,72:72,74:74,77:77,81:81,83:83,89:89,91:91,92:92}],152:[function(a,b,c){"use strict";var d=a(79);b.exports=a(80)("Set",function(a){return function(){return a(this,arguments.length>0?arguments[0]:void 0)}},{add:function(a){return d.def(this,a=0===a?0:a,a)}},d)},{79:79,80:80}],153:[function(a,b,c){"use strict";var d=a(92),e=a(93),f=a(85),g=a(89),h=a(127),i=a(111).KEY,j=a(90),k=a(132),l=a(130),m=a(141),n=a(144),o=a(143),p=a(142),q=a(109),r=a(88),s=a(101),t=a(75),u=a(137),v=a(140),w=a(125),x=a(114),y=a(118),z=a(117),A=a(115),B=a(123),C=z.f,D=A.f,E=y.f,F=d.Symbol,G=d.JSON,H=G&&G.stringify,I="prototype",J=n("_hidden"),K=n("toPrimitive"),L={}.propertyIsEnumerable,M=k("symbol-registry"),N=k("symbols"),O=k("op-symbols"),P=Object[I],Q="function"==typeof F,R=d.QObject,S=!R||!R[I]||!R[I].findChild,T=f&&j(function(){return 7!=x(D({},"a",{get:function(){return D(this,"a",{value:7}).a}})).a})?function(a,b,c){var d=C(P,b);d&&delete P[b],D(a,b,c),d&&a!==P&&D(P,b,d)}:D,U=function(a){var b=N[a]=x(F[I]);return b._k=a,b},V=Q&&"symbol"==typeof F.iterator?function(a){return"symbol"==typeof a}:function(a){return a instanceof F},W=function(a,b,c){return a===P&&W(O,b,c),t(a),b=v(b,!0),t(c),e(N,b)?(c.enumerable?(e(a,J)&&a[J][b]&&(a[J][b]=!1),c=x(c,{enumerable:w(0,!1)})):(e(a,J)||D(a,J,w(1,{})),a[J][b]=!0),T(a,b,c)):D(a,b,c)},X=function(a,b){t(a);for(var c,d=r(b=u(b)),e=0,f=d.length;f>e;)W(a,c=d[e++],b[c]);return a},Y=function(a,b){return void 0===b?x(a):X(x(a),b)},Z=function(a){var b=L.call(this,a=v(a,!0));return!(this===P&&e(N,a)&&!e(O,a))&&(!(b||!e(this,a)||!e(N,a)||e(this,J)&&this[J][a])||b)},$=function(a,b){if(a=u(a),b=v(b,!0),a!==P||!e(N,b)||e(O,b)){var c=C(a,b);return!c||!e(N,b)||e(a,J)&&a[J][b]||(c.enumerable=!0),c}},_=function(a){for(var b,c=E(u(a)),d=[],f=0;c.length>f;)e(N,b=c[f++])||b==J||b==i||d.push(b);return d},aa=function(a){for(var b,c=a===P,d=E(c?O:u(a)),f=[],g=0;d.length>g;)!e(N,b=d[g++])||c&&!e(P,b)||f.push(N[b]);return f};Q||(F=function(){if(this instanceof F)throw TypeError("Symbol is not a constructor!");var a=m(arguments.length>0?arguments[0]:void 0),b=function(c){this===P&&b.call(O,c),e(this,J)&&e(this[J],a)&&(this[J][a]=!1),T(this,a,w(1,c))};return f&&S&&T(P,a,{configurable:!0,set:b}),U(a)},h(F[I],"toString",function(){return this._k}),z.f=$,A.f=W,a(119).f=y.f=_,a(124).f=Z,a(120).f=aa,f&&!a(110)&&h(P,"propertyIsEnumerable",Z,!0),o.f=function(a){return U(n(a))}),g(g.G+g.W+g.F*!Q,{Symbol:F});for(var ba="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ca=0;ba.length>ca;)n(ba[ca++]);for(var ba=B(n.store),ca=0;ba.length>ca;)p(ba[ca++]);g(g.S+g.F*!Q,"Symbol",{for:function(a){return e(M,a+="")?M[a]:M[a]=F(a)},keyFor:function(a){if(V(a))return q(M,a);throw TypeError(a+" is not a symbol!")},useSetter:function(){S=!0},useSimple:function(){S=!1}}),g(g.S+g.F*!Q,"Object",{create:Y,defineProperty:W,defineProperties:X,getOwnPropertyDescriptor:$,getOwnPropertyNames:_,getOwnPropertySymbols:aa}),G&&g(g.S+g.F*(!Q||j(function(){var a=F();return"[null]"!=H([a])||"{}"!=H({a:a})||"{}"!=H(Object(a))})),"JSON",{stringify:function(a){if(void 0!==a&&!V(a)){for(var b,c,d=[a],e=1;arguments.length>e;)d.push(arguments[e++]);return b=d[1],"function"==typeof b&&(c=b),!c&&s(b)||(b=function(a,b){if(c&&(b=c.call(this,a,b)),!V(b))return b}),d[1]=b,H.apply(G,d)}}}),F[I][K]||a(94)(F[I],K,F[I].valueOf),l(F,"Symbol"),l(Math,"Math",!0),l(d.JSON,"JSON",!0)},{101:101,109:109,110:110,111:111,114:114,115:115,117:117,118:118,119:119,120:120,123:123,124:124,125:125,127:127,130:130,132:132,137:137,140:140,141:141,142:142,143:143,144:144,75:75,85:85,88:88,89:89,90:90,92:92,93:93,94:94}],154:[function(b,c,d){!function(b,e){"object"==typeof d?c.exports=d=e():"function"==typeof a&&a.amd?a([],e):b.CryptoJS=e()}(this,function(){var a=a||function(a,b){var c=Object.create||function(){function a(){}return function(b){var c;return a.prototype=b,c=new a,a.prototype=null,c}}(),d={},e=d.lib={},f=e.Base=function(){return{extend:function(a){var b=c(this);return a&&b.mixIn(a),b.hasOwnProperty("init")&&this.init!==b.init||(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var a=this.extend();return a.init.apply(a,arguments),a},init:function(){},mixIn:function(a){for(var b in a)a.hasOwnProperty(b)&&(this[b]=a[b]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),g=e.WordArray=f.extend({init:function(a,c){a=this.words=a||[],c!=b?this.sigBytes=c:this.sigBytes=4*a.length},toString:function(a){return(a||i).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,e=a.sigBytes;if(this.clamp(),d%4)for(var f=0;f>>2]>>>24-f%4*8&255;b[d+f>>>2]|=g<<24-(d+f)%4*8}else for(var f=0;f>>2]=c[f>>>2];return this.sigBytes+=e,this},clamp:function(){var b=this.words,c=this.sigBytes;b[c>>>2]&=4294967295<<32-c%4*8,b.length=a.ceil(c/4)},clone:function(){var a=f.clone.call(this);return a.words=this.words.slice(0),a},random:function(b){for(var c,d=[],e=function(b){var b=b,c=987654321,d=4294967295;return function(){c=36969*(65535&c)+(c>>16)&d,b=18e3*(65535&b)+(b>>16)&d;var e=(c<<16)+b&d;return e/=4294967296,e+=.5,e*(a.random()>.5?1:-1)}},f=0;f>>2]>>>24-e%4*8&255;d.push((f>>>4).toString(16)),d.push((15&f).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>3]|=parseInt(a.substr(d,2),16)<<24-d%8*4;return new g.init(c,b/2)}},j=h.Latin1={stringify:function(a){for(var b=a.words,c=a.sigBytes,d=[],e=0;e>>2]>>>24-e%4*8&255;d.push(String.fromCharCode(f))}return d.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d>>2]|=(255&a.charCodeAt(d))<<24-d%4*8;return new g.init(c,b)}},k=h.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(a){throw new Error("Malformed UTF-8 data")}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},l=e.BufferedBlockAlgorithm=f.extend({reset:function(){this._data=new g.init,this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a)),this._data.concat(a),this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,d=c.words,e=c.sigBytes,f=this.blockSize,h=4*f,i=e/h;i=b?a.ceil(i):a.max((0|i)-this._minBufferSize,0);var j=i*f,k=a.min(4*j,e);if(j){for(var l=0;ld&&(b=a.finalize(b)),b.clamp();for(var e=this._oKey=b.clone(),g=this._iKey=b.clone(),h=e.words,i=g.words,j=0;j>>31}var l=(d<<5|d>>>27)+i+g[j];l+=j<20?(e&f|~e&h)+1518500249:j<40?(e^f^h)+1859775393:j<60?(e&f|e&h|f&h)-1894007588:(e^f^h)-899497514,i=h,h=f,f=e<<30|e>>>2,e=d,d=l}c[0]=c[0]+d|0,c[1]=c[1]+e|0,c[2]=c[2]+f|0,c[3]=c[3]+h|0,c[4]=c[4]+i|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;return b[d>>>5]|=128<<24-d%32,b[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),b[(d+64>>>9<<4)+15]=c,a.sigBytes=4*b.length,this._process(),this._hash},clone:function(){var a=e.clone.call(this);return a._hash=this._hash.clone(),a}});b.SHA1=e._createHelper(h),b.HmacSHA1=e._createHmacHelper(h)}(),a.SHA1})},{154:154}],158:[function(b,c,d){!function(d){"use strict";function e(){var a=d.crypto||d.msCrypto;if(!k&&a&&a.getRandomValues)try{var b=new Uint8Array(16);n=k=function(){return a.getRandomValues(b),b},k()}catch(a){}if(!k){var c=new Array(16);l=k=function(){for(var a,b=0;b<16;b++)0===(3&b)&&(a=4294967296*Math.random()),c[b]=a>>>((3&b)<<3)&255;return c},"undefined"!=typeof console&&console.warn&&console.warn("[SECURITY] node-uuid: crypto not usable, falling back to insecure Math.random()")}}function f(){if("function"==typeof b)try{var a=b("crypto").randomBytes;m=k=a&&function(){return a(16)},k()}catch(a){}}function g(a,b,c){var d=b&&c||0,e=0;for(b=b||[],a.toLowerCase().replace(/[0-9a-f]{2}/g,function(a){e<16&&(b[d+e++]=r[a])});e<16;)b[d+e++]=0;return b}function h(a,b){var c=b||0,d=q;return d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+"-"+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]+d[a[c++]]}function i(a,b,c){var d=b&&c||0,e=b||[];a=a||{};var f=null!=a.clockseq?a.clockseq:v,g=null!=a.msecs?a.msecs:(new Date).getTime(),i=null!=a.nsecs?a.nsecs:x+1,j=g-w+(i-x)/1e4;if(j<0&&null==a.clockseq&&(f=f+1&16383),(j<0||g>w)&&null==a.nsecs&&(i=0),i>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");w=g,x=i,v=f,g+=122192928e5;var k=(1e4*(268435455&g)+i)%4294967296;e[d++]=k>>>24&255,e[d++]=k>>>16&255,e[d++]=k>>>8&255,e[d++]=255&k;var l=g/4294967296*1e4&268435455;e[d++]=l>>>8&255,e[d++]=255&l,e[d++]=l>>>24&15|16,e[d++]=l>>>16&255,e[d++]=f>>>8|128,e[d++]=255&f;for(var m=a.node||u,n=0;n<6;n++)e[d+n]=m[n];return b?b:h(e)}function j(a,b,c){var d=b&&c||0;"string"==typeof a&&(b="binary"===a?new p(16):null,a=null),a=a||{};var e=a.random||(a.rng||k)();if(e[6]=15&e[6]|64,e[8]=63&e[8]|128,b)for(var f=0;f<16;f++)b[d+f]=e[f];return b||h(e)}var k,l,m,n,o;d?e():f();for(var p="function"==typeof Buffer?Buffer:Array,q=[],r={},s=0;s<256;s++)q[s]=(s+256).toString(16).substr(1),r[q[s]]=s;var t=k(),u=[1|t[0],t[1],t[2],t[3],t[4],t[5]],v=16383&(t[6]<<8|t[7]),w=0,x=0,y=j;y.v1=i,y.v4=j,y.parse=g,y.unparse=h,y.BufferClass=p,y._rng=k,y._mathRNG=l,y._nodeRNG=m,y._whatwgRNG=n,"undefined"!=typeof c&&c.exports?c.exports=y:"function"==typeof a&&a.amd?a(function(){return y}):(o=d.uuid,y.noConflict=function(){return d.uuid=o,y},d.uuid=y)}("undefined"!=typeof window?window:null)},{undefined:void 0}],159:[function(a,b,c){"use strict";function d(a){function b(a){}if(!a)throw new TypeError("argument namespace is required");return b._file=void 0,b._ignored=!0,b._namespace=a,b._traced=!1,b._warned=Object.create(null),b.function=e,b.property=f,b}function e(a,b){if("function"!=typeof a)throw new TypeError("argument fn must be a function");return a}function f(a,b,c){if(!a||"object"!=typeof a&&"function"!=typeof a)throw new TypeError("argument obj must be object");var d=Object.getOwnPropertyDescriptor(a,b);if(!d)throw new TypeError("must call property on owner object");if(!d.configurable)throw new TypeError("property must be configurable")}b.exports=d},{}],160:[function(b,c,d){!function(b,e){"undefined"!=typeof d&&"undefined"!=typeof c?c.exports=e():"function"==typeof a&&"object"==typeof a.amd?a(e):"function"==typeof a&&"object"==typeof a.petal?a(b,[],e):this[b]=e()}("validator",function(a){"use strict";function d(a){var b,c,d,e,f=a.match(L);if(f){if(b=f[21],!b)return f[12]?null:0;if("z"===b||"Z"===b)return 0;c=f[22],b.indexOf(":")!==-1?(d=parseInt(f[23]),e=parseInt(f[24])):(d=0,e=parseInt(f[23]))}else{if(a=a.toLowerCase(),b=a.match(/(?:\s|gmt\s*)(-|\+)(\d{1,4})(\s|$)/),!b)return a.indexOf("gmt")!==-1?0:null;c=b[1];var g=b[2];3===g.length&&(g="0"+g),g.length<=2?(d=0,e=parseInt(g)):(d=parseInt(g.slice(0,2)),e=parseInt(g.slice(2,4)))}return(60*d+e)*("-"===c?1:-1)}function e(a,b){a=a||{};for(var c in b)"undefined"==typeof a[c]&&(a[c]=b[c]);return a}function f(a){var b="(\\"+a.symbol.replace(/\./g,"\\.")+")"+(a.require_symbol?"":"?"),c="-?",d="[1-9]\\d*",e="[1-9]\\d{0,2}(\\"+a.thousands_separator+"\\d{3})*",f=["0",d,e],g="("+f.join("|")+")?",h="(\\"+a.decimal_separator+"\\d{2})?",i=g+h;return a.allow_negatives&&!a.parens_for_negatives&&(a.negative_sign_after_digits?i+=c:a.negative_sign_before_digits&&(i=c+i)),a.allow_negative_sign_placeholder?i="( (?!\\-))?"+i:a.allow_space_after_symbol?i=" ?"+i:a.allow_space_after_digits&&(i+="( (?!$))?"),a.symbol_after_digits?i+=b:i=b+i,a.allow_negatives&&(a.parens_for_negatives?i="(\\("+i+"\\)|"+i+")":a.negative_sign_before_digits||a.negative_sign_after_digits||(i=c+i)),new RegExp("^(?!-? )(?=.*\\d)"+i+"$")}a={version:"4.9.0",coerce:!0};for(var g,h=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~]+$/i,i=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f]))*$/i,j=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+$/i,k=/^([\s\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|(\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*$/i,l=/^[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+[a-z\d!#\$%&'\*\+\-\/=\?\^_`{\|}~\.\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF\s]*<(.+)>$/i,m=/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})$/,n=/^[A-Z]{2}[0-9A-Z]{9}[0-9]$/,o=/^(?:[0-9]{9}X|[0-9]{10})$/,p=/^(?:[0-9]{13})$/,q=/^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/,r=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/,s=/^[0-9A-F]{1,4}$/i,t={3:/^[0-9A-F]{8}-[0-9A-F]{4}-3[0-9A-F]{3}-[0-9A-F]{4}-[0-9A-F]{12}$/i,4:/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,5:/^[0-9A-F]{8}-[0-9A-F]{4}-5[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i,all:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i},u={"en-US":/^[A-Z]+$/i,"de-DE":/^[A-ZÄÖÜß]+$/i,"es-ES":/^[A-ZÁÉÍÑÓÚÜ]+$/i,"fr-FR":/^[A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"nl-NL":/^[A-ZÉËÏÓÖÜ]+$/i,"pt-PT":/^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,"ru-RU":/^[А-ЯЁа-яё]+$/i},v={"en-US":/^[0-9A-Z]+$/i,"de-DE":/^[0-9A-ZÄÖÜß]+$/i,"es-ES":/^[0-9A-ZÁÉÍÑÓÚÜ]+$/i,"fr-FR":/^[0-9A-ZÀÂÆÇÉÈÊËÏÎÔŒÙÛÜŸ]+$/i,"nl-NL":/^[0-9A-ZÉËÏÓÖÜ]+$/i,"pt-PT":/^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i,"ru-RU":/^[0-9А-ЯЁа-яё]+$/i},w=["AU","GB","HK","IN","NZ","ZA","ZM"],x=0;x=0},a.matches=function(a,b,c){return"[object RegExp]"!==Object.prototype.toString.call(b)&&(b=new RegExp(b,c)),b.test(a)};var N={allow_display_name:!1,allow_utf8_local_part:!0,require_tld:!0};a.isEmail=function(b,c){if(c=e(c,N),c.allow_display_name){var d=b.match(l);d&&(b=d[1])}var f=b.split("@"),g=f.pop(),m=f.join("@"),n=g.toLowerCase();if("gmail.com"!==n&&"googlemail.com"!==n||(m=m.replace(/\./g,"").toLowerCase()),!a.isByteLength(m,{max:64})||!a.isByteLength(g,{max:256}))return!1;if(!a.isFQDN(g,{require_tld:c.require_tld}))return!1;if('"'===m[0])return m=m.slice(1,m.length-1),c.allow_utf8_local_part?k.test(m):i.test(m);for(var o=c.allow_utf8_local_part?j:h,p=m.split("."),q=0;q=2083||/\s/.test(b))return!1;if(0===b.indexOf("mailto:"))return!1;c=e(c,O);var d,f,g,h,i,j,k;if(k=b.split("://"),k.length>1){if(d=k.shift(),c.require_valid_protocol&&c.protocols.indexOf(d)===-1)return!1}else{if(c.require_protocol)return!1;c.allow_protocol_relative_urls&&"//"===b.substr(0,2)&&(k[0]=b.substr(2))}return b=k.join("://"),k=b.split("#"),b=k.shift(),k=b.split("?"),b=k.shift(),k=b.split("/"),b=k.shift(),k=b.split("@"),!(k.length>1&&(f=k.shift(),f.indexOf(":")>=0&&f.split(":").length>2))&&(h=k.join("@"),k=h.split(":"),g=k.shift(),!(k.length&&(j=k.join(":"),i=parseInt(j,10),!/^[0-9]+$/.test(j)||i<=0||i>65535))&&(!(!a.isIP(g)&&!a.isFQDN(g,c)&&"localhost"!==g)&&((!c.host_whitelist||c.host_whitelist.indexOf(g)!==-1)&&(!c.host_blacklist||c.host_blacklist.indexOf(g)===-1))))},a.isMACAddress=function(a){return q.test(a)},a.isIP=function(b,c){if(c=c?c+"":"",!c)return a.isIP(b,4)||a.isIP(b,6);if("4"===c){if(!r.test(b))return!1;var d=b.split(".").sort(function(a,b){return a-b});return d[3]<=255}if("6"===c){var e=b.split(":"),f=!1,g=a.isIP(e[e.length-1],4),h=g?7:8;if(e.length>h)return!1;if("::"===b)return!0;"::"===b.substr(0,2)?(e.shift(),e.shift(),f=!0):"::"===b.substr(b.length-2)&&(e.pop(),e.pop(),f=!0);for(var i=0;i0&&i=1:e.length===h}return!1};var P={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1};a.isFQDN=function(a,b){b=e(b,P),b.allow_trailing_dot&&"."===a[a.length-1]&&(a=a.substring(0,a.length-1));var c=a.split(".");if(b.require_tld){var d=c.pop();if(!c.length||!/^([a-z\u00a1-\uffff]{2,}|xn[a-z0-9-]{2,})$/i.test(d))return!1}for(var f,g=0;g=0)return!1;f=f.replace(/_/g,"")}if(!/^[a-z\u00a1-\uffff0-9-]+$/i.test(f))return!1;if(/[\uff01-\uff5e]/.test(f))return!1;if("-"===f[0]||"-"===f[f.length-1])return!1}return!0},a.isBoolean=function(a){return["true","false","1","0"].indexOf(a)>=0},a.isAlpha=function(a,b){if(b=b||"en-US",b in u)return u[b].test(a);throw new Error("Invalid locale '"+b+"'")},a.isAlphanumeric=function(a,b){if(b=b||"en-US",b in v)return v[b].test(a);throw new Error("Invalid locale '"+b+"'")},a.isNumeric=function(a){return y.test(a)},a.isDecimal=function(a){return""!==a&&C.test(a)},a.isHexadecimal=function(a){return B.test(a)},a.isHexColor=function(a){return D.test(a)},a.isLowercase=function(a){return a===a.toLowerCase()},a.isUppercase=function(a){return a===a.toUpperCase(); +},a.isInt=function(a,b){return b=b||{},z.test(a)&&(!b.hasOwnProperty("min")||a>=b.min)&&(!b.hasOwnProperty("max")||a<=b.max)},a.isFloat=function(a,b){return b=b||{},""!==a&&"."!==a&&(A.test(a)&&(!b.hasOwnProperty("min")||a>=b.min)&&(!b.hasOwnProperty("max")||a<=b.max))},a.isDivisibleBy=function(b,c){return a.toFloat(b)%parseInt(c,10)===0},a.isNull=function(a){return 0===a.length},a.isLength=function(a,b){var c,d;"object"==typeof b?(c=b.min||0,d=b.max):(c=arguments[1],d=arguments[2]);var e=a.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g)||[],f=a.length-e.length;return f>=c&&("undefined"==typeof d||f<=d)},a.isByteLength=function(a,b){var c,d;"object"==typeof b?(c=b.min||0,d=b.max):(c=arguments[1],d=arguments[2]);var e=encodeURI(a).split(/%..|./).length-1;return e>=c&&("undefined"==typeof d||e<=d)},a.isUUID=function(a,b){var c=t[b?b:"all"];return c&&c.test(a)},a.isDate=function(a){var b=new Date(Date.parse(a));if(isNaN(b))return!1;var c=d(a);if(null!==c){var e=b.getTimezoneOffset()-c;b=new Date(b.getTime()+6e4*e)}var f,g,h,i=String(b.getDate());return!(g=a.match(/(^|[^:\d])[23]\d([^:\d]|$)/g))||(f=g.map(function(a){return a.match(/\d+/g)[0]}).join("/"),h=String(b.getFullYear()).slice(-2),f===i||f===h||(f===i+"/"+h||f===h+"/"+i))},a.isAfter=function(b,c){var d=a.toDate(c||new Date),e=a.toDate(b);return!!(e&&d&&e>d)},a.isBefore=function(b,c){var d=a.toDate(c||new Date),e=a.toDate(b);return!!(e&&d&&e=0}return"object"==typeof c?c.hasOwnProperty(b):!(!c||"function"!=typeof c.indexOf)&&c.indexOf(b)>=0},a.isWhitelisted=function(a,b){for(var c=a.length-1;c>=0;c--)if(b.indexOf(a[c])===-1)return!1;return!0},a.isCreditCard=function(a){var b=a.replace(/[^0-9]+/g,"");if(!m.test(b))return!1;for(var c,d,e,f=0,g=b.length-1;g>=0;g--)c=b.substring(g,g+1),d=parseInt(c,10),e?(d*=2,f+=d>=10?d%10+1:d):f+=d,e=!e;return!(f%10!==0||!b)},a.isISIN=function(a){if(!n.test(a))return!1;for(var b,c,d=a.replace(/[A-Z]/g,function(a){return parseInt(a,36)}),e=0,f=!0,g=d.length-2;g>=0;g--)b=d.substring(g,g+1),c=parseInt(b,10),f?(c*=2,e+=c>=10?c+1:c):e+=c,f=!f;return parseInt(a.substr(a.length-1),10)===(1e4-e)%10},a.isISBN=function(b,c){if(c=c?c+"":"",!c)return a.isISBN(b,10)||a.isISBN(b,13);var d,e=b.replace(/[\s-]+/g,""),f=0;if("10"===c){if(!o.test(e))return!1;for(d=0;d<9;d++)f+=(d+1)*e.charAt(d);if(f+="X"===e.charAt(9)?100:10*e.charAt(9),f%11===0)return!!e}else if("13"===c){if(!p.test(e))return!1;var g=[1,3];for(d=0;d<12;d++)f+=g[d%2]*e.charAt(d);if(e.charAt(12)-(10-f%10)%10===0)return!!e}return!1},a.isMobilePhone=function(a,b){return b in K&&K[b].test(a)};var Q={symbol:"$",require_symbol:!1,allow_space_after_symbol:!1,symbol_after_digits:!1,allow_negatives:!0,parens_for_negatives:!1,negative_sign_before_digits:!1,negative_sign_after_digits:!1,allow_negative_sign_placeholder:!1,thousands_separator:",",decimal_separator:".",allow_space_after_digits:!1};a.isCurrency=function(a,b){return b=e(b,Q),f(b).test(a)},a.isJSON=function(a){try{var b=JSON.parse(a);return!!b&&"object"==typeof b}catch(a){}return!1},a.isMultibyte=function(a){return F.test(a)},a.isAscii=function(a){return E.test(a)},a.isFullWidth=function(a){return G.test(a)},a.isHalfWidth=function(a){return H.test(a)},a.isVariableWidth=function(a){return G.test(a)&&H.test(a)},a.isSurrogatePair=function(a){return I.test(a)},a.isBase64=function(a){return J.test(a)},a.isMongoId=function(b){return a.isHexadecimal(b)&&24===b.length},a.isISO8601=function(a){return L.test(a)},a.ltrim=function(a,b){var c=b?new RegExp("^["+b+"]+","g"):/^\s+/g;return a.replace(c,"")},a.rtrim=function(a,b){var c=b?new RegExp("["+b+"]+$","g"):/\s+$/g;return a.replace(c,"")},a.trim=function(a,b){var c=b?new RegExp("^["+b+"]+|["+b+"]+$","g"):/^\s+|\s+$/g;return a.replace(c,"")},a.escape=function(a){return a.replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">").replace(/\//g,"/").replace(/\`/g,"`")},a.stripLow=function(b,c){var d=c?"\\x00-\\x09\\x0B\\x0C\\x0E-\\x1F\\x7F":"\\x00-\\x1F\\x7F";return a.blacklist(b,d)},a.whitelist=function(a,b){return a.replace(new RegExp("[^"+b+"]+","g"),"")},a.blacklist=function(a,b){return a.replace(new RegExp("["+b+"]+","g"),"")};var R={lowercase:!0,remove_dots:!0,remove_extension:!0};return a.normalizeEmail=function(b,c){if(c=e(c,R),!a.isEmail(b))return!1;var d=b.split("@",2);if(d[1]=d[1].toLowerCase(),"gmail.com"===d[1]||"googlemail.com"===d[1]){if(c.remove_extension&&(d[0]=d[0].split("+")[0]),c.remove_dots&&(d[0]=d[0].replace(/\./g,"")),!d[0].length)return!1;d[0]=d[0].toLowerCase(),d[1]="gmail.com"}else c.lowercase&&(d[0]=d[0].toLowerCase());return d.join("@")},a.init(),a})},{159:159}],161:[function(a,b,c){"use strict";a(152),a(148),Object.assign||a(149),Object.setPrototypeOf||a(150),"undefined"==typeof Promise&&a(151),Array.from||(a(146),a(147)),"undefined"==typeof Symbol&&a(153)},{146:146,147:147,148:148,149:149,150:150,151:151,152:152,153:153}]},{},[35])(35)}); \ No newline at end of file diff --git a/doc/Acl.html b/doc/Acl.html new file mode 100644 index 00000000..a5b6ab2d --- /dev/null +++ b/doc/Acl.html @@ -0,0 +1,3015 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Acl + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Acl

+ + + + + + +
+ +
+ +

Acl

+ +

Creates a new Acl object, with an empty rule set for an object

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Acl(metadataopt)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
metadata + + +Metadata + + + + + + <optional>
+ + + + + +

the metadata of the object, null for files

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

allowReadAccess(…userOrRole) → {Acl}

+ + + + + +
+

Allows the given user or rule to read the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
userOrRole + + +User +| + +Role +| + +string + + + + + + + + + + <repeatable>
+ +

The user or role to allow

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

this acl object

+
+ + + +
+
+ Type +
+
+ +Acl + + +
+
+ + + + + + + + + + +

allowWriteAccess(…userOrRole) → {Acl}

+ + + + + +
+

Allows the given user or rule to write the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
userOrRole + + +User +| + +Role +| + +string + + + + + + + + + + <repeatable>
+ +

The user or role to allow

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

this acl object

+
+ + + +
+
+ Type +
+
+ +Acl + + +
+
+ + + + + + + + + + +

clear()

+ + + + + +
+

Removes all acl rules, read and write access is public afterwards

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

copy(acl) → {Acl}

+ + + + + +
+

Copies permissions from another ACL

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
acl + + +Acl + + + +

The ACL to copy from

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Acl + + +
+
+ + + + + + + + + + +

deleteReadAccess(…userOrRole) → {Acl}

+ + + + + +
+

Deletes any read allow/deny rule for the given user or role

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
userOrRole + + +User +| + +Role +| + +string + + + + + + + + + + <repeatable>
+ +

The user or role

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

this acl object

+
+ + + +
+
+ Type +
+
+ +Acl + + +
+
+ + + + + + + + + + +

deleteWriteAccess(…userOrRole) → {Acl}

+ + + + + +
+

Deletes any write allow/deny rule for the given user or role

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
userOrRole + + +User +| + +Role +| + +string + + + + + + + + + + <repeatable>
+ +

The user or role

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

this acl object

+
+ + + +
+
+ Type +
+
+ +Acl + + +
+
+ + + + + + + + + + +

denyReadAccess(…userOrRole) → {Acl}

+ + + + + +
+

Denies the given user or rule to read the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
userOrRole + + +User +| + +Role +| + +string + + + + + + + + + + <repeatable>
+ +

The user or role to deny

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

this acl object

+
+ + + +
+
+ Type +
+
+ +Acl + + +
+
+ + + + + + + + + + +

denyWriteAccess(…userOrRole) → {Acl}

+ + + + + +
+

Denies the given user or rule to write the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
userOrRole + + +User +| + +Role +| + +string + + + + + + + + + + <repeatable>
+ +

The user or role to deny

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

this acl object

+
+ + + +
+
+ Type +
+
+ +Acl + + +
+
+ + + + + + + + + + +

fromJSON(json)

+ + + + + +
+

Sets the acl rules form json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
json + + +json + + + +

The json encoded acls

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

isPublicReadAllowed() → {boolean}

+ + + + + +
+

Gets whenever all users and roles have the permission to read the object

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

true If public access is allowed

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

isPublicWriteAllowed() → {boolean}

+ + + + + +
+

Gets whenever all users and roles have the permission to write the object

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

true If public access is allowed

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

isReadAllowed(userOrRole) → {boolean}

+ + + + + +
+

Checks whenever the user or role is explicit allowed to read the object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
userOrRole + + +User +| + +Role +| + +string + + + +

The user or role to check for

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

true if read access is explicitly allowed for the given user or role

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

isReadDenied(userOrRole) → {boolean}

+ + + + + +
+

Checks whenever the user or role is explicit denied to read the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
userOrRole + + +User +| + +Role +| + +string + + + +

The user or role to check for

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

true if read access is explicitly denied for the given user or role

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

isWriteAllowed(userOrRole) → {boolean}

+ + + + + +
+

Checks whenever the user or role is explicit allowed to write the object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
userOrRole + + +User +| + +Role +| + +string + + + +

The user or role to check for

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

true if write access is explicitly allowed for the given user or role

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

isWriteDenied(userOrRole) → {boolean}

+ + + + + +
+

Checks whenever the user or role is explicit denied to write the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
userOrRole + + +User +| + +Role +| + +string + + + +

The user or role to check for

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

true if write access is explicitly denied for the given user or role

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

setPublicReadAllowed()

+ + + + + +
+

Sets whenever all users and roles should have the permission to read the object.
Note: All other allow read rules will be removed.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setPublicWriteAllowed()

+ + + + + +
+

Sets whenever all users and roles should have the permission to write the object.
Note: All other allow write rules will be removed.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

A Json representation of the set of rules

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/EntityManager.html b/doc/EntityManager.html new file mode 100644 index 00000000..e608cf7b --- /dev/null +++ b/doc/EntityManager.html @@ -0,0 +1,6811 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: EntityManager + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: EntityManager

+ + + + + + +
+ +
+ +

EntityManager

+ + +
+ +
+
+ + + + + +

new EntityManager(entityManagerFactory)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entityManagerFactory + + +EntityManagerFactory + + + +

The factory which of this entityManager instance

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

[YourEntityClass: string] :*

+ + + + +
+

An Object factory for entity or embedded objects,
that can be accessed by the type name of the entity type.
An object factory can be called to create new instances of the type.
The created instances implements the binding.Entity or the binding.Managed interface
whenever the class is an entity or embedded object

+
+ + + +
Type:
+
    +
  • + +* + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

Device :binding.DeviceFactory

+ + + + +
+

An Device factory for user objects.
The Device factory can be called to create new instances of devices or can be used to register, push to and
check registration status of devices.

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

File :binding.FileFactory

+ + + + +
+

A File factory for file objects.
The file factory can be called to create new instances for files.
The created instances implements the binding.File interface

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isOpen :boolean

+ + + + +
+

Determine whether the entity manager is open.
true until the entity manager has been closed

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isReady :boolean

+ + + + +
+

Indicates if there is currently no exclusive operation executed
true If no exclusive lock is hold

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

Role :binding.EntityFactory.<model.Role>

+ + + + +
+

An Role factory for role objects.
The Role factory can be called to create new instances of roles, later on users can be attached to roles to manage the
access permissions through this role
The created instances implements the model.Role interface

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

token

+ + + + +
+

The authentication token if the user is logged in currently

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

token :String

+ + + + +
+

The authentication token if the user is logged in currently

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

User :binding.UserFactory

+ + + + +
+

An User factory for user objects.
The User factory can be called to create new instances of users or can be used to register/login/logout users.
The created instances implements the model.User interface

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addToBlackList(objectId)

+ + + + + +
+

Adds the given object id to the cacheBlackList if needed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
objectId + + +string + + + +

The id to add.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

addToWhiteList(objectId)

+ + + + + +
+

Adds the given object id to the cacheWhiteList if needed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
objectId + + +string + + + +

The id to add.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

attach(entity)

+ + + + + +
+

Attach the instance to this database context, if it is not already attached

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

The entity to attach

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

clear()

+ + + + + +
+

Clear the persistence context, causing all managed entities to become detached.
Changes made to entities that have not been flushed to the database will not be persisted.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

close()

+ + + + + +
+

Close an application-managed entity manager. After the close method has been invoked,
all methods on the EntityManager instance and any Query and TypedQuery objects obtained from it
will throw the IllegalStateError except for transaction, and isOpen (which will return false).
If this method is called when the entity manager is associated with an active transaction,
the persistence context remains managed until the transaction completes.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

connected(connector, connectData, tokenStorage)

+ + + + + +
+

Connects this entityManager, used for synchronous and asynchronous initialization

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
connector + + +Connector + + + +
connectData + + +Object + + + +
tokenStorage + + +TokenStorage + + + +

The used tokenStorage for token persistence

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

contains(entity) → {boolean}

+ + + + + +
+

Check if the instance is a managed entity instance belonging to the current persistence context.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

boolean indicating if entity is in persistence context

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

containsById(entity) → {boolean}

+ + + + + +
+

Check if an object with the id from the given entity is already attached.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

boolean indicating if entity with same id is attached

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

createQueryBuilder(resultClassopt) → {query.Builder.<*>}

+ + + + + +
+

Creates an instance of Query.Builder for query creation and execution. The Query results are instances of the
resultClass argument.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
resultClass + + +<*> + + + + + + <optional>
+ + + + + +

the type of the query result

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A query builder to create one ore more queries for the specified class

+
+ + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

createURL(relativePath, authorizeopt) → {string}

+ + + + + +
+

Creates a absolute url for the given relative one

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
relativePath + + +string + + + + + + + + + +

the relative url

authorize + + +boolean + + + + + + <optional>
+ + + + + +

indicates if authorization credentials should be generated and be attached to the url

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

a absolute url wich is optionaly signed with a resource token which authenticates the currently
logged in user

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +

delete(entity, options) → {Promise.<binding.Entity>}

+ + + + + +
+

Delete the entity instance.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
options + + +Object + + + +

The delete options

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

detach(entity)

+ + + + + +
+

Remove the given entity from the persistence context, causing a managed entity to become detached.
Unflushed changes made to the entity if any (including removal of the entity),
will not be synchronized to the database. Entities which previously referenced the detached entity will continue to reference it.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

ensureBloomFilterFreshness()

+ + + + + +
+

Checks the freshness of the bloom filter and does a reload if necessary

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

ensureCacheHeader(id, message, refresh)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +string + + + +

To check the bloom filter

message + + +Message + + + +

To attach the headers

refresh + + +boolean + + + +

To force the reload headers

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

flush() → {Promise.<*>}

+ + + + + +
+

Synchronize the persistence context to the underlying database.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

GeoPoint(latitudeopt, longitudeopt) → {void}

+ + + + + +
+

Constructor for a new GeoPoint

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
latitude + + +string +| + +number +| + +Object +| + +<number> + + + + + + <optional>
+ + + + + +

A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude

longitude + + +number + + + + + + <optional>
+ + + + + +

The GeoPoint's longitude

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new created GeoPoint

+
+ + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + + +

getReference(entityClass, keyopt)

+ + + + + +
+

Get an instance, whose state may be lazily fetched. If the requested instance does not exist
in the database, the EntityNotFoundError is thrown when the instance state is first accessed.
The application should not expect that the instance state will be available upon detachment,
unless it was accessed by the application while the entity manager was open.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entityClass + + +Entity> +| + +string + + + + + + + + + +
key + + +string + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

getSubEntities(entity, depth, resolvedopt, initialEntityopt) → {Array.<binding.Entity>}

+ + + + + +
+

Returns all referenced sub entities for the given depth and root entity

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entity + + +Entity + + + + + + + + + +
depth + + +boolean +| + +number + + + + + + + + + +
resolved + + +Entity> + + + + + + <optional>
+ + + + + +
initialEntity + + +Entity + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

getSubEntitiesByPath(entity, path) → {Array.<binding.Entity>}

+ + + + + +
+

Returns all referenced one level sub entities for the given path

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
path + + +<string> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

insert(entity, options) → {Promise.<binding.Entity>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
options + + +Object + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

List(…args) → {void}

+ + + + + +
+

Constructor for a new List collection

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +* + + + + + + + + + + <repeatable>
+ +

Same arguments can be passed as the Array constructor takes

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new created List

+
+ + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + + +

load(entityClass, oid, optionsopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Search for an entity of the specified oid.
If the entity instance is contained in the persistence context, it is returned from there.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entityClass + + +Entity> +| + +string + + + + + + + + + +

entity class

oid + + +String + + + + + + + + + +

Object ID

options + + +Object + + + + + + <optional>
+ + + + + +

The load options.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the loaded entity or null

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

Map(collectionopt) → {void}

+ + + + + +
+

Constructor for a new Map collection

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
collection + + +<*> + + + + + + <optional>
+ + + + + +

The initial array or collection to initialize the new Map

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new created Map

+
+ + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + + +

mustRevalidate(id) → {boolean}

+ + + + + +
+

Checks for a given id, if revalidation is required, the resource is stale or caching was disabled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +string + + + +

The object id to check

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Indicates if the resource must be revalidated

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

optimisticSave(entity, cb) → {Promise.<binding.Entity>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
cb + + +function + + + +

pre-safe callback

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

persist(entity)

+ + + + + +
+

Make an instance managed and persistent.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

ready(doneCallbackopt, failCallbackopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

failCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

When the lock can't be released caused by a none
recoverable error

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + +

refresh(entity, options) → {Promise.<binding.Entity>}

+ + + + + +
+

Refresh the state of the instance from the database, overwriting changes made to the entity, if any.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

options + + +Object + + + +

The refresh options

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

resolveDepth(entity, optionsopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Resolve the depth by loading the referenced objects of the given entity.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entity + + +Entity + + + + + + + + + +

entity instance

options + + +Object + + + + + + <optional>
+ + + + + +

The load options

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

save(entity, options, withoutLockopt) → {Promise.<binding.Entity>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entity + + +Entity + + + + + + + + + +
options + + +Object + + + + + + + + + +

The save options

withoutLock + + +boolean + + + + + + <optional>
+ + + + + +

Set true to save the entity without locking

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

Set(collectionopt) → {void}

+ + + + + +
+

Constructor for a new Set collection

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
collection + + +<*> + + + + + + <optional>
+ + + + + +

The initial array or collection to initialize the new Set

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new created Set

+
+ + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + + +

update(entity, options) → {Promise.<binding.Entity>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
options + + +Object + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

validate(entity) → {util.ValidationResult}

+ + + + + +
+

The given entity will be checked by the validation code of the entity type.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

result

+
+ + + +
+
+ Type +
+
+ +ValidationResult + + +
+
+ + + + + + + + + + +

(protected) withLock(callback, criticalopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Try to aquire an exclusive lock and executes the given callback.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
callback + + +Lockable~callback + + + + + + + + + + + +

The exclusive operation to execute

critical + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Indicates if the operation is critical. If the operation is critical and the
operation fails, then the lock will not be released

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Throws:
+ + + +
+
+
+

If the lock can't be aquired

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

A promise

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/EntityManagerFactory.html b/doc/EntityManagerFactory.html new file mode 100644 index 00000000..6bdb1134 --- /dev/null +++ b/doc/EntityManagerFactory.html @@ -0,0 +1,2554 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: EntityManagerFactory + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: EntityManagerFactory

+ + + + + + +
+ +
+ +

EntityManagerFactory

+ + +
+ +
+
+ + + + + +

new EntityManagerFactory(optionsopt)

+ + + + + +
+

Creates a new EntityManagerFactory connected to the given destination

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +string +| + +Object + + + + + + <optional>
+ + + + + +

The destination to connect with, or an options object

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
host + + +string + + + + + + <optional>
+ + + + + +
+ +

The destination to connect with

port + + +number + + + + + + <optional>
+ + + + + +
+ + 80|443 + +

The optional destination port to connect with

secure + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

true To use a secure ssl encrypted connection

basePath + + +string + + + + + + <optional>
+ + + + + +
+ + "/v1" + +

The base path of the api

schema + + +Object + + + + + + <optional>
+ + + + + +
+ + null + +

The serialized schema as json used to initialize the metamodel

tokenStorage + + +TokenStorage + + + + + + <optional>
+ + + + + +
+ +

The tokenStorage which should be used by this emf

tokenStorageFactory + + +TokenStorageFactory + + + + + + <optional>
+ + + + + +
+ +

The tokenStorage factory implementation which should
be used for token storage

staleness + + +number + + + + + + <optional>
+ + + + + +
+ + 60 + +

The maximum staleness of objects that are acceptable while reading cached data

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isReady :boolean

+ + + + +
+

Indicates if there is currently no exclusive operation executed
true If no exclusive lock is hold

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

staleness :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

tokenStorage :util.TokenStorage

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

configure(options)

+ + + + + +
+

Apply additional configurations to this EntityManagerFactory

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + +

The additional configuration options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
tokenStorage + + +TokenStorage + + + + + + <optional>
+ + + + + +
+ +

The tokenStorage which should be used by this emf

tokenStorageFactory + + +TokenStorageFactory + + + + + + <optional>
+ + + + + +
+ +

The tokenStorage factory implementation which should
be used for token storage

staleness + + +number + + + + + + <optional>
+ + + + + +
+ + 60 + +

The maximum staleness of objects that are acceptable while reading cached data,
0 to always bypass the browser cache

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

connect(hostOrApp, portopt, secureopt, basePathopt)

+ + + + + +
+

Connects this EntityManager to the given destination

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
hostOrApp + + +string + + + + + + + + + + + +

The host or the app name to connect with

port + + +number + + + + + + <optional>
+ + + + + +
+ + 80|443 + +

The port to connect to

secure + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

true To use a secure connection

basePath + + +string + + + + + + <optional>
+ + + + + +
+ + "/v1" + +

The base path of the api

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

connect(hostOrApp, secureopt)

+ + + + + +
+

Connects this EntityManager to the given destination

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
hostOrApp + + +string + + + + + + + + + + + +

The host or the app name to connect with

secure + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

true To use a secure connection

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

createEntityManager(useSharedTokenStorageopt) → {EntityManager}

+ + + + + +
+

Create a new application-managed EntityManager.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
useSharedTokenStorage + + +boolean + + + + + + <optional>
+ + + + + +

The token storage to persist the authorization token, or
true To use the shared token storage of the emf.
false To use a instance based storage.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

a new entityManager

+
+ + + +
+
+ Type +
+
+ +EntityManager + + +
+
+ + + + + + + + + + +

createMetamodel() → {metamodel.Metamodel}

+ + + + + +
+

Creates a new Metamodel instance, which is not connected

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new Metamodel instance

+
+ + + +
+
+ Type +
+
+ +Metamodel + + +
+
+ + + + + + + + + + +

ready(doneCallbackopt, failCallbackopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

failCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

When the lock can't be released caused by a none
recoverable error

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + +

(protected) withLock(callback, criticalopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Try to aquire an exclusive lock and executes the given callback.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
callback + + +Lockable~callback + + + + + + + + + + + +

The exclusive operation to execute

critical + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Indicates if the operation is critical. If the operation is critical and the
operation fails, then the lock will not be released

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Throws:
+ + + +
+
+
+

If the lock can't be aquired

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

A promise

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/EntityTransaction.html b/doc/EntityTransaction.html new file mode 100644 index 00000000..97693b93 --- /dev/null +++ b/doc/EntityTransaction.html @@ -0,0 +1,977 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: EntityTransaction + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: EntityTransaction

+ + + + + + +
+ +
+ +

EntityTransaction

+ + +
+ +
+
+ + + + + +

new EntityTransaction(entityManager)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entityManager + + +EntityManager + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

isActive

+ + + + +
+

Indicate whether a resource transaction is in progress.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

begin()

+ + + + + +
+

Start a resource transaction.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

commit()

+ + + + + +
+

Commit the current resource transaction, writing any unflushed changes to the database.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

getRollbackOnly() → {boolean}

+ + + + + +
+

Determine whether the current resource transaction has been marked for rollback.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

indicating whether the transaction has been marked for rollback

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

rollback()

+ + + + + +
+

Roll back the current resource transaction.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setRollbackOnly()

+ + + + + +
+

Mark the current resource transaction so that the only possible outcome of the transaction is for the transaction to be rolled back.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/GeoPoint.html b/doc/GeoPoint.html new file mode 100644 index 00000000..701b0c99 --- /dev/null +++ b/doc/GeoPoint.html @@ -0,0 +1,1487 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GeoPoint + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GeoPoint

+ + + + + + +
+ +
+ +

GeoPoint

+ +

Creates a new GeoPoint instance
From latitude and longitude
From a json object
Or an tuple of latitude and longitude

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new GeoPoint(latitudeopt, longitudeopt)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
latitude + + +string +| + +number +| + +Object +| + +<number> + + + + + + <optional>
+ + + + + +

A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude

longitude + + +number + + + + + + <optional>
+ + + + + +

The GeoPoint's longitude

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) EARTH_RADIUS_IN_KILOMETERS :number

+ + + + +
+

The Earth radius in kilometers used by GeoPoint#kilometersTo

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) EARTH_RADIUS_IN_MILES :number

+ + + + +
+

The Earth radius in miles used by GeoPoint#milesTo

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(static) current() → {Promise.<GeoPoint>}

+ + + + + +
+

Creates a GeoPoint with the user's current location, if available.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with a GeoPoint

+
+ + + +
+
+ Type +
+
+ +<GeoPoint> + + +
+
+ + + + + + + + + + +

kilometersTo(point) → {number}

+ + + + + +
+

Returns the distance from this GeoPoint to another in kilometers.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
point + + +GeoPoint + + + +

another GeoPoint

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The distance in kilometers

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + + +

milesTo(point) → {number}

+ + + + + +
+

Returns the distance from this GeoPoint to another in miles.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
point + + +GeoPoint + + + +

another GeoPoint

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The distance in miles

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + + +

radiansTo(point) → {number}

+ + + + + +
+

Computes the arc, in radian, between two WGS-84 positions.

+

The haversine formula implementation is taken from:
http://www.movable-type.co.uk/scripts/latlong.html

+

Returns the distance from this GeoPoint to another in radians.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
point + + +GeoPoint + + + +

another GeoPoint

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the arc, in radian, between two WGS-84 positions

+
+ + + +
+
+ Type +
+
+ +number + + +
+
+ + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

Returns a JSON representation of the GeoPoint

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A GeoJson object of this GeoPoint

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

toString() → {string}

+ + + + + +
+

A String representation in latitude, longitude format

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The string representation of this class

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/StreamingEvent.html b/doc/StreamingEvent.html new file mode 100644 index 00000000..f9756ced --- /dev/null +++ b/doc/StreamingEvent.html @@ -0,0 +1,936 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: StreamingEvent<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: StreamingEvent

+ + + + + + +
+ +
+ +

StreamingEvent

+ + +
+ +
+
+ + + + + +

new StreamingEvent()

+ + + + + +
+

An event for a streaming query.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

data :T

+ + + + +
+

the database entity this event was generated for, e.g. an entity that just entered or left the result set

+
+ + + +
Type:
+
    +
  • + +T + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

date :Date

+ + + + +
+

server-time from the instant at which the event was generated

+
+ + + +
Type:
+
    +
  • + +Date + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

index :number

+ + + + +
+

for sorting queries only: the position of the matching entity in the ordered result (-1 for non-matching entities)

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

initial :boolean

+ + + + +
+

a boolean value indicating whether this event reflects the matching status at query time (true) or a recent change data change (false)

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

matchType :string

+ + + + +
+

indicates how the transmitted entity relates to the query result.
Every event is delivered with one of the following match types:


  • 'match': the entity matches the query.

  • 'add': the entity entered the result set, i.e. it did not match before and is matching now.

  • 'change': the entity was updated, but remains a match

  • 'changeIndex' (for sorting queries only): the entity was updated and remains a match, but changed its position within the query result

  • 'remove': the entity was a match before, but is not matching any longer

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

operation :string

+ + + + +
+

the operation by which the entity was altered ('insert', 'update' or 'delete'; 'none' if unknown or not applicable)

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

target :query.Node.<T>

+ + + + +
+

the query on which .stream([options]) was invoked

+
+ + + +
Type:
+
    +
  • + +<T> + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/baqend.html b/doc/baqend.html new file mode 100644 index 00000000..0a01c2fc --- /dev/null +++ b/doc/baqend.html @@ -0,0 +1,7453 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Interface: baqend + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Interface: baqend

+ + + + + + +
+ +
+ +

baqend

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

[YourEntityClass: string] :*

+ + + + +
+

An Object factory for entity or embedded objects,
that can be accessed by the type name of the entity type.
An object factory can be called to create new instances of the type.
The created instances implements the binding.Entity or the binding.Managed interface
whenever the class is an entity or embedded object

+
+ + + +
Type:
+
    +
  • + +* + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

Device :binding.DeviceFactory

+ + + + +
+

An Device factory for user objects.
The Device factory can be called to create new instances of devices or can be used to register, push to and
check registration status of devices.

+
+ + + +
Type:
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

File :binding.FileFactory

+ + + + +
+

A File factory for file objects.
The file factory can be called to create new instances for files.
The created instances implements the binding.File interface

+
+ + + +
Type:
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isOpen :boolean

+ + + + +
+

Determine whether the entity manager is open.
true until the entity manager has been closed

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isReady :boolean

+ + + + +
+

Indicates if there is currently no exclusive operation executed
true If no exclusive lock is hold

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

Role :binding.EntityFactory.<model.Role>

+ + + + +
+

An Role factory for role objects.
The Role factory can be called to create new instances of roles, later on users can be attached to roles to manage the
access permissions through this role
The created instances implements the model.Role interface

+
+ + + +
Type:
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

token :String

+ + + + +
+

The authentication token if the user is logged in currently

+
+ + + +
Type:
+
    +
  • + +String + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

User :binding.UserFactory

+ + + + +
+

An User factory for user objects.
The User factory can be called to create new instances of users or can be used to register/login/logout users.
The created instances implements the model.User interface

+
+ + + +
Type:
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addToBlackList(objectId)

+ + + + + +
+

Adds the given object id to the cacheBlackList if needed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
objectId + + +string + + + +

The id to add.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

addToWhiteList(objectId)

+ + + + + +
+

Adds the given object id to the cacheWhiteList if needed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
objectId + + +string + + + +

The id to add.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

attach(entity)

+ + + + + +
+

Attach the instance to this database context, if it is not already attached

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

The entity to attach

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

clear()

+ + + + + +
+

Clear the persistence context, causing all managed entities to become detached.
Changes made to entities that have not been flushed to the database will not be persisted.

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

close()

+ + + + + +
+

Close an application-managed entity manager. After the close method has been invoked,
all methods on the EntityManager instance and any Query and TypedQuery objects obtained from it
will throw the IllegalStateError except for transaction, and isOpen (which will return false).
If this method is called when the entity manager is associated with an active transaction,
the persistence context remains managed until the transaction completes.

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

configure(options) → {baqend}

+ + + + + +
+

Configures the DB with additional config options

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
options + + +Object + + + +

The additional configuration options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
tokenStorage + + +TokenStorage + + + + + + <optional>
+ + + + + +
+ +

The tokenStorage which should be used by this emf

tokenStorageFactory + + +TokenStorageFactory + + + + + + <optional>
+ + + + + +
+ +

The tokenStorage factory implementation which should
be used for token storage

staleness + + +number + + + + + + <optional>
+ + + + + +
+ + 60 + +

The maximum staleness of objects that are acceptable while reading cached data,
0 to always bypass the browser cache

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +baqend + + +
+
+ + + + + + + + + + +

connect(hostOrApp, secureopt, doneCallbackopt, failCallbackopt) → {Promise.<EntityManager>}

+ + + + + +
+

Connects the DB with the server and calls the callback on success

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
hostOrApp + + +string + + + + + + + + + + + +

The host or the app name to connect with

secure + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

true To use a secure connection

doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +
+ +

The callback, called when a connection is established and the
SDK is ready to use

failCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +
+ +

When an error occurred while initializing the SDK

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<EntityManager> + + +
+
+ + + + + + + + + + +

connected(connector, connectData, tokenStorage)

+ + + + + +
+

Connects this entityManager, used for synchronous and asynchronous initialization

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
connector + + +Connector + + + +
connectData + + +Object + + + +
tokenStorage + + +TokenStorage + + + +

The used tokenStorage for token persistence

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

contains(entity) → {boolean}

+ + + + + +
+

Check if the instance is a managed entity instance belonging to the current persistence context.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

boolean indicating if entity is in persistence context

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

containsById(entity) → {boolean}

+ + + + + +
+

Check if an object with the id from the given entity is already attached.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

boolean indicating if entity with same id is attached

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

createQueryBuilder(resultClassopt) → {query.Builder.<*>}

+ + + + + +
+

Creates an instance of Query.Builder for query creation and execution. The Query results are instances of the
resultClass argument.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
resultClass + + +<*> + + + + + + <optional>
+ + + + + +

the type of the query result

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A query builder to create one ore more queries for the specified class

+
+ + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

createURL(relativePath, authorizeopt) → {string}

+ + + + + +
+

Creates a absolute url for the given relative one

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
relativePath + + +string + + + + + + + + + +

the relative url

authorize + + +boolean + + + + + + <optional>
+ + + + + +

indicates if authorization credentials should be generated and be attached to the url

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

a absolute url wich is optionaly signed with a resource token which authenticates the currently
logged in user

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +

delete(entity, options) → {Promise.<binding.Entity>}

+ + + + + +
+

Delete the entity instance.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
options + + +Object + + + +

The delete options

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

detach(entity)

+ + + + + +
+

Remove the given entity from the persistence context, causing a managed entity to become detached.
Unflushed changes made to the entity if any (including removal of the entity),
will not be synchronized to the database. Entities which previously referenced the detached entity will continue to reference it.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

ensureBloomFilterFreshness()

+ + + + + +
+

Checks the freshness of the bloom filter and does a reload if necessary

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

ensureCacheHeader(id, message, refresh)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +string + + + +

To check the bloom filter

message + + +Message + + + +

To attach the headers

refresh + + +boolean + + + +

To force the reload headers

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

flush() → {Promise.<*>}

+ + + + + +
+

Synchronize the persistence context to the underlying database.

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

GeoPoint(latitudeopt, longitudeopt) → {void}

+ + + + + +
+

Constructor for a new GeoPoint

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
latitude + + +string +| + +number +| + +Object +| + +<number> + + + + + + <optional>
+ + + + + +

A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude

longitude + + +number + + + + + + <optional>
+ + + + + +

The GeoPoint's longitude

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new created GeoPoint

+
+ + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + + +

getReference(entityClass, keyopt)

+ + + + + +
+

Get an instance, whose state may be lazily fetched. If the requested instance does not exist
in the database, the EntityNotFoundError is thrown when the instance state is first accessed.
The application should not expect that the instance state will be available upon detachment,
unless it was accessed by the application while the entity manager was open.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entityClass + + +Entity> +| + +string + + + + + + + + + +
key + + +string + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

getSubEntities(entity, depth, resolvedopt, initialEntityopt) → {Array.<binding.Entity>}

+ + + + + +
+

Returns all referenced sub entities for the given depth and root entity

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entity + + +Entity + + + + + + + + + +
depth + + +boolean +| + +number + + + + + + + + + +
resolved + + +Entity> + + + + + + <optional>
+ + + + + +
initialEntity + + +Entity + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

getSubEntitiesByPath(entity, path) → {Array.<binding.Entity>}

+ + + + + +
+

Returns all referenced one level sub entities for the given path

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
path + + +<string> + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

insert(entity, options) → {Promise.<binding.Entity>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
options + + +Object + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

List(…args) → {void}

+ + + + + +
+

Constructor for a new List collection

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +* + + + + + + + + + + <repeatable>
+ +

Same arguments can be passed as the Array constructor takes

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new created List

+
+ + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + + +

load(entityClass, oid, optionsopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Search for an entity of the specified oid.
If the entity instance is contained in the persistence context, it is returned from there.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entityClass + + +Entity> +| + +string + + + + + + + + + +

entity class

oid + + +String + + + + + + + + + +

Object ID

options + + +Object + + + + + + <optional>
+ + + + + +

The load options.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the loaded entity or null

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

Map(collectionopt) → {void}

+ + + + + +
+

Constructor for a new Map collection

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
collection + + +<*> + + + + + + <optional>
+ + + + + +

The initial array or collection to initialize the new Map

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new created Map

+
+ + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + + +

mustRevalidate(id) → {boolean}

+ + + + + +
+

Checks for a given id, if revalidation is required, the resource is stale or caching was disabled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
id + + +string + + + +

The object id to check

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Indicates if the resource must be revalidated

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

optimisticSave(entity, cb) → {Promise.<binding.Entity>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
cb + + +function + + + +

pre-safe callback

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

persist(entity)

+ + + + + +
+

Make an instance managed and persistent.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

ready(doneCallbackopt, failCallbackopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

failCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

When the lock can't be released caused by a none
recoverable error

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + +

refresh(entity, options) → {Promise.<binding.Entity>}

+ + + + + +
+

Refresh the state of the instance from the database, overwriting changes made to the entity, if any.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

entity instance

options + + +Object + + + +

The refresh options

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

resolveDepth(entity, optionsopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Resolve the depth by loading the referenced objects of the given entity.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entity + + +Entity + + + + + + + + + +

entity instance

options + + +Object + + + + + + <optional>
+ + + + + +

The load options

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

save(entity, options, withoutLockopt) → {Promise.<binding.Entity>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
entity + + +Entity + + + + + + + + + +
options + + +Object + + + + + + + + + +

The save options

withoutLock + + +boolean + + + + + + <optional>
+ + + + + +

Set true to save the entity without locking

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

Set(collectionopt) → {void}

+ + + + + +
+

Constructor for a new Set collection

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
collection + + +<*> + + + + + + <optional>
+ + + + + +

The initial array or collection to initialize the new Set

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new created Set

+
+ + + +
+
+ Type +
+
+ +void + + +
+
+ + + + + + + + + + +

update(entity, options) → {Promise.<binding.Entity>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
options + + +Object + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

validate(entity) → {util.ValidationResult}

+ + + + + +
+

The given entity will be checked by the validation code of the entity type.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

result

+
+ + + +
+
+ Type +
+
+ +ValidationResult + + +
+
+ + + + + + + + + + +

(protected) withLock(callback, criticalopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Try to aquire an exclusive lock and executes the given callback.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
callback + + +Lockable~callback + + + + + + + + + + + +

The exclusive operation to execute

critical + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Indicates if the operation is critical. If the operation is critical and the
operation fails, then the lock will not be released

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Throws:
+ + + +
+
+
+

If the lock can't be aquired

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

A promise

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.Accessor.html b/doc/binding.Accessor.html new file mode 100644 index 00000000..da6ec84a --- /dev/null +++ b/doc/binding.Accessor.html @@ -0,0 +1,780 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Accessor + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Accessor

+ + + + + + +
+ +
+ +

+ binding.Accessor

+ + +
+ +
+
+ + + + + +

new Accessor()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

getValue(object, attribute) → {*}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
object + + +Object + + + +
attribute + + +Attribute + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

setValue(object, attribute, value)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
object + + +Object + + + +
attribute + + +Attribute + + + +
value + + +* + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.DeviceFactory.html b/doc/binding.DeviceFactory.html new file mode 100644 index 00000000..a88e91e7 --- /dev/null +++ b/doc/binding.DeviceFactory.html @@ -0,0 +1,1156 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DeviceFactory + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DeviceFactory

+ + + + + + +
+ +
+ +

+ binding.DeviceFactory

+ + +
+ +
+
+ + + + + +

new DeviceFactory(propertiesopt, …arguments) → {model.Device}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
properties + + +Object + + + + + + <optional>
+ + + + + +

initial properties to set on the instance

arguments + + +* + + + + + + + + + + <repeatable>
+ +

Additional constructor params passed through the type constructor

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new managed instance

+
+ + + +
+
+ Type +
+
+ +Device + + +
+
+ + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isRegistered

+ + + + +
+

Returns true if the devices is already registered, otherwise false.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

push(pushMessage, doneCallbackopt, failCallbackopt) → {Promise.<any>}

+ + + + + +
+

Uses the info from the given {util.PushMessage} message to send an push notification.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
pushMessage + + +PushMessage + + + + + + + + + +

to send an push notification.

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<any> + + +
+
+ + + + + + + + + + +

register(os, token, deviceopt, doneCallbackopt, failCallbackopt) → {Promise.<any>}

+ + + + + +
+

Register a new device with the given device token and OS.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
os + + +string + + + + + + + + + +

The OS of the device (IOS/Android)

token + + +string + + + + + + + + + +

The GCM or APNS device token

device + + +Device + + + + + + <optional>
+ + + + + +

A optional device entity to set custom field values

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<any> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.Enhancer.html b/doc/binding.Enhancer.html new file mode 100644 index 00000000..be468a5d --- /dev/null +++ b/doc/binding.Enhancer.html @@ -0,0 +1,1347 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Enhancer + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Enhancer

+ + + + + + +
+ +
+ +

+ binding.Enhancer

+ + +
+ +
+
+ + + + + +

new Enhancer()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

createProxy(superClass) → {Class.<*>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
superClass + + +<*> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

typeConstructor

+
+ + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

enhance(type, typeConstructor)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +ManagedType + + + +
typeConstructor + + +<*> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

enhanceProperty(proto, attribute)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proto + + +Object + + + +
attribute + + +Attribute + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

enhancePrototype(proto, type)

+ + + + + +
+

Enhance the prototype of the type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proto + + +Object + + + +
type + + +ManagedType + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

getIdentifier(typeConstructor) → {string}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
typeConstructor + + +<*> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +

setIdentifier(typeConstructor, identifier)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
typeConstructor + + +<*> + + + +
identifier + + +string + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.Entity.html b/doc/binding.Entity.html new file mode 100644 index 00000000..89111df4 --- /dev/null +++ b/doc/binding.Entity.html @@ -0,0 +1,3793 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Entity + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Entity

+ + + + + + +
+ +
+ +

+ binding.Entity

+ + +
+ +
+
+ + + + + +

new Entity(propertiesopt)

+ + + + + +
+

The default constructor, copy all given properties to this object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
properties + + +Object + + + + + + <optional>
+ + + + + +

The optional properties to copy

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

acl :Acl

+ + + + +
+

The object read/write permissions

+
+ + + +
Type:
+
    +
  • + +Acl + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

id :string

+ + + + +
+

The unique id of this object

+

Sets the unique id of this object, if the id is not formatted as an valid id,
it will be used as the key component of the id has the same affect as setting the key

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key :string

+ + + + +
+

The unique key part of the id
When the key of the unique id is set an error will be thrown if an id is already set.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version :number

+ + + + +
+

The version of this object

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

attach(db)

+ + + + + +
+

Attach this object to the given db

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
db + + +EntityManager + + + +

The db which will be used for future crud operations

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

delete(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Delete an existing object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The remove options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the remove operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be removed. Depth 0 removes this object only,
true removes objects by reachability.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

insert(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Inserts a new object. Inserts the object if it doesn't exists and raise an error if the object already exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The insertion options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be inserted. Depth 0 insert this object only,
true inserts objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

load(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Resolves the referenced object in the specified depth. Only unresolved objects will be loaded unless the refresh option is specified.
Removed objects will be marked as removed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The load options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be loaded. Depth set to true
loads objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

optimisticSave(cb, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object and repeats the operation if the object is out of date.
In each pass the callback will be called. Ths first parameter of the callback is the entity and the second one
is a function to abort the process.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
cb + + +function + + + + + + + + + +

Will be called in each pass

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

ready(doneCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

save(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object. Inserts the object if it doesn't exists and updates the object if the object exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The save options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the save operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be saved. Depth 0 save this object only,
true saves the objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

toJSON(excludeMetadataopt) → {json}

+ + + + + +
+

Converts the entity to an JSON-Object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
excludeMetadata + + +boolean + + + + + + <optional>
+ + + + + +

Indicates if the metadata i.e. id, version and acls should not be included into the json

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

JSON-Object

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

update(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Updates an existing object.
Updates the object if it exists and raise an error if the object doesn't exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The update options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the update operation, the version will not be validated, only existence will be checked.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be updated. Depth 0 updates this object only,
true updates objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

validate() → {util.ValidationResult}

+ + + + + +
+

Validates the entity by using the validation code of the entity type

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Contains the result of the Validation

+
+ + + +
+
+ Type +
+
+ +ValidationResult + + +
+
+ + + + + + + + + +

Type Definitions

+ + + + + + +

doneCallback(entity) → {Promise.<*>|*}

+ + + + + +
+

The done callback is called, when the asynchronous operation completes successfully

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +

This entity

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise, result or undefined

+
+ + + +
+
+ Type +
+
+ +<*> +| + +* + + +
+
+ + + + + + + + + + +

failCallback(error) → {Promise.<*>|*}

+ + + + + +
+

The fail callback is called, when the asynchronous operation is rejected by an error

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
error + + +PersistentError + + + +

The error which reject the operation

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise, result or undefined

+
+ + + +
+
+ Type +
+
+ +<*> +| + +* + + +
+
+ + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.EntityFactory.html b/doc/binding.EntityFactory.html new file mode 100644 index 00000000..f6081015 --- /dev/null +++ b/doc/binding.EntityFactory.html @@ -0,0 +1,2122 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: EntityFactory<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: EntityFactory

+ + + + + + +
+ +
+ +

+ binding.EntityFactory

+ + +
+ +
+
+ + + + + +

new EntityFactory(propertiesopt, …arguments) → {T}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
properties + + +Object + + + + + + <optional>
+ + + + + +

initial properties to set on the instance

arguments + + +* + + + + + + + + + + <repeatable>
+ +

Additional constructor params passed through the type constructor

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new managed instance

+
+ + + +
+
+ Type +
+
+ +T + + +
+
+ + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

(protected) _db :EntityManager

+ + + + +
+

The owning EntityManager where this factory belongs to

+
+ + + +
Type:
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(protected) _managedType :metamodel.ManagedType

+ + + + +
+

The managed type of this factory

+
+ + + +
Type:
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

methods :Object.<string, function()>

+ + + + +
+

Methods that are added to object instances
This property is an alias for this factory type prototype

+
+ + + +
Type:
+
    +
  • + +<string, function()> + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addMethod(name, fn)

+ + + + + +
+

Add a method to instances of this factories type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

The method name to add

fn + + +function + + + +

The Method to add

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

addMethods(methods)

+ + + + + +
+

Adds methods to instances of this factories type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
methods + + +<string, function()> + + + +

The methods to add

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

find() → {query.Builder.<T>}

+ + + + + +
+

Creates a new query for this class

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The query builder

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

fromJSON(json) → {T}

+ + + + + +
+

Creates a new instance and sets the DatabaseObject to the given json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
json + + +json + + + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

instance

+
+ + + +
+
+ Type +
+
+ +T + + +
+
+ + + + + + + + + + +

load(id, optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<T>}

+ + + + + +
+

Loads the instance for the given id, or null if the id does not exists.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
id + + +string + + + + + + + + + +

The id to query

options + + +Object + + + + + + <optional>
+ + + + + +

The load options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be saved. Depth 0 saves only this object,
true saves the objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Indicates whether the object should be revalidated (cache bypass).

local + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Indicates whether the local copy (from the entity manager)
of an object should be returned if it exists. This value might be stale.

+ +
doneCallback + + +EntityFactory~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +EntityFactory~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

new(properties) → {T}

+ + + + + +
+

Creates a new instance of the of this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
properties + + +<string, *> + + + +

Additional properties which will be applied to the created instance

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new created instance of this class

+
+ + + +
+
+ Type +
+
+ +T + + +
+
+ + + + + + + + + + +

newInstance(argsopt) → {T}

+ + + + + +
+

Creates a new instance of the factory type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +<*> + + + + + + <optional>
+ + + + + +

Constructor arguments used for instantiation, the constructor will not be called
when no arguments are passed

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new created instance of T

+
+ + + +
+
+ Type +
+
+ +T + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.Factory.html b/doc/binding.Factory.html new file mode 100644 index 00000000..1b63f375 --- /dev/null +++ b/doc/binding.Factory.html @@ -0,0 +1,852 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Factory<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Factory

+ + + + + + +
+ +
+ +

+ binding.Factory

+ + +
+ +
+
+ + + + + +

new Factory(…args) → {T}

+ + + + + +
+

This factory creates instances of type T, by invoking the #new() method or by instanciating this factory directly

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +any + + + + + + + + + + <repeatable>
+ +

constructor params passed to the type constructor

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new instance

+
+ + + +
+
+ Type +
+
+ +T + + +
+
+ + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

new(…args) → {*}

+ + + + + +
+

Creates a new instance of the factory type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +any + + + + + + + + + + <repeatable>
+ +

Constructor arguments used for instantiation

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new created instance of *

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

newInstance(aopt) → {*}

+ + + + + +
+

Creates a new instance of the factory type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
a + + +<*> + + + + + + <optional>
+ + + + + +

Constructor arguments used for instantiation

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new created instance of *

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.File.html b/doc/binding.File.html new file mode 100644 index 00000000..0ac501d1 --- /dev/null +++ b/doc/binding.File.html @@ -0,0 +1,4108 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: File + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: File

+ + + + + + +
+ +
+ +

+ binding.File

+ +

Creates a file object, which represents one specific file reference.
This File object can afterwards be used to up- and download the file contents or to retrieves and change the files
metadata.

+

The file data can be uploaded and downloaded as:

+


































type JavaScript type Description
'arraybuffer' ArrayBuffer The content is represented as a fixed-length raw binary data buffer
'blob'
Blob The content is represented as a simple blob
'json' object|array|string The file content is represented as json
'text' string The file content is represented through the string
'base64' string The file content as base64 encoded string
'data-url' string A data url which represents the file content
+ + +
+ +
+
+ + + + +

Constructor

+ + +

new File(fileOptions)

+ + + + + +
+

Creates a new file object which represents the a file at the given id. Data are provided to the constructor will
be uploaded by invoking upload()

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fileOptions + + +object +| + +string + + + +

The fileOptions used to create a new file object, or just the id of the
file object

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
id + + +string + + + + + + <optional>
+ + + + + +
+ +

The id of the file.

name + + +string + + + + + + <optional>
+ + + + + +
+ +

The filename without the id. If omitted and data is provided as a file object, the
File#name will be used otherwise a uuid will be generated.

parent + + +string + + + + + + <optional>
+ + + + + +
+ + "/www" + +

The parent folder which contains the file

path + + +string + + + + + + <optional>
+ + + + + +
+ + "/www" + +

The full path of the file. You might either specifiy the path of the file or a combination of parent and file name.

data + + +string +| + +Blob +| + +File +| + +ArrayBuffer +| + +json + + + + + + + + + + + +

The initial file content, which will be uploaded by
invoking #upload later on.

type + + +string + + + + + + <optional>
+ + + + + +
+ +

A optional type hint used to correctly interpret the provided data

mimeType + + +string + + + + + + <optional>
+ + + + + +
+ +

The mimType of the file. Defaults to the mimeType of the provided data if
it is a file object, blob or data-url

eTag + + +string + + + + + + <optional>
+ + + + + +
+ +

The optional current ETag of the file

lastModified + + +string + + + + + + <optional>
+ + + + + +
+ +

The optional last modified date

acl + + +Acl + + + + + + <optional>
+ + + + + +
+ +

The file acl which will be set, if the file is uploaded afterwards

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

acl :string

+ + + + +
+

The current file acl, only accessible after fetching the metadata or downloading/uploading/providing the file

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

eTag :string

+ + + + +
+

The eTag of the file, only accessible after fetching the metadata or downloading/uploading/providing the file

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

id :string

+ + + + +
+

The complete id of the file, including folder and name

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isMetadataLoaded :boolean

+ + + + +
+

Indicates if the metadata are loaded.

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

lastModified :string

+ + + + +
+

The last modified date of the file, only accessible after fetching the metadata or downloading/uploading/providing the eTag

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

mimeType :string

+ + + + +
+

The mimeType of the file, only accessible after fetching the metadata or downloading/uploading/providing the file

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

name :string

+ + + + +
+

The name of the file

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

parent :string

+ + + + +
+

The parent folder of the file.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

path :string

+ + + + +
+

The full path of the file.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

size :string

+ + + + +
+

The size of the file, only accessible after fetching the metadata or downloading/uploading/providing the file

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

url :string

+ + + + +
+

The fully url to the file, can be directly used to link the file, i.e. in link tags ot image sources

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

delete(deleteOptionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.File>}

+ + + + + +
+

Deletes a file

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
deleteOptions + + +object + + + + + + <optional>
+ + + + + +

The delete options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

force the deletion without verifying any version

+ +
doneCallback + + +File~deleteCallback + + + + + + <optional>
+ + + + + +

The callback is invoked after the deletion succeed successfully

failCallback + + +File~failCallback + + + + + + <optional>
+ + + + + +

The callback is invoked if any error is occurred

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which will be fulfilled with this file object

+
+ + + +
+
+ Type +
+
+ +File> + + +
+
+ + + + + + + + + + +

download(downloadOptionsopt, doneCallbackopt, failCallbackopt) → {Promise.<(string|Blob|File|ArrayBuffer|json)>}

+ + + + + +
+

Download a file and providing it in the requested type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
downloadOptions + + +object + + + + + + <optional>
+ + + + + +

The download options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
type + + +string + + + + + + <optional>
+ + + + + +
+ + "blob" + +

The type used to provide the file

refresh + + +string + + + + + + <optional>
+ + + + + +
+ + false + +

Indicates to make a revalidation request and not use the cache

+ +
doneCallback + + +File~downloadCallback + + + + + + <optional>
+ + + + + +

The callback is invoked after the download succeed successfully

failCallback + + +File~failCallback + + + + + + <optional>
+ + + + + +

The callback is invoked if any error is occurred

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which will be fulfilled with the downloaded file content

+
+ + + +
+
+ Type +
+
+ +<(string|Blob|File|ArrayBuffer|json)> + + +
+
+ + + + + + + + + + +

loadMetadata(options, doneCallbackopt, failCallbackopt) → {Promise.<binding.File>}

+ + + + + +
+

Gets the file metadata of a file

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + + + + +

The load metadata options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
refresh + + +Object + + + + + + <optional>
+ + + + + +
+ + false + +

Force a revalidation while fetching the metadata

+ +
doneCallback + + +File~fileCallback + + + + + + <optional>
+ + + + + +

The callback is invoked after the metadata is fetched

failCallback + + +File~failCallback + + + + + + <optional>
+ + + + + +

The callback is invoked if any error has occurred

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which will be fulfilled with this file

+
+ + + +
+
+ Type +
+
+ +File> + + +
+
+ + + + + + + + + + +

saveMetadata() → {Promise.<binding.File>}

+ + + + + +
+

Updates the matadata of this file.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
options.force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

force the update and overwrite the existing metadata without validating it

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which will be fulfilled with this file

+
+ + + +
+
+ Type +
+
+ +File> + + +
+
+ + + + + + + + + + +

upload(uploadOptionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.File>}

+ + + + + +
+

Uploads the file content which was provided in the constructor or by uploadOptions.data

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
uploadOptions + + +object + + + + + + <optional>
+ + + + + +

The upload options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +string +| + +Blob +| + +File +| + +ArrayBuffer +| + +json + + + + + + + + + + + +

The initial file content, which will be uploaded by
invoking #upload later on.

type + + +string + + + + + + <optional>
+ + + + + +
+ +

A optional type hint used to correctly interpret the provided data

mimeType + + +string + + + + + + <optional>
+ + + + + +
+ +

The mimType of the file. Defaults to the mimeType of the provided data if
it is a file object, blob or data-url

eTag + + +string + + + + + + <optional>
+ + + + + +
+ +

The optional current ETag of the file

lastModified + + +string + + + + + + <optional>
+ + + + + +
+ +

The optional last modified date

acl + + +Acl + + + + + + <optional>
+ + + + + +
+ +

The file acl which will be set, if the file is uploaded afterwards

force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

force the upload and overwrite any existing files without validating it

progress + + +Message~progressCallback + + + + + + <optional>
+ + + + + +
+ +

listen to progress changes during upload

+ +
doneCallback + + +File~fileCallback + + + + + + <optional>
+ + + + + +

The callback is invoked after the upload succeed successfully

failCallback + + +File~failCallback + + + + + + <optional>
+ + + + + +

The callback is invoked if any error is occurred

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which will be fulfilled with this file object where the metadata is updated

+
+ + + +
+
+ Type +
+
+ +File> + + +
+
+ + + + + + + + + +

Type Definitions

+ + + + + + +

deleteCallback(data) → {any}

+ + + + + +
+

The delete callback is called, when the asynchronous deletion completes successfully

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +File + + + +

The file metadata

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise, result or undefined

+
+ + + +
+
+ Type +
+
+ +any + + +
+
+ + + + + + + + + + +

downloadCallback(data) → {any}

+ + + + + +
+

The download callback is called, when the asynchronous download completes successfully

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +string +| + +Blob +| + +File +| + +ArrayBuffer +| + +json + + + +

The download file content in the requested format

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise, result or undefined

+
+ + + +
+
+ Type +
+
+ +any + + +
+
+ + + + + + + + + + +

failCallback(error) → {any}

+ + + + + +
+

The fail callback is called, when the asynchronous operation is rejected by an error

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
error + + +PersistentError + + + +

The error which reject the operation

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise, result or undefined

+
+ + + +
+
+ Type +
+
+ +any + + +
+
+ + + + + + + + + + +

fileCallback(file) → {any}

+ + + + + +
+

The file callback is called, when the asynchronous operation completes successfully

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
file + + +File + + + +

The updated file metadata

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise, result or undefined

+
+ + + +
+
+ Type +
+
+ +any + + +
+
+ + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.FileFactory.html b/doc/binding.FileFactory.html new file mode 100644 index 00000000..a032c609 --- /dev/null +++ b/doc/binding.FileFactory.html @@ -0,0 +1,2984 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: FileFactory + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: FileFactory

+ + + + + + +
+ +
+ +

+ binding.FileFactory

+ + +
+ +
+
+ + + + + +

new FileFactory(propertiesopt, …arguments) → {binding.File}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
properties + + +Object + + + + + + <optional>
+ + + + + +

initial properties to set on the file

arguments + + +* + + + + + + + + + + <repeatable>
+ +

Additional constructor params passed through the type constructor

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new managed instance

+
+ + + +
+
+ Type +
+
+ +File + + +
+
+ + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + +

create(db) → {binding.FileFactory}

+ + + + + +
+

Creates a new FileFactory for the given type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
db + + +EntityManager + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new file factory

+
+ + + +
+
+ Type +
+
+ +FileFactory + + +
+
+ + + + + + + + + + +

listBuckets(doneCallbackopt, failCallbackopt) → {Promise.<Array.<binding.File>>}

+ + + + + +
+

Lists all the buckets.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +FileFactory~fileListCallback + + + + + + <optional>
+ + + + + +

The callback is invoked with the listed buckets

failCallback + + +File~failCallback + + + + + + <optional>
+ + + + + +

The callback is invoked if any error has occurred

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The listed buckets.

+
+ + + +
+
+ Type +
+
+ +File>> + + +
+
+ + + + + + + + + + +

listFiles(folder, start, count, doneCallbackopt, failCallbackopt) → {Promise.<Array.<binding.File>>}

+ + + + + +
+

Lists the files (and folders) in the given folder.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
folder + + +File +| + +string + + + + + + + + + +

The folder/path to list.

start + + +File + + + + + + + + + +

The file/folder from where to start listing (not included)

count + + +number + + + + + + + + + +

The maximum number of files to return.

doneCallback + + +FileFactory~fileListCallback + + + + + + <optional>
+ + + + + +

The callback is invoked with the listed files

failCallback + + +File~failCallback + + + + + + <optional>
+ + + + + +

The callback is invoked if any error has occurred

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The listed files/folders.

+
+ + + +
+
+ Type +
+
+ +File>> + + +
+
+ + + + + + + + + + +

loadMetadata(bucket, options, doneCallbackopt, failCallbackopt) → {Promise.<Object>}

+ + + + + +
+

Gets the metadata of the root folder (formally the file "bucket")

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
bucket + + +string + + + + + + + + + +

The name of the root file directory

options + + +Object + + + + + + + + + +

The load metadata options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
refresh + + +Object + + + + + + <optional>
+ + + + + +
+ + false + +

Force a revalidation while fetching the metadata

+ +
doneCallback + + +FileFactory~bucketMetadataCallback + + + + + + <optional>
+ + + + + +

The callback is invoked after the metadata is fetched

failCallback + + +File~failCallback + + + + + + <optional>
+ + + + + +

The callback is invoked if any error has occurred

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which will be fulfilled with the bucket acls

+
+ + + +
+
+ Type +
+
+ +<Object> + + +
+
+ + + + + + + + + + +

new(fileOptions) → {binding.File}

+ + + + + +
+

Creates a new file object which represents the a file at the given id. Data are provided to the constructor will
be uploaded by invoking upload()

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fileOptions + + +object +| + +string + + + +

The fileOptions used to create a new file object, or just the id of the
file object

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
name + + +string + + + + + + <optional>
+ + + + + +
+ +

The filename without the id. If omitted and data is provided as a file object, the
File#name will be used otherwise a uuid will be generated.

parent + + +string + + + + + + <optional>
+ + + + + +
+ + "/www" + +

The parent folder which contains the file

data + + +string +| + +Blob +| + +File +| + +ArrayBuffer +| + +json + + + + + + + + + + + +

The initial file content, which will be uploaded by
invoking #upload later on.

type + + +string + + + + + + <optional>
+ + + + + +
+ +

A optional type hint used to correctly interpret the provided data

mimeType + + +string + + + + + + <optional>
+ + + + + +
+ +

The mimType of the file. Defaults to the mimeType of the provided data if
it is a file object, blob or data-url

eTag + + +string + + + + + + <optional>
+ + + + + +
+ +

The optional current ETag of the file

lastModified + + +string + + + + + + <optional>
+ + + + + +
+ +

The optional last modified date

acl + + +Acl + + + + + + <optional>
+ + + + + +
+ +

The file acl which will be set, if the file is uploaded afterwards

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new file instance

+
+ + + +
+
+ Type +
+
+ +File + + +
+
+ + + + + + + + + + +

newInstance(argsopt) → {binding.File}

+ + + + + +
+

Creates a new file

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +<*> + + + + + + <optional>
+ + + + + +

Constructor arguments used for instantiation, the constructor will not be called
when no arguments are passed

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new created file

+
+ + + +
+
+ Type +
+
+ +File + + +
+
+ + + + + + + + + + +

saveMetadata(bucket, metadata, doneCallbackopt, failCallbackopt) → {Promise.<void>}

+ + + + + +
+

Updates the metadata of the root file directory formally the file "bucket"

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
bucket + + +string + + + + + + + + + +

The name of the root file directory

metadata + + +Object + + + + + + + + + +

The new metadata for the bucket

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
loadPermission + + +Permission + + + +

The load permission which grants read access to all stored
files under the specified bucket

insertPermission + + +Permission + + + +

The insert permission which is required to insert new
files into the bucket

updatePermission + + +Permission + + + +

The update permission which is required to update existing
files within the bucket

deletePermission + + +Permission + + + +

The delete permission which is required to delete existing
files within the bucket

queryPermission + + +Permission + + + +

The query permission which is required to list all files
within a bucket

+ +
doneCallback + + +FileFactory~bucketMetadataCallback + + + + + + <optional>
+ + + + + +

Invoked if the operation succeeds

failCallback + + +File~failCallback + + + + + + <optional>
+ + + + + +

The callback is invoked if any error has occurred

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which will fulfilled with the updated metadata

+
+ + + +
+
+ Type +
+
+ +<void> + + +
+
+ + + + + + + + + +

Type Definitions

+ + + + + + +

bucketMetadataCallback(bucketMetadata) → {any}

+ + + + + +
+

The list files callback is called, with the bucket metadata

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucketMetadata + + +<Object> + + + +

the bucket metadata

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise, result or undefined

+
+ + + +
+
+ Type +
+
+ +any + + +
+
+ + + + + + + + + + +

fileListCallback(files) → {any}

+ + + + + +
+

The list files callback is called, with the loaded files

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
files + + +File> + + + +

The listed files

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise, result or undefined

+
+ + + +
+
+ Type +
+
+ +any + + +
+
+ + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.Managed.html b/doc/binding.Managed.html new file mode 100644 index 00000000..ce1ac498 --- /dev/null +++ b/doc/binding.Managed.html @@ -0,0 +1,933 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Managed + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Managed

+ + + + + + +
+ +
+ +

+ binding.Managed

+ + +
+ +
+
+ + + + + +

new Managed(propertiesopt)

+ + + + + +
+

The default constructor, copy all given properties to this object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
properties + + +Object + + + + + + <optional>
+ + + + + +

The optional properties to copy

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

(static) extend(childClass) → {Class.<*>}

+ + + + + +
+

Creates a subclass of this class

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
childClass + + +<*> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The extended child class

+
+ + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

(static) init(instance, propertiesopt)

+ + + + + +
+

Initialize the given instance

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
instance + + +Managed + + + + + + + + + +

The managed instance to initialize

properties + + +Object + + + + + + <optional>
+ + + + + +

The optional properties to set on the instance

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

Converts the managed object to an JSON-Object.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

JSON-Object

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.ManagedFactory.html b/doc/binding.ManagedFactory.html new file mode 100644 index 00000000..95a11733 --- /dev/null +++ b/doc/binding.ManagedFactory.html @@ -0,0 +1,1558 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ManagedFactory<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ManagedFactory

+ + + + + + +
+ +
+ +

+ binding.ManagedFactory

+ + +
+ +
+
+ + + + + +

new ManagedFactory(propertiesopt, …args) → {T}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
properties + + +Object + + + + + + <optional>
+ + + + + +

initial properties to set on the instance

args + + +* + + + + + + + + + + <repeatable>
+ +

Additional constructor params passed through the type constructor

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new managed instance

+
+ + + +
+
+ Type +
+
+ +T + + +
+
+ + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

(protected) _db :EntityManager

+ + + + +
+

The owning EntityManager where this factory belongs to

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(protected) _managedType :metamodel.ManagedType

+ + + + +
+

The managed type of this factory

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

methods :Object.<string, function()>

+ + + + +
+

Methods that are added to object instances
This property is an alias for this factory type prototype

+
+ + + +
Type:
+
    +
  • + +<string, function()> + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addMethod(name, fn)

+ + + + + +
+

Add a method to instances of this factories type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

The method name to add

fn + + +function + + + +

The Method to add

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

addMethods(methods)

+ + + + + +
+

Adds methods to instances of this factories type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
methods + + +<string, function()> + + + +

The methods to add

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

fromJSON(json) → {T}

+ + + + + +
+

Creates a new instance and sets the Managed Object to the given json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
json + + +json + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

instance

+
+ + + +
+
+ Type +
+
+ +T + + +
+
+ + + + + + + + + + +

new(properties) → {T}

+ + + + + +
+

Creates a new instance of the of this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
properties + + +<string, *> + + + +

Additional properties which will be applied to the created instance

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new created instance of this class

+
+ + + +
+
+ Type +
+
+ +T + + +
+
+ + + + + + + + + + +

newInstance(argsopt) → {T}

+ + + + + +
+

Creates a new instance of the factory type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +<*> + + + + + + <optional>
+ + + + + +

Constructor arguments used for instantiation, the constructor will not be called
when no arguments are passed

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new created instance of T

+
+ + + +
+
+ Type +
+
+ +T + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.Role.html b/doc/binding.Role.html new file mode 100644 index 00000000..474a91e1 --- /dev/null +++ b/doc/binding.Role.html @@ -0,0 +1,4052 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Role + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Role

+ + + + + + +
+ +
+ +

+ binding.Role

+ + +
+ +
+
+ + + + + +

new Role(propertiesopt)

+ + + + + +
+

The default constructor, copy all given properties to this object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
properties + + +Object + + + + + + <optional>
+ + + + + +

The optional properties to copy

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

acl :Acl

+ + + + +
+

The object read/write permissions

+
+ + + +
Type:
+
    +
  • + +Acl + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

id :string

+ + + + +
+

The unique id of this object

+

Sets the unique id of this object, if the id is not formatted as an valid id,
it will be used as the key component of the id has the same affect as setting the key

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key :string

+ + + + +
+

The unique key part of the id
When the key of the unique id is set an error will be thrown if an id is already set.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

name :string

+ + + + +
+

The name of the role

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

users :Set.<model.User>

+ + + + +
+

A set of users which have this role

+
+ + + +
Type:
+
    +
  • + +User> + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version :number

+ + + + +
+

The version of this object

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addUser(user)

+ + + + + +
+

Add the given user to this role

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + +

The user to add

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

attach(db)

+ + + + + +
+

Attach this object to the given db

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
db + + +EntityManager + + + +

The db which will be used for future crud operations

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

delete(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Delete an existing object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The remove options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the remove operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be removed. Depth 0 removes this object only,
true removes objects by reachability.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

hasUser() → {boolean}

+ + + + + +
+

Test if the given user has this role

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

true if the given user has this role,
otherwise false

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

insert(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Inserts a new object. Inserts the object if it doesn't exists and raise an error if the object already exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The insertion options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be inserted. Depth 0 insert this object only,
true inserts objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

load(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Resolves the referenced object in the specified depth. Only unresolved objects will be loaded unless the refresh option is specified.
Removed objects will be marked as removed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The load options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be loaded. Depth set to true
loads objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

optimisticSave(cb, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object and repeats the operation if the object is out of date.
In each pass the callback will be called. Ths first parameter of the callback is the entity and the second one
is a function to abort the process.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
cb + + +function + + + + + + + + + +

Will be called in each pass

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

ready(doneCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

removeUser(user)

+ + + + + +
+

Remove the given user from this role

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + +

The user to remove

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

save(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object. Inserts the object if it doesn't exists and updates the object if the object exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The save options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the save operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be saved. Depth 0 save this object only,
true saves the objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

toJSON(excludeMetadataopt) → {json}

+ + + + + +
+

Converts the entity to an JSON-Object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
excludeMetadata + + +boolean + + + + + + <optional>
+ + + + + +

Indicates if the metadata i.e. id, version and acls should not be included into the json

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

JSON-Object

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

update(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Updates an existing object.
Updates the object if it exists and raise an error if the object doesn't exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The update options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the update operation, the version will not be validated, only existence will be checked.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be updated. Depth 0 updates this object only,
true updates objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

validate() → {util.ValidationResult}

+ + + + + +
+

Validates the entity by using the validation code of the entity type

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Contains the result of the Validation

+
+ + + +
+
+ Type +
+
+ +ValidationResult + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.User.html b/doc/binding.User.html new file mode 100644 index 00000000..3b75e1cc --- /dev/null +++ b/doc/binding.User.html @@ -0,0 +1,3946 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: User + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: User

+ + + + + + +
+ +
+ +

+ binding.User

+ + +
+ +
+
+ + + + + +

new User(propertiesopt)

+ + + + + +
+

The default constructor, copy all given properties to this object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
properties + + +Object + + + + + + <optional>
+ + + + + +

The optional properties to copy

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

acl :Acl

+ + + + +
+

The object read/write permissions

+
+ + + +
Type:
+
    +
  • + +Acl + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

id :string

+ + + + +
+

The unique id of this object

+

Sets the unique id of this object, if the id is not formatted as an valid id,
it will be used as the key component of the id has the same affect as setting the key

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

inactive :boolean

+ + + + +
+

Indicates if the user is currently inactive, which disallow user login

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key :string

+ + + + +
+

The unique key part of the id
When the key of the unique id is set an error will be thrown if an id is already set.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

username :string

+ + + + +
+

The users username or email address

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version :number

+ + + + +
+

The version of this object

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

attach(db)

+ + + + + +
+

Attach this object to the given db

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
db + + +EntityManager + + + +

The db which will be used for future crud operations

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

delete(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Delete an existing object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The remove options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the remove operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be removed. Depth 0 removes this object only,
true removes objects by reachability.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

insert(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Inserts a new object. Inserts the object if it doesn't exists and raise an error if the object already exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The insertion options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be inserted. Depth 0 insert this object only,
true inserts objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

load(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Resolves the referenced object in the specified depth. Only unresolved objects will be loaded unless the refresh option is specified.
Removed objects will be marked as removed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The load options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be loaded. Depth set to true
loads objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

newPassword(currentPassword, password, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Change the password of the given user

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
currentPassword + + +string + + + + + + + + + +

Current password of the user

password + + +string + + + + + + + + + +

New password of the user

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + +

optimisticSave(cb, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object and repeats the operation if the object is out of date.
In each pass the callback will be called. Ths first parameter of the callback is the entity and the second one
is a function to abort the process.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
cb + + +function + + + + + + + + + +

Will be called in each pass

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

ready(doneCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

save(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object. Inserts the object if it doesn't exists and updates the object if the object exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The save options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the save operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be saved. Depth 0 save this object only,
true saves the objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

toJSON(excludeMetadataopt) → {json}

+ + + + + +
+

Converts the entity to an JSON-Object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
excludeMetadata + + +boolean + + + + + + <optional>
+ + + + + +

Indicates if the metadata i.e. id, version and acls should not be included into the json

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

JSON-Object

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

update(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Updates an existing object.
Updates the object if it exists and raise an error if the object doesn't exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The update options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the update operation, the version will not be validated, only existence will be checked.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be updated. Depth 0 updates this object only,
true updates objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

validate() → {util.ValidationResult}

+ + + + + +
+

Validates the entity by using the validation code of the entity type

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Contains the result of the Validation

+
+ + + +
+
+ Type +
+
+ +ValidationResult + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.UserFactory.html b/doc/binding.UserFactory.html new file mode 100644 index 00000000..6e4c2ca0 --- /dev/null +++ b/doc/binding.UserFactory.html @@ -0,0 +1,5149 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UserFactory + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UserFactory

+ + + + + + +
+ +
+ +

+ binding.UserFactory

+ + +
+ +
+
+ + + + + +

new UserFactory(propertiesopt, …arguments) → {model.User}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
properties + + +Object + + + + + + <optional>
+ + + + + +

initial properties to set on the instance

arguments + + +* + + + + + + + + + + <repeatable>
+ +

Additional constructor params passed through the type constructor

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The new managed instance

+
+ + + +
+
+ Type +
+
+ +User + + +
+
+ + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

(static) DefaultOptions

+ + + + + + + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oauth + + +Object + + + +

default properties

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
google + + +Object + + + +

default oauth properties for Google

facebook + + +Object + + + +

default oauth properties for Facebook

github + + +Object + + + +

default oauth properties for GitHub

twitter + + +Object + + + +

default oauth properties for Twitter

linkedin + + +Object + + + +

default oauth properties for LinkedIn

+ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) LoginOption :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
NO_LOGIN + + +number + + + +

Do not login the user after a successful registration

SESSION_LOGIN + + +number + + + +

Login in after a successful registration and keep the token in a nonpermanent storage, i.e SessionStorage

PERSIST_LOGIN + + +number + + + +

Login in after a successful registration and keep the token in a persistent storage, i.e LocalStorage

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

me :model.User

+ + + + +
+

The current logged in user, or null if the user is not logged in

+
+ + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

login(username, password, loginOptionopt, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Log in the user with the given username and password and starts a user session

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
username + + +string + + + + + + + + + + + +

The username of the user

password + + +string + + + + + + + + + + + +

The password of the user

loginOption + + +boolean +| + +LoginOption + + + + + + <optional>
+ + + + + +
+ + true + +

The default keeps the user logged in over multiple sessions

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + +

loginWithFacebook(clientID, optionsopt, loginOptionopt, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Prompts the user for the Facebook login in a new window. Before using OAuth you need to setup your application
on the provider website, add the redirect uri: https://example.net/db/User/OAuth/facebook and copy the client id
and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
clientID + + +string + + + + + + + + + + + +
options + + +Object + + + + + + <optional>
+ + + + + +
+ +
loginOption + + +boolean +| + +LoginOption + + + + + + <optional>
+ + + + + +
+ + true + +

The default keeps the user logged in over multiple sessions

options.title + + +string + + + + + + <optional>
+ + + + + +
+ + "Login" + +

sets the title of the popup window

options.width + + +number + + + + + + <optional>
+ + + + + +
+ + 1140 + +

defines the width of the popup window

options.height + + +number + + + + + + <optional>
+ + + + + +
+ + 640 + +

defines the height of the popup window

options.scope + + +string + + + + + + <optional>
+ + + + + +
+ + "email" + +

the range of rights requested from the user

options.state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + +
options.timeout + + +number + + + + + + <optional>
+ + + + + +
+ + 5 * 60 * 1000 + +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + +

loginWithGitHub(clientID, optionsopt, loginOptionopt, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Prompts the user for the GitHub login in a new window. Before using OAuth you need to setup your application
on the provider website, add the redirect uri: https://example.net/db/User/OAuth/github and copy the client id
and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
clientID + + +string + + + + + + + + + + + +
options + + +Object + + + + + + <optional>
+ + + + + +
+ +
loginOption + + +boolean +| + +LoginOption + + + + + + <optional>
+ + + + + +
+ + true + +

The default keeps the user logged in over multiple sessions

options.title + + +string + + + + + + <optional>
+ + + + + +
+ + "Login" + +

sets the title of the popup window

options.width + + +number + + + + + + <optional>
+ + + + + +
+ + 1040 + +

defines the width of the popup window

options.height + + +number + + + + + + <optional>
+ + + + + +
+ + 580 + +

defines the height of the popup window

options.scope + + +string + + + + + + <optional>
+ + + + + +
+ + "user:email" + +

the range of rights requested from the user

options.state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + +
options.timeout + + +number + + + + + + <optional>
+ + + + + +
+ + 5 * 60 * 1000 + +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + +

loginWithGoogle(clientID, optionsopt, loginOptionopt, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Prompts the user for the Google login in a new window. Before using OAuth you need to setup your application
on the provider website, add the redirect uri: https://example.net/db/User/OAuth/google and copy the client id
and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
clientID + + +string + + + + + + + + + + + +
options + + +Object + + + + + + <optional>
+ + + + + +
+ +
loginOption + + +boolean +| + +LoginOption + + + + + + <optional>
+ + + + + +
+ + true + +

The default keeps the user logged in over multiple sessions

options.title + + +string + + + + + + <optional>
+ + + + + +
+ + "Login" + +

sets the title of the popup window

options.width + + +number + + + + + + <optional>
+ + + + + +
+ + 585 + +

defines the width of the popup window

options.height + + +number + + + + + + <optional>
+ + + + + +
+ + 545 + +

defines the height of the popup window

options.scope + + +string + + + + + + <optional>
+ + + + + +
+ + "email" + +

the range of rights requested from the user

options.state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + +
options.timeout + + +number + + + + + + <optional>
+ + + + + +
+ + 5 * 60 * 1000 + +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + +

loginWithLinkedIn(clientID, optionsopt, loginOptionopt, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Prompts the user for the LinkedIn login in a new window. Before using OAuth you need to setup your application
on the provider website, add the redirect uri: https://example.net/db/User/OAuth/linkedin and copy the client id
and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
clientID + + +string + + + + + + + + + + + +
options + + +Object + + + + + + <optional>
+ + + + + +
+ +
loginOption + + +boolean +| + +LoginOption + + + + + + <optional>
+ + + + + +
+ + true + +

The default keeps the user logged in over multiple sessions

options.title + + +string + + + + + + <optional>
+ + + + + +
+ + "Login" + +

sets the title of the popup window

options.width + + +number + + + + + + <optional>
+ + + + + +
+ + 630 + +

defines the width of the popup window

options.height + + +number + + + + + + <optional>
+ + + + + +
+ + 530 + +

defines the height of the popup window

options.scope + + +string + + + + + + <optional>
+ + + + + +
+ + "" + +

the range of rights requested from the user

options.state + + +Object + + + + + + <optional>
+ + + + + +
+ + {} + +
options.timeout + + +number + + + + + + <optional>
+ + + + + +
+ + 5 * 60 * 1000 + +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + +

loginWithTwitter(clientID, optionsopt, loginOptionopt, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Prompts the user for the Twitter login in a new window. Before using OAuth you need to setup your application
on the provider website, add the redirect uri: https://example.net/db/User/OAuth/twitter and copy the client id
and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
clientID + + +string + + + + + + + + + + + +
options + + +Object + + + + + + <optional>
+ + + + + +
+ +
loginOption + + +boolean +| + +LoginOption + + + + + + <optional>
+ + + + + +
+ + true + +

The default keeps the user logged in over multiple sessions

options.title + + +string + + + + + + <optional>
+ + + + + +
+ + "Login" + +

sets the title of the popup window

options.width + + +number + + + + + + <optional>
+ + + + + +
+ + 740 + +

defines the width of the popup window

options.height + + +number + + + + + + <optional>
+ + + + + +
+ + 730 + +

defines the height of the popup window

options.timeout + + +number + + + + + + <optional>
+ + + + + +
+ + 5 * 60 * 1000 + +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + +

logout(doneCallbackopt, failCallbackopt) → {Promise.<*>}

+ + + + + +
+

Log out the current logged in user and ends the active user session

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

new(properties) → {model.User}

+ + + + + +
+

Creates a new user object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
properties + + +<string, *> + + + +

Additional properties which will be applied to the created instance

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A new created user

+
+ + + +
+
+ Type +
+
+ +User + + +
+
+ + + + + + + + + + +

newPassword(username, password, newPassword, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Change the password of the given user

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
username + + +string + + + + + + + + + +

Username to identify the user

password + + +string + + + + + + + + + +

Current password of the user

newPassword + + +string + + + + + + + + + +

New password of the user

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + +

register(user, password, loginOptionopt, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Register a new user with the given username and password, if the username is not used by an another user.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
user + + +string +| + +User + + + + + + + + + + + +

The username as a string or a Object, which must contain the username.

password + + +string + + + + + + + + + + + +

The password for the given user

loginOption + + +boolean +| + +LoginOption + + + + + + <optional>
+ + + + + +
+ + true + +

The default logs the user in after a successful registration and keeps the user logged in over multiple sessions

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +
+ +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The created user object, for the new registered user.

+
+ + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/binding.html b/doc/binding.html new file mode 100644 index 00000000..e0a4b8c7 --- /dev/null +++ b/doc/binding.html @@ -0,0 +1,437 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Namespace: binding + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Namespace: binding

+ + + + + + +
+ +
+ +

binding

+ + +
+ + + +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/caching.BloomFilter.html b/doc/caching.BloomFilter.html new file mode 100644 index 00000000..a9e59d81 --- /dev/null +++ b/doc/caching.BloomFilter.html @@ -0,0 +1,425 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: BloomFilter + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: BloomFilter

+ + + + + + +
+ +
+ +

+ caching.BloomFilter

+ + +
+ +
+
+ + + + + +

new BloomFilter()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/caching.html b/doc/caching.html new file mode 100644 index 00000000..76982660 --- /dev/null +++ b/doc/caching.html @@ -0,0 +1,401 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Namespace: caching + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Namespace: caching

+ + + + + + +
+ +
+ +

caching

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
BloomFilter
+
+
+ + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/connector.Connector.html b/doc/connector.Connector.html new file mode 100644 index 00000000..9ad308d2 --- /dev/null +++ b/doc/connector.Connector.html @@ -0,0 +1,2028 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Connector + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Connector

+ + + + + + +
+ +
+ +

+ connector.Connector

+ + +
+ +
+
+ + + + + +

new Connector(host, port, secure, basePath)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
host + + +string + + + +
port + + +number + + + +
secure + + +boolean + + + +
basePath + + +string + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) connections :Object.<string, connector.Connector>

+ + + + +
+

Array of all created connections

+
+ + + +
Type:
+
    +
  • + +Connector> + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) connectors :Array.<connector.Connector>

+ + + + +
+

Array of all available connector implementations

+
+ + + +
Type:
+
    +
  • + +Connector> + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) gzip

+ + + + +
+

The connector will detect if gzip is supports.
Returns true if supported otherwise false.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) RESPONSE_HEADERS :Array.<string>

+ + + + +
+

An array of all exposed response headers

+
+ + + +
Type:
+
    +
  • + +<string> + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(static) create(host, portopt, secureopt, basePathopt) → {connector.Connector}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
host + + +string + + + + + + + + + +

or location

port + + +number + + + + + + <optional>
+ + + + + +
secure + + +boolean + + + + + + <optional>
+ + + + + +

true for an secure connection

basePath + + +string + + + + + + <optional>
+ + + + + +

The basepath of the api

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Connector + + +
+
+ + + + + + + + + + +

(abstract) doSend(message, request, receive)

+ + + + + +
+

Handle the actual message send

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
request + + +Object + + + +
receive + + +function + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(abstract, protected) fromFormat(response, entity, type)

+ + + + + +
+

Convert received data to the requested response entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The response object

entity + + +* + + + +

The received data

type + + +string + + + +

The requested response format

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

prepareRequest(message)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

prepareResponse(message, response)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

send(message) → {Promise.<connector.Message>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Message> + + +
+
+ + + + + + + + + + +

(abstract, protected) toFormat(message)

+ + + + + +
+

Convert the message entity to the sendable representation

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +

The message to send

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/connector.IFrameConnector.html b/doc/connector.IFrameConnector.html new file mode 100644 index 00000000..aeaeaf05 --- /dev/null +++ b/doc/connector.IFrameConnector.html @@ -0,0 +1,1600 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: IFrameConnector + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: IFrameConnector

+ + + + + + +
+ +
+ +

+ connector.IFrameConnector

+ + +
+ +
+
+ + + + + +

new IFrameConnector()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + +

(static) isUsable(host, port, secure) → {boolean}

+ + + + + +
+

Indicates if this connector implementation is usable for the given host and port

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
host + + +string + + + +
port + + +number + + + +
secure + + +boolean + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

doSend(message, request, receive)

+ + + + + +
+

Handle the actual message send

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
request + + +Object + + + +
receive + + +function + + + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(protected) fromFormat(response, entity, type)

+ + + + + +
+

Convert received data to the requested response entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The response object

entity + + +* + + + +

The received data

type + + +string + + + +

The requested response format

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

prepareRequest(message)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

prepareResponse(message, response)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

send(message) → {Promise.<connector.Message>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Message> + + +
+
+ + + + + + + + + + +

(protected) toFormat(message)

+ + + + + +
+

Convert the message entity to the sendable representation

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +

The message to send

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/connector.Message.html b/doc/connector.Message.html new file mode 100644 index 00000000..668b3a6b --- /dev/null +++ b/doc/connector.Message.html @@ -0,0 +1,3954 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Message + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Message

+ + + + + + +
+ +
+ +

+ connector.Message

+ + +
+ +
+
+ + + + + +

new Message()

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arguments... + + +string + + + +

The path arguments

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) StatusCode :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
NOT_MODIFIED + + +number + + + +
BAD_CREDENTIALS + + +number + + + +
BUCKET_NOT_FOUND + + +number + + + +
INVALID_PERMISSION_MODIFICATION + + +number + + + +
INVALID_TYPE_VALUE + + +number + + + +
OBJECT_NOT_FOUND + + +number + + + +
OBJECT_OUT_OF_DATE + + +number + + + +
PERMISSION_DENIED + + +number + + + +
QUERY_DISPOSED + + +number + + + +
QUERY_NOT_SUPPORTED + + +number + + + +
SCHEMA_NOT_COMPATIBLE + + +number + + + +
SCHEMA_STILL_EXISTS + + +number + + + +
SYNTAX_ERROR + + +number + + + +
TRANSACTION_INACTIVE + + +number + + + +
TYPE_ALREADY_EXISTS + + +number + + + +
TYPE_STILL_REFERENCED + + +number + + + +
SCRIPT_ABORTION + + +number + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(static) create(specification) → {Class.<Message>}

+ + + + + +
+

Creates a new message class with the given message specification

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
specification + + +Object + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<Message> + + +
+
+ + + + + + + + + + +

(static) createExternal(specification, members) → {Class.<Message>}

+ + + + + +
+

Creates a new message class with the given message specification and a full path

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
specification + + +Object + + + +
members + + +Object + + + +

additional members applied to the created message

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<Message> + + +
+
+ + + + + + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + +

Type Definitions

+ + + + + + +

progressCallback(event) → {*}

+ + + + + +
+

The progress callback is called, when you send a message to the server and a progress is noticed

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
event + + +ProgressEvent + + + +

The Progress Event

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

unused

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/connector.NodeConnector.html b/doc/connector.NodeConnector.html new file mode 100644 index 00000000..55116715 --- /dev/null +++ b/doc/connector.NodeConnector.html @@ -0,0 +1,1532 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: NodeConnector + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: NodeConnector

+ + + + + + +
+ +
+ +

+ connector.NodeConnector

+ + +
+ +
+
+ + + + + +

new NodeConnector()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + +

doSend(message, request, receive)

+ + + + + +
+

Handle the actual message send

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
request + + +Object + + + +
receive + + +function + + + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(protected) fromFormat(response, entity, type)

+ + + + + +
+

Convert received data to the requested response entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The response object

entity + + +* + + + +

The received data

type + + +string + + + +

The requested response format

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

parseCookie(header)

+ + + + + +
+

Parse the cookie header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
header + + +string + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

prepareRequest(message)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

prepareResponse(message, response)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

send(message) → {Promise.<connector.Message>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Message> + + +
+
+ + + + + + + + + + +

(protected) toFormat(message)

+ + + + + +
+

Convert the message entity to the sendable representation

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +

The message to send

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/connector.WebSocketConnector.html b/doc/connector.WebSocketConnector.html new file mode 100644 index 00000000..e5f8bb05 --- /dev/null +++ b/doc/connector.WebSocketConnector.html @@ -0,0 +1,1242 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: WebSocketConnector + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: WebSocketConnector

+ + + + + + +
+ +
+ +

+ connector.WebSocketConnector

+ + +
+ +
+
+ + + + + +

new WebSocketConnector(connector)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
connector + + +Connector + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) websockets :Array.<connector.Connector>

+ + + + +
+

Map of all available connectors to their respective websocket connections

+
+ + + +
Type:
+
    +
  • + +Connector> + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(static) create(connector) → {connector.WebSocketConnector}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
connector + + +Connector + + + +

a connector

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

a websocket connection

+
+ + + +
+
+ Type +
+
+ +WebSocketConnector + + +
+
+ + + + + + + + + + +

sendOverSocket(msg)

+ + + + + +
+

Sends a websocket message over a lazily initialized websocket connection.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
msg + + +Object + + + +
+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
topic + + +string + + + +
token + + +string + + + +
+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

subscribe(topic, cb)

+ + + + + +
+

Registers a handler for a topic.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
topic + + +string +| + +Object + + + +
cb + + +function + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

unsubscribe(topic, cb)

+ + + + + +
+

Deregisters a handler.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
topic + + +string +| + +Object + + + +
cb + + +function + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/connector.XMLHttpConnector.html b/doc/connector.XMLHttpConnector.html new file mode 100644 index 00000000..e5a6d343 --- /dev/null +++ b/doc/connector.XMLHttpConnector.html @@ -0,0 +1,1600 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: XMLHttpConnector + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: XMLHttpConnector

+ + + + + + +
+ +
+ +

+ connector.XMLHttpConnector

+ + +
+ +
+
+ + + + + +

new XMLHttpConnector()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + +

(static) isUsable(host, port, secure) → {boolean}

+ + + + + +
+

Indicates if this connector implementation is usable for the given host and port

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
host + + +string + + + +
port + + +number + + + +
secure + + +boolean + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

doSend(message, request, receive)

+ + + + + +
+

Handle the actual message send

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
request + + +Object + + + +
receive + + +function + + + +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(protected) fromFormat(response, entity, type)

+ + + + + +
+

Convert received data to the requested response entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The response object

entity + + +* + + + +

The received data

type + + +string + + + +

The requested response format

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

prepareRequest(message)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

prepareResponse(message, response)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

send(message) → {Promise.<connector.Message>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Message> + + +
+
+ + + + + + + + + + +

(protected) toFormat(message)

+ + + + + +
+

Convert the message entity to the sendable representation

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
message + + +Message + + + +

The message to send

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/connector.html b/doc/connector.html new file mode 100644 index 00000000..bc0e27eb --- /dev/null +++ b/doc/connector.html @@ -0,0 +1,416 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Namespace: connector + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Namespace: connector

+ + + + + + +
+ +
+ +

connector

+ + +
+ + + +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/error.CommunicationError.html b/doc/error.CommunicationError.html new file mode 100644 index 00000000..d193eee4 --- /dev/null +++ b/doc/error.CommunicationError.html @@ -0,0 +1,512 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: CommunicationError + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: CommunicationError

+ + + + + + +
+ +
+ +

+ error.CommunicationError

+ + +
+ +
+
+ + + + + +

new CommunicationError(httpMessage, response)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
httpMessage + + +Message + + + +

The http message which was send

response + + +Object + + + +

The received entity headers and content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/error.EntityExistsError.html b/doc/error.EntityExistsError.html new file mode 100644 index 00000000..892e2aaa --- /dev/null +++ b/doc/error.EntityExistsError.html @@ -0,0 +1,487 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: EntityExistsError + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: EntityExistsError

+ + + + + + +
+ +
+ +

+ error.EntityExistsError

+ + +
+ +
+
+ + + + + +

new EntityExistsError(entity)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +string + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/error.IllegalEntityError.html b/doc/error.IllegalEntityError.html new file mode 100644 index 00000000..bf2ea349 --- /dev/null +++ b/doc/error.IllegalEntityError.html @@ -0,0 +1,487 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: IllegalEntityError + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: IllegalEntityError

+ + + + + + +
+ +
+ +

+ error.IllegalEntityError

+ + +
+ +
+
+ + + + + +

new IllegalEntityError(entity)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/error.PersistentError.html b/doc/error.PersistentError.html new file mode 100644 index 00000000..c77d6bca --- /dev/null +++ b/doc/error.PersistentError.html @@ -0,0 +1,532 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: PersistentError + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: PersistentError

+ + + + + + +
+ +
+ +

+ error.PersistentError

+ + +
+ +
+
+ + + + + +

new PersistentError(message, causeopt)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +
cause + + +Error + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + +
    +
  • Error
  • +
+ + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/error.RollbackError.html b/doc/error.RollbackError.html new file mode 100644 index 00000000..4420af15 --- /dev/null +++ b/doc/error.RollbackError.html @@ -0,0 +1,487 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: RollbackError + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: RollbackError

+ + + + + + +
+ +
+ +

+ error.RollbackError

+ + +
+ +
+
+ + + + + +

new RollbackError(cause)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
cause + + +Error + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/error.html b/doc/error.html new file mode 100644 index 00000000..c467d6e5 --- /dev/null +++ b/doc/error.html @@ -0,0 +1,413 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Namespace: error + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Namespace: error

+ + + + + + +
+ +
+ +

error

+ + +
+ + + +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-Bold-webfont.eot b/doc/fonts/OpenSans-Bold-webfont.eot new file mode 100644 index 00000000..5d20d916 Binary files /dev/null and b/doc/fonts/OpenSans-Bold-webfont.eot differ diff --git a/doc/fonts/OpenSans-Bold-webfont.svg b/doc/fonts/OpenSans-Bold-webfont.svg new file mode 100644 index 00000000..3ed7be4b --- /dev/null +++ b/doc/fonts/OpenSans-Bold-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-Bold-webfont.woff b/doc/fonts/OpenSans-Bold-webfont.woff new file mode 100644 index 00000000..1205787b Binary files /dev/null and b/doc/fonts/OpenSans-Bold-webfont.woff differ diff --git a/doc/fonts/OpenSans-BoldItalic-webfont.eot b/doc/fonts/OpenSans-BoldItalic-webfont.eot new file mode 100644 index 00000000..1f639a15 Binary files /dev/null and b/doc/fonts/OpenSans-BoldItalic-webfont.eot differ diff --git a/doc/fonts/OpenSans-BoldItalic-webfont.svg b/doc/fonts/OpenSans-BoldItalic-webfont.svg new file mode 100644 index 00000000..6a2607b9 --- /dev/null +++ b/doc/fonts/OpenSans-BoldItalic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-BoldItalic-webfont.woff b/doc/fonts/OpenSans-BoldItalic-webfont.woff new file mode 100644 index 00000000..ed760c06 Binary files /dev/null and b/doc/fonts/OpenSans-BoldItalic-webfont.woff differ diff --git a/doc/fonts/OpenSans-Italic-webfont.eot b/doc/fonts/OpenSans-Italic-webfont.eot new file mode 100644 index 00000000..0c8a0ae0 Binary files /dev/null and b/doc/fonts/OpenSans-Italic-webfont.eot differ diff --git a/doc/fonts/OpenSans-Italic-webfont.svg b/doc/fonts/OpenSans-Italic-webfont.svg new file mode 100644 index 00000000..e1075dcc --- /dev/null +++ b/doc/fonts/OpenSans-Italic-webfont.svg @@ -0,0 +1,1830 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-Italic-webfont.woff b/doc/fonts/OpenSans-Italic-webfont.woff new file mode 100644 index 00000000..ff652e64 Binary files /dev/null and b/doc/fonts/OpenSans-Italic-webfont.woff differ diff --git a/doc/fonts/OpenSans-Light-webfont.eot b/doc/fonts/OpenSans-Light-webfont.eot new file mode 100644 index 00000000..14868406 Binary files /dev/null and b/doc/fonts/OpenSans-Light-webfont.eot differ diff --git a/doc/fonts/OpenSans-Light-webfont.svg b/doc/fonts/OpenSans-Light-webfont.svg new file mode 100644 index 00000000..11a472ca --- /dev/null +++ b/doc/fonts/OpenSans-Light-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-Light-webfont.woff b/doc/fonts/OpenSans-Light-webfont.woff new file mode 100644 index 00000000..e7860748 Binary files /dev/null and b/doc/fonts/OpenSans-Light-webfont.woff differ diff --git a/doc/fonts/OpenSans-LightItalic-webfont.eot b/doc/fonts/OpenSans-LightItalic-webfont.eot new file mode 100644 index 00000000..8f445929 Binary files /dev/null and b/doc/fonts/OpenSans-LightItalic-webfont.eot differ diff --git a/doc/fonts/OpenSans-LightItalic-webfont.svg b/doc/fonts/OpenSans-LightItalic-webfont.svg new file mode 100644 index 00000000..431d7e35 --- /dev/null +++ b/doc/fonts/OpenSans-LightItalic-webfont.svg @@ -0,0 +1,1835 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-LightItalic-webfont.woff b/doc/fonts/OpenSans-LightItalic-webfont.woff new file mode 100644 index 00000000..43e8b9e6 Binary files /dev/null and b/doc/fonts/OpenSans-LightItalic-webfont.woff differ diff --git a/doc/fonts/OpenSans-Regular-webfont.eot b/doc/fonts/OpenSans-Regular-webfont.eot new file mode 100644 index 00000000..6bbc3cf5 Binary files /dev/null and b/doc/fonts/OpenSans-Regular-webfont.eot differ diff --git a/doc/fonts/OpenSans-Regular-webfont.svg b/doc/fonts/OpenSans-Regular-webfont.svg new file mode 100644 index 00000000..25a39523 --- /dev/null +++ b/doc/fonts/OpenSans-Regular-webfont.svg @@ -0,0 +1,1831 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/fonts/OpenSans-Regular-webfont.woff b/doc/fonts/OpenSans-Regular-webfont.woff new file mode 100644 index 00000000..e231183d Binary files /dev/null and b/doc/fonts/OpenSans-Regular-webfont.woff differ diff --git a/doc/global.html b/doc/global.html new file mode 100644 index 00000000..f2d73897 --- /dev/null +++ b/doc/global.html @@ -0,0 +1,739 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Global + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Global

+ + + + + + +
+ +
+ +

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(constant) isChrome

+ + + + +
+

Checks whether the user uses google chrome.

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

next() → {Object|boolean|metamodel.Attribute}

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+
    +
  • +
    +

    item

    +
    + + + +
    +
    + Type +
    +
    + +Object + + +
    +
    +
  • + +
  • +
    +

    item.done

    +
    + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    +
  • + +
  • +
    +

    item.value

    +
    + + + +
    +
    + Type +
    +
    + +Attribute + + +
    +
    +
  • +
+ + + + + + + + +

next() → {Object|boolean|Object}

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+
    +
  • +
    +

    item

    +
    + + + +
    +
    + Type +
    +
    + +Object + + +
    +
    +
  • + +
  • +
    +

    item.done

    +
    + + + +
    +
    + Type +
    +
    + +boolean + + +
    +
    +
  • + +
  • +
    +

    item.value

    +
    + + + +
    +
    + Type +
    +
    + +Object + + +
    +
    +
  • +
+ + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/img/baqend_logo.svg b/doc/img/baqend_logo.svg new file mode 100644 index 00000000..fd9398a3 --- /dev/null +++ b/doc/img/baqend_logo.svg @@ -0,0 +1,4218 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/img/favicon.ico b/doc/img/favicon.ico new file mode 100644 index 00000000..b4033db9 Binary files /dev/null and b/doc/img/favicon.ico differ diff --git a/doc/index.html b/doc/index.html new file mode 100644 index 00000000..8f32a7af --- /dev/null +++ b/doc/index.html @@ -0,0 +1,331 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Home + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Home

+ + + + + + + + +

baqend 2.4.3

+ + + + + + + + + + + + + + + + + + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/lib_Acl.js.html b/doc/lib_Acl.js.html new file mode 100644 index 00000000..05c4b6b0 --- /dev/null +++ b/doc/lib_Acl.js.html @@ -0,0 +1,517 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/Acl.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/Acl.js

+ + + + + + +
+
+
"use strict";
+
+var Permission = require('./util/Permission');
+
+/**
+ * Creates a new Acl object, with an empty rule set for an object
+ *
+ * @alias Acl
+ */
+class Acl {
+
+  /**
+   * @param {util.Metadata=} metadata the metadata of the object, null for files
+   */
+  constructor(metadata) {
+    /**
+     * The read permission of the object
+     * @type util.Permission
+     */
+    this.read = new Permission(metadata);
+    /**
+     * The write permission of the object
+     * @type util.Permission
+     */
+    this.write = new Permission(metadata);
+  }
+
+  /**
+   * Removes all acl rules, read and write access is public afterwards
+   */
+  clear() {
+    this.read.clear();
+    this.write.clear();
+  }
+
+  /**
+   * Copies permissions from another ACL
+   * @param {Acl} acl The ACL to copy from
+   * @return {Acl}
+   */
+  copy(acl) {
+    this.read.copy(acl.read);
+    this.write.copy(acl.write);
+    return this;
+  }
+
+  /**
+   * Gets whenever all users and roles have the permission to read the object
+   * @return {boolean} <code>true</code> If public access is allowed
+   */
+  isPublicReadAllowed() {
+    return this.read.isPublicAllowed();
+  }
+
+  /**
+   * Sets whenever all users and roles should have the permission to read the object.
+   * Note: All other allow read rules will be removed.
+   */
+  setPublicReadAllowed() {
+    return this.read.setPublicAllowed();
+  }
+
+  /**
+   * Checks whenever the user or role is explicit allowed to read the object.
+   *
+   * @param {model.User|model.Role|string} userOrRole The user or role to check for
+   * @return {boolean} <code>true</code> if read access is explicitly allowed for the given user or role
+   */
+  isReadAllowed(userOrRole) {
+    return this.read.isAllowed(userOrRole);
+  }
+
+  /**
+   * Checks whenever the user or role is explicit denied to read the object
+   *
+   * @param {model.User|model.Role|string} userOrRole The user or role to check for
+   * @return {boolean} <code>true</code> if read access is explicitly denied for the given user or role
+   */
+  isReadDenied(userOrRole) {
+    return this.read.isDenied(userOrRole);
+  }
+
+  /**
+   * Allows the given user or rule to read the object
+   * @param {...(model.User|model.Role|string)} userOrRole The user or role to allow
+   * @return {Acl} this acl object
+   */
+  allowReadAccess(userOrRole) {
+    Permission.prototype.allowAccess.apply(this.read, arguments);
+    return this;
+  }
+
+  /**
+   * Denies the given user or rule to read the object
+   * @param {...(model.User|model.Role|string)} userOrRole The user or role to deny
+   * @return {Acl} this acl object
+   */
+  denyReadAccess(userOrRole) {
+    Permission.prototype.denyAccess.apply(this.read, arguments);
+    return this;
+  }
+
+  /**
+   * Deletes any read allow/deny rule for the given user or role
+   * @param {...(model.User|model.Role|string)} userOrRole The user or role
+   * @return {Acl} this acl object
+   */
+  deleteReadAccess(userOrRole) {
+    Permission.prototype.deleteAccess.apply(this.read, arguments);
+    return this;
+  }
+
+  /**
+   * Gets whenever all users and roles have the permission to write the object
+   * @return {boolean} <code>true</code> If public access is allowed
+   */
+  isPublicWriteAllowed() {
+    return this.write.isPublicAllowed();
+  }
+
+  /**
+   * Sets whenever all users and roles should have the permission to write the object.
+   * Note: All other allow write rules will be removed.
+   */
+  setPublicWriteAllowed() {
+    return this.write.setPublicAllowed();
+  }
+
+  /**
+   * Checks whenever the user or role is explicit allowed to write the object.
+   *
+   * @param {model.User|model.Role|string} userOrRole The user or role to check for
+   * @return {boolean} <code>true</code> if write access is explicitly allowed for the given user or role
+   */
+  isWriteAllowed(userOrRole) {
+    return this.write.isAllowed(userOrRole);
+  }
+
+  /**
+   * Checks whenever the user or role is explicit denied to write the object
+   *
+   * @param {model.User|model.Role|string} userOrRole The user or role to check for
+   * @return {boolean} <code>true</code> if write access is explicitly denied for the given user or role
+   */
+  isWriteDenied(userOrRole) {
+    return this.write.isDenied(userOrRole);
+  }
+
+  /**
+   * Allows the given user or rule to write the object
+   * @param {...(model.User|model.Role|string)} userOrRole The user or role to allow
+   * @return {Acl} this acl object
+   */
+  allowWriteAccess(userOrRole) {
+    Permission.prototype.allowAccess.apply(this.write, arguments);
+    return this;
+  }
+
+  /**
+   * Denies the given user or rule to write the object
+   * @param {...(model.User|model.Role|string)} userOrRole The user or role to deny
+   * @return {Acl} this acl object
+   */
+  denyWriteAccess(userOrRole) {
+    Permission.prototype.denyAccess.apply(this.write, arguments);
+    return this;
+  }
+
+  /**
+   * Deletes any write allow/deny rule for the given user or role
+   * @param {...(model.User|model.Role|string)} userOrRole The user or role
+   * @return {Acl} this acl object
+   */
+  deleteWriteAccess(userOrRole) {
+    Permission.prototype.deleteAccess.apply(this.write, arguments);
+    return this;
+  }
+
+  /**
+   * A Json representation of the set of rules
+   * @return {json}
+   */
+  toJSON() {
+    return {
+      read: this.read,
+      write: this.write
+    };
+  }
+
+  /**
+   * Sets the acl rules form json
+   * @param {json} json The json encoded acls
+   */
+  fromJSON(json) {
+    this.read.fromJSON(json.read || {});
+    this.write.fromJSON(json.write || {});
+  }
+
+}
+
+module.exports = Acl;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_EntityManager.js.html b/doc/lib_EntityManager.js.html new file mode 100644 index 00000000..ab08c6f2 --- /dev/null +++ b/doc/lib_EntityManager.js.html @@ -0,0 +1,1480 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/EntityManager.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/EntityManager.js

+ + + + + + +
+
+
"use strict";
+
+var message = require('./message');
+var error = require('./error');
+var binding = require('./binding');
+var util = require('./util');
+var query = require('./query');
+
+var UserFactory = require('./binding/UserFactory');
+var EntityTransaction = require('./EntityTransaction');
+var Metadata = require('./util/Metadata');
+var Message = require('./connector/Message');
+var BloomFilter = require('./caching/BloomFilter');
+var StatusCode = Message.StatusCode;
+
+/**
+ * @alias EntityManager
+ * @extends util.Lockable
+ */
+class EntityManager extends util.Lockable {
+
+  /**
+   * Determine whether the entity manager is open.
+   * true until the entity manager has been closed
+   * @type boolean
+   */
+  get isOpen() {
+    return !!this._connector;
+  }
+
+  /**
+   * The authentication token if the user is logged in currently
+   * @type String
+   */
+  get token() {
+    return this.tokenStorage.token;
+  }
+
+  get isCachingDisabled() {
+    return !this.bloomFilter;
+  }
+
+  /**
+   * The authentication token if the user is logged in currently
+   * @param {String} value
+   */
+  set token(value) {
+    this.tokenStorage.update(value);
+  }
+
+  /**
+   * @param {EntityManagerFactory} entityManagerFactory The factory which of this entityManager instance
+   */
+  constructor(entityManagerFactory) {
+    super();
+
+    /**
+     * Log messages can created by calling log directly as function, with a specific log level or with the helper
+     * methods, which a members of the log method.
+     *
+     * Logs will be filtered by the client logger and the before they persisted. The default log level is
+     * 'info' therefore all log messages below the given message aren't persisted.
+     *
+     * Examples:
+     * <pre class="prettyprint">
+     // default log level ist info
+     db.log('test message %s', 'my string');
+     // info: test message my string
+
+     // pass a explicit log level as the first argument, one of ('trace', 'debug', 'info', 'warn', 'error')
+     db.log('warn', 'test message %d', 123);
+     // warn: test message 123
+
+     // debug log level will not be persisted by default, since the default logging level is info
+     db.log('debug', 'test message %j', {number: 123}, {});
+     // debug: test message {"number":123}
+     // data = {}
+
+     // One additional json object can be provided, which will be persisted together with the log entry
+     db.log('info', 'test message %s, %s', 'first', 'second', {number: 123});
+     // info: test message first, second
+     // data = {number: 123}
+
+     //use the log level helper
+     db.log.info('test message', 'first', 'second', {number: 123});
+     // info: test message first second
+     // data = {number: 123}
+
+     //change the default log level to trace, i.e. all log levels will be persisted, note that the log level can be
+     //additionally configured in the baqend
+     db.log.level = 'trace';
+
+     //trace will be persisted now
+     db.log.trace('test message', 'first', 'second', {number: 123});
+     // info: test message first second
+     // data = {number: 123}
+     * </pre>
+     *
+     * @type util.Logger
+     */
+    this.log = util.Logger.create(this);
+
+    /**
+     * The connector used for requests
+     * @type connector.Connector
+     * @private
+     */
+    this._connector = null;
+
+    /**
+     * All managed and cached entity instances
+     * @type Map<String,binding.Entity>
+     */
+    this._entities = null;
+
+    /** @type EntityManagerFactory */
+    this.entityManagerFactory = entityManagerFactory;
+
+    /** @type metamodel.Metamodel */
+    this.metamodel = entityManagerFactory.metamodel;
+
+    /** @type util.Code */
+    this.code = entityManagerFactory.code;
+
+    /** @type util.Modules */
+    this.modules = null;
+
+    /**
+     * The current logged in user object
+     * @type model.User
+     */
+    this.me = null;
+
+    /**
+     * Returns true if the device token is already registered, otherwise false.
+     * @type boolean
+     */
+    this.isDeviceRegistered = false;
+
+    /**
+     * Returns the tokenStorage which will be used to authorize all requests.
+     * @type {util.TokenStorage}
+     */
+    this.tokenStorage = null;
+
+    /**
+     * @type {caching.BloomFilter}
+     */
+    this.bloomFilter = null;
+
+    /**
+     * Set of object ids that were revalidated after the Bloom filter was loaded.
+     */
+    this.cacheWhiteList = null;
+
+    /**
+     * Set of object ids that were updated but are not yet included in the bloom filter.
+     * This set essentially implements revalidation by side effect which does not work in Chrome.
+     */
+    this.cacheBlackList = null;
+
+    /**
+     * Bloom filter refresh interval in seconds.
+     *
+     * @type {number}
+     */
+    this.bloomFilterRefresh = 60;
+
+    /**
+     * Bloom filter refresh Promise
+     *
+     */
+    this._bloomFilterLock = new util.Lockable();
+  }
+
+  /**
+   * Connects this entityManager, used for synchronous and asynchronous initialization
+   * @param {connector.Connector} connector
+   * @param {Object} connectData
+   * @param {util.TokenStorage} tokenStorage The used tokenStorage for token persistence
+   */
+  connected(connector, connectData, tokenStorage) {
+    this._connector = connector;
+    this.tokenStorage = tokenStorage;
+    this.bloomFilterRefresh = this.entityManagerFactory.staleness;
+    this._entities = {};
+
+    this.File = binding.FileFactory.create(this);
+    this._createObjectFactory(this.metamodel.embeddables);
+    this._createObjectFactory(this.metamodel.entities);
+
+    this.transaction = new EntityTransaction(this);
+    this.modules = new util.Modules(this, connector);
+
+    if (connectData) {
+      this.isDeviceRegistered = !!connectData.device;
+      if (connectData.user && connectData.token == tokenStorage.token)
+        this._updateUser(connectData.user, true);
+
+      if (this.bloomFilterRefresh > 0 && connectData.bloomFilter && util.atob && !util.isNode) {
+        this.updateBloomFilter(connectData.bloomFilter);
+      }
+    }
+  }
+
+  /**
+   * @param {metamodel.ManagedType[]} types
+   * @return {binding.ManagedFactory}
+   * @private
+   */
+  _createObjectFactory(types) {
+    Object.keys(types).forEach(function(ref) {
+      var type = this.metamodel.managedType(ref);
+      var name = type.name;
+
+      if (this[name]) {
+        type.typeConstructor = this[name];
+        Object.defineProperty(this, name, {
+          value: type.createObjectFactory(this)
+        });
+      } else {
+        Object.defineProperty(this, name, {
+          get() {
+            Object.defineProperty(this, name, {
+              value: type.createObjectFactory(this)
+            });
+
+            return this[name];
+          },
+          set(typeConstructor) {
+            type.typeConstructor = typeConstructor;
+          },
+          configurable: true
+        });
+      }
+    }, this);
+  }
+
+  send(message) {
+    message.tokenStorage = this.tokenStorage;
+    return this._connector.send(message).catch((e) => {
+      if (e.status == StatusCode.BAD_CREDENTIALS) {
+        this._logout();
+      }
+      throw e;
+    });
+  }
+
+  /**
+   * Get an instance, whose state may be lazily fetched. If the requested instance does not exist
+   * in the database, the EntityNotFoundError is thrown when the instance state is first accessed.
+   * The application should not expect that the instance state will be available upon detachment,
+   * unless it was accessed by the application while the entity manager was open.
+   *
+   * @param {(Class<binding.Entity>|string)} entityClass
+   * @param {string=} key
+   */
+  getReference(entityClass, key) {
+    var id, type;
+    if (key) {
+      type = this.metamodel.entity(entityClass);
+      if (key.indexOf('/db/') == 0) {
+        id = key;
+      } else {
+        id = type.ref + '/' + encodeURIComponent(key);
+      }
+    } else {
+      id = entityClass;
+      type = this.metamodel.entity(id.substring(0, id.indexOf('/', 4))); //skip /db/
+    }
+
+    var entity = this._entities[id];
+    if (!entity) {
+      entity = type.create();
+      var metadata = Metadata.get(entity);
+      metadata.id = id;
+      metadata.setUnavailable();
+
+      this._attach(entity);
+    }
+
+    return entity;
+  }
+
+  /**
+   * Creates an instance of Query.Builder for query creation and execution. The Query results are instances of the
+   * resultClass argument.
+   * @param {Class<*>=} resultClass - the type of the query result
+   * @return {query.Builder<*>} A query builder to create one ore more queries for the specified class
+   */
+  createQueryBuilder(resultClass) {
+    return new query.Builder(this, resultClass);
+  }
+
+  /**
+   * Clear the persistence context, causing all managed entities to become detached.
+   * Changes made to entities that have not been flushed to the database will not be persisted.
+   */
+  clear() {
+    this._entities = {};
+  }
+
+  /**
+   * Close an application-managed entity manager. After the close method has been invoked,
+   * all methods on the EntityManager instance and any Query and TypedQuery objects obtained from it
+   * will throw the IllegalStateError except for transaction, and isOpen (which will return false).
+   * If this method is called when the entity manager is associated with an active transaction,
+   * the persistence context remains managed until the transaction completes.
+   */
+  close() {
+    this._connector = null;
+
+    return this.clear();
+  }
+
+  /**
+   * Check if the instance is a managed entity instance belonging to the current persistence context.
+   * @param {binding.Entity} entity - entity instance
+   * @returns {boolean} boolean indicating if entity is in persistence context
+   */
+  contains(entity) {
+    return !!entity && this._entities[entity.id] === entity;
+  }
+
+  /**
+   * Check if an object with the id from the given entity is already attached.
+   * @param {binding.Entity} entity - entity instance
+   * @returns {boolean} boolean indicating if entity with same id is attached
+   */
+  containsById(entity) {
+    return !!(entity && this._entities[entity.id]);
+  }
+
+  /**
+   * Remove the given entity from the persistence context, causing a managed entity to become detached.
+   * Unflushed changes made to the entity if any (including removal of the entity),
+   * will not be synchronized to the database. Entities which previously referenced the detached entity will continue to reference it.
+   * @param {binding.Entity} entity - entity instance
+   */
+  detach(entity) {
+    var state = Metadata.get(entity);
+    return state.withLock(() => {
+      this.removeReference(entity);
+      return Promise.resolve(entity);
+    });
+  }
+
+  /**
+   * Resolve the depth by loading the referenced objects of the given entity.
+   *
+   * @param {binding.Entity} entity - entity instance
+   * @param {Object} [options] The load options
+   * @return {Promise<binding.Entity>}
+   */
+  resolveDepth(entity, options) {
+    if (!options || !options.depth)
+      return Promise.resolve(entity);
+
+    options.resolved = options.resolved || [];
+    var promises = [];
+    var subOptions = Object.assign({}, options, {
+      depth: options.depth === true ? true : options.depth - 1
+    });
+    this.getSubEntities(entity, 1).forEach((subEntity) => {
+      if (subEntity != null && !~options.resolved.indexOf(subEntity)) {
+        options.resolved.push(subEntity);
+        promises.push(this.load(subEntity.id, null, subOptions));
+      }
+    });
+
+    return Promise.all(promises).then(function() {
+      return entity;
+    });
+  }
+
+  /**
+   * Search for an entity of the specified oid.
+   * If the entity instance is contained in the persistence context, it is returned from there.
+   * @param {(Class<binding.Entity>|string)} entityClass - entity class
+   * @param {String} oid - Object ID
+   * @param {Object} [options] The load options.
+   * @return {Promise<binding.Entity>} the loaded entity or null
+   */
+  load(entityClass, oid, options) {
+    options = options || {};
+    var entity = this.getReference(entityClass, oid);
+    var state = Metadata.get(entity);
+
+    if (!options.refresh && options.local && state.isAvailable) {
+      return this.resolveDepth(entity, options);
+    }
+
+    var msg = new message.GetObject(state.bucket, state.key);
+
+    this.ensureCacheHeader(entity.id, msg, options.refresh);
+
+    return this.send(msg).then((response) => {
+      // refresh object if loaded older version from cache
+      // chrome doesn't using cache when ifNoneMatch is set
+      if (entity.version > response.entity.version) {
+        options.refresh = true;
+        return this.load(entityClass, oid, options)
+      }
+
+      this.addToWhiteList(response.entity.id);
+
+      if (response.status != StatusCode.NOT_MODIFIED) {
+        state.setJson(response.entity, true);
+      }
+
+      return this.resolveDepth(entity, options);
+    }, (e) => {
+      if (e.status == StatusCode.OBJECT_NOT_FOUND) {
+        this.removeReference(entity);
+        state.setRemoved();
+        return null;
+      } else {
+        throw e;
+      }
+    });
+  }
+
+  /**
+   * @param {binding.Entity} entity
+   * @param {Object} options
+   * @return {Promise<binding.Entity>}
+   */
+  insert(entity, options) {
+    options = options || {};
+    var isNew;
+
+    return this._save(entity, options, function(state, json) {
+      if (state.version)
+        throw new error.PersistentError('Existing objects can\'t be inserted.');
+
+      isNew = !state.id;
+
+      return new message.CreateObject(state.bucket, json);
+    }).then((val) => {
+      if (isNew)
+        this._attach(entity);
+
+      return val;
+    });
+  }
+
+  /**
+   * @param {binding.Entity} entity
+   * @param {Object} options
+   * @return {Promise<binding.Entity>}
+   */
+  update(entity, options) {
+    options = options || {};
+
+    return this._save(entity, options, function(state, json) {
+      if (!state.version)
+        throw new error.PersistentError("New objects can't be inserted.");
+
+      if (options.force) {
+        delete json.version;
+        return new message.ReplaceObject(state.bucket, state.key, json)
+            .ifMatch('*');
+      } else {
+        return new message.ReplaceObject(state.bucket, state.key, json)
+            .ifMatch(state.version);
+      }
+    });
+  }
+
+  /**
+   * @param {binding.Entity} entity
+   * @param {Object} options The save options
+   * @param {boolean=} withoutLock Set true to save the entity without locking
+   * @return {Promise<binding.Entity>}
+   */
+  save(entity, options, withoutLock) {
+    options = options || {};
+
+    var msgFactory = function(state, json) {
+      if (options.force) {
+        if (!state.id)
+          throw new error.PersistentError("New special objects can't be forcedly saved.");
+
+        delete json.version;
+        return new message.ReplaceObject(state.bucket, state.key, json);
+      } else if (state.version) {
+        return new message.ReplaceObject(state.bucket, state.key, json)
+            .ifMatch(state.version);
+      } else {
+        return new message.CreateObject(state.bucket, json);
+      }
+    };
+
+    return withoutLock ? this._locklessSave(entity, options, msgFactory) : this._save(entity, options, msgFactory)
+  }
+
+  /**
+   * @param {binding.Entity} entity
+   * @param {Function} cb pre-safe callback
+   * @return {Promise<binding.Entity>}
+   */
+  optimisticSave(entity, cb) {
+    return Metadata.get(entity).withLock(() => {
+      return this._optimisticSave(entity, cb);
+    });
+  }
+
+  /**
+   * @param {binding.Entity} entity
+   * @param {Function} cb pre-safe callback
+   * @return {Promise<binding.Entity>}
+   * @private
+   */
+  _optimisticSave(entity, cb) {
+    var abort = false;
+    var abortFn = function() {
+      abort = true;
+    };
+    var promise = Promise.resolve(cb(entity, abortFn));
+
+    if (abort)
+      return Promise.resolve(entity);
+
+    return promise.then(() => {
+      return this.save(entity, {}, true).catch((e) => {
+        if (e.status == 412) {
+          return this.refresh(entity, {}).then(() => {
+            return this._optimisticSave(entity, cb);
+          });
+        } else {
+          throw e;
+        }
+      });
+    });
+  }
+
+  /**
+   * Save the object state without locking
+   * @param {binding.Entity} entity
+   * @param {Object} options
+   * @param {Function} msgFactory
+   * @return {Promise.<binding.Entity>}
+   * @private
+   */
+  _locklessSave(entity, options, msgFactory) {
+    this.attach(entity);
+    var state = Metadata.get(entity);
+    var refPromises;
+
+    var json;
+    if (state.isAvailable) {
+      //getting json will check all collections changes, therefore we must do it before proofing the dirty state
+      json = state.getJson(false, true);
+    }
+
+    if (state.isDirty) {
+      if (!options.refresh) {
+        state.setPersistent();
+      }
+
+      var sendPromise = this.send(msgFactory(state, json)).then((response) => {
+        if (options.refresh) {
+          state.setJson(response.entity, true);
+        } else {
+          state.setJsonMetadata(response.entity);
+        }
+        return entity;
+      }, (e) => {
+        if (e.status == StatusCode.OBJECT_NOT_FOUND) {
+          this.removeReference(entity);
+          state.setRemoved();
+          return null;
+        } else {
+          state.setDirty();
+          throw e;
+        }
+      });
+
+      refPromises = [sendPromise];
+    } else {
+      refPromises = [Promise.resolve(entity)];
+    }
+
+    var subOptions = Object.assign({}, options);
+    subOptions.depth = 0;
+    this.getSubEntities(entity, options.depth).forEach((sub) => {
+      refPromises.push(this._save(sub, subOptions, msgFactory));
+    });
+
+    return Promise.all(refPromises).then(() => entity);
+  }
+
+  /**
+   * Save and lock the object state
+   * @param {binding.Entity} entity
+   * @param {Object} options
+   * @param {Function} msgFactory
+   * @return {Promise.<binding.Entity>}
+   * @private
+   */
+  _save(entity, options, msgFactory) {
+    this.ensureBloomFilterFreshness();
+
+    var state = Metadata.get(entity);
+    if (state.version) {
+      this.addToBlackList(entity.id);
+    }
+
+    return state.withLock(() => {
+      return this._locklessSave(entity, options, msgFactory);
+    });
+  }
+
+  /**
+   * Returns all referenced sub entities for the given depth and root entity
+   * @param {binding.Entity} entity
+   * @param {boolean|number} depth
+   * @param {binding.Entity[]} [resolved]
+   * @param {binding.Entity=} initialEntity
+   * @returns {binding.Entity[]}
+   */
+  getSubEntities(entity, depth, resolved, initialEntity) {
+    resolved = resolved || [];
+    if (!depth) {
+      return resolved;
+    }
+    initialEntity = initialEntity || entity;
+
+    var state = Metadata.get(entity);
+    for (let value of state.type.references()) {
+      this.getSubEntitiesByPath(entity, value.path).forEach((subEntity) => {
+        if (!~resolved.indexOf(subEntity) && subEntity != initialEntity) {
+          resolved.push(subEntity);
+          resolved = this.getSubEntities(subEntity, depth === true ? depth : depth - 1, resolved, initialEntity);
+        }
+      });
+    }
+
+    return resolved;
+  }
+
+  /**
+   * Returns all referenced one level sub entities for the given path
+   * @param {binding.Entity} entity
+   * @param {Array<string>} path
+   * @returns {binding.Entity[]}
+   */
+  getSubEntitiesByPath(entity, path) {
+    var subEntities = [entity];
+
+    path.forEach((attributeName) => {
+
+      var tmpSubEntities = [];
+      subEntities.forEach((subEntity) => {
+        var curEntity = subEntity[attributeName];
+        if (!curEntity)
+          return;
+
+        var attribute = this.metamodel.managedType(subEntity.constructor).getAttribute(attributeName);
+        if (attribute.isCollection) {
+          for (let entry of curEntity.entries()) {
+            tmpSubEntities.push(entry[1]);
+            attribute.keyType && attribute.keyType.isEntity && tmpSubEntities.push(entry[0]);
+          }
+        } else {
+          tmpSubEntities.push(curEntity);
+        }
+      });
+      subEntities = tmpSubEntities;
+
+    });
+
+    return subEntities;
+  }
+
+  /**
+   * Delete the entity instance.
+   * @param {binding.Entity} entity
+   * @param {Object} options The delete options
+   * @return {Promise<binding.Entity>}
+   */
+  'delete'(entity, options) {
+    options = options || {};
+
+    this.attach(entity);
+    var state = Metadata.get(entity);
+
+    return state.withLock(() => {
+      if (!state.version && !options.force)
+        throw new error.IllegalEntityError(entity);
+
+      var msg = new message.DeleteObject(state.bucket, state.key);
+
+      this.addToBlackList(entity.id);
+
+      if (!options.force)
+        msg.ifMatch(state.version);
+
+      var refPromises = [this.send(msg).then(() => {
+        this.removeReference(entity);
+        state.setRemoved();
+        return entity;
+      })];
+
+      var subOptions = Object.assign({}, options);
+      subOptions.depth = 0;
+      this.getSubEntities(entity, options.depth).forEach((sub) => {
+        refPromises.push(this.delete(sub, subOptions));
+      });
+
+      return Promise.all(refPromises).then(function() {
+        return entity;
+      });
+    });
+  }
+
+  /**
+   * Synchronize the persistence context to the underlying database.
+   *
+   * @returns {Promise<*>}
+   */
+  flush(doneCallback, failCallback) {
+    // TODO: implement this
+  }
+
+  /**
+   * Make an instance managed and persistent.
+   * @param {binding.Entity} entity - entity instance
+   */
+  persist(entity) {
+    this.attach(entity);
+  }
+
+  /**
+   * Refresh the state of the instance from the database, overwriting changes made to the entity, if any.
+   * @param {binding.Entity} entity - entity instance
+   * @param {Object} options The refresh options
+   * @return {Promise<binding.Entity>}
+   */
+  refresh(entity, options) {
+    options = options || {};
+    options.refresh = true;
+
+    return this.load(entity.id, null, options);
+  }
+
+  /**
+   * Attach the instance to this database context, if it is not already attached
+   * @param {binding.Entity} entity The entity to attach
+   */
+  attach(entity) {
+    if (!this.contains(entity)) {
+      var type = this.metamodel.entity(entity.constructor);
+      if (!type)
+        throw new error.IllegalEntityError(entity);
+
+      if (this.containsById(entity))
+        throw new error.EntityExistsError(entity);
+
+      this._attach(entity);
+    }
+  }
+
+  _attach(entity) {
+    var metadata = Metadata.get(entity);
+    if (metadata.isAttached) {
+      if (metadata.db != this) {
+        throw new error.EntityExistsError(entity);
+      }
+    } else {
+      metadata.db = this;
+    }
+
+    if (!metadata.id) {
+      if (metadata.type.name != 'User' && metadata.type.name != 'Role' && metadata.type.name != 'logs.AppLog') {
+        metadata.id = '/db/' + metadata.type.name + '/' + util.uuid();
+      }
+    }
+
+    if (metadata.id) {
+      this._entities[metadata.id] = entity;
+    }
+  }
+
+  removeReference(entity) {
+    var state = Metadata.get(entity);
+    if (!state)
+      throw new error.IllegalEntityError(entity);
+
+    delete this._entities[state.id];
+  }
+
+  register(user, password, loginOption) {
+    let login = loginOption > UserFactory.LoginOption.NO_LOGIN;
+    if (this.me && login) {
+      throw new error.PersistentError('User is already logged in.');
+    }
+
+    return this.withLock(() => {
+      var msg = new message.Register({
+        user: user,
+        password: password,
+        login: login
+      });
+      return this._userRequest(msg, loginOption);
+    });
+  }
+
+  login(username, password, loginOption) {
+    if (this.me)
+      throw new error.PersistentError('User is already logged in.');
+
+    return this.withLock(() => {
+      let msg = new message.Login({
+        username: username,
+        password: password
+      });
+
+      return this._userRequest(msg, loginOption);
+    });
+  }
+
+  logout() {
+    return this.withLock(() => {
+      return this.send(new message.Logout()).then(this._logout.bind(this));
+    });
+  }
+
+  loginWithOAuth(provider, clientID, options) {
+    if (this.me)
+      throw new error.PersistentError('User is already logged in.');
+
+    options = Object.assign({
+      title: "Login with " + provider,
+      timeout: 5 * 60 * 1000,
+      state: {},
+      loginOption: true
+    }, options);
+
+    var msg;
+    if (Message[provider + 'OAuth']) {
+      msg = new Message[provider + 'OAuth'](clientID, options.scope, JSON.stringify(options.state));
+    } else {
+      throw new Error('OAuth provider ' + provider + ' not supported.');
+    }
+
+    var req = this._userRequest(msg, options.loginOption);
+    var w = open(msg.request.path, options.title, 'width=' + options.width + ',height=' + options.height);
+
+    return new Promise((resolve, reject) => {
+      var timeout = setTimeout(() => {
+        reject(new error.PersistentError('OAuth login timeout.'));
+      }, options.timeout);
+
+      req.then(resolve, reject).then(() => {
+        clearTimeout(timeout);
+      });
+    });
+  }
+
+  renew() {
+    return this.withLock(() => {
+      var msg = new message.Me();
+      return this._userRequest(msg, true);
+    });
+  }
+
+  newPassword(username, password, newPassword) {
+    return this.withLock(() => {
+      var msg = new message.NewPassword({
+        username: username,
+        password: password,
+        newPassword: newPassword
+      });
+
+      return this.send(msg).then((response) => {
+        return this._updateUser(response.entity);
+      });
+    });
+  }
+
+  _updateUser(obj, updateMe) {
+    var user = this.getReference(obj.id);
+    var metadata = Metadata.get(user);
+    metadata.setJson(obj, true);
+
+    if (updateMe)
+      this.me = user;
+
+    return user;
+  }
+
+  _logout() {
+    this.me = null;
+    this.token = null;
+  }
+
+  _userRequest(msg, loginOption) {
+    let login = loginOption > UserFactory.LoginOption.NO_LOGIN;
+    if (login) {
+      this.tokenStorage.temporary = loginOption < UserFactory.LoginOption.PERSIST_LOGIN;
+    }
+
+    return this.send(msg).then((response) => {
+      if (response.entity) {
+        return this._updateUser(response.entity, login);
+      }
+    }, (e) => {
+      if (e.status == StatusCode.OBJECT_NOT_FOUND) {
+        if (login)
+          this._logout();
+        return null;
+      } else {
+        throw e;
+      }
+    });
+  }
+
+  registerDevice(os, token, device) {
+    var msg = new message.DeviceRegister({
+      token: token,
+      devicetype: os,
+      device: device
+    });
+
+    msg.withCredentials = true;
+    return this.send(msg);
+  }
+
+  checkDeviceRegistration() {
+    return this.send(new message.DeviceRegistered()).then(() => {
+      return this.isDeviceRegistered = true;
+    }, (e) => {
+      if (e.status == StatusCode.OBJECT_NOT_FOUND) {
+        return this.isDeviceRegistered = false;
+      } else {
+        throw e;
+      }
+    });
+  }
+
+  pushDevice(pushMessage) {
+    return this.send(new message.DevicePush(pushMessage));
+  }
+
+  /**
+   * The given entity will be checked by the validation code of the entity type.
+   *
+   * @param {binding.Entity} entity
+   * @returns {util.ValidationResult} result
+   */
+  validate(entity) {
+    var type = Metadata.get(entity).type;
+
+    var result = new util.ValidationResult();
+    for (var iter = type.attributes(), item; !(item = iter.next()).done;) {
+      var validate = new util.Validator(item.value.name, entity);
+      result.fields[validate.key] = validate;
+    }
+
+    var validationCode = type.validationCode;
+    if (validationCode) {
+      validationCode(result.fields);
+    }
+
+    return result;
+  }
+
+  /**
+   * Adds the given object id to the cacheWhiteList if needed.
+   * @param {string} objectId The id to add.
+   */
+  addToWhiteList(objectId) {
+    if (!this.isCachingDisabled) {
+      if (this.bloomFilter.contains(objectId)) {
+        this.cacheWhiteList.add(objectId);
+      }
+      this.cacheBlackList.delete(objectId);
+    }
+  }
+
+  /**
+   * Adds the given object id to the cacheBlackList if needed.
+   * @param {string} objectId The id to add.
+   */
+  addToBlackList(objectId) {
+    if (!this.isCachingDisabled) {
+      if (!this.bloomFilter.contains(objectId)) {
+        this.cacheBlackList.add(objectId);
+      }
+      this.cacheWhiteList.delete(objectId);
+    }
+  }
+
+  refreshBloomFilter() {
+    if (this.isCachingDisabled)
+      return Promise.resolve();
+
+    var msg = new message.GetBloomFilter();
+    return this.send(msg).then((response) => {
+      this.updateBloomFilter(response.entity);
+      return this.bloomFilter;
+    });
+  }
+
+  updateBloomFilter(bloomFilter) {
+    this.bloomFilter = new BloomFilter(bloomFilter);
+    this.cacheWhiteList = new Set();
+    this.cacheBlackList = new Set();
+  }
+
+  /**
+   * Checks the freshness of the bloom filter and does a reload if necessary
+   */
+  ensureBloomFilterFreshness() {
+    if (this.isCachingDisabled)
+      return;
+
+    var now = new Date().getTime();
+    var refreshRate = this.bloomFilterRefresh * 1000;
+
+    if (this._bloomFilterLock.isReady && now - this.bloomFilter.creation > refreshRate) {
+      this._bloomFilterLock.withLock(() => this.refreshBloomFilter());
+    }
+  }
+
+  /**
+   * Checks for a given id, if revalidation is required, the resource is stale or caching was disabled
+   * @param {string} id The object id to check
+   * @returns {boolean} Indicates if the resource must be revalidated
+   */
+  mustRevalidate(id) {
+    if (util.isNode)
+      return false;
+
+    this.ensureBloomFilterFreshness();
+
+    var refresh = this.isCachingDisabled || !this._bloomFilterLock.isReady;
+    refresh = refresh || (!this.cacheWhiteList.has(id) && (this.cacheBlackList.has(id) || this.bloomFilter.contains(id)));
+    return refresh;
+  }
+
+  /**
+   *
+   * @param {string} id To check the bloom filter
+   * @param {connector.Message} message To attach the headers
+   * @param {boolean} refresh To force the reload headers
+   */
+  ensureCacheHeader(id, message, refresh) {
+    refresh = refresh || this.mustRevalidate(id);
+
+    if (refresh) {
+      message.noCache();
+    }
+  }
+
+  /**
+   * Creates a absolute url for the given relative one
+   * @param {string} relativePath the relative url
+   * @param {boolean=} authorize indicates if authorization credentials should be generated and be attached to the url
+   * @return {string} a absolute url wich is optionaly signed with a resource token which authenticates the currently
+   * logged in user
+   */
+  createURL(relativePath, authorize) {
+    var path = this._connector.basePath + relativePath;
+
+    var append = false;
+    if (authorize && this.me) {
+      path = this.tokenStorage.signPath(path);
+      append = true;
+    } else {
+      path = path.split('/').map(encodeURIComponent).join('/');
+    }
+
+    if (this.mustRevalidate(relativePath)) {
+      path = path + (append ? '&' : '?') + 'BCB';
+    }
+
+    return this._connector.origin + path;
+  }
+}
+
+/**
+ * Constructor for a new List collection
+ * @function
+ * @param {...*} args Same arguments can be passed as the Array constructor takes
+ * @return {void} The new created List
+ */
+EntityManager.prototype.List = Array;
+
+/**
+ * Constructor for a new Set collection
+ * @function
+ * @param {Iterable<*>=} collection The initial array or collection to initialize the new Set
+ * @return {void} The new created Set
+ */
+EntityManager.prototype.Set = Set;
+
+/**
+ * Constructor for a new Map collection
+ * @function
+ * @param {Iterable<*>=} collection The initial array or collection to initialize the new Map
+ * @return {void} The new created Map
+ */
+EntityManager.prototype.Map = Map;
+
+/**
+ * Constructor for a new GeoPoint
+ * @function
+ * @param {string|number|Object|Array<number>} [latitude] A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude
+ * @param {number=} longitude The GeoPoint's longitude
+ * @return {void} The new created GeoPoint
+ */
+EntityManager.prototype.GeoPoint = require('./GeoPoint');
+
+/**
+ * An User factory for user objects.
+ * The User factory can be called to create new instances of users or can be used to register/login/logout users.
+ * The created instances implements the {@link model.User} interface
+ * @name User
+ * @type binding.UserFactory
+ * @memberOf EntityManager.prototype
+ */
+
+/**
+ * An Role factory for role objects.
+ * The Role factory can be called to create new instances of roles, later on users can be attached to roles to manage the
+ * access permissions through this role
+ * The created instances implements the {@link model.Role} interface
+ * @name Role
+ * @memberOf EntityManager.prototype
+ * @type binding.EntityFactory<model.Role>
+ */
+
+/**
+ * An Device factory for user objects.
+ * The Device factory can be called to create new instances of devices or can be used to register, push to and
+ * check registration status of devices.
+ * @name Device
+ * @memberOf EntityManager.prototype
+ * @type binding.DeviceFactory
+ */
+
+/**
+ * An Object factory for entity or embedded objects,
+ * that can be accessed by the type name of the entity type.
+ * An object factory can be called to create new instances of the type.
+ * The created instances implements the {@link binding.Entity} or the {@link binding.Managed} interface
+ * whenever the class is an entity or embedded object
+ * @name [YourEntityClass: string]
+ * @memberOf EntityManager.prototype
+ * @type {*}
+ */
+
+/**
+ * A File factory for file objects.
+ * The file factory can be called to create new instances for files.
+ * The created instances implements the {@link binding.File} interface
+ * @name File
+ * @memberOf EntityManager.prototype
+ * @type binding.FileFactory
+ */
+
+module.exports = EntityManager;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_EntityManagerFactory.js.html b/doc/lib_EntityManagerFactory.js.html new file mode 100644 index 00000000..e82a6217 --- /dev/null +++ b/doc/lib_EntityManagerFactory.js.html @@ -0,0 +1,518 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/EntityManagerFactory.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/EntityManagerFactory.js

+ + + + + + +
+
+
"use strict";
+
+var message = require('./message');
+var metamodel = require('./metamodel');
+
+var util = require('./util');
+var caching = require('./caching');
+var Connector = require('./connector/Connector');
+var EntityManager = require('./EntityManager');
+
+/**
+ * @alias EntityManagerFactory
+ * @extends util.Lockable
+ */
+class EntityManagerFactory extends util.Lockable {
+
+  _connected() {}
+
+  /**
+   * Creates a new EntityManagerFactory connected to the given destination
+   * @param {string|Object} [options] The destination to connect with, or an options object
+   * @param {string} [options.host] The destination to connect with
+   * @param {number} [options.port=80|443] The optional destination port to connect with
+   * @param {boolean} [options.secure=false] <code>true</code> To use a secure ssl encrypted connection
+   * @param {string} [options.basePath="/v1"] The base path of the api
+   * @param {Object} [options.schema=null] The serialized schema as json used to initialize the metamodel
+   * @param {util.TokenStorage} [options.tokenStorage] The tokenStorage which should be used by this emf
+   * @param {util.TokenStorageFactory} [options.tokenStorageFactory] The tokenStorage factory implementation which should
+   * be used for token storage
+   * @param {number} [options.staleness=60] The maximum staleness of objects that are acceptable while reading cached data
+   */
+  constructor(options) {
+    super();
+
+    options = Object(options) instanceof String? {host: options}: options || {};
+
+    /** @type connector.Connector */
+    this._connector = null;
+    /** @type metamodel.Metamodel */
+    this.metamodel = this.createMetamodel();
+    /** @type util.Code */
+    this.code = new util.Code(this.metamodel, this);
+    /** @type util.TokenStorageFactory */
+    this.tokenStorageFactory = util.TokenStorage.WEB_STORAGE || util.TokenStorage.GLOBAL;
+
+    this.configure(options);
+
+    var isReady = true;
+    var ready = new Promise((success) => {
+      this._connected = success;
+    });
+
+    if (options.host) {
+      this.connect(options.host, options.port, options.secure, options.basePath);
+    } else {
+      isReady = false;
+    }
+
+    if (!this.tokenStorage) {
+      isReady = false;
+      ready = ready.then(() => {
+        return this.tokenStorageFactory.create(this._connector.origin);
+      }).then((tokenStorage) => {
+        this.tokenStorage = tokenStorage;
+      });
+    }
+
+    if (options.schema) {
+      this._connectData = options;
+      this.metamodel.init(options.schema);
+    } else {
+      isReady = false;
+      ready = ready.then(() => {
+        var msg = new message.Connect();
+        msg.withCredentials = true; //used for registered devices
+
+        if (this.staleness === 0)
+          msg.noCache();
+
+        return this.send(msg);
+      }).then((response) => {
+        this._connectData = response.entity;
+
+        if (this.staleness === undefined) {
+          this.staleness = this._connectData.bloomFilterRefresh || 60;
+        }
+
+        if (!this.metamodel.isInitialized)
+          this.metamodel.init(this._connectData.schema);
+
+        this.tokenStorage.update(this._connectData.token);
+      });
+    }
+
+    if (!isReady) {
+      this.withLock(() => {
+        return ready;
+      }, true);
+    }
+  }
+
+  /**
+   * Apply additional configurations to this EntityManagerFactory
+   * @param {Object} options The additional configuration options
+   * @param {util.TokenStorage} [options.tokenStorage] The tokenStorage which should be used by this emf
+   * @param {util.TokenStorageFactory} [options.tokenStorageFactory] The tokenStorage factory implementation which should
+   * be used for token storage
+   * @param {number} [options.staleness=60] The maximum staleness of objects that are acceptable while reading cached data,
+   * <code>0</code> to always bypass the browser cache
+   */
+  configure(options) {
+    if (this._connector)
+      throw new Error('The EntityManagerFactory can only be configured before is is connected.');
+
+    if (options.tokenStorage) {
+      /** @type util.TokenStorage */
+      this.tokenStorage = options.tokenStorage;
+    }
+
+    if (options.tokenStorageFactory) {
+      this.tokenStorageFactory = options.tokenStorageFactory;
+    }
+
+    if (options.staleness !== undefined) {
+      /** @type number */
+      this.staleness = options.staleness;
+    }
+  }
+
+  /**
+   * Connects this EntityManager to the given destination
+   * @param {string} hostOrApp The host or the app name to connect with
+   * @param {number} [port=80|443] The port to connect to
+   * @param {boolean} [secure=false] <code>true</code> To use a secure connection
+   * @param {string} [basePath="/v1"] The base path of the api
+   */
+  connect(hostOrApp, port, secure, basePath) {
+    if (this._connector)
+      throw new Error('The EntityManagerFactory is already connected.');
+
+    if (Object(port) instanceof Boolean) {
+      secure = port;
+      port = 0;
+    }
+    
+    this._connector = Connector.create(hostOrApp, port, secure, basePath);
+
+    this._connected();
+    return this.ready();
+  }
+
+  /**
+   * Connects this EntityManager to the given destination
+   * @param {string} hostOrApp The host or the app name to connect with
+   * @param {boolean} [secure=false] <code>true</code> To use a secure connection
+   * @name connect
+   * @memberOf EntityManagerFactory.prototype
+   * @method
+   */
+
+
+  /**
+   * Creates a new Metamodel instance, which is not connected
+   * @return {metamodel.Metamodel} A new Metamodel instance
+   */
+  createMetamodel() {
+    return new metamodel.Metamodel(this);
+  }
+
+  /**
+   * Create a new application-managed EntityManager.
+   *
+   * @param {boolean=} useSharedTokenStorage The token storage to persist the authorization token, or
+   * <code>true</code> To use the shared token storage of the emf.
+   * <code>false</code> To use a instance based storage.
+   *
+   * @returns {EntityManager} a new entityManager
+   */
+  createEntityManager(useSharedTokenStorage) {
+    var em = new EntityManager(this);
+
+    if (this.isReady) {
+      em.connected(this._connector, this._connectData, useSharedTokenStorage? this.tokenStorage: new util.TokenStorage(this._connector.origin));
+    } else {
+      em.withLock(() => {
+        return this.ready().then(() => {
+          em.connected(this._connector, this._connectData, useSharedTokenStorage? this.tokenStorage: new util.TokenStorage(this._connector.origin));
+        });
+      }, true);
+    }
+
+    return em;
+  }
+
+  send(message) {
+    if (!message.tokenStorage)
+      message.tokenStorage = this.tokenStorage;
+    return this._connector.send(message);
+  }
+}
+
+module.exports = EntityManagerFactory;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_EntityTransaction.js.html b/doc/lib_EntityTransaction.js.html new file mode 100644 index 00000000..77761b08 --- /dev/null +++ b/doc/lib_EntityTransaction.js.html @@ -0,0 +1,469 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/EntityTransaction.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/EntityTransaction.js

+ + + + + + +
+
+
"use strict";
+
+var message = require('./message');
+var error = require('./error');
+
+/**
+ * @alias EntityTransaction
+ */
+class EntityTransaction {
+
+	/**
+	 * Indicate whether a resource transaction is in progress. 
+	 * @returns {boolean} indicating whether transaction is in progress 
+ 	 */
+	get isActive() {
+    return Boolean(this.tid);
+	}
+	
+	/**
+	 * @param {EntityManager} entityManager
+	 */
+	constructor(entityManager) {
+		this._connector = entityManager.connector;
+		this.entityManager = entityManager;
+		
+		this.tid = null;
+		this.rollbackOnly = false;
+		
+		this.readSet = null;
+		this.changeSet = null;
+	}
+	
+	/**
+	 * Start a resource transaction.
+	 */
+	begin(doneCallback, failCallback) {
+		return this.yield().then(function() {
+			var result = this.send(new message.PostTransaction()).done(function(msg) {
+				this.tid = msg.tid;
+
+				this.rollbackOnly = false;
+				this.readSet = {};
+				this.changeSet = {};
+			});
+			
+			return this.wait(result);
+		}).then(doneCallback, failCallback);
+	}
+	
+	/**
+	 * Commit the current resource transaction, writing any unflushed changes to the database. 
+	 */
+	commit(doneCallback, failCallback) {
+		return this.yield().then(function() {
+			if (this.getRollbackOnly()) {
+				return this.rollback().then(function() {
+					throw new error.RollbackError();
+				});
+			} else {
+				return this.wait(this.entityManager.flush()).then(function() {
+					var readSet = [];
+					for (var ref in this.readSet) {
+						readSet.push({
+							"oid": ref,
+							"version": this.readSet[ref]
+						});
+					}
+					
+					var result = this.send(new message.PutTransactionCommitted(this.tid, readSet));
+					
+					return this.wait(result).then(function(msg) {
+						this.tid = null;
+						this.readSet = null;
+						this.changeSet = null;
+						
+						var oids = msg.oids;
+						for (var oid in oids) {
+							var version = oids[oid];
+							var entity = this.entityManager.entities[oid];
+							
+							if (entity) {
+								var state = util.Metadata.get(entity);
+								if (version == 'DELETED' || state.isDeleted) {
+									this.entityManager.removeReference(entity);
+								} else {								
+									state.setJsonValue(state.type.version, version);
+								}
+							}
+						}
+					});
+				});
+			}
+		}).then(doneCallback, failCallback);
+	}
+	
+	/**
+	 * Determine whether the current resource transaction has been marked for rollback. 
+	 * @returns {boolean} indicating whether the transaction has been marked for rollback 
+	 */
+	getRollbackOnly() {
+		return this.rollbackOnly;
+	}
+	
+	/**
+	 * Roll back the current resource transaction. 
+	 */
+	rollback(doneCallback, failCallback) {
+		return this.yield().then(function() {
+			var result = this.send(new message.PutTransactionAborted(this.tid));
+			
+			this.wait(result).then(function() {
+				this.tid = null;
+				this.readSet = null;
+				this.changeSet = null;
+				return this.entityManager.clear();
+			}, function() {
+				return this.entityManager.clear();
+			});
+		}).then(doneCallback, failCallback);
+	}
+	
+	/**
+	 * Mark the current resource transaction so that the only possible outcome of the transaction is for the transaction to be rolled back. 
+	 */
+	setRollbackOnly(context, onSuccess) {
+		return this.yield().done(function() {
+			this.rollbackOnly = true;
+		});
+	}
+	
+	isRead(identifier) {
+		return this.isActive && identifier in this.readSet;
+	}
+	
+	setRead(identifier, version) {
+		if (this.isActive && !this.isChanged(identifier)) {
+			this.readSet[identifier] = version;
+		}
+	}
+	
+	isChanged(identifier) {
+		return this.isActive && identifier in this.changeSet;
+	}
+	
+	setChanged(identifier) {
+		if (this.isActive) {
+			delete this.readSet[identifier];
+			this.changeSet[identifier] = true;
+		}
+	}
+}
+
+module.exports = EntityTransaction;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_GeoPoint.js.html b/doc/lib_GeoPoint.js.html new file mode 100644 index 00000000..f2402bae --- /dev/null +++ b/doc/lib_GeoPoint.js.html @@ -0,0 +1,463 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/GeoPoint.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/GeoPoint.js

+ + + + + + +
+
+
"use strict";
+
+/**
+ * Creates a new GeoPoint instance
+ * From latitude and longitude
+ * From a json object
+ * Or an tuple of latitude and longitude
+ *
+ * @alias GeoPoint
+ */
+class GeoPoint {
+
+  /**
+   * Creates a GeoPoint with the user's current location, if available.
+   * @return {Promise<GeoPoint>} A promise that will be resolved with a GeoPoint
+   */
+  static current() {
+    return new Promise(function(resolve, reject) {
+      navigator.geolocation.getCurrentPosition(function(location) {
+        resolve(new GeoPoint(location.coords.latitude, location.coords.longitude));
+      }, function(error) {
+        reject(error);
+      });
+    });
+  }
+
+  /**
+   * @param {string|number|Object|Array<number>} [latitude] A coordinate pair (latitude first), a GeoPoint like object or the GeoPoint's latitude
+   * @param {number=} longitude The GeoPoint's longitude
+   */
+  constructor(latitude, longitude) {
+    let lat, lng;
+    if (Object(latitude) instanceof String) {
+      const index = latitude.indexOf(';');
+      lat = latitude.substring(0, index);
+      lng = latitude.substring(index + 1);
+    } else if (Object(latitude) instanceof Number) {
+      lat = latitude;
+      lng = longitude;
+    } else if (Object(latitude) instanceof Array) {
+      lat = latitude[0];
+      lng = latitude[1];
+    } else if (latitude instanceof Object) {
+      lat = latitude.latitude;
+      lng = latitude.longitude;
+    } else {
+      lat = 0;
+      lng = 0;
+    }
+
+    /**
+     * Longitude of the given point
+     * @type {number}
+     */
+    this.longitude = lng;
+
+    /**
+     * Latitude of the given point
+     * @type {number}
+     */
+    this.latitude = lat;
+
+    if (this.latitude < -90 || this.latitude > 90) {
+      throw new Error("Latitude " + this.latitude + " is not in bound of -90 <= latitude <= 90");
+    }
+
+    if (this.longitude < -180 || this.longitude > 180) {
+      throw new Error("Longitude " + this.longitude + " is not in bound of -180 <= longitude <= 180");
+    }
+  }
+
+  /**
+   * Returns the distance from this GeoPoint to another in kilometers.
+   * @param {GeoPoint} point another GeoPoint
+   * @return {number} The distance in kilometers
+   *
+   * @see GeoPoint#radiansTo
+   */
+  kilometersTo(point) {
+    return Number((GeoPoint.EARTH_RADIUS_IN_KILOMETERS * this.radiansTo(point)).toFixed(3));
+  }
+
+  /**
+   * Returns the distance from this GeoPoint to another in miles.
+   * @param {GeoPoint} point another GeoPoint
+   * @return {number} The distance in miles
+   *
+   * @see GeoPoint#radiansTo
+   */
+  milesTo(point) {
+    return Number((GeoPoint.EARTH_RADIUS_IN_MILES * this.radiansTo(point)).toFixed(3));
+  }
+
+  /**
+   * Computes the arc, in radian, between two WGS-84 positions.
+   *
+   * The haversine formula implementation is taken from:
+   * {@link http://www.movable-type.co.uk/scripts/latlong.html}
+   *
+   * Returns the distance from this GeoPoint to another in radians.
+   * @param {GeoPoint} point another GeoPoint
+   * @return {number} the arc, in radian, between two WGS-84 positions
+   *
+   * @see http://en.wikipedia.org/wiki/Haversine_formula
+   */
+  radiansTo(point) {
+    var from = this, to = point;
+    var rad1 = from.latitude * GeoPoint.DEG_TO_RAD,
+        rad2 = to.latitude * GeoPoint.DEG_TO_RAD,
+        dLng = (to.longitude - from.longitude) * GeoPoint.DEG_TO_RAD;
+
+    return Math.acos(Math.sin(rad1) * Math.sin(rad2) + Math.cos(rad1) * Math.cos(rad2) * Math.cos(dLng));
+  }
+
+  /**
+   * A String representation in latitude, longitude format
+   * @return {string} The string representation of this class
+   */
+  toString() {
+    return this.latitude + ';' + this.longitude;
+  }
+
+  /**
+   * Returns a JSON representation of the GeoPoint
+   * @return {json} A GeoJson object of this GeoPoint
+   */
+  toJSON() {
+    return {latitude: this.latitude, longitude: this.longitude};
+  }
+}
+
+GeoPoint.DEG_TO_RAD = Math.PI/180;
+
+/**
+ * The Earth radius in kilometers used by {@link GeoPoint#kilometersTo}
+ * @type {number}
+ */
+GeoPoint.EARTH_RADIUS_IN_KILOMETERS = 6371;
+
+/**
+ * The Earth radius in miles used by {@link GeoPoint#milesTo}
+ * @type {number}
+ */
+GeoPoint.EARTH_RADIUS_IN_MILES = 3956;
+
+module.exports = GeoPoint;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_baqend.js.html b/doc/lib_baqend.js.html new file mode 100644 index 00000000..d08bd735 --- /dev/null +++ b/doc/lib_baqend.js.html @@ -0,0 +1,385 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/baqend.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/baqend.js

+ + + + + + +
+
+
/**
+ * @interface baqend
+ * @extends EntityManager
+ */
+var EntityManagerFactory = require('./EntityManagerFactory');
+var EntityManager = require('./EntityManager');
+
+EntityManager.prototype.binding = require('./binding');
+EntityManager.prototype.connector = require('./connector');
+EntityManager.prototype.error = require('./error');
+EntityManager.prototype.message = require('./message');
+EntityManager.prototype.metamodel = require('./metamodel');
+EntityManager.prototype.util = require('./util');
+EntityManager.prototype.caching = require('./caching');
+EntityManager.prototype.query = require('./query');
+
+EntityManager.prototype.EntityManager = require('./EntityManager');
+EntityManager.prototype.EntityManagerFactory = require('./EntityManagerFactory');
+EntityManager.prototype.EntityTransaction = require('./EntityTransaction');
+EntityManager.prototype.Acl = require('./Acl');
+
+var emf = new EntityManagerFactory();
+var db = emf.createEntityManager(true);
+
+/**
+ * Configures the DB with additional config options
+ * @param {Object} options The additional configuration options
+ * @param {util.TokenStorage} [options.tokenStorage] The tokenStorage which should be used by this emf
+ * @param {util.TokenStorageFactory} [options.tokenStorageFactory] The tokenStorage factory implementation which should
+ * be used for token storage
+ * @param {number} [options.staleness=60] The maximum staleness of objects that are acceptable while reading cached data,
+ * <code>0</code> to always bypass the browser cache
+ * @function
+ * @return {baqend}
+ * @alias baqend#configure
+ */
+db.configure = function(options) {
+  emf.configure(options);
+  return this;
+};
+
+/**
+ * Connects the DB with the server and calls the callback on success
+ * @param {string} hostOrApp The host or the app name to connect with
+ * @param {boolean} [secure=false] <code>true</code> To use a secure connection
+ * @param {util.Lockable~callback=} doneCallback The callback, called when a connection is established and the
+ * SDK is ready to use
+ * @param {util.Lockable~callback=} failCallback When an error occurred while initializing the SDK
+ * @function
+ * @return {Promise<EntityManager>}
+ * @alias baqend#connect
+ */
+db.connect = function(hostOrApp, secure, doneCallback, failCallback) {
+  if (secure instanceof Function) {
+    failCallback = doneCallback;
+    doneCallback = secure;
+    secure = undefined;
+  }
+
+  emf.connect(hostOrApp, secure);
+  return this.ready(doneCallback, failCallback);
+};
+
+exports = module.exports = db;
+//import {db} from 'baqend';
+exports.db = db;
+//import db from 'baqend';
+exports.default = db;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_Accessor.js.html b/doc/lib_binding_Accessor.js.html new file mode 100644 index 00000000..99a20744 --- /dev/null +++ b/doc/lib_binding_Accessor.js.html @@ -0,0 +1,342 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/Accessor.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/Accessor.js

+ + + + + + +
+
+
"use strict";
+
+/**
+ * @alias binding.Accessor
+ */
+class Accessor {
+	/**
+	 * @param {Object} object
+	 * @param {metamodel.Attribute} attribute
+	 * @returns {*}
+	 */
+	getValue(object, attribute) {
+		return object[attribute.name];
+	}
+	 
+	/**
+	 * @param {Object} object
+	 * @param {metamodel.Attribute} attribute
+	 * @param {*} value
+	 */
+	setValue(object, attribute, value) {
+		object[attribute.name] = value;
+	}
+}
+
+module.exports = Accessor;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_DeviceFactory.js.html b/doc/lib_binding_DeviceFactory.js.html new file mode 100644 index 00000000..a6da65dc --- /dev/null +++ b/doc/lib_binding_DeviceFactory.js.html @@ -0,0 +1,372 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/DeviceFactory.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/DeviceFactory.js

+ + + + + + +
+
+
"use strict";
+
+var EntityFactory = require('./EntityFactory');
+
+/**
+ * @class binding.DeviceFactory
+ * @extends binding.EntityFactory<model.Device>
+ *
+ * @param {Object=} properties initial properties to set on the instance
+ * @param {...*} arguments Additional constructor params passed through the type constructor
+ * @return {model.Device} The new managed instance
+ */
+var DeviceFactory = EntityFactory.extend(/** @lends binding.DeviceFactory.prototype */ {
+
+  /**
+   * Returns true if the devices is already registered, otherwise false.
+   * @returns {boolean} Status of the device registration
+   */
+  get isRegistered() {
+    return this._db.isDeviceRegistered;
+  },
+
+  /**
+   * Register a new device with the given device token and OS.
+   * @param {string} os The OS of the device (IOS/Android)
+   * @param {string} token The GCM or APNS device token
+   * @param {model.Device=} device A optional device entity to set custom field values
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<any>}
+   */
+  register(os, token, device, doneCallback, failCallback) {
+    if (device instanceof Function) {
+      failCallback = doneCallback;
+      doneCallback = device;
+      device = null;
+    }
+
+    return this._db.registerDevice(os, token, device).then(doneCallback, failCallback);
+  },
+
+  /**
+   * Uses the info from the given {util.PushMessage} message to send an push notification.
+   * @param {util.PushMessage} pushMessage to send an push notification.
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<any>}
+   */
+  push(pushMessage, doneCallback, failCallback) {
+    return this._db.pushDevice(pushMessage).then(doneCallback, failCallback);
+  }
+});
+
+DeviceFactory.PushMessage = require('../util/PushMessage');
+
+module.exports = DeviceFactory;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_Enhancer.js.html b/doc/lib_binding_Enhancer.js.html new file mode 100644 index 00000000..67fe7f54 --- /dev/null +++ b/doc/lib_binding_Enhancer.js.html @@ -0,0 +1,428 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/Enhancer.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/Enhancer.js

+ + + + + + +
+
+
"use strict";
+
+var Metadata = require('../util/Metadata');
+var Lockable = require('../util/Lockable');
+
+/**
+ * @alias binding.Enhancer
+ */
+class Enhancer {
+
+  /**
+   * @param {Class<*>} superClass
+   * @returns {Class<*>} typeConstructor
+   */
+  createProxy(superClass) {
+    return class Proxy extends superClass {};
+  }
+
+  /**
+   * @param {Class<*>} typeConstructor
+   * @returns {string}
+   */
+  getIdentifier(typeConstructor) {
+    return typeConstructor.__d__;
+  }
+
+  /**
+   * @param {Class<*>} typeConstructor
+   * @param {string} identifier
+   */
+  setIdentifier(typeConstructor, identifier) {
+    Object.defineProperty(typeConstructor, '__d__', {
+      value: identifier
+    });
+  }
+
+  /**
+   * @param {metamodel.ManagedType} type
+   * @param {Class<*>} typeConstructor
+   */
+  enhance(type, typeConstructor) {
+    if (typeConstructor.__ype__ == type)
+      return;
+
+    if (typeConstructor.hasOwnProperty('__ype__'))
+      throw new Error('Type is already used by a different manager');
+
+    Object.defineProperty(typeConstructor, '__ype__', {
+      value: type
+    });
+
+    this.setIdentifier(typeConstructor, type.ref);
+    this.enhancePrototype(typeConstructor.prototype, type);
+  }
+
+  /**
+   * Enhance the prototype of the type
+   * @param {Object} proto
+   * @param {metamodel.ManagedType} type
+   */
+  enhancePrototype(proto, type) {
+    if (proto.toString === Object.prototype.toString) {
+      // implements a better convenience toString method
+      Object.defineProperty(proto, 'toString', {
+        value: function toString() {
+          return this._metadata.id || this._metadata.bucket;
+        },
+        enumerable: false
+      });
+    }
+
+    // enhance all persistent object properties
+    if (type.superType && type.superType.name == 'Object') {
+      for (let attr of type.superType.declaredAttributes) {
+        if (!attr.isMetadata)
+          this.enhanceProperty(proto, attr);
+      }
+    }
+
+    // enhance all persistent properties
+    for (let attr of type.declaredAttributes) {
+      this.enhanceProperty(proto, attr);
+    }
+  }
+
+  /**
+   * @param {Object} proto
+   * @param {metamodel.Attribute} attribute
+   */
+  enhanceProperty(proto, attribute) {
+    var name = '$' + attribute.name;
+    Object.defineProperty(proto, attribute.name, {
+      get() {
+        var metadata = this._metadata;
+        metadata.readAccess();
+        return metadata[name];
+      },
+      set(value) {
+        var metadata = this._metadata;
+        metadata.writeAccess();
+        metadata[name] = value;
+      },
+      configurable: true,
+      enumerable: true
+    });
+  }
+}
+
+module.exports = Enhancer;
+
+
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_Entity.js.html b/doc/lib_binding_Entity.js.html new file mode 100644 index 00000000..dff09d54 --- /dev/null +++ b/doc/lib_binding_Entity.js.html @@ -0,0 +1,611 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/Entity.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/Entity.js

+ + + + + + +
+
+
"use strict";
+
+var Managed = require('./Managed');
+
+/**
+ * @alias binding.Entity
+ * @extends binding.Managed
+ */
+class Entity extends Managed {
+  /**
+   * The default constructor, copy all given properties to this object
+   * @param {Object=} properties - The optional properties to copy
+   */
+  constructor(properties) {
+    super(properties);
+  }
+}
+
+Object.defineProperties(Entity.prototype, /** @lends binding.Entity.prototype */ {
+  /**
+   * The unique id of this object
+   *
+   * Sets the unique id of this object, if the id is not formatted as an valid id,
+   * it will be used as the key component of the id has the same affect as setting the key
+   *
+   * @type string
+   */
+  id: {
+    get() {
+      return this._metadata.id;
+    },
+
+    set(value) {
+      if (this._metadata.id)
+        throw new Error('The id can\'t be set twice: ' + value);
+
+      value += '';
+      if (value.indexOf('/db/' + this._metadata.bucket + '/') == 0) {
+        this._metadata.id = value;
+      } else {
+        this.key = value;
+      }
+    },
+    enumerable: true
+  },
+
+
+  /**
+   * The unique key part of the id
+   * When the key of the unique id is set an error will be thrown if an id is already set.
+   * @type string
+   */
+  key: {
+    get() {
+      return this._metadata.key;
+    },
+
+    set(value) {
+      this._metadata.key = value;
+    }
+  },
+
+  /**
+   * The version of this object
+   * @type number
+   */
+  version: {
+    get() {
+      return this._metadata.version;
+    },
+    enumerable: true
+  },
+
+  /**
+   * The object read/write permissions
+   * @type Acl
+   */
+  acl: {
+    get() {
+      return this._metadata.acl;
+    },
+    enumerable: true
+  },
+
+  /**
+   * Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled
+   * @param {util.Lockable~callback=} doneCallback The callback which will be invoked when the previously
+   * operations on this object is completed.
+   * @return {Promise<binding.Entity>} A promise which completes successfully, when the previously requested
+   * operation completes
+   * @method
+   */
+  ready: {
+    value: function ready(doneCallback) {
+      return this._metadata.ready(doneCallback);
+    }
+  },
+
+  /**
+   * Attach this object to the given db
+   * @param {EntityManager} db The db which will be used for future crud operations
+   * @method
+   */
+  attach: {
+    value: function attach(db) {
+      db.attach(this);
+    }
+  },
+
+  /**
+   * Saves the object. Inserts the object if it doesn't exists and updates the object if the object exist.
+   * @param {Object} [options] The save options
+   * @param {boolean} [options.force=false] Force the save operation, the version will not be validated.
+   * @param {number|boolean} [options.depth=0] The object depth which will be saved. Depth 0 save this object only,
+   * <code>true</code> saves the objects by reachability.
+   * @param {boolean} [options.refresh=false] Refresh the local object state from remote.
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<binding.Entity>} A Promise that will be fulfilled when the asynchronous operation completes.
+   * @method
+   */
+  save: {
+    value: function save(options, doneCallback, failCallback) {
+      if (options instanceof Function) {
+        failCallback = doneCallback;
+        doneCallback = options;
+        options = {};
+      }
+
+      return this._metadata.db.save(this, options).then(doneCallback, failCallback);
+    }
+  },
+
+  /**
+   * Inserts a new object. Inserts the object if it doesn't exists and raise an error if the object already exist.
+   * @param {Object} [options] The insertion options
+   * @param {number|boolean} [options.depth=0] The object depth which will be inserted. Depth 0 insert this object only,
+   * <code>true</code> inserts objects by reachability.
+   * @param {boolean} [options.refresh=false] Refresh the local object state from remote.
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<binding.Entity>} A Promise that will be fulfilled when the asynchronous operation completes.
+   * @method
+   */
+  insert: {
+    value: function insert(options, doneCallback, failCallback) {
+      if (options instanceof Function) {
+        failCallback = doneCallback;
+        doneCallback = options;
+        options = {};
+      }
+
+      return this._metadata.db.insert(this, options).then(doneCallback, failCallback);
+    }
+  },
+
+  /**
+   * Updates an existing object.
+   * Updates the object if it exists and raise an error if the object doesn't exist.
+   * @param {Object} [options] The update options
+   * @param {boolean} [options.force=false] Force the update operation, the version will not be validated, only existence will be checked.
+   * @param {number|boolean} [options.depth=0] The object depth which will be updated. Depth 0 updates this object only,
+   * <code>true</code> updates objects by reachability.
+   * @param {boolean} [options.refresh=false] Refresh the local object state from remote.
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<binding.Entity>} A Promise that will be fulfilled when the asynchronous operation completes.
+   * @method
+   */
+  update: {
+    value: function update(options, doneCallback, failCallback) {
+      if (options instanceof Function) {
+        failCallback = doneCallback;
+        doneCallback = options;
+        options = {};
+      }
+
+      return this._metadata.db.update(this, options).then(doneCallback, failCallback);
+    }
+  },
+
+  /**
+   * Resolves the referenced object in the specified depth. Only unresolved objects will be loaded unless the refresh option is specified.
+   * Removed objects will be marked as removed.
+   * @param {Object} [options] The load options
+   * @param {number|boolean} [options.depth=0] The object depth which will be loaded. Depth set to <code>true</code>
+   * loads objects by reachability.
+   * @param {boolean} [options.refresh=false] Refresh the local object state from remote.
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<binding.Entity>} A Promise that will be fulfilled when the asynchronous operation completes.
+   * @method
+   */
+  load: {
+    value: function load(options, doneCallback, failCallback) {
+      if (options instanceof Function) {
+        failCallback = doneCallback;
+        doneCallback = options;
+        options = {};
+      }
+      options = options || {};
+      options.local = true;
+
+      return this._metadata.db.load(this.id, null, options).then(doneCallback, failCallback);
+    }
+  },
+
+  /**
+   * Delete an existing object.
+   * @param {Object} [options] The remove options
+   * @param {boolean} [options.force=false] Force the remove operation, the version will not be validated.
+   * @param {number|boolean} [options.depth=0] The object depth which will be removed. Depth 0 removes this object only,
+   * <code>true</code> removes objects by reachability.
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<binding.Entity>} A Promise that will be fulfilled when the asynchronous operation completes.
+   * @method
+   */
+  'delete': {
+    value: function(options, doneCallback, failCallback) {
+      if (options instanceof Function) {
+        failCallback = doneCallback;
+        doneCallback = options;
+        options = {};
+      }
+
+      return this._metadata.db.delete(this, options).then(doneCallback, failCallback);
+    }
+  },
+
+  /**
+   * Saves the object and repeats the operation if the object is out of date.
+   * In each pass the callback will be called. Ths first parameter of the callback is the entity and the second one
+   * is a function to abort the process.
+   *
+   * @param {Function} cb Will be called in each pass
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<binding.Entity>} A Promise that will be fulfilled when the asynchronous operation completes.
+   * @method
+   */
+  optimisticSave: {
+    value: function optimisticSave(cb, doneCallback, failCallback) {
+      return this._metadata.db.optimisticSave(this, cb).then(doneCallback, failCallback);
+    }
+  },
+
+  attr: {
+    value: function attr() {
+      throw new Error("Attr is not yet implemented.");
+    }
+  },
+
+  /**
+   * Validates the entity by using the validation code of the entity type
+   *
+   * @returns {util.ValidationResult} Contains the result of the Validation
+   * @method
+   */
+  validate: {
+    value: function validate() {
+      return this._metadata.db.validate(this);
+    }
+  },
+
+  /**
+   * Converts the entity to an JSON-Object.
+   * @param {boolean=} excludeMetadata Indicates if the metadata i.e. id, version and acls should not be included into the json
+   * @return {json} JSON-Object
+   * @method
+   */
+  toJSON: {
+    value: function toJSON(excludeMetadata) {
+      return this._metadata.getJson(excludeMetadata);
+    }
+  }
+});
+
+module.exports = Entity;
+
+/**
+ * The done callback is called, when the asynchronous operation completes successfully
+ * @callback binding.Entity~doneCallback
+ * @param {binding.Entity} entity This entity
+ * @return {Promise<*>|*} A Promise, result or undefined
+ */
+
+/**
+ * The fail callback is called, when the asynchronous operation is rejected by an error
+ * @callback binding.Entity~failCallback
+ * @param {error.PersistentError} error The error which reject the operation
+ * @return {Promise<*>|*} A Promise, result or undefined
+ */
+
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_EntityFactory.js.html b/doc/lib_binding_EntityFactory.js.html new file mode 100644 index 00000000..3ebba114 --- /dev/null +++ b/doc/lib_binding_EntityFactory.js.html @@ -0,0 +1,401 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/EntityFactory.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/EntityFactory.js

+ + + + + + +
+
+
"use strict";
+
+var ManagedFactory = require('./ManagedFactory');
+
+/**
+ * @class binding.EntityFactory<T>
+ * @extends binding.ManagedFactory<T>
+ *
+ * @param {Object=} properties initial properties to set on the instance
+ * @param {...*} arguments Additional constructor params passed through the type constructor
+ * @return {T} The new managed instance
+ */
+var EntityFactory = ManagedFactory.extend(/** @lends binding.EntityFactory<T>.prototype */ {
+  /**
+   * Loads the instance for the given id, or null if the id does not exists.
+   * @param {string} id The id to query
+   * @param {Object} [options] The load options
+   * @param {number|boolean} [options.depth=0] The object depth which will be saved. Depth 0 saves only this object,
+   * <code>true</code> saves the objects by reachability.
+   * @param {boolean} [options.refresh=false] Indicates whether the object should be revalidated (cache bypass).
+   * @param {boolean} [options.local=false] Indicates whether the local copy (from the entity manager)
+   * of an object should be returned if it exists. This value might be stale.
+   * @param {binding.EntityFactory~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.EntityFactory~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<T>} A Promise that will be fulfilled when the asynchronous operation completes.
+   */
+  load(id, options, doneCallback, failCallback) {
+    if (options instanceof Function) {
+      failCallback = doneCallback;
+      doneCallback = options;
+      options = {};
+    }
+
+    return this._db.load(this._managedType.typeConstructor, id, options).then(doneCallback, failCallback);
+  },
+
+  /**
+   * Creates a new instance and sets the DatabaseObject to the given json
+   * @param {json} json
+   * @returns {T} instance
+   */
+  fromJSON(json) {
+    var instance = json.id ? this._db.getReference(this._managedType.typeConstructor, json.id) : this.newInstance();
+    var metadata = instance._metadata;
+    metadata.setJson(json);
+    return instance;
+  },
+
+  /**
+   * Creates a new query for this class
+   * @return {query.Builder<T>} The query builder
+   */
+  find() {
+    return this._db.createQueryBuilder(this._managedType.typeConstructor);
+  },
+
+  partialUpdate() {
+    throw new Error("partialUpdate is not yet implemented.");
+  }
+
+  /**
+   * Creates a new instance of the of this type
+   * @function
+   * @name new
+   * @param {Object<string, *>} properties Additional properties which will be applied to the created instance
+   * @return {binding.Entity} A new created instance of this class
+   * @memberOf binding.EntityFactory.prototype
+   */
+});
+
+module.exports = EntityFactory;
+
+/**
+ * The entity callback is called, when the asynchronous operation completes successfully
+ * @callback binding.EntityFactory~doneCallback
+ * @param {T} entity The entity
+ * @return {Promise<*>|*} A Promise or result
+ */
+
+/**
+ * The fail callback is called, when the asynchronous operation is rejected by an error
+ * @callback binding.EntityFactory~failCallback
+ * @param {error.PersistentError} error The error which reject the operation
+ * @return {Promise<*>|*} A Promise or result
+ */
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_Factory.js.html b/doc/lib_binding_Factory.js.html new file mode 100644 index 00000000..b4afd386 --- /dev/null +++ b/doc/lib_binding_Factory.js.html @@ -0,0 +1,398 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/Factory.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/Factory.js

+ + + + + + +
+
+
"use strict";
+
+/**
+ * This factory creates instances of type T, by invoking the {@link #new()} method or by instanciating this factory directly
+ * @class binding.Factory<T>
+ *
+ * @param {...any} args constructor params passed to the type constructor
+ * @return {T} The new instance
+ */
+var Factory = extend( /** @lends binding.Factory<T>.prototype */ {
+
+  /**
+   * Creates a child factory of this factory
+   * @param {Object} factoryMembers additional members applied to the child factory
+   * @returns {Object} The new created child Factory
+   * @static
+   * @ignore
+   */
+  extend(factoryMembers) {
+    //copy all factory members to the child factory
+    return extend({}, this, factoryMembers);
+  },
+
+  /**
+   * Creates a new Factory for the given type
+   * @param {Class<*>} type the type constructor of T
+   * @return {binding.Factory} A new object factory to created instances of T
+   * @static
+   * @ignore
+   */
+  create(type) {
+    var factory = function Factory(properties) {
+      return factory.newInstance(arguments);
+    };
+
+    extend(factory, this);
+
+    //lets instanceof work properly
+    factory.prototype = type.prototype;
+    factory._type = type;
+
+    return factory;
+  },
+
+  /**
+   * Creates a new instance of the factory type
+   * @param {...any} args Constructor arguments used for instantiation
+   * @return {*} A new created instance of *
+   * @instance
+   */
+  new() {
+    return this.newInstance(arguments);
+  },
+
+  /**
+   * Creates a new instance of the factory type
+   * @param {Array<*>=} a Constructor arguments used for instantiation
+   * @return {*} A new created instance of *
+   * @instance
+   */
+  newInstance(a) {
+    var instance;
+    if (!a || a.length == 0) {
+      instance = new this._type();
+    } else {
+      //es6 constructors can't be called, therfore we must provide all arguments separately
+      //TODO: uggly! replace this with the spread operator if node support it
+      instance = new this._type(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9]);
+    }
+
+    return instance;
+  }
+});
+
+function extend(target) {
+  for (let i = 1, source; source = arguments[i]; ++i)
+    for (let prop of Object.getOwnPropertyNames(source))
+      Object.defineProperty(target, prop, Object.getOwnPropertyDescriptor(source, prop));
+  return target;
+}
+
+module.exports = Factory;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_File.js.html b/doc/lib_binding_File.js.html new file mode 100644 index 00000000..81699b84 --- /dev/null +++ b/doc/lib_binding_File.js.html @@ -0,0 +1,868 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/File.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/File.js

+ + + + + + +
+
+
"use strict";
+
+var error = require('../error');
+var Acl = require('../Acl');
+var util = require('../util/util');
+var message = require('../message');
+var StatusCode = require('../connector/Message').StatusCode;
+
+var PREFIX = '/file';
+var LEN = PREFIX.length;
+
+/**
+ * Creates a file object, which represents one specific file reference.
+ * This File object can afterwards be used to up- and download the file contents or to retrieves and change the files
+ * metadata.
+ *
+ * The file data can be uploaded and downloaded as:
+ *
+ *  <table class="table">
+ *   <tr>
+ *     <th>type</th>
+ *     <th>JavaScript type</th>
+ *     <th>Description</th>
+ *   </tr>
+ *   <tr>
+ *     <td>'arraybuffer'</td>
+ *     <td>ArrayBuffer</td>
+ *     <td>The content is represented as a fixed-length raw binary data buffer</td>
+ *   </tr>
+ *   <tr>
+ *     <td>'blob'</th>
+ *     <td>Blob</td>
+ *     <td>The content is represented as a simple blob</td>
+ *   </tr>
+ *   <tr>
+ *     <td>'json'</td>
+ *     <td>object|array|string</td>
+ *     <td>The file content is represented as json</td>
+ *   </tr>
+ *   <tr>
+ *     <td>'text'</td>
+ *     <td>string</td>
+ *     <td>The file content is represented through the string</td>
+ *   </tr>
+ *   <tr>
+ *     <td>'base64'</td>
+ *     <td>string</td>
+ *     <td>The file content as base64 encoded string</td>
+ *   </tr>
+ *   <tr>
+ *     <td>'data-url'</td>
+ *     <td>string</td>
+ *     <td>A data url which represents the file content</td>
+ *   </tr>
+ * </table>
+ *
+ *
+ * @alias binding.File
+ */
+class File {
+
+  /**
+   * The complete id of the file, including folder and name
+   * @type string
+   */
+  get id() {
+    return this._id;
+  }
+
+  /**
+   * The fully url to the file, can be directly used to link the file, i.e. in link tags ot image sources
+   * @type string
+   */
+  get url() {
+    if (this.isFolder) {
+      throw new Error("Url can not be created for folders.");
+    }
+    if (!this._url) {
+      this._url = this._db.createURL(this.id, this.bucket != 'www');
+    }
+    return this._url;
+  }
+
+  /**
+   * The name of the file
+   * @type string
+   */
+  get name() {
+    if (!this._name)
+      this._name = this._id.substring(this._id.lastIndexOf('/', this._id.length - 2) + 1);
+    return this._name;
+  }
+
+  /**
+   * The mimeType of the file, only accessible after fetching the metadata or downloading/uploading/providing the file
+   * @type string
+   */
+  get mimeType() {
+    if (this.isFolder) {
+      throw new Error("A folder has no mimeType");
+    }
+    this._checkAvailable();
+    return this._mimeType;
+  }
+
+  /**
+   * The current file acl, only accessible after fetching the metadata or downloading/uploading/providing the file
+   * @type string
+   */
+  get acl() {
+    this._checkAvailable();
+    return this._acl;
+  }
+
+  /**
+   * The last modified date of the file, only accessible after fetching the metadata or downloading/uploading/providing the eTag
+   * @type string
+   */
+  get lastModified() {
+    if (this.isFolder) {
+      throw new Error("A folder has no lastModified");
+    }
+    this._checkAvailable();
+    return this._lastModified;
+  }
+
+  /**
+   * The eTag of the file, only accessible after fetching the metadata or downloading/uploading/providing the file
+   * @type string
+   */
+  get eTag() {
+    if (this.isFolder) {
+      throw new Error("A folder has no eTag");
+    }
+    this._checkAvailable();
+    return this._eTag;
+  }
+
+  /**
+   * The size of the file, only accessible after fetching the metadata or downloading/uploading/providing the file
+   * @type string
+   */
+  get size() {
+    if (this.isFolder) {
+      throw new Error("A folder has no size");
+    }
+    this._checkAvailable();
+    return this._size;
+  }
+
+  get bucket() {
+    return this.id.substring(LEN + 1, this.id.indexOf('/', LEN + 1));
+  }
+
+  get key() {
+    return this.id.substring(this.id.indexOf('/', LEN + 1) + 1);
+  }
+
+  /**
+   * The full path of the file.
+   * @type string
+   */
+  get path() {
+    return this.id.substring(LEN);
+  }
+
+  /**
+   * The parent folder of the file.
+   * @type string
+   */
+  get parent() {
+    return this.id.substring(LEN, this.id.lastIndexOf('/', this.id.length - 2));
+  }
+
+  /**
+   * Indicates if the metadata are loaded.
+   * @type boolean
+   */
+  get isMetadataLoaded() {
+    return this._available;
+  }
+
+  /**
+   * Creates a new file object which represents the a file at the given id. Data are provided to the constructor will
+   * be uploaded by invoking {@link upload()}
+   * @param {object|string} fileOptions The fileOptions used to create a new file object, or just the id of the
+   * file object
+   * @param {string=} fileOptions.id The id of the file.
+   * @param {string=} fileOptions.name The filename without the id. If omitted and data is provided as a file object, the
+   * {@link File#name} will be used otherwise a uuid will be generated.
+   * @param {string} [fileOptions.parent="/www"] The parent folder which contains the file
+   * @param {string} [fileOptions.path="/www"] The full path of the file. You might either specifiy the path of the file or a combination of parent and file name.
+   * @param {string|Blob|File|ArrayBuffer|json=} fileOptions.data The initial file content, which will be uploaded by
+   * invoking {@link #upload} later on.
+   * @param {string=} fileOptions.type A optional type hint used to correctly interpret the provided data
+   * @param {string=} fileOptions.mimeType The mimType of the file. Defaults to the mimeType of the provided data if
+   * it is a file object, blob or data-url
+   * @param {string=} fileOptions.eTag The optional current ETag of the file
+   * @param {string=} fileOptions.lastModified The optional last modified date
+   * @param {Acl=} fileOptions.acl The file acl which will be set, if the file is uploaded afterwards
+   */
+  constructor(fileOptions) {
+    fileOptions = fileOptions || {};
+
+    this._available = false;
+
+    if (Object(fileOptions) instanceof String) {
+      let id = fileOptions;
+      let nameSeparator = id.indexOf('/', '/file/'.length);
+      if (nameSeparator == -1 || id.indexOf('/file/') != 0) {
+        throw new Error('Invalid file reference ' + id);
+      }
+
+      this._id = id;
+    } else if (fileOptions.id) {
+      this._id = fileOptions.id;
+      this._setMetadata(fileOptions);
+    } else {
+      let path;
+      if (fileOptions.path) {
+        path = fileOptions.path;
+      } else {
+        let parent = fileOptions.parent || '/www';
+        if (parent.charAt(parent.length - 1) != '/')
+          parent = parent + '/';
+
+        if (parent.length < 3) {
+          throw new Error('Invalid parent name: ' + parent);
+        }
+
+        let name = fileOptions.name || (fileOptions.data && fileOptions.data.name) || util.uuid();
+        path = parent + name;
+      }
+
+      if (path.charAt(0) != '/')
+        path = '/' + path;
+
+      if (path.indexOf('//') != -1 || path.length < 3)
+        throw new Error('Invalid path: ' + path);
+
+      this._id = PREFIX + path;
+      this._setMetadata(fileOptions);
+    }
+
+    /**
+     * Specifies whether this file is a folder.
+     * @type {boolean}
+     */
+    this.isFolder = this._id.charAt(this._id.length - 1) == '/';
+  }
+
+  /**
+   * Uploads the file content which was provided in the constructor or by uploadOptions.data
+   * @param {object=} uploadOptions The upload options
+   * @param {string|Blob|File|ArrayBuffer|json=} uploadOptions.data The initial file content, which will be uploaded by
+   * invoking {@link #upload} later on.
+   * @param {string=} uploadOptions.type A optional type hint used to correctly interpret the provided data
+   * @param {string=} uploadOptions.mimeType The mimType of the file. Defaults to the mimeType of the provided data if
+   * it is a file object, blob or data-url
+   * @param {string=} uploadOptions.eTag The optional current ETag of the file
+   * @param {string=} uploadOptions.lastModified The optional last modified date
+   * @param {Acl=} uploadOptions.acl The file acl which will be set, if the file is uploaded afterwards
+   * @param {boolean} [uploadOptions.force=false] force the upload and overwrite any existing files without validating it
+   * @param {connector.Message~progressCallback} [uploadOptions.progress] listen to progress changes during upload
+   * @param {binding.File~fileCallback=} doneCallback The callback is invoked after the upload succeed successfully
+   * @param {binding.File~failCallback=} failCallback The callback is invoked if any error is occurred
+   * @return {Promise<binding.File>} A promise which will be fulfilled with this file object where the metadata is updated
+   */
+  upload(uploadOptions, doneCallback, failCallback) {
+    uploadOptions = uploadOptions || {};
+
+    if (this.isFolder) {
+      throw new Error("A folder cannot be uploaded");
+    }
+
+    this._setMetadata(uploadOptions);
+
+    const uploadMessage = new message.UploadFile(this.bucket, this.key)
+        .entity(this._data, this._type)
+        .acl(this._acl);
+
+    uploadMessage.progress(uploadOptions.progress);
+
+    if (this._size) {
+      uploadMessage.contentLength(this._size);
+    }
+
+    if (this._mimeType) {
+      uploadMessage.mimeType(this._mimeType);
+    }
+
+    this._conditional(uploadMessage, uploadOptions);
+
+    this._db.addToBlackList(this.id);
+    return this._db.send(uploadMessage).then((response) => {
+      this._data = null;
+      this._type = null;
+
+      this.fromJSON(response.entity);
+      return this;
+    }).then(doneCallback, failCallback);
+  }
+
+  /**
+   * Download a file and providing it in the requested type
+   * @param {object=} downloadOptions The download options
+   * @param {string} [downloadOptions.type="blob"] The type used to provide the file
+   * @param {string} [downloadOptions.refresh=false] Indicates to make a revalidation request and not use the cache
+   * @param {binding.File~downloadCallback=} doneCallback The callback is invoked after the download succeed successfully
+   * @param {binding.File~failCallback=} failCallback The callback is invoked if any error is occurred
+   * @return {Promise<string|Blob|File|ArrayBuffer|json>} A promise which will be fulfilled with the downloaded file content
+   */
+  download(downloadOptions, doneCallback, failCallback) {
+    downloadOptions = downloadOptions || {};
+
+    if (this.isFolder) {
+      throw new Error("A folder cannot be downloaded");
+    }
+
+    var type = downloadOptions.type || 'blob';
+
+    var downloadMessage = new message.DownloadFile(this.bucket, this.key)
+        .responseType(type);
+
+    this._db.ensureCacheHeader(this.id, downloadMessage, downloadOptions.refresh);
+
+    return this._db.send(downloadMessage).then((response) => {
+      this._db.addToWhiteList(this.id);
+      this._fromHeaders(response.headers);
+      return response.entity;
+    }, (e) => {
+      if (e.status == StatusCode.OBJECT_NOT_FOUND) {
+        return null;
+      } else {
+        throw e;
+      }
+    }).then(doneCallback, failCallback);
+  }
+
+  /**
+   * Deletes a file
+   * @param {object=} deleteOptions The delete options
+   * @param {boolean} [deleteOptions.force=false] force the deletion without verifying any version
+   * @param {binding.File~deleteCallback=} doneCallback The callback is invoked after the deletion succeed successfully
+   * @param {binding.File~failCallback=} failCallback The callback is invoked if any error is occurred
+   * @return {Promise<binding.File>} A promise which will be fulfilled with this file object
+   */
+  delete(deleteOptions, doneCallback, failCallback) {
+    deleteOptions = deleteOptions || {};
+
+    if (this.isFolder) {
+      throw new Error("A folder cannot be deleted");
+    }
+
+    var deleteMessage = new message.DeleteFile(this.bucket, this.key);
+    this._conditional(deleteMessage, deleteOptions);
+
+    this._db.addToBlackList(this.id);
+    return this._db.send(deleteMessage).then(function() {
+      return this;
+    }).then(doneCallback, failCallback);
+  }
+
+  _conditional(message, options) {
+    if (!options.force) {
+      if (this._lastModified)
+        message.ifUnmodifiedSince(this._lastModified);
+      if (this._eTag)
+        message.ifMatch(this._eTag);
+      if (!this._lastModified && !this._eTag)
+        message.ifNoneMatch('*');
+    }
+  }
+
+  /**
+   * Gets the file metadata of a file
+   * @param {Object} options The load metadata options
+   * @param {Object} [options.refresh=false] Force a revalidation while fetching the metadata
+   * @param {binding.File~fileCallback=} doneCallback The callback is invoked after the metadata is fetched
+   * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred
+   * @return {Promise<binding.File>} A promise which will be fulfilled with this file
+   */
+  loadMetadata(options, doneCallback, failCallback) {
+    options = options || {};
+
+    if (this.isFolder) {
+      throw new Error("A folder has no matadata");
+    }
+
+    let msg = new message.GetFileMetadata(this.bucket, this.key);
+    this._db.ensureCacheHeader(this.id, msg, options.refresh);
+    return this._db.send(msg).then((response) => {
+      // do not white list the file, because head-request does not revalidate the cache.
+      this._fromHeaders(response.headers);
+      return this;
+    }, (e) => {
+      if (e.status == StatusCode.OBJECT_NOT_FOUND) {
+        return null;
+      } else {
+        throw e;
+      }
+    }).then(doneCallback, failCallback);
+  }
+
+  /**
+   * Updates the matadata of this file.
+   * @param {boolean} [options.force=false] force the update and overwrite the existing metadata without validating it
+   * @return {Promise<binding.File>} A promise which will be fulfilled with this file
+   */
+  saveMetadata(options, doneCallback, failCallback) {
+    options = options || {};
+
+    let metadata = this.toJSON();
+    metadata.id = this._id;
+
+    let msg = new message.UpdateFileMetadata(this.bucket, this.key)
+        .entity(metadata);
+
+    this._conditional(msg, options);
+
+    return this._db.send(msg).then((response) => {
+      this.fromJSON(response);
+      return this;
+    });
+  }
+
+  /**
+   * Validates and sets the file metadata based on the given options
+   * @param {Object} options
+   * @private
+   */
+  _setMetadata(options) {
+    let data = options.data;
+    let type = options.type;
+    let eTag = options.eTag;
+    let acl = options.acl;
+    let size = options.size;
+    let mimeType = options.mimeType;
+    let lastModified = options.lastModified;
+
+    if (!data) {
+      this._available = false;
+    } else {
+      if (typeof Blob !== "undefined" && data instanceof Blob) {
+        mimeType = mimeType || data.type;
+      } else if (type == 'data-url') {
+        let match = data.match(/^data:(.+?)(;base64)?,.*$/);
+        mimeType = mimeType || match[1];
+      }
+
+      this._data = data;
+      this._type = type;
+      this._size = size;
+
+      this._mimeType = mimeType;
+      this._acl = acl || this._acl || new Acl();
+      this._available = true;
+    }
+
+    this._eTag = eTag || this._eTag;
+
+    if (lastModified) {
+      this._lastModified = new Date(lastModified);
+    }
+  }
+
+  _fromHeaders(headers) {
+    this.fromJSON({
+      eTag: headers.etag ? headers.etag.substring(1, headers.etag.length - 1) : null,
+      lastModified: headers['last-modified'],
+      mimeType: headers['content-type'],
+      acl: headers['baqend-acl'] && JSON.parse(headers['baqend-acl']),
+      contentLength: +headers['baqend-size']
+    });
+  }
+
+  fromJSON(metadata) {
+    if (metadata.mimeType)
+      this._mimeType = metadata.mimeType;
+
+    if (metadata.lastModified)
+      this._lastModified = new Date(metadata.lastModified);
+
+    if (metadata.eTag)
+      this._eTag = metadata.eTag;
+
+    this._acl = this._acl || new Acl();
+    if (metadata.acl)
+      this._acl.fromJSON(metadata.acl);
+
+    if (metadata.contentLength)
+      this._size = metadata.contentLength;
+
+    this._available = true;
+  }
+
+  toJSON() {
+    var result = {
+      mimeType: this._mimeType,
+      eTag: this._eTag,
+      acl: this._acl,
+      contentLength: this._size
+    };
+
+    if (this._lastModified) {
+      result.lastModified = this._lastModified.toISOString();
+    }
+    return result;
+  }
+
+  _checkAvailable() {
+    if (!this._available) {
+      throw new error.PersistentError('The file metadata of ' + this.id + ' is not available.');
+    }
+  }
+
+  /**
+   * The database connection to use
+   * @member {EntityManager} _db
+   * @private
+   */
+}
+
+/**
+ * The file callback is called, when the asynchronous operation completes successfully
+ * @callback binding.File~fileCallback
+ * @param {binding.File} file The updated file metadata
+ * @return {any} A Promise, result or undefined
+ */
+
+/**
+ * The download callback is called, when the asynchronous download completes successfully
+ * @callback binding.File~downloadCallback
+ * @param {string|Blob|File|ArrayBuffer|json} data The download file content in the requested format
+ * @return {any} A Promise, result or undefined
+ */
+
+/**
+ * The delete callback is called, when the asynchronous deletion completes successfully
+ * @callback binding.File~deleteCallback
+ * @param {binding.File} data The file metadata
+ * @return {any} A Promise, result or undefined
+ */
+
+/**
+ * The fail callback is called, when the asynchronous operation is rejected by an error
+ * @callback binding.File~failCallback
+ * @param {error.PersistentError} error The error which reject the operation
+ * @return {any} A Promise, result or undefined
+ */
+
+module.exports = File;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_FileFactory.js.html b/doc/lib_binding_FileFactory.js.html new file mode 100644 index 00000000..6cededb5 --- /dev/null +++ b/doc/lib_binding_FileFactory.js.html @@ -0,0 +1,488 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/FileFactory.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/FileFactory.js

+ + + + + + +
+
+
"use strict";
+
+var Factory = require('./Factory');
+var File = require('./File');
+var message = require('../message');
+var Permission = require('../util/Permission');
+
+/**
+ * @class binding.FileFactory
+ * @extends binding.Factory<binding.File>
+ *
+ * @param {Object=} properties initial properties to set on the file
+ * @param {...*} arguments Additional constructor params passed through the type constructor
+ * @return {binding.File} The new managed instance
+ */
+var FileFactory = Factory.extend(/** @lends binding.FileFactory.prototype */ {
+
+  /**
+   * Creates a new FileFactory for the given type
+   * @param {EntityManager} db
+   * @return {binding.FileFactory} A new file factory
+   * @static
+   */
+  create(db) {
+    //invoke super method
+    let factory = Factory.create.call(this, File);
+    factory._db = db;
+    return factory;
+  },
+
+  /**
+   * Creates a new file
+   * @param {Array<*>=} args Constructor arguments used for instantiation, the constructor will not be called
+   * when no arguments are passed
+   * @return {binding.File} A new created file
+   */
+  newInstance(args) {
+    let instance = Factory.newInstance.call(this, args);
+    instance._db = this._db;
+    return instance;
+  },
+
+  /**
+   * Updates the metadata of the root file directory formally the file "bucket"
+   * @param {string} bucket The name of the root file directory
+   * @param {Object} metadata The new metadata for the bucket
+   * @param {util.Permission} metadata.loadPermission The load permission which grants read access to all stored
+   * files under the specified bucket
+   * @param {util.Permission} metadata.insertPermission The insert permission which is required to insert new
+   * files into the bucket
+   * @param {util.Permission} metadata.updatePermission The update permission which is required to update existing
+   * files within the bucket
+   * @param {util.Permission} metadata.deletePermission The delete permission which is required to delete existing
+   * files within the bucket
+   * @param {util.Permission} metadata.queryPermission The query permission which is required to list all files
+   * within a bucket
+   * @param {binding.FileFactory~bucketMetadataCallback=} doneCallback Invoked if the operation succeeds
+   * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred
+   * @return {Promise<void>} A promise which will fulfilled with the updated metadata
+   */
+  saveMetadata(bucket, metadata, doneCallback, failCallback) {
+    var msg = new message.SetFileBucketMetadata(bucket, metadata);
+    return this._db.send(msg).then(doneCallback, failCallback);
+  },
+
+  /**
+   * Gets the metadata of the root folder (formally the file "bucket")
+   * @param {string} bucket The name of the root file directory
+   * @param {Object} options The load metadata options
+   * @param {Object} [options.refresh=false] Force a revalidation while fetching the metadata
+   * @param {binding.FileFactory~bucketMetadataCallback=} doneCallback The callback is invoked after the metadata is fetched
+   * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred
+   * @return {Promise<Object>} A promise which will be fulfilled with the bucket acls
+   */
+  loadMetadata(bucket, options, doneCallback, failCallback){
+    options = options || {};
+
+    let msg = new message.GetFileBucketMetadata(bucket);
+    // this._db.ensureCacheHeader(this.id, msg, options.refresh);
+    // do not white list the file, because head-request does not revalidate the cache.
+    return this._db.send(msg).then((response) => {
+      var result = {};
+      Permission.BASE_PERMISSIONS.forEach((key) => {
+        result[key] = Permission.fromJSON(response.entity[key] || {});
+      });
+      return result;
+    }, (e) => {
+      if (e.status == StatusCode.OBJECT_NOT_FOUND) {
+        return null;
+      } else {
+        throw e;
+      }
+    }).then(doneCallback, failCallback);
+  },
+
+  /**
+   * Lists all the buckets.
+   * @param {binding.FileFactory~fileListCallback=} doneCallback The callback is invoked with the listed buckets
+   * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred
+   * @return {Promise<Array<binding.File>>} The listed buckets.
+   */
+  listBuckets(doneCallback, failCallback) {
+    return this._db.send(new message.ListBuckets()).then((response) => {
+      return response.entity.map((bucket) => this.new(bucket + '/'));
+    }).then(doneCallback, failCallback);
+  },
+
+  /**
+   * Lists the files (and folders) in the given folder.
+   *
+   * @param {binding.File|string} folder The folder/path to list.
+   * @param {binding.File} start The file/folder from where to start listing (not included)
+   * @param {number} count The maximum number of files to return.
+   * @param {binding.FileFactory~fileListCallback=} doneCallback The callback is invoked with the listed files
+   * @param {binding.File~failCallback=} failCallback The callback is invoked if any error has occurred
+   * @return {Promise<Array<binding.File>>} The listed files/folders.
+   */
+  listFiles(folder, start, count, doneCallback, failCallback) {
+    if (Object(folder) instanceof String) {
+      if (folder.charAt(folder.length - 1) != '/') {
+        folder += '/';
+      }
+      folder = this.new({path: folder});
+    }
+
+    var path = folder.key;
+    var bucket = folder.bucket;
+    start = start ? start.key : null;
+    return this._db.send(new message.ListFiles(bucket, path, start, count)).then((response) => {
+      return response.entity.map((file) => this.new(file));
+    }).then(doneCallback, failCallback);
+  }
+
+  /**
+   * Creates a new file object which represents the a file at the given id. Data are provided to the constructor will
+   * be uploaded by invoking {@link upload()}
+   * @param {object|string} fileOptions The fileOptions used to create a new file object, or just the id of the
+   * file object
+   * @param {string=} fileOptions.name The filename without the id. If omitted and data is provided as a file object, the
+   * {@link File#name} will be used otherwise a uuid will be generated.
+   * @param {string} [fileOptions.parent="/www"] The parent folder which contains the file
+   * @param {string|Blob|File|ArrayBuffer|json=} fileOptions.data The initial file content, which will be uploaded by
+   * invoking {@link #upload} later on.
+   * @param {string=} fileOptions.type A optional type hint used to correctly interpret the provided data
+   * @param {string=} fileOptions.mimeType The mimType of the file. Defaults to the mimeType of the provided data if
+   * it is a file object, blob or data-url
+   * @param {string=} fileOptions.eTag The optional current ETag of the file
+   * @param {string=} fileOptions.lastModified The optional last modified date
+   * @param {Acl=} fileOptions.acl The file acl which will be set, if the file is uploaded afterwards
+   * @return {binding.File} A new file instance
+   *
+   * @function
+   * @name new
+   * @memberOf binding.FileFactory.prototype
+   */
+});
+
+/**
+ * The list files callback is called, with the bucket metadata
+ * @callback binding.FileFactory~bucketMetadataCallback
+ * @param {Array<Object>} bucketMetadata the bucket metadata
+ * @return {any} A Promise, result or undefined
+ */
+
+/**
+ * The list files callback is called, with the loaded files
+ * @callback binding.FileFactory~fileListCallback
+ * @param {Array<binding.File>} files The listed files
+ * @return {any} A Promise, result or undefined
+ */
+
+module.exports = FileFactory;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_Managed.js.html b/doc/lib_binding_Managed.js.html new file mode 100644 index 00000000..67f38a15 --- /dev/null +++ b/doc/lib_binding_Managed.js.html @@ -0,0 +1,391 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/Managed.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/Managed.js

+ + + + + + +
+
+
"use strict";
+
+var Metadata = require('../util/Metadata');
+
+/**
+ * @alias binding.Managed
+ */
+class Managed {
+
+  /**
+   * Initialize the given instance
+   * @param {binding.Managed} instance The managed instance to initialize
+   * @param {Object=} properties The optional properties to set on the instance
+   */
+  static init(instance, properties) {
+    var type = instance.constructor.__ype__;
+    if (type) {
+      Object.defineProperty(instance, '_metadata', {
+        value: Metadata.create(type, instance),
+        configurable: true
+      });
+    }
+
+    if (properties)
+      Object.assign(instance, properties);
+  }
+
+  /**
+   * Creates a subclass of this class
+   * @param {Class<*>} childClass
+   * @return {Class<*>} The extended child class
+   */
+  static extend(childClass) {
+    childClass.prototype = Object.create(this.prototype, {
+      constructor: {
+        value: childClass,
+        configurable: true,
+        writable: true
+      }
+    });
+    childClass.extend = Managed.extend;
+    return childClass;
+  }
+
+  /**
+   * The default constructor, copy all given properties to this object
+   * @param {Object=} properties - The optional properties to copy
+   */
+  constructor(properties) {
+    Managed.init(this, properties);
+  }
+}
+
+Object.defineProperties(Managed.prototype, /** @lends binding.Managed.prototype */ {
+  /**
+   * Converts the managed object to an JSON-Object.
+   * @return {json} JSON-Object
+   * @method
+   */
+  toJSON: {
+    value: function toJSON() {
+      return this._metadata.type.toJsonValue(this._metadata, this);
+    }
+  }
+});
+
+/**
+ * Contains the metadata of this managed object
+ * @type util.Metadata
+ * @name _metadata
+ * @memberOf binding.Managed
+ * @private
+ */
+
+module.exports = Managed;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_ManagedFactory.js.html b/doc/lib_binding_ManagedFactory.js.html new file mode 100644 index 00000000..c1f29473 --- /dev/null +++ b/doc/lib_binding_ManagedFactory.js.html @@ -0,0 +1,426 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/ManagedFactory.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/ManagedFactory.js

+ + + + + + +
+
+
"use strict";
+
+var Factory = require('./Factory');
+var Managed = require('./Managed');
+
+/**
+ * @class binding.ManagedFactory<T>
+ * @extends binding.Factory<T>
+ *
+ * @param {Object=} properties initial properties to set on the instance
+ * @param {...*} args Additional constructor params passed through the type constructor
+ * @return {T} The new managed instance
+ */
+var ManagedFactory = Factory.extend( /** @lends binding.ManagedFactory<T>.prototype */ {
+
+  /**
+   * Creates a new ManagedFactory for the given type
+   * @param {metamodel.ManagedType} managedType The metadata of type T
+   * @param {EntityManager} db
+   * @return {binding.ManagedFactory<*>} A new object factory to created instances of T
+   * @static
+   * @ignore
+   */
+  create(managedType, db) {
+    //invoke super method
+    let factory = Factory.create.call(this, managedType.typeConstructor);
+    factory.methods = factory.prototype;
+
+    factory._managedType = managedType;
+    factory._db = db;
+
+    return factory;
+  },
+
+  /**
+   * Creates a new instance of the factory type
+   * @param {Array<*>=} args Constructor arguments used for instantiation, the constructor will not be called
+   * when no arguments are passed
+   * @return {T} A new created instance of T
+   */
+  newInstance(args) {
+    let instance = args? Factory.newInstance.call(this, args): this._managedType.create(args);
+    instance._metadata.db = this._db;
+    return instance;
+  },
+
+  /**
+   * Creates a new instance and sets the Managed Object to the given json
+   * @param {json} json
+   * @returns {T} instance
+   */
+  fromJSON(json) {
+    var instance = this.newInstance();
+    var metadata = instance._metadata;
+    this._managedType.fromJsonValue(metadata, json, instance);
+    return instance;
+  },
+
+  /**
+   * Adds methods to instances of this factories type
+   * @param {Object<string, Function>} methods The methods to add
+   */
+  addMethods(methods) {
+    Object.assign(this.methods, methods);
+  },
+
+  /**
+   * Add a method to instances of this factories type
+   * @param {string} name The method name to add
+   * @param {Function} fn The Method to add
+   */
+  addMethod(name, fn) {
+    this.methods[name] = fn;
+  }
+
+  /**
+   * Methods that are added to object instances
+   * This property is an alias for this factory type prototype
+   * @name methods
+   * @type {Object<string, Function>}
+   * @memberOf binding.ManagedFactory<T>.prototype
+   */
+
+  /**
+   * The managed type of this factory
+   * @name _managedType
+   * @type metamodel.ManagedType
+   * @protected
+   * @memberOf binding.ManagedFactory<T>.prototype
+   */
+
+  /**
+   * The owning EntityManager where this factory belongs to
+   * @name _db
+   * @type EntityManager
+   * @protected
+   * @memberOf binding.ManagedFactory<T>.prototype
+   */
+
+  /**
+   * Creates a new instance of the of this type
+   * @function
+   * @name new
+   * @param {Object<string, *>} properties Additional properties which will be applied to the created instance
+   * @return {T} A new created instance of this class
+   * @memberOf binding.ManagedFactory<T>.prototype
+   */
+});
+
+module.exports = ManagedFactory;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_Role.js.html b/doc/lib_binding_Role.js.html new file mode 100644 index 00000000..742e12b8 --- /dev/null +++ b/doc/lib_binding_Role.js.html @@ -0,0 +1,402 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/Role.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/Role.js

+ + + + + + +
+
+
"use strict";
+
+var Entity = require('./Entity');
+var User = require('./User');
+
+/**
+ * @alias binding.Role
+ * @extends binding.Entity
+ */
+class Role extends Entity {
+  /**
+   * The default constructor, copy all given properties to this object
+   * @param {Object=} properties - The optional properties to copy
+   */
+  constructor(properties) {
+    super(properties);
+  }
+
+}
+
+Object.defineProperties(Role.prototype, /** @lends binding.Role.prototype */ {
+  /**
+   * Test if the given user has this role
+   * @return {boolean} <code>true</code> if the given user has this role,
+   * otherwise <code>false</code>
+   * @method
+   */
+  hasUser: {
+    value: function hasUser(user) {
+      return this.users && this.users.has(user);
+    }
+  },
+
+  /**
+   * Add the given user to this role
+   * @param {model.User} user The user to add
+   * @method
+   */
+  addUser: {
+    value: function addUser(user) {
+      if (user instanceof User) {
+        if (!this.users)
+          this.users = new Set();
+
+        this.users.add(user);
+      } else {
+        throw new Error('Only user instances can be added to a role.');
+      }
+    }
+  },
+
+  /**
+   * Remove the given user from this role
+   * @param {model.User} user The user to remove
+   * @method
+   */
+  removeUser: {
+    value: function removeUser(user) {
+      if (user instanceof User) {
+        if (this.users)
+          this.users.delete(user);
+      } else {
+        throw new Error('Only user instances can be removed from a role.');
+      }
+    }
+  }
+
+  /**
+   * A set of users which have this role
+   * @type Set<model.User>
+   * @name users
+   * @memberOf binding.Role.prototype
+   */
+
+  /**
+   * The name of the role
+   * @type string
+   * @name name
+   * @memberOf binding.Role.prototype
+   */
+});
+
+module.exports = Role;
+
+
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_User.js.html b/doc/lib_binding_User.js.html new file mode 100644 index 00000000..edf05f99 --- /dev/null +++ b/doc/lib_binding_User.js.html @@ -0,0 +1,371 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/User.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/User.js

+ + + + + + +
+
+
"use strict";
+
+var Entity = require('./Entity');
+
+/**
+ * @alias binding.User
+ * @extends binding.Entity
+ */
+class User extends Entity {
+  /**
+   * The default constructor, copy all given properties to this object
+   * @param {Object=} properties - The optional properties to copy
+   */
+  constructor(properties) {
+    super(properties);
+  }
+}
+
+Object.defineProperties(User.prototype, /** @lends binding.User.prototype */ {
+
+  /**
+   * Change the password of the given user
+   *
+   * @param {string} currentPassword Current password of the user
+   * @param {string} password New password of the user
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<model.User>}
+   * @method
+   */
+  newPassword: {
+    value: function newPassword(currentPassword, password, doneCallback, failCallback) {
+      return this._metadata.db.newPassword(this.username, currentPassword, password).then(doneCallback, failCallback);
+    }
+  }
+
+  /**
+   * The users username or email address
+   * @type string
+   * @name username
+   * @memberOf binding.User.prototype
+   */
+
+  /**
+   * Indicates if the user is currently inactive, which disallow user login
+   * @type boolean
+   * @name inactive
+   * @memberOf binding.User.prototype
+   */
+});
+
+module.exports = User;
+
+
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_UserFactory.js.html b/doc/lib_binding_UserFactory.js.html new file mode 100644 index 00000000..3949f9f1 --- /dev/null +++ b/doc/lib_binding_UserFactory.js.html @@ -0,0 +1,596 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/UserFactory.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/UserFactory.js

+ + + + + + +
+
+
"use strict";
+
+var EntityFactory = require('./EntityFactory');
+
+/**
+ * @class binding.UserFactory
+ * @extends binding.EntityFactory<model.User>
+ *
+ * Creates a new instance of the managed type of this factory
+ * @param {Object=} properties initial properties to set on the instance
+ * @param {...*} arguments Additional constructor params passed through the type constructor
+ * @return {model.User} The new managed instance
+ */
+var UserFactory = EntityFactory.extend( /** @lends binding.UserFactory.prototype */ {
+  /**
+   * The current logged in user, or <code>null</code> if the user is not logged in
+   * @type model.User
+   */
+  get me() {
+    return this._db.me;
+  },
+
+  /**
+   * Register a new user with the given username and password, if the username is not used by an another user.
+   * @param {string|model.User} user The username as a string or a <User> Object, which must contain the username.
+   * @param {string} password The password for the given user
+   * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default logs the user in after a successful registration and keeps the user logged in over multiple sessions
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<model.User>} The created user object, for the new registered user.
+   */
+  register(user, password, loginOption, doneCallback, failCallback) {
+    if (loginOption instanceof Function) {
+      failCallback = doneCallback;
+      doneCallback = loginOption;
+      loginOption = true;
+    }
+
+    user = Object(user) instanceof String? this.fromJSON({username: user}): user;
+    return this._db.register(user, password, loginOption === undefined? true: loginOption).then(doneCallback, failCallback);
+  },
+
+  /**
+   * Log in the user with the given username and password and starts a user session
+   * @param {string} username The username of the user
+   * @param {string} password The password of the user
+   * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<model.User>}
+   */
+  login(username, password, loginOption, doneCallback, failCallback) {
+    if (loginOption instanceof Function) {
+      failCallback = doneCallback;
+      doneCallback = loginOption;
+      loginOption = true;
+    }
+
+    return this._db.login(username, password, loginOption === undefined? true: loginOption).then(doneCallback, failCallback);
+  },
+
+  /**
+   * Log out the current logged in user and ends the active user session
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<*>}
+   */
+  logout(doneCallback, failCallback) {
+    return this._db.logout().then(doneCallback, failCallback);
+  },
+
+  /**
+   * Change the password of the given user
+   *
+   * @param {string} username Username to identify the user
+   * @param {string} password Current password of the user
+   * @param {string} newPassword New password of the user
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<model.User>}
+   */
+  newPassword(username, password, newPassword, doneCallback, failCallback) {
+    return this._db.newPassword(username, password, newPassword).then(doneCallback, failCallback);
+  }
+
+  /**
+   * Prompts the user for the Google login in a new window. Before using OAuth you need to setup your application
+   * on the provider website, add the redirect uri: <code>https://example.net/db/User/OAuth/google</code> and copy the client id
+   * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.
+   *
+   * @param {string} clientID
+   * @param {Object=} options
+   * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions
+   * @param {string} [options.title="Login"] sets the title of the popup window
+   * @param {number} [options.width=585] defines the width of the popup window
+   * @param {number} [options.height=545] defines the height of the popup window
+   * @param {string} [options.scope="email"] the range of rights requested from the user
+   * @param {Object} [options.state={}]
+   * @param {number} [options.timeout=5 * 60 * 1000]
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<model.User>}
+   *
+   * @function
+   * @name loginWithGoogle
+   * @memberOf binding.UserFactory.prototype
+   */
+
+  /**
+   * Prompts the user for the Facebook login in a new window. Before using OAuth you need to setup your application
+   * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/facebook and copy the client id
+   * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.
+   *
+   * @param {string} clientID
+   * @param {Object=} options
+   * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions
+   * @param {string} [options.title="Login"] sets the title of the popup window
+   * @param {number} [options.width=1140] defines the width of the popup window
+   * @param {number} [options.height=640] defines the height of the popup window
+   * @param {string} [options.scope="email"] the range of rights requested from the user
+   * @param {Object} [options.state={}]
+   * @param {number} [options.timeout=5 * 60 * 1000]
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<model.User>}
+   *
+   * @function
+   * @name loginWithFacebook
+   * @memberOf binding.UserFactory.prototype
+   */
+
+  /**
+   * Prompts the user for the GitHub login in a new window. Before using OAuth you need to setup your application
+   * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/github and copy the client id
+   * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.
+   *
+   * @param {string} clientID
+   * @param {Object=} options
+   * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions
+   * @param {string} [options.title="Login"] sets the title of the popup window
+   * @param {number} [options.width=1040] defines the width of the popup window
+   * @param {number} [options.height=580] defines the height of the popup window
+   * @param {string} [options.scope="user:email"] the range of rights requested from the user
+   * @param {Object} [options.state={}]
+   * @param {number} [options.timeout=5 * 60 * 1000]
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<model.User>}
+   *
+   * @function
+   * @name loginWithGitHub
+   * @memberOf binding.UserFactory.prototype
+   */
+
+  /**
+   * Prompts the user for the Twitter login in a new window. Before using OAuth you need to setup your application
+   * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/twitter and copy the client id
+   * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.
+   *
+   * @param {string} clientID
+   * @param {Object=} options
+   * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions
+   * @param {string} [options.title="Login"] sets the title of the popup window
+   * @param {number} [options.width=740] defines the width of the popup window
+   * @param {number} [options.height=730] defines the height of the popup window
+   * @param {number} [options.timeout=5 * 60 * 1000]
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<model.User>}
+   *
+   * @function
+   * @name loginWithTwitter
+   * @memberOf binding.UserFactory.prototype
+   */
+
+  /**
+   * Prompts the user for the LinkedIn login in a new window. Before using OAuth you need to setup your application
+   * on the provider website, add the redirect uri: https://example.net/db/User/OAuth/linkedin and copy the client id
+   * and the client secret to your Baqend dashboard settings. When the returned promise succeeds the user is logged in.
+   *
+   * @param {string} clientID
+   * @param {Object=} options
+   * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default keeps the user logged in over multiple sessions
+   * @param {string} [options.title="Login"] sets the title of the popup window
+   * @param {number} [options.width=630] defines the width of the popup window
+   * @param {number} [options.height=530] defines the height of the popup window
+   * @param {string} [options.scope=""] the range of rights requested from the user
+   * @param {Object} [options.state={}]
+   * @param {number} [options.timeout=5 * 60 * 1000]
+   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
+   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<model.User>}
+   *
+   * @function
+   * @name loginWithLinkedIn
+   * @memberOf binding.UserFactory.prototype
+   */
+
+  /**
+   * Creates a new user object
+   * @function
+   * @name new
+   * @param {Object<string, *>} properties Additional properties which will be applied to the created instance
+   * @return {model.User} A new created user
+   * @memberOf binding.UserFactory.prototype
+   */
+});
+
+/**
+ * @alias binding.UserFactory.LoginOption
+ * @enum {number}
+ */
+UserFactory.LoginOption = {
+  /**
+   * Do not login the user after a successful registration
+   */
+  NO_LOGIN: -1,
+  /**
+   * Login in after a successful registration and keep the token in a nonpermanent storage, i.e SessionStorage
+   */
+  SESSION_LOGIN: 0,
+  /**
+   * Login in after a successful registration and keep the token in a persistent storage, i.e LocalStorage
+   */
+  PERSIST_LOGIN: 1
+};
+
+/**
+ * @alias binding.UserFactory.DefaultOptions
+ * @property {Object} oauth default properties
+ * @property {Object} oauth.google default oauth properties for Google
+ * @property {Object} oauth.facebook default oauth properties for Facebook
+ * @property {Object} oauth.github default oauth properties for GitHub
+ * @property {Object} oauth.twitter default oauth properties for Twitter
+ * @property {Object} oauth.linkedin default oauth properties for LinkedIn
+ */
+UserFactory.DefaultOptions = {
+  google: {
+    width: 585,
+    height: 545,
+    scope: 'email'
+  },
+  facebook:{
+    width: 1140,
+    height: 640,
+    scope: 'email'
+  },
+  github: {
+    width: 1040,
+    height: 580,
+    scope: 'user:email'
+  },
+  twitter: {
+    width: 740,
+    height: 730
+  },
+  linkedin: {
+    width: 630,
+    height: 530,
+    scope: ''
+  }
+};
+
+["Google", "Facebook", "GitHub", "Twitter", "LinkedIn"].forEach(function(name) {
+  UserFactory["loginWith" + name] = function(clientID, options, doneCallback, failCallback) {
+    //noinspection JSPotentiallyInvalidUsageOfThis
+    if (options instanceof Function) {
+      failCallback = doneCallback;
+      doneCallback = options;
+      options = {};
+    }
+
+    options = Object.assign({}, UserFactory.DefaultOptions[name.toLowerCase()], options || {});
+
+    return this._db.loginWithOAuth(name, clientID, options).then(doneCallback, failCallback);
+  }
+});
+
+module.exports = UserFactory;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_binding_index.js.html b/doc/lib_binding_index.js.html new file mode 100644 index 00000000..41ce5035 --- /dev/null +++ b/doc/lib_binding_index.js.html @@ -0,0 +1,333 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/binding/index.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/binding/index.js

+ + + + + + +
+
+
/**
+ * @namespace binding
+ */
+
+exports.Accessor = require('./Accessor');
+exports.Enhancer = require('./Enhancer');
+exports.Factory = require('./Factory');
+exports.ManagedFactory = require('./ManagedFactory');
+exports.EntityFactory = require('./EntityFactory');
+exports.UserFactory = require('./UserFactory');
+exports.DeviceFactory = require('./DeviceFactory');
+exports.FileFactory = require('./FileFactory');
+exports.Managed = require('./Managed');
+exports.Entity = require('./Entity');
+exports.Role = require('./Role');
+exports.User = require('./User');
+exports.File = require('./File');
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_caching_BloomFilter.js.html b/doc/lib_caching_BloomFilter.js.html new file mode 100644 index 00000000..2ad9c5d2 --- /dev/null +++ b/doc/lib_caching_BloomFilter.js.html @@ -0,0 +1,415 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/caching/BloomFilter.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/caching/BloomFilter.js

+ + + + + + +
+
+
"use strict";
+var atob = require("../util").atob;
+
+/**
+ * @alias caching.BloomFilter
+ */
+class BloomFilter {
+  constructor(rawBF) {
+    this.bytes = atob(rawBF.b);
+    this.bits = rawBF.m;
+    this.hashes = rawBF.h;
+    this.creation = new Date().getTime();
+  }
+
+  contains(element) {
+    for (let hash of BloomFilter._getHashes(element, this.bits, this.hashes)) {
+      if (!this._isSet(hash)) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  _isSet(index) {
+    var pos = Math.floor(index / 8);
+    var bit = 1 << (index % 8);
+    //Extract byte as int or NaN if out of range
+    var byte = this.bytes.charCodeAt(pos);
+    //Bit-wise AND should be non-zero (NaN always yields false)
+    return (byte & bit) != 0;
+  }
+
+  static _getHashes(element, bits, hashes) {
+    var hashValues = new Array(this.hashes);
+    var hash1 = BloomFilter._murmur3(0, element);
+    var hash2 = BloomFilter._murmur3(hash1, element);
+    for (let i = 0; i < hashes; i++) {
+      hashValues[i] = (hash1 + i * hash2) % bits;
+    }
+    return hashValues;
+  }
+
+  static _murmur3(seed, key) {
+    var remainder, bytes, h1, h1b, c1, c2, k1, i;
+    remainder = key.length & 3;
+    bytes = key.length - remainder;
+    h1 = seed;
+    c1 = 0xcc9e2d51;
+    c2 = 0x1b873593;
+    i = 0;
+
+    while (i < bytes) {
+      k1 =
+          ((key.charCodeAt(i) & 0xff)) |
+          ((key.charCodeAt(++i) & 0xff) << 8) |
+          ((key.charCodeAt(++i) & 0xff) << 16) |
+          ((key.charCodeAt(++i) & 0xff) << 24);
+      ++i;
+
+      k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;
+      k1 = (k1 << 15) | (k1 >>> 17);
+      k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;
+
+      h1 ^= k1;
+      h1 = (h1 << 13) | (h1 >>> 19);
+      h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;
+      h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));
+    }
+
+    k1 = 0;
+
+    switch (remainder) {
+      case 3:
+        k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;
+      case 2:
+        k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;
+      case 1:
+        k1 ^= (key.charCodeAt(i) & 0xff);
+
+        k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;
+        k1 = (k1 << 15) | (k1 >>> 17);
+        k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;
+        h1 ^= k1;
+    }
+
+    h1 ^= key.length;
+
+    h1 ^= h1 >>> 16;
+    h1 = (((h1 & 0xffff) * 0x85ebca6b) + ((((h1 >>> 16) * 0x85ebca6b) & 0xffff) << 16)) & 0xffffffff;
+    h1 ^= h1 >>> 13;
+    h1 = ((((h1 & 0xffff) * 0xc2b2ae35) + ((((h1 >>> 16) * 0xc2b2ae35) & 0xffff) << 16))) & 0xffffffff;
+    h1 ^= h1 >>> 16;
+
+    return h1 >>> 0;
+  }
+
+}
+
+module.exports = BloomFilter;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_caching_index.js.html b/doc/lib_caching_index.js.html new file mode 100644 index 00000000..5cee7521 --- /dev/null +++ b/doc/lib_caching_index.js.html @@ -0,0 +1,320 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/caching/index.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/caching/index.js

+ + + + + + +
+
+
/**
+ * @namespace caching
+ */
+exports.BloomFilter = require('./BloomFilter');
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_connector_Connector.js.html b/doc/lib_connector_Connector.js.html new file mode 100644 index 00000000..2fe558ca --- /dev/null +++ b/doc/lib_connector_Connector.js.html @@ -0,0 +1,605 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/connector/Connector.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/connector/Connector.js

+ + + + + + +
+
+
"use strict";
+var PersistentError = require('../error/PersistentError');
+var message = require('../message');
+
+
+/**
+ * @alias connector.Connector
+ */
+class Connector {
+
+  /**
+   * @param {string} host or location
+   * @param {number=} port
+   * @param {boolean=} secure <code>true</code> for an secure connection
+   * @param {string=} basePath The basepath of the api
+   * @return {connector.Connector}
+   */
+  static create(host, port, secure, basePath) {
+    if (typeof window !== 'undefined') {
+      if (!host) {
+        host = window.location.hostname;
+        port = Number(window.location.port);
+      }
+
+      if (secure === undefined) {
+        secure = window.location.protocol == 'https:';
+      }
+    }
+
+    //ensure right type
+    secure = !!secure;
+    if (basePath === undefined)
+      basePath = Connector.DEFAULT_BASE_PATH;
+
+    if (host.indexOf('/') != -1) {
+      var matches = /^(https?):\/\/([^\/:]+|\[[^\]]+])(:(\d*))?(\/\w+)?\/?$/.exec(host);
+      if (matches) {
+        secure = matches[1] == 'https';
+        host = matches[2].replace(/(\[|])/g, '');
+        port = matches[4];
+        basePath = matches[5] || '';
+      } else {
+        throw new Error('The connection uri host ' + host + ' seems not to be valid');
+      }
+    } else if (host != 'localhost' && /^[a-z0-9-]*$/.test(host)) {
+      //handle app names as hostname
+      host += secure? Connector.SSL_DOMAIN: Connector.HTTP_DOMAIN;
+    }
+
+    if (!port)
+      port = secure? 443 : 80;
+
+    var url = Connector.toUri(host, port, secure, basePath);
+    var connection = this.connections[url];
+
+    if (!connection) {
+      for (var name in this.connectors) {
+        var connector = this.connectors[name];
+        if (connector.isUsable && connector.isUsable(host, port, secure, basePath)) {
+          connection = new connector(host, port, secure, basePath);
+          break;
+        }
+      }
+
+      if (!connection)
+        throw new Error('No connector is usable for the requested connection.');
+
+      this.connections[url] = connection;
+    }
+
+    return connection;
+  }
+
+  static toUri(host, port, secure, basePath) {
+    var uri = (secure ? 'https://' : 'http://') + (host.indexOf(':') != -1? '[' + host + ']': host);
+    uri += (secure && port != 443 || !secure && port != 80) ? ':' + port : '';
+    uri += basePath;
+    return uri;
+  }
+
+  /**
+   * @param {string} host
+   * @param {number} port
+   * @param {boolean} secure
+   * @param {string} basePath
+   */
+  constructor(host, port, secure, basePath) {
+    this.host = host;
+    this.port = port;
+    this.secure = secure;
+    this.basePath = basePath;
+
+    //the origin do not contains the basepath
+    this.origin = Connector.toUri(host, port, secure, "");
+  }
+
+  /**
+   * @param {connector.Message} message
+   * @returns {Promise<connector.Message>}
+   */
+  send(message) {
+    if (message.request.method == 'OAUTH') {
+      message.addRedirectOrigin(this.origin + this.basePath);
+    }
+
+    let response = {status: 0};
+    return new Promise((resolve) => {
+      this.prepareRequest(message);
+      this.doSend(message, message.request, resolve);
+    })
+    .then((res) => response = res)
+    .then(() => this.prepareResponse(message, response))
+    .then(() => {
+      message.doReceive(response);
+      return response;
+    })
+    .catch((e) => {
+      response.entity = null;
+      throw PersistentError.of(e);
+    });
+  }
+
+  /**
+   * Handle the actual message send
+   * @param {connector.Message} message
+   * @param {Object} request
+   * @param {Function} receive
+   * @abstract
+   */
+  doSend(message, request, receive) {
+  }
+
+  /**
+   * @param {connector.Message} message
+   */
+  prepareRequest(message) {
+    let mimeType = message.mimeType();
+    if (!mimeType) {
+      let type = message.request.type;
+      if (type == 'json') {
+        message.mimeType('application/json;charset=utf-8');
+      } else if (type == 'text') {
+        message.mimeType('text/plain;charset=utf-8');
+      }
+    }
+
+    this.toFormat(message);
+
+    let accept;
+    switch (message.responseType()) {
+      case 'json':
+        accept = 'application/json';
+        break;
+      case 'text':
+        accept = 'text/*';
+        break;
+      default:
+        accept = 'application/json,text/*;q=0.5,*/*;q=0.1';
+    }
+
+    if (!message.accept()) {
+      message.accept(accept);
+    }
+
+    if (this.gzip) {
+      let ifNoneMatch = message.ifNoneMatch();
+      if (ifNoneMatch && ifNoneMatch !== '""' && ifNoneMatch != '*') {
+        message.ifNoneMatch(ifNoneMatch.slice(0,-1) + '--gzip"');
+      }
+    }
+
+    if (message.request.path == '/connect') {
+      message.request.path = message.tokenStorage.signPath(this.basePath + message.request.path)
+          .substring(this.basePath.length);
+      if (message.cacheControl()) {
+        message.request.path += (message.tokenStorage.token? '&': '?') + 'BCB';
+      }
+    } else if (message.tokenStorage) {
+      let token = message.tokenStorage.token;
+      if (token) {
+        message.header('authorization', 'BAT ' + token);
+      }
+    }
+  }
+
+  /**
+   * Convert the message entity to the sendable representation
+   * @param {connector.Message} message The message to send
+   * @protected
+   * @abstract
+   */
+  toFormat(message) {}
+
+  /**
+   * @param {connector.Message} message
+   * @param {Object} response The received response headers and data
+   */
+  prepareResponse(message, response) {
+    // IE9 returns status code 1223 instead of 204
+    response.status = response.status == 1223 ? 204 : response.status;
+
+    let type;
+    let headers = response.headers || {};
+    let entity = response.entity;
+
+    if (entity) {
+      type = message.responseType();
+      if (!type || response.status >= 400) {
+        var contentType = headers['content-type'] || headers['Content-Type'];
+        if (contentType && contentType.indexOf("application/json") > -1) {
+          type = 'json';
+        }
+      }
+    }
+
+    if (headers.etag) {
+      headers.etag = headers.etag.replace('--gzip', '');
+    }
+
+    if (message.tokenStorage) {
+      let token = headers['baqend-authorization-token'] || headers['Baqend-Authorization-Token'];
+      if (token) {
+        message.tokenStorage.update(token);
+      }
+    }
+
+    return new Promise((resolve) => {
+      resolve(entity && this.fromFormat(response, entity, type));
+    }).then((entity) => {
+      response.entity = entity;
+
+      if (message.request.path.indexOf('/connect') != -1 && entity) {
+        this.gzip = !!entity.gzip;
+      }
+    }, (e) => {
+      throw new Error('Response was not valid ' + type + ': ' + e.message);
+    });
+  }
+
+  /**
+   * Convert received data to the requested response entity type
+   * @param {Object} response The response object
+   * @param {*} entity The received data
+   * @param {string} type The requested response format
+   * @protected
+   * @abstract
+   */
+  fromFormat(response, entity, type) {}
+}
+
+Object.assign(Connector, /** @lends connector.Connector */ {
+  DEFAULT_BASE_PATH: '/v1',
+  HTTP_DOMAIN: '.app.baqend.com',
+  SSL_DOMAIN: '-bq.global.ssl.fastly.net',
+
+  /**
+   * An array of all exposed response headers
+   * @type string[]
+   */
+  RESPONSE_HEADERS: [
+    'baqend-authorization-token',
+    'content-type',
+    'baqend-size',
+    'baqend-acl',
+    'etag',
+    'last-modified'
+  ],
+
+  /**
+   * Array of all available connector implementations
+   * @type connector.Connector[]
+   */
+  connectors: [],
+
+  /**
+   * Array of all created connections
+   * @type Object<string,connector.Connector>
+   */
+  connections: {},
+
+  /**
+   * The connector will detect if gzip is supports.
+   * Returns true if supported otherwise false.
+   * @returns {boolean} gzip
+   */
+  gzip: false
+});
+
+module.exports = Connector;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_connector_IFrameConnector.js.html b/doc/lib_connector_IFrameConnector.js.html new file mode 100644 index 00000000..113eb0ea --- /dev/null +++ b/doc/lib_connector_IFrameConnector.js.html @@ -0,0 +1,440 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/connector/IFrameConnector.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/connector/IFrameConnector.js

+ + + + + + +
+
+
"use strict";
+var Connector = require('./Connector');
+var XMLHttpConnector = require('./XMLHttpConnector');
+
+/**
+ * @alias connector.IFrameConnector
+ * @extends connector.XMLHttpConnector
+ */
+class IFrameConnector extends XMLHttpConnector {
+  /**
+   * Indicates if this connector implementation is usable for the given host and port
+   * @param {string} host
+   * @param {number} port
+   * @param {boolean} secure
+   * @returns {boolean}
+   */
+  static isUsable(host, port, secure) {
+    return typeof window != 'undefined';
+  }
+
+  constructor(host, port, secure, basePath) {
+    super(host, port, secure, basePath);
+
+    this.mid = 0;
+    this.messages = {};
+    this.doReceive = this.doReceive.bind(this);
+
+    addEventListener('message', this.doReceive, false);
+  }
+
+  load(path) {
+    this.iframe = document.createElement('iframe');
+    this.iframe.src = this.origin + this.basePath + path;
+    this.iframe.setAttribute("style", IFrameConnector.style);
+    document.body.appendChild(this.iframe);
+
+    this.queue = [];
+    this.iframe.addEventListener('load', this.onLoad.bind(this), false);
+  }
+
+  onLoad() {
+    var queue = this.queue;
+
+    for (var i = 0; i < queue.length; ++i) {
+      this.postMessage(queue[i]);
+    }
+
+    this.queue = null;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  doSend(message, request, receive) {
+    //binary data will be send and received directly
+    if (message.isBinary) {
+      return super.doSend(message, request, receive);
+    }
+
+    if (!this.iframe) {
+      this.load(message.request.path);
+    }
+    
+    var msg = {
+      mid: ++this.mid,
+      method: request.method,
+      path: request.path,
+      headers: request.headers,
+      entity: request.entity,
+      responseHeaders: Connector.RESPONSE_HEADERS
+    };
+
+    this.messages[msg.mid] = receive;
+
+    var strMsg = JSON.stringify(msg);
+    if (this.queue) {
+      this.queue.push(strMsg);
+    } else {
+      this.postMessage(strMsg);
+    }
+
+    if (!this.connected) {
+      setTimeout(() => {
+        if (this.messages[msg.mid]) {
+          delete this.messages[msg.mid];
+          receive({
+            status: 0,
+            error: new Error('Connection refused.')
+          });
+        }
+      }, 10000);
+    }
+  }
+
+  postMessage(msg) {
+    this.iframe.contentWindow.postMessage(msg, this.origin);
+  }
+
+  doReceive(event) {
+    if (event.origin !== this.origin || event.data[0] != '{') {
+      return;
+    }
+
+    var msg = JSON.parse(event.data);
+
+    var receive = this.messages[msg.mid];
+    if (receive) {
+      delete this.messages[msg.mid];
+      this.connected = true;
+
+      receive({
+        status: msg.status,
+        headers: msg.headers,
+        entity: msg.entity
+      });
+    }
+  }
+}
+
+IFrameConnector.style = 'width:1px;height:1px;position:absolute;top:-10px;left:-10px;';
+
+Connector.connectors.push(IFrameConnector);
+
+module.exports = IFrameConnector;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_connector_Message.js.html b/doc/lib_connector_Message.js.html new file mode 100644 index 00000000..64d276c0 --- /dev/null +++ b/doc/lib_connector_Message.js.html @@ -0,0 +1,752 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/connector/Message.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/connector/Message.js

+ + + + + + +
+
+
"use strict";
+
+var CommunicationError = require('../error/CommunicationError');
+
+/**
+ * Checks whether the user uses google chrome.
+ */
+const isChrome = typeof window != 'undefined' && ((!!window.chrome && /google/i.test(navigator.vendor)) || (/cros i686/i.test(window.navigator.platform)));
+
+/**
+ * @alias connector.Message
+ */
+class Message {
+  /**
+   * Creates a new message class with the given message specification
+   * @param {Object} specification
+   * @return {Class<Message>}
+   */
+  static create(specification) {
+    const parts = specification.path.split('?');
+    const path = parts[0].split(/[:\*]\w*/);
+
+    const query = [];
+    if (parts[1]) {
+      parts[1].split('&').forEach(function(arg) {
+        const part = arg.split('=');
+        query.push(part[0]);
+      });
+    }
+
+    specification.dynamic = specification.path.indexOf('*') != -1;
+    specification.path = path;
+    specification.query = query;
+
+    return class extends Message {
+      get spec() {
+        return specification;
+      }
+    };
+  }
+
+  /**
+   * Creates a new message class with the given message specification and a full path
+   * @param {Object} specification
+   * @param {Object} members additional members applied to the created message
+   * @return {Class<Message>}
+   */
+  static createExternal(specification, members) {
+    specification.path = [specification.path];
+
+    /**
+     * @ignore
+     */
+    const cls = class extends Message {
+      get spec() {
+        return specification;
+      }
+    };
+
+    Object.assign(cls.prototype, members);
+
+    return cls;
+  }
+
+  get isBinary() {
+    return this.request.type in Message.BINARY || this._responseType in Message.BINARY;
+  }
+
+  /**
+   * @param {string} arguments... The path arguments
+   */
+  constructor() {
+    /** @type boolean */
+    this.withCredentials = false;
+
+    /** @type util.TokenStorage */
+    this.tokenStorage = null;
+
+    /** @type connector.Message~progressCallback */
+    this._progress = null;
+
+    const args = arguments;
+    let index = 0;
+    let path = this.spec.path;
+    if (Object(path) instanceof Array) {
+      path = this.spec.path[0];
+      let len = this.spec.path.length;
+      for (let i = 1; i < len; ++i) {
+        if (this.spec.dynamic && len - 1 == i) {
+          path += args[index].split('/').map(encodeURIComponent).join('/');
+          index += 1;
+        } else {
+          path += encodeURIComponent(args[index++]) + this.spec.path[i];
+        }
+      }
+    }
+
+    var query = "";
+    for (let i = 0; i < this.spec.query.length; ++i) {
+      let arg = args[index++];
+      if (arg !== undefined && arg !== null) {
+        query += (query || ~path.indexOf("?"))? "&": "?";
+        query += this.spec.query[i] + '=' + encodeURIComponent(arg);
+      }
+    }
+
+    this.request = {
+      method: this.spec.method,
+      path: path + query,
+      entity: null,
+      headers: {}
+    };
+
+    if (args[index]) {
+      this.entity(args[index], 'json');
+    }
+    
+    this.responseType('json');
+  }
+
+  /**
+   * Get/Sets the value of a the specified request header
+   * @param {string} name The header name
+   * @param {string=} value The header value if omitted the value will be returned
+   * @return {connector.Message|string} This message object
+   */
+  header(name, value) {
+    if (value !== undefined) {
+      this.request.headers[name] = value;
+      return this;
+    } else {
+      return this.request.headers[name];
+    }
+  }
+
+  /**
+   * sets the entity type
+   * @param {any} data The data to send
+   * @param {string} [type="json"] the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'
+   * @return {connector.Message} This message object
+   */
+  entity(data, type) {
+    if (!type) {
+      if (typeof data === 'string') {
+        if (/^data:(.+?)(;base64)?,.*$/.test(data)) {
+          type = 'data-url';
+        } else {
+          type = 'text';
+        }
+      } else if (typeof Blob != 'undefined' && data instanceof Blob) {
+        type = 'blob';
+      } else if (typeof Buffer != 'undefined' && data instanceof Buffer) {
+        type = 'buffer';
+      } else if (typeof ArrayBuffer != 'undefined' && data instanceof ArrayBuffer) {
+        type = 'arraybuffer';
+      } else if (typeof FormData != 'undefined' && data instanceof FormData) {
+        type = 'form';
+      } else {
+        type = 'json';
+      }
+    }
+
+    this.request.type = type;
+    this.request.entity = data;
+    return this;
+  }
+    
+  /**
+   * Get/Sets the mimeType
+   * @param {string=} mimeType the mimeType of the data
+   * @return {connector.Message} This message object
+   */
+  mimeType(mimeType) {
+    return this.header('content-type', mimeType);
+  }
+
+  /**
+   * Get/Sets the contentLength
+   * @param {number=} contentLength the content length of the data
+   * @return {connector.Message} This message object
+   */
+  contentLength(contentLength) {
+    return this.header('content-length', contentLength);
+  }
+
+  /**
+   * Get/Sets the request conditional If-Match header
+   * @param {string=} eTag the If-Match ETag value
+   * @return {connector.Message} This message object
+   */
+  ifMatch(eTag) {
+    return this.header('If-Match', this._formatETag(eTag));
+  }
+
+  /**
+   * Get/Sets the request a ETag based conditional header
+   * @param {string=} eTag The ETag value
+   * @return {connector.Message} This message object
+   */
+  ifNoneMatch(eTag) {
+    return this.header('If-None-Match', this._formatETag(eTag));
+  }
+
+  /**
+   * Get/Sets the request date based conditional header
+   * @param {Date=} date The date value
+   * @return {connector.Message} This message object
+   */
+  ifUnmodifiedSince(date) {
+    //IE 10 returns UTC strings and not an RFC-1123 GMT date string
+    return this.header('if-unmodified-since', date && date.toUTCString().replace('UTC','GMT'));
+  }
+
+  /**
+   * Indicates that the request should not be served by a local cache
+   */
+  noCache() {
+    if (!isChrome) {
+      this.ifMatch('') // is needed for firefox or safari (but forbidden for chrome)
+          .ifNoneMatch('-'); // is needed for edge and ie (but forbidden for chrome)
+    }
+
+    return this.cacheControl('max-age=0, no-cache');
+  }
+
+  /**
+   * Get/Sets the cache control header
+   * @param {string=} value The cache control flags
+   * @return {connector.Message} This message object
+   */
+  cacheControl(value) {
+    return this.header('cache-control', value);
+  }
+  
+  /**
+   * Get/Sets and encodes the acl of a file into the Baqend-Acl header
+   * @param {Acl=} acl the file acls
+   * @return {connector.Message} This message object
+   */
+  acl(acl) {
+    return this.header('baqend-acl', acl && JSON.stringify(acl));
+  }
+
+  /**
+   * Get/Sets the request accept header
+   * @param {string=} accept the accept header value
+   * @return {connector.Message} This message object
+   */
+  accept(accept) {
+    return this.header('accept', accept);
+  }
+
+  /**
+   * Get/Sets the response type which should be returned
+   * @param {string=} type The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'
+   * @return {connector.Message} This message object
+   */
+  responseType(type) {
+    if (type !== undefined) {
+      this._responseType = type;
+      return this;
+    }
+
+    return this._responseType;
+  }
+
+  /**
+   * Get/Sets the progress callback
+   * @param {connector.Message~progressCallback} callback
+   * @return {connector.Message} This message object
+   */
+  progress(callback) {
+    if (callback !== undefined) {
+      this._progress = callback;
+      return this;
+    }
+
+    return this._progress;
+  }
+
+  /**
+   * Adds the given String to the request path.
+   * If the parameter is an object the query string will be created.
+   *
+   * @param {string|Object} query which will added to the request path
+   */
+  addQueryString(query) {
+    if(Object(query) instanceof String) {
+      this.request.path += query;
+    } else if(query) {
+      var sep = ~this.request.path.indexOf("?")? "&": "?";
+      Object.keys(query).forEach((key, i) => {
+        this.request.path += sep + key + "=" + encodeURIComponent(query[key]);
+        if(i == 0) {
+          sep = "&";
+        }
+      });
+    }
+    return this;
+  }
+
+  _formatETag(eTag) {
+    if (eTag && eTag != '*') {
+      eTag = '' + eTag;
+      if (eTag.indexOf('"') == -1)
+        eTag = '"' + eTag + '"';
+    }
+
+    return eTag;
+  }
+
+  /**
+   * Handle the receive
+   * @param {Object} response The received response headers and data
+   */
+  doReceive(response) {
+    if (this.spec.status.indexOf(response.status) == -1) {
+      throw new CommunicationError(this, response);
+    }
+  }
+}
+
+/**
+ * The message specification
+ * @name spec
+ * @memberOf connector.Message.prototype
+ * @type {Object}
+ */
+
+Object.assign(Message, {
+  /**
+   * @alias connector.Message.StatusCode
+   * @enum {number}
+   */
+  StatusCode: {
+    NOT_MODIFIED: 304,
+    BAD_CREDENTIALS: 460,
+    BUCKET_NOT_FOUND: 461,
+    INVALID_PERMISSION_MODIFICATION: 462,
+    INVALID_TYPE_VALUE: 463,
+    OBJECT_NOT_FOUND: 404,
+    OBJECT_OUT_OF_DATE: 412,
+    PERMISSION_DENIED: 466,
+    QUERY_DISPOSED: 467,
+    QUERY_NOT_SUPPORTED: 468,
+    SCHEMA_NOT_COMPATIBLE: 469,
+    SCHEMA_STILL_EXISTS: 470,
+    SYNTAX_ERROR: 471,
+    TRANSACTION_INACTIVE: 472,
+    TYPE_ALREADY_EXISTS: 473,
+    TYPE_STILL_REFERENCED: 474,
+    SCRIPT_ABORTION: 475
+  },
+
+  BINARY: {
+    blob: true,
+    buffer: true,
+    stream: true,
+    arraybuffer: true,
+    'data-url': true,
+    'base64': true
+  },
+
+  GoogleOAuth: Message.createExternal({
+    method: 'OAUTH',
+    path: 'https://accounts.google.com/o/oauth2/auth?response_type=code&access_type=online',
+    query: ["client_id", "scope", "state"],
+    status: [200]
+  }, {
+    addRedirectOrigin(baseUri) {
+      this.addQueryString({
+        redirect_uri: baseUri + '/db/User/OAuth/google'
+      });
+    }
+  }),
+
+  FacebookOAuth: Message.createExternal({
+    method: 'OAUTH',
+    path: 'https://www.facebook.com/dialog/oauth?response_type=code',
+    query: ["client_id", "scope", "state"],
+    status: [200]
+  }, {
+    addRedirectOrigin(baseUri) {
+      this.addQueryString({
+        redirect_uri: baseUri + '/db/User/OAuth/facebook'
+      });
+    }
+  }),
+
+  GitHubOAuth: Message.createExternal({
+    method: 'OAUTH',
+    path: 'https://github.com/login/oauth/authorize?response_type=code&access_type=online',
+    query: ["client_id", "scope", "state"],
+    status: [200]
+  }, {
+    addRedirectOrigin(baseUri) {
+      this.addQueryString({
+        redirect_uri: baseUri + '/db/User/OAuth/github'
+      });
+    }
+  }),
+
+  LinkedInOAuth: Message.createExternal({
+    method: 'OAUTH',
+    path: 'https://www.linkedin.com/uas/oauth2/authorization?response_type=code&access_type=online',
+    query: ["client_id", "scope", "state"],
+    status: [200]
+  }, {
+    addRedirectOrigin(baseUri) {
+      this.addQueryString({
+        redirect_uri: baseUri + '/db/User/OAuth/linkedin'
+      });
+    }
+  }),
+
+  TwitterOAuth: Message.createExternal({
+    method: 'OAUTH',
+    path: '',
+    query: [],
+    status: [200]
+  }, {
+    addRedirectOrigin(baseUri) {
+      this.request.path = baseUri + '/db/User/OAuth1/twitter';
+    }
+  })
+});
+
+module.exports = Message;
+
+
+/**
+ * The progress callback is called, when you send a message to the server and a progress is noticed
+ * @callback connector.Message~progressCallback
+ * @param {ProgressEvent} event The Progress Event
+ * @return {*} unused
+ */
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_connector_NodeConnector.js.html b/doc/lib_connector_NodeConnector.js.html new file mode 100644 index 00000000..efdbeef5 --- /dev/null +++ b/doc/lib_connector_NodeConnector.js.html @@ -0,0 +1,519 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/connector/NodeConnector.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/connector/NodeConnector.js

+ + + + + + +
+
+
"use strict";
+
+var Connector = require('./Connector');
+var PersistentError = require('../error/PersistentError');
+var http;
+var https;
+var stream;
+
+/**
+ * @alias connector.NodeConnector
+ * @extends connector.Connector
+ */
+class NodeConnector extends Connector {
+  static isUsable(host, port, secure) {
+    if (!http) {
+      try {
+        http = require('http');
+        https = require('https');
+        stream = require('stream');
+      } catch (e) {}
+    }
+    //prevent using when it is shimmed
+    return http && http.Server;
+  }
+
+  constructor(host, port, secure, basePath) {
+    super(host, port, secure, basePath);
+    this.cookie = null;
+    this.http = secure? https: http;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  doSend(message, request, receive) {
+    request.host = this.host;
+    request.port = this.port;
+    request.path = this.basePath + request.path;
+
+    const entity = request.entity;
+    const type = request.type;
+    let responseType = message.responseType();
+
+    if (this.cookie && message.withCredentials)
+      request.headers['cookie'] = this.cookie;
+
+    let req = this.http.request(request, (res) => {
+      const cookie = res.headers['set-cookie'];
+      if (cookie) {
+        // cookie may be an array, convert it to a string
+        this.cookie = this.parseCookie(cookie + '');
+      }
+
+      const status = res.statusCode;
+      if (status >= 400) {
+        responseType = 'json';
+      }
+
+      if (responseType == 'stream') {
+        receive({
+          status: status,
+          headers: res.headers,
+          entity: res
+        });
+        return;
+      }
+
+      const binary = responseType && responseType != 'text' && responseType != 'json';
+      const chunks = [];
+      if (!binary) {
+        res.setEncoding('utf-8');
+      }
+
+      res.on('data', (chunk) => {
+        chunks.push(chunk);
+      });
+
+      res.on('end', () => {
+        receive({
+          status: status,
+          headers: res.headers,
+          entity: binary? Buffer.concat(chunks): chunks.join('')
+        });
+      });
+    });
+
+    req.on('error', (e) => {
+      receive({
+        status: 0,
+        error: e
+      });
+    });
+
+    if (type == 'stream') {
+      entity.pipe(req);
+    } else if (type == 'buffer') {
+      req.end(entity);
+    } else if (type) {
+      req.end(entity, 'utf8');
+    } else {
+      req.end();
+    }
+  }
+
+
+  /**
+   * Parse the cookie header
+   * @param {string} header
+   */
+  parseCookie(header) {
+    var parts = header.split(';');
+
+    for (var i = 0, part; part = parts[i]; ++i) {
+      if (part.indexOf('Expires=') == 0) {
+        var date = Date.parse(part.substring(8));
+        if (date < Date.now()) {
+          return null;
+        }
+      }
+    }
+
+    return parts[0];
+  }
+
+  /**
+   * @inheritDoc
+   */
+  toFormat(message) {
+    let type = message.request.type;
+
+    if (type) {
+      let entity = message.request.entity;
+      let mimeType = message.mimeType();
+
+      switch (type) {
+        case 'stream':
+          if (!message.contentLength()) {
+            throw new PersistentError('You must specify a content length while making a stream based upload.');
+          }
+          break;
+        case 'buffer':
+          break;
+        case 'arraybuffer':
+          type = 'buffer';
+          entity = new Buffer(entity);
+          break;
+        case 'data-url':
+          let match = entity.match(/^data:(.+?)(;base64)?,(.*)$/);
+          let isBase64 = match[2];
+          entity = match[3];
+
+          type = 'buffer';
+          mimeType = mimeType || match[1];
+          if (isBase64) {
+            entity = new Buffer(entity, 'base64');
+          } else {
+            entity = new Buffer(decodeURIComponent(entity), 'utf8');
+          }
+
+          break;
+        case 'base64':
+          type = 'buffer';
+          entity = new Buffer(entity, 'base64');
+          break;
+        case 'json':
+          if (typeof entity != 'string') {
+            entity = JSON.stringify(entity);
+          }
+          break;
+        case 'text':
+          break;
+        default:
+          throw new Error('The request type ' + type + ' is not supported');
+      }
+
+      message.entity(entity, type)
+        .mimeType(mimeType);
+    }
+  }
+
+  /**
+   * @inheritDoc
+   */
+  fromFormat(response, entity, type) {
+    if (type == 'json') {
+      entity = JSON.parse(entity);
+    } else if (type == 'data-url' || type == 'base64') {
+      entity = entity.toString('base64');
+
+      if (type == 'data-url') {
+        entity = 'data:' + response.headers['content-type'] + ';base64,' + entity;
+      }
+    } else if (type == 'arraybuffer') {
+      entity = entity.buffer.slice(entity.byteOffset, entity.byteOffset + entity.byteLength);
+    }
+
+    return entity;
+  }
+}
+
+Connector.connectors.push(NodeConnector);
+
+module.exports = NodeConnector;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_connector_XMLHttpConnector.js.html b/doc/lib_connector_XMLHttpConnector.js.html new file mode 100644 index 00000000..87adbbcb --- /dev/null +++ b/doc/lib_connector_XMLHttpConnector.js.html @@ -0,0 +1,499 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/connector/XMLHttpConnector.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/connector/XMLHttpConnector.js

+ + + + + + +
+
+
"use strict";
+var Connector = require('./Connector');
+
+/**
+ * @alias connector.XMLHttpConnector
+ * @extends connector.Connector
+ */
+class XMLHttpConnector extends Connector {
+  /**
+   * Indicates if this connector implementation is usable for the given host and port
+   * @param {string} host
+   * @param {number} port
+   * @param {boolean} secure
+   * @returns {boolean}
+   */
+  static isUsable(host, port, secure) {
+    if (typeof window == 'undefined')
+      return false;
+
+    let locationSecure = location.protocol == 'https:';
+    let locationPort = location.port || (locationSecure? 443: 80);
+
+    return location.hostname == host && locationPort == port && locationSecure == secure;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  doSend(message, request, receive) {
+    if (request.method == 'OAUTH') {
+      if (this.oAuthHandle)
+        this.oAuthHandle({status: 409, entity: '{"message": "A new OAuth request was sent."}'});
+
+      localStorage.removeItem('oauth-response');
+
+      var handler = (event) => {
+        if (event.key == 'oauth-response') {
+          this.oAuthHandle(JSON.parse(event.newValue));
+        }
+      };
+
+      this.oAuthHandle = (msg) => {
+        receive(msg);
+        localStorage.removeItem('oauth-response');
+        removeEventListener("storage", handler, false);
+      };
+
+      addEventListener("storage", handler, false);
+      return;
+    }
+
+    var xhr = new XMLHttpRequest();
+
+    var url = this.origin + this.basePath + request.path;
+
+    xhr.onreadystatechange = function() {
+      //if we receive an error switch the response type to json
+      if (xhr.readyState == 2 && xhr.status >= 400)
+        xhr.responseType = 'text';
+
+      if (xhr.readyState == 4) {
+        var response = {
+          headers: {},
+          status: xhr.status,
+          entity: xhr.response || xhr.responseText
+        };
+
+        Connector.RESPONSE_HEADERS.forEach(function(name) {
+          response.headers[name] = xhr.getResponseHeader(name);
+        });
+
+        receive(response);
+      }
+    };
+
+    // Set the message progress callback
+    xhr.upload.onprogress = message.progress();
+
+    xhr.open(request.method, url, true);
+
+    var entity = request.entity;
+    var headers = request.headers;
+    for (let name in headers)
+      xhr.setRequestHeader(name, headers[name]);
+
+    xhr.withCredentials = message.withCredentials;
+
+    switch (message.responseType()) {
+      case 'arraybuffer':
+        xhr.responseType = 'arraybuffer';
+        break;
+      case 'blob':
+      case 'data-url':
+      case 'base64':
+        xhr.responseType = 'blob';
+        break;
+    }
+
+    xhr.send(entity);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  fromFormat(response, entity, type) {
+    if (type == 'json') {
+      entity = JSON.parse(entity);
+    } else if (type == 'data-url' || type == 'base64') {
+      let reader = new FileReader();
+      reader.readAsDataURL(entity);
+
+      return new Promise((resolve, reject) => {
+        reader.onload = resolve;
+        reader.onerror = reject;
+      }).then(() => {
+        let result = reader.result;
+
+        if (type == 'base64')
+          result = result.substring(result.indexOf(',') + 1);
+
+        return result;
+      });
+    }
+
+    return entity;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  toFormat(message) {
+    let type = message.request.type;
+
+    if (type) {
+      let entity = message.request.entity;
+      let mimeType = message.mimeType();
+      switch (type) {
+        case 'blob':
+          mimeType = mimeType || entity.type;
+          break;
+        case 'arraybuffer':
+        case 'form':
+          break;
+        case 'data-url':
+          let match = entity.match(/^data:(.+?)(;base64)?,(.*)$/);
+          let isBase64 = match[2];
+          entity = match[3];
+
+          type = 'blob';
+          mimeType = mimeType || match[1];
+          if (!isBase64) {
+            entity = decodeURIComponent(entity);
+            break;
+          }
+
+        //fallthrough
+        case 'base64':
+          let binaryStr = atob(entity), len = binaryStr.length;
+          let array = new Uint8Array(len);
+          for (let i = 0; i < len; ++i) {
+            array[i] = binaryStr.charCodeAt(i);
+          }
+          type = 'blob';
+          entity = new Blob([array], {type: mimeType});
+          break;
+        case 'json':
+          if (typeof entity != 'string') {
+            entity = JSON.stringify(entity);
+          }
+          break;
+        case 'text':
+          break;
+      }
+
+      message.entity(entity, type)
+       .mimeType(mimeType);
+    }
+  }
+}
+
+Connector.connectors.push(XMLHttpConnector);
+
+module.exports = XMLHttpConnector;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_connector_index.js.html b/doc/lib_connector_index.js.html new file mode 100644 index 00000000..1ce97e9a --- /dev/null +++ b/doc/lib_connector_index.js.html @@ -0,0 +1,325 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/connector/index.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/connector/index.js

+ + + + + + +
+
+
/**
+ * @namespace connector
+ */
+
+exports.Message = require('./Message');
+exports.Connector = require('./Connector');
+exports.NodeConnector = require('./NodeConnector');
+exports.XMLHttpConnector = require('./XMLHttpConnector');
+exports.IFrameConnector = require('./IFrameConnector');
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_error_CommunicationError.js.html b/doc/lib_error_CommunicationError.js.html new file mode 100644 index 00000000..b6bee6b4 --- /dev/null +++ b/doc/lib_error_CommunicationError.js.html @@ -0,0 +1,362 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/error/CommunicationError.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/error/CommunicationError.js

+ + + + + + +
+
+
"use strict";
+
+var PersistentError = require('./PersistentError');
+
+/**
+ * @alias error.CommunicationError
+ * @extends error.PersistentError
+ */
+class CommunicationError extends PersistentError {
+
+	/**
+	 * @param {connector.Message} httpMessage The http message which was send
+	 * @param {Object} response The received entity headers and content
+   */
+	constructor(httpMessage, response) {
+		var entity = response.entity || response.error || {};
+		var state = (response.status == 0? 'Request': 'Response');
+		var message = entity.message || 'Handling the ' + state + ' for ' + httpMessage.request.method + ' ' + httpMessage.request.path;
+
+		super(message, entity);
+
+		this.name = entity.className || 'CommunicationError';
+		this.reason = entity.reason || 'Communication failed';
+    this.status = response.status;
+
+    if(entity.data)
+      this.data = entity.data;
+
+		var cause = entity;
+		while (cause && cause.stackTrace) {
+			this.stack += '\nServerside Caused by: ' + cause.className + ' ' + cause.message;
+
+			var stackTrace = cause.stackTrace;
+			for (var i = 0; i < stackTrace.length; ++i) {
+				var el = stackTrace[i];
+
+				this.stack += '\n    at ' + el.className + '.' + el.methodName;
+				this.stack += ' (' + el.fileName + ':' + el.lineNumber + ')';
+			}
+			
+			cause = cause.cause;
+		}
+	}
+}
+
+module.exports = CommunicationError;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_error_EntityExistsError.js.html b/doc/lib_error_EntityExistsError.js.html new file mode 100644 index 00000000..45e2212d --- /dev/null +++ b/doc/lib_error_EntityExistsError.js.html @@ -0,0 +1,334 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/error/EntityExistsError.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/error/EntityExistsError.js

+ + + + + + +
+
+
"use strict";
+var PersistentError = require('./PersistentError');
+
+/**
+ * @alias error.EntityExistsError
+ * @extends error.PersistentError
+ */
+class EntityExistsError extends PersistentError {
+  /**
+   * @param {string} entity
+   */
+  constructor(entity) {
+    super('The entity ' + entity + ' is managed by a different db.');
+    this.entity = entity;
+  }
+}
+
+module.exports = EntityExistsError;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_error_IllegalEntityError.js.html b/doc/lib_error_IllegalEntityError.js.html new file mode 100644 index 00000000..0b43c88b --- /dev/null +++ b/doc/lib_error_IllegalEntityError.js.html @@ -0,0 +1,335 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/error/IllegalEntityError.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/error/IllegalEntityError.js

+ + + + + + +
+
+
"use strict";
+
+var PersistentError = require('./PersistentError');
+
+/**
+ * @alias error.IllegalEntityError
+ * @extends error.PersistentError
+ */
+class IllegalEntityError extends PersistentError {
+	/**
+	 * @param {binding.Entity} entity
+	 */
+  constructor(entity) {
+		super('Entity ' + entity + ' is not a valid entity');
+		this.entity = entity;
+	}
+}
+
+module.exports = IllegalEntityError;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_error_PersistentError.js.html b/doc/lib_error_PersistentError.js.html new file mode 100644 index 00000000..3b235eb0 --- /dev/null +++ b/doc/lib_error_PersistentError.js.html @@ -0,0 +1,364 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/error/PersistentError.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/error/PersistentError.js

+ + + + + + +
+
+
"use strict";
+/**
+ * @class error.PersistentError
+ * @extends Error
+ *
+ * @param {string} message
+ * @param {Error=} cause
+ */
+
+//do not use class here, since we can't change the class prototype
+function PersistentError(message, cause) {
+  message = (message ? message : 'An unexpected persistent error occured.');
+
+  if (Error.hasOwnProperty('captureStackTrace')) {
+    Error.captureStackTrace(this, this.constructor);
+  } else {
+    this.stack = (new Error()).stack;
+  }
+
+  this.message = message;
+  this.name = this.constructor.name;
+
+  if (cause) {
+    this.cause = cause;
+    if (cause.stack) {
+      this.stack += '\nCaused By: ' + cause.stack;
+    }
+  }
+}
+
+PersistentError.of = function of(error) {
+  if (error instanceof PersistentError) {
+    return error;
+  } else {
+    return new PersistentError(null, error);
+  }
+};
+
+//custom errors must be manually extended for babel, otherwise the super call destroys the origin 'this' reference
+PersistentError.prototype = Object.create(Error.prototype, {
+  constructor: {
+    value: PersistentError,
+    enumerable: false,
+    configurable: true
+  }
+});
+
+module.exports = PersistentError;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_error_RollbackError.js.html b/doc/lib_error_RollbackError.js.html new file mode 100644 index 00000000..059edf08 --- /dev/null +++ b/doc/lib_error_RollbackError.js.html @@ -0,0 +1,335 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/error/RollbackError.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/error/RollbackError.js

+ + + + + + +
+
+
"use strict";
+
+var PersistentError = require('./PersistentError');
+
+/**
+ * @alias error.RollbackError
+ * @extends error.PersistentError
+ */
+class RollbackError extends PersistentError {
+  /**
+   * @param {Error} cause
+   */
+  constructor(cause) {
+    super('The transaction has been rollbacked', cause);
+  }
+}
+
+module.exports = RollbackError;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_error_index.js.html b/doc/lib_error_index.js.html new file mode 100644 index 00000000..c36a7c89 --- /dev/null +++ b/doc/lib_error_index.js.html @@ -0,0 +1,325 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/error/index.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/error/index.js

+ + + + + + +
+
+
/**
+ * @namespace error
+ */
+
+exports.CommunicationError = require('./CommunicationError');
+exports.IllegalEntityError = require('./IllegalEntityError');
+exports.EntityExistsError = require('./EntityExistsError');
+exports.PersistentError = require('./PersistentError');
+exports.RollbackError = require('./RollbackError');
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_message.js.html b/doc/lib_message.js.html new file mode 100644 index 00000000..3c672bc3 --- /dev/null +++ b/doc/lib_message.js.html @@ -0,0 +1,1509 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/message.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/message.js

+ + + + + + +
+
+
var Message = require('./connector/Message');
+
+/**
+ * Get the list of all available subresources
+ * 
+ * @class message.ListAllResources
+ * @extends connector.Message
+ *
+ */
+exports.ListAllResources = Message.create({
+    method: 'GET',
+    path: '/',
+    status: [200]
+});
+
+/**
+ * Get the API version of the Orestes-Server
+ * 
+ * @class message.ApiVersion
+ * @extends connector.Message
+ *
+ */
+exports.ApiVersion = Message.create({
+    method: 'GET',
+    path: '/version',
+    status: [200]
+});
+
+/**
+ * Gets the event Endpoint
+ *
+ * @class message.Events
+ * @extends connector.Message
+ *
+ */
+exports.EventsUrl = Message.create({
+    method: 'GET',
+    path: '/events-url',
+    status: [200]
+});
+
+/**
+ * The Swagger specification of the Orestes-Server
+ * 
+ * @class message.Specification
+ * @extends connector.Message
+ *
+ */
+exports.Specification = Message.create({
+    method: 'GET',
+    path: '/spec',
+    status: [200]
+});
+
+/**
+ * Returns all changed objects
+ * 
+ * @class message.GetBloomFilter
+ * @extends connector.Message
+ *
+ */
+exports.GetBloomFilter = Message.create({
+    method: 'GET',
+    path: '/bloomfilter',
+    status: [200]
+});
+
+/**
+ * Get the current Orestes config
+ * 
+ * @class message.GetOrestesConfig
+ * @extends connector.Message
+ *
+ */
+exports.GetOrestesConfig = Message.create({
+    method: 'GET',
+    path: '/config',
+    status: [200]
+});
+
+/**
+ * Updates the current Orestes config
+ * 
+ * @class message.UpdateOrestesConfig
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.UpdateOrestesConfig = Message.create({
+    method: 'PUT',
+    path: '/config',
+    status: [200, 202]
+});
+
+/**
+ * Connects a browser to this server
+ * 
+ * @class message.Connect
+ * @extends connector.Message
+ *
+ */
+exports.Connect = Message.create({
+    method: 'GET',
+    path: '/connect',
+    status: [200]
+});
+
+/**
+ * Gets the status of the server health
+ * 
+ * @class message.Status
+ * @extends connector.Message
+ *
+ */
+exports.Status = Message.create({
+    method: 'GET',
+    path: '/status',
+    status: [200]
+});
+
+/**
+ * Determines whether the IP has exceeded its rate limit
+ * 
+ * @class message.BannedIp
+ * @extends connector.Message
+ *
+ * @param ip {Object} The ip to test
+ */
+exports.BannedIp = Message.create({
+    method: 'GET',
+    path: '/banned/:ip',
+    status: [204]
+});
+
+/**
+ * Always returns banned status for proper CDN handling
+ * 
+ * @class message.Banned
+ * @extends connector.Message
+ *
+ */
+exports.Banned = Message.create({
+    method: 'GET',
+    path: '/banned',
+    status: []
+});
+
+/**
+ * Clears all rate-limiting information for all IPs
+ * 
+ * @class message.Unban
+ * @extends connector.Message
+ *
+ */
+exports.Unban = Message.create({
+    method: 'DELETE',
+    path: '/banned',
+    status: [204]
+});
+
+/**
+ * Clears rate-limiting information for given IPs
+ * 
+ * @class message.UnbanIp
+ * @extends connector.Message
+ *
+ * @param ip {Object} The ip to reset
+ */
+exports.UnbanIp = Message.create({
+    method: 'DELETE',
+    path: '/banned/:ip',
+    status: [204]
+});
+
+/**
+ * List all available bucket names
+ * List all bucket
+ * 
+ * @class message.GetBucketNames
+ * @extends connector.Message
+ *
+ */
+exports.GetBucketNames = Message.create({
+    method: 'GET',
+    path: '/db',
+    status: [200]
+});
+
+/**
+ * List all bucket objects
+ * List all object ids of the bucket
+ * 
+ * @class message.GetBucketIds
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param start {Object} The offset to skip
+ * @param count {Object} The upper limit to return
+ */
+exports.GetBucketIds = Message.create({
+    method: 'GET',
+    path: '/db/:bucket/ids?start=0&count=-1',
+    status: [200]
+});
+
+/**
+ * Dumps all objects of the bucket
+ * Exports the complete Bucket content
+ * 
+ * @class message.ExportBucket
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ */
+exports.ExportBucket = Message.create({
+    method: 'GET',
+    path: '/db/:bucket',
+    status: [200]
+});
+
+/**
+ * Upload all objects to the bucket
+ * Imports the complete Bucket content
+ * 
+ * @class message.ImportBucket
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param body {Object} The massage Content
+ */
+exports.ImportBucket = Message.create({
+    method: 'PUT',
+    path: '/db/:bucket',
+    status: [200]
+});
+
+/**
+ * Deletes all objects of the bucket
+ * Deletes all objects of the bucket
+ * 
+ * @class message.TruncateBucket
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ */
+exports.TruncateBucket = Message.create({
+    method: 'DELETE',
+    path: '/db/:bucket',
+    status: [200]
+});
+
+/**
+ * Create object
+ * Create the given Object.
+ * The object will be created and gets a unique oid.
+ * 
+ * @class message.CreateObject
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param body {Object} The massage Content
+ */
+exports.CreateObject = Message.create({
+    method: 'POST',
+    path: '/db/:bucket',
+    status: [201, 202]
+});
+
+/**
+ * Get object
+ * Returns the specified object. Each object has one unique identifier and therefore only one location.
+ * 
+ * @class message.GetObject
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {Object} The unique object identifier
+ */
+exports.GetObject = Message.create({
+    method: 'GET',
+    path: '/db/:bucket/:oid',
+    status: [200, 304]
+});
+
+/**
+ * Replace object
+ * Replace the current object with the updated one.
+ * To update a specific version of the object a version Number can be provided in the If-Match header.
+ * The update will only be accepted, if the current version matchesToBeForwarded the provided one, otherwise the update
+ * will be rejected.
+ * You can use the * wildcard to match any existing object, but prevents a insertion if the object doesn't exists.
+ * 
+ * @class message.ReplaceObject
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {Object} The unique object identifier
+ * @param body {Object} The massage Content
+ */
+exports.ReplaceObject = Message.create({
+    method: 'PUT',
+    path: '/db/:bucket/:oid',
+    status: [200, 202]
+});
+
+/**
+ * Deletes the object
+ * Deletes the object. The If-Match Header can be used to specify an expected version. The object will
+ * only be deleted if the version matchesToBeForwarded the provided one. The * wildcard can be used to match any existing
+ * version but results in an error if the object doesn't exists.
+ * 
+ * @class message.DeleteObject
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {Object} The unique object identifier
+ */
+exports.DeleteObject = Message.create({
+    method: 'DELETE',
+    path: '/db/:bucket/:oid',
+    status: [202, 204]
+});
+
+/**
+ * Get all available class schemas
+ * Gets the complete schema
+ * 
+ * @class message.GetAllSchemas
+ * @extends connector.Message
+ *
+ */
+exports.GetAllSchemas = Message.create({
+    method: 'GET',
+    path: '/schema',
+    status: [200]
+});
+
+/**
+ * Create new class schemas and update existing class schemas
+ * Updates the complete schema, merge all changes, reject the schema update if the schema changes aren't compatible
+ * 
+ * @class message.UpdateAllSchemas
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.UpdateAllSchemas = Message.create({
+    method: 'POST',
+    path: '/schema',
+    status: [200]
+});
+
+/**
+ * Replace all currently created schemas with the new ones
+ * Replace the complete schema, with the new one.
+ * 
+ * @class message.ReplaceAllSchemas
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.ReplaceAllSchemas = Message.create({
+    method: 'PUT',
+    path: '/schema',
+    status: [200]
+});
+
+/**
+ * Get the class schema
+ * Returns the schema definition of the class
+ * The class definition contains a link to its parent class and all persistable fields with there types of the class
+ * 
+ * @class message.GetSchema
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ */
+exports.GetSchema = Message.create({
+    method: 'GET',
+    path: '/schema/:bucket',
+    status: [200]
+});
+
+/**
+ * Update the class schema
+ * Modify the schema definition of the class by adding all missing fields
+ * 
+ * @class message.UpdateSchema
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param body {Object} The massage Content
+ */
+exports.UpdateSchema = Message.create({
+    method: 'POST',
+    path: '/schema/:bucket',
+    status: [200]
+});
+
+/**
+ * Replace the class schema
+ * Replace the schema definition of the class
+ * 
+ * @class message.ReplaceSchema
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param body {Object} The massage Content
+ */
+exports.ReplaceSchema = Message.create({
+    method: 'PUT',
+    path: '/schema/:bucket',
+    status: [200]
+});
+
+/**
+ * Delete the class schema
+ * Delete the schema definition of the class
+ * 
+ * @class message.DeleteSchema
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ */
+exports.DeleteSchema = Message.create({
+    method: 'DELETE',
+    path: '/schema/:bucket',
+    status: [204]
+});
+
+/**
+ * Executes a basic ad-hoc query
+ * Executes the given query and returns a list of matching objects.
+ * 
+ * @class message.AdhocQuery
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param q {Object} The query
+ * @param eager {Object} indicates if the query result should be send back as ids or as objects
+ * @param start {Object} The offset to start from
+ * @param count {Object} The number of objects to list
+ * @param sort {Object} The sort object
+ */
+exports.AdhocQuery = Message.create({
+    method: 'GET',
+    path: '/db/:bucket/query?q&start=0&count=-1&sort=&eager=',
+    status: [200]
+});
+
+/**
+ * Executes a basic ad-hoc query
+ * Executes the given query and returns a list of matching objects.
+ * 
+ * @class message.AdhocQueryPOST
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param start {Object} The offset to start from
+ * @param count {Object} The number of objects to list
+ * @param sort {Object} The sort object
+ * @param body {Object} The massage Content
+ */
+exports.AdhocQueryPOST = Message.create({
+    method: 'POST',
+    path: '/db/:bucket/query?start=0&count=-1&sort=',
+    status: [200]
+});
+
+/**
+ * Executes a count query
+ * Executes the given query and returns the number of objects that match the query
+ * 
+ * @class message.AdhocCountQuery
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param q {Object} The query
+ */
+exports.AdhocCountQuery = Message.create({
+    method: 'GET',
+    path: '/db/:bucket/count?q',
+    status: [200]
+});
+
+/**
+ * Executes a count query
+ * Executes the given query and returns the number of objects that match the query
+ * 
+ * @class message.AdhocCountQueryPOST
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param body {Object} The massage Content
+ */
+exports.AdhocCountQueryPOST = Message.create({
+    method: 'POST',
+    path: '/db/:bucket/count',
+    status: [200]
+});
+
+/**
+ * List all Query subresources
+ * 
+ * @class message.ListQueryResources
+ * @extends connector.Message
+ *
+ */
+exports.ListQueryResources = Message.create({
+    method: 'GET',
+    path: '/query',
+    status: [200]
+});
+
+/**
+ * Creates a prepared query
+ * 
+ * @class message.CreateQuery
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.CreateQuery = Message.create({
+    method: 'POST',
+    path: '/query',
+    status: [201]
+});
+
+/**
+ * List all subresources of a query
+ * 
+ * @class message.ListThisQueryResources
+ * @extends connector.Message
+ *
+ * @param qid {Object} The query id
+ */
+exports.ListThisQueryResources = Message.create({
+    method: 'GET',
+    path: '/query/:qid',
+    status: [200]
+});
+
+/**
+ * Get the query string
+ * 
+ * @class message.GetQueryCode
+ * @extends connector.Message
+ *
+ * @param qid {Object} The query id
+ */
+exports.GetQueryCode = Message.create({
+    method: 'GET',
+    path: '/query/:qid/source',
+    status: [200]
+});
+
+/**
+ * Executes a prepared query
+ * 
+ * @class message.RunQuery
+ * @extends connector.Message
+ *
+ * @param start {Object} The offset from where to start from
+ * @param count {Object} The number of objects to enlist
+ * @param qid {Object} The query id
+ */
+exports.RunQuery = Message.create({
+    method: 'GET',
+    path: '/query/:qid/result?start=0&count=-1',
+    status: [200]
+});
+
+/**
+ * Get the declared query parameters
+ * 
+ * @class message.GetQueryParameters
+ * @extends connector.Message
+ *
+ * @param qid {Object} The query id
+ */
+exports.GetQueryParameters = Message.create({
+    method: 'GET',
+    path: '/query/:qid/parameters',
+    status: [200]
+});
+
+/**
+ * Starts a new Transaction
+ * 
+ * @class message.NewTransaction
+ * @extends connector.Message
+ *
+ */
+exports.NewTransaction = Message.create({
+    method: 'POST',
+    path: '/transaction',
+    status: [201]
+});
+
+/**
+ * Commits the transaction
+ * If the transaction can be completed a list of all changed objects with their updated versions are returned.
+ * 
+ * @class message.CommitTransaction
+ * @extends connector.Message
+ *
+ * @param tid {Object} The transaction id
+ * @param body {Object} The massage Content
+ */
+exports.CommitTransaction = Message.create({
+    method: 'PUT',
+    path: '/transaction/:tid/committed',
+    status: [200]
+});
+
+/**
+ * Returns the object in the given version or the newest version if the given does not exist.
+ * 
+ * @class message.GetObjectInExplicitVersion
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {Object} The unique object identifier
+ * @param version {Object} The version to load
+ */
+exports.GetObjectInExplicitVersion = Message.create({
+    method: 'GET',
+    path: '/db/:bucket/:oid/:version',
+    status: [200]
+});
+
+/**
+ * Update the object
+ * Executes the partial updates on the object.
+ * To update an object an explicit version must be provided in the If-Match header.
+ * If the version is not equal to the current object version the update will be aborted.
+ * The version identifier Any (*) can be used to skip the version validation and therefore
+ * the update will always be applied.
+ * 
+ * @class message.UpdatePartially
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {Object} The unique object identifier
+ * @param body {Object} The massage Content
+ */
+exports.UpdatePartially = Message.create({
+    method: 'POST',
+    path: '/db/:bucket/:oid',
+    status: [204]
+});
+
+/**
+ * Update the object field
+ * Executes the partial update on a object field.
+ * To update an object an explicit version must be provided in the If-Match header.
+ * If the version is not equal to the current object version the update will be aborted.
+ * The version identifier Any (*) can be used to skip the version validation and therefore
+ * the update will always be applied.
+ * 
+ * @class message.UpdateField
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param field {Object} The field name
+ * @param oid {Object} The unique object identifier
+ * @param body {Object} The massage Content
+ */
+exports.UpdateField = Message.create({
+    method: 'POST',
+    path: '/db/:bucket/:oid/:field',
+    status: [204]
+});
+
+/**
+ * Method to login a user
+ * Log in a user by it's credentials
+ * 
+ * @class message.Login
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.Login = Message.create({
+    method: 'POST',
+    path: '/db/User/login',
+    status: [200]
+});
+
+/**
+ * Method to register a user
+ * Register and creates a new user
+ * 
+ * @class message.Register
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.Register = Message.create({
+    method: 'POST',
+    path: '/db/User/register',
+    status: [200, 204]
+});
+
+/**
+ * Method to load the current user object
+ * Gets the user object of the currently logged in user
+ * 
+ * @class message.Me
+ * @extends connector.Message
+ *
+ */
+exports.Me = Message.create({
+    method: 'GET',
+    path: '/db/User/me',
+    status: [200]
+});
+
+/**
+ * Method to validate a user token
+ * Validates if a given token is still valid
+ * 
+ * @class message.ValidateUser
+ * @extends connector.Message
+ *
+ */
+exports.ValidateUser = Message.create({
+    method: 'GET',
+    path: '/db/User/validate',
+    status: [200]
+});
+
+/**
+ * Method to remove token cookie
+ * Log out a user by removing the cookie token
+ * 
+ * @class message.Logout
+ * @extends connector.Message
+ *
+ */
+exports.Logout = Message.create({
+    method: 'GET',
+    path: '/db/User/logout',
+    status: [204]
+});
+
+/**
+ * Method to change the password
+ * 
+ * @class message.NewPassword
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.NewPassword = Message.create({
+    method: 'POST',
+    path: '/db/User/password',
+    status: [200]
+});
+
+/**
+ * Method to verify user by a given token
+ * 
+ * @class message.Verify
+ * @extends connector.Message
+ *
+ * @param token {Object} Token to verify the user
+ */
+exports.Verify = Message.create({
+    method: 'GET',
+    path: '/db/User/verify?token=',
+    status: [204]
+});
+
+/**
+ * Method to register or login using an OAuth provider.
+ * This resource is invoked by the provider with a redirect after the user granted permission.
+ * 
+ * @class message.OAuth2
+ * @extends connector.Message
+ *
+ * @param oauth_verifier {Object} OAuth 1.0 code
+ * @param code {Object} The code written by the provider
+ * @param provider {Object} The OAuth provider
+ * @param oauth_token {Object} OAuth 1.0 identifier
+ * @param error_description {Object} The error description of the oauth provider
+ * @param state {Object} On true a token will be returned
+ */
+exports.OAuth2 = Message.create({
+    method: 'GET',
+    path: '/db/User/OAuth/:provider?state=&code=&oauth_verifier=&oauth_token=&error_description=',
+    status: [200]
+});
+
+/**
+ * Method to invoke a OAuth-1.0 login/register
+ * The resource requests a request-token and redirects the user to the provider page to log-in and grant permission for
+ * your application.
+ * 
+ * @class message.OAuth1
+ * @extends connector.Message
+ *
+ * @param provider {Object} The OAuth provider
+ */
+exports.OAuth1 = Message.create({
+    method: 'GET',
+    path: '/db/User/OAuth1/:provider',
+    status: [200]
+});
+
+/**
+ * Gets the code of the the given bucket and type
+ * 
+ * @class message.GetBaqendCode
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param type {Object} The type of the script
+ */
+exports.GetBaqendCode = Message.create({
+    method: 'GET',
+    path: '/code/:bucket/:type',
+    status: [200]
+});
+
+/**
+ * Sets the code of the bucket and type
+ * 
+ * @class message.SetBaqendCode
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param type {Object} The type of the script
+ * @param body {Object} The massage Content
+ */
+exports.SetBaqendCode = Message.create({
+    method: 'PUT',
+    path: '/code/:bucket/:type',
+    status: [200, 202]
+});
+
+/**
+ * Delete the code of the given bucket and type
+ * 
+ * @class message.DeleteBaqendCode
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param type {Object} The type of the script
+ */
+exports.DeleteBaqendCode = Message.create({
+    method: 'DELETE',
+    path: '/code/:bucket/:type',
+    status: [202, 204]
+});
+
+/**
+ * Calls the module of the specific bucket
+ * 
+ * @class message.PostBaqendModule
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The method name
+ */
+exports.PostBaqendModule = Message.create({
+    method: 'POST',
+    path: '/code/:bucket',
+    status: [200, 204]
+});
+
+/**
+ * Calls the module of the specific bucket
+ * 
+ * @class message.GetBaqendModule
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The module name
+ */
+exports.GetBaqendModule = Message.create({
+    method: 'GET',
+    path: '/code/:bucket',
+    status: [200, 204]
+});
+
+/**
+ * List all available modules
+ * 
+ * @class message.GetAllModules
+ * @extends connector.Message
+ *
+ */
+exports.GetAllModules = Message.create({
+    method: 'GET',
+    path: '/code',
+    status: [200]
+});
+
+/**
+ * Get all file ID's in the given folder
+ * Retrieve meta-information about all accessible Files and folders in a specified folder.
+ * 
+ * @class message.ListFiles
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param path {Object} The folder to list
+ * @param start {Object} The file/folder name from where to start listing
+ * @param count {Object} The upper limit to return.
+ */
+exports.ListFiles = Message.create({
+    method: 'GET',
+    path: '/file/:bucket/ids?path=/&start=&count=-1',
+    status: [200]
+});
+
+/**
+ * Get all buckets
+ * Get all buckets.
+ *
+ * @class message.ListBuckets
+ * @extends connector.Message
+ *
+ */
+exports.ListBuckets = Message.create({
+    method: 'GET',
+    path: '/file/buckets',
+    status: [200]
+});
+
+/**
+ * Retrieves the bucket Metadata
+ * The bucket metadata object contains the bucketAcl
+ * 
+ * @class message.GetFileBucketMetadata
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ */
+exports.GetFileBucketMetadata = Message.create({
+    method: 'GET',
+    path: '/file/:bucket',
+    status: [200]
+});
+
+/**
+ * Sets the Bucket Metadata
+ * Creates or replaces the bucket Metadata to control permission access to all included Files.
+ * 
+ * @class message.SetFileBucketMetadata
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param body {Object} The massage Content
+ */
+exports.SetFileBucketMetadata = Message.create({
+    method: 'PUT',
+    path: '/file/:bucket',
+    status: [204]
+});
+
+/**
+ * deletes all files of a file Bucket
+ * Deletes the bucket and all its content
+ * 
+ * @class message.DeleteFileBucket
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ */
+exports.DeleteFileBucket = Message.create({
+    method: 'DELETE',
+    path: '/file/:bucket',
+    status: [204]
+});
+
+/**
+ * Creates a new file with a random UUID
+ * Creates a File with a random ID, only Insert permissions are required
+ * 
+ * @class message.CreateFile
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ */
+exports.CreateFile = Message.create({
+    method: 'POST',
+    path: '/file/:bucket',
+    status: [200]
+});
+
+/**
+ * Download a file
+ * Download a file.
+ * 
+ * @class message.DownloadFile
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {String} The unique object identifier
+ */
+exports.DownloadFile = Message.create({
+    method: 'GET',
+    path: '/file/:bucket/*oid',
+    status: [200, 304]
+});
+
+/**
+ * Upload a new file
+ * Upload and replace any existing File with the new one.
+ * The If-Match or If-Unmodified-Since header can be used to make a conditional update
+ * 
+ * @class message.UploadFile
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {String} The unique file identifier
+ */
+exports.UploadFile = Message.create({
+    method: 'PUT',
+    path: '/file/:bucket/*oid',
+    status: [200]
+});
+
+/**
+ * Gets the file metadata
+ * Gets the file Acl and metadata.
+ * 
+ * @class message.GetFileMetadata
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {String} The unique object identifier
+ */
+exports.GetFileMetadata = Message.create({
+    method: 'HEAD',
+    path: '/file/:bucket/*oid',
+    status: [200]
+});
+
+/**
+ * update File Metadata
+ * Updates the file Metadata.
+ * 
+ * @class message.UpdateFileMetadata
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {String} The unique object identifier
+ * @param body {Object} The massage Content
+ */
+exports.UpdateFileMetadata = Message.create({
+    method: 'POST',
+    path: '/file/:bucket/*oid',
+    status: [200]
+});
+
+/**
+ * Delete a file
+ * Deletes a file.
+ * The If-Match or If-Unmodified-Since header can be used to make a conditional deletion
+ * 
+ * @class message.DeleteFile
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param oid {String} The unique file identifier
+ */
+exports.DeleteFile = Message.create({
+    method: 'DELETE',
+    path: '/file/:bucket/*oid',
+    status: [204]
+});
+
+/**
+ * List bucket indexes
+ * List all indexes of the given bucket
+ * 
+ * @class message.ListIndexes
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ */
+exports.ListIndexes = Message.create({
+    method: 'GET',
+    path: '/index/:bucket',
+    status: [200]
+});
+
+/**
+ * Create or drop bucket index
+ * Create or drop a index for the given bucket
+ * 
+ * @class message.CreateDropIndex
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ * @param body {Object} The massage Content
+ */
+exports.CreateDropIndex = Message.create({
+    method: 'POST',
+    path: '/index/:bucket',
+    status: [202]
+});
+
+/**
+ * Drop all indexes
+ * Drop all indexes on the given bucket
+ * 
+ * @class message.DropAllIndexes
+ * @extends connector.Message
+ *
+ * @param bucket {Object} The bucket name
+ */
+exports.DropAllIndexes = Message.create({
+    method: 'DELETE',
+    path: '/index/:bucket',
+    status: [202]
+});
+
+/**
+ * Method to register a new device
+ * Registers a new devices
+ * 
+ * @class message.DeviceRegister
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.DeviceRegister = Message.create({
+    method: 'POST',
+    path: '/db/Device/register',
+    status: [204]
+});
+
+/**
+ * Method to push a message to devices
+ * Pushes a message to devices
+ * 
+ * @class message.DevicePush
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.DevicePush = Message.create({
+    method: 'POST',
+    path: '/db/Device/push',
+    status: [204]
+});
+
+/**
+ * Check if device is registered
+ * Checks if the device is already registered
+ * 
+ * @class message.DeviceRegistered
+ * @extends connector.Message
+ *
+ */
+exports.DeviceRegistered = Message.create({
+    method: 'GET',
+    path: '/db/Device/registered',
+    status: [200]
+});
+
+/**
+ * Upload APNS certificate
+ * Upload APNS certificate
+ * 
+ * @class message.UploadAPNSCertificate
+ * @extends connector.Message
+ *
+ */
+exports.UploadAPNSCertificate = Message.create({
+    method: 'POST',
+    path: '/config/APNSCert',
+    status: [204]
+});
+
+/**
+ * Set GCM-API-Key
+ * Sets the GCM-API-Key
+ * 
+ * @class message.GCMAKey
+ * @extends connector.Message
+ *
+ * @param body {Object} The massage Content
+ */
+exports.GCMAKey = Message.create({
+    method: 'POST',
+    path: '/config/GCMKey',
+    status: [204]
+});
+
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_Attribute.js.html b/doc/lib_metamodel_Attribute.js.html new file mode 100644 index 00000000..0f1178bd --- /dev/null +++ b/doc/lib_metamodel_Attribute.js.html @@ -0,0 +1,438 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/Attribute.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/Attribute.js

+ + + + + + +
+
+
"use strict";
+
+var Accessor = require('../binding/Accessor');
+
+/**
+ * @alias metamodel.Attribute
+ */
+class Attribute {
+  /**
+   * @type number
+   */
+  get persistentAttributeType() {
+    return -1;
+  }
+
+  /**
+   * @type boolean
+   */
+  get isAssociation() {
+    return this.persistentAttributeType > Attribute.PersistentAttributeType.EMBEDDED;
+  }
+
+  /**
+   * @type boolean
+   */
+  get isCollection() {
+    return this.persistentAttributeType == Attribute.PersistentAttributeType.ELEMENT_COLLECTION;
+  }
+
+  /**
+   * @param {string} name The attribute name
+   * @param {boolean=} isMetadata <code>true</code> if the attribute is an metadata attribute
+   */
+  constructor(name, isMetadata) {
+    /** @type boolean */
+    this.isMetadata = !!isMetadata;
+    /** @type boolean */
+    this.isId = false;
+    /** @type boolean */
+    this.isVersion = false;
+    /** @type boolean */
+    this.isAcl = false;
+
+    /** @type string */
+    this.name = name;
+    /** @type number */
+    this.order = null;
+    /** @type binding.Accessor */
+    this.accessor = null;
+    /** @type metamodel.ManagedType */
+    this.declaringType = null;
+  }
+
+  /**
+   * @param {metamodel.ManagedType} declaringType The type that owns this attribute
+   * @param {number} order Position of the attribute
+   */
+  init(declaringType, order) {
+    if (this.declaringType)
+      throw new Error('The attribute is already initialized.');
+
+    this.order = order;
+    this.accessor = new Accessor();
+    this.declaringType = declaringType;
+  }
+
+  /**
+   * @param {Object} entity
+   * @returns {*}
+   */
+  getValue (entity) {
+    return this.accessor.getValue(entity, this);
+  }
+
+  /**
+   * @param {Object} entity
+   * @param {*} value
+   */
+  setValue (entity, value) {
+    this.accessor.setValue(entity, this, value);
+  }
+
+  /**
+   * Gets this attribute value form the object as json
+   * @param {util.Metadata} state The root object state
+   * @param {*} object The object which contains the value of this attribute
+   * @return {*} The converted json value
+   * @abstract
+   */
+  getJsonValue (state, object) {}
+
+  /**
+   * Sets this attribute value from json to the object
+   * @param {util.Metadata} state The root state
+   * @param {*} object The object which contains the attribute
+   * @param {*} jsonValue The json value to convert an set
+   * @abstract
+   */
+  setJsonValue (state, object, jsonValue) {}
+
+  /**
+   * Converts this attribute field to json
+   * @abstract
+   * @returns {json} The attribute description as json
+   */
+  toJSON() {}
+}
+
+/**
+ * @enum {number}
+ */
+Attribute.PersistentAttributeType = {
+  BASIC: 0,
+  ELEMENT_COLLECTION: 1,
+  EMBEDDED: 2,
+  MANY_TO_MANY: 3,
+  MANY_TO_ONE: 4,
+  ONE_TO_MANY: 5,
+  ONE_TO_ONE: 6
+};
+
+module.exports = Attribute;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_BasicType.js.html b/doc/lib_metamodel_BasicType.js.html new file mode 100644 index 00000000..d855471e --- /dev/null +++ b/doc/lib_metamodel_BasicType.js.html @@ -0,0 +1,483 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/BasicType.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/BasicType.js

+ + + + + + +
+
+
"use strict";
+
+var Type = require('./Type');
+var GeoPoint = require('../GeoPoint');
+
+/**
+ * @alias metamodel.BasicType
+ * @extends metamodel.Type
+ */
+class BasicType extends Type {
+
+  /**
+   * The persistent type of this type
+   * @type number
+   */
+  get persistenceType() {
+    return Type.PersistenceType.BASIC;
+  }
+
+  /**
+   * Creates a new instance of a native db type
+   * @param {string} ref The db ref of this type
+   * @param {Class<*>} typeConstructor The javascript class of this type
+   * @param {boolean=} noResolving Indicates if this type is not the main type of the constructor
+   */
+  constructor(ref, typeConstructor, noResolving) {
+    if (ref.indexOf('/db/') != 0)
+      ref = '/db/' + ref;
+
+    super(ref, typeConstructor);
+
+    /**
+     * Indicates if this type is not the main type of the constructor
+     * @type {boolean}
+     */
+    this.noResolving = noResolving;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  toJsonValue (state, currentValue) {
+    return currentValue === null || currentValue === undefined? null: this.typeConstructor(currentValue);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  fromJsonValue (state, jsonValue, currentValue) {
+    return jsonValue === null || jsonValue === undefined? null: jsonValue;
+  }
+
+  toString() {
+    return "BasicType(" + this.ref + ")";
+  }
+}
+
+function dateToJson(value) {
+  //remove trailing zeros
+  return value instanceof Date? value.toISOString().replace(/\.?0*Z/, 'Z'): null;
+}
+
+function jsonToDate(json, currentValue) {
+  var date = typeof json === 'string'? new Date(json) : null;
+  if (currentValue && date) {
+    //compare normalized date strings instead of plain strings
+    return currentValue.toISOString() == date.toISOString()? currentValue: date;
+  } else {
+    return date;
+  }
+}
+
+Object.assign(BasicType, /** @lends metamodel.BasicType */ {
+  Boolean: new class BooleanType extends BasicType {
+    fromJsonValue (state, json, currentValue) {
+      return typeof json === 'string'? json !== "false": super.fromJsonValue(state, json, currentValue);
+    }
+  }('Boolean', Boolean),
+
+  Double: new class DoubleType extends BasicType {
+    fromJsonValue (state, json, currentValue) {
+      return typeof json === 'string'? parseFloat(json): super.fromJsonValue(state, json, currentValue);
+    }
+  }('Double', Number),
+
+  Integer: new class IntegerType extends BasicType {
+    fromJsonValue (state, json, currentValue) {
+      return typeof json === 'string'? parseInt(json): super.fromJsonValue(state, json, currentValue);
+    }
+  }('Integer', Number),
+
+  String: new class StringType extends BasicType {}('String', String),
+
+  DateTime: new class DateTimeType extends BasicType {
+    toJsonValue(state, value) {
+      return dateToJson(value);
+    }
+
+    fromJsonValue (state, json, currentValue) {
+      return jsonToDate(json, currentValue);
+    }
+  }('DateTime', Date),
+
+  Date: new class DateType extends BasicType {
+    toJsonValue (state, value) {
+      var json = dateToJson(value);
+      return json? json.substring(0, json.indexOf('T')): null;
+    }
+
+    fromJsonValue (state, json, currentValue) {
+      return jsonToDate(json, currentValue);
+    }
+  }('Date', Date),
+
+  Time: new class TimeType extends BasicType {
+    toJsonValue (state, value) {
+      var json = dateToJson(value);
+      return json? json.substring(json.indexOf('T') + 1): null;
+    }
+
+    fromJsonValue (state, json, currentValue) {
+      return typeof json === 'string'? jsonToDate('1970-01-01T' + json, currentValue): json;
+    }
+  }('Time', Date),
+
+  GeoPoint: new class GeoPointType extends BasicType {
+    toJsonValue (state, value) {
+      return value instanceof GeoPoint? value: null;
+    }
+
+    fromJsonValue (state, json) {
+      return json? new GeoPoint(json): null;
+    }
+  }('GeoPoint', GeoPoint),
+
+  JsonArray: new class JsonArrayType extends BasicType {
+    init(classFactory) {
+      //do not manipulate array properties
+      this._enhancer = classFactory;
+    }
+
+    toJsonValue (state, value) {
+      return Array.isArray(value)? value: null;
+    }
+
+    fromJsonValue (state, json) {
+      return Array.isArray(json)? json: null;
+    }
+  }('JsonArray', Array),
+
+  JsonObject: new class JsonObjectType extends BasicType {
+    init(classFactory) {
+      //do not manipulate object properties
+      this._enhancer = classFactory;
+    }
+
+    toJsonValue (state, value) {
+      if (value && value.constructor == Object) {
+        return value;
+      }
+
+      return null;
+    }
+  }('JsonObject', Object)
+});
+
+module.exports = BasicType;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_CollectionAttribute.js.html b/doc/lib_metamodel_CollectionAttribute.js.html new file mode 100644 index 00000000..4a2f1b55 --- /dev/null +++ b/doc/lib_metamodel_CollectionAttribute.js.html @@ -0,0 +1,344 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/CollectionAttribute.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/CollectionAttribute.js

+ + + + + + +
+
+
"use strict";
+
+var PluralAttribute = require('./PluralAttribute');
+
+/**
+ * @alias metamodel.CollectionAttribute
+ * @extends metamodel.PluralAttribute
+ */
+class CollectionAttribute extends PluralAttribute {
+
+  /**
+   * @inheritDoc
+   */
+  get collectionType() {
+    return PluralAttribute.CollectionType.COLLECTION;
+  }
+
+  /**
+   * @param {string} name
+   * @param {metamodel.Type} elementType
+   */
+  constructor(name, elementType) {
+    super(name, elementType);
+    this.typeConstructor = null;
+  }
+}
+
+module.exports = CollectionAttribute;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_DbIndex.js.html b/doc/lib_metamodel_DbIndex.js.html new file mode 100644 index 00000000..f4926409 --- /dev/null +++ b/doc/lib_metamodel_DbIndex.js.html @@ -0,0 +1,407 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/DbIndex.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/DbIndex.js

+ + + + + + +
+
+
"use strict";
+/**
+ * Creates a new index instance which is needed to create an
+ * database index.
+ *
+ * @alias metamodel.DbIndex
+ */
+class DbIndex {
+
+  /**
+   * @param {string|Object|Array<string>} keys The name of the field which will be used for the index,
+   * an object of an field and index type combination or
+   * an array of objects to create an compound index
+   * @param {boolean=} unique Indicates if the index will be unique
+   */
+  constructor(keys, unique) {
+    if(Object(keys) instanceof String) {
+      var key = {};
+      key[keys] = DbIndex.ASC;
+      this.keys = [key];
+    } else if(Object(keys) instanceof Array) {
+      this.keys = keys;
+    } else if(keys) {
+      this.keys = [keys];
+    } else {
+      throw new Error("The keys parameter must be an String, Object or Array.");
+    }
+
+    /** @type boolean */
+    this.drop = false;
+    this.unique = unique === true;
+  }
+
+  hasKey(name) {
+    for(var i = 0; i < this.keys.length; i++) {
+      if(this.keys[i][name]) {
+        return true;
+      }
+    }
+    return false;
+  }
+
+  get isCompound() {
+    return this.keys.length > 1;
+  }
+
+  get isUnique() {
+    return this.unique;
+  }
+
+  /**
+   * Returns a JSON representation of the Index object
+   *
+   * @return {json} A Json of this Index object
+   */
+  toJSON() {
+    return {
+      unique: this.unique,
+      keys: this.keys,
+      drop: this.drop
+    };
+  }
+}
+
+Object.assign(DbIndex, /** @lends metamodel.DbIndex */ {
+  /**
+   * @type string
+   */
+  ASC: 'asc',
+
+  /**
+   * @type string
+   */
+  DESC: 'desc',
+
+  /**
+   * @type string
+   */
+  GEO: 'geo',
+
+  /**
+   * Returns DbIndex Object created from the given JSON
+   * @param {json} json
+   */
+  fromJSON(json) {
+    return new DbIndex(json.keys, json.unique);
+  }
+});
+
+module.exports = DbIndex;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_EmbeddableType.js.html b/doc/lib_metamodel_EmbeddableType.js.html new file mode 100644 index 00000000..d3ab7ff5 --- /dev/null +++ b/doc/lib_metamodel_EmbeddableType.js.html @@ -0,0 +1,384 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/EmbeddableType.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/EmbeddableType.js

+ + + + + + +
+
+
"use strict";
+
+var ManagedType = require('./ManagedType');
+var Type = require('./Type');
+var binding = require('../binding');
+
+/**
+ * @alias metamodel.EmbeddableType
+ * @extends metamodel.ManagedType
+ */
+class EmbeddableType extends ManagedType {
+
+  get persistenceType() {
+    return Type.PersistenceType.EMBEDDABLE;
+  }
+
+  constructor(name, typeConstructor) {
+    super(name, typeConstructor);
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  createProxyClass() {
+    return this._enhancer.createProxy(binding.Managed);
+  }
+
+  /**
+   * {@inheritDoc}
+   * @param {EntityManager} db {@inheritDoc}
+   * @return {binding.ManagedFactory<*>} A factory which creates embeddable objects
+   */
+  createObjectFactory(db) {
+    return binding.ManagedFactory.create(this, db);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  toJsonValue(state, object) {
+    if (state._root && object instanceof this.typeConstructor && !object._metadata._root) {
+      object._metadata._root = state._root;
+    }
+
+    return super.toJsonValue(state, object);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  fromJsonValue(state, jsonObject, currentObject) {
+    if (jsonObject) {
+      if (!(currentObject instanceof this.typeConstructor))
+        currentObject = this.create();
+
+      if (state._root && !currentObject._metadata._root)
+        currentObject._metadata._root = state._root;
+    }
+
+    return super.fromJsonValue(state, jsonObject, currentObject);
+  }
+
+  toString() {
+    return "EmbeddableType(" + this.ref + ")";
+  }
+}
+
+module.exports = EmbeddableType;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_EntityType.js.html b/doc/lib_metamodel_EntityType.js.html new file mode 100644 index 00000000..8464889d --- /dev/null +++ b/doc/lib_metamodel_EntityType.js.html @@ -0,0 +1,501 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/EntityType.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/EntityType.js

+ + + + + + +
+
+
"use strict";
+
+var binding = require('../binding');
+
+var SingularAttribute = require('./SingularAttribute');
+var BasicType = require('./BasicType');
+var Type = require('./Type');
+var ManagedType = require('./ManagedType');
+var util = require('../util');
+
+/**
+ * @alias metamodel.EntityType
+ * @extends metamodel.ManagedType
+ */
+class EntityType extends ManagedType {
+
+  get persistenceType() {
+    return Type.PersistenceType.ENTITY;
+  }
+
+  /**
+   * @type metamodel.SingularAttribute
+   */
+  get id() {
+    return this.declaredId || this.superType.id;
+  }
+
+  /**
+   * @type metamodel.SingularAttribute
+   */
+  get version() {
+    return this.declaredVersion || this.superType.version;
+  }
+
+  /**
+   * @type metamodel.SingularAttribute
+   */
+  get acl() {
+    return this.declaredAcl || this.superType.acl;
+  }
+
+  /**
+   * @param {string} ref
+   * @param {metamodel.EntityType} superType
+   * @param {Class<binding.Entity>} typeConstructor
+   */
+  constructor(ref, superType, typeConstructor) {
+    super(ref, typeConstructor);
+
+    /** @type metamodel.SingularAttribute */
+    this.declaredId = null;
+    /** @type metamodel.SingularAttribute */
+    this.declaredVersion = null;
+    /** @type metamodel.SingularAttribute */
+    this.declaredAcl = null;
+    /** @type metamodel.EntityType */
+    this.superType = superType;
+
+    /** @type util.Permission */
+    this.loadPermission = new util.Permission();
+    /** @type util.Permission */
+    this.updatePermission = new util.Permission();
+    /** @type util.Permission */
+    this.deletePermission = new util.Permission();
+    /** @type util.Permission */
+    this.queryPermission = new util.Permission();
+    /** @type util.Permission */
+    this.schemaSubclassPermission = new util.Permission();
+    /** @type util.Permission */
+    this.insertPermission = new util.Permission();
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  createProxyClass() {
+    var Class = this.superType.typeConstructor;
+    if (Class === Object) {
+      switch (this.name) {
+        case 'User':
+          Class = binding.User;
+          break;
+        case 'Role':
+          Class = binding.Role;
+          break;
+        default:
+          Class = binding.Entity;
+          break;
+      }
+    }
+
+    return this._enhancer.createProxy(Class);
+  }
+
+  /**
+   * {@inheritDoc}
+   * Creates an ObjectFactory for this type and the given EntityManager
+   * @return {binding.EntityFactory<binding.Entity>} A factory which creates entity objects
+   */
+  createObjectFactory(db) {
+    switch (this.name) {
+      case 'User':
+        return binding.UserFactory.create(this, db);
+      case 'Device':
+        return binding.DeviceFactory.create(this, db);
+      case 'Object':
+        return undefined;
+    }
+
+    return binding.EntityFactory.create(this, db);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  fromJsonValue (state, jsonObject, currentObject, isRoot) {
+    if (isRoot) {
+      return super.fromJsonValue(state, jsonObject, currentObject);
+    } else if (jsonObject) {
+      return state.db.getReference(jsonObject);
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * @inheritDoc
+   */
+  toJsonValue(state, object, isRoot) {
+    if (isRoot) {
+      return super.toJsonValue(state, object);
+    } else if (object instanceof this.typeConstructor) {
+      object.attach(state.db);
+      return object.id;
+    } else {
+      return null;
+    }
+  }
+
+  toString() {
+    return "EntityType(" + this.ref + ")";
+  }
+
+  toJSON() {
+    var json = super.toJSON();
+
+    json.acl.schemaSubclass = this.schemaSubclassPermission;
+    json.acl.insert = this.insertPermission;
+    json.acl.update = this.updatePermission;
+    json.acl.delete = this.deletePermission;
+    json.acl.query = this.queryPermission;
+
+    return json;
+  }
+}
+
+/**
+ * @alias metamodel.EntityType.Object
+ * @extends metamodel.EntityType
+ */
+class ObjectType extends EntityType {
+  static get ref() {
+    return '/db/Object';
+  }
+
+  constructor() {
+    super(EntityType.Object.ref, null, Object);
+
+    this.declaredId = new SingularAttribute('id', BasicType.String, true);
+    this.declaredId.init(this, 0);
+    this.declaredId.isId = true;
+    this.declaredVersion = new SingularAttribute('version', BasicType.Double, true);
+    this.declaredVersion.init(this, 1);
+    this.declaredVersion.isVersion = true;
+    this.declaredAcl = new SingularAttribute('acl', BasicType.JsonObject, true);
+    this.declaredAcl.init(this, 2);
+    this.declaredAcl.isAcl = true;
+
+    this.declaredAttributes = [this.declaredId, this.declaredVersion, this.declaredAcl];
+  }
+}
+
+EntityType.Object = ObjectType;
+
+module.exports = EntityType;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_ListAttribute.js.html b/doc/lib_metamodel_ListAttribute.js.html new file mode 100644 index 00000000..113acee9 --- /dev/null +++ b/doc/lib_metamodel_ListAttribute.js.html @@ -0,0 +1,423 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/ListAttribute.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/ListAttribute.js

+ + + + + + +
+
+
"use strict";
+
+var PluralAttribute = require('./PluralAttribute');
+
+/**
+ * @alias metamodel.ListAttribute
+ * @extends metamodel.PluralAttribute
+ */
+class ListAttribute extends PluralAttribute {
+
+  static get ref() {
+    return '/db/collection.List'
+  }
+
+  get collectionType() {
+    return PluralAttribute.CollectionType.LIST;
+  }
+
+  /**
+   * @param {string} name
+   * @param {metamodel.Type} elementType
+   */
+  constructor(name, elementType) {
+    super(name, elementType);
+    this.typeConstructor = Array;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  getJsonValue (state, object) {
+    var value = this.getValue(object);
+
+    if (value instanceof this.typeConstructor) {
+      var len = value.length;
+      var persisting = new Array(len), persistedState = value.__persistedState__ || [];
+      var changed = !value.__persistedState__ || persistedState.length != len;
+
+      var json = new Array(len);
+      for (let i = 0; i < len; ++i) {
+        let el = value[i];
+        json[i] = this.elementType.toJsonValue(state, el);
+        persisting[i] = el;
+
+        changed |= persistedState[i] !== el;
+      }
+
+      if (state.persisting) {
+        Object.defineProperty(value, '__persistedState__', {value: persisting, configurable: true});
+      }
+
+      if (state.isPersistent && changed)
+        state.setDirty();
+
+      return json;
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  setJsonValue(state, obj, json) {
+    var value = null;
+
+    if (json) {
+      value = this.getValue(obj);
+
+      var len = json.length;
+      if (!(value instanceof this.typeConstructor)) {
+        value = new this.typeConstructor(len);
+      }
+
+      var persisting = new Array(len), persistedState = value.__persistedState__ || [];
+
+      //clear additional items
+      if (len < value.length)
+        value.splice(len, value.length - len);
+
+      for (let i = 0; i < len; ++i) {
+        let el = this.elementType.fromJsonValue(state, json[i], persistedState[i]);
+        persisting[i] = value[i] = el;
+      }
+
+      if (state.persisting) {
+        Object.defineProperty(value, '__persistedState__', {value: persisting, configurable: true});
+      }
+    }
+
+    this.setValue(obj, value);
+  }
+
+  /**
+   * {@inheritDoc}
+   * @returns {json} {@inheritDoc}
+   */
+  toJSON() {
+    return {
+      name: this.name,
+      type: ListAttribute.ref + '[' + this.elementType.ref + ']',
+      order: this.order
+    };
+  }
+}
+
+module.exports = ListAttribute;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_ManagedType.js.html b/doc/lib_metamodel_ManagedType.js.html new file mode 100644 index 00000000..849eb2a1 --- /dev/null +++ b/doc/lib_metamodel_ManagedType.js.html @@ -0,0 +1,639 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/ManagedType.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/ManagedType.js

+ + + + + + +
+
+
"use strict";
+
+var Type = require('./Type');
+var Permission = require('../util/Permission');
+var Validator = require('../util/Validator');
+var binding = require('../binding');
+
+/**
+ * @alias metamodel.ManagedType
+ * @extends metamodel.Type
+ */
+class ManagedType extends Type {
+
+  /**
+   * @type Function
+   */
+  get validationCode() {
+    return this._validationCode;
+  }
+
+  set validationCode(code) {
+    if(!code) {
+      this._validationCode = null;
+    } else {
+      this._validationCode = Validator.compile(this, code);
+    }
+  }
+
+  /**
+   * The Managed class
+   * @type Class<binding.Managed>
+   */
+  get typeConstructor() {
+    if (!this._typeConstructor) {
+      this.typeConstructor = this.createProxyClass();
+    }
+    return this._typeConstructor;
+  }
+
+  /**
+   * The Managed class constructor
+   * @param {Class<binding.Managed>} typeConstructor The managed class constructor
+   */
+  set typeConstructor(typeConstructor) {
+    if (this._typeConstructor) {
+      throw new Error("Type constructor has already been set.");
+    }
+
+    var isEntity = typeConstructor.prototype instanceof binding.Entity;
+    if (this.isEntity) {
+      if (!isEntity)
+        throw new TypeError("Entity classes must extends the Entity class.");
+    } else {
+      if (!(typeConstructor.prototype instanceof binding.Managed) || isEntity)
+        throw new TypeError("Embeddable classes must extends the Managed class.");
+    }
+
+    this._enhancer.enhance(this, typeConstructor);
+    this._typeConstructor = typeConstructor;
+  }
+
+  /**
+   * @param {string} ref or full class name
+   * @param {Class<binding.Managed>} typeConstructor
+   */
+  constructor(ref, typeConstructor) {
+    super(ref.indexOf('/db/') != 0 ? '/db/' + ref : ref, typeConstructor);
+
+    /** @type binding.Enhancer */
+    this._enhancer = null;
+    /** @type {metamodel.Attribute[]} */
+    this.declaredAttributes = [];
+
+    /** @type util.Permission */
+    this.schemaAddPermission = new Permission();
+    /** @type util.Permission */
+    this.schemaReplacePermission = new Permission();
+  }
+
+  /**
+   * Initialize this type
+   * @param {binding.Enhancer} enhancer The class enhancer
+   * used to enhance and instantiate instance of this managed class
+   */
+  init(enhancer) {
+    this._enhancer = enhancer;
+
+    if (this._typeConstructor && !this._enhancer.getIdentifier(this._typeConstructor))
+      this._enhancer.setIdentifier(this._typeConstructor, this.ref);
+  }
+
+  /**
+   * Creates an ProxyClass for this type
+   * @return {Class<*>} the crated proxy class for this type
+   * @abstract
+   */
+  createProxyClass() {}
+
+  /**
+   * Creates an ObjectFactory for this type and the given EntityManager
+   * @param {EntityManager} db The created instances will be attached to this EntityManager
+   * @return {binding.ManagedFactory<*>} the crated object factory for the given EntityManager
+   * @abstract
+   */
+  createObjectFactory(db) {}
+
+  /**
+   * Creates a new instance of the managed type, without invoking any constructors
+   * This method is used to create object instances which are loaded form the backend
+   * @returns {Object} The created instance
+   */
+  create() {
+    var instance;
+    instance = Object.create(this.typeConstructor.prototype);
+    binding.Managed.init(instance);
+
+    return instance;
+  }
+
+  /**
+   * An iterator which returns all attributes declared by this type and inherited form all super types
+   * @return {Iterator<metamodel.Attribute>}
+   */
+  attributes() {
+    let iter, index = 0, type = this;
+    if (this.superType) {
+      iter = this.superType.attributes();
+    }
+
+    return {
+      [Symbol.iterator]() {
+        return this
+      },
+
+      /**
+       * @return {Object} item
+       * @return {boolean} item.done
+       * @return {metamodel.Attribute} item.value
+       */
+      next() {
+        if (iter) {
+          let item = iter.next();
+          if (item.done) {
+            iter = null;
+          } else {
+            return item;
+          }
+        }
+
+        if (index < type.declaredAttributes.length) {
+          return {
+            value: type.declaredAttributes[index++],
+            done: false
+          }
+        } else {
+          return {done: true}
+        }
+      }
+    }
+  }
+
+  /**
+   * Adds an attribute to this type
+   * @param {metamodel.Attribute} attr The attribute to add
+   * @param {number=} order Position of the attribute
+   */
+  addAttribute(attr, order) {
+    if (this.getAttribute(attr.name))
+      throw new Error("An attribute with the name " + attr.name + " is already declared.");
+
+    if(attr.order == null) {
+      order = typeof order == 'undefined'? this.declaredAttributes.length: order;
+    } else {
+      order = attr.order;
+    }
+    attr.init(this, order);
+
+    this.declaredAttributes.push(attr);
+    if (this._typeConstructor && this.name != 'Object')
+      this._enhancer.enhanceProperty(this._typeConstructor, attr);
+  }
+
+  /**
+   * Removes an attribute from this type
+   * @param {string} name The Name of the attribute which will be removed
+   */
+  removeAttribute(name) {
+    var length = this.declaredAttributes.length;
+    this.declaredAttributes = this.declaredAttributes.filter(function(val) {
+      return val.name != name;
+    });
+
+    if (length == this.declaredAttributes.length)
+      throw new Error("An Attribute with the name " + name + " is not declared.");
+  }
+
+  /**
+   * @param {!string} name
+   * @returns {metamodel.Attribute}
+   */
+  getAttribute(name) {
+    var attr = this.getDeclaredAttribute(name);
+
+    if (!attr && this.superType) {
+      attr = this.superType.getAttribute(name);
+    }
+
+    return attr;
+  }
+
+  /**
+   * @param {string|number} val Name or order of the attribute
+   * @returns {metamodel.Attribute}
+   */
+  getDeclaredAttribute(val) {
+    for (let attr of this.declaredAttributes) {
+      if (attr.name === val || attr.order === val) {
+        return attr;
+      }
+    }
+
+    return null;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  fromJsonValue(state, jsonObject, currentObject) {
+    if (jsonObject) {
+      for (let attribute of this.attributes()) {
+        if (!attribute.isMetadata)
+          attribute.setJsonValue(state, currentObject, jsonObject[attribute.name]);
+      }
+    } else {
+      currentObject = null;
+    }
+
+    return currentObject;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  toJsonValue(state, object) {
+    var value = null;
+
+    if (object instanceof this.typeConstructor) {
+      value = {};
+      for (let attribute of this.attributes()) {
+        if (!attribute.isMetadata)
+          value[attribute.name] = attribute.getJsonValue(state, object);
+      }
+    }
+
+    return value;
+  }
+
+  /**
+   * Converts ths type schema to json
+   * @returns {json}
+   */
+  toJSON() {
+    var json = {};
+    json['class'] = this.ref;
+
+    if (this.superType)
+      json['superClass'] = this.superType.ref;
+
+    if (this.isEmbeddable)
+      json['embedded'] = true;
+
+    json['acl'] = {
+      load: this.loadPermission,
+      schemaAdd: this.schemaAddPermission,
+      schemaReplace: this.schemaReplacePermission
+    };
+
+    var fields = json['fields'] = {};
+    for (let attribute of this.declaredAttributes) {
+      if (!attribute.isMetadata)
+        fields[attribute.name] = attribute;
+    }
+
+    return json;
+  }
+
+  /**
+   * Returns iterator to get all referenced entities
+   * @return {Iterator<EntityType>}
+   */
+  references() {
+    let attributes = this.attributes();
+    let embedded = [];
+
+    return {
+      [Symbol.iterator]() {
+        return this
+      },
+
+      /**
+       * @return {Object} item
+       * @return {boolean} item.done
+       * @return {Object} item.value
+       */
+      next() {
+        for (let attribute of attributes) {
+          var type = attribute.isCollection ? attribute.elementType : attribute.type;
+          if(type.isEntity) {
+            return {done: false, value: {path: [attribute.name]}};
+          } else if(type.isEmbeddable) {
+            for (let emItem of type.references()) {
+              embedded.push({done: false, value: {path: [attribute.name].concat(emItem.path)}});
+            }
+          }
+        }
+
+        return embedded.length ? embedded.pop() : {done: true};
+      }
+    }
+  }
+}
+
+module.exports = ManagedType;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_MapAttribute.js.html b/doc/lib_metamodel_MapAttribute.js.html new file mode 100644 index 00000000..86ced8b8 --- /dev/null +++ b/doc/lib_metamodel_MapAttribute.js.html @@ -0,0 +1,435 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/MapAttribute.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/MapAttribute.js

+ + + + + + +
+
+
"use strict";
+
+var PluralAttribute = require('./PluralAttribute');
+var PersistentError = require('../error/PersistentError');
+
+/**
+ * @alias metamodel.MapAttribute
+ * @extends metamodel.PluralAttribute
+ */
+class MapAttribute extends PluralAttribute {
+
+  static get ref() {
+    return '/db/collection.Map';
+  }
+
+  get collectionType() {
+    return PluralAttribute.CollectionType.MAP;
+  }
+
+  /**
+   * @param {string} name
+   * @param {metamodel.Type} keyType
+   * @param {metamodel.Type} elementType
+   */
+  constructor(name, keyType, elementType) {
+    super(name, elementType);
+    /** @type metamodel.Type */
+    this.keyType = keyType;
+    this.typeConstructor = Map;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  getJsonValue (state, object) {
+    var value = this.getValue(object);
+
+    if (value instanceof this.typeConstructor) {
+      var persisting = {}, persistedState = value.__persistedState__ || {};
+      var changed = !value.__persistedState__ || value.__persistedSize__ !== value.size;
+
+      var json = {};
+      for (let entry of value.entries()) {
+        if (entry[0] === null || entry[0] === undefined)
+          throw new PersistentError('Map keys can\'t be null nor undefined.');
+
+        let jsonKey = this.keyType.toJsonValue(state, entry[0]);
+        json[jsonKey] = this.elementType.toJsonValue(state, entry[1]);
+
+        persisting[jsonKey] = [entry[0], entry[1]];
+        changed |= (persistedState[jsonKey] || [])[1] !== entry[1];
+      }
+
+      if (state.persisting) {
+        Object.defineProperties(value, {
+          '__persistedState__': {value: persisting, configurable: true},
+          '__persistedSize__': {value: value.size, configurable: true}
+        });
+      }
+
+      if (state.isPersistent && changed)
+        state.setDirty();
+
+      return json;
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * @inheritDoc
+   */
+  setJsonValue (state, obj, json) {
+    var value = null;
+    if (json) {
+      value = this.getValue(obj);
+
+      if (!(value instanceof this.typeConstructor)) {
+        value = new this.typeConstructor();
+      }
+
+      var persisting = {}, persistedState = value.__persistedState__ || {};
+
+      value.clear();
+      for (let jsonKey in json) {
+        let persistedEntry = persistedState[jsonKey] || [];
+        // ensure that "false" keys will be converted to false
+        let key = this.keyType.fromJsonValue(state, jsonKey, persistedEntry[0]);
+        let val = this.elementType.fromJsonValue(state, json[jsonKey], persistedEntry[1]);
+
+        persisting[jsonKey] = [key, val];
+        value.set(key, val);
+      }
+
+      if (state.persisting) {
+        Object.defineProperties(value, {
+          '__persistedState__': {value: persisting, configurable: true},
+          '__persistedSize__': {value: value.size, configurable: true}
+        });
+      }
+    }
+
+    this.setValue(obj, value);
+  }
+
+  /**
+   * {@inheritDoc}
+   * @returns {json} {@inheritDoc}
+   */
+  toJSON() {
+    return {
+      name: this.name,
+      type: MapAttribute.ref + '[' + this.keyType.ref + ',' + this.elementType.ref + ']',
+      order: this.order
+    };
+  }
+}
+
+module.exports = MapAttribute;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_Metamodel.js.html b/doc/lib_metamodel_Metamodel.js.html new file mode 100644 index 00000000..9afcff1a --- /dev/null +++ b/doc/lib_metamodel_Metamodel.js.html @@ -0,0 +1,639 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/Metamodel.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/Metamodel.js

+ + + + + + +
+
+
"use strict";
+
+var BasicType = require('./BasicType');
+var ManagedType = require('./ManagedType');
+var EntityType = require('./EntityType');
+var Enhancer = require('../binding/Enhancer');
+var ModelBuilder = require('./ModelBuilder');
+var DbIndex = require('./DbIndex');
+var Lockable = require('../util/Lockable');
+var StatusCode = require('../connector/Message').StatusCode;
+
+var message = require('../message');
+
+/**
+ * @alias metamodel.Metamodel
+ * @extends util.Lockable
+ */
+class Metamodel extends Lockable {
+
+  constructor(entityManagerFactory) {
+    super();
+
+    /**
+     * Defines if the Metamodel has been finalized
+     * @type boolean
+     */
+    this.isInitialized = false;
+
+    /**
+     * @type EntityManagerFactory
+     */
+    this.entityManagerFactory = entityManagerFactory;
+
+    /**
+     * @type Array.<metamodel.EntityType>
+     */
+    this.entities = null;
+
+    /**
+     * @type Array.<metamodel.EmbeddableType>
+     */
+    this.embeddables = null;
+
+    /**
+     * @type Array.<metamodel.BasicType>
+     */
+    this.baseTypes = null;
+
+    this._enhancer = new Enhancer();
+  }
+
+  /**
+   * Prepare the Metamodel for custom schema creation
+   * @param {Object=} jsonMetamodel initialize the metamodel with the serialized json schema
+   */
+  init(jsonMetamodel) {
+    if (this.isInitialized) {
+      throw new Error('Metamodel is already initialized.');
+    }
+
+    this.fromJSON(jsonMetamodel || []);
+    this.isInitialized = true;
+  }
+
+  /**
+   * @param {(Class<binding.Managed>|string)} arg
+   * @return {string}
+   */
+  _getRef(arg) {
+    var ref;
+    if (Object(arg) instanceof String) {
+      ref = arg;
+
+      if (ref.indexOf('/db/') != 0) {
+        ref = '/db/' + arg;
+      }
+    } else {
+      ref = this._enhancer.getIdentifier(arg);
+    }
+
+    return ref;
+  }
+
+  /**
+   * Return the metamodel entity type representing the entity.
+   *
+   * @param {(Class<binding.Entity>|string)} typeConstructor - the type of the represented entity
+   * @returns {metamodel.EntityType} the metamodel entity type
+   */
+  entity(typeConstructor) {
+    var ref = this._getRef(typeConstructor);
+    return ref ? this.entities[ref] : null;
+  }
+
+  /**
+   * Return the metamodel basic type representing the native class.
+   * @param {(Class<*>|string)} typeConstructor - the type of the represented native class
+   * @returns {metamodel.BasicType} the metamodel basic type
+   */
+  baseType(typeConstructor) {
+    var ref = null;
+    if (Object(typeConstructor) instanceof String) {
+      ref = this._getRef(typeConstructor);
+    } else {
+      for (var name in this.baseTypes) {
+        var type = this.baseTypes[name];
+        if (!type.noResolving && type.typeConstructor == typeConstructor) {
+          ref = name;
+          break;
+        }
+      }
+    }
+
+    return ref ? this.baseTypes[ref] : null;
+  }
+
+  /**
+   * Return the metamodel embeddable type representing the embeddable class.
+   * @param {Class<binding.Managed>|string} typeConstructor - the type of the represented embeddable class
+   * @returns {metamodel.EmbeddableType} the metamodel embeddable type
+   */
+  embeddable(typeConstructor) {
+    var ref = this._getRef(typeConstructor);
+    return ref ? this.embeddables[ref] : null;
+  }
+
+  /**
+   * Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.
+   *
+   * @param {(Class<binding.Managed>|string)} typeConstructor - the type of the represented managed class
+   * @returns {metamodel.Type} the metamodel managed type
+   */
+  managedType(typeConstructor) {
+    return this.baseType(typeConstructor) || this.entity(typeConstructor) || this.embeddable(typeConstructor);
+  }
+
+  /**
+   * @param {metamodel.Type} type
+   * @return {metamodel.Type} the added type
+   */
+  addType(type) {
+    var types;
+
+    if (type.isBasic) {
+      types = this.baseTypes;
+    } else if (type.isEmbeddable) {
+      type.init(this._enhancer);
+      types = this.embeddables;
+    } else if (type.isEntity) {
+      type.init(this._enhancer);
+      types = this.entities;
+
+      if (type.superType == null && type.ref != EntityType.Object.ref) {
+        type.superType = this.entity(EntityType.Object.ref);
+      }
+    }
+
+    if (types[type.ref]) {
+      throw new Error("The type " + type.ref + " is already declared.");
+    }
+
+    return types[type.ref] = type;
+  }
+
+  /**
+   * Load all schema data from the server
+   * @returns {Promise<metamodel.Metamodel>}
+   */
+  load() {
+    if(!this.isInitialized) {
+      return this.withLock(() => {
+        var msg = new message.GetAllSchemas();
+
+        return this.entityManagerFactory.send(msg).then((response) => {
+          this.init(response.entity);
+          return this;
+        });
+      });
+    } else {
+      throw new Error("Metamodel is already initialized.");
+    }
+  }
+
+  /**
+   * Store all local schema data on the server, or the provided one
+   *
+   * Note: The schema must be initialized, by init or load
+   *
+   * @param {metamodel.ManagedType=} managedType The specific type to persist, if omitted the complete schema will be updated
+   * @returns {Promise<metamodel.Metamodel>}
+   */
+  save(managedType) {
+    return this._send(managedType || this.toJSON()).then(() => {
+      return this;
+    });
+  }
+
+  /**
+   * The provided options object will be forwarded to the UpdateAllSchemas resource.
+   * The underlying schema of this Metamodel object will be replaced by the result.
+   *
+   * @param {json} data The JSON which will be send to the UpdateAllSchemas resource.
+   * @returns {Promise<metamodel.Metamodel>}
+   */
+  update(data) {
+    return this._send(data).then((response) => {
+      this.fromJSON(response.entity);
+      return this;
+    });
+  }
+
+  _send(data) {
+    if (!this.isInitialized)
+      throw new Error("Metamodel is not initialized.");
+
+    return this.withLock(() => {
+      var msg;
+      if(data instanceof ManagedType) {
+        msg = new message.UpdateSchema(data.name, data.toJSON());
+      } else {
+        msg = new message.UpdateAllSchemas(data);
+      }
+
+      return this.entityManagerFactory.send(msg);
+    });
+  }
+
+  /**
+   * Get the current schema types as json
+   * @returns {json} the json data
+   */
+  toJSON() {
+    var json = [];
+
+    for (var ref in this.entities) {
+      json.push(this.entities[ref]);
+    }
+
+    for (ref in this.embeddables) {
+      json.push(this.embeddables[ref]);
+    }
+
+    return json;
+  }
+
+  /**
+   * Replace the current schema by the provided one in json
+   * @param {json} json The json schema data
+   */
+  fromJSON(json) {
+    var builder = new ModelBuilder();
+    var models = builder.buildModels(json);
+
+    this.baseTypes = {};
+    this.embeddables = {};
+    this.entities = {};
+
+    for (var ref in models) {
+      var type = models[ref];
+      this.addType(type);
+    }
+  }
+
+  /**
+   * Creates an index
+   *
+   * @param {string} bucket Name of the Bucket
+   * @param {metamodel.DbIndex} index Will be applied for the given bucket
+   * @return {Promise<*>}
+   */
+  createIndex(bucket, index) {
+    index.drop = false;
+    var msg = new message.CreateDropIndex(bucket, index.toJSON());
+    return this.entityManagerFactory.send(msg);
+  }
+
+  /**
+   * Drops an index
+   *
+   * @param {string} bucket Name of the Bucket
+   * @param {metamodel.DbIndex} index Will be dropped for the given bucket
+   * @return {Promise<*>}
+   */
+  dropIndex(bucket, index) {
+    index.drop = true;
+    var msg = new message.CreateDropIndex(bucket, index.toJSON());
+    return this.entityManagerFactory.send(msg);
+  }
+
+  /**
+   * Drops all indexes
+   *
+   * @param {string} bucket Indexes will be dropped for the given bucket
+   * @returns {Promise<*>}
+   */
+  dropAllIndexes(bucket) {
+    var msg = new message.DropAllIndexes(bucket);
+    return this.entityManagerFactory.send(msg);
+  }
+
+  /**
+   * Loads all indexes for the given bucket
+   *
+   * @param {string} bucket Current indexes will be loaded for the given bucket
+   * @returns {Promise<Array<metamodel.DbIndex>>}
+   */
+  getIndexes(bucket) {
+    var msg = new message.ListIndexes(bucket);
+    return this.entityManagerFactory.send(msg).then((response) => {
+      return response.entity.map(function(el) {
+        return new DbIndex(el.keys, el.unique);
+      });
+    }, function(e) {
+      if (e.status == StatusCode.BUCKET_NOT_FOUND || e.status == StatusCode.OBJECT_NOT_FOUND) {
+        return null;
+      } else {
+        throw e;
+      }
+    });
+  }
+}
+
+module.exports = Metamodel;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_ModelBuilder.js.html b/doc/lib_metamodel_ModelBuilder.js.html new file mode 100644 index 00000000..941eada3 --- /dev/null +++ b/doc/lib_metamodel_ModelBuilder.js.html @@ -0,0 +1,467 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/ModelBuilder.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/ModelBuilder.js

+ + + + + + +
+
+
"use strict";
+
+var BasicType = require('./BasicType');
+var EntityType = require('./EntityType');
+var EmbeddableType = require('./EmbeddableType');
+
+var ListAttribute = require('./ListAttribute');
+var MapAttribute = require('./MapAttribute');
+var SetAttribute = require('./SetAttribute');
+var SingularAttribute = require('./SingularAttribute');
+
+var PersistentError = require('../error/PersistentError');
+
+/**
+ * @alias metamodel.ModelBuilder
+ */
+class ModelBuilder {
+  /**
+   * @param {metamodel.Metamodel} metamodel
+   */
+  constructor() {
+    /** @type Object<string,metamodel.ManagedType> */
+    this.models = {};
+
+    /** @type Object<string,Object> */
+    this.modelDescriptors = null;
+
+    for (let typeName of Object.keys(BasicType)) {
+      let basicType = BasicType[typeName];
+      if (basicType instanceof BasicType) {
+        this.models[basicType.ref] = basicType;
+      }
+    }
+  }
+
+  /**
+   * @param {string} ref
+   * @returns {metamodel.ManagedType}
+   */
+  getModel (ref) {
+    if (ref in this.models) {
+      return this.models[ref];
+    } else {
+      return this.models[ref] = this.buildModel(ref);
+    }
+  }
+
+  /**
+   * @param {Object[]} modelDescriptors
+   * @returns {Object<string,metamodel.ManagedType>}
+   */
+  buildModels (modelDescriptors) {
+    this.modelDescriptors = {};
+    for (var i = 0, modelDescriptor; modelDescriptor = modelDescriptors[i]; ++i) {
+      this.modelDescriptors[modelDescriptor['class']] = modelDescriptor;
+    }
+
+    for (let ref in this.modelDescriptors) {
+      try {
+        var model = this.getModel(ref);
+        this.buildAttributes(model);
+      } catch (e) {
+        throw new PersistentError('Can\'t create model for entity class ' + ref, e);
+      }
+    }
+
+    //ensure at least an object entity
+    this.getModel(EntityType.Object.ref);
+
+    return this.models;
+  }
+
+  /**
+   * @param {string} ref
+   * @returns {metamodel.ManagedType}
+   */
+  buildModel (ref) {
+    var modelDescriptor = this.modelDescriptors[ref];
+    var type;
+    if (ref == EntityType.Object.ref) {
+      type = new EntityType.Object();
+    } else if (modelDescriptor) {
+      if (modelDescriptor.embedded) {
+        type = new EmbeddableType(ref)
+      } else {
+        var superTypeIdentifier = modelDescriptor['superClass'] || EntityType.Object.ref;
+        type = new EntityType(ref, this.getModel(superTypeIdentifier));
+      }
+    } else {
+      throw new TypeError('No model available for ' + ref);
+    }
+
+    if (modelDescriptor) {
+      var permissions = modelDescriptor['acl'];
+      for (var permission in permissions) {
+        type[permission + 'Permission'].fromJSON(permissions[permission]);
+      }
+    }
+
+    return type;
+  }
+
+  /**
+   * @param {metamodel.EntityType} model
+   */
+  buildAttributes (model) {
+    var modelDescriptor = this.modelDescriptors[model.ref];
+    var fields = modelDescriptor['fields'];
+
+    for (let name in fields) {
+      let field = fields[name];
+      if (!model.getAttribute(name)) //skip predefined attributes
+        model.addAttribute(this.buildAttribute(field.name, field.type), field.order);
+    }
+
+    if(modelDescriptor.validationCode) {
+      model.validationCode = modelDescriptor.validationCode;
+    }
+  }
+
+  /**
+   * @param {metamodel.EntityType} model
+   * @param {string} name
+   * @param {string} ref
+   * @returns {metamodel.Attribute}
+   */
+  buildAttribute(name, ref) {
+    if (ref.indexOf('/db/collection.') == 0) {
+      var collectionType = ref.substring(0, ref.indexOf('['));
+
+      var elementType = ref.substring(ref.indexOf('[') + 1, ref.indexOf(']')).trim();
+      switch (collectionType) {
+        case ListAttribute.ref:
+          return new ListAttribute(name, this.getModel(elementType));
+        case SetAttribute.ref:
+          return new SetAttribute(name, this.getModel(elementType));
+        case MapAttribute.ref:
+          var keyType = elementType.substring(0, elementType.indexOf(',')).trim();
+          elementType = elementType.substring(elementType.indexOf(',') + 1).trim();
+
+          return new MapAttribute(name, this.getModel(keyType), this.getModel(elementType));
+        default:
+          throw new TypeError('No collection available for ' + ref);
+      }
+    } else {
+      return new SingularAttribute(name, this.getModel(ref));
+    }
+  }
+}
+
+module.exports = ModelBuilder;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_PluralAttribute.js.html b/doc/lib_metamodel_PluralAttribute.js.html new file mode 100644 index 00000000..bdf67bc6 --- /dev/null +++ b/doc/lib_metamodel_PluralAttribute.js.html @@ -0,0 +1,354 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/PluralAttribute.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/PluralAttribute.js

+ + + + + + +
+
+
"use strict";
+
+var Attribute = require('./Attribute');
+
+/**
+ * @alias metamodel.PluralAttribute
+ * @extends metamodel.Attribute
+ */
+class PluralAttribute extends Attribute {
+  
+  get persistentAttributeType() {
+    return Attribute.PersistentAttributeType.ELEMENT_COLLECTION;
+  }
+
+  /**
+   * @param {string} name
+   * @param {metamodel.Type} elementType
+   */
+  constructor(name, elementType) {
+    super(name);
+    /** @type metamodel.Type */
+    this.elementType = elementType;
+    /** @type Class<*> */
+    this.typeConstructor = null;
+  }
+}
+
+/**
+ * @enum {number}
+ */
+PluralAttribute.CollectionType = {
+  COLLECTION: 0,
+  LIST: 1,
+  MAP: 2,
+  SET: 3
+};
+
+module.exports = PluralAttribute;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_SetAttribute.js.html b/doc/lib_metamodel_SetAttribute.js.html new file mode 100644 index 00000000..972e88d6 --- /dev/null +++ b/doc/lib_metamodel_SetAttribute.js.html @@ -0,0 +1,428 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/SetAttribute.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/SetAttribute.js

+ + + + + + +
+
+
"use strict";
+
+var PluralAttribute = require('./PluralAttribute');
+
+/**
+ * @alias metamodel.SetAttribute
+ * @extends metamodel.PluralAttribute
+ */
+class SetAttribute extends PluralAttribute {
+
+  static get ref() {
+    return '/db/collection.Set'
+  }
+
+  get collectionType() {
+    return PluralAttribute.CollectionType.SET;
+  }
+
+  /**
+   * @param {string} name
+   * @param {metamodel.Type} elementType
+   */
+  constructor(name, elementType) {
+    super(name, elementType);
+
+    this.typeConstructor = Set;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  getJsonValue (state, object) {
+    var value = this.getValue(object);
+
+    if (value instanceof this.typeConstructor) {
+      var persisting = {}, persistedState = value.__persistedState__ || {};
+      var changed = !value.__persistedState__ || value.__persistedSize__ !== value.size;
+
+      var json = [];
+      for (let el of value) {
+        let jsonValue = this.elementType.toJsonValue(state, el);
+        json.push(jsonValue);
+
+        persisting[jsonValue] = el;
+        changed |= persistedState[jsonValue] !== el;
+      }
+
+      if (state.persisting) {
+        Object.defineProperties(value, {
+          '__persistedState__': {value: persisting, configurable: true},
+          '__persistedSize__': {value: value.size, configurable: true}
+        });
+      }
+
+      if (state.isPersistent && changed)
+        state.setDirty();
+
+      return json;
+    } else {
+      return null;
+    }
+  }
+
+  /**
+   * {@inheritDoc}
+   */
+  setJsonValue(state, obj, json) {
+    var value = null;
+
+    if (json) {
+      value = this.getValue(obj);
+
+      if (!(value instanceof this.typeConstructor)) {
+        value = new this.typeConstructor();
+      }
+
+      var persisting = {}, persistedState = value.__persistedState__  || {};
+
+      value.clear();
+      for (let i = 0, len = json.length; i < len; ++i) {
+        let jsonValue = json[i];
+        let el = this.elementType.fromJsonValue(state, jsonValue, persistedState[jsonValue]);
+        value.add(el);
+
+        persisting[jsonValue] = el;
+      }
+
+      if (state.persisting) {
+        Object.defineProperties(value, {
+          '__persistedState__': {value: persisting, configurable: true},
+          '__persistedSize__': {value: value.size, configurable: true}
+        });
+      }
+    }
+
+    this.setValue(obj, value);
+  }
+
+  /**
+   * {@inheritDoc}
+   * @returns {json} {@inheritDoc}
+   */
+  toJSON() {
+    return {
+      name: this.name,
+      type: SetAttribute.ref + '[' + this.elementType.ref + ']',
+      order: this.order
+    };
+  }
+}
+
+module.exports = SetAttribute;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_SingularAttribute.js.html b/doc/lib_metamodel_SingularAttribute.js.html new file mode 100644 index 00000000..01eb8eec --- /dev/null +++ b/doc/lib_metamodel_SingularAttribute.js.html @@ -0,0 +1,381 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/SingularAttribute.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/SingularAttribute.js

+ + + + + + +
+
+
"use strict";
+
+var Attribute = require('./Attribute');
+var Type = require('./Type');
+
+/**
+ * @alias metamodel.SingularAttribute
+ * @extends metamodel.Attribute
+ */
+class SingularAttribute extends Attribute {
+
+  get typeConstructor() {
+    return this.type.typeConstructor;
+  }
+
+  get persistentAttributeType() {
+    switch (this.type.persistenceType) {
+      case Type.PersistenceType.BASIC:
+        return Attribute.PersistentAttributeType.BASIC;
+      case Type.PersistenceType.EMBEDDABLE:
+        return Attribute.PersistentAttributeType.EMBEDDED;
+      case Type.PersistenceType.ENTITY:
+        return Attribute.PersistentAttributeType.ONE_TO_MANY;
+    }
+  }
+
+  /**
+   * @param {string} name
+   * @param {metamodel.Type} type
+   * @param {boolean=} isMetadata
+   */
+  constructor(name, type, isMetadata) {
+    super(name, isMetadata);
+
+    /** @type metamodel.Type */
+    this.type = type;
+  }
+
+  /**
+   * @inheritDoc
+   */
+  getJsonValue(state, object) {
+    return this.type.toJsonValue(state, this.getValue(object));
+  }
+
+  /**
+   * @inheritDoc
+   */
+  setJsonValue(state, object, jsonValue) {
+    this.setValue(object, this.type.fromJsonValue(state, jsonValue, this.getValue(object)));
+  }
+
+  /**
+   * @inheritDoc
+   */
+  toJSON() {
+    return {
+      name: this.name,
+      type: this.type.ref,
+      order: this.order
+    }
+  }
+}
+
+module.exports = SingularAttribute;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_Type.js.html b/doc/lib_metamodel_Type.js.html new file mode 100644 index 00000000..614374e0 --- /dev/null +++ b/doc/lib_metamodel_Type.js.html @@ -0,0 +1,424 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/Type.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/Type.js

+ + + + + + +
+
+
"use strict";
+
+/**
+ * @alias metamodel.Type
+ */
+class Type {
+  /**
+   * The persistent type of this type
+   * @type number
+   * @abstract
+   */
+  get persistenceType() {
+    return -1;
+  }
+
+  /**
+   * @type boolean
+   */
+  get isBasic() {
+    return this.persistenceType == Type.PersistenceType.BASIC;
+  }
+
+  /**
+   * @type boolean
+   */
+  get isEmbeddable() {
+    return this.persistenceType == Type.PersistenceType.EMBEDDABLE;
+  }
+
+  /**
+   * @type boolean
+   */
+  get isEntity() {
+    return this.persistenceType == Type.PersistenceType.ENTITY;
+  }
+
+  /**
+   * @type boolean
+   */
+  get isMappedSuperclass() {
+    return this.persistenceType == Type.PersistenceType.MAPPED_SUPERCLASS;
+  }
+
+  /**
+   * @return {Class<*>}
+   */
+  get typeConstructor() {
+    return this._typeConstructor;
+  }
+
+  /**
+   * @param {Class<*>} typeConstructor
+   */
+  set typeConstructor(typeConstructor) {
+    if(this._typeConstructor) {
+      throw new Error("typeConstructor has already been set.")
+    }
+    this._typeConstructor = typeConstructor;
+  }
+
+  /**
+   * @param {string} ref
+   * @param {Class<*>} typeConstructor
+   */
+  constructor(ref, typeConstructor) {
+    if (ref.indexOf("/db/") != 0) {
+      throw new SyntaxError("Type ref " + ref + " is invalid.");
+    }
+
+    /** @type string */
+    this.ref = ref;
+    /** @type string */
+    this.name = ref.substring(4);
+    this._typeConstructor = typeConstructor;
+  }
+
+  /**
+   * Merge the json data into the current object instance and returns the merged object
+   * @param {util.Metadata} state The root object state
+   * @param {json} jsonValue The json data to merge
+   * @param {*=} currentValue The object where the jsonObject will be merged into, if the current object is null,
+   *  a new instance will be created
+   * @return {*} The merged object instance
+   * @abstract
+   */
+  fromJsonValue(state, jsonValue, currentValue) {}
+
+  /**
+   * Converts the given object to json
+   * @param {util.Metadata} state The root object state
+   * @param {*} object The object to convert
+   * @return {json} The converted object as json
+   * @abstract
+   */
+  toJsonValue(state, object) {}
+}
+
+/**
+ * @enum {number}
+ */
+Type.PersistenceType = {
+  BASIC: 0,
+  EMBEDDABLE: 1,
+  ENTITY: 2,
+  MAPPED_SUPERCLASS: 3
+};
+
+module.exports = Type;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_metamodel_index.js.html b/doc/lib_metamodel_index.js.html new file mode 100644 index 00000000..03ee98f4 --- /dev/null +++ b/doc/lib_metamodel_index.js.html @@ -0,0 +1,340 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/metamodel/index.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/metamodel/index.js

+ + + + + + +
+
+
/**
+ * @namespace metamodel
+ */
+
+var Metamodel = require('./Metamodel');
+
+Metamodel.prototype.Attribute = require('./Attribute');
+Metamodel.prototype.BasicType = require('./BasicType');
+Metamodel.prototype.CollectionAttribute = require('./CollectionAttribute');
+Metamodel.prototype.EmbeddableType = require('./EmbeddableType');
+Metamodel.prototype.EntityType = require('./EntityType');
+Metamodel.prototype.ListAttribute = require('./ListAttribute');
+Metamodel.prototype.ManagedType = require('./ManagedType');
+Metamodel.prototype.MapAttribute = require('./MapAttribute');
+Metamodel.prototype.Metamodel = require('./Metamodel');
+Metamodel.prototype.ModelBuilder = require('./ModelBuilder');
+Metamodel.prototype.PluralAttribute = require('./PluralAttribute');
+Metamodel.prototype.SetAttribute = require('./SetAttribute');
+Metamodel.prototype.SingularAttribute = require('./SingularAttribute');
+Metamodel.prototype.Type = require('./Type');
+Metamodel.prototype.DbIndex = require('./DbIndex');
+
+exports = module.exports = new Metamodel();
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_model_index.js.html b/doc/lib_model_index.js.html new file mode 100644 index 00000000..0240243b --- /dev/null +++ b/doc/lib_model_index.js.html @@ -0,0 +1,334 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/model/index.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/model/index.js

+ + + + + + +
+
+
/**
+ * @namespace model
+ */
+
+/**
+ * @interface model.User
+ * @extends binding.User
+ */
+
+/**
+ * @interface model.Role
+ * @extends binding.Role
+ */
+
+/**
+ * @interface model.Device
+ * @extends binding.Entity
+ */
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_query_Builder.js.html b/doc/lib_query_Builder.js.html new file mode 100644 index 00000000..78fe9d1a --- /dev/null +++ b/doc/lib_query_Builder.js.html @@ -0,0 +1,429 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/query/Builder.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/query/Builder.js

+ + + + + + +
+
+
"use strict";
+
+var Filter = require('./Filter');
+var Condition = require('./Condition');
+var Operator = require('./Operator');
+var Query = require('./Query');
+var varargs = Query.varargs;
+
+/**
+ * @alias query.Builder<T>
+ * @extends query.Query<T>
+ * @extends query.Condition<T>
+ */
+class Builder extends Query {
+
+  /**
+   * @param {EntityManager} entityManager The owning entity manager of this query
+   * @param {Class<T>} resultClass The query result class
+   */
+  constructor(entityManager, resultClass) {
+    super(entityManager, resultClass);
+  }
+
+  /**
+   * Joins the conditions by an logical AND
+   * @param {...(query.Query<T>|Array<query.Query<T>>)} args The query nodes to join
+   * @return {query.Query<T>} Returns a new query which joins the given queries by a logical AND
+   */
+  and(args) {
+    return this._addOperator('$and', varargs(0, arguments));
+  }
+
+  /**
+   * Joins the conditions by an logical OR
+   * @param {...(query.Query<T>|Array<query.Query<T>>)} args The query nodes to join
+   * @return {query.Query<T>} Returns a new query which joins the given queries by a logical OR
+   */
+  or(args) {
+    return this._addOperator('$or', varargs(0, arguments));
+  }
+
+  /**
+   * Joins the conditions by an logical NOR
+   * @param {...(query.Query<T>|Array<query.Query<T>>)} args The query nodes to join
+   * @return {query.Query<T>} Returns a new query which joins the given queries by a logical NOR
+   */
+  nor(args) {
+    return this._addOperator('$nor', varargs(0, arguments));
+  }
+
+  /**
+   * @inheritDoc
+   */
+  stream(options) {
+    return this.where({})._stream(options, this);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  resultList(options, doneCallback, failCallback) {
+    return this.where({}).resultList(options, doneCallback, failCallback);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  singleResult(options, doneCallback, failCallback) {
+    return this.where({}).singleResult(options, doneCallback, failCallback);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  count(doneCallback, failCallback) {
+    return this.where({}).count(doneCallback, failCallback);
+  }
+
+  _addOperator(operator, args) {
+    if (args.length < 2) {
+      throw new Error('Only two or more queries can be joined with an ' + operator + ' operator.');
+    }
+
+    args.forEach(function(arg, index) {
+      if (!(arg instanceof Query)) {
+        throw new Error('Argument at index ' + index + ' is not a query.');
+      }
+    });
+
+    return new Operator(this.entityManager, this.resultClass, operator, args);
+  }
+
+  _addOrder(fieldOrSort, order) {
+    return new Filter(this.entityManager, this.resultClass)._addOrder(fieldOrSort, order);
+  }
+
+  _addFilter(field, filter, value) {
+    return new Filter(this.entityManager, this.resultClass)._addFilter(field, filter, value);
+  }
+
+  _addOffset(offset) {
+    return new Filter(this.entityManager, this.resultClass)._addOffset(offset);
+  }
+
+  _addLimit(limit) {
+    return new Filter(this.entityManager, this.resultClass)._addLimit(limit);
+  }
+}
+
+Object.assign(Builder.prototype, Condition);
+
+module.exports = Builder;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_query_Condition.js.html b/doc/lib_query_Condition.js.html new file mode 100644 index 00000000..985681bc --- /dev/null +++ b/doc/lib_query_Condition.js.html @@ -0,0 +1,684 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/query/Condition.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/query/Condition.js

+ + + + + + +
+
+
"use strict";
+
+var varargs = require('./Query').varargs;
+
+/**
+ * @class query.Condition<T>
+ */
+var Condition = {};
+
+Object.assign(Condition, /** @lends query.Condition<T>.prototype */ {
+
+  /**
+   * An object, that contains filter rules which will be merged with the current filters of this query.
+   * @param {json} conditions - Additional filters for this query
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   */
+  where(conditions) {
+    return this._addFilter(null, null, conditions);
+  },
+
+  /**
+   * Adds a equal filter to the field. All other other filters on the field will be discarded
+   * @param {string} field The field to filter
+   * @param {*} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   */
+  equal(field, value) {
+    return this._addFilter(field, null, value);
+  },
+
+  /**
+   * Adds a not equal filter to the field.
+   * @param {string} field The field to filter
+   * @param {*} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/ne/
+   */
+  notEqual(field, value) {
+    return this._addFilter(field, "$ne", value);
+  },
+
+  /**
+   * Adds a greater than filter to the field.
+   * @param {string} field The field to filter
+   * @param {number|string|Date} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/gt/
+   */
+  greaterThan(field, value) {
+    return this._addFilter(field, "$gt", value);
+  },
+
+  /**
+   * Adds a greater than or equal to filter to the field.
+   * @param {string} field The field to filter
+   * @param {number|string|Date} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/gte/
+   */
+  greaterThanOrEqualTo(field, value) {
+    return this._addFilter(field, "$gte", value);
+  },
+
+  /**
+   * Adds a less than filter to the field.
+   * @param {string} field The field to filter
+   * @param {number|string|Date} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/lt/
+   */
+  lessThan(field, value) {
+    return this._addFilter(field, "$lt", value);
+  },
+
+  /**
+   * Adds a less than or equal to filter to the field.
+   * @param {string} field The field to filter
+   * @param {number|string|Date} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/lte/
+   */
+  lessThanOrEqualTo(field, value) {
+    return this._addFilter(field, "$lte", value);
+  },
+
+  /**
+   * Adds a between filter to the field. This is a shorthand for an less than and greater than filter.
+   * @param {string} field The field to filter
+   * @param {number|string|Date} lessValue The field value must be greater than this value
+   * @param {number|string|Date} greaterValue The field value must be less than this value
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   */
+  between(field, lessValue, greaterValue) {
+    return this._addFilter(field, "$gt", lessValue)
+    ._addFilter(field, "$lt", greaterValue);
+  },
+
+  /**
+   * Adds a in filter to the field. The field value must be equal to one of the given values
+   * @param {string} field The field to filter
+   * @param {...(*|Array<*>)} args The field value or values to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/in/
+   */
+  'in'(field, args) {
+    return this._addFilter(field, "$in", varargs(1, arguments));
+  },
+
+  /**
+   * Adds a in filter to the field. The field value must be equal to one of the given values
+   * @param {string} field The field to filter
+   * @param {...(*|Array<*>)} args The field value or values to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   * @memberOf query.Condition<T>.prototype
+   * @name in
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/in/
+   */
+
+  /**
+   * Adds a not in filter to the field. The field value must not be equal to any of the given values
+   * @param {string} field The field to filter
+   * @param {...(*|Array<*>)} args The field value or values to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/nin/
+   */
+  notIn(field, args) {
+    return this._addFilter(field, "$nin", varargs(1, arguments));
+  },
+
+  /**
+   * Adds a null filter to the field. The field value must be null
+   * @param {string} field The field to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   */
+  isNull(field) {
+    return this.equal(field, null);
+  },
+
+  /**
+   * Adds a not null filter to the field. The field value must not be null
+   * @param {string} field The field to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   */
+  isNotNull(field) {
+    return this._addFilter(field, "$exists", true)
+    ._addFilter(field, "$ne", null);
+  },
+
+  /**
+   * Adds a contains all filter to the collection field. The collection must contain all the given values.
+   * @param {string} field The field to filter
+   * @param {...(*|Array<*>)} args The field value or values to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/all/
+   */
+  containsAll(field, args) {
+    return this._addFilter(field, "$all", varargs(1, arguments));
+  },
+
+  /**
+   * Adds a modulo filter to the field. The field value divided by divisor must be equal to the remainder.
+   * @param {string} field The field to filter
+   * @param {number} divisor The divisor of the modulo filter
+   * @param {number} remainder The remainder of the modulo filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/mod/
+   */
+  mod(field, divisor, remainder) {
+    return this._addFilter(field, "$mod", [divisor, remainder]);
+  },
+
+  /**
+   * Adds a regular expression filter to the field. The field value must matches the regular expression.
+   * <p>Note: Only anchored expressions (Expressions that starts with an ^) and the multiline flag are supported.</p>
+   * @param {string} field The field to filter
+   * @param {string|RegExp} regExp The regular expression of the filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/regex/
+   */
+  matches(field, regExp) {
+    if (!(Object(regExp) instanceof RegExp)) {
+      regExp = new RegExp(regExp);
+    }
+
+    if (regExp.ignoreCase) {
+      throw new Error('RegExp.ignoreCase flag is not supported.');
+    }
+
+    if (regExp.global) {
+      throw new Error('RegExp.global flag is not supported.');
+    }
+
+    if (regExp.source.indexOf('^') != 0) {
+      throw new Error('regExp must be an anchored expression, i.e. it must be started with a ^.');
+    }
+
+    var result = this._addFilter(field, '$regex', regExp.source);
+    if (regExp.multiline) {
+      result._addFilter(field, '$options', 'm');
+    }
+
+    return result;
+  },
+
+  /**
+   * Adds a size filter to the collection field. The collection must have exactly size members.
+   * @param {string} field The field to filter
+   * @param {number} size The collections size to filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/size/
+   */
+  size(field, size) {
+    return this._addFilter(field, "$size", size);
+  },
+
+  /**
+   * Adds a geopoint based near filter to the GeoPoint field. The GeoPoint must be within the maximum distance
+   * to the given GeoPoint. Returns from nearest to farthest.
+   * @param {string} field The field to filter
+   * @param {GeoPoint} geoPoint The GeoPoint to filter
+   * @param {number} maxDistance Tha maximum distance to filter in meters
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/nearSphere/
+   */
+  near(field, geoPoint, maxDistance) {
+    return this._addFilter(field, "$nearSphere", {
+      $geometry: {
+        type: "Point",
+        coordinates: [geoPoint.longitude, geoPoint.latitude]
+      },
+      $maxDistance: maxDistance
+    });
+  },
+
+  /**
+   * Adds a GeoPoint based polygon filter to the GeoPoint field. The GeoPoint must be contained within the polygon.
+   * @param {string} field The field to filter
+   * @param {...(GeoPoint|Array<GeoPoint>)} geoPoints The geoPoints that describes the polygon of the filter
+   * @return {query.Filter<T>} The resulting Query
+   * @instance
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/geoWithin/
+   */
+  withinPolygon(field, geoPoints) {
+    geoPoints = varargs(1, arguments);
+    return this._addFilter(field, "$geoWithin", {
+      $geometry: {
+        type: "Polygon",
+        coordinates: [geoPoints.map(function(geoPoint) {
+          return [geoPoint.longitude, geoPoint.latitude];
+        })]
+      }
+    });
+  }
+});
+
+// aliases
+Object.assign(Condition, /** @lends query.Condition<T>.prototype */ {
+  /**
+   * Adds a equal filter to the field. All other other filters on the field will be discarded
+   * @method
+   * @param {string} field The field to filter
+   * @param {*} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   */
+  eq: Condition.equal,
+
+  /**
+   * Adds a not equal filter to the field.
+   * @method
+   * @param {string} field The field to filter
+   * @param {*} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/ne/
+   */
+  ne: Condition.notEqual,
+
+  /**
+   * Adds a less than filter to the field. Shorthand for {@link query.Condition#lessThan}.
+   * @method
+   * @param {string} field The field to filter
+   * @param {number|string|Date} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/lt/
+   */
+  lt: Condition.lessThan,
+
+  /**
+   * Adds a less than or equal to filter to the field. Shorthand for {@link query.Condition#lessThanOrEqualTo}.
+   * @method
+   * @param {string} field The field to filter
+   * @param {number|string|Date} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/lte/
+   */
+  le: Condition.lessThanOrEqualTo,
+
+  /**
+   * Adds a greater than filter to the field. Shorthand for {@link query.Condition#greaterThan}.
+   * @method
+   * @param {string} field The field to filter
+   * @param {number|string|Date} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/gt/
+   */
+  gt: Condition.greaterThan,
+
+  /**
+   * Adds a greater than or equal to filter to the field. Shorthand for {@link query.Condition#greaterThanOrEqualTo}.
+   * @method
+   * @param {string} field The field to filter
+   * @param {number|string|Date} value The value used to filter
+   * @return {query.Filter<T>} The resulting Query
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/gte/
+   */
+  ge: Condition.greaterThanOrEqualTo,
+
+  /**
+   * Adds a contains any filter to the collection field. The collection must contains one the given values.
+   * Alias for {@link query.Condition#in}
+   * @method
+   * @param {string} field The field to filter
+   * @param {...(*|Array<*>)} args The field value or values to filter
+   * @return {query.Filter<T>} The resulting Query
+   *
+   * @see http://docs.mongodb.org/manual/reference/operator/query/in/
+   */
+  containsAny: Condition.in
+});
+
+module.exports = Condition;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_query_Filter.js.html b/doc/lib_query_Filter.js.html new file mode 100644 index 00000000..329fad78 --- /dev/null +++ b/doc/lib_query_Filter.js.html @@ -0,0 +1,370 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/query/Filter.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/query/Filter.js

+ + + + + + +
+
+
"use strict";
+var Node = require('./Node');
+var Condition = require('./Condition');
+
+/**
+ * @alias query.Filter<T>
+ * @extends query.Node<T>
+ * @extends query.Condition<T>
+ */
+class Filter extends Node {
+
+  /**
+   * @param {EntityManager} entityManager The owning entity manager of this query
+   * @param {Class<T>} resultClass The query result class
+   */
+  constructor(entityManager, resultClass) {
+    super(entityManager, resultClass);
+
+    /**
+     * The actual filters of this node
+     * @type Object
+     */
+    this._filter = {};
+  }
+
+  _addFilter(field, filter, value) {
+    if (field !== null) {
+      if (!(Object(field) instanceof String))
+        throw new Error('Field must be a string.');
+
+      if (filter) {
+        var fieldFilter = this._filter[field];
+        if (!(fieldFilter instanceof Object) || Object.getPrototypeOf(fieldFilter) != Object.prototype) {
+          this._filter[field] = fieldFilter = {};
+        }
+
+        fieldFilter[filter] = value;
+      } else {
+        this._filter[field] = value;
+      }
+    } else {
+      Object.assign(this._filter, value);
+    }
+
+    return this;
+  }
+
+  toJSON() {
+    return this._filter;
+  }
+}
+
+Object.assign(Filter.prototype, Condition);
+module.exports = Filter;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_query_Node.js.html b/doc/lib_query_Node.js.html new file mode 100644 index 00000000..223f20f3 --- /dev/null +++ b/doc/lib_query_Node.js.html @@ -0,0 +1,519 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/query/Node.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/query/Node.js

+ + + + + + +
+
+
"use strict";
+
+var Query = require('./Query');
+var message = require('../message');
+var Metadata = require('../util/Metadata');
+var Entity = require('../binding/Entity');
+
+/**
+ * @alias query.Node<T>
+ * @extends query.Query<T>
+ */
+class Node extends Query {
+
+  /**
+   * @param {EntityManager} entityManager The owning entity manager of this query
+   * @param {Class<T>} resultClass The query result class
+   */
+  constructor(entityManager, resultClass) {
+    super(entityManager, resultClass);
+
+    /**
+     * The offset how many results should be skipped
+     * @type number
+     */
+    this.firstResult = 0;
+
+    /**
+     * The limit how many objects should be returned
+     * @type number
+     */
+    this.maxResults = -1;
+
+    this._sort = {};
+  }
+
+  /**
+   * @inheritDoc
+   */
+  stream(options) {
+    return this._stream(options, this);
+  }
+
+  /**
+   * Only available in streaming SDK!
+   * @ignore
+   */
+  _stream(options, target) {
+    throw new Error('Streaming features not available! Please use Streaming SDK!');
+  }
+
+  /**
+   * @inheritDoc
+   */
+  resultList(options, doneCallback, failCallback) {
+    if(options instanceof Function) {
+      failCallback = doneCallback;
+      doneCallback = options;
+      options = {};
+    }
+
+    var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null;
+
+    if (!type) {
+      throw new Error('Only typed queries can be executed.');
+    }
+
+    var query = this._serializeQuery();
+    var sort = this._serializeSort();
+
+    var uriSize = this.entityManager._connector.host.length + query.length;
+    var msg;
+    if(uriSize > Query.MAX_URI_SIZE) {
+      msg = new message.AdhocQueryPOST(type.name, this.firstResult, this.maxResults, sort)
+        .entity(query, 'text');
+    } else {
+      msg = new message.AdhocQuery(type.name, query, this.firstResult, this.maxResults, sort);
+    }
+
+    return this.entityManager.send(msg).then((response) => {
+      return this._createResultList(response.entity, options);
+    }).then(doneCallback, failCallback);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  singleResult(options, doneCallback, failCallback) {
+    if(options instanceof Function) {
+      failCallback = doneCallback;
+      doneCallback = options;
+      options = {};
+    }
+
+    var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null;
+
+    if (!type) {
+      throw new Error('Only typed queries can be executed.');
+    }
+
+    var query = this._serializeQuery();
+    var sort = this._serializeSort();
+
+    var uriSize = this.entityManager._connector.host.length + query.length;
+    var msg;
+    if(uriSize > Query.MAX_URI_SIZE) {
+      msg = new message.AdhocQueryPOST(type.name, query, this.firstResult, 1, sort)
+      .entity(query, 'text');
+    } else {
+      msg = new message.AdhocQuery(type.name, query, this.firstResult, 1, sort);
+    }
+
+    return this.entityManager.send(msg).then((response) => {
+      return this._createResultList(response.entity, options);
+    }).then((list) => {
+      return list.length ? list[0] : null;
+    }).then(doneCallback, failCallback);
+  }
+
+  /**
+   * @inheritDoc
+   */
+  count(doneCallback, failCallback) {
+    var type = this.resultClass ? this.entityManager.metamodel.entity(this.resultClass) : null;
+
+    if (!type) {
+      throw new Error('Only typed queries can be executed.');
+    }
+
+    var query = this._serializeQuery();
+
+    var uriSize = this.entityManager._connector.host.length + query.length;
+    var msg;
+    if(uriSize > Query.MAX_URI_SIZE) {
+      msg = new message.AdhocCountQueryPOST(type.name)
+      .entity(query, 'text');
+    } else {
+      msg = new message.AdhocCountQuery(type.name, query);
+    }
+
+    return this.entityManager.send(msg).then((response) => {
+      return response.entity.count;
+    }).then(doneCallback, failCallback);
+  }
+
+  _serializeQuery() {
+    return JSON.stringify(this, function(k, v) {
+      var typedValue = this[k];
+      if (Object(typedValue) instanceof Date) {
+        return {$date: v};
+      } else if (typedValue instanceof Entity) {
+        return typedValue.id;
+      } else {
+        return v;
+      }
+    });
+  }
+
+  _serializeSort() {
+    return JSON.stringify(this._sort);
+  }
+
+  _createResultList(result, options) {
+    if (result.length) {
+      return Promise.all(result.map(function(el) {
+        if (el.id) {
+          var entity = this.entityManager.getReference(this.resultClass, el.id);
+          var metadata = Metadata.get(entity);
+          metadata.setJson(el, true);
+          return this.entityManager.resolveDepth(entity, options);
+        } else {
+          return this.entityManager.load(Object.keys(el)[0]);
+        }
+      }, this)).then(function(result) {
+        return result.filter(function(val) {
+          return !!val;
+        });
+      });
+    } else {
+      return Promise.resolve([]);
+    }
+  }
+
+  _addOrder(fieldOrSort, order) {
+    if (order) {
+      this._sort[fieldOrSort] = order;
+    } else {
+      this._sort = fieldOrSort;
+    }
+    return this;
+  }
+
+  _addOffset(offset) {
+    this.firstResult = offset;
+    return this;
+  }
+
+  _addLimit(limit) {
+    this.maxResults = limit;
+    return this;
+  }
+}
+
+module.exports = Node;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_query_Operator.js.html b/doc/lib_query_Operator.js.html new file mode 100644 index 00000000..9dc8c742 --- /dev/null +++ b/doc/lib_query_Operator.js.html @@ -0,0 +1,353 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/query/Operator.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/query/Operator.js

+ + + + + + +
+
+
"use strict";
+var Node = require('./Node');
+
+/**
+ * @alias query.Operator<T>
+ * @extends query.Node<T>
+ */
+class Operator extends Node {
+
+  /**
+   * @param {EntityManager} entityManager The owning entity manager of this query
+   * @param {Class<T>} resultClass The query result class
+   * @param {string} operator The operator used to join the childs
+   * @param {Array<query.Node<T>>} childs The childs to join
+   */
+  constructor(entityManager, resultClass, operator, childs) {
+    super(entityManager, resultClass);
+    /**
+     * The operator used to join the child queries
+     * @type string
+     */
+    this._operator = operator;
+    /**
+     * The child Node of this query, it is always one
+     * @type Array<query.Node>
+     */
+    this._childs = childs;
+  }
+
+  toJSON() {
+    var json = {};
+    json[this._operator] = this._childs;
+    return json;
+  }
+}
+
+module.exports = Operator;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_query_Query.js.html b/doc/lib_query_Query.js.html new file mode 100644 index 00000000..77b24063 --- /dev/null +++ b/doc/lib_query_Query.js.html @@ -0,0 +1,496 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/query/Query.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/query/Query.js

+ + + + + + +
+
+
"use strict";
+
+/**
+ * @alias query.Query<T>
+ */
+class Query {
+  constructor(entityManager, resultClass) {
+    /**
+     * The owning EntityManager of this query
+     * @type EntityManager
+     */
+    this.entityManager = entityManager;
+
+    /**
+     * The result class of this query
+     * @type Class<T>
+     */
+    this.resultClass = resultClass;
+  }
+
+  /**
+   * Add an ascending sort for the specified field to this query
+   * @param {string} field The field to sort
+   * @return {query.Query<T>} The resulting Query
+   */
+  ascending(field) {
+    return this._addOrder(field, 1);
+  }
+
+  /**
+   * Add an decending sort for the specified field to this query
+   * @param {string} field The field to sort
+   * @return {query.Query<T>} The resulting Query
+   */
+  descending(field) {
+    return this._addOrder(field, -1);
+  }
+
+  /**
+   * Sets the sort of the query and discard all existing paramaters
+   * @param {Object} sort The new sort of the query
+   * @return {query.Query<T>} The resulting Query
+   *
+   * @see http://docs.mongodb.org/manual/reference/method/cursor.sort/
+   */
+  sort(sort) {
+    if (!(sort instanceof Object) || Object.getPrototypeOf(sort) != Object.prototype)
+      throw new Error('sort must be an object.');
+
+    return this._addOrder(sort);
+  }
+
+  /**
+   * Sets the offset of the query, i.e. how many elements should be skipped
+   * @param {number} offset The offset of this query
+   * @return {query.Query<T>} The resulting Query
+   *
+   * @see http://docs.mongodb.org/manual/reference/method/cursor.skip/
+   */
+  offset(offset) {
+    if (offset < 0)
+      throw new Error("The offset can't be nagative.");
+
+    return this._addOffset(offset);
+  }
+
+  /**
+   * Sets the limit of this query, i.e hox many objects should be returnd
+   * @param {number} limit The limit of this query
+   * @return {query.Query<T>} The resulting Query
+   *
+   * @see http://docs.mongodb.org/manual/reference/method/cursor.limit/
+   */
+  limit(limit) {
+    if (limit < 0)
+      throw new Error("The limit can't be nagative.");
+
+    return this._addLimit(limit);
+  }
+
+  /**
+   * Execute the query and return the query results as a List.
+   * Note: All local unsaved changes on matching objects, will be discarded.
+   * @param {Object} [options] The query options
+   * @param {number|boolean} [options.depth=0] The object depth which will be loaded. Depth 0 load only the found
+   * objects, <code>true</code> loads the objects by reachability.
+   * @param {query.Query~resultListCallback=} doneCallback Called when the operation succeed.
+   * @param {query.Query~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<Array<T>>} A promise that will be resolved with the query result as a list
+   */
+  resultList(options, doneCallback, failCallback) {}
+
+  /**
+   * Execute the query and return the query results as a List.
+   * Note: All local unsaved changes on matching objects, will be discarded.
+   * @param {query.Query~resultListCallback=} doneCallback Called when the operation succeed.
+   * @param {query.Query~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<Array<T>>} A promise that will be resolved with the query result as a list
+   * @name resultList
+   * @memberOf query.Query<T>.prototype
+   * @method
+   */
+
+  /**
+   * Execute the query that returns a single result.
+   * Note: All local unsaved changes on the matched object, will be discarded.
+   * @param {Object} [options] The query options
+   * @param {number|boolean} [options.depth=0] The object depth which will be loaded. Depth 0 load only the found
+   * object, <code>true</code> loads the objects by reachability.
+   * @param {query.Query~singleResultCallback=} doneCallback Called when the operation succeed.
+   * @param {query.Query~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<T>} A promise that will be resolved with the query result as a single result
+   */
+  singleResult(options, doneCallback, failCallback) {}
+
+  /**
+   * Execute the query that returns a single result.
+   * Note: All local unsaved changes on the matched object, will be discarded.
+   * @param {query.Query~singleResultCallback=} doneCallback Called when the operation succeed.
+   * @param {query.Query~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<T>} A promise that will be resolved with the query result as a single result
+   * @name singleResult
+   * @memberOf query.Query<T>.prototype
+   * @method
+   */
+
+  /**
+   * Returns an RxJS observable that receives events for streaming query.
+   * @param {Object} [options] options on whether an initial result and what kind of events (w.r.t. match types and operations) are requested
+   * @param {boolean} [options.initial=true] whether or not you want to receive the initial result set (i.e. the entities matching the query at subscription time)
+   * @param {(string|Array<string>)} [options.matchTypes=['all']] the match types you are interested in; accepts the default ('all'/['all']) or any combination of 'match', 'add', 'change', 'changeIndex' and 'remove'
+   * @param {(string|Array<string>)} [options.operations=['any']] the operations you are interested in; accepts the default ('any'/['any']) or any combination of 'insert', 'update', 'delete' and 'none'
+   * @return {Observable<StreamingEvent<T>>} an RxJS observable
+   */
+  stream(options) {}
+
+  /**
+   * Execute the query that returns the matching objects count.
+   * @param {query.Query~countCallback=} doneCallback Called when the operation succeed.
+   * @param {query.Query~failCallback=} failCallback Called when the operation failed.
+   * @return {Promise<number>} The total number of matched objects
+   */
+  count(doneCallback, failCallback) {}
+}
+
+Query.MAX_URI_SIZE = 2000;
+
+Query.varargs = function varargs(offset, args) {
+  return Array.prototype.concat.apply([], Array.prototype.slice.call(args, offset));
+};
+
+module.exports = Query;
+
+/**
+ * The resultList callback is called, when the asynchronous query operation completes successfully
+ * @callback query.Query~resultListCallback
+ * @param {Array<T>} result The query result list, an empty list if no match was found
+ * @return {Promise<*>|*} A Promise, result or undefined
+ */
+
+/**
+ * The singleResult callback is called, when the asynchronous query operation completes successfully
+ * @callback query.Query~singleResultCallback
+ * @param {T} entity The matching object or null id no matching object was found
+ * @return {Promise<*>|*} A Promise, result or undefined
+ */
+
+/**
+ * The count callback is called, when the asynchronous query operation completes successfully
+ * @callback query.Query~countCallback
+ * @param {number} count the matching object count
+ * @return {Promise<*>|*} A Promise, result or undefined
+ */
+
+/**
+ * The fail callback is called, when the asynchronous query operation is rejected by an error
+ * @callback query.Query~failCallback
+ * @param {error.PersistentError} error The error which reject the operation
+ * @return {Promise<*>|*} A Promise, result or undefined
+ */
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_query_StreamingEvent.js.html b/doc/lib_query_StreamingEvent.js.html new file mode 100644 index 00000000..558e0cba --- /dev/null +++ b/doc/lib_query_StreamingEvent.js.html @@ -0,0 +1,385 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/query/StreamingEvent.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/query/StreamingEvent.js

+ + + + + + +
+
+
/**
+ * An event for a streaming query.
+ *
+ * @class
+ * @name StreamingEvent<T>
+ */
+
+/**
+ * the query on which .stream([options]) was invoked
+ *
+ * @memberOf StreamingEvent<T>.prototype
+ * @name target
+ * @type {query.Node<T>}
+ */
+
+/**
+ * the database entity this event was generated for, e.g. an entity that just entered or left the result set
+ *
+ * @memberOf StreamingEvent<T>.prototype
+ * @name data
+ * @type {T}
+ */
+
+/**
+ * the operation by which the entity was altered ('insert', 'update' or 'delete'; 'none' if unknown or not applicable)
+ *
+ * @memberOf StreamingEvent<T>.prototype
+ * @name operation
+ * @type {string}
+ */
+
+/**
+ * indicates how the transmitted entity relates to the query result.
+ Every event is delivered with one of the following match types:
+ <ul>
+ <li> 'match': the entity matches the query. </li>
+ <li> 'add': the entity entered the result set, i.e. it did not match before and is matching now. </li>
+ <li> 'change': the entity was updated, but remains a match </li>
+ <li> 'changeIndex' (for sorting queries only): the entity was updated and remains a match, but changed its position within the query result </li>
+ <li> 'remove': the entity was a match before, but is not matching any longer </li>
+ </ul>
+ * @memberOf StreamingEvent<T>.prototype
+ * @name matchType
+ * @type {string}
+ */
+
+/**
+ * a boolean value indicating whether this event reflects the matching status at query time (true) or a recent change data change (false)
+ *
+ * @memberOf StreamingEvent<T>.prototype
+ * @name initial
+ * @type {boolean}
+ */
+
+/**
+ * for sorting queries only: the position of the matching entity in the ordered result (-1 for non-matching entities)
+ *
+ * @memberOf StreamingEvent<T>.prototype
+ * @name index
+ * @type {number}
+ */
+
+/**
+ * server-time from the instant at which the event was generated
+ *
+ * @memberOf StreamingEvent<T>.prototype
+ * @name date
+ * @type {Date}
+ */
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_query_index.js.html b/doc/lib_query_index.js.html new file mode 100644 index 00000000..d95f9694 --- /dev/null +++ b/doc/lib_query_index.js.html @@ -0,0 +1,327 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/query/index.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/query/index.js

+ + + + + + +
+
+
/**
+ * @namespace query
+ */
+
+exports.Builder = require('./Builder');
+exports.Condition = require('./Condition');
+exports.Filter = require('./Filter');
+exports.Node = require('./Node');
+exports.Operator = require('./Operator');
+exports.Query = require('./Query');
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_Code.js.html b/doc/lib_util_Code.js.html new file mode 100644 index 00000000..90b0c024 --- /dev/null +++ b/doc/lib_util_Code.js.html @@ -0,0 +1,455 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/Code.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/Code.js

+ + + + + + +
+
+
"use strict";
+var message = require('../message');
+var StatusCode = require('../connector/Message').StatusCode;
+
+/**
+ * @alias util.Code
+ * @param {metamodel.Metamodel} metamodel
+ */
+class Code {
+
+  constructor(metamodel, entityManagerFactory) {
+    /**
+     * @private
+     * @type metamodel.Metamodel
+     */
+    this._metamodel = metamodel;
+    /** @type EntityManagerFactory */
+    this.entityManagerFactory = entityManagerFactory;
+  }
+
+  /**
+   * Converts the given function to a string
+   * @param {Function} fn The JavaScript function to serialize
+   * @return {string} The serialized function
+   */
+  functionToString(fn) {
+    if(!fn)
+      return "";
+
+    var str = fn.toString();
+    str = str.substring(str.indexOf("{") + 1, str.lastIndexOf("}"));
+    if (str.charAt(0) == '\n')
+      str = str.substring(1);
+
+    if (str.charAt(str.length - 1) == '\n')
+      str = str.substring(0, str.length - 1);
+
+    return str;
+  }
+
+  /**
+   * Converts the given string to a module wrapper function
+   * @param {Array<string>} signature The expected parameters of the function
+   * @param {string} code The JavaScript function to deserialize
+   * @return {Function} The deserialized function
+   */
+  stringToFunction(signature, code) {
+    return new Function(signature, code);
+  }
+
+  /**
+   * Loads a list of all available modules
+   * Does not include handlers
+   *
+   * @returns {Promise<Array<string>>}
+   */
+  loadModules() {
+    var msg = new message.GetAllModules();
+    return this.entityManagerFactory.send(msg).then((response) => {
+      return response.entity;
+    });
+  }
+
+  /**
+   * Loads Baqend code which will be identified by the given bucket and code codeType
+   *
+   * @param {metamodel.ManagedType|string} type The entity type for the handler or the Name of the
+   * Baqend code
+   * @param {string} codeType The type of the code
+   * @param {boolean} [asFunction=false] set it to <code>true</code>, to parse the code as a function and return it
+   * instead of a string
+   * @returns {Promise<string|Function>} The code as string or as a parsed function
+   */
+  loadCode(type, codeType, asFunction) {
+    var bucket = Object(type) instanceof String? type: type.name;
+    var msg = new message.GetBaqendCode(bucket, codeType)
+      .responseType('text');
+
+    return this.entityManagerFactory.send(msg).then((response) => {
+      return this._parseCode(bucket, codeType, asFunction, response.entity);
+    }, function(e) {
+      if (e.status == StatusCode.OBJECT_NOT_FOUND)
+        return null;
+
+      throw e;
+    });
+  }
+
+  /**
+   * Saves Baqend code which will be identified by the given bucket and code type
+   *
+   * @param {metamodel.ManagedType|string} type The entity type for the handler or the Name of the
+   * Baqend code
+   * @param {string} codeType The type of the code
+   * @param {string|Function} fn Baqend code as a string or function
+   * @return {Promise<string|Function>} The stored code as a string or as a parsed function
+   */
+  saveCode(type, codeType, fn) {
+    var bucket = Object(type) instanceof String? type: type.name;
+    var asFunction = fn instanceof Function;
+
+    var msg = new message.SetBaqendCode(bucket, codeType)
+        .entity(asFunction? this.functionToString(fn): fn, 'text')
+        .responseType('text');
+
+    return this.entityManagerFactory.send(msg).then((response) => {
+      return this._parseCode(bucket, codeType, asFunction, response.entity);
+    });
+  }
+
+  /**
+   * Deletes Baqend code identified by the given bucket and code type
+   *
+   * @param {metamodel.ManagedType|string} type The entity type for the handler or the Name of the
+   * Baqend code
+   * @param {string} codeType The type of the code
+   * @returns {Promise<*>} succeed if the code was deleted
+   */
+  deleteCode(type, codeType) {
+    var bucket = Object(type) instanceof String? type: type.name;
+    var msg = new message.DeleteBaqendCode(bucket, codeType);
+    return this.entityManagerFactory.send(msg).then(() => {
+      return this._parseCode(bucket, codeType, false, null);
+    });
+  }
+
+  _parseCode(bucket, codeType, asFunction, code) {
+    if (codeType == 'validate') {
+      var type = this._metamodel.entity(bucket);
+      type.validationCode = code;
+      return asFunction? type.validationCode: code;
+    } else {
+      return asFunction? this.stringToFunction(['module', 'exports'], code): code;
+    }
+  }
+}
+
+module.exports = Code;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_Lockable.js.html b/doc/lib_util_Lockable.js.html new file mode 100644 index 00000000..8bfdc02f --- /dev/null +++ b/doc/lib_util_Lockable.js.html @@ -0,0 +1,421 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/Lockable.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/Lockable.js

+ + + + + + +
+
+
"use strict";
+
+/**
+ * This base class provides an lock interface to execute exclusive operations
+ * @alias util.Lockable
+ */
+class Lockable {
+
+  constructor() {
+    /**
+     * Indicates if there is currently an onging exclusive operation
+     * @type boolean
+     * @private
+     */
+    this._isLocked = false;
+
+    /**
+     * A promise which represents the state of the least exclusive operation
+     * @type Promise
+     * @private
+     */
+    this._readyPromise = Promise.resolve(this);
+
+    /**
+     * A deferred used to explicit lock and unlock this instance
+     * @private
+     */
+    this._deferred = null;
+  }
+
+  /**
+   * Indicates if there is currently no exclusive operation executed
+   * <code>true</code> If no exclusive lock is hold
+   * @type {boolean}
+   */
+  get isReady() {
+    return !this._isLocked;
+  }
+
+  /**
+   * Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled
+   * @param {util.Lockable~callback=} doneCallback The callback which will be invoked when the previously
+   * operations on this object is completed.
+   * @param {util.Lockable~callback=} failCallback When the lock can't be released caused by a none
+   * recoverable error
+   * @return {Promise<util.Lockable>} A promise which completes successfully, when the previously requested
+   * operation completes
+   */
+  ready(doneCallback, failCallback) {
+    return this._readyPromise.then(doneCallback, failCallback);
+  }
+
+  /**
+   * Try to aquire an exclusive lock and executes the given callback.
+   * @param {util.Lockable~callback} callback The exclusive operation to execute
+   * @param {boolean} [critical=false] Indicates if the operation is critical. If the operation is critical and the
+   * operation fails, then the lock will not be released
+   * @return {Promise<util.Lockable>} A promise
+   * @throws {Error} If the lock can't be aquired
+   * @protected
+   */
+  withLock(callback, critical) {
+    if(this._isLocked)
+      throw new Error('Current operation has not been finished.');
+
+    var self = this;
+    try {
+      this._isLocked = true;
+      var result = callback().then(function(result) {
+        self._isLocked = false;
+        return result;
+      }, function(e) {
+        if (!critical)
+          self._isLocked = false;
+        throw e;
+      });
+
+      this._readyPromise = result.then(function() {
+        return self;
+      }, function(e) {
+        if (!critical)
+          return self;
+        throw e;
+      });
+
+      return result;
+    } catch (e) {
+      if (critical) {
+        this._readyPromise = Promise.reject(e);
+      } else {
+        this._isLocked = false;
+      }
+      throw e;
+    }
+  }
+}
+
+module.exports = Lockable;
+
+/**
+ * The operation callback is used by the {@link util.Lockable#withLock} method,
+ * to perform an exclusive operation on the 
+ * @callback util.Lockable~callback
+ * @return {Promise<*>} A Promise, which reflects the result of the operation
+ */
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_Logger.js.html b/doc/lib_util_Logger.js.html new file mode 100644 index 00000000..5a56a05e --- /dev/null +++ b/doc/lib_util_Logger.js.html @@ -0,0 +1,596 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/Logger.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/Logger.js

+ + + + + + +
+
+
"use strict";
+
+var message = require('../message');
+var StatusCode = require('../connector/Message').StatusCode;
+
+/**
+ * @alias util.Logger
+ */
+class Logger {
+
+  static create(entityManager) {
+    var proto = this.prototype;
+
+    function Logger() {
+      proto.log.apply(Logger, arguments);
+    }
+
+    for (let key of Object.getOwnPropertyNames(proto))
+      Object.defineProperty(Logger, key, Object.getOwnPropertyDescriptor(proto, key));
+
+    Logger._init(entityManager);
+
+    return Logger;
+  }
+
+  /**
+   * The log level which will be logged
+   *
+   * The log level can be one of 'trace', 'debug', 'info', 'warn', 'error'
+   * @type string
+   */
+  get level() {
+    return Logger.LEVELS[this.levelIndex];
+  }
+
+  /**
+   * Sets the log level which will be logged
+   * @param {string} value
+   */
+  set level(value) {
+    var index = Logger.LEVELS.indexOf(value);
+    if (index == -1)
+      throw new Error("Unknown logging level " + value);
+
+    this.levelIndex = index;
+  }
+
+  /**
+   * Logs a message in the default level 'info'
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will
+   * be included in the log entry
+   *
+   * @name log
+   * @memberOf util.Logger.prototype
+   * @function
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Logs a message in the default level 'info'
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {Object<string, *>} [data=null] An optional object which will be included in the log entry
+   *
+   * @name log
+   * @memberOf util.Logger.prototype
+   * @function
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Logs a message with the given log level
+   * @param {string} level The level used to log the message
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will
+   * be included in the log entry
+   * @name log
+   * @memberOf util.Logger.prototype
+   * @function
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Logs a message with the given log level
+   * @param {string} level The level used to log the message
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {Object<string, *>} [data=null] An optional object which will be included in the log entry
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+  log(level, message, data) {
+    var args = Array.prototype.slice.call(arguments);
+
+    if (Logger.LEVELS.indexOf(args[0]) == -1) {
+      level = 'info';
+    } else {
+      level = args.shift();
+    }
+
+    if (this.levelIndex > Logger.LEVELS.indexOf(level))
+      return;
+
+    message = typeof args[0] === 'string'? this._format(args.shift(), args): '[no message]';
+    data = null;
+    if (args.length && typeof args[args.length - 1] === 'object') {
+      data = args.pop();
+      if (Array.isArray(data))
+        data = {data: data};
+    }
+
+    if (args.length) {
+      message += ", " + args.join(", ");
+    }
+
+    return this._log({
+      date: new Date(),
+      message: message,
+      level: level,
+      user: this.entityManager.me && this.entityManager.me.id,
+      data: data
+    });
+  }
+
+  _format(f, args) {
+    if (args.length == 0)
+      return f;
+
+    var str = String(f).replace(Logger.FORMAT_REGEXP, function(x) {
+      if (x === '%%') return '%';
+      if (!args.length) return x;
+      switch (x) {
+        case '%s':
+          return String(args.shift());
+        case '%d':
+          return Number(args.shift());
+        case '%j':
+          try {
+            return JSON.stringify(args.shift());
+          } catch (_) {
+            return '[Circular]';
+          }
+        default:
+          return x;
+      }
+    });
+
+    return str;
+  }
+
+  _init(entityManager) {
+    /** @type EntityManager */
+    this.entityManager = entityManager;
+    this.levelIndex = 2;
+
+    Logger.LEVELS.forEach((level) => {
+      this[level] = this.log.bind(this, level);
+    });
+  }
+
+  _log(json) {
+    if (!this.entityManager.isReady) {
+      return this.entityManager.ready(this._log.bind(this, json));
+    } else {
+      return this.entityManager.send(new message.CreateObject('logs.AppLog', json));
+    }
+  }
+
+  /**
+   * Log message at trace level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will
+   * be included in the log entry
+   * @function trace
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Log message at trace level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {Object<string, *>} [data=null] An optional object which will be included in the log entry
+   * @function trace
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Log message at debug level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will
+   * be included in the log entry
+   * @function debug
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Log message at debug level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {Object<string, *>} [data=null] An optional object which will be included in the log entry
+   * @function debug
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Log message at info level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will
+   * be included in the log entry
+   * @function info
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Log message at info level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {Object<string, *>} [data=null] An optional object which will be included in the log entry
+   * @function info
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Log message at warn level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will
+   * be included in the log entry
+   * @function warn
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Log message at warn level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {Object<string, *>} [data=null] An optional object which will be included in the log entry
+   * @function warn
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Log message at error level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {...*} args The arguments used to interpolated the message string. The last param can be object which will
+   * be included in the log entry
+   * @function error
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+
+  /**
+   * Log message at error level
+   * @param {string} message The message to log, the message string can be interpolated like the node util.format method
+   * @param {Object<string, *>} [data=null] An optional object which will be included in the log entry
+   * @function error
+   * @memberOf util.Logger.prototype
+   *
+   * @see https://nodejs.org/api/util.html#util_util_format_format
+   */
+}
+
+Object.assign(Logger, {
+  LEVELS: ['trace', 'debug', 'info', 'warn', 'error'],
+  FORMAT_REGEXP: /%[sdj%]/g
+});
+
+module.exports = Logger;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_Metadata.js.html b/doc/lib_util_Metadata.js.html new file mode 100644 index 00000000..2e5338c8 --- /dev/null +++ b/doc/lib_util_Metadata.js.html @@ -0,0 +1,619 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/Metadata.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/Metadata.js

+ + + + + + +
+
+
"use strict";
+
+var error = require('../error');
+var Acl = require('../Acl');
+var Lockable = require('./Lockable');
+var binding = require('../binding');
+
+/**
+ * @alias util.Metadata
+ * @extends util.Lockable
+ */
+class Metadata extends Lockable {
+
+  static create(type, object) {
+    var metadata;
+    if (type.isEntity) {
+      metadata = new Metadata(object, type);
+    } else if (type.isEmbeddable) {
+      metadata = {
+        type: type,
+        readAccess() {
+          var metadata = this._root && this._root._metadata;
+          if (metadata)
+            metadata.readAccess();
+        },
+        writeAccess() {
+          var metadata = this._root && this._root._metadata;
+          if (metadata)
+            metadata.writeAccess();
+        }
+      };
+    } else {
+      throw new Error('Illegal type ' + type);
+    }
+
+    return metadata;
+  }
+
+  /**
+   * Returns the metadata of the managed object
+   * @param {binding.Managed} managed
+   * @return {util.Metadata}
+   */
+  static get(managed) {
+    return managed._metadata;
+  }
+
+  /**
+   * @type EntityManager
+   */
+  get db() {
+    if(this._db)
+      return this._db;
+
+    return this._db = require('../baqend');
+  }
+
+  /**
+   * @param db {EntityManager}
+   */
+  set db(db) {
+    if(!this._db) {
+      this._db = db;
+    } else {
+      throw new Error("DB has already been set.")
+    }
+  }
+
+  /**
+   * @type string
+   */
+  get bucket() {
+    return this.type.name;
+  }
+
+  /**
+   * @type string
+   */
+  get key() {
+    if (!this._key && this.id) {
+      var index = this.id.lastIndexOf('/');
+      this._key = decodeURIComponent(this.id.substring(index + 1));
+    }
+    return this._key;
+  }
+
+  /**
+   * @param {string} value
+   */
+  set key(value) {
+    value += '';
+
+    if (this.id)
+      throw new Error('The id can\'t be set twice.');
+
+    this.id = '/db/' + this.bucket + '/' + encodeURIComponent(value);
+    this._key = value;
+  }
+
+  /**
+   * Indicates if this object already belongs to an db
+   * <code>true</code> if this object belongs already to an db otherwise <code>false</code>
+   * @type boolean
+   */
+  get isAttached() {
+    return !!this._db;
+  }
+
+  /**
+   * Indicates if this object is represents a db object, but was not loaded up to now
+   * @type boolean
+   */
+  get isAvailable() {
+    return this._state > Metadata.Type.UNAVAILABLE;
+  }
+
+  /**
+   * Indicates if this object represents the state of the db and was not modified in any manner
+   * @type boolean
+   */
+  get isPersistent() {
+    return this._state == Metadata.Type.PERSISTENT;
+  }
+
+  /**
+   * Indicates that this object was modified and the object was not written back to the db
+   * @type boolean
+   */
+  get isDirty() {
+    return this._state == Metadata.Type.DIRTY;
+  }
+
+  /**
+   * @param {binding.Entity} entity
+   * @param {metamodel.ManagedType} type
+   */
+  constructor(entity, type) {
+    super();
+
+    /**
+     * @type binding.Entity
+     * @private
+     */
+    this._root = entity;
+    this._state = Metadata.Type.DIRTY;
+    this._enabled = true;
+    this.persisting = false;
+    /** @type string */
+    this.id = null;
+    /** @type number */
+    this.version = null;
+    /** @type metamodel.ManagedType */
+    this.type = type;
+    /** @type Acl */
+    this.acl = new Acl(this);
+  }
+
+  /**
+   * Signals that the object will be access by a read access
+   * Ensures that the object was loaded already
+   */
+  readAccess() {
+    if (this._enabled) {
+      if (!this.isAvailable) {
+        throw new error.PersistentError('This object ' + this.id + ' is not available.');
+      }
+    }
+  }
+
+  /**
+   * Signals that the object will be access by a write access
+   * Ensures that the object was loaded already and marks the object as dirty
+   */
+  writeAccess() {
+    if (this._enabled) {
+      if (!this.isAvailable) {
+        throw new error.PersistentError('This object ' + this.id + ' is not available.');
+      }
+
+      this.setDirty();
+    }
+  }
+
+  /**
+   * Indicates that the associated object isn't available
+   */
+  setUnavailable() {
+    this._state = Metadata.Type.UNAVAILABLE;
+  }
+
+  /**
+   * Indicates that the associated object isn't stale, i.e.
+   * the object correlate the database state and is not modified by the user
+   */
+  setPersistent() {
+    this._state = Metadata.Type.PERSISTENT;
+  }
+
+  /**
+   * Indicates the the object is modified by the user
+   */
+  setDirty() {
+    this._state = Metadata.Type.DIRTY;
+  }
+
+  /**
+   * Indicates the the object is removed
+   */
+  setRemoved() {
+    //mark the object only as dirty if it was already available
+    if (this.isAvailable) {
+      this.setDirty();
+      this.version = null;
+    }
+  }
+
+  getJsonMetadata() {
+    var info = {};
+
+    if (this.id) {
+      info.id = this.id;
+    }
+
+    if (this.version) {
+      info.version = this.version;
+    }
+
+    info.acl = this.acl;
+
+    return info;
+  }
+
+  /**
+   * Sets the object metadata from the object
+   * @param {Object} json
+   */
+  setJsonMetadata(json) {
+    if (!this.id) {
+      this.id = json.id;
+    }
+
+    if(json.version)
+      this.version = json.version;
+
+    this.acl.fromJSON(json.acl || {});
+  }
+
+  /**
+   * Converts the object to an JSON-Object
+   * @param {boolean} [excludeMetadata=false]
+   * @param {boolean} [persisting=false] indicates if the current state will be persisted.
+   *  Used to update the internal change tracking state of collections and mark the object persistent if its true
+   * @returns {json} JSON-Object
+   */
+  getJson(excludeMetadata, persisting) {
+    this._enabled = false;
+    this.persisting = !!persisting;
+    var json = this.type.toJsonValue(this, this._root, true);
+    this._enabled = true;
+    this.persisting = false;
+
+    if (this.isAttached && !excludeMetadata) {
+      Object.assign(json, this.getJsonMetadata());
+    }
+
+    return json;
+  }
+
+  /**
+   * Sets the object content from json
+   * @param {json} json The updated json content
+   * @param {boolean} [persisting=false] indicates if the current state will be persisted.
+   *  Used to update the internal change tracking state of collections and mark the object persistent or dirty afterwards
+   */
+  setJson(json, persisting) {
+    if (json.id || json.version || json.acl) {
+      this.setJsonMetadata(json);
+    }
+
+    this._enabled = false;
+    this.persisting = !!persisting;
+    this.type.fromJsonValue(this, json, this._root, true);
+    this._enabled = true;
+    this.persisting = false;
+
+    if (persisting) {
+      this.setPersistent();
+    } else {
+      this.setDirty();
+    }
+  }
+}
+
+/**
+ * @enum {number}
+ */
+Metadata.Type = {
+  UNAVAILABLE: -1,
+  PERSISTENT: 0,
+  DIRTY: 1
+};
+
+module.exports = Metadata;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_Modules.js.html b/doc/lib_util_Modules.js.html new file mode 100644 index 00000000..3364f4ef --- /dev/null +++ b/doc/lib_util_Modules.js.html @@ -0,0 +1,419 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/Modules.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/Modules.js

+ + + + + + +
+
+
"use strict";
+
+var message = require('../message');
+
+/**
+ * @alias util.Modules
+ */
+class Modules {
+
+  /**
+   * @param {EntityManager} entityManager
+   * @param {connector.Connector} connector
+   */
+  constructor(entityManager, connector) {
+    /**
+     * @type EntityManager
+     */
+    this._entityManager = entityManager;
+    /**
+     * The connector used for requests
+     * @type connector.Connector
+     */
+    this._connector = connector;
+  }
+
+  /**
+   * Calls the module, which is identified by the given bucket.
+   * The optional query parameter will be attached as GET-parameters.
+   *
+   * @param {string} bucket Name of the module
+   * @param {Object|string=} query GET-Parameter as key-value-pairs or query string
+   * @param {Object=} options Additional request options
+   * @param {string=} options.responseType The type used to provide the response data, defaults to text oder json depends
+   *    on the received data, can be one of arraybuffer, blob, json, text, base64, data-url
+   * @param {Function=} doneCallback
+   * @param {Function=} failCallback
+   * @returns {Promise<Object>}
+   */
+  get(bucket, query, options, doneCallback, failCallback) {
+    if (query instanceof Function) {
+      failCallback = options;
+      doneCallback = query;
+      options = {};
+      query = null;
+    }
+
+    if (options instanceof Function) {
+      failCallback = doneCallback;
+      doneCallback = options;
+      options = {};
+    }
+
+    options = options || {};
+
+    var msg = new message.GetBaqendModule(bucket)
+      .addQueryString(query)
+      .responseType(options.responseType || null);
+
+    return this._send(msg, doneCallback, failCallback);
+  }
+
+  /**
+   * Calls the module, which is identified by the given bucket.
+   *
+   * @param {string} bucket Name of the module
+   * @param body {string|Blob|File|ArrayBuffer|FormData|json=} The POST-body data to send
+   * @param {Object=} options Additional request options
+   * @param {string=} options.requestType A optional type hint used to correctly interpret the provided data, can be one of
+   *    arraybuffer, blob, json, text, base64, data-url, form
+   * @param {string=} options.mimeType The mimType of the body. Defaults to the mimeType of the provided data if
+   * it is a file object, blob or data-url
+   * @param {string=} options.responseType The type used to provide the response data, defaults to text oder json depends
+   *    on the received data, can be one of arraybuffer, blob, json, text, base64, data-url
+   * @param {Function=} doneCallback
+   * @param {Function=} failCallback
+   * @returns {Promise<Object>}
+   */
+  post(bucket, body, options, doneCallback, failCallback) {
+    if (options instanceof Function) {
+      failCallback = doneCallback;
+      doneCallback = options;
+      options = {};
+    }
+
+    options = options || {};
+
+    var msg = new message.PostBaqendModule(bucket)
+      .entity(body, options.requestType)
+      .mimeType(options.mimeType || null)
+      .responseType(options.responseType || null);
+
+    return this._send(msg, doneCallback, failCallback);
+  }
+
+  _send(msg, doneCallback, failCallback) {
+    return this._entityManager.send(msg).then((response) => {
+      return response.entity;
+    }).then(doneCallback, failCallback);
+  }
+}
+
+module.exports = Modules;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_Permission.js.html b/doc/lib_util_Permission.js.html new file mode 100644 index 00000000..e8304ea7 --- /dev/null +++ b/doc/lib_util_Permission.js.html @@ -0,0 +1,509 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/Permission.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/Permission.js

+ + + + + + +
+
+
"use strict";
+
+/**
+ * @alias util.Permission
+ */
+class Permission {
+
+  /**
+   * Creates a new Permission object, with an empty rule set
+   * @param {util.Metadata} metadata The metadata of the object
+   */
+  constructor(metadata) {
+    /** @type {Object.<string, string>} */
+    this._rules = {};
+    /** @type util.Metadata */
+    this._metadata = metadata;
+  }
+
+  /**
+   * Returns a list of user and role references of all rules
+   * @return {Array<string>} a list of references
+   */
+  allRules() {
+    return Object.keys(this._rules);
+  }
+
+  /**
+   * Removes all rules from this permission object
+   */
+  clear() {
+    this._metadata && this._metadata.writeAccess();
+    this._rules = {};
+  }
+
+  /**
+   * Copies permissions from another permission object
+   * @param {util.Permission} permission The permission to copy from
+   * @return {util.Permission}
+   */
+  copy(permission) {
+    this._metadata && this._metadata.writeAccess();
+    this._rules = Object.assign({}, permission._rules);
+    return this;
+  }
+
+  /**
+   * Gets whenever all users and roles have the permission to perform the operation
+   * @return {boolean} <code>true</code> If public access is allowed
+   */
+  isPublicAllowed() {
+    if ('*' in this._rules)
+      return false;
+
+    for (let ref in this._rules) {
+      if (this._rules[ref] == 'allow') {
+        return false;
+      }
+    }
+
+    return true;
+  }
+
+  /**
+   * Sets whenever all users and roles should have the permission to perform the operation.
+   * Note: All other allow rules will be removed.
+   */
+  setPublicAllowed() {
+    this._metadata && this._metadata.writeAccess();
+    for (var ref in this._rules) {
+      if (this._rules[ref] == 'allow') {
+        delete this._rules[ref];
+      }
+    }
+  }
+
+  /**
+   * Returns the actual rule of the given user or role.
+   * @param {model.User|model.Role|string} userOrRole The user or role to check for
+   * @return {string} The actual access rule or undefined if no rule was found
+   */
+  getRule(userOrRole) {
+    return this._rules[this._getRef(userOrRole)];
+  }
+
+  /**
+   * Checks whenever the user or role is explicit allowed to perform the operation.
+   *
+   * @param {model.User|model.Role|string} userOrRole The user or role to check for
+   */
+  isAllowed(userOrRole) {
+    return this._rules[this._getRef(userOrRole)] == 'allow';
+  }
+
+  /**
+   * Checks whenever the user or role is explicit denied to perform the operation.
+   *
+   * @param {model.User|model.Role|string} userOrRole The user or role to check for
+   */
+  isDenied(userOrRole) {
+    return this._rules[this._getRef(userOrRole)] == 'deny';
+  }
+
+  /**
+   * Allows the given users or rules to perform the operation
+   * @param {...(model.User|model.Role|string)} userOrRole The users or roles to allow
+   * @return {util.Permission} this permission object
+   */
+  allowAccess(userOrRole) {
+    const rules = arguments;
+    this._metadata && this._metadata.writeAccess();
+    for (let i = 0; i < rules.length; i++) {
+      this._rules[this._getRef(rules[i])] = 'allow';
+    }
+    return this;
+  }
+
+  /**
+   * Denies the given users or rules to perform the operation
+   * @param {...(model.User|model.Role|string)} userOrRole The users or roles to deny
+   * @return {util.Permission} this permission object
+   */
+  denyAccess(userOrRole) {
+    const rules = arguments;
+    this._metadata && this._metadata.writeAccess();
+    for (let i = 0; i < rules.length; i++) {
+      this._rules[this._getRef(rules[i])] = 'deny';
+    }
+    return this;
+  }
+
+  /**
+   * Deletes any allow/deny rules for the given users or roles
+   * @param {...(model.User|model.Role|string)} userOrRole The users or roles to delete rules for
+   * @return {util.Permission} this permission object
+   */
+  deleteAccess(userOrRole) {
+    const rules = arguments;
+    this._metadata && this._metadata.writeAccess();
+    for (let i = 0; i < rules.length; i++) {
+      delete this._rules[this._getRef(rules[i])];
+    }
+    return this;
+  }
+
+  /**
+   * A Json representation of the set of rules
+   * @return {json}
+   */
+  toJSON() {
+    return this._rules;
+  }
+
+  /**
+   * Sets the permission rules from json
+   * @param {json} json The permission json representation
+   */
+  fromJSON(json) {
+    this._rules = json;
+  }
+
+  /**
+   * Creates a permission from the given rules.
+   * @param {json} json The rules.
+   * @return {util.Permission} The permission.
+   */
+  static fromJSON(json) {
+    var permission = new this();
+    permission.fromJSON(json);
+    return permission;
+  }
+
+  /**
+   * Resolves user and role references and validate given references
+   * @param {model.User|model.Role|string} userOrRole The user, role or reference
+   * @return {string} The resolved and validated reference
+   * @private
+   */
+  _getRef(userOrRole) {
+    if (typeof userOrRole !== 'string') {
+      userOrRole = userOrRole._metadata.id;
+    }
+
+    if (userOrRole.indexOf('/db/User/') == 0 || userOrRole.indexOf('/db/Role/') == 0) {
+      return userOrRole;
+    }
+
+    throw new TypeError('The given object isn\'t a user, role or a valid reference.');
+  }
+}
+
+Permission.BASE_PERMISSIONS = ['load', 'update', 'delete', 'query', 'insert'];
+module.exports = Permission;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_PushMessage.js.html b/doc/lib_util_PushMessage.js.html new file mode 100644 index 00000000..123c1748 --- /dev/null +++ b/doc/lib_util_PushMessage.js.html @@ -0,0 +1,413 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/PushMessage.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/PushMessage.js

+ + + + + + +
+
+
"use strict";
+
+var Entity = require('../binding/Entity');
+
+
+/**
+ * @alias util.PushMessage
+ */
+class PushMessage {
+
+  /**
+   * Push message will be used to send a push notification to a set of devices
+   *
+   * @param {Set<binding.Entity>|Array<binding.Entity>} [devices] The Set of device references which
+   * will receive this push notification.
+   * @param {string=} message The message of the push notification.
+   * @param {string=} subject The subject of the push notification.
+   * @param {string=} sound The file reference of the sound file as a string. The device uses this file as the
+   * notification sound.
+   * @param {number=} badge The badge count.
+   * @param {Object=} data The data object which can contain additional information.
+   */
+  constructor(devices, message, subject, sound, badge, data) {
+    /**
+     * Set of devices
+     * @type Set<binding.Entity>
+     */
+    this.devices = null;
+
+    if (devices instanceof Set) {
+      this.devices = devices;
+    } else if(!devices || devices[Symbol.iterator]) {
+      this.devices = new Set(devices);
+    } else if (devices instanceof Entity) {
+      this.devices = new Set();
+      this.devices.add(devices);
+    } else {
+      throw new Error("Only Sets, Lists and Arrays can be used as devices.")
+    }
+
+    /**
+     * push notification message
+     * @type string
+     */
+    this.message = message;
+
+    /**
+     * push notification subject
+     * @type string
+     */
+    this.subject = subject;
+
+    /**
+     * push notification sound
+     * @type string
+     */
+    this.sound = sound;
+
+    /**
+     * badge count
+     * @type number
+     */
+    this.badge = badge;
+
+    /**
+     * data object
+     * @type json
+     */
+    this.data = data;
+  }
+
+  /**
+   * Adds a new object to the set of devices
+   *
+   * @param {binding.Entity} device will be added to the device set to receive the push notification
+   */
+  addDevice(device) {
+    if(!this.devices) {
+      this.devices = new Set();
+    }
+
+    this.devices.add(device);
+  }
+
+  toJSON() {
+    if(!this.devices || !this.devices.size)
+      throw new Error("Set of devices is empty.");
+
+    return Object.assign({}, this, {
+      devices: Array.from(this.devices, function(device) {
+        return device.id;
+      })
+    });
+  }
+}
+
+module.exports = PushMessage;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_TokenStorage.js.html b/doc/lib_util_TokenStorage.js.html new file mode 100644 index 00000000..90480bcc --- /dev/null +++ b/doc/lib_util_TokenStorage.js.html @@ -0,0 +1,486 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/TokenStorage.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/TokenStorage.js

+ + + + + + +
+
+
"use strict";
+
+const hmac = require('./util').hmac;
+
+/**
+ * @interface util.TokenStorageFactory
+ */
+
+/**
+ * Creates a new tokenStorage which persist tokens for the given origin
+ * @param {string} origin The origin where the token contains to
+ * @return {Promise<TokenStorage>} The initialized token storage
+ * @name create
+ * @memberOf util.TokenStorageFactory.prototype
+ * @method
+ */
+
+/**
+ * @alias util.TokenStorage
+ */
+class TokenStorage {
+  /**
+   * Get the stored token
+   * @returns {string} The token or undefined, if no token is available
+   */
+  get token() {
+    return this._token;
+  }
+
+  static create(origin) {
+    return Promise.resolve(new TokenStorage(origin));
+  }
+
+  /**
+   * @param {string} origin The origin where the token belongs to
+   * @param {string} token The initial token
+   * @param {boolean=} temporary If the token should be saved temporary or permanently
+   */
+  constructor(origin, token, temporary) {
+    /**
+     * The actual stored token
+     */
+    this._token = token || null;
+    this._origin = origin;
+    /**
+     * Indicates if the token should keep temporary only or should be persisted for later sessions
+     * @type boolean
+     */
+    this.temporary = temporary;
+  }
+
+  /**
+   * Use the underlying storage implementation to save the token
+   * @param {string} origin The origin where the token belongs to
+   * @param {string} token The initial token
+   * @param {boolean} temporary If the token should be saved temporary or permanently
+   * @protected
+   * @abstract
+   */
+  _saveToken(origin, token, temporary) {}
+
+  /**
+   * Update the token for the givin origin, the operation may be asynchronous
+   * @param {String} token The token to store or <code>null</code> to remove the token
+   */
+  update(token) {
+    this._token = token;
+    this._saveToken(this._origin, this._token, this.temporary);
+  }
+
+  /**
+   * Derived a resource token from the the stored origin token for the resource and signs the resource with the
+   * generated resource token
+   * @param {string} resource The resource which will be accessible with the returned token
+   * @returns {string} A resource token which can only be used to access the specified resource
+   */
+  signPath(resource) {
+    var token = this.token;
+    if (token) {
+      var data = token.substring(0, token.length - 40);
+      var sig = token.substring(data.length);
+
+      var path = resource.split('/').map(encodeURIComponent).join('/');
+      return path + '?BAT=' + (data + hmac(resource + data, sig));
+    }
+    return resource;
+  }
+}
+
+const tokens = {};
+/**
+ * @ignore
+ */
+class GlobalStorage extends TokenStorage {
+
+  static create(origin) {
+    return Promise.resolve(new GlobalStorage(origin, tokens[origin]));
+  }
+
+  /**
+   * @inheritDoc
+   */
+  _saveToken(origin, token, temporary) {
+    if (!temporary) {
+      if (token) {
+        tokens[origin] = token;
+      } else {
+        delete tokens[origin];
+      }
+    }
+  }
+}
+
+/**
+ * @alias util.TokenStorage.GLOBAL
+ * @type {util.TokenStorageFactory}
+ */
+TokenStorage.GLOBAL = GlobalStorage;
+
+/**
+ * @ignore
+ */
+class WebStorage extends TokenStorage {
+  static isAvailable() {
+    try {
+      //firefox throws an exception if cookies are disabled
+      if (typeof localStorage === 'undefined') {
+        return false;
+      }
+
+      localStorage.setItem('bq_webstorage_test', 'bq');
+      localStorage.removeItem('bq_webstorage_test');
+      return true;
+    } catch (e) {}
+    return false;
+  }
+
+  static create(origin) {
+    let temporary = false;
+    let token = localStorage.getItem('BAT:' + origin);
+    if (!token) {
+      token = sessionStorage.getItem('BAT:' + origin);
+      temporary = !!token;
+    }
+
+    return Promise.resolve(new WebStorage(origin, token, temporary));
+  }
+
+  /**
+   * @inheritDoc
+   */
+  _saveToken(origin, token, temporary) {
+    var webStorage = temporary? sessionStorage: localStorage;
+    if (token) {
+      webStorage.setItem('BAT:' + origin, token);
+    } else {
+      webStorage.removeItem('BAT:' + origin);
+    }
+  }
+}
+
+if (WebStorage.isAvailable()) {
+  /**
+   * @alias util.TokenStorage.WEB_STORAGE
+   * @type {util.TokenStorageFactory}
+   */
+  TokenStorage.WEB_STORAGE = WebStorage;
+}
+
+module.exports = TokenStorage;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_ValidationResult.js.html b/doc/lib_util_ValidationResult.js.html new file mode 100644 index 00000000..b892089e --- /dev/null +++ b/doc/lib_util_ValidationResult.js.html @@ -0,0 +1,346 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/ValidationResult.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/ValidationResult.js

+ + + + + + +
+
+
"use strict";
+
+/**
+ * @alias util.ValidationResult
+ */
+class ValidationResult {
+
+  get isValid() {
+    for (var key in this.fields) {
+      if(!this.fields[key].isValid) {
+        return false;
+      }
+    }
+    return true;
+  }
+
+  constructor() {
+    this.fields = {};
+  }
+
+  toJSON() {
+    var json = {};
+    for(var key in this.fields) {
+      json[key] = this.fields[key].toJSON();
+    }
+    return json;
+  }
+}
+
+module.exports = ValidationResult;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_Validator.js.html b/doc/lib_util_Validator.js.html new file mode 100644 index 00000000..4d0fd884 --- /dev/null +++ b/doc/lib_util_Validator.js.html @@ -0,0 +1,457 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/Validator.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/Validator.js

+ + + + + + +
+
+
"use strict";
+
+var valLib = require('validator');
+var ValidationResult = require('./ValidationResult');
+
+/**
+ * @alias util.Validator
+ */
+class Validator {
+
+  /**
+   * Compiles the given validation code for the managedType
+   * @param {metamodel.ManagedType} managedType The managedType of the code
+   * @param {string} validationCode The validation code
+   */
+  static compile(managedType, validationCode) {
+    var keys = [];
+    for (let attr of managedType.attributes()) {
+      keys.push(attr.name);
+    }
+
+    var fn = new Function(keys, validationCode);
+    return function onValidate(argObj) {
+      var args = keys.map(function(name) {
+        return argObj[name];
+      });
+
+      return fn.apply({}, args);
+    }
+  }
+
+  /**
+   * Gets the value of the attribute
+   * @return {*} Value
+   */
+  get value() {
+    return this._entity[this.key];
+  }
+
+  /**
+   * Checks if the attribute is valid
+   * @return {boolean}
+   */
+  get isValid() {
+    return this.errors.length == 0;
+  }
+
+  /**
+   * Executes the given validation function to validate the value.
+   *
+   * The value will be passed as the first parameter to the validation function and
+   * the library {@link https://github.com/chriso/validator.js} as the second one.
+   * If the function returns true the value is valid, otherwise it's invalid.
+   *
+   * @name is
+   * @memberOf util.Validator.prototype
+   * @function
+   * @param {Function} fn will be used to validate the value
+   * @returns {util.Validator}
+   */
+
+  /**
+   * Executes the given validation function to validate the value.
+   *
+   * The value will be passed as the first parameter to the validation function and
+   * the library {@link https://github.com/chriso/validator.js} as the second one.
+   * If the function returns true the value is valid, otherwise it's invalid.
+   *
+   * @param {string} error The error message which will be used if the value is invalid
+   * @param {Function} fn will be used to validate the value
+   * @returns {util.Validator}
+   */
+  is(error, fn) {
+    if(error instanceof Function) {
+      fn = error;
+      error = 'is';
+    }
+    if(fn(this.value, valLib) === false) {
+      this.errors.push(error);
+    }
+    return this;
+  }
+
+  constructor(key, entity) {
+    /**
+     * Name of the attribute
+     * @type string
+     */
+    this.key = key;
+
+    /**
+     * Entity to get the value of the attribute
+     * @type {binding.Entity}
+     * @private
+     */
+    this._entity = entity;
+
+    /**
+     * Entity to get the value of the attribute
+     * @type {binding.Entity}
+     * @private
+     */
+    this.errors = [];
+  }
+
+  _callMethod(method, error, args) {
+    args = args || [];
+    args.unshift(this.value);
+    if(valLib[method].apply(this, args) === false) {
+      this.errors.push(error);
+    }
+    return this;
+  }
+
+  toString() {
+    return this.value;
+  }
+
+  toJSON() {
+    return {
+      isValid: this.isValid,
+      errors: this.errors
+    }
+  }
+}
+
+Object.keys(valLib).forEach(function(name) {
+  if (typeof valLib[name] == 'function' && name !== 'toString' &&
+      name !== 'toDate' && name !== 'extend' && name !== 'init') {
+
+    /**
+     * @ignore
+     */
+    Validator.prototype[name] = function(error) {
+      //noinspection JSPotentiallyInvalidUsageOfThis
+      return this._callMethod(name, error || name, Array.prototype.slice.call(arguments, error? 1: 0));
+    }
+  }
+});
+
+module.exports = Validator;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/lib_util_index.js.html b/doc/lib_util_index.js.html new file mode 100644 index 00000000..4e68a269 --- /dev/null +++ b/doc/lib_util_index.js.html @@ -0,0 +1,339 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: lib/util/index.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: lib/util/index.js

+ + + + + + +
+
+
/**
+ * @namespace util
+ */
+module.exports = exports = require('./util');
+exports.Metadata = require('./Metadata');
+exports.Permission = require('./Permission');
+exports.Validator = require('./Validator');
+exports.ValidationResult = require('./ValidationResult');
+exports.Code = require('./Code');
+exports.Modules = require('./Modules');
+exports.Lockable = require('./Lockable');
+exports.Logger = require('./Logger');
+exports.PushMessage = require('./PushMessage');
+exports.TokenStorage = require('./TokenStorage');
+
+/**
+ * @function
+ * @name uuid
+ * @memberOf util.prototype
+ * @return {string} A generated version 4 UUID.
+ */
+exports.uuid = require('node-uuid').v4;
+
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/message.AdhocCountQuery.html b/doc/message.AdhocCountQuery.html new file mode 100644 index 00000000..c15cf115 --- /dev/null +++ b/doc/message.AdhocCountQuery.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: AdhocCountQuery + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: AdhocCountQuery

+ + + + + + +
+ +
+ +

AdhocCountQuery

+ + +
+ +
+
+ + + + + +

new AdhocCountQuery(bucket, q)

+ + + + + +
+

Executes a count query
Executes the given query and returns the number of objects that match the query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

q + + +Object + + + +

The query

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.AdhocCountQueryPOST.html b/doc/message.AdhocCountQueryPOST.html new file mode 100644 index 00000000..911f7ab9 --- /dev/null +++ b/doc/message.AdhocCountQueryPOST.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: AdhocCountQueryPOST + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: AdhocCountQueryPOST

+ + + + + + +
+ +
+ +

AdhocCountQueryPOST

+ + +
+ +
+
+ + + + + +

new AdhocCountQueryPOST(bucket, body)

+ + + + + +
+

Executes a count query
Executes the given query and returns the number of objects that match the query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.AdhocQuery.html b/doc/message.AdhocQuery.html new file mode 100644 index 00000000..4ac1acb2 --- /dev/null +++ b/doc/message.AdhocQuery.html @@ -0,0 +1,3199 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: AdhocQuery + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: AdhocQuery

+ + + + + + +
+ +
+ +

AdhocQuery

+ + +
+ +
+
+ + + + + +

new AdhocQuery(bucket, q, eager, start, count, sort)

+ + + + + +
+

Executes a basic ad-hoc query
Executes the given query and returns a list of matching objects.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

q + + +Object + + + +

The query

eager + + +Object + + + +

indicates if the query result should be send back as ids or as objects

start + + +Object + + + +

The offset to start from

count + + +Object + + + +

The number of objects to list

sort + + +Object + + + +

The sort object

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.AdhocQueryPOST.html b/doc/message.AdhocQueryPOST.html new file mode 100644 index 00000000..6a7f76f3 --- /dev/null +++ b/doc/message.AdhocQueryPOST.html @@ -0,0 +1,3174 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: AdhocQueryPOST + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: AdhocQueryPOST

+ + + + + + +
+ +
+ +

AdhocQueryPOST

+ + +
+ +
+
+ + + + + +

new AdhocQueryPOST(bucket, start, count, sort, body)

+ + + + + +
+

Executes a basic ad-hoc query
Executes the given query and returns a list of matching objects.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

start + + +Object + + + +

The offset to start from

count + + +Object + + + +

The number of objects to list

sort + + +Object + + + +

The sort object

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ApiVersion.html b/doc/message.ApiVersion.html new file mode 100644 index 00000000..7cdd608e --- /dev/null +++ b/doc/message.ApiVersion.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ApiVersion + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ApiVersion

+ + + + + + +
+ +
+ +

ApiVersion

+ + +
+ +
+
+ + + + + +

new ApiVersion()

+ + + + + +
+

Get the API version of the Orestes-Server

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Banned.html b/doc/message.Banned.html new file mode 100644 index 00000000..81ca66e5 --- /dev/null +++ b/doc/message.Banned.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Banned + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Banned

+ + + + + + +
+ +
+ +

Banned

+ + +
+ +
+
+ + + + + +

new Banned()

+ + + + + +
+

Always returns banned status for proper CDN handling

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.BannedIp.html b/doc/message.BannedIp.html new file mode 100644 index 00000000..ddaf28ea --- /dev/null +++ b/doc/message.BannedIp.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: BannedIp + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: BannedIp

+ + + + + + +
+ +
+ +

BannedIp

+ + +
+ +
+
+ + + + + +

new BannedIp(ip)

+ + + + + +
+

Determines whether the IP has exceeded its rate limit

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ip + + +Object + + + +

The ip to test

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.CommitTransaction.html b/doc/message.CommitTransaction.html new file mode 100644 index 00000000..40db745e --- /dev/null +++ b/doc/message.CommitTransaction.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: CommitTransaction + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: CommitTransaction

+ + + + + + +
+ +
+ +

CommitTransaction

+ + +
+ +
+
+ + + + + +

new CommitTransaction(tid, body)

+ + + + + +
+

Commits the transaction
If the transaction can be completed a list of all changed objects with their updated versions are returned.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
tid + + +Object + + + +

The transaction id

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Connect.html b/doc/message.Connect.html new file mode 100644 index 00000000..ede2d232 --- /dev/null +++ b/doc/message.Connect.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Connect + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Connect

+ + + + + + +
+ +
+ +

Connect

+ + +
+ +
+
+ + + + + +

new Connect()

+ + + + + +
+

Connects a browser to this server

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.CreateDropIndex.html b/doc/message.CreateDropIndex.html new file mode 100644 index 00000000..a3fd6a62 --- /dev/null +++ b/doc/message.CreateDropIndex.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: CreateDropIndex + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: CreateDropIndex

+ + + + + + +
+ +
+ +

CreateDropIndex

+ + +
+ +
+
+ + + + + +

new CreateDropIndex(bucket, body)

+ + + + + +
+

Create or drop bucket index
Create or drop a index for the given bucket

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.CreateFile.html b/doc/message.CreateFile.html new file mode 100644 index 00000000..a47c9599 --- /dev/null +++ b/doc/message.CreateFile.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: CreateFile + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: CreateFile

+ + + + + + +
+ +
+ +

CreateFile

+ + +
+ +
+
+ + + + + +

new CreateFile(bucket)

+ + + + + +
+

Creates a new file with a random UUID
Creates a File with a random ID, only Insert permissions are required

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.CreateObject.html b/doc/message.CreateObject.html new file mode 100644 index 00000000..bc7cfb9a --- /dev/null +++ b/doc/message.CreateObject.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: CreateObject + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: CreateObject

+ + + + + + +
+ +
+ +

CreateObject

+ + +
+ +
+
+ + + + + +

new CreateObject(bucket, body)

+ + + + + +
+

Create object
Create the given Object.
The object will be created and gets a unique oid.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.CreateQuery.html b/doc/message.CreateQuery.html new file mode 100644 index 00000000..249e804f --- /dev/null +++ b/doc/message.CreateQuery.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: CreateQuery + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: CreateQuery

+ + + + + + +
+ +
+ +

CreateQuery

+ + +
+ +
+
+ + + + + +

new CreateQuery(body)

+ + + + + +
+

Creates a prepared query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DeleteBaqendCode.html b/doc/message.DeleteBaqendCode.html new file mode 100644 index 00000000..23a7de50 --- /dev/null +++ b/doc/message.DeleteBaqendCode.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DeleteBaqendCode + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DeleteBaqendCode

+ + + + + + +
+ +
+ +

DeleteBaqendCode

+ + +
+ +
+
+ + + + + +

new DeleteBaqendCode(bucket, type)

+ + + + + +
+

Delete the code of the given bucket and type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

type + + +Object + + + +

The type of the script

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DeleteFile.html b/doc/message.DeleteFile.html new file mode 100644 index 00000000..fcaf7557 --- /dev/null +++ b/doc/message.DeleteFile.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DeleteFile + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DeleteFile

+ + + + + + +
+ +
+ +

DeleteFile

+ + +
+ +
+
+ + + + + +

new DeleteFile(bucket, oid)

+ + + + + +
+

Delete a file
Deletes a file.
The If-Match or If-Unmodified-Since header can be used to make a conditional deletion

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +String + + + +

The unique file identifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DeleteFileBucket.html b/doc/message.DeleteFileBucket.html new file mode 100644 index 00000000..91433e04 --- /dev/null +++ b/doc/message.DeleteFileBucket.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DeleteFileBucket + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DeleteFileBucket

+ + + + + + +
+ +
+ +

DeleteFileBucket

+ + +
+ +
+
+ + + + + +

new DeleteFileBucket(bucket)

+ + + + + +
+

deletes all files of a file Bucket
Deletes the bucket and all its content

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DeleteObject.html b/doc/message.DeleteObject.html new file mode 100644 index 00000000..26e233b0 --- /dev/null +++ b/doc/message.DeleteObject.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DeleteObject + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DeleteObject

+ + + + + + +
+ +
+ +

DeleteObject

+ + +
+ +
+
+ + + + + +

new DeleteObject(bucket, oid)

+ + + + + +
+

Deletes the object
Deletes the object. The If-Match Header can be used to specify an expected version. The object will
only be deleted if the version matchesToBeForwarded the provided one. The * wildcard can be used to match any existing
version but results in an error if the object doesn't exists.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +Object + + + +

The unique object identifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DeleteSchema.html b/doc/message.DeleteSchema.html new file mode 100644 index 00000000..e6d30728 --- /dev/null +++ b/doc/message.DeleteSchema.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DeleteSchema + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DeleteSchema

+ + + + + + +
+ +
+ +

DeleteSchema

+ + +
+ +
+
+ + + + + +

new DeleteSchema(bucket)

+ + + + + +
+

Delete the class schema
Delete the schema definition of the class

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DevicePush.html b/doc/message.DevicePush.html new file mode 100644 index 00000000..b8d01691 --- /dev/null +++ b/doc/message.DevicePush.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DevicePush + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DevicePush

+ + + + + + +
+ +
+ +

DevicePush

+ + +
+ +
+
+ + + + + +

new DevicePush(body)

+ + + + + +
+

Method to push a message to devices
Pushes a message to devices

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:27 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DeviceRegister.html b/doc/message.DeviceRegister.html new file mode 100644 index 00000000..e711f986 --- /dev/null +++ b/doc/message.DeviceRegister.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DeviceRegister + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DeviceRegister

+ + + + + + +
+ +
+ +

DeviceRegister

+ + +
+ +
+
+ + + + + +

new DeviceRegister(body)

+ + + + + +
+

Method to register a new device
Registers a new devices

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DeviceRegistered.html b/doc/message.DeviceRegistered.html new file mode 100644 index 00000000..b6aadf21 --- /dev/null +++ b/doc/message.DeviceRegistered.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DeviceRegistered + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DeviceRegistered

+ + + + + + +
+ +
+ +

DeviceRegistered

+ + +
+ +
+
+ + + + + +

new DeviceRegistered()

+ + + + + +
+

Check if device is registered
Checks if the device is already registered

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DownloadFile.html b/doc/message.DownloadFile.html new file mode 100644 index 00000000..7a6e35ff --- /dev/null +++ b/doc/message.DownloadFile.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DownloadFile + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DownloadFile

+ + + + + + +
+ +
+ +

DownloadFile

+ + +
+ +
+
+ + + + + +

new DownloadFile(bucket, oid)

+ + + + + +
+

Download a file
Download a file.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +String + + + +

The unique object identifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.DropAllIndexes.html b/doc/message.DropAllIndexes.html new file mode 100644 index 00000000..08a1d841 --- /dev/null +++ b/doc/message.DropAllIndexes.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DropAllIndexes + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DropAllIndexes

+ + + + + + +
+ +
+ +

DropAllIndexes

+ + +
+ +
+
+ + + + + +

new DropAllIndexes(bucket)

+ + + + + +
+

Drop all indexes
Drop all indexes on the given bucket

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Events.html b/doc/message.Events.html new file mode 100644 index 00000000..1990a733 --- /dev/null +++ b/doc/message.Events.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Events + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Events

+ + + + + + +
+ +
+ +

Events

+ + +
+ +
+
+ + + + + +

new Events()

+ + + + + +
+

Gets the event Endpoint

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ExportBucket.html b/doc/message.ExportBucket.html new file mode 100644 index 00000000..1a7893c8 --- /dev/null +++ b/doc/message.ExportBucket.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ExportBucket + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ExportBucket

+ + + + + + +
+ +
+ +

ExportBucket

+ + +
+ +
+
+ + + + + +

new ExportBucket(bucket)

+ + + + + +
+

Dumps all objects of the bucket
Exports the complete Bucket content

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GCMAKey.html b/doc/message.GCMAKey.html new file mode 100644 index 00000000..44f50d22 --- /dev/null +++ b/doc/message.GCMAKey.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GCMAKey + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GCMAKey

+ + + + + + +
+ +
+ +

GCMAKey

+ + +
+ +
+
+ + + + + +

new GCMAKey(body)

+ + + + + +
+

Set GCM-API-Key
Sets the GCM-API-Key

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetAllModules.html b/doc/message.GetAllModules.html new file mode 100644 index 00000000..aa427251 --- /dev/null +++ b/doc/message.GetAllModules.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetAllModules + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetAllModules

+ + + + + + +
+ +
+ +

GetAllModules

+ + +
+ +
+
+ + + + + +

new GetAllModules()

+ + + + + +
+

List all available modules

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetAllSchemas.html b/doc/message.GetAllSchemas.html new file mode 100644 index 00000000..01d9d052 --- /dev/null +++ b/doc/message.GetAllSchemas.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetAllSchemas + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetAllSchemas

+ + + + + + +
+ +
+ +

GetAllSchemas

+ + +
+ +
+
+ + + + + +

new GetAllSchemas()

+ + + + + +
+

Get all available class schemas
Gets the complete schema

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetBaqendCode.html b/doc/message.GetBaqendCode.html new file mode 100644 index 00000000..8ba7b31c --- /dev/null +++ b/doc/message.GetBaqendCode.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetBaqendCode + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetBaqendCode

+ + + + + + +
+ +
+ +

GetBaqendCode

+ + +
+ +
+
+ + + + + +

new GetBaqendCode(bucket, type)

+ + + + + +
+

Gets the code of the the given bucket and type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

type + + +Object + + + +

The type of the script

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetBaqendModule.html b/doc/message.GetBaqendModule.html new file mode 100644 index 00000000..df857241 --- /dev/null +++ b/doc/message.GetBaqendModule.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetBaqendModule + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetBaqendModule

+ + + + + + +
+ +
+ +

GetBaqendModule

+ + +
+ +
+
+ + + + + +

new GetBaqendModule(bucket)

+ + + + + +
+

Calls the module of the specific bucket

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The module name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetBloomFilter.html b/doc/message.GetBloomFilter.html new file mode 100644 index 00000000..6397e7fc --- /dev/null +++ b/doc/message.GetBloomFilter.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetBloomFilter + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetBloomFilter

+ + + + + + +
+ +
+ +

GetBloomFilter

+ + +
+ +
+
+ + + + + +

new GetBloomFilter()

+ + + + + +
+

Returns all changed objects

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetBucketIds.html b/doc/message.GetBucketIds.html new file mode 100644 index 00000000..f3478a21 --- /dev/null +++ b/doc/message.GetBucketIds.html @@ -0,0 +1,3124 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetBucketIds + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetBucketIds

+ + + + + + +
+ +
+ +

GetBucketIds

+ + +
+ +
+
+ + + + + +

new GetBucketIds(bucket, start, count)

+ + + + + +
+

List all bucket objects
List all object ids of the bucket

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

start + + +Object + + + +

The offset to skip

count + + +Object + + + +

The upper limit to return

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetBucketNames.html b/doc/message.GetBucketNames.html new file mode 100644 index 00000000..3b598ec8 --- /dev/null +++ b/doc/message.GetBucketNames.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetBucketNames + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetBucketNames

+ + + + + + +
+ +
+ +

GetBucketNames

+ + +
+ +
+
+ + + + + +

new GetBucketNames()

+ + + + + +
+

List all available bucket names
List all bucket

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetFileBucketMetadata.html b/doc/message.GetFileBucketMetadata.html new file mode 100644 index 00000000..16d12389 --- /dev/null +++ b/doc/message.GetFileBucketMetadata.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetFileBucketMetadata + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetFileBucketMetadata

+ + + + + + +
+ +
+ +

GetFileBucketMetadata

+ + +
+ +
+
+ + + + + +

new GetFileBucketMetadata(bucket)

+ + + + + +
+

Retrieves the bucket Metadata
The bucket metadata object contains the bucketAcl

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetFileMetadata.html b/doc/message.GetFileMetadata.html new file mode 100644 index 00000000..a8f6576a --- /dev/null +++ b/doc/message.GetFileMetadata.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetFileMetadata + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetFileMetadata

+ + + + + + +
+ +
+ +

GetFileMetadata

+ + +
+ +
+
+ + + + + +

new GetFileMetadata(bucket, oid)

+ + + + + +
+

Gets the file metadata
Gets the file Acl and metadata.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +String + + + +

The unique object identifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetObject.html b/doc/message.GetObject.html new file mode 100644 index 00000000..815cb9bf --- /dev/null +++ b/doc/message.GetObject.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetObject + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetObject

+ + + + + + +
+ +
+ +

GetObject

+ + +
+ +
+
+ + + + + +

new GetObject(bucket, oid)

+ + + + + +
+

Get object
Returns the specified object. Each object has one unique identifier and therefore only one location.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +Object + + + +

The unique object identifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetObjectInExplicitVersion.html b/doc/message.GetObjectInExplicitVersion.html new file mode 100644 index 00000000..fb43d80c --- /dev/null +++ b/doc/message.GetObjectInExplicitVersion.html @@ -0,0 +1,3124 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetObjectInExplicitVersion + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetObjectInExplicitVersion

+ + + + + + +
+ +
+ +

GetObjectInExplicitVersion

+ + +
+ +
+
+ + + + + +

new GetObjectInExplicitVersion(bucket, oid, version)

+ + + + + +
+

Returns the object in the given version or the newest version if the given does not exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +Object + + + +

The unique object identifier

version + + +Object + + + +

The version to load

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetOrestesConfig.html b/doc/message.GetOrestesConfig.html new file mode 100644 index 00000000..a2c28d63 --- /dev/null +++ b/doc/message.GetOrestesConfig.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetOrestesConfig + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetOrestesConfig

+ + + + + + +
+ +
+ +

GetOrestesConfig

+ + +
+ +
+
+ + + + + +

new GetOrestesConfig()

+ + + + + +
+

Get the current Orestes config

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetQueryCode.html b/doc/message.GetQueryCode.html new file mode 100644 index 00000000..77fe0435 --- /dev/null +++ b/doc/message.GetQueryCode.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetQueryCode + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetQueryCode

+ + + + + + +
+ +
+ +

GetQueryCode

+ + +
+ +
+
+ + + + + +

new GetQueryCode(qid)

+ + + + + +
+

Get the query string

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qid + + +Object + + + +

The query id

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetQueryParameters.html b/doc/message.GetQueryParameters.html new file mode 100644 index 00000000..cb2404ba --- /dev/null +++ b/doc/message.GetQueryParameters.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetQueryParameters + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetQueryParameters

+ + + + + + +
+ +
+ +

GetQueryParameters

+ + +
+ +
+
+ + + + + +

new GetQueryParameters(qid)

+ + + + + +
+

Get the declared query parameters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qid + + +Object + + + +

The query id

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.GetSchema.html b/doc/message.GetSchema.html new file mode 100644 index 00000000..031ddbdb --- /dev/null +++ b/doc/message.GetSchema.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: GetSchema + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: GetSchema

+ + + + + + +
+ +
+ +

GetSchema

+ + +
+ +
+
+ + + + + +

new GetSchema(bucket)

+ + + + + +
+

Get the class schema
Returns the schema definition of the class
The class definition contains a link to its parent class and all persistable fields with there types of the class

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ImportBucket.html b/doc/message.ImportBucket.html new file mode 100644 index 00000000..8bc0c012 --- /dev/null +++ b/doc/message.ImportBucket.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ImportBucket + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ImportBucket

+ + + + + + +
+ +
+ +

ImportBucket

+ + +
+ +
+
+ + + + + +

new ImportBucket(bucket, body)

+ + + + + +
+

Upload all objects to the bucket
Imports the complete Bucket content

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ListAllResources.html b/doc/message.ListAllResources.html new file mode 100644 index 00000000..7ea4ce02 --- /dev/null +++ b/doc/message.ListAllResources.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ListAllResources + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ListAllResources

+ + + + + + +
+ +
+ +

ListAllResources

+ + +
+ +
+
+ + + + + +

new ListAllResources()

+ + + + + +
+

Get the list of all available subresources

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ListBuckets.html b/doc/message.ListBuckets.html new file mode 100644 index 00000000..6f44e831 --- /dev/null +++ b/doc/message.ListBuckets.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ListBuckets + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ListBuckets

+ + + + + + +
+ +
+ +

ListBuckets

+ + +
+ +
+
+ + + + + +

new ListBuckets()

+ + + + + +
+

Get all buckets
Get all buckets.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ListFiles.html b/doc/message.ListFiles.html new file mode 100644 index 00000000..1d314051 --- /dev/null +++ b/doc/message.ListFiles.html @@ -0,0 +1,3149 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ListFiles + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ListFiles

+ + + + + + +
+ +
+ +

ListFiles

+ + +
+ +
+
+ + + + + +

new ListFiles(bucket, path, start, count)

+ + + + + +
+

Get all file ID's in the given folder
Retrieve meta-information about all accessible Files and folders in a specified folder.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

path + + +Object + + + +

The folder to list

start + + +Object + + + +

The file/folder name from where to start listing

count + + +Object + + + +

The upper limit to return.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ListIndexes.html b/doc/message.ListIndexes.html new file mode 100644 index 00000000..b76c9df9 --- /dev/null +++ b/doc/message.ListIndexes.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ListIndexes + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ListIndexes

+ + + + + + +
+ +
+ +

ListIndexes

+ + +
+ +
+
+ + + + + +

new ListIndexes(bucket)

+ + + + + +
+

List bucket indexes
List all indexes of the given bucket

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ListQueryResources.html b/doc/message.ListQueryResources.html new file mode 100644 index 00000000..7beffc40 --- /dev/null +++ b/doc/message.ListQueryResources.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ListQueryResources + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ListQueryResources

+ + + + + + +
+ +
+ +

ListQueryResources

+ + +
+ +
+
+ + + + + +

new ListQueryResources()

+ + + + + +
+

List all Query subresources

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ListThisQueryResources.html b/doc/message.ListThisQueryResources.html new file mode 100644 index 00000000..35edb479 --- /dev/null +++ b/doc/message.ListThisQueryResources.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ListThisQueryResources + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ListThisQueryResources

+ + + + + + +
+ +
+ +

ListThisQueryResources

+ + +
+ +
+
+ + + + + +

new ListThisQueryResources(qid)

+ + + + + +
+

List all subresources of a query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
qid + + +Object + + + +

The query id

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Login.html b/doc/message.Login.html new file mode 100644 index 00000000..e26fde17 --- /dev/null +++ b/doc/message.Login.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Login + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Login

+ + + + + + +
+ +
+ +

Login

+ + +
+ +
+
+ + + + + +

new Login(body)

+ + + + + +
+

Method to login a user
Log in a user by it's credentials

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Logout.html b/doc/message.Logout.html new file mode 100644 index 00000000..87b26936 --- /dev/null +++ b/doc/message.Logout.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Logout + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Logout

+ + + + + + +
+ +
+ +

Logout

+ + +
+ +
+
+ + + + + +

new Logout()

+ + + + + +
+

Method to remove token cookie
Log out a user by removing the cookie token

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Me.html b/doc/message.Me.html new file mode 100644 index 00000000..bb4729b7 --- /dev/null +++ b/doc/message.Me.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Me + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Me

+ + + + + + +
+ +
+ +

Me

+ + +
+ +
+
+ + + + + +

new Me()

+ + + + + +
+

Method to load the current user object
Gets the user object of the currently logged in user

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.NewPassword.html b/doc/message.NewPassword.html new file mode 100644 index 00000000..5bcc8b99 --- /dev/null +++ b/doc/message.NewPassword.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: NewPassword + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: NewPassword

+ + + + + + +
+ +
+ +

NewPassword

+ + +
+ +
+
+ + + + + +

new NewPassword(body)

+ + + + + +
+

Method to change the password

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.NewTransaction.html b/doc/message.NewTransaction.html new file mode 100644 index 00000000..9639d82d --- /dev/null +++ b/doc/message.NewTransaction.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: NewTransaction + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: NewTransaction

+ + + + + + +
+ +
+ +

NewTransaction

+ + +
+ +
+
+ + + + + +

new NewTransaction()

+ + + + + +
+

Starts a new Transaction

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.OAuth1.html b/doc/message.OAuth1.html new file mode 100644 index 00000000..92de3879 --- /dev/null +++ b/doc/message.OAuth1.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: OAuth1 + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: OAuth1

+ + + + + + +
+ +
+ +

OAuth1

+ + +
+ +
+
+ + + + + +

new OAuth1(provider)

+ + + + + +
+

Method to invoke a OAuth-1.0 login/register
The resource requests a request-token and redirects the user to the provider page to log-in and grant permission for
your application.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
provider + + +Object + + + +

The OAuth provider

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.OAuth2.html b/doc/message.OAuth2.html new file mode 100644 index 00000000..f2c076f8 --- /dev/null +++ b/doc/message.OAuth2.html @@ -0,0 +1,3199 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: OAuth2 + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: OAuth2

+ + + + + + +
+ +
+ +

OAuth2

+ + +
+ +
+
+ + + + + +

new OAuth2(oauth_verifier, code, provider, oauth_token, error_description, state)

+ + + + + +
+

Method to register or login using an OAuth provider.
This resource is invoked by the provider with a redirect after the user granted permission.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
oauth_verifier + + +Object + + + +

OAuth 1.0 code

code + + +Object + + + +

The code written by the provider

provider + + +Object + + + +

The OAuth provider

oauth_token + + +Object + + + +

OAuth 1.0 identifier

error_description + + +Object + + + +

The error description of the oauth provider

state + + +Object + + + +

On true a token will be returned

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.PostBaqendModule.html b/doc/message.PostBaqendModule.html new file mode 100644 index 00000000..04d8962b --- /dev/null +++ b/doc/message.PostBaqendModule.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: PostBaqendModule + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: PostBaqendModule

+ + + + + + +
+ +
+ +

PostBaqendModule

+ + +
+ +
+
+ + + + + +

new PostBaqendModule(bucket)

+ + + + + +
+

Calls the module of the specific bucket

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The method name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:28 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Register.html b/doc/message.Register.html new file mode 100644 index 00000000..0e9a4d67 --- /dev/null +++ b/doc/message.Register.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Register + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Register

+ + + + + + +
+ +
+ +

Register

+ + +
+ +
+
+ + + + + +

new Register(body)

+ + + + + +
+

Method to register a user
Register and creates a new user

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ReplaceAllSchemas.html b/doc/message.ReplaceAllSchemas.html new file mode 100644 index 00000000..18470633 --- /dev/null +++ b/doc/message.ReplaceAllSchemas.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ReplaceAllSchemas + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ReplaceAllSchemas

+ + + + + + +
+ +
+ +

ReplaceAllSchemas

+ + +
+ +
+
+ + + + + +

new ReplaceAllSchemas(body)

+ + + + + +
+

Replace all currently created schemas with the new ones
Replace the complete schema, with the new one.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ReplaceObject.html b/doc/message.ReplaceObject.html new file mode 100644 index 00000000..86a22b1e --- /dev/null +++ b/doc/message.ReplaceObject.html @@ -0,0 +1,3124 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ReplaceObject + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ReplaceObject

+ + + + + + +
+ +
+ +

ReplaceObject

+ + +
+ +
+
+ + + + + +

new ReplaceObject(bucket, oid, body)

+ + + + + +
+

Replace object
Replace the current object with the updated one.
To update a specific version of the object a version Number can be provided in the If-Match header.
The update will only be accepted, if the current version matchesToBeForwarded the provided one, otherwise the update
will be rejected.
You can use the * wildcard to match any existing object, but prevents a insertion if the object doesn't exists.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +Object + + + +

The unique object identifier

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ReplaceSchema.html b/doc/message.ReplaceSchema.html new file mode 100644 index 00000000..f257afbd --- /dev/null +++ b/doc/message.ReplaceSchema.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ReplaceSchema + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ReplaceSchema

+ + + + + + +
+ +
+ +

ReplaceSchema

+ + +
+ +
+
+ + + + + +

new ReplaceSchema(bucket, body)

+ + + + + +
+

Replace the class schema
Replace the schema definition of the class

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.RunQuery.html b/doc/message.RunQuery.html new file mode 100644 index 00000000..b49c8fa8 --- /dev/null +++ b/doc/message.RunQuery.html @@ -0,0 +1,3124 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: RunQuery + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: RunQuery

+ + + + + + +
+ +
+ +

RunQuery

+ + +
+ +
+
+ + + + + +

new RunQuery(start, count, qid)

+ + + + + +
+

Executes a prepared query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
start + + +Object + + + +

The offset from where to start from

count + + +Object + + + +

The number of objects to enlist

qid + + +Object + + + +

The query id

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.SetBaqendCode.html b/doc/message.SetBaqendCode.html new file mode 100644 index 00000000..c8fa1d52 --- /dev/null +++ b/doc/message.SetBaqendCode.html @@ -0,0 +1,3124 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: SetBaqendCode + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: SetBaqendCode

+ + + + + + +
+ +
+ +

SetBaqendCode

+ + +
+ +
+
+ + + + + +

new SetBaqendCode(bucket, type, body)

+ + + + + +
+

Sets the code of the bucket and type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

type + + +Object + + + +

The type of the script

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.SetFileBucketMetadata.html b/doc/message.SetFileBucketMetadata.html new file mode 100644 index 00000000..4a7c355f --- /dev/null +++ b/doc/message.SetFileBucketMetadata.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: SetFileBucketMetadata + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: SetFileBucketMetadata

+ + + + + + +
+ +
+ +

SetFileBucketMetadata

+ + +
+ +
+
+ + + + + +

new SetFileBucketMetadata(bucket, body)

+ + + + + +
+

Sets the Bucket Metadata
Creates or replaces the bucket Metadata to control permission access to all included Files.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Specification.html b/doc/message.Specification.html new file mode 100644 index 00000000..9e2e3b58 --- /dev/null +++ b/doc/message.Specification.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Specification + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Specification

+ + + + + + +
+ +
+ +

Specification

+ + +
+ +
+
+ + + + + +

new Specification()

+ + + + + +
+

The Swagger specification of the Orestes-Server

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Status.html b/doc/message.Status.html new file mode 100644 index 00000000..c1ebf081 --- /dev/null +++ b/doc/message.Status.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Status + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Status

+ + + + + + +
+ +
+ +

Status

+ + +
+ +
+
+ + + + + +

new Status()

+ + + + + +
+

Gets the status of the server health

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.TruncateBucket.html b/doc/message.TruncateBucket.html new file mode 100644 index 00000000..a2b1304f --- /dev/null +++ b/doc/message.TruncateBucket.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: TruncateBucket + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: TruncateBucket

+ + + + + + +
+ +
+ +

TruncateBucket

+ + +
+ +
+
+ + + + + +

new TruncateBucket(bucket)

+ + + + + +
+

Deletes all objects of the bucket
Deletes all objects of the bucket

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Unban.html b/doc/message.Unban.html new file mode 100644 index 00000000..22d28eef --- /dev/null +++ b/doc/message.Unban.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Unban + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Unban

+ + + + + + +
+ +
+ +

Unban

+ + +
+ +
+
+ + + + + +

new Unban()

+ + + + + +
+

Clears all rate-limiting information for all IPs

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.UnbanIp.html b/doc/message.UnbanIp.html new file mode 100644 index 00000000..ec248e96 --- /dev/null +++ b/doc/message.UnbanIp.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UnbanIp + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UnbanIp

+ + + + + + +
+ +
+ +

UnbanIp

+ + +
+ +
+
+ + + + + +

new UnbanIp(ip)

+ + + + + +
+

Clears rate-limiting information for given IPs

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ip + + +Object + + + +

The ip to reset

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.UpdateAllSchemas.html b/doc/message.UpdateAllSchemas.html new file mode 100644 index 00000000..47816eba --- /dev/null +++ b/doc/message.UpdateAllSchemas.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UpdateAllSchemas + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UpdateAllSchemas

+ + + + + + +
+ +
+ +

UpdateAllSchemas

+ + +
+ +
+
+ + + + + +

new UpdateAllSchemas(body)

+ + + + + +
+

Create new class schemas and update existing class schemas
Updates the complete schema, merge all changes, reject the schema update if the schema changes aren't compatible

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.UpdateField.html b/doc/message.UpdateField.html new file mode 100644 index 00000000..92c68a8e --- /dev/null +++ b/doc/message.UpdateField.html @@ -0,0 +1,3149 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UpdateField + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UpdateField

+ + + + + + +
+ +
+ +

UpdateField

+ + +
+ +
+
+ + + + + +

new UpdateField(bucket, field, oid, body)

+ + + + + +
+

Update the object field
Executes the partial update on a object field.
To update an object an explicit version must be provided in the If-Match header.
If the version is not equal to the current object version the update will be aborted.
The version identifier Any (*) can be used to skip the version validation and therefore
the update will always be applied.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

field + + +Object + + + +

The field name

oid + + +Object + + + +

The unique object identifier

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.UpdateFileMetadata.html b/doc/message.UpdateFileMetadata.html new file mode 100644 index 00000000..c34942b3 --- /dev/null +++ b/doc/message.UpdateFileMetadata.html @@ -0,0 +1,3124 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UpdateFileMetadata + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UpdateFileMetadata

+ + + + + + +
+ +
+ +

UpdateFileMetadata

+ + +
+ +
+
+ + + + + +

new UpdateFileMetadata(bucket, oid, body)

+ + + + + +
+

update File Metadata
Updates the file Metadata.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +String + + + +

The unique object identifier

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.UpdateOrestesConfig.html b/doc/message.UpdateOrestesConfig.html new file mode 100644 index 00000000..cbd715ec --- /dev/null +++ b/doc/message.UpdateOrestesConfig.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UpdateOrestesConfig + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UpdateOrestesConfig

+ + + + + + +
+ +
+ +

UpdateOrestesConfig

+ + +
+ +
+
+ + + + + +

new UpdateOrestesConfig(body)

+ + + + + +
+

Updates the current Orestes config

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.UpdatePartially.html b/doc/message.UpdatePartially.html new file mode 100644 index 00000000..0b6c7e29 --- /dev/null +++ b/doc/message.UpdatePartially.html @@ -0,0 +1,3124 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UpdatePartially + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UpdatePartially

+ + + + + + +
+ +
+ +

UpdatePartially

+ + +
+ +
+
+ + + + + +

new UpdatePartially(bucket, oid, body)

+ + + + + +
+

Update the object
Executes the partial updates on the object.
To update an object an explicit version must be provided in the If-Match header.
If the version is not equal to the current object version the update will be aborted.
The version identifier Any (*) can be used to skip the version validation and therefore
the update will always be applied.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +Object + + + +

The unique object identifier

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.UpdateSchema.html b/doc/message.UpdateSchema.html new file mode 100644 index 00000000..bc4f8000 --- /dev/null +++ b/doc/message.UpdateSchema.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UpdateSchema + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UpdateSchema

+ + + + + + +
+ +
+ +

UpdateSchema

+ + +
+ +
+
+ + + + + +

new UpdateSchema(bucket, body)

+ + + + + +
+

Update the class schema
Modify the schema definition of the class by adding all missing fields

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

body + + +Object + + + +

The massage Content

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.UploadAPNSCertificate.html b/doc/message.UploadAPNSCertificate.html new file mode 100644 index 00000000..b950097b --- /dev/null +++ b/doc/message.UploadAPNSCertificate.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UploadAPNSCertificate + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UploadAPNSCertificate

+ + + + + + +
+ +
+ +

UploadAPNSCertificate

+ + +
+ +
+
+ + + + + +

new UploadAPNSCertificate()

+ + + + + +
+

Upload APNS certificate
Upload APNS certificate

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.UploadFile.html b/doc/message.UploadFile.html new file mode 100644 index 00000000..5791501b --- /dev/null +++ b/doc/message.UploadFile.html @@ -0,0 +1,3099 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: UploadFile + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: UploadFile

+ + + + + + +
+ +
+ +

UploadFile

+ + +
+ +
+
+ + + + + +

new UploadFile(bucket, oid)

+ + + + + +
+

Upload a new file
Upload and replace any existing File with the new one.
The If-Match or If-Unmodified-Since header can be used to make a conditional update

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +Object + + + +

The bucket name

oid + + +String + + + +

The unique file identifier

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.ValidateUser.html b/doc/message.ValidateUser.html new file mode 100644 index 00000000..c99b4201 --- /dev/null +++ b/doc/message.ValidateUser.html @@ -0,0 +1,3023 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ValidateUser + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ValidateUser

+ + + + + + +
+ +
+ +

ValidateUser

+ + +
+ +
+
+ + + + + +

new ValidateUser()

+ + + + + +
+

Method to validate a user token
Validates if a given token is still valid

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/message.Verify.html b/doc/message.Verify.html new file mode 100644 index 00000000..64598e0f --- /dev/null +++ b/doc/message.Verify.html @@ -0,0 +1,3074 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Verify + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Verify

+ + + + + + +
+ +
+ +

Verify

+ + +
+ +
+
+ + + + + +

new Verify(token)

+ + + + + +
+

Method to verify user by a given token

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
token + + +Object + + + +

Token to verify the user

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

spec :Object

+ + + + +
+

The message specification

+
+ + + +
Type:
+
    +
  • + +Object + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

accept(acceptopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request accept header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
accept + + +string + + + + + + <optional>
+ + + + + +

the accept header value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

acl(aclopt) → {connector.Message}

+ + + + + +
+

Get/Sets and encodes the acl of a file into the Baqend-Acl header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
acl + + +Acl + + + + + + <optional>
+ + + + + +

the file acls

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

addQueryString(query)

+ + + + + +
+

Adds the given String to the request path.
If the parameter is an object the query string will be created.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
query + + +string +| + +Object + + + +

which will added to the request path

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

cacheControl(valueopt) → {connector.Message}

+ + + + + +
+

Get/Sets the cache control header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
value + + +string + + + + + + <optional>
+ + + + + +

The cache control flags

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

contentLength(contentLengthopt) → {connector.Message}

+ + + + + +
+

Get/Sets the contentLength

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
contentLength + + +number + + + + + + <optional>
+ + + + + +

the content length of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

doReceive(response)

+ + + + + +
+

Handle the receive

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
response + + +Object + + + +

The received response headers and data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

entity(data, typeopt) → {connector.Message}

+ + + + + +
+

sets the entity type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
data + + +any + + + + + + + + + + + +

The data to send

type + + +string + + + + + + <optional>
+ + + + + +
+ + "json" + +

the type of the data one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + + + + + + +
+

Get/Sets the value of a the specified request header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The header name

value + + +string + + + + + + <optional>
+ + + + + +

The header value if omitted the value will be returned

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message +| + +string + + +
+
+ + + + + + + + + + +

ifMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request conditional If-Match header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

the If-Match ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifNoneMatch(eTagopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request a ETag based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
eTag + + +string + + + + + + <optional>
+ + + + + +

The ETag value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

ifUnmodifiedSince(dateopt) → {connector.Message}

+ + + + + +
+

Get/Sets the request date based conditional header

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
date + + +Date + + + + + + <optional>
+ + + + + +

The date value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

mimeType(mimeTypeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the mimeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
mimeType + + +string + + + + + + <optional>
+ + + + + +

the mimeType of the data

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

noCache()

+ + + + + +
+

Indicates that the request should not be served by a local cache

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

progress(callback) → {connector.Message}

+ + + + + +
+

Get/Sets the progress callback

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
callback + + +Message~progressCallback + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + +

responseType(typeopt) → {connector.Message}

+ + + + + +
+

Get/Sets the response type which should be returned

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
type + + +string + + + + + + <optional>
+ + + + + +

The response type one of 'json'|'text'|'blob'|'arraybuffer' defaults to 'json'

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

This message object

+
+ + + +
+
+ Type +
+
+ +Message + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.Attribute.html b/doc/metamodel.Attribute.html new file mode 100644 index 00000000..3baf604d --- /dev/null +++ b/doc/metamodel.Attribute.html @@ -0,0 +1,1913 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Attribute + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Attribute

+ + + + + + +
+ +
+ +

+ metamodel.Attribute

+ + +
+ +
+
+ + + + + +

new Attribute(name, isMetadataopt)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +

The attribute name

isMetadata + + +boolean + + + + + + <optional>
+ + + + + +

true if the attribute is an metadata attribute

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) PersistentAttributeType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
BASIC + + +number + + + +
ELEMENT_COLLECTION + + +number + + + +
EMBEDDED + + +number + + + +
MANY_TO_MANY + + +number + + + +
MANY_TO_ONE + + +number + + + +
ONE_TO_MANY + + +number + + + +
ONE_TO_ONE + + +number + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isAssociation :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isCollection :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

persistentAttributeType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(abstract) getJsonValue(state, object) → {*}

+ + + + + +
+

Gets this attribute value form the object as json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object which contains the value of this attribute

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted json value

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getValue(entity) → {*}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

init(declaringType, order)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
declaringType + + +ManagedType + + + +

The type that owns this attribute

order + + +number + + + +

Position of the attribute

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(abstract) setJsonValue(state, object, jsonValue)

+ + + + + +
+

Sets this attribute value from json to the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root state

object + + +* + + + +

The object which contains the attribute

jsonValue + + +* + + + +

The json value to convert an set

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setValue(entity, value)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
value + + +* + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(abstract) toJSON() → {json}

+ + + + + +
+

Converts this attribute field to json

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The attribute description as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.BasicType.html b/doc/metamodel.BasicType.html new file mode 100644 index 00000000..264d29f7 --- /dev/null +++ b/doc/metamodel.BasicType.html @@ -0,0 +1,1432 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: BasicType + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: BasicType

+ + + + + + +
+ +
+ +

+ metamodel.BasicType

+ + +
+ +
+
+ + + + + +

new BasicType(ref, typeConstructor, noResolvingopt)

+ + + + + +
+

Creates a new instance of a native db type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
ref + + +string + + + + + + + + + +

The db ref of this type

typeConstructor + + +<*> + + + + + + + + + +

The javascript class of this type

noResolving + + +boolean + + + + + + <optional>
+ + + + + +

Indicates if this type is not the main type of the constructor

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isBasic :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEmbeddable :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEntity :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isMappedSuperclass :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

persistenceType :number

+ + + + +
+

The persistent type of this type

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

typeConstructor

+ + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

fromJsonValue(state, jsonValue, currentValueopt) → {*}

+ + + + + +
+

Merge the json data into the current object instance and returns the merged object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
state + + +Metadata + + + + + + + + + +

The root object state

jsonValue + + +json + + + + + + + + + +

The json data to merge

currentValue + + +* + + + + + + <optional>
+ + + + + +

The object where the jsonObject will be merged into, if the current object is null,
a new instance will be created

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The merged object instance

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

toJsonValue(state, object) → {json}

+ + + + + +
+

Converts the given object to json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object to convert

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted object as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.CollectionAttribute.html b/doc/metamodel.CollectionAttribute.html new file mode 100644 index 00000000..33212059 --- /dev/null +++ b/doc/metamodel.CollectionAttribute.html @@ -0,0 +1,1749 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: CollectionAttribute + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: CollectionAttribute

+ + + + + + +
+ +
+ +

+ metamodel.CollectionAttribute

+ + +
+ +
+
+ + + + + +

new CollectionAttribute(name, elementType)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +
elementType + + +Type + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

collectionType

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isAssociation :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isCollection :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

persistentAttributeType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(abstract) getJsonValue(state, object) → {*}

+ + + + + +
+

Gets this attribute value form the object as json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object which contains the value of this attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted json value

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getValue(entity) → {*}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

init(declaringType, order)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
declaringType + + +ManagedType + + + +

The type that owns this attribute

order + + +number + + + +

Position of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(abstract) setJsonValue(state, object, jsonValue)

+ + + + + +
+

Sets this attribute value from json to the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root state

object + + +* + + + +

The object which contains the attribute

jsonValue + + +* + + + +

The json value to convert an set

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setValue(entity, value)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
value + + +* + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(abstract) toJSON() → {json}

+ + + + + +
+

Converts this attribute field to json

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The attribute description as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.DbIndex.html b/doc/metamodel.DbIndex.html new file mode 100644 index 00000000..69a364d5 --- /dev/null +++ b/doc/metamodel.DbIndex.html @@ -0,0 +1,980 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: DbIndex + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: DbIndex

+ + + + + + +
+ +
+ +

+ metamodel.DbIndex

+ +

Creates a new index instance which is needed to create an
database index.

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new DbIndex(keys, uniqueopt)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
keys + + +string +| + +Object +| + +<string> + + + + + + + + + +

The name of the field which will be used for the index,
an object of an field and index type combination or
an array of objects to create an compound index

unique + + +boolean + + + + + + <optional>
+ + + + + +

Indicates if the index will be unique

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) ASC :string

+ + + + + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) DESC :string

+ + + + + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) GEO :string

+ + + + + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(static) fromJSON(json)

+ + + + + +
+

Returns DbIndex Object created from the given JSON

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
json + + +json + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

Returns a JSON representation of the Index object

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Json of this Index object

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.EmbeddableType.html b/doc/metamodel.EmbeddableType.html new file mode 100644 index 00000000..8bcb8914 --- /dev/null +++ b/doc/metamodel.EmbeddableType.html @@ -0,0 +1,2823 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: EmbeddableType + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: EmbeddableType

+ + + + + + +
+ +
+ +

+ metamodel.EmbeddableType

+ + +
+ +
+
+ + + + + +

new EmbeddableType()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isBasic :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEmbeddable :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEntity :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isMappedSuperclass :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(abstract) persistenceType :number

+ + + + +
+

The persistent type of this type

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

typeConstructor :Class.<binding.Managed>

+ + + + +
+

The Managed class

+
+ + + +
Type:
+
    +
  • + +Managed> + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

validationCode :function

+ + + + + + +
Type:
+
    +
  • + +function + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addAttribute(attr, orderopt)

+ + + + + +
+

Adds an attribute to this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
attr + + +Attribute + + + + + + + + + +

The attribute to add

order + + +number + + + + + + <optional>
+ + + + + +

Position of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

attributes() → {Iterator.<metamodel.Attribute>}

+ + + + + +
+

An iterator which returns all attributes declared by this type and inherited form all super types

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute> + + +
+
+ + + + + + + + + + +

create() → {Object}

+ + + + + +
+

Creates a new instance of the managed type, without invoking any constructors
This method is used to create object instances which are loaded form the backend

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The created instance

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + +

createObjectFactory(db) → {binding.ManagedFactory.<*>}

+ + + + + +
+

{@inheritDoc}

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
db + + +EntityManager + + + +

{@inheritDoc}

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A factory which creates embeddable objects

+
+ + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

createProxyClass()

+ + + + + +
+

{@inheritDoc}

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

fromJsonValue(state, jsonValue, currentValueopt) → {*}

+ + + + + +
+

Merge the json data into the current object instance and returns the merged object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
state + + +Metadata + + + + + + + + + +

The root object state

jsonValue + + +json + + + + + + + + + +

The json data to merge

currentValue + + +* + + + + + + <optional>
+ + + + + +

The object where the jsonObject will be merged into, if the current object is null,
a new instance will be created

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The merged object instance

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getAttribute(namenon-null) → {metamodel.Attribute}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + +

getDeclaredAttribute(val) → {metamodel.Attribute}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +string +| + +number + + + +

Name or order of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + +

init(enhancer)

+ + + + + +
+

Initialize this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
enhancer + + +Enhancer + + + +

The class enhancer
used to enhance and instantiate instance of this managed class

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

references() → {Iterator.<EntityType>}

+ + + + + +
+

Returns iterator to get all referenced entities

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<EntityType> + + +
+
+ + + + + + + + + + +

removeAttribute(name)

+ + + + + +
+

Removes an attribute from this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

The Name of the attribute which will be removed

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

Converts ths type schema to json

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

toJsonValue(state, object) → {json}

+ + + + + +
+

Converts the given object to json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object to convert

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted object as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.EntityType.Object.html b/doc/metamodel.EntityType.Object.html new file mode 100644 index 00000000..bfa55445 --- /dev/null +++ b/doc/metamodel.EntityType.Object.html @@ -0,0 +1,2991 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Object + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Object

+ + + + + + +
+ +
+ +

+ metamodel.EntityType.Object

+ + +
+ +
+
+ + + + + +

new Object()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

acl :metamodel.SingularAttribute

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

id :metamodel.SingularAttribute

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isBasic :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEmbeddable :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEntity :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isMappedSuperclass :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(abstract) persistenceType :number

+ + + + +
+

The persistent type of this type

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

typeConstructor :Class.<binding.Managed>

+ + + + +
+

The Managed class

+
+ + + +
Type:
+
    +
  • + +Managed> + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

validationCode :function

+ + + + + + +
Type:
+
    +
  • + +function + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version :metamodel.SingularAttribute

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addAttribute(attr, orderopt)

+ + + + + +
+

Adds an attribute to this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
attr + + +Attribute + + + + + + + + + +

The attribute to add

order + + +number + + + + + + <optional>
+ + + + + +

Position of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

attributes() → {Iterator.<metamodel.Attribute>}

+ + + + + +
+

An iterator which returns all attributes declared by this type and inherited form all super types

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute> + + +
+
+ + + + + + + + + + +

create() → {Object}

+ + + + + +
+

Creates a new instance of the managed type, without invoking any constructors
This method is used to create object instances which are loaded form the backend

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The created instance

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + +

createObjectFactory() → {binding.EntityFactory.<binding.Entity>}

+ + + + + +
+

{@inheritDoc}
Creates an ObjectFactory for this type and the given EntityManager

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A factory which creates entity objects

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

createProxyClass()

+ + + + + +
+

{@inheritDoc}

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

fromJsonValue(state, jsonValue, currentValueopt) → {*}

+ + + + + +
+

Merge the json data into the current object instance and returns the merged object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
state + + +Metadata + + + + + + + + + +

The root object state

jsonValue + + +json + + + + + + + + + +

The json data to merge

currentValue + + +* + + + + + + <optional>
+ + + + + +

The object where the jsonObject will be merged into, if the current object is null,
a new instance will be created

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The merged object instance

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getAttribute(namenon-null) → {metamodel.Attribute}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + +

getDeclaredAttribute(val) → {metamodel.Attribute}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +string +| + +number + + + +

Name or order of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + +

init(enhancer)

+ + + + + +
+

Initialize this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
enhancer + + +Enhancer + + + +

The class enhancer
used to enhance and instantiate instance of this managed class

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

references() → {Iterator.<EntityType>}

+ + + + + +
+

Returns iterator to get all referenced entities

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<EntityType> + + +
+
+ + + + + + + + + + +

removeAttribute(name)

+ + + + + +
+

Removes an attribute from this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

The Name of the attribute which will be removed

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

Converts ths type schema to json

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

toJsonValue(state, object) → {json}

+ + + + + +
+

Converts the given object to json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object to convert

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted object as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.EntityType.html b/doc/metamodel.EntityType.html new file mode 100644 index 00000000..cda72a9b --- /dev/null +++ b/doc/metamodel.EntityType.html @@ -0,0 +1,3084 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: EntityType + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: EntityType

+ + + + + + +
+ +
+ +

+ metamodel.EntityType

+ + +
+ +
+
+ + + + + +

new EntityType(ref, superType, typeConstructor)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ref + + +string + + + +
superType + + +EntityType + + + +
typeConstructor + + +Entity> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + +

Classes

+ +
+
Object
+
+
+ + + + + + + +

Members

+ + + +

acl :metamodel.SingularAttribute

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

id :metamodel.SingularAttribute

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isBasic :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEmbeddable :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEntity :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isMappedSuperclass :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(abstract) persistenceType :number

+ + + + +
+

The persistent type of this type

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

typeConstructor :Class.<binding.Managed>

+ + + + +
+

The Managed class

+
+ + + +
Type:
+
    +
  • + +Managed> + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

validationCode :function

+ + + + + + +
Type:
+
    +
  • + +function + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version :metamodel.SingularAttribute

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addAttribute(attr, orderopt)

+ + + + + +
+

Adds an attribute to this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
attr + + +Attribute + + + + + + + + + +

The attribute to add

order + + +number + + + + + + <optional>
+ + + + + +

Position of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

attributes() → {Iterator.<metamodel.Attribute>}

+ + + + + +
+

An iterator which returns all attributes declared by this type and inherited form all super types

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute> + + +
+
+ + + + + + + + + + +

create() → {Object}

+ + + + + +
+

Creates a new instance of the managed type, without invoking any constructors
This method is used to create object instances which are loaded form the backend

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The created instance

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + +

createObjectFactory() → {binding.EntityFactory.<binding.Entity>}

+ + + + + +
+

{@inheritDoc}
Creates an ObjectFactory for this type and the given EntityManager

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A factory which creates entity objects

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

createProxyClass()

+ + + + + +
+

{@inheritDoc}

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

fromJsonValue(state, jsonValue, currentValueopt) → {*}

+ + + + + +
+

Merge the json data into the current object instance and returns the merged object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
state + + +Metadata + + + + + + + + + +

The root object state

jsonValue + + +json + + + + + + + + + +

The json data to merge

currentValue + + +* + + + + + + <optional>
+ + + + + +

The object where the jsonObject will be merged into, if the current object is null,
a new instance will be created

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The merged object instance

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getAttribute(namenon-null) → {metamodel.Attribute}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + +

getDeclaredAttribute(val) → {metamodel.Attribute}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +string +| + +number + + + +

Name or order of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + +

init(enhancer)

+ + + + + +
+

Initialize this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
enhancer + + +Enhancer + + + +

The class enhancer
used to enhance and instantiate instance of this managed class

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

references() → {Iterator.<EntityType>}

+ + + + + +
+

Returns iterator to get all referenced entities

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<EntityType> + + +
+
+ + + + + + + + + + +

removeAttribute(name)

+ + + + + +
+

Removes an attribute from this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

The Name of the attribute which will be removed

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

Converts ths type schema to json

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

toJsonValue(state, object) → {json}

+ + + + + +
+

Converts the given object to json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object to convert

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted object as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.ListAttribute.html b/doc/metamodel.ListAttribute.html new file mode 100644 index 00000000..9816a2ea --- /dev/null +++ b/doc/metamodel.ListAttribute.html @@ -0,0 +1,1590 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ListAttribute + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ListAttribute

+ + + + + + +
+ +
+ +

+ metamodel.ListAttribute

+ + +
+ +
+
+ + + + + +

new ListAttribute(name, elementType)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +
elementType + + +Type + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isAssociation :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isCollection :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

persistentAttributeType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

getJsonValue(state, object) → {*}

+ + + + + +
+

Gets this attribute value form the object as json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object which contains the value of this attribute

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted json value

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getValue(entity) → {*}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

init(declaringType, order)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
declaringType + + +ManagedType + + + +

The type that owns this attribute

order + + +number + + + +

Position of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setJsonValue()

+ + + + + +
+

{@inheritDoc}

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setValue(entity, value)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
value + + +* + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

{@inheritDoc}

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

{@inheritDoc}

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.ManagedType.html b/doc/metamodel.ManagedType.html new file mode 100644 index 00000000..f64ba266 --- /dev/null +++ b/doc/metamodel.ManagedType.html @@ -0,0 +1,2928 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ManagedType + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ManagedType

+ + + + + + +
+ +
+ +

+ metamodel.ManagedType

+ + +
+ +
+
+ + + + + +

new ManagedType(ref, typeConstructor)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ref + + +string + + + +

or full class name

typeConstructor + + +Managed> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isBasic :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEmbeddable :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEntity :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isMappedSuperclass :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(abstract) persistenceType :number

+ + + + +
+

The persistent type of this type

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

typeConstructor :Class.<binding.Managed>

+ + + + +
+

The Managed class

+
+ + + +
Type:
+
    +
  • + +Managed> + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

typeConstructor

+ + + + +
+

The Managed class constructor

+
+ + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

validationCode :function

+ + + + + + +
Type:
+
    +
  • + +function + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addAttribute(attr, orderopt)

+ + + + + +
+

Adds an attribute to this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
attr + + +Attribute + + + + + + + + + +

The attribute to add

order + + +number + + + + + + <optional>
+ + + + + +

Position of the attribute

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

attributes() → {Iterator.<metamodel.Attribute>}

+ + + + + +
+

An iterator which returns all attributes declared by this type and inherited form all super types

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute> + + +
+
+ + + + + + + + + + +

create() → {Object}

+ + + + + +
+

Creates a new instance of the managed type, without invoking any constructors
This method is used to create object instances which are loaded form the backend

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The created instance

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + +

(abstract) createObjectFactory(db) → {binding.ManagedFactory.<*>}

+ + + + + +
+

Creates an ObjectFactory for this type and the given EntityManager

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
db + + +EntityManager + + + +

The created instances will be attached to this EntityManager

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the crated object factory for the given EntityManager

+
+ + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

(abstract) createProxyClass() → {Class.<*>}

+ + + + + +
+

Creates an ProxyClass for this type

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the crated proxy class for this type

+
+ + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

fromJsonValue(state, jsonValue, currentValueopt) → {*}

+ + + + + +
+

Merge the json data into the current object instance and returns the merged object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
state + + +Metadata + + + + + + + + + +

The root object state

jsonValue + + +json + + + + + + + + + +

The json data to merge

currentValue + + +* + + + + + + <optional>
+ + + + + +

The object where the jsonObject will be merged into, if the current object is null,
a new instance will be created

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The merged object instance

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getAttribute(namenon-null) → {metamodel.Attribute}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + +

getDeclaredAttribute(val) → {metamodel.Attribute}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
val + + +string +| + +number + + + +

Name or order of the attribute

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + +

init(enhancer)

+ + + + + +
+

Initialize this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
enhancer + + +Enhancer + + + +

The class enhancer
used to enhance and instantiate instance of this managed class

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

references() → {Iterator.<EntityType>}

+ + + + + +
+

Returns iterator to get all referenced entities

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<EntityType> + + +
+
+ + + + + + + + + + +

removeAttribute(name)

+ + + + + +
+

Removes an attribute from this type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +

The Name of the attribute which will be removed

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

Converts ths type schema to json

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

toJsonValue(state, object) → {json}

+ + + + + +
+

Converts the given object to json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object to convert

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted object as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.MapAttribute.html b/doc/metamodel.MapAttribute.html new file mode 100644 index 00000000..74d58deb --- /dev/null +++ b/doc/metamodel.MapAttribute.html @@ -0,0 +1,1716 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: MapAttribute + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: MapAttribute

+ + + + + + +
+ +
+ +

+ metamodel.MapAttribute

+ + +
+ +
+
+ + + + + +

new MapAttribute(name, keyType, elementType)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +
keyType + + +Type + + + +
elementType + + +Type + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isAssociation :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isCollection :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

persistentAttributeType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

getJsonValue(state, object) → {*}

+ + + + + +
+

Gets this attribute value form the object as json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object which contains the value of this attribute

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted json value

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getValue(entity) → {*}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

init(declaringType, order)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
declaringType + + +ManagedType + + + +

The type that owns this attribute

order + + +number + + + +

Position of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setJsonValue(state, object, jsonValue)

+ + + + + +
+

Sets this attribute value from json to the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root state

object + + +* + + + +

The object which contains the attribute

jsonValue + + +* + + + +

The json value to convert an set

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setValue(entity, value)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
value + + +* + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

{@inheritDoc}

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

{@inheritDoc}

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.Metamodel.html b/doc/metamodel.Metamodel.html new file mode 100644 index 00000000..e10793fb --- /dev/null +++ b/doc/metamodel.Metamodel.html @@ -0,0 +1,3358 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Metamodel + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Metamodel

+ + + + + + +
+ +
+ +

+ metamodel.Metamodel

+ + +
+ +
+
+ + + + + +

new Metamodel()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isReady :boolean

+ + + + +
+

Indicates if there is currently no exclusive operation executed
true If no exclusive lock is hold

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

_getRef(arg) → {string}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
arg + + +Managed> +| + +string + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +

addType(type) → {metamodel.Type}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +Type + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the added type

+
+ + + +
+
+ Type +
+
+ +Type + + +
+
+ + + + + + + + + + +

baseType(typeConstructor) → {metamodel.BasicType}

+ + + + + +
+

Return the metamodel basic type representing the native class.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
typeConstructor + + +<*> +| + +string + + + +

the type of the represented native class

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the metamodel basic type

+
+ + + +
+
+ Type +
+
+ +BasicType + + +
+
+ + + + + + + + + + +

createIndex(bucket, index) → {Promise.<*>}

+ + + + + +
+

Creates an index

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +string + + + +

Name of the Bucket

index + + +DbIndex + + + +

Will be applied for the given bucket

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

dropAllIndexes(bucket) → {Promise.<*>}

+ + + + + +
+

Drops all indexes

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +string + + + +

Indexes will be dropped for the given bucket

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

dropIndex(bucket, index) → {Promise.<*>}

+ + + + + +
+

Drops an index

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +string + + + +

Name of the Bucket

index + + +DbIndex + + + +

Will be dropped for the given bucket

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

embeddable(typeConstructor) → {metamodel.EmbeddableType}

+ + + + + +
+

Return the metamodel embeddable type representing the embeddable class.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
typeConstructor + + +Managed> +| + +string + + + +

the type of the represented embeddable class

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the metamodel embeddable type

+
+ + + +
+
+ Type +
+
+ +EmbeddableType + + +
+
+ + + + + + + + + + +

entity(typeConstructor) → {metamodel.EntityType}

+ + + + + +
+

Return the metamodel entity type representing the entity.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
typeConstructor + + +Entity> +| + +string + + + +

the type of the represented entity

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the metamodel entity type

+
+ + + +
+
+ Type +
+
+ +EntityType + + +
+
+ + + + + + + + + + +

fromJSON(json)

+ + + + + +
+

Replace the current schema by the provided one in json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
json + + +json + + + +

The json schema data

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

getIndexes(bucket) → {Promise.<Array.<metamodel.DbIndex>>}

+ + + + + +
+

Loads all indexes for the given bucket

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
bucket + + +string + + + +

Current indexes will be loaded for the given bucket

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +DbIndex>> + + +
+
+ + + + + + + + + + +

init(jsonMetamodelopt)

+ + + + + +
+

Prepare the Metamodel for custom schema creation

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
jsonMetamodel + + +Object + + + + + + <optional>
+ + + + + +

initialize the metamodel with the serialized json schema

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

load() → {Promise.<metamodel.Metamodel>}

+ + + + + +
+

Load all schema data from the server

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Metamodel> + + +
+
+ + + + + + + + + + +

managedType(typeConstructor) → {metamodel.Type}

+ + + + + +
+

Return the metamodel managed type representing the entity, mapped superclass, or embeddable class.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
typeConstructor + + +Managed> +| + +string + + + +

the type of the represented managed class

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the metamodel managed type

+
+ + + +
+
+ Type +
+
+ +Type + + +
+
+ + + + + + + + + + +

ready(doneCallbackopt, failCallbackopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

failCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

When the lock can't be released caused by a none
recoverable error

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + +

save(managedTypeopt) → {Promise.<metamodel.Metamodel>}

+ + + + + +
+

Store all local schema data on the server, or the provided one

+

Note: The schema must be initialized, by init or load

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
managedType + + +ManagedType + + + + + + <optional>
+ + + + + +

The specific type to persist, if omitted the complete schema will be updated

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Metamodel> + + +
+
+ + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

Get the current schema types as json

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

the json data

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

update(data) → {Promise.<metamodel.Metamodel>}

+ + + + + +
+

The provided options object will be forwarded to the UpdateAllSchemas resource.
The underlying schema of this Metamodel object will be replaced by the result.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
data + + +json + + + +

The JSON which will be send to the UpdateAllSchemas resource.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Metamodel> + + +
+
+ + + + + + + + + + +

(protected) withLock(callback, criticalopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Try to aquire an exclusive lock and executes the given callback.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
callback + + +Lockable~callback + + + + + + + + + + + +

The exclusive operation to execute

critical + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Indicates if the operation is critical. If the operation is critical and the
operation fails, then the lock will not be released

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Throws:
+ + + +
+
+
+

If the lock can't be aquired

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

A promise

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.ModelBuilder.html b/doc/metamodel.ModelBuilder.html new file mode 100644 index 00000000..251520c8 --- /dev/null +++ b/doc/metamodel.ModelBuilder.html @@ -0,0 +1,1247 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ModelBuilder + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ModelBuilder

+ + + + + + +
+ +
+ +

+ metamodel.ModelBuilder

+ + +
+ +
+
+ + + + + +

new ModelBuilder(metamodel)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
metamodel + + +Metamodel + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

buildAttribute(model, name, ref) → {metamodel.Attribute}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
model + + +EntityType + + + +
name + + +string + + + +
ref + + +string + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Attribute + + +
+
+ + + + + + + + + + +

buildAttributes(model)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
model + + +EntityType + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

buildModel(ref) → {metamodel.ManagedType}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ref + + +string + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +ManagedType + + +
+
+ + + + + + + + + + +

buildModels(modelDescriptors) → {Object.<string, metamodel.ManagedType>}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
modelDescriptors + + +<Object> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +ManagedType> + + +
+
+ + + + + + + + + + +

getModel(ref) → {metamodel.ManagedType}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ref + + +string + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +ManagedType + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.PluralAttribute.html b/doc/metamodel.PluralAttribute.html new file mode 100644 index 00000000..d9f65a55 --- /dev/null +++ b/doc/metamodel.PluralAttribute.html @@ -0,0 +1,1880 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: PluralAttribute + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: PluralAttribute

+ + + + + + +
+ +
+ +

+ metamodel.PluralAttribute

+ + +
+ +
+
+ + + + + +

new PluralAttribute(name, elementType)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +
elementType + + +Type + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

(static) CollectionType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
COLLECTION + + +number + + + +
LIST + + +number + + + +
MAP + + +number + + + +
SET + + +number + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isAssociation :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isCollection :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

persistentAttributeType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(abstract) getJsonValue(state, object) → {*}

+ + + + + +
+

Gets this attribute value form the object as json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object which contains the value of this attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted json value

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getValue(entity) → {*}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

init(declaringType, order)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
declaringType + + +ManagedType + + + +

The type that owns this attribute

order + + +number + + + +

Position of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(abstract) setJsonValue(state, object, jsonValue)

+ + + + + +
+

Sets this attribute value from json to the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root state

object + + +* + + + +

The object which contains the attribute

jsonValue + + +* + + + +

The json value to convert an set

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setValue(entity, value)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
value + + +* + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(abstract) toJSON() → {json}

+ + + + + +
+

Converts this attribute field to json

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The attribute description as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.SetAttribute.html b/doc/metamodel.SetAttribute.html new file mode 100644 index 00000000..395eaef7 --- /dev/null +++ b/doc/metamodel.SetAttribute.html @@ -0,0 +1,1590 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: SetAttribute + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: SetAttribute

+ + + + + + +
+ +
+ +

+ metamodel.SetAttribute

+ + +
+ +
+
+ + + + + +

new SetAttribute(name, elementType)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
name + + +string + + + +
elementType + + +Type + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isAssociation :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isCollection :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

persistentAttributeType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

getJsonValue(state, object) → {*}

+ + + + + +
+

Gets this attribute value form the object as json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object which contains the value of this attribute

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted json value

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getValue(entity) → {*}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

init(declaringType, order)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
declaringType + + +ManagedType + + + +

The type that owns this attribute

order + + +number + + + +

Position of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setJsonValue()

+ + + + + +
+

{@inheritDoc}

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setValue(entity, value)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
value + + +* + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

{@inheritDoc}

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

{@inheritDoc}

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.SingularAttribute.html b/doc/metamodel.SingularAttribute.html new file mode 100644 index 00000000..9cadbad8 --- /dev/null +++ b/doc/metamodel.SingularAttribute.html @@ -0,0 +1,1744 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: SingularAttribute + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: SingularAttribute

+ + + + + + +
+ +
+ +

+ metamodel.SingularAttribute

+ + +
+ +
+
+ + + + + +

new SingularAttribute(name, type, isMetadataopt)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
name + + +string + + + + + + + + + +
type + + +Type + + + + + + + + + +
isMetadata + + +boolean + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

isAssociation :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isCollection :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

persistentAttributeType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

getJsonValue(state, object) → {*}

+ + + + + +
+

Gets this attribute value form the object as json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object which contains the value of this attribute

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted json value

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

getValue(entity) → {*}

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

init(declaringType, order)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
declaringType + + +ManagedType + + + +

The type that owns this attribute

order + + +number + + + +

Position of the attribute

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setJsonValue(state, object, jsonValue)

+ + + + + +
+

Sets this attribute value from json to the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root state

object + + +* + + + +

The object which contains the attribute

jsonValue + + +* + + + +

The json value to convert an set

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setValue(entity, value)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Object + + + +
value + + +* + + + +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

Converts this attribute field to json

+
+ + + + + + + + + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The attribute description as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.Type.html b/doc/metamodel.Type.html new file mode 100644 index 00000000..cdd31b6a --- /dev/null +++ b/doc/metamodel.Type.html @@ -0,0 +1,1571 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Type + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Type

+ + + + + + +
+ +
+ +

+ metamodel.Type

+ + +
+ +
+
+ + + + + +

new Type(ref, typeConstructor)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
ref + + +string + + + +
typeConstructor + + +<*> + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) PersistenceType :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
BASIC + + +number + + + +
EMBEDDABLE + + +number + + + +
ENTITY + + +number + + + +
MAPPED_SUPERCLASS + + +number + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isBasic :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEmbeddable :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isEntity :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isMappedSuperclass :boolean

+ + + + + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(abstract) persistenceType :number

+ + + + +
+

The persistent type of this type

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

typeConstructor

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

typeConstructor

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(abstract) fromJsonValue(state, jsonValue, currentValueopt) → {*}

+ + + + + +
+

Merge the json data into the current object instance and returns the merged object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
state + + +Metadata + + + + + + + + + +

The root object state

jsonValue + + +json + + + + + + + + + +

The json data to merge

currentValue + + +* + + + + + + <optional>
+ + + + + +

The object where the jsonObject will be merged into, if the current object is null,
a new instance will be created

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The merged object instance

+
+ + + +
+
+ Type +
+
+ +* + + +
+
+ + + + + + + + + + +

(abstract) toJsonValue(state, object) → {json}

+ + + + + +
+

Converts the given object to json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
state + + +Metadata + + + +

The root object state

object + + +* + + + +

The object to convert

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The converted object as json

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/metamodel.html b/doc/metamodel.html new file mode 100644 index 00000000..eb27d2cf --- /dev/null +++ b/doc/metamodel.html @@ -0,0 +1,443 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Namespace: metamodel + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Namespace: metamodel

+ + + + + + +
+ +
+ +

metamodel

+ + +
+ + + +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:29 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/model.Device.html b/doc/model.Device.html new file mode 100644 index 00000000..162c3078 --- /dev/null +++ b/doc/model.Device.html @@ -0,0 +1,3441 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Interface: Device + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Interface: Device

+ + + + + + +
+ +
+ +

+ model.Device

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

acl :Acl

+ + + + +
+

The object read/write permissions

+
+ + + +
Type:
+
    +
  • + +Acl + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

id :string

+ + + + +
+

The unique id of this object

+

Sets the unique id of this object, if the id is not formatted as an valid id,
it will be used as the key component of the id has the same affect as setting the key

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key :string

+ + + + +
+

The unique key part of the id
When the key of the unique id is set an error will be thrown if an id is already set.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version :number

+ + + + +
+

The version of this object

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

attach(db)

+ + + + + +
+

Attach this object to the given db

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
db + + +EntityManager + + + +

The db which will be used for future crud operations

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

delete(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Delete an existing object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The remove options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the remove operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be removed. Depth 0 removes this object only,
true removes objects by reachability.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

insert(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Inserts a new object. Inserts the object if it doesn't exists and raise an error if the object already exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The insertion options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be inserted. Depth 0 insert this object only,
true inserts objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

load(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Resolves the referenced object in the specified depth. Only unresolved objects will be loaded unless the refresh option is specified.
Removed objects will be marked as removed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The load options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be loaded. Depth set to true
loads objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

optimisticSave(cb, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object and repeats the operation if the object is out of date.
In each pass the callback will be called. Ths first parameter of the callback is the entity and the second one
is a function to abort the process.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
cb + + +function + + + + + + + + + +

Will be called in each pass

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

ready(doneCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

save(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object. Inserts the object if it doesn't exists and updates the object if the object exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The save options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the save operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be saved. Depth 0 save this object only,
true saves the objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

toJSON(excludeMetadataopt) → {json}

+ + + + + +
+

Converts the entity to an JSON-Object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
excludeMetadata + + +boolean + + + + + + <optional>
+ + + + + +

Indicates if the metadata i.e. id, version and acls should not be included into the json

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

JSON-Object

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

update(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Updates an existing object.
Updates the object if it exists and raise an error if the object doesn't exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The update options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the update operation, the version will not be validated, only existence will be checked.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be updated. Depth 0 updates this object only,
true updates objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

validate() → {util.ValidationResult}

+ + + + + +
+

Validates the entity by using the validation code of the entity type

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Contains the result of the Validation

+
+ + + +
+
+ Type +
+
+ +ValidationResult + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/model.Role.html b/doc/model.Role.html new file mode 100644 index 00000000..bbbba8c5 --- /dev/null +++ b/doc/model.Role.html @@ -0,0 +1,3980 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Interface: Role + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Interface: Role

+ + + + + + +
+ +
+ +

+ model.Role

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

acl :Acl

+ + + + +
+

The object read/write permissions

+
+ + + +
Type:
+
    +
  • + +Acl + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

id :string

+ + + + +
+

The unique id of this object

+

Sets the unique id of this object, if the id is not formatted as an valid id,
it will be used as the key component of the id has the same affect as setting the key

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key :string

+ + + + +
+

The unique key part of the id
When the key of the unique id is set an error will be thrown if an id is already set.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

name :string

+ + + + +
+

The name of the role

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

users :Set.<model.User>

+ + + + +
+

A set of users which have this role

+
+ + + +
Type:
+
    +
  • + +User> + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version :number

+ + + + +
+

The version of this object

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

addUser(user)

+ + + + + +
+

Add the given user to this role

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + +

The user to add

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

attach(db)

+ + + + + +
+

Attach this object to the given db

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
db + + +EntityManager + + + +

The db which will be used for future crud operations

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

delete(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Delete an existing object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The remove options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the remove operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be removed. Depth 0 removes this object only,
true removes objects by reachability.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

hasUser() → {boolean}

+ + + + + +
+

Test if the given user has this role

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

true if the given user has this role,
otherwise false

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

insert(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Inserts a new object. Inserts the object if it doesn't exists and raise an error if the object already exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The insertion options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be inserted. Depth 0 insert this object only,
true inserts objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

load(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Resolves the referenced object in the specified depth. Only unresolved objects will be loaded unless the refresh option is specified.
Removed objects will be marked as removed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The load options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be loaded. Depth set to true
loads objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

optimisticSave(cb, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object and repeats the operation if the object is out of date.
In each pass the callback will be called. Ths first parameter of the callback is the entity and the second one
is a function to abort the process.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
cb + + +function + + + + + + + + + +

Will be called in each pass

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

ready(doneCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

removeUser(user)

+ + + + + +
+

Remove the given user from this role

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
user + + +User + + + +

The user to remove

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

save(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object. Inserts the object if it doesn't exists and updates the object if the object exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The save options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the save operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be saved. Depth 0 save this object only,
true saves the objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

toJSON(excludeMetadataopt) → {json}

+ + + + + +
+

Converts the entity to an JSON-Object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
excludeMetadata + + +boolean + + + + + + <optional>
+ + + + + +

Indicates if the metadata i.e. id, version and acls should not be included into the json

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

JSON-Object

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

update(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Updates an existing object.
Updates the object if it exists and raise an error if the object doesn't exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The update options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the update operation, the version will not be validated, only existence will be checked.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be updated. Depth 0 updates this object only,
true updates objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

validate() → {util.ValidationResult}

+ + + + + +
+

Validates the entity by using the validation code of the entity type

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Contains the result of the Validation

+
+ + + +
+
+ Type +
+
+ +ValidationResult + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/model.User.html b/doc/model.User.html new file mode 100644 index 00000000..a8b18275 --- /dev/null +++ b/doc/model.User.html @@ -0,0 +1,3864 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Interface: User + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Interface: User

+ + + + + + +
+ +
+ +

+ model.User

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

acl :Acl

+ + + + +
+

The object read/write permissions

+
+ + + +
Type:
+
    +
  • + +Acl + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

id :string

+ + + + +
+

The unique id of this object

+

Sets the unique id of this object, if the id is not formatted as an valid id,
it will be used as the key component of the id has the same affect as setting the key

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

inactive :boolean

+ + + + +
+

Indicates if the user is currently inactive, which disallow user login

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key :string

+ + + + +
+

The unique key part of the id
When the key of the unique id is set an error will be thrown if an id is already set.

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

username :string

+ + + + +
+

The users username or email address

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

version :number

+ + + + +
+

The version of this object

+
+ + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

attach(db)

+ + + + + +
+

Attach this object to the given db

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
db + + +EntityManager + + + +

The db which will be used for future crud operations

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

delete(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Delete an existing object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The remove options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the remove operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be removed. Depth 0 removes this object only,
true removes objects by reachability.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

insert(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Inserts a new object. Inserts the object if it doesn't exists and raise an error if the object already exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The insertion options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be inserted. Depth 0 insert this object only,
true inserts objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

load(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Resolves the referenced object in the specified depth. Only unresolved objects will be loaded unless the refresh option is specified.
Removed objects will be marked as removed.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The load options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be loaded. Depth set to true
loads objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

newPassword(currentPassword, password, doneCallbackopt, failCallbackopt) → {Promise.<model.User>}

+ + + + + +
+

Change the password of the given user

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
currentPassword + + +string + + + + + + + + + +

Current password of the user

password + + +string + + + + + + + + + +

New password of the user

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +User> + + +
+
+ + + + + + + + + + +

optimisticSave(cb, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object and repeats the operation if the object is out of date.
In each pass the callback will be called. Ths first parameter of the callback is the entity and the second one
is a function to abort the process.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
cb + + +function + + + + + + + + + +

Will be called in each pass

doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

ready(doneCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

save(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Saves the object. Inserts the object if it doesn't exists and updates the object if the object exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The save options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the save operation, the version will not be validated.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be saved. Depth 0 save this object only,
true saves the objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

toJSON(excludeMetadataopt) → {json}

+ + + + + +
+

Converts the entity to an JSON-Object.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
excludeMetadata + + +boolean + + + + + + <optional>
+ + + + + +

Indicates if the metadata i.e. id, version and acls should not be included into the json

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

JSON-Object

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

update(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<binding.Entity>}

+ + + + + +
+

Updates an existing object.
Updates the object if it exists and raise an error if the object doesn't exist.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The update options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
force + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Force the update operation, the version will not be validated, only existence will be checked.

depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be updated. Depth 0 updates this object only,
true updates objects by reachability.

refresh + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Refresh the local object state from remote.

+ +
doneCallback + + +Entity~doneCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Entity~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise that will be fulfilled when the asynchronous operation completes.

+
+ + + +
+
+ Type +
+
+ +Entity> + + +
+
+ + + + + + + + + + +

validate() → {util.ValidationResult}

+ + + + + +
+

Validates the entity by using the validation code of the entity type

+
+ + + + + + + + + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Contains the result of the Validation

+
+ + + +
+
+ Type +
+
+ +ValidationResult + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/model.html b/doc/model.html new file mode 100644 index 00000000..dd72fa4e --- /dev/null +++ b/doc/model.html @@ -0,0 +1,394 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Namespace: model + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Namespace: model

+ + + + + + +
+ +
+ +

model

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/query.Builder.html b/doc/query.Builder.html new file mode 100644 index 00000000..b361a446 --- /dev/null +++ b/doc/query.Builder.html @@ -0,0 +1,7742 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Builder<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Builder

+ + + + + + +
+ +
+ +

+ query.Builder

+ + +
+ +
+
+ + + + + +

new Builder(entityManager, resultClass)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entityManager + + +EntityManager + + + +

The owning entity manager of this query

resultClass + + +<T> + + + +

The query result class

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + +

and(…args) → {query.Query.<T>}

+ + + + + +
+

Joins the conditions by an logical AND

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +<T> +| + +<T>> + + + + + + + + + + <repeatable>
+ +

The query nodes to join

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Returns a new query which joins the given queries by a logical AND

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

ascending(field) → {query.Query.<T>}

+ + + + + +
+

Add an ascending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

between(field, lessValue, greaterValue) → {query.Filter.<T>}

+ + + + + +
+

Adds a between filter to the field. This is a shorthand for an less than and greater than filter.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

lessValue + + +number +| + +string +| + +Date + + + +

The field value must be greater than this value

greaterValue + + +number +| + +string +| + +Date + + + +

The field value must be less than this value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

containsAll(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a contains all filter to the collection field. The collection must contain all the given values.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

containsAny(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a contains any filter to the collection field. The collection must contains one the given values.
Alias for query.Condition#in

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

count(doneCallbackopt, failCallbackopt) → {Promise.<number>}

+ + + + + +
+

Execute the query that returns the matching objects count.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~countCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The total number of matched objects

+
+ + + +
+
+ Type +
+
+ +<number> + + +
+
+ + + + + + + + + + +

descending(field) → {query.Query.<T>}

+ + + + + +
+

Add an decending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

eq(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a equal filter to the field. All other other filters on the field will be discarded

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

equal(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a equal filter to the field. All other other filters on the field will be discarded

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

ge(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than or equal to filter to the field. Shorthand for query.Condition#greaterThanOrEqualTo.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

greaterThan(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

greaterThanOrEqualTo(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than or equal to filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

gt(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than filter to the field. Shorthand for query.Condition#greaterThan.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

in(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a in filter to the field. The field value must be equal to one of the given values

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

isNotNull(field) → {query.Filter.<T>}

+ + + + + +
+

Adds a not null filter to the field. The field value must not be null

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

isNull(field) → {query.Filter.<T>}

+ + + + + +
+

Adds a null filter to the field. The field value must be null

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

le(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than or equal to filter to the field. Shorthand for query.Condition#lessThanOrEqualTo.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

lessThan(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

lessThanOrEqualTo(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than or equal to filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

limit(limit) → {query.Query.<T>}

+ + + + + +
+

Sets the limit of this query, i.e hox many objects should be returnd

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
limit + + +number + + + +

The limit of this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

lt(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than filter to the field. Shorthand for query.Condition#lessThan.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

matches(field, regExp) → {query.Filter.<T>}

+ + + + + +
+

Adds a regular expression filter to the field. The field value must matches the regular expression.

+

Note: Only anchored expressions (Expressions that starts with an ^) and the multiline flag are supported.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

regExp + + +string +| + +RegExp + + + +

The regular expression of the filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

mod(field, divisor, remainder) → {query.Filter.<T>}

+ + + + + +
+

Adds a modulo filter to the field. The field value divided by divisor must be equal to the remainder.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

divisor + + +number + + + +

The divisor of the modulo filter

remainder + + +number + + + +

The remainder of the modulo filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

ne(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a not equal filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

near(field, geoPoint, maxDistance) → {query.Filter.<T>}

+ + + + + +
+

Adds a geopoint based near filter to the GeoPoint field. The GeoPoint must be within the maximum distance
to the given GeoPoint. Returns from nearest to farthest.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

geoPoint + + +GeoPoint + + + +

The GeoPoint to filter

maxDistance + + +number + + + +

Tha maximum distance to filter in meters

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

nor(…args) → {query.Query.<T>}

+ + + + + +
+

Joins the conditions by an logical NOR

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +<T> +| + +<T>> + + + + + + + + + + <repeatable>
+ +

The query nodes to join

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Returns a new query which joins the given queries by a logical NOR

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

notEqual(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a not equal filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

notIn(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a not in filter to the field. The field value must not be equal to any of the given values

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

offset(offset) → {query.Query.<T>}

+ + + + + +
+

Sets the offset of the query, i.e. how many elements should be skipped

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
offset + + +number + + + +

The offset of this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

or(…args) → {query.Query.<T>}

+ + + + + +
+

Joins the conditions by an logical OR

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
args + + +<T> +| + +<T>> + + + + + + + + + + <repeatable>
+ +

The query nodes to join

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

Returns a new query which joins the given queries by a logical OR

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

resultList(doneCallbackopt, failCallbackopt) → {Promise.<Array.<T>>}

+ + + + + +
+

Execute the query and return the query results as a List.
Note: All local unsaved changes on matching objects, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~resultListCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a list

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + +

singleResult(doneCallbackopt, failCallbackopt) → {Promise.<T>}

+ + + + + +
+

Execute the query that returns a single result.
Note: All local unsaved changes on the matched object, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~singleResultCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a single result

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

size(field, size) → {query.Filter.<T>}

+ + + + + +
+

Adds a size filter to the collection field. The collection must have exactly size members.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

size + + +number + + + +

The collections size to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

sort(sort) → {query.Query.<T>}

+ + + + + +
+

Sets the sort of the query and discard all existing paramaters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sort + + +Object + + + +

The new sort of the query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

stream(optionsopt) → {Observable.<StreamingEvent.<T>>}

+ + + + + +
+

Returns an RxJS observable that receives events for streaming query.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

options on whether an initial result and what kind of events (w.r.t. match types and operations) are requested

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
initial + + +boolean + + + + + + <optional>
+ + + + + +
+ + true + +

whether or not you want to receive the initial result set (i.e. the entities matching the query at subscription time)

matchTypes + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['all'] + +

the match types you are interested in; accepts the default ('all'/['all']) or any combination of 'match', 'add', 'change', 'changeIndex' and 'remove'

operations + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['any'] + +

the operations you are interested in; accepts the default ('any'/['any']) or any combination of 'insert', 'update', 'delete' and 'none'

+ +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

an RxJS observable

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + +

where(conditions) → {query.Filter.<T>}

+ + + + + +
+

An object, that contains filter rules which will be merged with the current filters of this query.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
conditions + + +json + + + +

Additional filters for this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

withinPolygon(field, …geoPoints) → {query.Filter.<T>}

+ + + + + +
+

Adds a GeoPoint based polygon filter to the GeoPoint field. The GeoPoint must be contained within the polygon.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

geoPoints + + +GeoPoint +| + +<GeoPoint> + + + + + + + + + + <repeatable>
+ +

The geoPoints that describes the polygon of the filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/query.Condition.html b/doc/query.Condition.html new file mode 100644 index 00000000..bb668a10 --- /dev/null +++ b/doc/query.Condition.html @@ -0,0 +1,5314 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Condition<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Condition

+ + + + + + +
+ +
+ +

+ query.Condition

+ + +
+ +
+
+ + + + + +

new Condition()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

in

+ + + + +
+

Adds a in filter to the field. The field value must be equal to one of the given values

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

between(field, lessValue, greaterValue) → {query.Filter.<T>}

+ + + + + +
+

Adds a between filter to the field. This is a shorthand for an less than and greater than filter.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

lessValue + + +number +| + +string +| + +Date + + + +

The field value must be greater than this value

greaterValue + + +number +| + +string +| + +Date + + + +

The field value must be less than this value

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

containsAll(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a contains all filter to the collection field. The collection must contain all the given values.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

containsAny(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a contains any filter to the collection field. The collection must contains one the given values.
Alias for query.Condition#in

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

eq(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a equal filter to the field. All other other filters on the field will be discarded

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

equal(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a equal filter to the field. All other other filters on the field will be discarded

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

ge(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than or equal to filter to the field. Shorthand for query.Condition#greaterThanOrEqualTo.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

greaterThan(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

greaterThanOrEqualTo(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than or equal to filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

gt(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than filter to the field. Shorthand for query.Condition#greaterThan.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

in(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a in filter to the field. The field value must be equal to one of the given values

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

isNotNull(field) → {query.Filter.<T>}

+ + + + + +
+

Adds a not null filter to the field. The field value must not be null

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

isNull(field) → {query.Filter.<T>}

+ + + + + +
+

Adds a null filter to the field. The field value must be null

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

le(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than or equal to filter to the field. Shorthand for query.Condition#lessThanOrEqualTo.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

lessThan(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

lessThanOrEqualTo(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than or equal to filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

lt(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than filter to the field. Shorthand for query.Condition#lessThan.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

matches(field, regExp) → {query.Filter.<T>}

+ + + + + +
+

Adds a regular expression filter to the field. The field value must matches the regular expression.

+

Note: Only anchored expressions (Expressions that starts with an ^) and the multiline flag are supported.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

regExp + + +string +| + +RegExp + + + +

The regular expression of the filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

mod(field, divisor, remainder) → {query.Filter.<T>}

+ + + + + +
+

Adds a modulo filter to the field. The field value divided by divisor must be equal to the remainder.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

divisor + + +number + + + +

The divisor of the modulo filter

remainder + + +number + + + +

The remainder of the modulo filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

ne(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a not equal filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

near(field, geoPoint, maxDistance) → {query.Filter.<T>}

+ + + + + +
+

Adds a geopoint based near filter to the GeoPoint field. The GeoPoint must be within the maximum distance
to the given GeoPoint. Returns from nearest to farthest.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

geoPoint + + +GeoPoint + + + +

The GeoPoint to filter

maxDistance + + +number + + + +

Tha maximum distance to filter in meters

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

notEqual(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a not equal filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

notIn(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a not in filter to the field. The field value must not be equal to any of the given values

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

size(field, size) → {query.Filter.<T>}

+ + + + + +
+

Adds a size filter to the collection field. The collection must have exactly size members.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

size + + +number + + + +

The collections size to filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

where(conditions) → {query.Filter.<T>}

+ + + + + +
+

An object, that contains filter rules which will be merged with the current filters of this query.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
conditions + + +json + + + +

Additional filters for this query

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

withinPolygon(field, …geoPoints) → {query.Filter.<T>}

+ + + + + +
+

Adds a GeoPoint based polygon filter to the GeoPoint field. The GeoPoint must be contained within the polygon.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

geoPoints + + +GeoPoint +| + +<GeoPoint> + + + + + + + + + + <repeatable>
+ +

The geoPoints that describes the polygon of the filter

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/query.Filter.html b/doc/query.Filter.html new file mode 100644 index 00000000..6e82e1af --- /dev/null +++ b/doc/query.Filter.html @@ -0,0 +1,7232 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Filter<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Filter

+ + + + + + +
+ +
+ +

+ query.Filter

+ + +
+ +
+
+ + + + + +

new Filter(entityManager, resultClass)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entityManager + + +EntityManager + + + +

The owning entity manager of this query

resultClass + + +<T> + + + +

The query result class

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + +

ascending(field) → {query.Query.<T>}

+ + + + + +
+

Add an ascending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

between(field, lessValue, greaterValue) → {query.Filter.<T>}

+ + + + + +
+

Adds a between filter to the field. This is a shorthand for an less than and greater than filter.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

lessValue + + +number +| + +string +| + +Date + + + +

The field value must be greater than this value

greaterValue + + +number +| + +string +| + +Date + + + +

The field value must be less than this value

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

containsAll(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a contains all filter to the collection field. The collection must contain all the given values.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

containsAny(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a contains any filter to the collection field. The collection must contains one the given values.
Alias for query.Condition#in

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

count(doneCallbackopt, failCallbackopt) → {Promise.<number>}

+ + + + + +
+

Execute the query that returns the matching objects count.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~countCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The total number of matched objects

+
+ + + +
+
+ Type +
+
+ +<number> + + +
+
+ + + + + + + + + + +

descending(field) → {query.Query.<T>}

+ + + + + +
+

Add an decending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

eq(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a equal filter to the field. All other other filters on the field will be discarded

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

equal(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a equal filter to the field. All other other filters on the field will be discarded

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

ge(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than or equal to filter to the field. Shorthand for query.Condition#greaterThanOrEqualTo.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

greaterThan(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

greaterThanOrEqualTo(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than or equal to filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

gt(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a greater than filter to the field. Shorthand for query.Condition#greaterThan.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

in(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a in filter to the field. The field value must be equal to one of the given values

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

isNotNull(field) → {query.Filter.<T>}

+ + + + + +
+

Adds a not null filter to the field. The field value must not be null

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

isNull(field) → {query.Filter.<T>}

+ + + + + +
+

Adds a null filter to the field. The field value must be null

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

le(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than or equal to filter to the field. Shorthand for query.Condition#lessThanOrEqualTo.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

lessThan(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

lessThanOrEqualTo(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than or equal to filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

limit(limit) → {query.Query.<T>}

+ + + + + +
+

Sets the limit of this query, i.e hox many objects should be returnd

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
limit + + +number + + + +

The limit of this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

lt(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a less than filter to the field. Shorthand for query.Condition#lessThan.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +number +| + +string +| + +Date + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

matches(field, regExp) → {query.Filter.<T>}

+ + + + + +
+

Adds a regular expression filter to the field. The field value must matches the regular expression.

+

Note: Only anchored expressions (Expressions that starts with an ^) and the multiline flag are supported.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

regExp + + +string +| + +RegExp + + + +

The regular expression of the filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

mod(field, divisor, remainder) → {query.Filter.<T>}

+ + + + + +
+

Adds a modulo filter to the field. The field value divided by divisor must be equal to the remainder.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

divisor + + +number + + + +

The divisor of the modulo filter

remainder + + +number + + + +

The remainder of the modulo filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

ne(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a not equal filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

near(field, geoPoint, maxDistance) → {query.Filter.<T>}

+ + + + + +
+

Adds a geopoint based near filter to the GeoPoint field. The GeoPoint must be within the maximum distance
to the given GeoPoint. Returns from nearest to farthest.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

geoPoint + + +GeoPoint + + + +

The GeoPoint to filter

maxDistance + + +number + + + +

Tha maximum distance to filter in meters

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

notEqual(field, value) → {query.Filter.<T>}

+ + + + + +
+

Adds a not equal filter to the field.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

value + + +* + + + +

The value used to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

notIn(field, …args) → {query.Filter.<T>}

+ + + + + +
+

Adds a not in filter to the field. The field value must not be equal to any of the given values

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

args + + +* +| + +<*> + + + + + + + + + + <repeatable>
+ +

The field value or values to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

offset(offset) → {query.Query.<T>}

+ + + + + +
+

Sets the offset of the query, i.e. how many elements should be skipped

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
offset + + +number + + + +

The offset of this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

resultList(doneCallbackopt, failCallbackopt) → {Promise.<Array.<T>>}

+ + + + + +
+

Execute the query and return the query results as a List.
Note: All local unsaved changes on matching objects, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~resultListCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a list

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + +

singleResult(doneCallbackopt, failCallbackopt) → {Promise.<T>}

+ + + + + +
+

Execute the query that returns a single result.
Note: All local unsaved changes on the matched object, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~singleResultCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a single result

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

size(field, size) → {query.Filter.<T>}

+ + + + + +
+

Adds a size filter to the collection field. The collection must have exactly size members.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to filter

size + + +number + + + +

The collections size to filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

sort(sort) → {query.Query.<T>}

+ + + + + +
+

Sets the sort of the query and discard all existing paramaters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sort + + +Object + + + +

The new sort of the query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

stream(optionsopt) → {Observable.<StreamingEvent.<T>>}

+ + + + + +
+

Returns an RxJS observable that receives events for streaming query.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

options on whether an initial result and what kind of events (w.r.t. match types and operations) are requested

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
initial + + +boolean + + + + + + <optional>
+ + + + + +
+ + true + +

whether or not you want to receive the initial result set (i.e. the entities matching the query at subscription time)

matchTypes + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['all'] + +

the match types you are interested in; accepts the default ('all'/['all']) or any combination of 'match', 'add', 'change', 'changeIndex' and 'remove'

operations + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['any'] + +

the operations you are interested in; accepts the default ('any'/['any']) or any combination of 'insert', 'update', 'delete' and 'none'

+ +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

an RxJS observable

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + +

where(conditions) → {query.Filter.<T>}

+ + + + + +
+

An object, that contains filter rules which will be merged with the current filters of this query.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
conditions + + +json + + + +

Additional filters for this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

withinPolygon(field, …geoPoints) → {query.Filter.<T>}

+ + + + + +
+

Adds a GeoPoint based polygon filter to the GeoPoint field. The GeoPoint must be contained within the polygon.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
field + + +string + + + + + + + + + +

The field to filter

geoPoints + + +GeoPoint +| + +<GeoPoint> + + + + + + + + + + <repeatable>
+ +

The geoPoints that describes the polygon of the filter

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/query.Node.html b/doc/query.Node.html new file mode 100644 index 00000000..6214012b --- /dev/null +++ b/doc/query.Node.html @@ -0,0 +1,2293 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Node<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Node

+ + + + + + +
+ +
+ +

+ query.Node

+ + +
+ +
+
+ + + + + +

new Node(entityManager, resultClass)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entityManager + + +EntityManager + + + +

The owning entity manager of this query

resultClass + + +<T> + + + +

The query result class

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + +

ascending(field) → {query.Query.<T>}

+ + + + + +
+

Add an ascending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

count(doneCallbackopt, failCallbackopt) → {Promise.<number>}

+ + + + + +
+

Execute the query that returns the matching objects count.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~countCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The total number of matched objects

+
+ + + +
+
+ Type +
+
+ +<number> + + +
+
+ + + + + + + + + + +

descending(field) → {query.Query.<T>}

+ + + + + +
+

Add an decending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

limit(limit) → {query.Query.<T>}

+ + + + + +
+

Sets the limit of this query, i.e hox many objects should be returnd

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
limit + + +number + + + +

The limit of this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

offset(offset) → {query.Query.<T>}

+ + + + + +
+

Sets the offset of the query, i.e. how many elements should be skipped

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
offset + + +number + + + +

The offset of this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

resultList(doneCallbackopt, failCallbackopt) → {Promise.<Array.<T>>}

+ + + + + +
+

Execute the query and return the query results as a List.
Note: All local unsaved changes on matching objects, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~resultListCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a list

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + +

singleResult(doneCallbackopt, failCallbackopt) → {Promise.<T>}

+ + + + + +
+

Execute the query that returns a single result.
Note: All local unsaved changes on the matched object, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~singleResultCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a single result

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

sort(sort) → {query.Query.<T>}

+ + + + + +
+

Sets the sort of the query and discard all existing paramaters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sort + + +Object + + + +

The new sort of the query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

stream(optionsopt) → {Observable.<StreamingEvent.<T>>}

+ + + + + +
+

Returns an RxJS observable that receives events for streaming query.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

options on whether an initial result and what kind of events (w.r.t. match types and operations) are requested

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
initial + + +boolean + + + + + + <optional>
+ + + + + +
+ + true + +

whether or not you want to receive the initial result set (i.e. the entities matching the query at subscription time)

matchTypes + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['all'] + +

the match types you are interested in; accepts the default ('all'/['all']) or any combination of 'match', 'add', 'change', 'changeIndex' and 'remove'

operations + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['any'] + +

the operations you are interested in; accepts the default ('any'/['any']) or any combination of 'insert', 'update', 'delete' and 'none'

+ +
+ + + + + + +
+ + + + + + + + +
Overrides:
+
+ + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

an RxJS observable

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/query.Operator.html b/doc/query.Operator.html new file mode 100644 index 00000000..2a597d39 --- /dev/null +++ b/doc/query.Operator.html @@ -0,0 +1,2343 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Operator<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Operator

+ + + + + + +
+ +
+ +

+ query.Operator

+ + +
+ +
+
+ + + + + +

new Operator(entityManager, resultClass, operator, childs)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entityManager + + +EntityManager + + + +

The owning entity manager of this query

resultClass + + +<T> + + + +

The query result class

operator + + +string + + + +

The operator used to join the childs

childs + + +<T>> + + + +

The childs to join

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + + + +

Methods

+ + + + + + +

ascending(field) → {query.Query.<T>}

+ + + + + +
+

Add an ascending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

count(doneCallbackopt, failCallbackopt) → {Promise.<number>}

+ + + + + +
+

Execute the query that returns the matching objects count.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~countCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The total number of matched objects

+
+ + + +
+
+ Type +
+
+ +<number> + + +
+
+ + + + + + + + + + +

descending(field) → {query.Query.<T>}

+ + + + + +
+

Add an decending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

limit(limit) → {query.Query.<T>}

+ + + + + +
+

Sets the limit of this query, i.e hox many objects should be returnd

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
limit + + +number + + + +

The limit of this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

offset(offset) → {query.Query.<T>}

+ + + + + +
+

Sets the offset of the query, i.e. how many elements should be skipped

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
offset + + +number + + + +

The offset of this query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

resultList(doneCallbackopt, failCallbackopt) → {Promise.<Array.<T>>}

+ + + + + +
+

Execute the query and return the query results as a List.
Note: All local unsaved changes on matching objects, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~resultListCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a list

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + +

singleResult(doneCallbackopt, failCallbackopt) → {Promise.<T>}

+ + + + + +
+

Execute the query that returns a single result.
Note: All local unsaved changes on the matched object, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~singleResultCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a single result

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

sort(sort) → {query.Query.<T>}

+ + + + + +
+

Sets the sort of the query and discard all existing paramaters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sort + + +Object + + + +

The new sort of the query

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

stream(optionsopt) → {Observable.<StreamingEvent.<T>>}

+ + + + + +
+

Returns an RxJS observable that receives events for streaming query.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

options on whether an initial result and what kind of events (w.r.t. match types and operations) are requested

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
initial + + +boolean + + + + + + <optional>
+ + + + + +
+ + true + +

whether or not you want to receive the initial result set (i.e. the entities matching the query at subscription time)

matchTypes + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['all'] + +

the match types you are interested in; accepts the default ('all'/['all']) or any combination of 'match', 'add', 'change', 'changeIndex' and 'remove'

operations + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['any'] + +

the operations you are interested in; accepts the default ('any'/['any']) or any combination of 'insert', 'update', 'delete' and 'none'

+ +
+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

an RxJS observable

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/query.Query.html b/doc/query.Query.html new file mode 100644 index 00000000..3caac60d --- /dev/null +++ b/doc/query.Query.html @@ -0,0 +1,2791 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Query<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Query

+ + + + + + +
+ +
+ +

+ query.Query

+ + +
+ +
+
+ + + + + +

new Query()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

ascending(field) → {query.Query.<T>}

+ + + + + +
+

Add an ascending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

count(doneCallbackopt, failCallbackopt) → {Promise.<number>}

+ + + + + +
+

Execute the query that returns the matching objects count.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~countCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The total number of matched objects

+
+ + + +
+
+ Type +
+
+ +<number> + + +
+
+ + + + + + + + + + +

descending(field) → {query.Query.<T>}

+ + + + + +
+

Add an decending sort for the specified field to this query

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
field + + +string + + + +

The field to sort

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

limit(limit) → {query.Query.<T>}

+ + + + + +
+

Sets the limit of this query, i.e hox many objects should be returnd

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
limit + + +number + + + +

The limit of this query

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

offset(offset) → {query.Query.<T>}

+ + + + + +
+

Sets the offset of the query, i.e. how many elements should be skipped

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
offset + + +number + + + +

The offset of this query

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

resultList(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<Array.<T>>}

+ + + + + +
+

Execute the query and return the query results as a List.
Note: All local unsaved changes on matching objects, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The query options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be loaded. Depth 0 load only the found
objects, true loads the objects by reachability.

+ +
doneCallback + + +Query~resultListCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a list

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + +

resultList(doneCallbackopt, failCallbackopt) → {Promise.<Array.<T>>}

+ + + + + +
+

Execute the query and return the query results as a List.
Note: All local unsaved changes on matching objects, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~resultListCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a list

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + +

singleResult(optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<T>}

+ + + + + +
+

Execute the query that returns a single result.
Note: All local unsaved changes on the matched object, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

The query options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
depth + + +number +| + +boolean + + + + + + <optional>
+ + + + + +
+ + 0 + +

The object depth which will be loaded. Depth 0 load only the found
object, true loads the objects by reachability.

+ +
doneCallback + + +Query~singleResultCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a single result

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

singleResult(doneCallbackopt, failCallbackopt) → {Promise.<T>}

+ + + + + +
+

Execute the query that returns a single result.
Note: All local unsaved changes on the matched object, will be discarded.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Query~singleResultCallback + + + + + + <optional>
+ + + + + +

Called when the operation succeed.

failCallback + + +Query~failCallback + + + + + + <optional>
+ + + + + +

Called when the operation failed.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise that will be resolved with the query result as a single result

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

sort(sort) → {query.Query.<T>}

+ + + + + +
+

Sets the sort of the query and discard all existing paramaters

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
sort + + +Object + + + +

The new sort of the query

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The resulting Query

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + +

stream(optionsopt) → {Observable.<StreamingEvent.<T>>}

+ + + + + +
+

Returns an RxJS observable that receives events for streaming query.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
options + + +Object + + + + + + <optional>
+ + + + + +

options on whether an initial result and what kind of events (w.r.t. match types and operations) are requested

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
initial + + +boolean + + + + + + <optional>
+ + + + + +
+ + true + +

whether or not you want to receive the initial result set (i.e. the entities matching the query at subscription time)

matchTypes + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['all'] + +

the match types you are interested in; accepts the default ('all'/['all']) or any combination of 'match', 'add', 'change', 'changeIndex' and 'remove'

operations + + +string +| + +<string> + + + + + + <optional>
+ + + + + +
+ + ['any'] + +

the operations you are interested in; accepts the default ('any'/['any']) or any combination of 'insert', 'update', 'delete' and 'none'

+ +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

an RxJS observable

+
+ + + +
+
+ Type +
+
+ +<T>> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/query.Stream.html b/doc/query.Stream.html new file mode 100644 index 00000000..99d5947f --- /dev/null +++ b/doc/query.Stream.html @@ -0,0 +1,914 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Stream<T> + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Stream

+ + + + + + +
+ +
+ +

+ query.Stream

+ + +
+ +
+
+ + + + + +

new Stream(entityManager, bucket, query, options, sort, limit, offset, target)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entityManager + + +EntityManager + + + +

The owning entity manager of this query

bucket + + +string + + + +

The Bucket on which the streaming query is performed

query + + +string + + + +

The serialized query

options + + +Object + + + +

an object containing parameters

sort + + +string + + + +

the sort string

limit + + +number + + + +

the count, i.e. the number of items in the result

offset + + +number + + + +

offset, i.e. the number of items to skip

target + + +<T> + + + +

the target of the stream

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

(static) parseOptions(provided) → {Object}

+ + + + + +
+

Valid options are:


  • initial: a Boolean indicating whether or not the initial result set should be delivered on creating the subscription

  • matchTypes: a list of match types

  • operations: a list of operations


+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
provided + + +Object + + + +

object containing options

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

an object containing VALID options

+
+ + + +
+
+ Type +
+
+ +Object + + +
+
+ + + + + + + + + + +

observable() → {Observable.<T>}

+ + + + + +
+

Returns an RxJS observable.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

an RxJS observable

+
+ + + +
+
+ Type +
+
+ +<T> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/query.html b/doc/query.html new file mode 100644 index 00000000..85c20cf5 --- /dev/null +++ b/doc/query.html @@ -0,0 +1,419 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Namespace: query + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Namespace: query

+ + + + + + +
+ +
+ +

query

+ + +
+ + + +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/scripts/filter.js b/doc/scripts/filter.js new file mode 100644 index 00000000..8239aa97 --- /dev/null +++ b/doc/scripts/filter.js @@ -0,0 +1,35 @@ +(function() { + var nav = document.querySelector('.bs-sidebar'); + var filter = nav.querySelector('.filter'); + var openables = nav.querySelectorAll('ul > li:not(.active)'); + + filter.addEventListener('keyup', function() { + var str = filter.value.toLowerCase(); + + for (var i = 0, openable; openable = openables[i]; i++) { + if (str) { + openable.classList.add('active'); + } else { + openable.classList.remove('active'); + } + } + + var lis = nav.querySelectorAll('li'); + loop: for (var i = 0, li; li = lis[i]; i++) { + if (str) { + var names = li.querySelectorAll('.nav-name'); + for (var j = 0, name; name = names[j]; j++) { + if (name.innerText.toLowerCase().indexOf(str) != -1) { + li.style.display = 'block'; + continue loop; + } + } + + li.style.display = 'none'; + } else { + li.style.display = 'block'; + } + } + }, false); + +}()); diff --git a/doc/scripts/linenumber.js b/doc/scripts/linenumber.js new file mode 100644 index 00000000..8d52f7ea --- /dev/null +++ b/doc/scripts/linenumber.js @@ -0,0 +1,25 @@ +/*global document */ +(function() { + var source = document.getElementsByClassName('prettyprint source linenums'); + var i = 0; + var lineNumber = 0; + var lineId; + var lines; + var totalLines; + var anchorHash; + + if (source && source[0]) { + anchorHash = document.location.hash.substring(1); + lines = source[0].getElementsByTagName('li'); + totalLines = lines.length; + + for (; i < totalLines; i++) { + lineNumber++; + lineId = 'line' + lineNumber; + lines[i].id = lineId; + if (lineId === anchorHash) { + lines[i].className += ' selected'; + } + } + } +})(); diff --git a/doc/scripts/prettify/Apache-License-2.0.txt b/doc/scripts/prettify/Apache-License-2.0.txt new file mode 100644 index 00000000..d6456956 --- /dev/null +++ b/doc/scripts/prettify/Apache-License-2.0.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/doc/scripts/prettify/lang-css.js b/doc/scripts/prettify/lang-css.js new file mode 100644 index 00000000..041e1f59 --- /dev/null +++ b/doc/scripts/prettify/lang-css.js @@ -0,0 +1,2 @@ +PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n "]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*'/,null],["lang-css-str",/^url\(([^"')]*)\)/i],["kwd",/^(?:url|rgb|!important|@import|@page|@media|@charset|inherit)(?=[^\w-]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],["com", +/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]); diff --git a/doc/scripts/prettify/prettify.js b/doc/scripts/prettify/prettify.js new file mode 100644 index 00000000..eef5ad7e --- /dev/null +++ b/doc/scripts/prettify/prettify.js @@ -0,0 +1,28 @@ +var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; +(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= +[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), +l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, +q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, +q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, +"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), +a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} +for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], +"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], +H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], +J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ +I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), +["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", +/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), +["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", +hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= +!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p + + + + Baqend JavaScript SDK 2.4.3 - Source: streaming/connector/WebSocketConnector.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: streaming/connector/WebSocketConnector.js

+ + + + + + +
+
+
"use strict";
+var Connector = require('../../lib/connector/Connector');
+var message = require('../../lib/message');
+var WebSocket = require('./websocket').WebSocket;
+
+/**
+ * @alias connector.WebSocketConnector
+ */
+class WebSocketConnector {
+
+
+  /**
+   * @param {connector.Connector} connector a connector
+   * @return {connector.WebSocketConnector} a websocket connection
+   */
+  static create(connector) {
+    if (!connector)
+      throw new Error('No connector was provided, but connector is required for websocket connection!');
+
+    var websocket = this.websockets[connector.origin];
+
+    if (!websocket) {
+      websocket = new WebSocketConnector(connector);
+      this.websockets[connector.origin] = websocket;
+    }
+
+    return websocket;
+  }
+
+  /**
+   * @param {connector.Connector} connector
+   */
+  constructor(connector) {
+    this.host = connector.host;
+    this.port = connector.port;
+    this.secure = connector.secure;
+    this.basePath = connector.basePath;
+    this.connector = connector;
+    this.listeners = {};
+  }
+
+  /**
+   * Registers a handler for a topic.
+   * @param {string|Object} topic
+   * @param {Function} cb
+   */
+  subscribe(topic, cb) {
+    topic = Object(topic) instanceof String ? topic : JSON.stringify(topic);
+    if (!this.listeners[topic]) {
+      this.listeners[topic] = [cb];
+    } else if (this.listeners[topic].indexOf(cb) == -1) {
+      this.listeners[topic].push(cb);
+    }
+  }
+
+  /**
+   * Deregisters a handler.
+   * @param {string|Object} topic
+   * @param {Function} cb
+   */
+  unsubscribe(topic, cb) {
+    topic = Object(topic) instanceof String ? topic : JSON.stringify(topic);
+    if (this.listeners[topic]) {
+      var index = this.listeners[topic].indexOf(cb);
+      if (index != -1) {
+        this.listeners[topic].splice(index, 1);
+      }
+    }
+  }
+
+  socketListener(event) {
+    var message = JSON.parse(event.data);
+    var topic = message.topic;
+    topic = Object(topic) instanceof String ? topic : JSON.stringify(topic);
+    if (this.listeners[topic]) {
+      this.listeners[topic].forEach(function(listener) {
+        listener(message);
+      });
+    }
+  }
+
+  /**
+   * Sends a websocket message over a lazily initialized websocket connection.
+   * @param {Object} msg
+   * @param {string} msg.topic
+   * @param {string} msg.token
+   */
+  sendOverSocket(msg) {
+    //Lazy socket initialization
+    if (!this.socketOpen) {
+      //Resolve Promise on connect
+      this.socketOpen = new Promise((resolve, reject) => {
+        this.connector.send(new message.EventsUrl()).then((response) => {
+          return response.entity.urls;
+        }, () => null).then((urls) => {
+          let url;
+          if (urls) {
+            let prefix = this.secure ? "wss://" : "ws://";
+            urls = urls.filter((url) => {
+              return url.indexOf(prefix) == 0;
+            });
+
+            let len = urls.length;
+            url = urls[Math.floor(Math.random() * len)];
+          } else {
+            url = (this.secure ? 'wss://' : 'ws://') + this.host + ':' + this.port + this.basePath + '/events'
+          }
+
+          this.socket = this.createWebSocket(url);
+          this.socket.onmessage = this.socketListener.bind(this);
+
+          this.socket.onopen = resolve;
+          this.socket.onerror = reject;
+
+          //Reset socket on close
+          this.socket.onclose = () => {
+            this.socket = null;
+            this.socketOpen = null;
+          };
+        }).catch(reject);
+      });
+    }
+
+    this.socketOpen.then(() => {
+      var jsonMessage = JSON.stringify(msg);
+      this.socket.send(jsonMessage);
+    });
+  }
+
+  createWebSocket(destination) {
+    return new WebSocket(destination);
+  }
+
+}
+
+Object.assign(WebSocketConnector,  /** @lends connector.WebSocketConnector */ {
+  /**
+   * Map of all available connectors to their respective websocket connections
+   * @type connector.Connector[]
+   */
+  websockets: {}
+});
+
+module.exports = WebSocketConnector;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/streaming_query_Stream.js.html b/doc/streaming_query_Stream.js.html new file mode 100644 index 00000000..644e25c3 --- /dev/null +++ b/doc/streaming_query_Stream.js.html @@ -0,0 +1,622 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Source: streaming/query/Stream.js + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Source: streaming/query/Stream.js

+ + + + + + +
+
+
"use strict";
+var Metadata = require('../../lib/util/Metadata');
+var WebSocketConnector = require('../connector/WebSocketConnector');
+var lib = require('../../lib');
+
+/**
+ * @alias query.Stream<T>
+ */
+class Stream {
+
+  /**
+   * Returns an RxJS observable.
+   *
+   * @returns {Observable<T>} an RxJS observable
+   */
+  observable() {
+    return new lib.Observable(observer => {
+      var callback = (e) => {
+        if (e.errorMessage) {
+          observer.error(e);
+        } else {
+          observer.next(e);
+        }
+      };
+
+      this.on(this.query.matchTypes, callback);
+      return () => {
+        this.off(this.query.matchTypes, callback);
+      };
+    });
+  }
+
+  /**
+   * @param {EntityManager} entityManager The owning entity manager of this query
+   * @param {string} bucket The Bucket on which the streaming query is performed
+   * @param {string} query The serialized query
+   * @param {Object} options an object containing parameters
+   * @param {string} sort the sort string
+   * @param {number} limit the count, i.e. the number of items in the result
+   * @param {number} offset offset, i.e. the number of items to skip
+   * @param {query.Node<T>} target the target of the stream
+   */
+  constructor(entityManager, bucket, query, options, sort, limit, offset, target) {
+    var verifiedOptions = Stream.parseOptions(options);
+    this.entityManager = entityManager;
+    this.query = {
+      bucket: bucket,
+      matchTypes: verifiedOptions.matchTypes,
+      operations: verifiedOptions.operations,
+      initial: verifiedOptions.initial,
+      query: query,
+      sort: sort,
+      start: offset,
+      count: limit
+    };
+    this.callbacks = [];
+    this.topic = Stream.getTopic(this.query.bucket, this.query.query, this.query.start, this.query.count, this.query.sort, this.query.matchTypes, this.query.operations);
+    this.target = target;
+    this.socket = WebSocketConnector.create(entityManager._connector);
+  }
+
+
+  on(matchTypes, callback) {
+    var wrappedCallback = this._wrapQueryCallback(callback);
+    this.socket.subscribe(this.topic, wrappedCallback);
+
+    var queryMessage = {
+      register: true,
+      topic: this.topic,
+      query: this.query
+    };
+
+    if (this.query.initial === true) {
+      queryMessage.fromstart = true;
+    }
+
+    this.socket.sendOverSocket(queryMessage);
+
+    this.callbacks.push({
+      matchTypes: matchTypes,
+      callback: callback,
+      topic: this.topic,
+      wrappedCallback: wrappedCallback,
+      queryMessage: queryMessage
+    });
+  }
+
+  off(matchTypes, callback) {
+    this.callbacks = this.callbacks.reduce((keep, el) => {
+      if ((!callback || el.callback == callback) && (!matchTypes || el.matchTypes == matchTypes)) {
+        this.socket.unsubscribe(el.topic, el.wrappedCallback);
+        el.queryMessage.register = false;
+        this.socket.sendOverSocket(el.queryMessage);
+      } else {
+        keep.push(el);
+      }
+      return keep;
+    }, []);
+  }
+
+  static getCachableQueryString(query, start, count, sort) {
+    var queryID = query;
+    if (Stream.isEmptyJSONString(query)) {
+      queryID = "{}";
+    }
+    if (start > 0) {
+      queryID += "&start=" + start;
+    }
+    if (count > 0) {
+      queryID += "&count=" + count;
+    }
+    if (!Stream.isEmptyJSONString(sort)) {
+      queryID += "&sort=" + sort;
+    }
+    return queryID;
+  }
+
+  static getTopic(bucket, query, start, count, sort, matchTypes, operations) {
+    return [bucket, Stream.getCachableQueryString(query, start, count, sort), Stream.normalizeMatchTypes(matchTypes).join("_"), Stream.normalizeOperations(operations).join("_")].join("/");
+  }
+
+  static isEmptyJSONString(string) {
+    return string === undefined || string === null || /^\s*(\{\s*\})?\s*$/.test(string);
+  }
+
+  /**
+   * Valid options are:
+   <ul>
+   <li>initial: a Boolean indicating whether or not the initial result set should be delivered on creating the subscription</li>
+   <li>matchTypes: a list of match types</li>
+   <li>operations: a list of operations</li>
+   <li></li>
+   </ul>
+   *
+   *
+   * @param {Object} provided object containing options
+   * @returns {Object} an object containing VALID options
+   */
+  static parseOptions(provided) {
+    var verified = {
+      matchTypes: ['all'],
+      operations: ['any']
+    };
+
+    if (provided) {
+      if (provided.initial !== null && provided.initial !== undefined) {
+        if (typeof(provided.initial) === "boolean") {
+          verified.initial = provided.initial;
+        } else {
+          throw new Error('Option "initial" only permits Boolean values!');
+        }
+      }
+
+      if (provided.matchTypes) {
+        if (Array.isArray(provided.matchTypes)) {
+          verified.matchTypes = provided.matchTypes;
+        } else {
+          verified.matchTypes = [provided.matchTypes];
+        }
+
+        verified.matchTypes = Stream.normalizeMatchTypes(verified.matchTypes);
+      }
+
+      if (provided.operations) {
+        if (Array.isArray(provided.operations)) {
+          verified.operations = provided.operations;
+        } else {
+          verified.operations = [provided.operations];
+        }
+
+        verified.operations = Stream.normalizeOperations(verified.operations);
+      }
+
+      if (verified.matchTypes.indexOf('all') == -1 && verified.operations.indexOf('any') == -1) {
+        throw new Error('Only subscriptions for either operations or matchTypes are allowed. You cannot subscribe to a query using matchTypes and operations at the same time!');
+      }
+    }
+
+    // Apply default values if missing
+    if (verified.initial === null || verified.initial === undefined) {
+      verified.initial = true;
+    }
+
+    if (!verified.matchTypes) {
+      verified.matchTypes = ['all'];
+    }
+
+    if (!verified.operations) {
+      verified.operations = ['any'];
+    }
+
+    return verified;
+  }
+
+  static normalizeMatchTypes(list) {
+    return Stream.normalizeSortedSet(list, 'all', "match types", ['add', 'change', 'changeIndex', 'match', 'remove']);
+  }
+
+  static normalizeOperations(list) {
+    return Stream.normalizeSortedSet(list, 'any', "operations", ['delete', 'insert', 'none', 'update']);
+  }
+
+  static normalizeSortedSet(list, wildcard, itemType, allowedItems) {
+    if (!list || list.length == 0) {//undefined or empty list --> default value
+      return undefined;
+    }
+
+    // sort, remove duplicates and check whether all values are allowed
+    list.sort();
+    var item;
+    var lastItem = undefined;
+    for (var i = list.length - 1; i >= 0; i--) {
+      item = list[i];
+      if (!item) {//undefined and null item in the list --> invalid!
+        throw new Error('undefined and null not allowed!');
+      }
+      if (item === lastItem) {//remove duplicates
+        list.splice(i, 1);
+      }
+      if (item === wildcard) {
+        return [wildcard];
+      }
+      if (allowedItems.indexOf(item) == -1) {//raise error on invalid elements
+        throw new Error(item + ' not allowed for ' + itemType + '! (permitted: ' + allowedItems + '.)');
+      }
+      lastItem = item;
+    }
+
+    return list;
+  }
+
+  _wrapQueryCallback(cb) {
+    return function(msg) {
+      msg.query = this.query;
+
+      if (msg.result) { //Initial result received
+        var basicMatch = {matchType: "add", operation: 'none'};
+        var index = 0;
+        msg.result.forEach((obj)=> {
+          var entity = this._createObject(obj, false);
+          if (msg.ordered) {
+            basicMatch.index = index++;
+          }
+          var callback = this.createCallback(msg, basicMatch, entity, true);
+          cb(callback);
+        }, this);
+      }
+      if (msg.match) {
+        //Single Match received, hollow object for deletes
+        var obj = msg.match.object;
+        var entity = this._createObject(obj, msg.match.operation === "delete");
+        //Call wrapped callback
+        var callback = this.createCallback(msg, msg.match, entity, false);
+        cb(callback);
+      }
+
+      if (msg.errorMessage) { //error message
+          var error = this.createError(msg);
+          cb(error);
+      }
+    }.bind(this);
+  }
+
+  createCallback(msg, match, entity, init) {
+    var matchEvent = {
+      matchType: match.matchType,
+      operation: match.operation,
+      data: entity,
+      date: new Date(msg.date),
+      target: this.target,
+      initial: init
+    };
+    if (match.index !== undefined) {
+      matchEvent.index = match.index;
+    }
+    return matchEvent;
+  }
+
+  createError(msg) {
+    var error = {
+      errorMessage: msg.errorMessage,
+      date: new Date(msg.date),
+      target: this.target
+    };
+    return  error;
+  }
+
+  _createObject(object, objectWasDeleted) {
+    var entity;
+    if (object) {
+      entity = this.entityManager.getReference(object.id);
+      if (entity.version < object.version || objectWasDeleted) {
+        var metadata = Metadata.get(entity);
+        if (objectWasDeleted) {
+          metadata.setRemoved();
+        } else {
+          metadata.setJson(object, true);
+          metadata.setPersistent();
+        }
+      }
+    }
+    return entity;
+  }
+}
+
+module.exports = Stream;
+
+
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:26 GMT +
+
+
+
+ + + + + + diff --git a/doc/styles/bootstrap-baqend.min.css b/doc/styles/bootstrap-baqend.min.css new file mode 100644 index 00000000..e601e51b --- /dev/null +++ b/doc/styles/bootstrap-baqend.min.css @@ -0,0 +1 @@ +/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */.label,sub,sup{vertical-align:baseline}body,figure{margin:0}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.pre-scrollable{max-height:340px}.btn-group>.btn-group,.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.dropdown-menu{float:left}@font-face{font-family:'Open Sans';font-style:normal;font-weight:300;src:local('Open Sans Light'),local('OpenSans-Light'),url(//fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTYnF5uFdDttMLvmWuJdhhgs.ttf) format('truetype')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local('Open Sans'),local('OpenSans'),url(//fonts.gstatic.com/s/opensans/v13/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf) format('truetype')}@font-face{font-family:'Open Sans';font-style:normal;font-weight:600;src:local('Open Sans Semibold'),local('OpenSans-Semibold'),url(//fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSonF5uFdDttMLvmWuJdhhgs.ttf) format('truetype')}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}b,optgroup,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0}mark{background:#ff0;color:#000}sub,sup{font-size:75%;line-height:0;position:relative}sup{top:-.5em}sub{bottom:-.25em}img{border:0;vertical-align:middle}svg:not(:root){overflow:hidden}hr{box-sizing:content-box;height:0}pre,textarea{overflow:auto}code,kbd,pre,samp{font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{blockquote,img,pre,tr{page-break-inside:avoid}*,:after,:before{background:0 0!important;color:#000!important;box-shadow:none!important;text-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}blockquote,pre{border:1px solid #999}thead{display:table-header-group}img{max-width:100%!important}h2,h3,p{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table td,.table th{background-color:#fff!important}.table-bordered td,.table-bordered th{border:1px solid #ddd!important}}.btn,.btn-danger.active,.btn-danger:active,.btn-default.active,.btn-default:active,.btn-info.active,.btn-info:active,.btn-primary.active,.btn-primary:active,.btn-warning.active,.btn-warning:active,.btn.active,.btn:active,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover,.form-control,.navbar-toggle,.open>.dropdown-toggle.btn-danger,.open>.dropdown-toggle.btn-default,.open>.dropdown-toggle.btn-info,.open>.dropdown-toggle.btn-primary,.open>.dropdown-toggle.btn-warning{background-image:none}.img-thumbnail,body{background-color:#fff}*,:after,:before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:'Open Sans',sans-serif;font-size:18px;line-height:1.42857143;color:#333}button,input,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#1967be;text-decoration:none}a:focus,a:hover{color:#10427b;text-decoration:underline}a:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.carousel-inner>.item>a>img,.carousel-inner>.item>img,.img-responsive,.thumbnail a>img,.thumbnail>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:0}.img-thumbnail{padding:4px;line-height:1.42857143;border:1px solid #ddd;border-radius:0;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:25px;margin-bottom:25px;border:0}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role=button]{cursor:pointer}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{font-family:'Open Sans',sans-serif;font-weight:300;line-height:1.1;color:inherit}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-weight:400;line-height:1;color:#999}.h1,.h2,.h3,h1,h2,h3{margin-top:25px;margin-bottom:12.5px}.h1 .small,.h1 small,.h2 .small,.h2 small,.h3 .small,.h3 small,h1 .small,h1 small,h2 .small,h2 small,h3 .small,h3 small{font-size:65%}.h4,.h5,.h6,h4,h5,h6{margin-top:12.5px;margin-bottom:12.5px}.h4 .small,.h4 small,.h5 .small,.h5 small,.h6 .small,.h6 small,h4 .small,h4 small,h5 .small,h5 small,h6 .small,h6 small{font-size:75%}.h1,h1{font-size:46px}.h2,h2{font-size:38px}.h3,h3{font-size:31px}.h4,h4{font-size:23px}.h5,h5{font-size:18px}.h6,h6{font-size:16px}p{margin:0 0 12.5px}.lead{margin-bottom:25px;font-size:20px;font-weight:300;line-height:1.4}dt,kbd kbd,label{font-weight:700}address,blockquote .small,blockquote footer,blockquote small,dd,dt,pre{line-height:1.42857143}@media (min-width:768px){.lead{font-size:27px}}.small,small{font-size:88%}.mark,mark{background-color:#e85814;padding:.2em}.list-inline,.list-unstyled{padding-left:0;list-style:none}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#999}.text-primary{color:#2780E3}a.text-primary:focus,a.text-primary:hover{color:#1967be}.text-success{color:#fff}a.text-success:focus,a.text-success:hover{color:#e6e6e6}.text-info{color:#fff}a.text-info:focus,a.text-info:hover{color:#e6e6e6}.text-warning{color:#fff}a.text-warning:focus,a.text-warning:hover{color:#e6e6e6}.text-danger{color:#fff}a.text-danger:focus,a.text-danger:hover{color:#e6e6e6}.bg-primary{color:#fff;background-color:#2780E3}a.bg-primary:focus,a.bg-primary:hover{background-color:#1967be}.bg-success{background-color:#3FB618}a.bg-success:focus,a.bg-success:hover{background-color:#2f8912}.bg-info{background-color:#7532c7}a.bg-info:focus,a.bg-info:hover{background-color:#5d289e}.bg-warning{background-color:#e85814}a.bg-warning:focus,a.bg-warning:hover{background-color:#b94610}.bg-danger{background-color:#FF0039}a.bg-danger:focus,a.bg-danger:hover{background-color:#cc002e}pre code,table{background-color:transparent}.page-header{padding-bottom:11.5px;margin:50px 0 25px;border-bottom:1px solid #e6e6e6}dl,ol,ul{margin-top:0}blockquote ol:last-child,blockquote p:last-child,blockquote ul:last-child,ol ol,ol ul,ul ol,ul ul{margin-bottom:0}address,dl{margin-bottom:25px}ol,ul{margin-bottom:12.5px}.list-inline{margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}.container{width:750px}}abbr[data-original-title],abbr[title]{cursor:help;border-bottom:1px dotted #999}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:12.5px 25px;margin:0 0 25px;font-size:22.5px;border-left:5px solid #e6e6e6}blockquote .small,blockquote footer,blockquote small{display:block;font-size:80%;color:#999}legend,pre{display:block;color:#333}blockquote .small:before,blockquote footer:before,blockquote small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #e6e6e6;border-left:0;text-align:right}code,kbd{padding:2px 4px;font-size:90%;border-radius:0}caption,th{text-align:left}.blockquote-reverse .small:before,.blockquote-reverse footer:before,.blockquote-reverse small:before,blockquote.pull-right .small:before,blockquote.pull-right footer:before,blockquote.pull-right small:before{content:''}.blockquote-reverse .small:after,.blockquote-reverse footer:after,.blockquote-reverse small:after,blockquote.pull-right .small:after,blockquote.pull-right footer:after,blockquote.pull-right small:after{content:'\00A0 \2014'}address{font-style:normal}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{color:#c7254e;background-color:#f9f2f4}kbd{color:#fff;background-color:#333;box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;box-shadow:none}pre{padding:12px;margin:0 0 12.5px;font-size:17px;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:0}.container,.container-fluid{margin-right:auto;margin-left:auto}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;border-radius:0}.container,.container-fluid{padding-left:15px;padding-right:15px}.pre-scrollable{overflow-y:scroll}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.row{margin-left:-15px;margin-right:-15px}.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-xs-1,.col-xs-10,.col-xs-11,.col-xs-12,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}caption{padding-top:8px;padding-bottom:8px;color:#999}.table{width:100%;max-width:100%;margin-bottom:25px}.table>tbody>tr>td,.table>tbody>tr>th,.table>tfoot>tr>td,.table>tfoot>tr>th,.table>thead>tr>td,.table>thead>tr>th{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>td,.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>td,.table>thead:first-child>tr:first-child>th{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>tbody>tr>td,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>td,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>thead>tr>th{padding:5px}.table-bordered,.table-bordered>tbody>tr>td,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>td,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border:1px solid #ddd}.table-bordered>thead>tr>td,.table-bordered>thead>tr>th{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover,.table>tbody>tr.active>td,.table>tbody>tr.active>th,.table>tbody>tr>td.active,.table>tbody>tr>th.active,.table>tfoot>tr.active>td,.table>tfoot>tr.active>th,.table>tfoot>tr>td.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>thead>tr.active>th,.table>thead>tr>td.active,.table>thead>tr>th.active{background-color:#f5f5f5}table col[class*=col-]{position:static;float:none;display:table-column}table td[class*=col-],table th[class*=col-]{position:static;float:none;display:table-cell}.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr.active:hover>th,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover{background-color:#e8e8e8}.table>tbody>tr.success>td,.table>tbody>tr.success>th,.table>tbody>tr>td.success,.table>tbody>tr>th.success,.table>tfoot>tr.success>td,.table>tfoot>tr.success>th,.table>tfoot>tr>td.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>thead>tr.success>th,.table>thead>tr>td.success,.table>thead>tr>th.success{background-color:#3FB618}.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr.success:hover>th,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover{background-color:#379f15}.table>tbody>tr.info>td,.table>tbody>tr.info>th,.table>tbody>tr>td.info,.table>tbody>tr>th.info,.table>tfoot>tr.info>td,.table>tfoot>tr.info>th,.table>tfoot>tr>td.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>thead>tr.info>th,.table>thead>tr>td.info,.table>thead>tr>th.info{background-color:#7532c7}.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr.info:hover>th,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover{background-color:#692db3}.table>tbody>tr.warning>td,.table>tbody>tr.warning>th,.table>tbody>tr>td.warning,.table>tbody>tr>th.warning,.table>tfoot>tr.warning>td,.table>tfoot>tr.warning>th,.table>tfoot>tr>td.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>thead>tr.warning>th,.table>thead>tr>td.warning,.table>thead>tr>th.warning{background-color:#e85814}.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr.warning:hover>th,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover{background-color:#d14f12}.table>tbody>tr.danger>td,.table>tbody>tr.danger>th,.table>tbody>tr>td.danger,.table>tbody>tr>th.danger,.table>tfoot>tr.danger>td,.table>tfoot>tr.danger>th,.table>tfoot>tr>td.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>thead>tr.danger>th,.table>thead>tr>td.danger,.table>thead>tr>th.danger{background-color:#FF0039}.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr.danger:hover>th,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover{background-color:#e60033}.table-responsive{overflow-x:auto;min-height:.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:18.75px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>td,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>thead>tr>th{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}}fieldset,legend{padding:0;border:0}fieldset{margin:0;min-width:0}legend{width:100%;margin-bottom:25px;font-size:27px;line-height:inherit;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-appearance:none}input[type=checkbox],input[type=radio]{margin:4px 0 0;margin-top:1px\9;line-height:normal}.form-control,output{font-size:18px;line-height:1.42857143;color:#333;display:block}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=checkbox]:focus,input[type=radio]:focus,input[type=file]:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}output{padding-top:11px}.form-control{width:100%;height:47px;padding:10px 18px;background-color:#fff;border:1px solid #ccc;border-radius:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#e6e6e6;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}@media screen and (-webkit-min-device-pixel-ratio:0){input[type=date].form-control,input[type=time].form-control,input[type=datetime-local].form-control,input[type=month].form-control{line-height:47px}.input-group-sm input[type=date],.input-group-sm input[type=time],.input-group-sm input[type=datetime-local],.input-group-sm input[type=month],input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:36px}.input-group-lg input[type=date],.input-group-lg input[type=time],.input-group-lg input[type=datetime-local],.input-group-lg input[type=month],input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:69px}}.form-group{margin-bottom:15px}.checkbox,.radio{position:relative;display:block;margin-top:10px;margin-bottom:10px}.checkbox label,.radio label{min-height:25px;padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox],.radio input[type=radio],.radio-inline input[type=radio]{position:absolute;margin-left:-20px;margin-top:4px\9}.checkbox+.checkbox,.radio+.radio{margin-top:-5px}.checkbox-inline,.radio-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:400;cursor:pointer}.checkbox-inline+.checkbox-inline,.radio-inline+.radio-inline{margin-top:0;margin-left:10px}.checkbox-inline.disabled,.checkbox.disabled label,.radio-inline.disabled,.radio.disabled label,fieldset[disabled] .checkbox label,fieldset[disabled] .checkbox-inline,fieldset[disabled] .radio label,fieldset[disabled] .radio-inline,fieldset[disabled] input[type=checkbox],fieldset[disabled] input[type=radio],input[type=checkbox].disabled,input[type=checkbox][disabled],input[type=radio].disabled,input[type=radio][disabled]{cursor:not-allowed}.form-control-static{padding-top:11px;padding-bottom:11px;margin-bottom:0;min-height:43px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.form-group-sm .form-control,.input-sm{padding:5px 10px;font-size:16px;border-radius:0}.input-sm{height:36px;line-height:1.5}select.input-sm{height:36px;line-height:36px}select[multiple].input-sm,textarea.input-sm{height:auto}.form-group-sm .form-control{height:36px;line-height:1.5}.form-group-sm select.form-control{height:36px;line-height:36px}.form-group-sm select[multiple].form-control,.form-group-sm textarea.form-control{height:auto}.form-group-sm .form-control-static{height:36px;min-height:41px;padding:6px 10px;font-size:16px;line-height:1.5}.input-lg{height:69px;padding:18px 30px;font-size:23px;line-height:1.3333333;border-radius:0}select.input-lg{height:69px;line-height:69px}select[multiple].input-lg,textarea.input-lg{height:auto}.form-group-lg .form-control{height:69px;padding:18px 30px;font-size:23px;line-height:1.3333333;border-radius:0}.form-group-lg select.form-control{height:69px;line-height:69px}.form-group-lg select[multiple].form-control,.form-group-lg textarea.form-control{height:auto}.form-group-lg .form-control-static{height:69px;min-height:48px;padding:19px 30px;font-size:23px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:58.75px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:47px;height:47px;line-height:47px;text-align:center;pointer-events:none}.collapsing,.dropdown,.dropup{position:relative}.form-group-lg .form-control+.form-control-feedback,.input-group-lg+.form-control-feedback,.input-lg+.form-control-feedback{width:69px;height:69px;line-height:69px}.form-group-sm .form-control+.form-control-feedback,.input-group-sm+.form-control-feedback,.input-sm+.form-control-feedback{width:36px;height:36px;line-height:36px}.has-success .checkbox,.has-success .checkbox-inline,.has-success .control-label,.has-success .help-block,.has-success .radio,.has-success .radio-inline,.has-success.checkbox label,.has-success.checkbox-inline label,.has-success.radio label,.has-success.radio-inline label{color:#fff}.has-success .form-control{border-color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #fff}.has-success .input-group-addon{color:#fff;border-color:#fff;background-color:#3FB618}.has-success .form-control-feedback,.has-warning .checkbox,.has-warning .checkbox-inline,.has-warning .control-label,.has-warning .help-block,.has-warning .radio,.has-warning .radio-inline,.has-warning.checkbox label,.has-warning.checkbox-inline label,.has-warning.radio label,.has-warning.radio-inline label{color:#fff}.has-warning .form-control{border-color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #fff}.has-warning .input-group-addon{color:#fff;border-color:#fff;background-color:#e85814}.has-error .checkbox,.has-error .checkbox-inline,.has-error .control-label,.has-error .help-block,.has-error .radio,.has-error .radio-inline,.has-error.checkbox label,.has-error.checkbox-inline label,.has-error.radio label,.has-error.radio-inline label,.has-warning .form-control-feedback{color:#fff}.has-error .form-control{border-color:#fff;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#e6e6e6;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #fff;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #fff}.has-error .input-group-addon{color:#fff;border-color:#fff;background-color:#FF0039}.has-error .form-control-feedback{color:#fff}.has-feedback label~.form-control-feedback{top:30px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-control-static,.form-inline .form-group{display:inline-block}.form-inline .control-label,.form-inline .form-group{margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .form-control,.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .checkbox,.form-inline .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .checkbox label,.form-inline .radio label{padding-left:0}.form-inline .checkbox input[type=checkbox],.form-inline .radio input[type=radio]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:11px}}.form-horizontal .checkbox,.form-horizontal .checkbox-inline,.form-horizontal .radio,.form-horizontal .radio-inline{margin-top:0;margin-bottom:0;padding-top:11px}.form-horizontal .checkbox,.form-horizontal .radio{min-height:36px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:19px;font-size:23px}.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:16px}}.btn{display:inline-block;margin-bottom:0;font-weight:400;text-align:center;vertical-align:middle;touch-action:manipulation;cursor:pointer;border:1px solid transparent;white-space:nowrap;padding:10px 18px;font-size:18px;line-height:1.42857143;border-radius:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn.active.focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn:active:focus,.btn:focus{outline:dotted thin;outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}.btn.focus,.btn:focus,.btn:hover{color:#fff;text-decoration:none}.btn.active,.btn:active{outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#fff;background-color:#222;border-color:#222}.btn-default.focus,.btn-default:focus{color:#fff;background-color:#090909;border-color:#000}.btn-default.active,.btn-default:active,.btn-default:hover,.open>.dropdown-toggle.btn-default{color:#fff;background-color:#090909;border-color:#040404}.btn-default.active.focus,.btn-default.active:focus,.btn-default.active:hover,.btn-default:active.focus,.btn-default:active:focus,.btn-default:active:hover,.open>.dropdown-toggle.btn-default.focus,.open>.dropdown-toggle.btn-default:focus,.open>.dropdown-toggle.btn-default:hover{color:#fff;background-color:#000;border-color:#000}.btn-default.disabled.focus,.btn-default.disabled:focus,.btn-default.disabled:hover,.btn-default[disabled].focus,.btn-default[disabled]:focus,.btn-default[disabled]:hover,fieldset[disabled] .btn-default.focus,fieldset[disabled] .btn-default:focus,fieldset[disabled] .btn-default:hover{background-color:#222;border-color:#222}.btn-default .badge{color:#222;background-color:#fff}.btn-primary{color:#fff;background-color:#2780E3;border-color:#2780E3}.btn-primary.focus,.btn-primary:focus{color:#fff;background-color:#1967be;border-color:#10427b}.btn-primary.active,.btn-primary:active,.btn-primary:hover,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#1967be;border-color:#1862b5}.btn-primary.active.focus,.btn-primary.active:focus,.btn-primary.active:hover,.btn-primary:active.focus,.btn-primary:active:focus,.btn-primary:active:hover,.open>.dropdown-toggle.btn-primary.focus,.open>.dropdown-toggle.btn-primary:focus,.open>.dropdown-toggle.btn-primary:hover{color:#fff;background-color:#15569f;border-color:#10427b}.btn-primary.disabled.focus,.btn-primary.disabled:focus,.btn-primary.disabled:hover,.btn-primary[disabled].focus,.btn-primary[disabled]:focus,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary.focus,fieldset[disabled] .btn-primary:focus,fieldset[disabled] .btn-primary:hover{background-color:#2780E3;border-color:#2780E3}.btn-primary .badge{color:#2780E3;background-color:#fff}.btn-success{color:#fff;background-color:#3FB618;border-color:#3FB618}.btn-success.focus,.btn-success:focus{color:#fff;background-color:#2f8912;border-color:#184509}.btn-success.active,.btn-success:active,.btn-success:hover,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#2f8912;border-color:#2c8011}.btn-success.active.focus,.btn-success.active:focus,.btn-success.active:hover,.btn-success:active.focus,.btn-success:active:focus,.btn-success:active:hover,.open>.dropdown-toggle.btn-success.focus,.open>.dropdown-toggle.btn-success:focus,.open>.dropdown-toggle.btn-success:hover{color:#fff;background-color:#24690e;border-color:#184509}.btn-success.active,.btn-success:active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled.focus,.btn-success.disabled:focus,.btn-success.disabled:hover,.btn-success[disabled].focus,.btn-success[disabled]:focus,.btn-success[disabled]:hover,fieldset[disabled] .btn-success.focus,fieldset[disabled] .btn-success:focus,fieldset[disabled] .btn-success:hover{background-color:#3FB618;border-color:#3FB618}.btn-success .badge{color:#3FB618;background-color:#fff}.btn-info{color:#fff;background-color:#7532c7;border-color:#7532c7}.btn-info.focus,.btn-info:focus{color:#fff;background-color:#5d289e;border-color:#391861}.btn-info.active,.btn-info:active,.btn-info:hover,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#5d289e;border-color:#582696}.btn-info.active.focus,.btn-info.active:focus,.btn-info.active:hover,.btn-info:active.focus,.btn-info:active:focus,.btn-info:active:hover,.open>.dropdown-toggle.btn-info.focus,.open>.dropdown-toggle.btn-info:focus,.open>.dropdown-toggle.btn-info:hover{color:#fff;background-color:#4c2182;border-color:#391861}.btn-info.disabled.focus,.btn-info.disabled:focus,.btn-info.disabled:hover,.btn-info[disabled].focus,.btn-info[disabled]:focus,.btn-info[disabled]:hover,fieldset[disabled] .btn-info.focus,fieldset[disabled] .btn-info:focus,fieldset[disabled] .btn-info:hover{background-color:#7532c7;border-color:#7532c7}.btn-info .badge{color:#7532c7;background-color:#fff}.btn-warning{color:#fff;background-color:#e85814;border-color:#e85814}.btn-warning.focus,.btn-warning:focus{color:#fff;background-color:#b94610;border-color:#732b0a}.btn-warning.active,.btn-warning:active,.btn-warning:hover,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#b94610;border-color:#b0430f}.btn-warning.active.focus,.btn-warning.active:focus,.btn-warning.active:hover,.btn-warning:active.focus,.btn-warning:active:focus,.btn-warning:active:hover,.open>.dropdown-toggle.btn-warning.focus,.open>.dropdown-toggle.btn-warning:focus,.open>.dropdown-toggle.btn-warning:hover{color:#fff;background-color:#983a0d;border-color:#732b0a}.btn-warning.disabled.focus,.btn-warning.disabled:focus,.btn-warning.disabled:hover,.btn-warning[disabled].focus,.btn-warning[disabled]:focus,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning.focus,fieldset[disabled] .btn-warning:focus,fieldset[disabled] .btn-warning:hover{background-color:#e85814;border-color:#e85814}.btn-warning .badge{color:#e85814;background-color:#fff}.btn-danger{color:#fff;background-color:#FF0039;border-color:#FF0039}.btn-danger.focus,.btn-danger:focus{color:#fff;background-color:#cc002e;border-color:#80001c}.btn-danger.active,.btn-danger:active,.btn-danger:hover,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#cc002e;border-color:#c2002b}.btn-danger.active.focus,.btn-danger.active:focus,.btn-danger.active:hover,.btn-danger:active.focus,.btn-danger:active:focus,.btn-danger:active:hover,.open>.dropdown-toggle.btn-danger.focus,.open>.dropdown-toggle.btn-danger:focus,.open>.dropdown-toggle.btn-danger:hover{color:#fff;background-color:#a80026;border-color:#80001c}.btn-danger.disabled.focus,.btn-danger.disabled:focus,.btn-danger.disabled:hover,.btn-danger[disabled].focus,.btn-danger[disabled]:focus,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger.focus,fieldset[disabled] .btn-danger:focus,fieldset[disabled] .btn-danger:hover{background-color:#FF0039;border-color:#FF0039}.btn-danger .badge{color:#FF0039;background-color:#fff}.btn-link{color:#1967be;font-weight:400;border-radius:0}.btn-link,.btn-link.active,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:active,.btn-link:focus,.btn-link:hover{border-color:transparent}.btn-link:focus,.btn-link:hover{color:#10427b;text-decoration:underline;background-color:transparent}.btn-link[disabled]:focus,.btn-link[disabled]:hover,fieldset[disabled] .btn-link:focus,fieldset[disabled] .btn-link:hover{color:#999;text-decoration:none}.btn-group-lg>.btn,.btn-lg{padding:18px 30px;font-size:23px;line-height:1.3333333;border-radius:0}.btn-group-sm>.btn,.btn-sm{padding:5px 10px;font-size:16px;line-height:1.5;border-radius:0}.btn-group-xs>.btn,.btn-xs{padding:1px 5px;font-size:16px;line-height:1.5;border-radius:0}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=button].btn-block,input[type=reset].btn-block,input[type=submit].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{height:0;overflow:hidden;-webkit-transition-property:height,visibility;transition-property:height,visibility;-webkit-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid\9;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:18px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:0;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu-right,.dropdown-menu.pull-right{left:auto;right:0}.dropdown-header,.dropdown-menu>li>a{display:block;padding:3px 20px;line-height:1.42857143;white-space:nowrap}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle,.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child,.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.dropdown-menu .divider{height:1px;margin:11.5px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{clear:both;font-weight:400;color:#333}.dropdown-menu>li>a:focus,.dropdown-menu>li>a:hover{text-decoration:none;color:#fff;background-color:#2780E3}.dropdown-menu>.active>a,.dropdown-menu>.active>a:focus,.dropdown-menu>.active>a:hover{color:#fff;text-decoration:none;outline:0;background-color:#2780E3}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{color:#999}.dropdown-menu>.disabled>a:focus,.dropdown-menu>.disabled>a:hover{text-decoration:none;background-color:transparent;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{font-size:16px;color:#999}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.nav-justified>.dropdown .dropdown-menu,.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid\9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:768px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group-vertical>.btn,.btn-group>.btn{position:relative;float:left}.btn-group-vertical>.btn.active,.btn-group-vertical>.btn:active,.btn-group-vertical>.btn:focus,.btn-group-vertical>.btn:hover,.btn-group>.btn.active,.btn-group>.btn:active,.btn-group>.btn:focus,.btn-group>.btn:hover{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn .caret,.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn-lg .caret{border-width:5px 5px 0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn,.btn-group-vertical>.btn:first-child:not(:last-child),.btn-group-vertical>.btn:last-child:not(:first-child),.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn input[type=checkbox],[data-toggle=buttons]>.btn input[type=radio],[data-toggle=buttons]>.btn-group>.btn input[type=checkbox],[data-toggle=buttons]>.btn-group>.btn input[type=radio]{position:absolute;clip:rect(0,0,0,0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:69px;padding:18px 30px;font-size:23px;line-height:1.3333333;border-radius:0}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:69px;line-height:69px}select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn,textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:36px;padding:5px 10px;font-size:16px;line-height:1.5;border-radius:0}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:36px;line-height:36px}select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn,textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn{height:auto}.input-group .form-control,.input-group-addon,.input-group-btn{display:table-cell}.nav>li,.nav>li>a{display:block;position:relative}.input-group .form-control:not(:first-child):not(:last-child),.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:10px 18px;font-size:18px;font-weight:400;line-height:1;color:#333;text-align:center;background-color:#e6e6e6;border:1px solid #ccc;border-radius:0}.badge,.label{font-weight:700;white-space:nowrap;text-align:center}.input-group-addon.input-sm{padding:5px 10px;font-size:16px;border-radius:0}.input-group-addon.input-lg{padding:18px 30px;font-size:23px;border-radius:0}.input-group-addon input[type=checkbox],.input-group-addon input[type=radio]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn-group:not(:last-child)>.btn,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:first-child>.btn-group:not(:first-child)>.btn,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:active,.input-group-btn>.btn:focus,.input-group-btn>.btn:hover{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li>a{padding:10px 15px}.nav>li>a:focus,.nav>li>a:hover{text-decoration:none;background-color:#e6e6e6}.nav>li.disabled>a{color:#999}.nav>li.disabled>a:focus,.nav>li.disabled>a:hover{color:#999;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:focus,.nav .open>a:hover{background-color:#e6e6e6;border-color:#1967be}.nav .nav-divider{height:1px;margin:11.5px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:0}.nav-tabs>li>a:hover{border-color:#e6e6e6 #e6e6e6 #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:focus,.nav-tabs>li.active>a:hover{color:#555;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px;margin-right:0;border-radius:0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0;border-bottom:1px solid #ddd;border-radius:0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:focus,.nav-tabs.nav-justified>.active>a:hover{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-justified>li,.nav-stacked>li{float:none}.nav-pills>li>a{border-radius:0}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:focus,.nav-pills>li.active>a:hover{color:#fff;background-color:#2780E3}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border:1px solid #ddd}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:focus,.nav-tabs-justified>.active>a:hover{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:90px;margin-bottom:25px;border:1px solid transparent}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;box-shadow:inset 0 1px 0 rgba(255,255,255,.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar{border-radius:0}.navbar-header{float:left}.navbar-collapse{width:auto;border-top:0;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse{padding-left:0;padding-right:0}}.carousel-inner,.embed-responsive,.modal,.modal-open,.progress{overflow:hidden}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-bottom .navbar-collapse,.navbar-fixed-top .navbar-collapse{max-height:200px}}.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:-15px;margin-left:-15px}.navbar-static-top{z-index:1000;border-width:0 0 1px}.navbar-fixed-bottom,.navbar-fixed-top{position:fixed;right:0;left:0;z-index:1030}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:32.5px 15px;font-size:23px;line-height:25px;height:90px}.navbar-brand:focus,.navbar-brand:hover{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:768px){.container-fluid>.navbar-collapse,.container-fluid>.navbar-header,.container>.navbar-collapse,.container>.navbar-header{margin-right:0;margin-left:0}.navbar-fixed-bottom,.navbar-fixed-top,.navbar-static-top{border-radius:0}.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:28px;margin-bottom:28px;background-color:transparent;border:1px solid transparent;border-radius:0}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}.navbar-nav{margin:16.25px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:25px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;box-shadow:none}.navbar-nav .open .dropdown-menu .dropdown-header,.navbar-nav .open .dropdown-menu>li>a{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:25px}.navbar-nav .open .dropdown-menu>li>a:focus,.navbar-nav .open .dropdown-menu>li>a:hover{background-image:none}}.progress-bar-striped,.progress-striped .progress-bar,.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}@media (min-width:768px){.navbar-toggle{display:none}.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:32.5px;padding-bottom:32.5px}}.navbar-form{padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);margin:21.5px -15px}@media (min-width:768px){.navbar-form .form-control-static,.navbar-form .form-group{display:inline-block}.navbar-form .control-label,.navbar-form .form-group{margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .form-control,.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .checkbox,.navbar-form .radio{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .checkbox label,.navbar-form .radio label{padding-left:0}.navbar-form .checkbox input[type=checkbox],.navbar-form .radio input[type=radio]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.breadcrumb>li,.pagination{display:inline-block}.btn .badge,.btn .label{top:-1px;position:relative}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-radius:0}.navbar-btn{margin-top:21.5px;margin-bottom:21.5px}.navbar-btn.btn-sm{margin-top:27px;margin-bottom:27px}.navbar-btn.btn-xs{margin-top:34px;margin-bottom:34px}.navbar-text{margin-top:32.5px;margin-bottom:32.5px}@media (min-width:768px){.navbar-text{float:left;margin-left:15px;margin-right:15px}.navbar-left{float:left!important}.navbar-right{float:right!important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:rgba(255,255,255,.95);border-color:rgba(238,238,238,.95)}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:focus,.navbar-default .navbar-brand:hover{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-nav>li>a,.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a:focus,.navbar-default .navbar-nav>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:focus,.navbar-default .navbar-nav>.active>a:hover{color:#555;background-color:rgba(238,238,238,.95)}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:focus,.navbar-default .navbar-nav>.disabled>a:hover{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:focus,.navbar-default .navbar-toggle:hover{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:rgba(238,238,238,.95)}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:focus,.navbar-default .navbar-nav>.open>a:hover{background-color:rgba(238,238,238,.95);color:#555}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover{color:#555;background-color:rgba(238,238,238,.95)}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:focus,.navbar-default .btn-link:hover{color:#333}.navbar-default .btn-link[disabled]:focus,.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:focus,fieldset[disabled] .navbar-default .btn-link:hover{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#bfbfbf}.navbar-inverse .navbar-brand:focus,.navbar-inverse .navbar-brand:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>li>a,.navbar-inverse .navbar-text{color:#bfbfbf}.navbar-inverse .navbar-nav>li>a:focus,.navbar-inverse .navbar-nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:focus,.navbar-inverse .navbar-nav>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:focus,.navbar-inverse .navbar-nav>.disabled>a:hover{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:focus,.navbar-inverse .navbar-toggle:hover{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:focus,.navbar-inverse .navbar-nav>.open>a:hover{background-color:#080808;color:#fff}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#bfbfbf}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#bfbfbf}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#bfbfbf}.navbar-inverse .btn-link:focus,.navbar-inverse .btn-link:hover{color:#fff}.navbar-inverse .btn-link[disabled]:focus,.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:focus,fieldset[disabled] .navbar-inverse .btn-link:hover{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:25px;list-style:none;background-color:#f5f5f5;border-radius:0}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{padding-left:0;margin:25px 0;border-radius:0}.pager li,.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:10px 18px;line-height:1.42857143;text-decoration:none;color:#1967be;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span,.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:0;border-top-left-radius:0}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span,.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span,.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:0;border-top-right-radius:0}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:0;border-top-left-radius:0}.pagination>li>a:focus,.pagination>li>a:hover,.pagination>li>span:focus,.pagination>li>span:hover{z-index:2;color:#10427b;background-color:#e6e6e6;border-color:#ddd}.pagination>.active>a,.pagination>.active>a:focus,.pagination>.active>a:hover,.pagination>.active>span,.pagination>.active>span:focus,.pagination>.active>span:hover{z-index:3;color:#999;background-color:#f5f5f5;border-color:#ddd;cursor:default}.pagination>.disabled>a,.pagination>.disabled>a:focus,.pagination>.disabled>a:hover,.pagination>.disabled>span,.pagination>.disabled>span:focus,.pagination>.disabled>span:hover{color:#999;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:18px 30px;font-size:23px;line-height:1.3333333}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:16px;line-height:1.5}.badge,.carousel-inner>.item>a>img,.carousel-inner>.item>img,.close,.label{line-height:1}.pager{padding-left:0;margin:25px 0;list-style:none;text-align:center}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:0}.pager li>a:focus,.pager li>a:hover{text-decoration:none;background-color:#e6e6e6}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:focus,.pager .disabled>a:hover,.pager .disabled>span{color:#999;background-color:#fff;cursor:not-allowed}a.badge:focus,a.badge:hover,a.label:focus,a.label:hover{color:#fff;cursor:pointer;text-decoration:none}.label{display:inline;padding:.2em .6em .3em;font-size:75%;color:#fff;border-radius:.25em}.label:empty{display:none}.label-default{background-color:#222}.label-default[href]:focus,.label-default[href]:hover{background-color:#090909}.label-primary{background-color:#2780E3}.label-primary[href]:focus,.label-primary[href]:hover{background-color:#1967be}.label-success{background-color:#3FB618}.label-success[href]:focus,.label-success[href]:hover{background-color:#2f8912}.label-info{background-color:#7532c7}.label-info[href]:focus,.label-info[href]:hover{background-color:#5d289e}.label-warning{background-color:#e85814}.label-warning[href]:focus,.label-warning[href]:hover{background-color:#b94610}.label-danger{background-color:#FF0039}.label-danger[href]:focus,.label-danger[href]:hover{background-color:#cc002e}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:16px;color:#fff;vertical-align:middle;background-color:#2780E3;border-radius:10px}.badge:empty{display:none}.media-object,.thumbnail{display:block}.btn-group-xs>.btn .badge,.btn-xs .badge{top:0;padding:1px 5px}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#1967be;background-color:#fff}.jumbotron,.jumbotron .h1,.jumbotron h1{color:inherit}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;background-color:#e6e6e6}.jumbotron p{margin-bottom:15px;font-size:27px;font-weight:200}.alert,.thumbnail{margin-bottom:25px}.alert .alert-link,.close{font-weight:700}.jumbotron>hr{border-top-color:#ccc}.container .jumbotron,.container-fluid .jumbotron{border-radius:0;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron .h1,.jumbotron h1{font-size:81px}}.thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:0;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail a>img,.thumbnail>img{margin-left:auto;margin-right:auto}a.thumbnail.active,a.thumbnail:focus,a.thumbnail:hover{border-color:#1967be}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;border:1px solid transparent;border-radius:0}.alert h4{margin-top:0;color:inherit}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.modal,.modal-backdrop{right:0;bottom:0;left:0}.alert-success{background-color:#3FB618;border-color:#4e9f15;color:#fff}.alert-success hr{border-top-color:#438912}.alert-success .alert-link{color:#e6e6e6}.alert-info{background-color:#7532c7;border-color:#4f2baa;color:#fff}.alert-info hr{border-top-color:#462696}.alert-info .alert-link{color:#e6e6e6}.alert-warning{background-color:#e85814;border-color:#da3113;color:#fff}.alert-warning hr{border-top-color:#c22c11}.alert-warning .alert-link{color:#e6e6e6}.alert-danger{background-color:#FF0039;border-color:#f0005e;color:#fff}.alert-danger hr{border-top-color:#d60054}.alert-danger .alert-link{color:#e6e6e6}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:25px;margin-bottom:25px;background-color:#ccc;border-radius:0;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:16px;line-height:25px;color:#fff;text-align:center;background-color:#2780E3;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-bar-striped,.progress-striped .progress-bar{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:40px 40px}.progress-bar.active,.progress.active .progress-bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#3FB618}.progress-striped .progress-bar-success{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-striped .progress-bar-info,.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#7532c7}.progress-striped .progress-bar-info{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#e85814}.progress-striped .progress-bar-warning{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#FF0039}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-body,.media-left,.media-right{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:focus,a.list-group-item:hover,button.list-group-item:focus,button.list-group-item:hover{text-decoration:none;color:#555;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:focus,.list-group-item.disabled:hover{background-color:#e6e6e6;color:#999;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text{color:#999}.list-group-item.active,.list-group-item.active:focus,.list-group-item.active:hover{z-index:2;color:#fff;background-color:#2780E3;border-color:#ddd}.list-group-item.active .list-group-item-heading,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:focus .list-group-item-text,.list-group-item.active:hover .list-group-item-text{color:#dceafa}.list-group-item-success{color:#fff;background-color:#3FB618}a.list-group-item-success,button.list-group-item-success{color:#fff}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:focus,a.list-group-item-success:hover,button.list-group-item-success:focus,button.list-group-item-success:hover{color:#fff;background-color:#379f15}a.list-group-item-success.active,a.list-group-item-success.active:focus,a.list-group-item-success.active:hover,button.list-group-item-success.active,button.list-group-item-success.active:focus,button.list-group-item-success.active:hover{color:#fff;background-color:#fff;border-color:#fff}.list-group-item-info{color:#fff;background-color:#7532c7}a.list-group-item-info,button.list-group-item-info{color:#fff}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:focus,a.list-group-item-info:hover,button.list-group-item-info:focus,button.list-group-item-info:hover{color:#fff;background-color:#692db3}a.list-group-item-info.active,a.list-group-item-info.active:focus,a.list-group-item-info.active:hover,button.list-group-item-info.active,button.list-group-item-info.active:focus,button.list-group-item-info.active:hover{color:#fff;background-color:#fff;border-color:#fff}.list-group-item-warning{color:#fff;background-color:#e85814}a.list-group-item-warning,button.list-group-item-warning{color:#fff}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:focus,a.list-group-item-warning:hover,button.list-group-item-warning:focus,button.list-group-item-warning:hover{color:#fff;background-color:#d14f12}a.list-group-item-warning.active,a.list-group-item-warning.active:focus,a.list-group-item-warning.active:hover,button.list-group-item-warning.active,button.list-group-item-warning.active:focus,button.list-group-item-warning.active:hover{color:#fff;background-color:#fff;border-color:#fff}.list-group-item-danger{color:#fff;background-color:#FF0039}a.list-group-item-danger,button.list-group-item-danger{color:#fff}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:focus,a.list-group-item-danger:hover,button.list-group-item-danger:focus,button.list-group-item-danger:hover{color:#fff;background-color:#e60033}a.list-group-item-danger.active,a.list-group-item-danger.active:focus,a.list-group-item-danger.active:hover,button.list-group-item-danger.active,button.list-group-item-danger.active:focus,button.list-group-item-danger.active:hover{color:#fff;background-color:#fff;border-color:#fff}.panel-heading>.dropdown .dropdown-toggle,.panel-title,.panel-title>.small,.panel-title>.small>a,.panel-title>a,.panel-title>small,.panel-title>small>a{color:inherit}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:25px;background-color:#fff;border:1px solid transparent;border-radius:0;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-title,.panel>.list-group,.panel>.panel-collapse>.list-group,.panel>.panel-collapse>.table,.panel>.table,.panel>.table-responsive>.table{margin-bottom:0}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:-1;border-top-left-radius:-1}.panel-title{margin-top:0;font-size:21px}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:-1;border-bottom-left-radius:-1}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel-group .panel-heading,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th{border-bottom:0}.panel>.table-responsive:last-child>.table:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:-1;border-bottom-right-radius:-1}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:-1;border-top-left-radius:-1}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:-1;border-bottom-left-radius:-1}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel>.table-responsive:first-child>.table:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table:first-child>thead:first-child>tr:first-child{border-top-right-radius:-1;border-top-left-radius:-1}.list-group+.panel-footer,.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.panel>.panel-collapse>.table caption,.panel>.table caption,.panel>.table-responsive>.table caption{padding-left:15px;padding-right:15px}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child{border-top-left-radius:-1}.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child{border-top-right-radius:-1}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:-1}.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:-1}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child td,.panel>.table>tbody:first-child>tr:first-child th{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child{border-left:0}.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child{border-right:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:25px}.panel-group .panel{margin-bottom:0;border-radius:0}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading+.panel-collapse>.list-group,.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#2780E3}.panel-primary>.panel-heading{color:#fff;background-color:#2780E3;border-color:#2780E3}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#2780E3}.panel-primary>.panel-heading .badge{color:#2780E3;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#2780E3}.panel-success{border-color:#4e9f15}.panel-success>.panel-heading{color:#fff;background-color:#3FB618;border-color:#4e9f15}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#4e9f15}.panel-success>.panel-heading .badge{color:#3FB618;background-color:#fff}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#4e9f15}.panel-info{border-color:#4f2baa}.panel-info>.panel-heading{color:#fff;background-color:#7532c7;border-color:#4f2baa}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#4f2baa}.panel-info>.panel-heading .badge{color:#7532c7;background-color:#fff}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#4f2baa}.panel-warning{border-color:#da3113}.panel-warning>.panel-heading{color:#fff;background-color:#e85814;border-color:#da3113}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#da3113}.panel-warning>.panel-heading .badge{color:#e85814;background-color:#fff}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#da3113}.panel-danger{border-color:#f0005e}.panel-danger>.panel-heading{color:#fff;background-color:#FF0039;border-color:#f0005e}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#f0005e}.panel-danger>.panel-heading .badge{color:#FF0039;background-color:#fff}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#f0005e}.embed-responsive{position:relative;display:block;height:0;padding:0}.embed-responsive .embed-responsive-item,.embed-responsive embed,.embed-responsive iframe,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:0}.well-sm{padding:9px;border-radius:0}.close{float:right;font-size:27px;color:#fff;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.popover,.tooltip{font-family:'Open Sans',sans-serif;font-style:normal;font-weight:400;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;text-decoration:none}.close:focus,.close:hover{color:#fff;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:0 0;border:0;-webkit-appearance:none}.modal-content,.popover{background-clip:padding-box}.modal{display:none;position:fixed;top:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0,-25%);-ms-transform:translate(0,-25%);-o-transform:translate(0,-25%);transform:translate(0,-25%);-webkit-transition:-webkit-transform .3s ease-out;-moz-transition:-moz-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0,0);-ms-transform:translate(0,0);-o-transform:translate(0,0);transform:translate(0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;border:1px solid transparent;border-radius:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5);outline:0}.modal-backdrop{position:fixed;top:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:20px}.modal-footer{padding:20px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}.tooltip.top-left .tooltip-arrow,.tooltip.top-right .tooltip-arrow{bottom:0;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;text-align:left;text-align:start;font-size:16px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:0}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{right:5px}.tooltip.top-right .tooltip-arrow{left:5px}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow,.tooltip.bottom-left .tooltip-arrow,.tooltip.bottom-right .tooltip-arrow{border-width:0 5px 5px;border-bottom-color:#000;top:0}.tooltip.bottom .tooltip-arrow{left:50%;margin-left:-5px}.tooltip.bottom-left .tooltip-arrow{right:5px;margin-top:-5px}.tooltip.bottom-right .tooltip-arrow{left:5px;margin-top:-5px}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;text-align:left;text-align:start;font-size:18px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:0;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.carousel-caption,.carousel-control{text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:-1 -1 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.carousel,.carousel-inner{position:relative}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.left>.arrow:after,.popover.right>.arrow:after{content:" ";bottom:-10px}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,.25)}.popover.right>.arrow:after{left:1px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;border-right-width:0;border-left-color:#fff}.carousel-inner{width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform .6s ease-in-out;-moz-transition:-moz-transform .6s ease-in-out;-o-transition:-o-transform .6s ease-in-out;transition:transform .6s ease-in-out;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;-moz-perspective:1000px;perspective:1000px}.carousel-inner>.item.active.right,.carousel-inner>.item.next{-webkit-transform:translate3d(100%,0,0);transform:translate3d(100%,0,0);left:0}.carousel-inner>.item.active.left,.carousel-inner>.item.prev{-webkit-transform:translate3d(-100%,0,0);transform:translate3d(-100%,0,0);left:0}.carousel-inner>.item.active,.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right{-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;background-color:rgba(0,0,0,0)}.carousel-control.left{background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:focus,.carousel-control:hover{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{left:50%;margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{right:50%;margin-right:-10px}.carousel-control .icon-next,.carousel-control .icon-prev{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border-radius:10px;cursor:pointer;background-color:#000\9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff}.h1,.h2,body,h1,h2{padding-top:100px}.carousel-caption .btn,.text-hide{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next,.carousel-control .icon-prev{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.btn-group-vertical>.btn-group:after,.btn-group-vertical>.btn-group:before,.btn-toolbar:after,.btn-toolbar:before,.clearfix:after,.clearfix:before,.container-fluid:after,.container-fluid:before,.container:after,.container:before,.dl-horizontal dd:after,.dl-horizontal dd:before,.form-horizontal .form-group:after,.form-horizontal .form-group:before,.modal-footer:after,.modal-footer:before,.modal-header:after,.modal-header:before,.nav:after,.nav:before,.navbar-collapse:after,.navbar-collapse:before,.navbar-header:after,.navbar-header:before,.navbar:after,.navbar:before,.pager:after,.pager:before,.panel-body:after,.panel-body:before,.row:after,.row:before{content:" ";display:table}.btn-group-vertical>.btn-group:after,.btn-toolbar:after,.clearfix:after,.container-fluid:after,.container:after,.dl-horizontal dd:after,.form-horizontal .form-group:after,.modal-footer:after,.modal-header:after,.nav:after,.navbar-collapse:after,.navbar-header:after,.navbar:after,.pager:after,.panel-body:after,.row:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.hidden,.visible-lg,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block,.visible-md,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-sm,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-xs,.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block{display:none!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;background-color:transparent;border:0}.affix{position:fixed}@-ms-viewport{width:device-width}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table!important}tr.visible-xs{display:table-row!important}td.visible-xs,th.visible-xs{display:table-cell!important}.visible-xs-block{display:block!important}.visible-xs-inline{display:inline!important}.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table!important}tr.visible-sm{display:table-row!important}td.visible-sm,th.visible-sm{display:table-cell!important}.visible-sm-block{display:block!important}.visible-sm-inline{display:inline!important}.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table!important}tr.visible-md{display:table-row!important}td.visible-md,th.visible-md{display:table-cell!important}.visible-md-block{display:block!important}.visible-md-inline{display:inline!important}.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table!important}tr.visible-lg{display:table-row!important}td.visible-lg,th.visible-lg{display:table-cell!important}.visible-lg-block{display:block!important}.visible-lg-inline{display:inline!important}.visible-lg-inline-block{display:inline-block!important}.hidden-lg{display:none!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table!important}tr.visible-print{display:table-row!important}td.visible-print,th.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}.hidden-print{display:none!important}}.h1,.h2,h1,h2{margin-top:-80px}body,html{height:100%;min-height:700px}h1,h2,h3,h4,h5,h6{font-weight:700}.navbar-fixed-top{box-shadow:0 2px 5px rgba(0,0,0,.1);transition:background-color .3s linear}@media (min-width:768px){.navbar-fixed-top.invisible-bg{background:0 0;border:none;box-shadow:none}.navbar-fixed-top.invisible-bg .nav li a{background:0 0;color:#000}.navbar-fixed-top.invisible-bg .nav li a:hover{background:0 0;color:#555}}.navbar-fixed-top .navbar-brand{padding-right:30px}.navbar-fixed-top .navbar-brand img{height:78px;margin-top:-23px}.navbar-fixed-top .button-right{margin-top:22.5px}.navbar-fixed-top .button-right .btn{border:1px solid #666;border-radius:6px;background:0 0;color:#000;transition:background ease .3s}.navbar-fixed-top .button-right .btn:hover{background:rgba(230,230,230,.7)}@media (max-width:991px){.navbar-fixed-top .navbar-header .navbar-brand{padding-right:5px}.navbar-fixed-top .navbar-header .navbar-brand img{height:60px;margin-top:-18px}}.bs-sidebar .filter,.bs-sidenav{margin-top:30px}hr{border-bottom:5px solid #303b7f;border-top:0;width:150px}.box{padding:80px 50px 40px}.clear{clear:both}.announce{text-transform:uppercase}.triangle{position:absolute;left:50%;top:-50px;font-size:120px;margin-left:-35px;color:#f5f5f5}.carousel-control{width:10%;cursor:pointer}.carousel-control.left,.carousel-control.right{background-image:none}.carousel-control .fa{color:#000}.carousel-indicators li{border:1px solid #303b7f}.carousel-indicators li.active{background:#303b7f}@media (max-width:767px){.h1,h1{font-size:24px}.h2,h2{font-size:22px}.h3,h3{font-size:20px}.h4,h4{font-size:18px}.box{padding:40px 25px}.popover{font-size:11px;max-width:250px}}.bs-sidebar.affix{position:static}.bs-sidebar.well{padding:0}.bs-sidenav{margin-bottom:30px;padding-top:10px;padding-bottom:10px;border-radius:5px}.filter~.bs-sidenav{margin-top:10px}.bs-sidebar .nav>li>a{display:block;padding:5px 20px}.bs-sidebar .nav>li>a:focus,.bs-sidebar .nav>li>a:hover{text-decoration:none;border-right:1px solid}.bs-sidebar .nav>.active:focus>a,.bs-sidebar .nav>.active:hover>a,.bs-sidebar .nav>.active>a{font-weight:700;background-color:transparent;border-right:1px solid}.bs-sidebar .nav .nav{display:none;margin-bottom:8px}.bs-sidebar .nav .nav>li>a{padding-top:3px;padding-bottom:3px;padding-left:30px;font-size:90%}@media (min-width:992px){.bs-sidebar .nav>.active>ul{display:block}.bs-sidebar.affix,.bs-sidebar.affix-bottom,.bs-sidebar.fixed{width:213px}.bs-sidebar.affix,.bs-sidebar.fixed{position:fixed;top:100px}.bs-sidebar.affix-bottom{position:absolute}.bs-sidebar.affix .bs-sidenav,.bs-sidebar.affix-bottom .bs-sidenav,.bs-sidebar.fixed .bs-sidenav{margin-top:0;margin-bottom:0}}@media (min-width:1200px){.bs-sidebar.affix,.bs-sidebar.affix-bottom,.bs-sidebar.fixed{width:263px}}div.col-md-3{padding-left:0}div.source-links{float:right} \ No newline at end of file diff --git a/doc/styles/jsdoc-default.css b/doc/styles/jsdoc-default.css new file mode 100644 index 00000000..4c23aca8 --- /dev/null +++ b/doc/styles/jsdoc-default.css @@ -0,0 +1,234 @@ +header +{ + display: block; + padding: 0px 4px; +} + +.class-description { + font-size: 130%; + line-height: 140%; + margin-bottom: 1em; + margin-top: 1em; +} + +.class-description:empty { + margin: 0; +} + +article dl { + margin-bottom: 40px; +} + +section +{ + display: block; + background-color: #fff; + padding: 12px 24px; + border-bottom: 1px solid #ccc; + margin-right: 30px; +} + +.variation { + display: none; +} + +.signature-attributes { + font-size: 60%; + color: #aaa; + font-style: italic; + font-weight: lighter; +} + +footer { + display: block; + padding: 6px; + margin-top: 12px; + font-style: italic; + font-size: 90%; +} + + +h1 +{ + font-size: 48px; + letter-spacing: -2px; +} + +h2, h3 +{ + font-size: 30px; + font-weight: 700; + letter-spacing: -1px; + margin-bottom: 12px; +} + +h4 +{ + font-size: 18px; + letter-spacing: -0.33px; + margin-bottom: 12px; +} + +h5, .container-overview .subsection-title +{ + font-size: 120%; + font-weight: bold; + letter-spacing: -0.01em; + margin: 8px 0 3px 0; +} + +h6 +{ + font-size: 100%; + letter-spacing: -0.01em; + margin: 6px 0 3px 0; + font-style: italic; +} + +.ancestors { color: #999; } +.ancestors a +{ + color: #999 !important; + text-decoration: none; +} + +.clear +{ + clear: both; +} + +.important +{ + font-weight: bold; + color: #950B02; +} + +.yes-def { + text-indent: -1000px; +} + +.type-signature { + color: #aaa; +} + +.name, .signature { + font-family: Consolas, Monaco, 'Andale Mono', monospace; +} + +.details { margin-top: 14px; border-left: 2px solid #DDD; } +.details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; } +.details dd { margin-left: 70px; } +.details ul { margin: 0; } +.details ul { list-style-type: none; } +.details li { margin-left: 30px; padding-top: 6px; } +.details pre.prettyprint { margin: 0 } +.details .object-value { padding-top: 0; } + +.description { + margin-bottom: 1em; + margin-top: 1em; +} + +.code-caption +{ + font-style: italic; + font-size: 107%; + margin: 0; +} + +.prettyprint +{ + border: 1px solid #ddd; + overflow: auto; +} + +.prettyprint.source { + width: inherit; +} + +.prettyprint code +{ + font-size: 100%; + line-height: 18px; + display: block; + margin: 0; + color: #4D4E53; +} + +.prettyprint code span.line +{ + display: inline-block; +} + +.prettyprint.linenums +{ + padding-left: 70px; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.prettyprint.linenums ol +{ + padding-left: 0; +} + +.prettyprint.linenums li +{ + border-left: 3px #ddd solid; +} + +.prettyprint.linenums li.selected, +.prettyprint.linenums li.selected * +{ + background-color: lightyellow; +} + +.prettyprint.linenums li * +{ + -webkit-user-select: text; + -moz-user-select: text; + -ms-user-select: text; + user-select: text; +} + +.params, .props +{ + border-spacing: 0; + border: 0; + border-collapse: collapse; +} + +.params .subparams { + padding-left: 40px; +} + +.params .name, .props .name, .name code { + color: #4D4E53; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 100%; +} + +.params td, .params th, .props td, .props th +{ + text-align: left; + vertical-align: top; + padding: 4px 6px; +} + +.params td.description > p:first-child +{ + margin-top: 0; + padding-top: 0; +} + +.params td.description > p:last-child +{ + margin-bottom: 0; + padding-bottom: 0; +} + +.disabled { + color: #454545; +} diff --git a/doc/styles/prettify-jsdoc.css b/doc/styles/prettify-jsdoc.css new file mode 100644 index 00000000..5a2526e3 --- /dev/null +++ b/doc/styles/prettify-jsdoc.css @@ -0,0 +1,111 @@ +/* JSDoc prettify.js theme */ + +/* plain text */ +.pln { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* string content */ +.str { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a keyword */ +.kwd { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a comment */ +.com { + font-weight: normal; + font-style: italic; +} + +/* a type name */ +.typ { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a literal value */ +.lit { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* punctuation */ +.pun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp open bracket */ +.opn { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* lisp close bracket */ +.clo { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a markup tag name */ +.tag { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute name */ +.atn { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a markup attribute value */ +.atv { + color: #006400; + font-weight: normal; + font-style: normal; +} + +/* a declaration */ +.dec { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* a variable name */ +.var { + color: #000000; + font-weight: normal; + font-style: normal; +} + +/* a function name */ +.fun { + color: #000000; + font-weight: bold; + font-style: normal; +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; +} diff --git a/doc/styles/prettify-tomorrow.css b/doc/styles/prettify-tomorrow.css new file mode 100644 index 00000000..b6f92a78 --- /dev/null +++ b/doc/styles/prettify-tomorrow.css @@ -0,0 +1,132 @@ +/* Tomorrow Theme */ +/* Original theme - https://github.com/chriskempson/tomorrow-theme */ +/* Pretty printing styles. Used with prettify.js. */ +/* SPAN elements with the classes below are added by prettyprint. */ +/* plain text */ +.pln { + color: #4d4d4c; } + +@media screen { + /* string content */ + .str { + color: #718c00; } + + /* a keyword */ + .kwd { + color: #8959a8; } + + /* a comment */ + .com { + color: #8e908c; } + + /* a type name */ + .typ { + color: #4271ae; } + + /* a literal value */ + .lit { + color: #f5871f; } + + /* punctuation */ + .pun { + color: #4d4d4c; } + + /* lisp open bracket */ + .opn { + color: #4d4d4c; } + + /* lisp close bracket */ + .clo { + color: #4d4d4c; } + + /* a markup tag name */ + .tag { + color: #c82829; } + + /* a markup attribute name */ + .atn { + color: #f5871f; } + + /* a markup attribute value */ + .atv { + color: #3e999f; } + + /* a declaration */ + .dec { + color: #f5871f; } + + /* a variable name */ + .var { + color: #c82829; } + + /* a function name */ + .fun { + color: #4271ae; } } +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { + color: #060; } + + .kwd { + color: #006; + font-weight: bold; } + + .com { + color: #600; + font-style: italic; } + + .typ { + color: #404; + font-weight: bold; } + + .lit { + color: #044; } + + .pun, .opn, .clo { + color: #440; } + + .tag { + color: #006; + font-weight: bold; } + + .atn { + color: #404; } + + .atv { + color: #060; } } +/* Style */ +/* +pre.prettyprint { + background: white; + font-family: Consolas, Monaco, 'Andale Mono', monospace; + font-size: 12px; + line-height: 1.5; + border: 1px solid #ccc; + padding: 10px; } +*/ + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { + margin-top: 0; + margin-bottom: 0; } + +/* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L4, +li.L5, +li.L6, +li.L7, +li.L8, +li.L9 { + /* */ } + +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { + /* */ } diff --git a/doc/util.Code.html b/doc/util.Code.html new file mode 100644 index 00000000..b69da16f --- /dev/null +++ b/doc/util.Code.html @@ -0,0 +1,1561 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Code + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Code

+ + + + + + +
+ +
+ +

+ util.Code

+ + +
+ +
+
+ + + + + +

new Code(metamodel)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
metamodel + + +Metamodel + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

deleteCode(type, codeType) → {Promise.<*>}

+ + + + + +
+

Deletes Baqend code identified by the given bucket and code type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +ManagedType +| + +string + + + +

The entity type for the handler or the Name of the
Baqend code

codeType + + +string + + + +

The type of the code

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

succeed if the code was deleted

+
+ + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + + +

functionToString(fn) → {string}

+ + + + + +
+

Converts the given function to a string

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

The JavaScript function to serialize

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The serialized function

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +

loadCode(type, codeType, asFunctionopt) → {Promise.<(string|function())>}

+ + + + + +
+

Loads Baqend code which will be identified by the given bucket and code codeType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
type + + +ManagedType +| + +string + + + + + + + + + + + +

The entity type for the handler or the Name of the
Baqend code

codeType + + +string + + + + + + + + + + + +

The type of the code

asFunction + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

set it to true, to parse the code as a function and return it
instead of a string

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The code as string or as a parsed function

+
+ + + +
+
+ Type +
+
+ +<(string|function())> + + +
+
+ + + + + + + + + + +

loadModules() → {Promise.<Array.<string>>}

+ + + + + +
+

Loads a list of all available modules
Does not include handlers

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<string>> + + +
+
+ + + + + + + + + + +

saveCode(type, codeType, fn) → {Promise.<(string|function())>}

+ + + + + +
+

Saves Baqend code which will be identified by the given bucket and code type

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
type + + +ManagedType +| + +string + + + +

The entity type for the handler or the Name of the
Baqend code

codeType + + +string + + + +

The type of the code

fn + + +string +| + +function + + + +

Baqend code as a string or function

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The stored code as a string or as a parsed function

+
+ + + +
+
+ Type +
+
+ +<(string|function())> + + +
+
+ + + + + + + + + + +

stringToFunction(signature, code) → {function}

+ + + + + +
+

Converts the given string to a module wrapper function

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
signature + + +<string> + + + +

The expected parameters of the function

code + + +string + + + +

The JavaScript function to deserialize

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The deserialized function

+
+ + + +
+
+ Type +
+
+ +function + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.Lockable.html b/doc/util.Lockable.html new file mode 100644 index 00000000..72043c63 --- /dev/null +++ b/doc/util.Lockable.html @@ -0,0 +1,1060 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Lockable + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Lockable

+ + + + + + +
+ +
+ +

+ util.Lockable

+ +

This base class provides an lock interface to execute exclusive operations

+ + +
+ +
+
+ + + + +

Constructor

+ + +

new Lockable()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

isReady :boolean

+ + + + +
+

Indicates if there is currently no exclusive operation executed
true If no exclusive lock is hold

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

ready(doneCallbackopt, failCallbackopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

failCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

When the lock can't be released caused by a none
recoverable error

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + +

(protected) withLock(callback, criticalopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Try to aquire an exclusive lock and executes the given callback.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
callback + + +Lockable~callback + + + + + + + + + + + +

The exclusive operation to execute

critical + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Indicates if the operation is critical. If the operation is critical and the
operation fails, then the lock will not be released

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Throws:
+ + + +
+
+
+

If the lock can't be aquired

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

A promise

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + +

Type Definitions

+ + + + + + +

callback() → {Promise.<*>}

+ + + + + +
+

The operation callback is used by the util.Lockable#withLock method,
to perform an exclusive operation on the

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A Promise, which reflects the result of the operation

+
+ + + +
+
+ Type +
+
+ +<*> + + +
+
+ + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.Logger.html b/doc/util.Logger.html new file mode 100644 index 00000000..68c93d58 --- /dev/null +++ b/doc/util.Logger.html @@ -0,0 +1,3380 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Logger + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Logger

+ + + + + + +
+ +
+ +

+ util.Logger

+ + +
+ +
+
+ + + + + +

new Logger()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

entityManager :EntityManager

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

level

+ + + + +
+

Sets the log level which will be logged

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

level :string

+ + + + +
+

The log level which will be logged

+

The log level can be one of 'trace', 'debug', 'info', 'warn', 'error'

+
+ + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

debug(message, dataopt)

+ + + + + +
+

Log message at debug level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
message + + +string + + + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

data + + +<string, *> + + + + + + <optional>
+ + + + + +
+ + null + +

An optional object which will be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

debug(message, …args)

+ + + + + +
+

Log message at debug level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

args + + +* + + + + + + + + + + <repeatable>
+ +

The arguments used to interpolated the message string. The last param can be object which will
be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

error(message, dataopt)

+ + + + + +
+

Log message at error level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
message + + +string + + + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

data + + +<string, *> + + + + + + <optional>
+ + + + + +
+ + null + +

An optional object which will be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

error(message, …args)

+ + + + + +
+

Log message at error level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

args + + +* + + + + + + + + + + <repeatable>
+ +

The arguments used to interpolated the message string. The last param can be object which will
be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

info(message, …args)

+ + + + + +
+

Log message at info level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

args + + +* + + + + + + + + + + <repeatable>
+ +

The arguments used to interpolated the message string. The last param can be object which will
be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

info(message, dataopt)

+ + + + + +
+

Log message at info level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
message + + +string + + + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

data + + +<string, *> + + + + + + <optional>
+ + + + + +
+ + null + +

An optional object which will be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

log(message, …args)

+ + + + + +
+

Logs a message in the default level 'info'

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

args + + +* + + + + + + + + + + <repeatable>
+ +

The arguments used to interpolated the message string. The last param can be object which will
be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

log(message, dataopt)

+ + + + + +
+

Logs a message in the default level 'info'

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
message + + +string + + + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

data + + +<string, *> + + + + + + <optional>
+ + + + + +
+ + null + +

An optional object which will be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

log(level, message, …args)

+ + + + + +
+

Logs a message with the given log level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
level + + +string + + + + + + + + + +

The level used to log the message

message + + +string + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

args + + +* + + + + + + + + + + <repeatable>
+ +

The arguments used to interpolated the message string. The last param can be object which will
be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

log(level, message, dataopt)

+ + + + + +
+

Logs a message with the given log level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
level + + +string + + + + + + + + + + + +

The level used to log the message

message + + +string + + + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

data + + +<string, *> + + + + + + <optional>
+ + + + + +
+ + null + +

An optional object which will be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

trace(message, dataopt)

+ + + + + +
+

Log message at trace level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
message + + +string + + + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

data + + +<string, *> + + + + + + <optional>
+ + + + + +
+ + null + +

An optional object which will be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

trace(message, …args)

+ + + + + +
+

Log message at trace level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

args + + +* + + + + + + + + + + <repeatable>
+ +

The arguments used to interpolated the message string. The last param can be object which will
be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

warn(message, …args)

+ + + + + +
+

Log message at warn level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
message + + +string + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

args + + +* + + + + + + + + + + <repeatable>
+ +

The arguments used to interpolated the message string. The last param can be object which will
be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + +

warn(message, dataopt)

+ + + + + +
+

Log message at warn level

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
message + + +string + + + + + + + + + + + +

The message to log, the message string can be interpolated like the node util.format method

data + + +<string, *> + + + + + + <optional>
+ + + + + +
+ + null + +

An optional object which will be included in the log entry

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.Metadata.html b/doc/util.Metadata.html new file mode 100644 index 00000000..3c75b6c3 --- /dev/null +++ b/doc/util.Metadata.html @@ -0,0 +1,3006 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Metadata + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Metadata

+ + + + + + +
+ +
+ +

+ util.Metadata

+ + +
+ +
+
+ + + + + +

new Metadata(entity, type)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entity + + +Entity + + + +
type + + +ManagedType + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + +

Extends

+ + + + + + + + + + + + + + + + + + +

Members

+ + + +

(static) Type :number

+ + + + + + +
Type:
+
    +
  • + +number + + +
  • +
+ + + + + +
Properties:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
UNAVAILABLE + + +number + + + +
PERSISTENT + + +number + + + +
DIRTY + + +number + + + +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

bucket :string

+ + + + + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

db

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

db :EntityManager

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isAttached :boolean

+ + + + +
+

Indicates if this object already belongs to an db
true if this object belongs already to an db otherwise false

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isAvailable :boolean

+ + + + +
+

Indicates if this object is represents a db object, but was not loaded up to now

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isDirty :boolean

+ + + + +
+

Indicates that this object was modified and the object was not written back to the db

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isPersistent :boolean

+ + + + +
+

Indicates if this object represents the state of the db and was not modified in any manner

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

isReady :boolean

+ + + + +
+

Indicates if there is currently no exclusive operation executed
true If no exclusive lock is hold

+
+ + + +
Type:
+
    +
  • + +boolean + + +
  • +
+ + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key

+ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

key :string

+ + + + + + +
Type:
+
    +
  • + +string + + +
  • +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(static) get(managed) → {util.Metadata}

+ + + + + +
+

Returns the metadata of the managed object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
managed + + +Managed + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Metadata + + +
+
+ + + + + + + + + + +

getJson(excludeMetadataopt, persistingopt) → {json}

+ + + + + +
+

Converts the object to an JSON-Object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
excludeMetadata + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +
persisting + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

indicates if the current state will be persisted.
Used to update the internal change tracking state of collections and mark the object persistent if its true

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

JSON-Object

+
+ + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + +

readAccess()

+ + + + + +
+

Signals that the object will be access by a read access
Ensures that the object was loaded already

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

ready(doneCallbackopt, failCallbackopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Waits on the previously requested operation and calls the doneCallback if the operation is fulfilled

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
doneCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

The callback which will be invoked when the previously
operations on this object is completed.

failCallback + + +Lockable~callback + + + + + + <optional>
+ + + + + +

When the lock can't be released caused by a none
recoverable error

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A promise which completes successfully, when the previously requested
operation completes

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + +

setDirty()

+ + + + + +
+

Indicates the the object is modified by the user

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setJson(json, persistingopt)

+ + + + + +
+

Sets the object content from json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
json + + +json + + + + + + + + + + + +

The updated json content

persisting + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

indicates if the current state will be persisted.
Used to update the internal change tracking state of collections and mark the object persistent or dirty afterwards

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setJsonMetadata(json)

+ + + + + +
+

Sets the object metadata from the object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
json + + +Object + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setPersistent()

+ + + + + +
+

Indicates that the associated object isn't stale, i.e.
the object correlate the database state and is not modified by the user

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setRemoved()

+ + + + + +
+

Indicates the the object is removed

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

setUnavailable()

+ + + + + +
+

Indicates that the associated object isn't available

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

(protected) withLock(callback, criticalopt) → {Promise.<util.Lockable>}

+ + + + + +
+

Try to aquire an exclusive lock and executes the given callback.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
callback + + +Lockable~callback + + + + + + + + + + + +

The exclusive operation to execute

critical + + +boolean + + + + + + <optional>
+ + + + + +
+ + false + +

Indicates if the operation is critical. If the operation is critical and the
operation fails, then the lock will not be released

+ + + + + + +
+ + + + + + +
Inherited From:
+
+ + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + +
Throws:
+ + + +
+
+
+

If the lock can't be aquired

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + + + +
Returns:
+ + +
+

A promise

+
+ + + +
+
+ Type +
+
+ +Lockable> + + +
+
+ + + + + + + + + + +

writeAccess()

+ + + + + +
+

Signals that the object will be access by a write access
Ensures that the object was loaded already and marks the object as dirty

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.Modules.html b/doc/util.Modules.html new file mode 100644 index 00000000..059be2cd --- /dev/null +++ b/doc/util.Modules.html @@ -0,0 +1,1325 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Modules + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Modules

+ + + + + + +
+ +
+ +

+ util.Modules

+ + +
+ +
+
+ + + + + +

new Modules(entityManager, connector)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
entityManager + + +EntityManager + + + +
connector + + +Connector + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

get(bucket, query, optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<Object>}

+ + + + + +
+

Calls the module, which is identified by the given bucket.
The optional query parameter will be attached as GET-parameters.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
bucket + + +string + + + + + + + + + +

Name of the module

query + + +Object +| + +string + + + + + + + + + +

GET-Parameter as key-value-pairs or query string

options + + +Object + + + + + + <optional>
+ + + + + +

Additional request options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
responseType + + +string + + + + + + <optional>
+ + + + + +

The type used to provide the response data, defaults to text oder json depends
on the received data, can be one of arraybuffer, blob, json, text, base64, data-url

+ +
doneCallback + + +function + + + + + + <optional>
+ + + + + +
failCallback + + +function + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<Object> + + +
+
+ + + + + + + + + + +

post(bucket, body, optionsopt, doneCallbackopt, failCallbackopt) → {Promise.<Object>}

+ + + + + +
+

Calls the module, which is identified by the given bucket.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
bucket + + +string + + + + + + + + + +

Name of the module

body + + +string +| + +Blob +| + +File +| + +ArrayBuffer +| + +FormData +| + +json + + + + + + + + + +

The POST-body data to send

options + + +Object + + + + + + <optional>
+ + + + + +

Additional request options

+
Properties
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
requestType + + +string + + + + + + <optional>
+ + + + + +

A optional type hint used to correctly interpret the provided data, can be one of
arraybuffer, blob, json, text, base64, data-url, form

mimeType + + +string + + + + + + <optional>
+ + + + + +

The mimType of the body. Defaults to the mimeType of the provided data if
it is a file object, blob or data-url

responseType + + +string + + + + + + <optional>
+ + + + + +

The type used to provide the response data, defaults to text oder json depends
on the received data, can be one of arraybuffer, blob, json, text, base64, data-url

+ +
doneCallback + + +function + + + + + + <optional>
+ + + + + +
failCallback + + +function + + + + + + <optional>
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +<Object> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.Permission.html b/doc/util.Permission.html new file mode 100644 index 00000000..c317b470 --- /dev/null +++ b/doc/util.Permission.html @@ -0,0 +1,2353 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Permission + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Permission

+ + + + + + +
+ +
+ +

+ util.Permission

+ + +
+ +
+
+ + + + + +

new Permission(metadata)

+ + + + + +
+

Creates a new Permission object, with an empty rule set

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
metadata + + +Metadata + + + +

The metadata of the object

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

(static) fromJSON(json) → {util.Permission}

+ + + + + +
+

Creates a permission from the given rules.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
json + + +json + + + +

The rules.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The permission.

+
+ + + +
+
+ Type +
+
+ +Permission + + +
+
+ + + + + + + + + + +

allowAccess(…userOrRole) → {util.Permission}

+ + + + + +
+

Allows the given users or rules to perform the operation

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
userOrRole + + +User +| + +Role +| + +string + + + + + + + + + + <repeatable>
+ +

The users or roles to allow

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

this permission object

+
+ + + +
+
+ Type +
+
+ +Permission + + +
+
+ + + + + + + + + + +

allRules() → {Array.<string>}

+ + + + + +
+

Returns a list of user and role references of all rules

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

a list of references

+
+ + + +
+
+ Type +
+
+ +<string> + + +
+
+ + + + + + + + + + +

clear()

+ + + + + +
+

Removes all rules from this permission object

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

copy(permission) → {util.Permission}

+ + + + + +
+

Copies permissions from another permission object

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
permission + + +Permission + + + +

The permission to copy from

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Permission + + +
+
+ + + + + + + + + + +

deleteAccess(…userOrRole) → {util.Permission}

+ + + + + +
+

Deletes any allow/deny rules for the given users or roles

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
userOrRole + + +User +| + +Role +| + +string + + + + + + + + + + <repeatable>
+ +

The users or roles to delete rules for

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

this permission object

+
+ + + +
+
+ Type +
+
+ +Permission + + +
+
+ + + + + + + + + + +

denyAccess(…userOrRole) → {util.Permission}

+ + + + + +
+

Denies the given users or rules to perform the operation

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
userOrRole + + +User +| + +Role +| + +string + + + + + + + + + + <repeatable>
+ +

The users or roles to deny

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

this permission object

+
+ + + +
+
+ Type +
+
+ +Permission + + +
+
+ + + + + + + + + + +

fromJSON(json)

+ + + + + +
+

Sets the permission rules from json

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
json + + +json + + + +

The permission json representation

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

getRule(userOrRole) → {string}

+ + + + + +
+

Returns the actual rule of the given user or role.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
userOrRole + + +User +| + +Role +| + +string + + + +

The user or role to check for

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The actual access rule or undefined if no rule was found

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +

isAllowed(userOrRole)

+ + + + + +
+

Checks whenever the user or role is explicit allowed to perform the operation.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
userOrRole + + +User +| + +Role +| + +string + + + +

The user or role to check for

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

isDenied(userOrRole)

+ + + + + +
+

Checks whenever the user or role is explicit denied to perform the operation.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
userOrRole + + +User +| + +Role +| + +string + + + +

The user or role to check for

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

isPublicAllowed() → {boolean}

+ + + + + +
+

Gets whenever all users and roles have the permission to perform the operation

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

true If public access is allowed

+
+ + + +
+
+ Type +
+
+ +boolean + + +
+
+ + + + + + + + + + +

setPublicAllowed()

+ + + + + +
+

Sets whenever all users and roles should have the permission to perform the operation.
Note: All other allow rules will be removed.

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

toJSON() → {json}

+ + + + + +
+

A Json representation of the set of rules

+
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +json + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.PushMessage.html b/doc/util.PushMessage.html new file mode 100644 index 00000000..a216c15a --- /dev/null +++ b/doc/util.PushMessage.html @@ -0,0 +1,807 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: PushMessage + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: PushMessage

+ + + + + + +
+ +
+ +

+ util.PushMessage

+ + +
+ +
+
+ + + + + +

new PushMessage(devicesopt, messageopt, subjectopt, soundopt, badgeopt, dataopt)

+ + + + + +
+

Push message will be used to send a push notification to a set of devices

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
devices + + +Entity> +| + +Entity> + + + + + + <optional>
+ + + + + +

The Set of device references which
will receive this push notification.

message + + +string + + + + + + <optional>
+ + + + + +

The message of the push notification.

subject + + +string + + + + + + <optional>
+ + + + + +

The subject of the push notification.

sound + + +string + + + + + + <optional>
+ + + + + +

The file reference of the sound file as a string. The device uses this file as the
notification sound.

badge + + +number + + + + + + <optional>
+ + + + + +

The badge count.

data + + +Object + + + + + + <optional>
+ + + + + +

The data object which can contain additional information.

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

addDevice(device)

+ + + + + +
+

Adds a new object to the set of devices

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
device + + +Entity + + + +

will be added to the device set to receive the push notification

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.TokenStorage.html b/doc/util.TokenStorage.html new file mode 100644 index 00000000..aba48f97 --- /dev/null +++ b/doc/util.TokenStorage.html @@ -0,0 +1,1231 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: TokenStorage + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: TokenStorage

+ + + + + + +
+ +
+ +

+ util.TokenStorage

+ + +
+ +
+
+ + + + + +

new TokenStorage(origin, token, temporaryopt)

+ + + + + + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDescription
origin + + +string + + + + + + + + + +

The origin where the token belongs to

token + + +string + + + + + + + + + +

The initial token

temporary + + +boolean + + + + + + <optional>
+ + + + + +

If the token should be saved temporary or permanently

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

(static) GLOBAL :util.TokenStorageFactory

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

(static) WEB_STORAGE :util.TokenStorageFactory

+ + + + + + +
Type:
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

token

+ + + + +
+

Get the stored token

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(abstract, protected) _saveToken(origin, token, temporary)

+ + + + + +
+

Use the underlying storage implementation to save the token

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
origin + + +string + + + +

The origin where the token belongs to

token + + +string + + + +

The initial token

temporary + + +boolean + + + +

If the token should be saved temporary or permanently

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

signPath(resource) → {string}

+ + + + + +
+

Derived a resource token from the the stored origin token for the resource and signs the resource with the
generated resource token

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
resource + + +string + + + +

The resource which will be accessible with the returned token

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A resource token which can only be used to access the specified resource

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + +

update(token)

+ + + + + +
+

Update the token for the givin origin, the operation may be asynchronous

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
token + + +String + + + +

The token to store or null to remove the token

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.TokenStorageFactory.html b/doc/util.TokenStorageFactory.html new file mode 100644 index 00000000..079048d4 --- /dev/null +++ b/doc/util.TokenStorageFactory.html @@ -0,0 +1,554 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Interface: TokenStorageFactory + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Interface: TokenStorageFactory

+ + + + + + +
+ +
+ +

+ util.TokenStorageFactory

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + + + + + + + + + +

Methods

+ + + + + + +

create(origin) → {Promise.<TokenStorage>}

+ + + + + +
+

Creates a new tokenStorage which persist tokens for the given origin

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
origin + + +string + + + +

The origin where the token contains to

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

The initialized token storage

+
+ + + +
+
+ Type +
+
+ +<TokenStorage> + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.ValidationResult.html b/doc/util.ValidationResult.html new file mode 100644 index 00000000..3be44270 --- /dev/null +++ b/doc/util.ValidationResult.html @@ -0,0 +1,425 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: ValidationResult + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: ValidationResult

+ + + + + + +
+ +
+ +

+ util.ValidationResult

+ + +
+ +
+
+ + + + + +

new ValidationResult()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.Validator.html b/doc/util.Validator.html new file mode 100644 index 00000000..3e395ba6 --- /dev/null +++ b/doc/util.Validator.html @@ -0,0 +1,1044 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Class: Validator + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Class: Validator

+ + + + + + +
+ +
+ +

+ util.Validator

+ + +
+ +
+
+ + + + + +

new Validator()

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +

Members

+ + + +

isValid

+ + + + +
+

Checks if the attribute is valid

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + +

value

+ + + + +
+

Gets the value of the attribute

+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + +

Methods

+ + + + + + +

(static) compile(managedType, validationCode)

+ + + + + +
+

Compiles the given validation code for the managedType

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
managedType + + +ManagedType + + + +

The managedType of the code

validationCode + + +string + + + +

The validation code

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +

is(fn) → {util.Validator}

+ + + + + +
+

Executes the given validation function to validate the value.

+

The value will be passed as the first parameter to the validation function and
the library https://github.com/chriso/validator.js as the second one.
If the function returns true the value is valid, otherwise it's invalid.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
fn + + +function + + + +

will be used to validate the value

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Validator + + +
+
+ + + + + + + + + + +

is(error, fn) → {util.Validator}

+ + + + + +
+

Executes the given validation function to validate the value.

+

The value will be passed as the first parameter to the validation function and
the library https://github.com/chriso/validator.js as the second one.
If the function returns true the value is valid, otherwise it's invalid.

+
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
error + + +string + + + +

The error message which will be used if the value is invalid

fn + + +function + + + +

will be used to validate the value

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + + + +
+
+ Type +
+
+ +Validator + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/doc/util.html b/doc/util.html new file mode 100644 index 00000000..b093459f --- /dev/null +++ b/doc/util.html @@ -0,0 +1,532 @@ + + + + + Baqend JavaScript SDK 2.4.3 - Namespace: util + + + + + + + + + + + + + + + + +
+
+
+ +
+
+

Namespace: util

+ + + + + + +
+ +
+ +

util

+ + +
+ +
+
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + +
+ + + + + + +

Classes

+ +
+
Code
+
+ +
Lockable
+
+ +
Logger
+
+ +
Metadata
+
+ +
Modules
+
+ +
Permission
+
+ +
PushMessage
+
+ +
TokenStorage
+
+ +
ValidationResult
+
+ +
Validator
+
+
+ + + + + + + + + +

Methods

+ + + + + + +

uuid() → {string}

+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + +
Returns:
+ + +
+

A generated version 4 UUID.

+
+ + + +
+
+ Type +
+
+ +string + + +
+
+ + + + + + + + + + + +
+ +
+ + + + + +
+ Baqend JavaScript SDK 2.4.3 © 2015 Baqend GmbH
+ Documentation generated by JSDoc 3.4.3 on Mon, 28 Nov 2016 19:18:30 GMT +
+
+
+
+ + + + + + \ No newline at end of file diff --git a/package.json b/package.json index c7ab1711..68d97fc4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "baqend", - "version": "2.4.3-0", + "version": "2.4.3", "description": "Baqend JavaScript SDK", "license": "MIT", "author": {