Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@neoskop/adamant

Package Overview
Dependencies
Maintainers
12
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@neoskop/adamant - npm Package Compare versions

Comparing version 0.1.0-rc.6 to 0.1.0-rc.7

esm2015/factories.js

9

bulk.d.ts

@@ -10,2 +10,3 @@ /// <reference types="pouchdb-find" />

import { Metadata } from './metadata';
import { AdamantDeletedMeta, AdamantRevMeta } from './meta-interfaces';
export declare enum BulkOperation {

@@ -23,6 +24,6 @@ Create = "create",

constructor(db: PouchDB.Database<T>, entityClass: Ctor<T>, metadata: Metadata<T>, hydrator: Hydrator, validator: Validator);
protected bulk(entities: T[], operation: BulkOperation): Promise<T[]>;
create(entities: T[]): Promise<T[]>;
update(entities: T[]): Promise<T[]>;
delete(entities: T[]): Promise<T[]>;
protected bulk(entities: T[], operation: BulkOperation): Promise<(T & AdamantRevMeta & AdamantDeletedMeta)[]>;
create(entities: T[]): Promise<(T & AdamantRevMeta)[]>;
update(entities: T[]): Promise<(T & AdamantRevMeta)[]>;
delete(entities: T[]): Promise<(T & AdamantRevMeta & AdamantDeletedMeta)[]>;
}

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("reflect-metadata"),require("@angular/core"),require("fast-deep-equal")):"function"==typeof define&&define.amd?define("@neoskop/adamant",["exports","reflect-metadata","@angular/core","fast-deep-equal"],e):e((t.neoskop=t.neoskop||{},t.neoskop.adamant={}),null,t.ng.core,t.fastDeepEqual)}(this,function(t,e,i,n){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function M(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}function l(e,a,s,u){return new(s||(s=Promise))(function(t,n){function r(t){try{o(u.next(t))}catch(e){n(e)}}function i(t){try{o(u["throw"](t))}catch(e){n(e)}}function o(e){e.done?t(e.value):new s(function(t){t(e.value)}).then(r,i)}o((u=u.apply(e,a||[])).next())})}function D(r,i){var o,a,s,t,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return t={next:e(0),"throw":e(1),"return":e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function n(t){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(s=2&t[0]?a["return"]:t[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,a=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(s=0<(s=u.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){u.label=t[1];break}if(6===t[0]&&u.label<s[1]){u.label=s[1],s=t;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(t);break}s[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(r,u)}catch(e){t=[6,e],a=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([e,t])}}}function E(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function A(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return a}var s=new WeakMap,f=new WeakMap;function j(t,e){return s.has(t)?s.get(t).filter(function(t){return!e||t instanceof e}):[]}function u(t,e){s.has(t)||s.set(t,[]),s.get(t).push(e)}function O(t){return f.has(t)?f.get(t):new Map}function c(t,e,n){f.has(t)||f.set(t,new Map),f.get(t).has(e)||f.get(t).set(e,[]),f.get(t).get(e).push(n)}function d(t,e){var n,r;try{for(var i=E(Object.keys(e)),o=i.next();!o.done;o=i.next()){var a=o.value;t[a]=e[a]}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(n)throw n.error}}return t}var N=function(){function t(){}return t.prototype.validate=function(t,e){if(this.required&&null==t)throw new Error('Property "'+("symbol"==typeof e?Symbol.keyFor(e):e)+'" required')},t}();var q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return i.resolveForwardRef(this._type)},set:function(t){this._type=t},enumerable:!0,configurable:!0}),e}(N),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(q);var I=function nt(){};var g=function rt(){};var T=function it(){};var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(q);var R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(q);var h={Static:"static"},C=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.required=!0,t}return o(t,e),t}(N);var F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(q);var x=function ot(){};var k=function at(){};var V=function st(){};var p=function ut(){},y=function ct(){},v=new i.InjectionToken("ADAMANT_CONNECTION"),w=new i.InjectionToken("ADAMANT_ENTITY_CLASS"),m=new i.InjectionToken("ADAMANT_ENTITY_METADATA"),b=new i.InjectionToken("ADAMANT_EQUAL_CHECKER"),_=new i.InjectionToken("ADAMANT_CONNECTION_FACTORY"),B=new i.InjectionToken("ADAMANT_ID");function H(t){return Object.defineProperty(t,"_deleted",{configurable:!0,value:!0}),t}function U(t,e){return Object.defineProperty(t,"_id",{configurable:!0,value:e.id}),Object.defineProperty(t,"_rev",{configurable:!0,value:e.rev}),t}var Y=function(){function t(t){this.entity=t,this.inline=!1,this.properties=new Map,this.parse(),this.assert()}return t.prototype.parse=function(){var t,e,n,r,i,o,a=j(this.entity),s=O(this.entity);try{for(var u=E(a),c=u.next();!c.done;c=u.next()){((w=c.value)instanceof g||w instanceof x)&&Object.assign(this,w)}}catch(m){t={error:m}}finally{try{c&&!c.done&&(e=u["return"])&&e.call(u)}finally{if(t)throw t.error}}try{for(var d=E(s),l=d.next();!l.done;l=d.next()){var f=A(l.value,2),h=f[0],p=f[1];try{for(var y=E(p),v=y.next();!v.done;v=y.next()){var w;(w=v.value)instanceof C&&(this.id=h,this.idType=w.type,this.idStrategy=w.strategy),w instanceof N&&this.properties.set(h,w)}}catch(b){i={error:b}}finally{try{v&&!v.done&&(o=y["return"])&&o.call(y)}finally{if(i)throw i.error}}}}catch(_){n={error:_}}finally{try{l&&!l.done&&(r=d["return"])&&r.call(d)}finally{if(n)throw n.error}}},t.prototype.assert=function(){var t,e;try{for(var n=E(this.inline?[]:["id","idStrategy","name","attachments"]),r=n.next();!r.done;r=n.next()){var i=r.value;if(null==this[i])throw new Error("Missing metadata '"+i+"' for entity \""+this.entity.name+'"')}}catch(o){t={error:o}}finally{try{r&&!r.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}},t}(),Q={Create:"create",Update:"update",Delete:"delete"},L=function(){function t(t,e,n,r,i){this.db=t,this.entityClass=e,this.metadata=n,this.hydrator=r,this.validator=i}return t.prototype.bulk=function(o,a){return l(this,void 0,void 0,function(){var e,n,r,i=this;return D(this,function(t){switch(t.label){case 0:return 0===o.length?[2,o]:[4,Promise.all(o.map(function(n){return l(i,void 0,void 0,function(){var e;return D(this,function(t){switch(t.label){case 0:if(!(n instanceof this.entityClass))throw new Error('Entity "'+n+'" is not instanceof '+this.entityClass.name);return[4,this.validator.validate(n,this.metadata)];case 1:return t.sent(),e=this.hydrator.dehydrate(n,this.metadata,{includeRev:a===Q.Update||a===Q.Delete}),a===Q.Delete&&(e._deleted=!0),[2,e]}})})}))];case 1:return e=t.sent(),[4,this.db.bulkDocs(e)];case 2:if(n=t.sent(),0<(r=n.filter(function(t){return Object.prototype.hasOwnProperty.call(t,"error")})).length)throw r;return n.forEach(function(t,e){a===Q.Delete&&H(o[e]),U(o[e],t)}),[2,o]}})})},t.prototype.create=function(t){return this.bulk(t,Q.Create)},t.prototype.update=function(t){return this.bulk(t,Q.Update)},t.prototype["delete"]=function(t){return this.bulk(t,Q.Delete)},t.ctorParameters=function(){return[{type:undefined,decorators:[{type:i.Inject,args:[v]}]},{type:undefined,decorators:[{type:i.Inject,args:[w]}]},{type:Y,decorators:[{type:i.Inject,args:[m]}]},{type:p},{type:y}]},t}();var $=function(){function t(t){this.db=t,this.queue=[]}return t.prototype.read=function(e){var t;return(t=this.queue).push.apply(t,function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(A(arguments[e]));return t}(e)),this.schedule().then(function(t){return e.map(function(e){return t.find(function(t){return t._id===e})}).filter(Boolean).map(function(t){return JSON.parse(JSON.stringify(t))})})},t.prototype.schedule=function(){var t=this;return this.deffered||(setImmediate(function(){t.execute()}),this.deffered=function e(){var n,r,t=new Promise(function(t,e){n=t,r=e});return Object.assign(t,{resolve:n,reject:r})}(),this.deffered.then(function(){delete t.deffered},function(){delete t.deffered})),this.deffered},t.prototype.execute=function(){return l(this,void 0,void 0,function(){var e,n,r;return D(this,function(t){switch(t.label){case 0:e=this.queue.filter(function(t,e,n){return e===n.indexOf(t)}),this.queue=[],t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.db.allDocs({include_docs:!0,keys:e})];case 2:return n=t.sent().rows,this.deffered.resolve(n.map(function(t){return t.doc}).filter(Boolean)),[3,4];case 3:return r=t.sent(),this.deffered.reject(r),[3,4];case 4:return[2]}})})},t}(),J=function(){function t(t,e,n){this.repository=t,this._selector={},this._sort=[],this._selector._id={$gt:e,$lt:n}}return t.prototype.selector=function(t,e){if("string"==typeof t)"object"!=typeof e&&(e={$eq:e}),t in this._selector?Object.assign(this._selector[t],e):this._selector[t]=e;else for(var n in t)this.selector(n,t[n]);return this},t.prototype.sort=function(t,e){var n;return"string"==typeof t&&e?this._sort.push(((n={})[t]=e,n)):this._sort.push(t),this},t.prototype.limit=function(t){return this._limit=t,this},t.prototype.skip=function(t){return this._skip=t,this},t.prototype.resolve=function(t){return this.repository.executeQuery(this,t)},t.prototype.toFindRequest=function(){var t={selector:this._selector};return 0<this._sort.length&&(t.sort=this._sort),null!=this._limit&&(t.limit=this._limit),null!=this._skip&&(t.skip=this._skip),t},t}();function K(){return n}var W=function(){function t(t,e,n,r,i,o,a,s){this.db=t,this.entityClass=e,this.metadata=n,this.equal=r,this.id=i,this.bulk=o,this.hydrator=a,this.validator=s,this.queryBatcher=new $(this.db)}return t.prototype.create=function(r){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(r,this.metadata)];case 1:return t.sent(),e=this.hydrator.dehydrate(r,this.metadata),[4,this.db.put(e)];case 2:return n=t.sent(),U(r,n),[2,r]}})})},t.prototype.upsert=function(r){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(r,this.metadata)];case 1:return t.sent(),e=this.hydrator.dehydrate(r,this.metadata),[4,this._upsert(this.id.build(this.metadata.name,this.metadata.idType,r[this.metadata.id]),e)];case 2:return n=t.sent(),U(r,n),[2,r]}})})},t.prototype._upsert=function(t,o){var a=this;return this.db.upsert(t,function(t){var e=o,n=(e._id,e._rev,M(e,["_id","_rev"])),r=t,i=(r._id,r._rev,M(r,["_id","_rev"]));return!a.equal(n,i)&&o})},t.prototype.update=function(r){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(r,this.metadata)];case 1:return t.sent(),e=this.hydrator.dehydrate(r,this.metadata,{includeRev:!0}),[4,this.db.put(e)];case 2:return n=t.sent(),U(r,n),[2,r]}})})},t.prototype["delete"]=function(r){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(r,this.metadata)];case 1:return t.sent(),(e=this.hydrator.dehydrate(r,this.metadata,{includeRev:!0}))._deleted=!0,[4,this.db.put(e)];case 2:return n=t.sent(),U(r,n),H(r),[2,r]}})})},t.prototype.read=function(t,e){return this._read(this.id.build(this.metadata.name,this.metadata.idType,t),e)},t.prototype._read=function(i,o){return l(this,void 0,void 0,function(){var e,n,r;return D(this,function(t){switch(t.label){case 0:return n=(e=this.hydrator).hydrate,r=[Object.create(this.entityClass.prototype)],[4,this._readRaw(i)];case 1:return[2,n.apply(e,r.concat([t.sent(),this.metadata,o]))]}})})},t.prototype._readRaw=function(n){return l(this,void 0,void 0,function(){var e;return D(this,function(t){switch(t.label){case 0:return[4,this.queryBatcher.read([n])];case 1:if(!(e=t.sent())[0])throw{status:404,name:"not_found",message:"missing",reason:"missing",id:n};return[2,e[0]]}})})},t.prototype.readAll=function(r,i){return l(this,void 0,void 0,function(){var e,n=this;return D(this,function(t){return e={include_docs:!0},r?e.keys=r.map(function(t){return n.id.build(n.metadata.name,n.metadata.idType,t)}).sort(function(t,e){return t.localeCompare(e)}):(e.startkey=this.id.head(this.metadata.name),e.endkey=this.id.tail(this.metadata.name)),[2,this._readAll(e,i)]})})},t.prototype._readAll=function(i,o){return l(this,void 0,void 0,function(){var e,n,r=this;return D(this,function(t){switch(t.label){case 0:return n=(e=Promise).all,[4,this._readAllRaw(i)];case 1:return[4,n.apply(e,[t.sent().map(function(e){return l(r,void 0,void 0,function(){return D(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,this.metadata,o)]})})})])];case 2:return[2,t.sent()]}})})},t.prototype._readAllRaw=function(e){return l(this,void 0,void 0,function(){return D(this,function(t){switch(t.label){case 0:return e.include_docs&&"keys"in e?[4,this.queryBatcher.read(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[4,this.db.allDocs(e)];case 3:return[2,t.sent().rows.map(function(t){return t.doc}).filter(Boolean)]}})})},t.prototype.query=function(){return new J(this,this.id.head(this.metadata.name),this.id.tail(this.metadata.name))},t.prototype.executeQuery=function(i,o){return l(this,void 0,void 0,function(){var e,n,r=this;return D(this,function(t){switch(t.label){case 0:return n=(e=Promise).all,[4,this.db.find(i.toFindRequest())];case 1:return[4,n.apply(e,[t.sent().docs.map(function(e){return l(r,void 0,void 0,function(){return D(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,this.metadata,o)]})})})])];case 2:return[2,t.sent()]}})})},t.prototype.build=function(t){return void 0===t&&(t={}),d(Object.create(this.entityClass.prototype),t)},t.prototype.persistDesignDoc=function(g){return l(this,void 0,void 0,function(){var r,i,o,a,s,u,c,d,l,f,h,p,y,v,w,m,b,_=this;return D(this,function(t){switch(t.label){case 0:if(s=j(g.constructor,I),u=O(g.constructor),1!==s.length)throw new Error("Design doc annotation required");if(s[0].entity!==this.entityClass)throw new Error("Invalid design doc entity");c={_id:"_design/"+s[0].name,views:{},filters:{}};try{for(d=E(u),l=d.next();!l.done;l=d.next()){f=A(l.value,2),h=f[0],p=f[1];try{for(y=E(p),v=y.next();!v.done;v=y.next())(w=v.value)instanceof V?(m=g[h],"string"===(b=typeof m)||"function"===b?c.views[h]={map:m.toString()}:"object"===b&&(c.views[h]={map:m.map.toString(),reduce:m.reduce&&m.reduce.toString()})):w instanceof T?c.filters[h]=g[h].toString():w instanceof k&&(c.validate_doc_update=g[h].toString())}catch(e){o={error:e}}finally{try{v&&!v.done&&(a=y["return"])&&a.call(y)}finally{if(o)throw o.error}}}}catch(n){r={error:n}}finally{try{l&&!l.done&&(i=d["return"])&&i.call(d)}finally{if(r)throw r.error}}return[4,this.db.upsert(c._id,function(t){var e=c,n=(e._id,e._rev,M(e,["_id","_rev"])),r=t,i=(r._id,r._rev,M(r,["_id","_rev"]));return!_.equal(n,i)&&c})];case 1:return t.sent(),[2]}})})},t.prototype.view=function(a,s,t){void 0===t&&(t={});var u=t.depth,c=t.circularCache,d=M(t,["depth","circularCache"]);return l(this,void 0,void 0,function(){var e,n,i,o=this;return D(this,function(t){switch(t.label){case 0:if(!(e=j(a,I)[0]))throw new Error("Design doc annotation required");if(e.entity!==this.entityClass)throw new Error("Invalid design doc entity");if(!function r(t,e,n){return f.has(t)&&f.get(t).has(e)?f.get(t).get(e).filter(function(t){return!n||t instanceof n}):[]}(a,s,V))throw new Error('Unknown view "'+s+'"');return d||(d={}),d.include_docs=!0,i=(n=Promise).all,[4,this.rawView(e.name+"/"+s,d)];case 1:return[4,i.apply(n,[t.sent().rows.map(function(t){return t.doc}).map(function(e){return l(o,void 0,void 0,function(){return D(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,this.metadata,{depth:u,circularCache:c})]})})})])];case 2:return[2,t.sent()]}})})},t.prototype.rawView=function(t,e){return this.db.query(t,e)},t.decorators=[{type:i.Injectable}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:i.Inject,args:[v]}]},{type:undefined,decorators:[{type:i.Inject,args:[w]}]},{type:Y,decorators:[{type:i.Inject,args:[m]}]},{type:undefined,decorators:[{type:i.Inject,args:[b]}]},{type:undefined,decorators:[{type:i.Inject,args:[B]}]},{type:L},{type:p},{type:y}]},t}(),G=function(r){function t(t,e){var n=r.call(this)||this;return n.id=t,n.connectionManager=e,n}return o(t,r),t.prototype.dehydrate=function(a,s,t){var e,n,u=this,c={};t&&t.includeRev&&(c._rev=a._rev),s.attachments&&a._attachments&&(c._attachments=a._attachments);var r=function(t,e){var n=a[t];if(e instanceof q){if(null!=n){var r=d.connectionManager.getMetadata(e.type);if(e instanceof P)c[t]=X(n,r,d.id);else if(e instanceof S)c[t]=n.map(function(t){return X(t,r,u.id)});else if(e instanceof R){var i={};for(var o in n)i[o]=X(n[o],r,d.id);c[t]=i}else e instanceof F&&(c[t]=d.connectionManager.getRepository(e.type).hydrator.dehydrate(n,r))}}else e instanceof N&&(c[t]=n,e instanceof C&&(c._id=d.id.build(s.name,s.idType,n)));undefined===c[t]&&delete c[t]},d=this;try{for(var i=E(s.properties),o=i.next();!o.done;o=i.next()){var l=A(o.value,2);r(l[0],l[1])}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(e)throw e.error}}return c},t.prototype.hydrate=function(T,C,d,t){var e=void 0===t?{}:t,n=e.depth,x=void 0===n?Infinity:n,r=e.circularCache,k=void 0===r?{}:r;return l(this,void 0,void 0,function(){var e,n,r,I,i,o,a,s,u,c;return D(this,function(t){switch(t.label){case 0:if(C._id in k)return[2,k[C._id]];U(k[C._id]=T,{id:C._id,rev:C._rev}),d.attachments&&Object.defineProperty(T,"_attachments",{configurable:!0,value:C._attachments}),r=function(r,i){var o,a,s,u,c,d,l,f,h,p,y,v,w,m,b,_,g,M,A,j,O;return D(this,function(t){switch(t.label){case 0:return null!=(s=C[r])?[3,1]:(T[r]=null,[3,13]);case 1:return i instanceof q?(u=I.connectionManager.getMetadata(i.type),c=I.connectionManager.getRepository(i.type),i instanceof P?(d=T,l=r,k.hasOwnProperty(s)?(f=k[s],[3,4]):[3,2]):[3,5]):[3,12];case 2:return[4,c._read(s,{depth:x-1,circularCache:k})];case 3:f=t.sent(),t.label=4;case 4:return d[l]=f,[3,11];case 5:return i instanceof S?(h=T,p=r,[4,z(c,s,x-1,k)]):[3,7];case 6:return h[p]=t.sent(),[3,11];case 7:return i instanceof R?(y=Object.keys(s),v=y.map(function(t){return s[t]}),[4,z(c,v,x-1,k)]):[3,9];case 8:w=t.sent(),m={},b=function(e){m[e]=w.find(function(t){return t._id===s[e]})};try{for(_=E(y),g=_.next();!g.done;g=_.next())M=g.value,b(M)}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=_["return"])&&a.call(_)}finally{if(o)throw o.error}}return T[r]=m,[3,11];case 9:return i instanceof F?(A=T,j=r,[4,c.hydrator.hydrate(c.build(),s,u)]):[3,11];case 10:A[j]=t.sent(),t.label=11;case 11:return[3,13];case 12:i instanceof N&&(!(O=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(T),r))||O.writable||O.set)&&(T[r]=function n(t,e){if(e===Date&&t)return new Date(t);return t}(s,i.type)),t.label=13;case 13:return[2]}})},I=this,t.label=1;case 1:t.trys.push([1,6,7,8]),i=E(d.properties),o=i.next(),t.label=2;case 2:return o.done?[3,5]:(a=A(o.value,2),s=a[0],u=a[1],[5,r(s,u)]);case 3:t.sent(),t.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return c=t.sent(),e={error:c},[3,8];case 7:try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(e)throw e.error}return[7];case 8:return[2,T]}})})},t.decorators=[{type:i.Injectable}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:i.Inject,args:[B]}]},{type:et}]},t}(p);function z(r,i,o,a){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return(e=i.filter(function(t){return!a.hasOwnProperty(t)})).length?[4,r._readAll({keys:e,include_docs:!0},{depth:o,circularCache:a})]:[3,2];case 1:n=t.sent(),t.label=2;case 2:return[2,i.map(function(e){return a.hasOwnProperty(e)?a[e]:n&&n.find(function(t){return t._id===e})})]}})})}function X(t,e,n){return"string"==typeof t?t:n.build(e.name,e.idType,t[e.id])}var Z=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.validate=function(u,c){return l(this,void 0,void 0,function(){var e,n,r,i,o,a,s;return D(this,function(t){switch(t.label){case 0:t.trys.push([0,5,6,7]),r=E(c.properties),i=r.next(),t.label=1;case 1:return i.done?[3,4]:(o=A(i.value,2),a=o[0],[4,o[1].validate(u[a],a)]);case 2:t.sent(),t.label=3;case 3:return i=r.next(),[3,1];case 4:return[3,7];case 5:return s=t.sent(),e={error:s},[3,7];case 6:try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(e)throw e.error}return[7];case 7:return[2,!0]}})})},e}(y);function tt(){return{head:function(t){return t+"_0"},tail:function(t){return t+"_9"},build:function(t,e,n){if(e===String)return t+"_2_"+n;if(e!==Number)throw new Error('Invalid id type "'+e+'"');var r=n.toString();return t+"_1_"+"0".repeat(16-r.length)+r},parse:function(t){var e=/^(.*)_(1|2)_(.*)$/.exec(t);if(!e)throw new TypeError('Invalid id "'+t+'"');return{name:e[1],type:"2"===e[2]?String:Number,id:"2"===e[2]?e[3]:Number.parseInt(e[3],10)}}}}var et=function(){function n(t,e,n){this.connectionFactory=t,this.id=e,this.injector=n,this.connections=new Map,this.repositories=new Map,this.metadata=new Map}return n.prototype.getOpenConnections=function(){return Array.from(this.connections.values())},n.prototype.getConnection=function(t){return this.connections.has(t)||this.connections.set(t,this.createConnection(t)),this.connections.get(t)},n.prototype.clearConnections=function(){this.connections.clear()},n.prototype.createConnection=function(t){return this.connectionFactory(t)},n.prototype.getRepository=function(t){return this.repositories.has(t)||this.repositories.set(t,this.createRepository(t)),this.repositories.get(t)},n.prototype.createRepository=function(t){var e=this.getMetadata(t);return i.Injector.create({parent:this.injector,providers:[{provide:n,useValue:this},{provide:W,deps:[v,w,m,b,B,L,p,y]},{provide:w,useValue:t},{provide:m,useValue:e},{provide:v,useValue:e.inline?null:this.getConnection(e.name)},{provide:G,deps:[B,n]},{provide:Z,deps:[]},{provide:p,useExisting:e.hydrator||G},{provide:y,useExisting:e.validator||Z},{provide:L,deps:[v,w,m,p,y]}]}).get(W)},n.prototype.getMetadata=function(t){return this.metadata.has(t)||this.metadata.set(t,this.createMetadata(t)),this.metadata.get(t)},n.prototype.createMetadata=function(t){return new Y(t)},n.decorators=[{type:i.Injectable}],n.ctorParameters=function(){return[{type:undefined,decorators:[{type:i.Inject,args:[_]}]},{type:undefined,decorators:[{type:i.Inject,args:[B]}]},{type:i.Injector}]},n}();t.BelongsTo=function dt(n){return void 0===n&&(n={}),function(t,e){c(t.constructor,e,d(new P,a({type:Reflect.getMetadata("design:type",t,e),required:!1},n)))}},t.BelongsToMetadata=P,t.DesignDoc=function lt(e,n){return function(t){u(t,d(new I,{entity:e,name:n}))}},t.DesignDocMetadata=I,t.Entity=function ft(e,n){return void 0===n&&(n={}),function(t){u(t,d(new g,a({name:e,attachments:!1},n)))}},t.EntityMetadata=g,t.Filter=function ht(){return function(t,e){c(t.constructor,e,d(new T,{}))}},t.FilterMetadata=T,t.HasMany=function pt(n,r){return void 0===r&&(r={}),function(t,e){c(t.constructor,e,d(new S,a({type:n,required:!1},r)))}},t.HasManyMetadata=S,t.HasManyMap=function yt(n,r){return void 0===r&&(r={}),function(t,e){c(t.constructor,e,d(new R,a({type:n,required:!1},r)))}},t.HasManyMapMetadata=R,t.Id=function vt(n){return void 0===n&&(n={}),function(t,e){c(t.constructor,e,d(new C,a({strategy:h.Static,type:Reflect.getMetadata("design:type",t,e)},n)))}},t.IdStrategy=h,t.IdMetadata=C,t.Inline=function wt(n){return void 0===n&&(n={}),function(t,e){c(t.constructor,e,d(new F,a({type:Reflect.getMetadata("design:type",t,e),required:!1},n)))}},t.InlineMetadata=F,t.InlineEntity=function mt(e){return void 0===e&&(e={}),function(t){u(t,d(new x,a({},e,{inline:!0})))}},t.InlineEntityMetadata=x,t.Property=function bt(n){return void 0===n&&(n={}),function(t,e){c(t.constructor,e,d(new N,a({type:Reflect.getMetadata("design:type",t,e),required:!1},n)))}},t.PropertyMetadata=N,t.RelationMetadata=q,t.ValidateDoc=function _t(){return function(t,e){c(t.constructor,e,d(new k,{}))}},t.ValidateDocMetadata=k,t.View=function gt(){return function(t,e){c(t.constructor,e,d(new V,{}))}},t.ViewMetadata=V,t.BulkOperation=Q,t.Bulk=L,t.adamantIdFactory=tt,t.createAdamantConnection=function Mt(t){return i.Injector.create({providers:[{provide:_,useValue:t},{provide:et,deps:[_,B,i.Injector]},{provide:B,useFactory:tt,deps:[]},{provide:b,useFactory:K,deps:[]}]}).get(et)},t.AdamantConnectionManager=et,t.Hydrator=p,t.HydratorImpl=G,t.ADAMANT_CONNECTION=v,t.ADAMANT_ENTITY_CLASS=w,t.ADAMANT_ENTITY_METADATA=m,t.ADAMANT_EQUAL_CHECKER=b,t.ADAMANT_CONNECTION_FACTORY=_,t.ADAMANT_ID=B,t.Metadata=Y,t.QueryBuilder=J,t.equalCheckerFactory=K,t.AdamantRepository=W,t.Validator=y,t.ValidatorImpl=Z,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("reflect-metadata"),require("@angular/core"),require("fast-deep-equal")):"function"==typeof define&&define.amd?define("@neoskop/adamant",["exports","reflect-metadata","@angular/core","fast-deep-equal"],e):e((t.neoskop=t.neoskop||{},t.neoskop.adamant={}),null,t.ng.core,t.fastDeepEqual)}(this,function(t,e,i,n){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var a=function(){return(a=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function M(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}function l(e,a,s,u){return new(s||(s=Promise))(function(t,n){function r(t){try{o(u.next(t))}catch(e){n(e)}}function i(t){try{o(u["throw"](t))}catch(e){n(e)}}function o(e){e.done?t(e.value):new s(function(t){t(e.value)}).then(r,i)}o((u=u.apply(e,a||[])).next())})}function D(r,i){var o,a,s,t,u={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return t={next:e(0),"throw":e(1),"return":e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function n(t){if(o)throw new TypeError("Generator is already executing.");for(;u;)try{if(o=1,a&&(s=2&t[0]?a["return"]:t[0]?a["throw"]||((s=a["return"])&&s.call(a),0):a.next)&&!(s=s.call(a,t[1])).done)return s;switch(a=0,s&&(t=[2&t[0],s.value]),t[0]){case 0:case 1:s=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,a=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(s=0<(s=u.trys).length&&s[s.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!s||t[1]>s[0]&&t[1]<s[3])){u.label=t[1];break}if(6===t[0]&&u.label<s[1]){u.label=s[1],s=t;break}if(s&&u.label<s[2]){u.label=s[2],u.ops.push(t);break}s[2]&&u.ops.pop(),u.trys.pop();continue}t=i.call(r,u)}catch(e){t=[6,e],a=0}finally{o=s=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([e,t])}}}function E(t){var e="function"==typeof Symbol&&t[Symbol.iterator],n=0;return e?e.call(t):{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}}}function A(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),a=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o["return"])&&n.call(o)}finally{if(i)throw i.error}}return a}var s=new WeakMap,f=new WeakMap;function j(t,e){return s.has(t)?s.get(t).filter(function(t){return!e||t instanceof e}):[]}function u(t,e){s.has(t)||s.set(t,[]),s.get(t).push(e)}function O(t){return f.has(t)?f.get(t):new Map}function c(t,e,n){f.has(t)||f.set(t,new Map),f.get(t).has(e)||f.get(t).set(e,[]),f.get(t).get(e).push(n)}function d(t,e){var n,r;try{for(var i=E(Object.keys(e)),o=i.next();!o.done;o=i.next()){var a=o.value;t[a]=e[a]}}catch(s){n={error:s}}finally{try{o&&!o.done&&(r=i["return"])&&r.call(i)}finally{if(n)throw n.error}}return t}var N=function(){function t(){}return t.prototype.validate=function(t,e){if(this.required&&null==t)throw new Error('Property "'+("symbol"==typeof e?Symbol.keyFor(e):e)+'" required')},t}();var q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),Object.defineProperty(e.prototype,"type",{get:function(){return i.resolveForwardRef(this._type)},set:function(t){this._type=t},enumerable:!0,configurable:!0}),e}(N),P=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(q);var I=function nt(){};var g=function rt(){};var T=function it(){};var S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(q);var R=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(q);var h={Static:"static"},C=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.required=!0,t}return o(t,e),t}(N);var F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(q);var x=function ot(){};var k=function at(){};var V=function st(){};var p=function ut(){},y=function ct(){},v=new i.InjectionToken("ADAMANT_CONNECTION"),w=new i.InjectionToken("ADAMANT_ENTITY_CLASS"),m=new i.InjectionToken("ADAMANT_ENTITY_METADATA"),b=new i.InjectionToken("ADAMANT_EQUAL_CHECKER"),_=new i.InjectionToken("ADAMANT_CONNECTION_FACTORY"),B=new i.InjectionToken("ADAMANT_ID");function H(t){return Object.defineProperty(t,"_deleted",{configurable:!0,value:!0}),t}function U(t,e){return Object.defineProperty(t,"_id",{configurable:!0,value:e.id}),Object.defineProperty(t,"_rev",{configurable:!0,value:e.rev}),t}var Y=function(){function t(t){this.entity=t,this.inline=!1,this.properties=new Map,this.parse(),this.assert()}return t.prototype.parse=function(){var t,e,n,r,i,o,a=j(this.entity),s=O(this.entity);try{for(var u=E(a),c=u.next();!c.done;c=u.next()){((w=c.value)instanceof g||w instanceof x)&&Object.assign(this,w)}}catch(m){t={error:m}}finally{try{c&&!c.done&&(e=u["return"])&&e.call(u)}finally{if(t)throw t.error}}try{for(var d=E(s),l=d.next();!l.done;l=d.next()){var f=A(l.value,2),h=f[0],p=f[1];try{for(var y=E(p),v=y.next();!v.done;v=y.next()){var w;(w=v.value)instanceof C&&(this.id=h,this.idType=w.type,this.idStrategy=w.strategy),w instanceof N&&this.properties.set(h,w)}}catch(b){i={error:b}}finally{try{v&&!v.done&&(o=y["return"])&&o.call(y)}finally{if(i)throw i.error}}}}catch(_){n={error:_}}finally{try{l&&!l.done&&(r=d["return"])&&r.call(d)}finally{if(n)throw n.error}}},t.prototype.assert=function(){var t,e;try{for(var n=E(this.inline?[]:["id","idStrategy","name","attachments"]),r=n.next();!r.done;r=n.next()){var i=r.value;if(null==this[i])throw new Error("Missing metadata '"+i+"' for entity \""+this.entity.name+'"')}}catch(o){t={error:o}}finally{try{r&&!r.done&&(e=n["return"])&&e.call(n)}finally{if(t)throw t.error}}},t}(),Q={Create:"create",Update:"update",Delete:"delete"},L=function(){function t(t,e,n,r,i){this.db=t,this.entityClass=e,this.metadata=n,this.hydrator=r,this.validator=i}return t.prototype.bulk=function(o,a){return l(this,void 0,void 0,function(){var e,n,r,i=this;return D(this,function(t){switch(t.label){case 0:return 0===o.length?[2,o]:[4,Promise.all(o.map(function(n){return l(i,void 0,void 0,function(){var e;return D(this,function(t){switch(t.label){case 0:if(!(n instanceof this.entityClass))throw new Error('Entity "'+n+'" is not instanceof '+this.entityClass.name);return[4,this.validator.validate(n,this.metadata)];case 1:return t.sent(),e=this.hydrator.dehydrate(n,this.metadata,{includeRev:a===Q.Update||a===Q.Delete}),a===Q.Delete&&(e._deleted=!0),[2,e]}})})}))];case 1:return e=t.sent(),[4,this.db.bulkDocs(e)];case 2:if(n=t.sent(),0<(r=n.filter(function(t){return Object.prototype.hasOwnProperty.call(t,"error")})).length)throw r;return n.forEach(function(t,e){a===Q.Delete&&H(o[e]),U(o[e],t)}),[2,o]}})})},t.prototype.create=function(t){return this.bulk(t,Q.Create)},t.prototype.update=function(t){return this.bulk(t,Q.Update)},t.prototype["delete"]=function(t){return this.bulk(t,Q.Delete)},t.ctorParameters=function(){return[{type:undefined,decorators:[{type:i.Inject,args:[v]}]},{type:undefined,decorators:[{type:i.Inject,args:[w]}]},{type:Y,decorators:[{type:i.Inject,args:[m]}]},{type:p},{type:y}]},t}();var $=function(){function t(t){this.db=t,this.queue=[]}return t.prototype.read=function(e){var t;return(t=this.queue).push.apply(t,function n(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(A(arguments[e]));return t}(e)),this.schedule().then(function(t){return e.map(function(e){return t.find(function(t){return t._id===e})}).filter(Boolean).map(function(t){return JSON.parse(JSON.stringify(t))})})},t.prototype.schedule=function(){var t=this;return this.deffered||(setImmediate(function(){t.execute()}),this.deffered=function e(){var n,r,t=new Promise(function(t,e){n=t,r=e});return Object.assign(t,{resolve:n,reject:r})}(),this.deffered.then(function(){delete t.deffered},function(){delete t.deffered})),this.deffered},t.prototype.execute=function(){return l(this,void 0,void 0,function(){var e,n,r;return D(this,function(t){switch(t.label){case 0:e=this.queue.filter(function(t,e,n){return e===n.indexOf(t)}),this.queue=[],t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.db.allDocs({include_docs:!0,keys:e})];case 2:return n=t.sent().rows,this.deffered.resolve(n.map(function(t){return t.doc}).filter(Boolean)),[3,4];case 3:return r=t.sent(),this.deffered.reject(r),[3,4];case 4:return[2]}})})},t}(),J=function(){function t(t,e,n){this.repository=t,this._selector={},this._sort=[],this._selector._id={$gt:e,$lt:n}}return t.prototype.selector=function(t,e){if("string"==typeof t)"object"!=typeof e&&(e={$eq:e}),t in this._selector?Object.assign(this._selector[t],e):this._selector[t]=e;else for(var n in t)this.selector(n,t[n]);return this},t.prototype.sort=function(t,e){var n;return"string"==typeof t&&e?this._sort.push(((n={})[t]=e,n)):this._sort.push(t),this},t.prototype.limit=function(t){return this._limit=t,this},t.prototype.skip=function(t){return this._skip=t,this},t.prototype.resolve=function(t){return this.repository.executeQuery(this,t)},t.prototype.toFindRequest=function(){var t={selector:this._selector};return 0<this._sort.length&&(t.sort=this._sort),null!=this._limit&&(t.limit=this._limit),null!=this._skip&&(t.skip=this._skip),t},t}(),K=function(){function t(t,e,n,r,i,o,a,s){this.db=t,this.entityClass=e,this.metadata=n,this.equal=r,this.id=i,this.bulk=o,this.hydrator=a,this.validator=s,this.queryBatcher=new $(this.db)}return t.prototype.create=function(r){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(r,this.metadata)];case 1:return t.sent(),e=this.hydrator.dehydrate(r,this.metadata),[4,this.db.put(e)];case 2:return n=t.sent(),U(r,n),[2,r]}})})},t.prototype.upsert=function(r){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(r,this.metadata)];case 1:return t.sent(),e=this.hydrator.dehydrate(r,this.metadata),[4,this._upsert(this.id.build(this.metadata.name,this.metadata.idType,r[this.metadata.id]),e)];case 2:return n=t.sent(),U(r,n),[2,r]}})})},t.prototype._upsert=function(t,o){var a=this;return this.db.upsert(t,function(t){var e=o,n=(e._id,e._rev,M(e,["_id","_rev"])),r=t,i=(r._id,r._rev,M(r,["_id","_rev"]));return!a.equal(n,i)&&o})},t.prototype.update=function(r){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(r,this.metadata)];case 1:return t.sent(),e=this.hydrator.dehydrate(r,this.metadata,{includeRev:!0}),[4,this.db.put(e)];case 2:return n=t.sent(),U(r,n),[2,r]}})})},t.prototype["delete"]=function(r){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return[4,this.validator.validate(r,this.metadata)];case 1:return t.sent(),(e=this.hydrator.dehydrate(r,this.metadata,{includeRev:!0}))._deleted=!0,[4,this.db.put(e)];case 2:return n=t.sent(),U(r,n),H(r),[2,r]}})})},t.prototype.read=function(t,e){return this._read(this.id.build(this.metadata.name,this.metadata.idType,t),e)},t.prototype._read=function(i,o){return l(this,void 0,void 0,function(){var e,n,r;return D(this,function(t){switch(t.label){case 0:return n=(e=this.hydrator).hydrate,r=[Object.create(this.entityClass.prototype)],[4,this._readRaw(i)];case 1:return[2,n.apply(e,r.concat([t.sent(),this.metadata,o]))]}})})},t.prototype._readRaw=function(n){return l(this,void 0,void 0,function(){var e;return D(this,function(t){switch(t.label){case 0:return[4,this.queryBatcher.read([n])];case 1:if(!(e=t.sent())[0])throw{status:404,name:"not_found",message:"missing",reason:"missing",id:n};return[2,e[0]]}})})},t.prototype.readAll=function(r,i){return l(this,void 0,void 0,function(){var e,n=this;return D(this,function(t){return e={include_docs:!0},r?e.keys=r.map(function(t){return n.id.build(n.metadata.name,n.metadata.idType,t)}).sort(function(t,e){return t.localeCompare(e)}):(e.startkey=this.id.head(this.metadata.name),e.endkey=this.id.tail(this.metadata.name)),[2,this._readAll(e,i)]})})},t.prototype._readAll=function(i,o){return l(this,void 0,void 0,function(){var e,n,r=this;return D(this,function(t){switch(t.label){case 0:return n=(e=Promise).all,[4,this._readAllRaw(i)];case 1:return[4,n.apply(e,[t.sent().map(function(e){return l(r,void 0,void 0,function(){return D(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,this.metadata,o)]})})})])];case 2:return[2,t.sent()]}})})},t.prototype._readAllRaw=function(e){return l(this,void 0,void 0,function(){return D(this,function(t){switch(t.label){case 0:return e.include_docs&&"keys"in e?[4,this.queryBatcher.read(e.keys)]:[3,2];case 1:return[2,t.sent()];case 2:return[4,this.db.allDocs(e)];case 3:return[2,t.sent().rows.map(function(t){return t.doc}).filter(Boolean)]}})})},t.prototype.query=function(){return new J(this,this.id.head(this.metadata.name),this.id.tail(this.metadata.name))},t.prototype.executeQuery=function(i,o){return l(this,void 0,void 0,function(){var e,n,r=this;return D(this,function(t){switch(t.label){case 0:return n=(e=Promise).all,[4,this.db.find(i.toFindRequest())];case 1:return[4,n.apply(e,[t.sent().docs.map(function(e){return l(r,void 0,void 0,function(){return D(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,this.metadata,o)]})})})])];case 2:return[2,t.sent()]}})})},t.prototype.build=function(t){return void 0===t&&(t={}),d(Object.create(this.entityClass.prototype),t)},t.prototype.persistDesignDoc=function(g){return l(this,void 0,void 0,function(){var r,i,o,a,s,u,c,d,l,f,h,p,y,v,w,m,b,_=this;return D(this,function(t){switch(t.label){case 0:if(s=j(g.constructor,I),u=O(g.constructor),1!==s.length)throw new Error("Design doc annotation required");if(s[0].entity!==this.entityClass)throw new Error("Invalid design doc entity");c={_id:"_design/"+s[0].name,views:{},filters:{}};try{for(d=E(u),l=d.next();!l.done;l=d.next()){f=A(l.value,2),h=f[0],p=f[1];try{for(y=E(p),v=y.next();!v.done;v=y.next())(w=v.value)instanceof V?(m=g[h],"string"===(b=typeof m)||"function"===b?c.views[h]={map:m.toString()}:"object"===b&&(c.views[h]={map:m.map.toString(),reduce:m.reduce&&m.reduce.toString()})):w instanceof T?c.filters[h]=g[h].toString():w instanceof k&&(c.validate_doc_update=g[h].toString())}catch(e){o={error:e}}finally{try{v&&!v.done&&(a=y["return"])&&a.call(y)}finally{if(o)throw o.error}}}}catch(n){r={error:n}}finally{try{l&&!l.done&&(i=d["return"])&&i.call(d)}finally{if(r)throw r.error}}return[4,this.db.upsert(c._id,function(t){var e=c,n=(e._id,e._rev,M(e,["_id","_rev"])),r=t,i=(r._id,r._rev,M(r,["_id","_rev"]));return!_.equal(n,i)&&c})];case 1:return t.sent(),[2]}})})},t.prototype.view=function(a,s,t){void 0===t&&(t={});var u=t.depth,c=t.circularCache,d=M(t,["depth","circularCache"]);return l(this,void 0,void 0,function(){var e,n,i,o=this;return D(this,function(t){switch(t.label){case 0:if(!(e=j(a,I)[0]))throw new Error("Design doc annotation required");if(e.entity!==this.entityClass)throw new Error("Invalid design doc entity");if(0===function r(t,e,n){return f.has(t)&&f.get(t).has(e)?f.get(t).get(e).filter(function(t){return!n||t instanceof n}):[]}(a,s,V).length)throw new Error('Unknown view "'+s+'"');return d.include_docs=!0,i=(n=Promise).all,[4,this.rawView(e.name+"/"+s,d)];case 1:return[4,i.apply(n,[t.sent().rows.map(function(t){return t.doc}).map(function(e){return l(o,void 0,void 0,function(){return D(this,function(t){return[2,this.hydrator.hydrate(Object.create(this.entityClass.prototype),e,this.metadata,{depth:u,circularCache:c})]})})})])];case 2:return[2,t.sent()]}})})},t.prototype.rawView=function(t,e){return this.db.query(t,e)},t.decorators=[{type:i.Injectable}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:i.Inject,args:[v]}]},{type:undefined,decorators:[{type:i.Inject,args:[w]}]},{type:Y,decorators:[{type:i.Inject,args:[m]}]},{type:undefined,decorators:[{type:i.Inject,args:[b]}]},{type:undefined,decorators:[{type:i.Inject,args:[B]}]},{type:L},{type:p},{type:y}]},t}(),W=function(r){function t(t,e){var n=r.call(this)||this;return n.id=t,n.connectionManager=e,n}return o(t,r),t.prototype.dehydrate=function(a,s,t){var e,n,u=this,c={};t&&t.includeRev&&(c._rev=a._rev),s.attachments&&a._attachments&&(c._attachments=a._attachments);var r=function(t,e){var n=a[t];if(e instanceof q){if(null!=n){var r=d.connectionManager.getMetadata(e.type);if(e instanceof P)c[t]=z(n,r,d.id);else if(e instanceof S)c[t]=n.map(function(t){return z(t,r,u.id)});else if(e instanceof R){var i={};for(var o in n)i[o]=z(n[o],r,d.id);c[t]=i}else e instanceof F&&(c[t]=d.connectionManager.getRepository(e.type).hydrator.dehydrate(n,r))}}else e instanceof N&&(c[t]=n,e instanceof C&&(c._id=d.id.build(s.name,s.idType,n)));undefined===c[t]&&delete c[t]},d=this;try{for(var i=E(s.properties),o=i.next();!o.done;o=i.next()){var l=A(o.value,2);r(l[0],l[1])}}catch(f){e={error:f}}finally{try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(e)throw e.error}}return c},t.prototype.hydrate=function(T,C,d,t){var e=void 0===t?{}:t,n=e.depth,x=void 0===n?Infinity:n,r=e.circularCache,k=void 0===r?{}:r;return l(this,void 0,void 0,function(){var e,n,r,I,i,o,a,s,u,c;return D(this,function(t){switch(t.label){case 0:if(C._id in k)return[2,k[C._id]];U(k[C._id]=T,{id:C._id,rev:C._rev}),d.attachments&&Object.defineProperty(T,"_attachments",{configurable:!0,value:C._attachments}),r=function(r,i){var o,a,s,u,c,d,l,f,h,p,y,v,w,m,b,_,g,M,A,j,O;return D(this,function(t){switch(t.label){case 0:return null!=(s=C[r])?[3,1]:(T[r]=null,[3,13]);case 1:return i instanceof q?(u=I.connectionManager.getMetadata(i.type),c=I.connectionManager.getRepository(i.type),i instanceof P?(d=T,l=r,k.hasOwnProperty(s)?(f=k[s],[3,4]):[3,2]):[3,5]):[3,12];case 2:return[4,c._read(s,{depth:x-1,circularCache:k})];case 3:f=t.sent(),t.label=4;case 4:return d[l]=f,[3,11];case 5:return i instanceof S?(h=T,p=r,[4,G(c,s,x-1,k)]):[3,7];case 6:return h[p]=t.sent(),[3,11];case 7:return i instanceof R?(y=Object.keys(s),v=y.map(function(t){return s[t]}),[4,G(c,v,x-1,k)]):[3,9];case 8:w=t.sent(),m={},b=function(e){m[e]=w.find(function(t){return t._id===s[e]})};try{for(_=E(y),g=_.next();!g.done;g=_.next())M=g.value,b(M)}catch(e){o={error:e}}finally{try{g&&!g.done&&(a=_["return"])&&a.call(_)}finally{if(o)throw o.error}}return T[r]=m,[3,11];case 9:return i instanceof F?(A=T,j=r,[4,c.hydrator.hydrate(c.build(),s,u)]):[3,11];case 10:A[j]=t.sent(),t.label=11;case 11:return[3,13];case 12:i instanceof N&&(!(O=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(T),r))||O.writable||O.set)&&(T[r]=function n(t,e){if(e===Date&&t)return new Date(t);return t}(s,i.type)),t.label=13;case 13:return[2]}})},I=this,t.label=1;case 1:t.trys.push([1,6,7,8]),i=E(d.properties),o=i.next(),t.label=2;case 2:return o.done?[3,5]:(a=A(o.value,2),s=a[0],u=a[1],[5,r(s,u)]);case 3:t.sent(),t.label=4;case 4:return o=i.next(),[3,2];case 5:return[3,8];case 6:return c=t.sent(),e={error:c},[3,8];case 7:try{o&&!o.done&&(n=i["return"])&&n.call(i)}finally{if(e)throw e.error}return[7];case 8:return[2,T]}})})},t.decorators=[{type:i.Injectable}],t.ctorParameters=function(){return[{type:undefined,decorators:[{type:i.Inject,args:[B]}]},{type:et}]},t}(p);function G(r,i,o,a){return l(this,void 0,void 0,function(){var e,n;return D(this,function(t){switch(t.label){case 0:return(e=i.filter(function(t){return!a.hasOwnProperty(t)})).length?[4,r._readAll({keys:e,include_docs:!0},{depth:o,circularCache:a})]:[3,2];case 1:n=t.sent(),t.label=2;case 2:return[2,i.map(function(e){return a.hasOwnProperty(e)?a[e]:n&&n.find(function(t){return t._id===e})})]}})})}function z(t,e,n){return"string"==typeof t?t:n.build(e.name,e.idType,t[e.id])}var X=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.validate=function(u,c){return l(this,void 0,void 0,function(){var e,n,r,i,o,a,s;return D(this,function(t){switch(t.label){case 0:t.trys.push([0,5,6,7]),r=E(c.properties),i=r.next(),t.label=1;case 1:return i.done?[3,4]:(o=A(i.value,2),a=o[0],[4,o[1].validate(u[a],a)]);case 2:t.sent(),t.label=3;case 3:return i=r.next(),[3,1];case 4:return[3,7];case 5:return s=t.sent(),e={error:s},[3,7];case 6:try{i&&!i.done&&(n=r["return"])&&n.call(r)}finally{if(e)throw e.error}return[7];case 7:return[2,!0]}})})},e}(y);function Z(){return n}function tt(){return{head:function(t){return t+"_0"},tail:function(t){return t+"_9"},build:function(t,e,n){if(e===String)return t+"_2_"+n;if(e!==Number)throw new Error('Invalid id type "'+e+'"');var r=n.toString();return t+"_1_"+"0".repeat(16-r.length)+r},parse:function(t){var e=/^(.*)_(1|2)_(.*)$/.exec(t);if(!e)throw new TypeError('Invalid id "'+t+'"');return{name:e[1],type:"2"===e[2]?String:Number,id:"2"===e[2]?e[3]:Number.parseInt(e[3],10)}}}}var et=function(){function n(t,e,n){this.connectionFactory=t,this.id=e,this.injector=n,this.connections=new Map,this.repositories=new Map,this.metadata=new Map}return n.prototype.getOpenConnections=function(){return Array.from(this.connections.values())},n.prototype.getConnection=function(t){return this.connections.has(t)||this.connections.set(t,this.createConnection(t)),this.connections.get(t)},n.prototype.clearConnections=function(){this.connections.clear()},n.prototype.createConnection=function(t){return this.connectionFactory(t)},n.prototype.getRepository=function(t){return this.repositories.has(t)||this.repositories.set(t,this.createRepository(t)),this.repositories.get(t)},n.prototype.createRepository=function(t){var e=this.getMetadata(t);return i.Injector.create({parent:this.injector,providers:[{provide:n,useValue:this},{provide:K,deps:[v,w,m,b,B,L,p,y]},{provide:w,useValue:t},{provide:m,useValue:e},{provide:v,useValue:e.inline?null:this.getConnection(e.name)},{provide:W,deps:[B,n]},{provide:X,deps:[]},{provide:p,useExisting:e.hydrator||W},{provide:y,useExisting:e.validator||X},{provide:L,deps:[v,w,m,p,y]}]}).get(K)},n.prototype.getMetadata=function(t){return this.metadata.has(t)||this.metadata.set(t,this.createMetadata(t)),this.metadata.get(t)},n.prototype.createMetadata=function(t){return new Y(t)},n.decorators=[{type:i.Injectable}],n.ctorParameters=function(){return[{type:undefined,decorators:[{type:i.Inject,args:[_]}]},{type:undefined,decorators:[{type:i.Inject,args:[B]}]},{type:i.Injector}]},n}();t.BelongsTo=function dt(n){return void 0===n&&(n={}),function(t,e){c(t.constructor,e,d(new P,a({type:Reflect.getMetadata("design:type",t,e),required:!1},n)))}},t.BelongsToMetadata=P,t.DesignDoc=function lt(e,n){return function(t){u(t,d(new I,{entity:e,name:n}))}},t.DesignDocMetadata=I,t.Entity=function ft(e,n){return void 0===n&&(n={}),function(t){u(t,d(new g,a({name:e,attachments:!1},n)))}},t.EntityMetadata=g,t.Filter=function ht(){return function(t,e){c(t.constructor,e,d(new T,{}))}},t.FilterMetadata=T,t.HasMany=function pt(n,r){return void 0===r&&(r={}),function(t,e){c(t.constructor,e,d(new S,a({type:n,required:!1},r)))}},t.HasManyMetadata=S,t.HasManyMap=function yt(n,r){return void 0===r&&(r={}),function(t,e){c(t.constructor,e,d(new R,a({type:n,required:!1},r)))}},t.HasManyMapMetadata=R,t.Id=function vt(n){return void 0===n&&(n={}),function(t,e){c(t.constructor,e,d(new C,a({strategy:h.Static,type:Reflect.getMetadata("design:type",t,e)},n)))}},t.IdStrategy=h,t.IdMetadata=C,t.Inline=function wt(n){return void 0===n&&(n={}),function(t,e){c(t.constructor,e,d(new F,a({type:Reflect.getMetadata("design:type",t,e),required:!1},n)))}},t.InlineMetadata=F,t.InlineEntity=function mt(e){return void 0===e&&(e={}),function(t){u(t,d(new x,a({},e,{inline:!0})))}},t.InlineEntityMetadata=x,t.Property=function bt(n){return void 0===n&&(n={}),function(t,e){c(t.constructor,e,d(new N,a({type:Reflect.getMetadata("design:type",t,e),required:!1},n)))}},t.PropertyMetadata=N,t.RelationMetadata=q,t.ValidateDoc=function _t(){return function(t,e){c(t.constructor,e,d(new k,{}))}},t.ValidateDocMetadata=k,t.View=function gt(){return function(t,e){c(t.constructor,e,d(new V,{}))}},t.ViewMetadata=V,t.BulkOperation=Q,t.Bulk=L,t.createAdamantConnection=function Mt(t){return i.Injector.create({providers:[{provide:_,useValue:t},{provide:et,deps:[_,B,i.Injector]},{provide:B,useFactory:tt,deps:[]},{provide:b,useFactory:Z,deps:[]}]}).get(et)},t.AdamantConnectionManager=et,t.equalCheckerFactory=Z,t.adamantIdFactory=tt,t.Hydrator=p,t.HydratorImpl=W,t.ADAMANT_CONNECTION=v,t.ADAMANT_ENTITY_CLASS=w,t.ADAMANT_ENTITY_METADATA=m,t.ADAMANT_EQUAL_CHECKER=b,t.ADAMANT_CONNECTION_FACTORY=_,t.ADAMANT_ID=B,t.Metadata=Y,t.QueryBuilder=J,t.AdamantRepository=K,t.Validator=y,t.ValidatorImpl=X,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=neoskop-adamant.umd.min.js.map

@@ -11,3 +11,2 @@ /// <reference types="pouchdb-find" />

import { AdamantId, ConnectionFactory } from './injector-tokens';
export declare function adamantIdFactory(): AdamantId;
export declare function createAdamantConnection(factory: ConnectionFactory): AdamantConnectionManager;

@@ -14,0 +13,0 @@ export declare class AdamantConnectionManager {

@@ -45,3 +45,3 @@ /**

if (0 === entities.length) {
return entities;
return /** @type {?} */ (entities);
}

@@ -74,3 +74,3 @@ /** @type {?} */

});
return entities;
return /** @type {?} */ (entities);
});

@@ -121,2 +121,2 @@ }

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVsay5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJidWxrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUN0QyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBRXhDLE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxvQkFBb0IsRUFBRSx1QkFBdUIsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ3RHLE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxlQUFlLENBQUM7QUF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aHJvdyBlcnJvcnM7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIHJlc3VsdC5mb3JFYWNoKChyZXMsIGluZGV4KSA9PiB7XG4gICAgICAgICAgICBpZihvcGVyYXRpb24gPT09IEJ1bGtPcGVyYXRpb24uRGVsZXRlKSB7XG4gICAgICAgICAgICAgICAgbWFya0RlbGV0ZWQoZW50aXRpZXNbaW5kZXhdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG1hcmtJZFJldihlbnRpdGllc1tpbmRleF0sIHJlcyk7XG4gICAgICAgIH0pO1xuICAgICAgICBcbiAgICAgICAgcmV0dXJuIGVudGl0aWVzO1xuICAgIH1cbiAgICBcbiAgICBjcmVhdGUoZW50aXRpZXMgOiBUW10pIDogUHJvbWlzZTxUW10+IHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYnVsayhlbnRpdGllcywgQnVsa09wZXJhdGlvbi5DcmVhdGUpO1xuICAgIH1cbiAgICBcbiAgICB1cGRhdGUoZW50aXRpZXMgOiBUW10pIDogUHJvbWlzZTxUW10+IHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYnVsayhlbnRpdGllcywgQnVsa09wZXJhdGlvbi5VcGRhdGUpO1xuICAgIH1cbiAgICBcbiAgICBkZWxldGUoZW50aXRpZXMgOiBUW10pIDogUHJvbWlzZTxUW10+IHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYnVsayhlbnRpdGllcywgQnVsa09wZXJhdGlvbi5EZWxldGUpO1xuICAgIH1cbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVsay5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJidWxrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUN0QyxPQ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xuICAgICAgICAgICAgICAgIGRvYy5fZGVsZXRlZCA9IHRydWU7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICByZXR1cm4gZG9jO1xuICAgICAgICB9KSk7XG4gICAgICAgIFxuICAgICAgICBjb25zdCByZXN1bHQgPSBhd2FpdCB0aGlzLmRiLmJ1bGtEb2NzKGRvY3MpO1xuICAgICAgICBjb25zdCBlcnJvcnMgOiBQb3VjaERCLkNvcmUuRXJyb3JbXSA9IHJlc3VsdC5maWx0ZXIociA9PiBPYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5LmNhbGwociwgJ2Vycm9yJykpO1xuICAgICAgICBcbiAgICAgICAgaWYoMCA8IGVycm9ycy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRocm93IGVycm9ycztcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgcmVzdWx0LmZvckVhY2goKHJlcywgaW5kZXgpID0+IHtcbiAgICAgICAgICAgIGlmKG9wZXJhdGlvbiA9PT0gQnVsa09wZXJhdGlvbi5EZWxldGUpIHtcbiAgICAgICAgICAgICAgICBtYXJrRGVsZXRlZChlbnRpdGllc1tpbmRleF0pO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgbWFya0lkUmV2KGVudGl0aWVzW2luZGV4XSwgcmVzKTtcbiAgICAgICAgfSk7XG4gICAgICAgIFxuICAgICAgICByZXR1cm4gZW50aXRpZXMgYXMgKFQgJiBBZGFtYW50UmV2TWV0YSAmIEFkYW1hbnREZWxldGVkTWV0YSlbXTtcbiAgICB9XG4gICAgXG4gICAgY3JlYXRlKGVudGl0aWVzIDogVFtdKSA6IFByb21pc2U8KFQgJiBBZGFtYW50UmV2TWV0YSlbXT4ge1xuICAgICAgICByZXR1cm4gdGhpcy5idWxrKGVudGl0aWVzLCBCdWxrT3BlcmF0aW9uLkNyZWF0ZSk7XG4gICAgfVxuICAgIFxuICAgIHVwZGF0ZShlbnRpdGllcyA6IFRbXSkgOiBQcm9taXNlPChUICYgQWRhbWFudFJldk1ldGEpW10+IHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYnVsayhlbnRpdGllcywgQnVsa09wZXJhdGlvbi5VcGRhdGUpO1xuICAgIH1cbiAgICBcbiAgICBkZWxldGUoZW50aXRpZXMgOiBUW10pIDogUHJvbWlzZTwoVCAmIEFkYW1hbnRSZXZNZXRhICYgQWRhbWFudERlbGV0ZWRNZXRhKVtdPiB7XG4gICAgICAgIHJldHVybiB0aGlzLmJ1bGsoZW50aXRpZXMsIEJ1bGtPcGVyYXRpb24uRGVsZXRlKTtcbiAgICB9XG59XG4iXX0=

@@ -6,3 +6,3 @@ /**

import { Inject, Injectable, Injector } from '@angular/core';
import { AdamantRepository, equalCheckerFactory } from './repository';
import { AdamantRepository } from './repository';
import { Metadata } from './metadata';

@@ -15,57 +15,4 @@ import { Bulk } from './bulk';

import { ADAMANT_CONNECTION, ADAMANT_CONNECTION_FACTORY, ADAMANT_ENTITY_CLASS, ADAMANT_ENTITY_METADATA, ADAMANT_EQUAL_CHECKER, ADAMANT_ID } from './injector-tokens';
import { adamantIdFactory, equalCheckerFactory } from './factories';
/**
* @return {?}
*/
export function adamantIdFactory() {
return {
/**
* @param {?} name
* @return {?}
*/
head(name) {
return `${name}_0`;
},
/**
* @param {?} name
* @return {?}
*/
tail(name) {
return `${name}_9`;
},
/**
* @param {?} name
* @param {?} type
* @param {?} id
* @return {?}
*/
build(name, type, id) {
if (type === String) {
return `${name}_2_${id}`;
}
else if (type === Number) {
/** @type {?} */
const idStr = id.toString();
return `${name}_1_${'0'.repeat(16 - idStr.length)}${idStr}`;
}
throw new Error(`Invalid id type "${type}"`);
},
/**
* @param {?} id
* @return {?}
*/
parse(id) {
/** @type {?} */
const match = /^(.*)_(1|2)_(.*)$/.exec(id);
if (!match) {
throw new TypeError(`Invalid id "${id}"`);
}
return {
name: /** @type {?} */ ((match[1])),
type: match[2] === '2' ? String : Number,
id: match[2] === '2' ? match[3] : Number.parseInt(match[3], 10)
};
}
};
}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Zykge1xuICAgICAgICAgICAgICAgIHJldHVybiBgJHtuYW1lfV8yXyR7aWR9YDtcbiAgICAgICAgICAgIH0gZWxzZSBpZih0eXBlID09PSBOdW1iZXIpIHtcbiAgICAgICAgICAgICAgICBjb25zdCBpZFN0ciA9IGlkLnRvU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGAke25hbWV9XzFfJHsnMCcucmVwZWF0KDE2IC0gaWRTdHIubGVuZ3RoKX0ke2lkU3RyfWA7XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgaWQgdHlwZSBcIiR7dHlwZX1cImApO1xuICAgICAgICB9LFxuICAgICAgICBwYXJzZShpZCA6IHN0cmluZykgOiB7IG5hbWU6IHN0cmluZywgdHlwZTogdHlwZW9mIFN0cmluZyB8IHR5cGVvZiBOdW1iZXIsIGlkIDogc3RyaW5nIHwgbnVtYmVyIH0ge1xuICAgICAgICAgICAgY29uc3QgbWF0Y2ggPSAvXiguKilfKDF8MilfKC4qKSQvLmV4ZWMoaWQpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBpZighbWF0Y2gpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKGBJbnZhbGlkIGlkIFwiJHtpZH1cImApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgXG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIG5hbWU6IG1hdGNoWzFdISxcbiAgICAgICAgICAgICAgICB0eXBlOiBtYXRjaFsyXSA9PT0gJzInID8gU3RyaW5nIDogTnVtYmVyLFxuICAgICAgICAgICAgICAgIGlkOiBtYXRjaFsyXSA9PT0gJzInID8gbWF0Y2hbM10gOiBOdW1iZXIucGFyc2VJbnQobWF0Y2hbM10sIDEwKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH1cbn1cblxuXG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlQWR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gIH1cbiAgICBcbiAgICBnZXRNZXRhZGF0YTxUPihlbnRpdHlDbGFzcyA6IEN0b3I8VD4pIDogTWV0YWRhdGE8VD4ge1xuICAgICAgICBpZighdGhpcy5tZXRhZGF0YS5oYXMoZW50aXR5Q2xhc3MpKSB7XG4gICAgICAgICAgICB0aGlzLm1ldGFkYXRhLnNldChlbnRpdHlDbGFzcywgdGhpcy5jcmVhdGVNZXRhZGF0YShlbnRpdHlDbGFzcykpO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICByZXR1cm4gdGhpcy5tZXRhZGF0YS5nZXQoZW50aXR5Q2xhc3MpITtcbiAgICB9XG4gICAgXG4gICAgcHJvdGVjdGVkIGNyZWF0ZU1ldGFkYXRhPFQ+KGVudGl0eUNsYXNzIDogQ3RvcjxUPikgOiBNZXRhZGF0YTxUPiB7XG4gICAgICAgIHJldHVybiBuZXcgTWV0YWRhdGE8VD4oZW50aXR5Q2xhc3MpO1xuICAgIH1cbn1cbiJdfQ==

@@ -39,6 +39,6 @@ /**

if (options && options.includeRev) {
doc._rev = (/** @type {?} */ (entity))._rev;
doc._rev = entity._rev;
}
if (metadata.attachments && (/** @type {?} */ (entity))._attachments) {
doc._attachments = (/** @type {?} */ (entity))._attachments;
if (metadata.attachments && entity._attachments) {
doc._attachments = entity._attachments;
}

@@ -48,2 +48,3 @@ for (const [property, annotation] of metadata.properties) {

const value = entity[/** @type {?} */ (property)];
/* instanbul ignore else */
if (annotation instanceof RelationMetadata) {

@@ -53,2 +54,3 @@ if (value != null) {

const relationMetadata = this.connectionManager.getMetadata(annotation.type);
/* istanbul ignore else */
if (annotation instanceof BelongsToMetadata) {

@@ -110,2 +112,3 @@ doc[property] = relationToId(value, relationMetadata, this.id);

else {
/* istanbul ignore else */
if (annotation instanceof RelationMetadata) {

@@ -116,2 +119,3 @@ /** @type {?} */

const relationRepository = this.connectionManager.getRepository(annotation.type);
/* istanbul ignore else */
if (annotation instanceof BelongsToMetadata) {

@@ -155,3 +159,3 @@ entity[/** @type {?} */ (property)] = circularCache.hasOwnProperty(value) ? circularCache[value] : yield relationRepository

}
return entity;
return /** @type {?} */ (entity);
});

@@ -223,2 +227,2 @@ }

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHlkcmF0b3ItaW1wbC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJoeWRyYXRvci1pbXBsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFRLE1BQU0sd0JBQXdCLENBQUM7QUFDaEUsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ2hFLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDMUMsT0FBTyxFQUFrQixRQUFRLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFFdEQsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDMUQsT0FBTyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDaEUsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBRXpELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzdELE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUM5QyxPQUFPLEVBQUUsTUFBTSxFQUFFLFVBQVUsRUFBRSxNQUFNLGVBQWUsQ0FBQztBQUNuRCxPQUFPLEVBQUUsVUFBVSxFQUFhLE1BQU0sbUJBQW1CLENBQUM7QUFHMUQsTUFBTSxtQkFBb0IsU0FBUSxRQUFROzs7O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0YSA6IE1ldGFkYXRhPFQ+LCBvcHRpb25zPyA6IHsgaW5jbHVkZVJldj8gOiBib29sZWFuIH0pIDogUG91Y2hEQi5Db3JlLkRvY3VtZW50PFQ+ICYgUGFydGlhbDxQb3VjaERCLkNvcmUuUmV2aXNpb25JZE1ldGE+IHtcbiAgICAgICAgY29uc3QgZG9jIDogYW55ID0ge307XG4gICAgICAgIFxuICAgICAgICBpZihvcHRpb25zICYmIG9wdGlvbnMuaW5jbHVkZVJldikge1xuICAgICAgICAgICAgZG9jLl9yZXYgPSAoZW50aXR5IGFzIGFueSkuX3JldjtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgaWYobWV0YWRhdGEuYXR0YWNobWVudHMgJiYgKGVudGl0eSBhcyBhbnkpLl9hdHRhY2htZW50cykge1xuICAgICAgICAgICAgZG9jLl9hdHRhY2htZW50cyA9IChlbnRpdHkgYXMgYW55KS5fYXR0YWNobWVudHM7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGZvcihjb25zdCBbIHByb3BlcnR5LCBhbm5vdGF0aW9uIF0gb2YgbWV0YWRhdGEucHJvcGVydGllcykge1xuICAgICAgICAgICAgY29uc3QgdmFsdWUgOiBhbnkgPSBlbnRpdHlbIHByb3BlcnR5IGFzIGtleW9mIFQgXTtcbiAgICAgICAgICAgIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBSZWxhdGlvbk1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgaWYodmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCByZWxhdGlvbk1ldGFkYXRhID0gdGhpcy5jb25uZWN0aW9uTWFuYWdlci5nZXRNZXRhZGF0YShhbm5vdGF0aW9uLnR5cGUpO1xuICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIEJlbG9uZ3NUb01ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2NbIHByb3BlcnR5IF0gPSByZWxhdGlvblRvSWQodmFsdWUsIHJlbGF0aW9uTWV0YWRhdGEsIHRoaXMuaWQpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIEhhc01hbnlNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9jWyBwcm9wZXJ0eSBdID0gKHZhbHVlIGFzIGFueVtdKS5tYXAocmVsID0+IHJlbGF0aW9uVG9JZChyZWwsIHJlbGF0aW9uTWV0YWRhdGEsIHRoaXMuaWQpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBIYXNNYW55TWFwTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlbCA6IGFueSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGNvbnN0IGtleSBpbiB2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbFsga2V5IF0gPSByZWxhdGlvblRvSWQodmFsdWVbIGtleSBdLCByZWxhdGlvbk1ldGFkYXRhLCB0aGlzLmlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY1sgcHJvcGVydHkgXSA9IHJlbDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBJbmxpbmVNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9jWyBwcm9wZXJ0eSBdID0gdGhpcy5jb25uZWN0aW9uTWFuYWdlci5nZXRSZXBvc2l0b3J5KGFubm90YXRpb24udHlwZSkuaHlkcmF0b3IuZGVoeWRyYXRlKHZhbHVlLCByZWxhdGlvbk1ldGFkYXRhKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAg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GRhdGEuX2lkIF07XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGNpcmN1bGFyQ2FjaGVbIGRhdGEuX2lkIF0gPSBlbnRpdHk7XG4gICAgICAgIFxuICAgICAgICBtYXJrSWRSZXYoZW50aXR5LCB7IGlkOiBkYXRhLl9pZCwgcmV2OiBkYXRhLl9yZXYgfSk7XG4gICAgICAgIFxuICAgICAgICBpZihtZXRhZGF0YS5hdHRhY2htZW50cykge1xuICAgICAgICAgICAgT2JqZWN0LmRlZmluZVByb3BlcnR5KGVudGl0eSwgJ19hdHRhY2htZW50cycsIHsgY29uZmlndXJhYmxlOiB0cnVlLCB2YWx1ZTogZGF0YS5fYXR0YWNobWVudHMgfSk7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGZvcihjb25zdCBbIHByb3BlcnR5LCBhbm5vdGF0aW9uIF0gb2YgbWV0YWRhdGEucHJvcGVydGllcykge1xuICAgICAgICAgICAgY29uc3QgdmFsdWUgOiBhbnkgPSBkYXRhWyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF07XG4gICAgICAgICAgICBpZihudWxsID09IHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgZW50aXR5WyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF0gPSBudWxsITtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIFJlbGF0aW9uTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVsYXRpb25NZXRhZGF0YSA9IHRoaXMuY29ubmVjdGlvbk1hbmFnZXIuZ2V0TWV0YWRhdGEoYW5ub3RhdGlvbi50eXBlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVsYXRpb25SZXBvc2l0b3J5ID0gdGhpcy5jb25uZWN0aW9uTWFuYWdlci5nZXRSZXBvc2l0b3J5KGFubm90YXRpb24udHlwZSk7XG4gICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgQmVsb25nc1RvTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVudGl0eVsgcHJvcGVydHkgYXMga2V5b2YgVCBdID0gY2lyY3VsYXJDYWNoZS5oYXNPd25Qcm9wZXJ0eSh2YWx1ZSkgPyBjaXJjdWxhckNhY2hlW3ZhbHVlXSA6IGF3YWl0IHJlbGF0aW9uUmVwb3NpdG9yeVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5fcmVhZCh2YWx1ZSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXB0aDogZGVwdGggLSAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaXJjdWxhckNhY2hlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgSGFzTWFueU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRpdHlbIHByb3BlcnR5IGFzIGtleW9mIFQgXSA9IGF3YWl0IHJlYWRBbGxXaXRoQ2lyY3VsYXJDYWNoZShyZWxhdGlvblJlcG9zaXRvcnksIHZhbHVlLCBkZXB0aCAtIDEsIGNpcmN1bGFyQ2FjaGUpIGFzIGFueTtcbiAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIEhhc01hbnlNYXBNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5cyA9IE9iamVjdC5rZXlzKHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlcyA9IGtleXMubWFwKGsgPT4gdmFsdWVbIGsgXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGVudGl0aWVzID0gYXdhaXQgcmVhZEFsbFdpdGhDaXJjdWxhckNhY2hlKHJlbGF0aW9uUmVwb3NpdG9yeSwgdmFsdWVzLCBkZXB0aCAtIDEsIGNpcmN1bGFyQ2FjaGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVsIDogYW55ID0ge307XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IoY29uc3Qga2V5IG9mIGtleXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWxbIGtleSBdID0gZW50aXRpZXMuZmluZChlID0+IGUuX2lkID09PSB2YWx1ZVsga2V5IF0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZW50aXR5WyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF0gPSByZWw7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgSW5saW5lTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVudGl0eVsgcHJvcGVydHkgYXMga2V5b2YgVCBdID0gYXdhaXQgcmVsYXRpb25SZXBvc2l0b3J5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmh5ZHJhdG9yLmh5ZHJhdGUocmVsYXRpb25SZXBvc2l0b3J5LmJ1aWxkKCksIHZhbHVlLCByZWxhdGlvbk1ldGFkYXRhKVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBQcm9wZXJ0eU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGRlc2NyaXB0b3IgPSBPYmplY3QuZ2V0T3duUHJvcGVydHlEZXNjcmlwdG9yKE9iamVjdC5nZXRQcm90b3R5cGVPZihlbnRpdHkpLCBwcm9wZXJ0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NobWVudHM7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGZvcihjb25zdCBbIHByb3BlcnR5LCBhbm5vdGF0aW9uIF0gb2YgbWV0YWRhdGEucHJvcGVydGllcykge1xuICAgICAgICAgICAgY29uc3QgdmFsdWUgOiBhbnkgPSBlbnRpdHlbIHByb3BlcnR5IGFzIGtleW9mIFQgXTtcbiAgICAgICAgICAgIC8qIGluc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgICAgICAgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIFJlbGF0aW9uTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICBpZih2YWx1ZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlbGF0aW9uTWV0YWRhdGEgPSB0aGlzLmNvbm5lY3Rpb25NYW5hZ2VyLmdldE1ldGFkYXRhKGFubm90YXRpb24udHlwZSk7XG4gICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgICAgICAgICAgICAgICBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgQmVsb25nc1RvTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY1sgcHJvcGVydHkgXSA9IHJlbGF0aW9uVG9JZCh2YWx1ZSwgcmVsYXRpb25NZXRhZGF0YSwgdGhpcy5pZCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgSGFzTWFueU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2NbIHByb3BlcnR5IF0gPSAodmFsdWUgYXMgYW55W10pLm1hcChyZWwgPT4gcmVsYXRpb25Ub0lkKHJlbCwgcmVsYXRpb25NZXRhZGF0YSwgdGhpcy5pZCkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIEhhc01hbnlNYXBNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVsIDogYW55ID0ge307XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IoY29uc3Qga2V5IGluIHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVsWyBrZXkgXSA9IHJlbGF0aW9uVG9JZCh2YWx1ZVsga2V5IF0sIHJlbGF0aW9uTWV0YWRhdGEsIHRoaXMuaWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZG9jWyBwcm9wZXJ0eSBdID0gcmVsO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIElubGluZU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2NbIHByb3BlcnR5IF0gPSB0aGlzLmNvbm5lY3Rpb25NYW5hZ2VyLmdldFJlcG9zaXRvcnkoYW5ub3RhdGlvbi50eXBlKS5oeWRyYXRvci5kZWh5ZHJhdGUodmFsdWUsIHJlbGF0aW9uTWV0YWRhdGEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBQcm9wZXJ0eU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgZG9jWyBwcm9wZXJ0eSBdID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIElkTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9jLl9pZCA9IHRoaXMuaWQuYnVpbGQobWV0YWRhdGEubmFtZSEsIG1ldGFkYXRhLmlkVHlwZSwgdmFsdWUgYXMgYW55KTtcbiAgICAgICAgICAgIC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YXdhaXQgcmVsYXRpb25SZXBvc2l0b3J5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLl9yZWFkKHZhbHVlLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlcHRoOiBkZXB0aCAtIDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcmN1bGFyQ2FjaGVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBIYXNNYW55TWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVudGl0eVsgcHJvcGVydHkgYXMga2V5b2YgVCBdID0gYXdhaXQgcmVhZEFsbFdpdGhDaXJjdWxhckNhY2hlKHJlbGF0aW9uUmVwb3NpdG9yeSwgdmFsdWUsIGRlcHRoIC0gMSwgY2lyY3VsYXJDYWNoZSkgYXMgYW55O1xuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgSGFzTWFueU1hcE1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXlzID0gT2JqZWN0LmtleXModmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsdWVzID0ga2V5cy5tYXAoayA9PiB2YWx1ZVsgayBdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZW50aXRpZXMgPSBhd2FpdCByZWFkQWxsV2l0aENpcmN1bGFyQ2FjaGUocmVsYXRpb25SZXBvc2l0b3J5LCB2YWx1ZXMsIGRlcHRoIC0gMSwgY2lyY3VsYXJDYWNoZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCByZWwgOiBhbnkgPSB7fTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvcihjb25zdCBrZXkgb2Yga2V5cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbFsga2V5IF0gPSBlbnRpdGllcy5maW5kKGUgPT4gZS5faWQgPT09IHZhbHVlWyBrZXkgXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRpdHlbIHByb3BlcnR5IGFzIGtleW9mIFQgXSA9IHJlbDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBJbmxpbmVNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZW50aXR5WyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF0gPSBhd2FpdCByZWxhdGlvblJlcG9zaXRvcnlcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuaHlkcmF0b3IuaHlkcmF0ZShyZWxhdGlvblJlcG9zaXRvcnkuYnVpbGQoKSwgdmFsdWUsIHJlbGF0aW9uTWV0YWRhdGEpXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIFByb3BlcnR5TWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZGVzY3JpcHRvciA9IE9iamVjdC5nZXRPd25Qcm9wZXJ0eURlc2NyaXB0b3IoT2JqZWN0LmdldFByb3RvdHlwZU9mKGVudGl0eSksIHByb3BlcnR5KTtcbiAgICAgICAgICAgICAgICAgICAgaWYoIWRlc2NyaXB0b3IgfHwgZGVzY3JpcHRvci53cml0YWJsZSB8fCBkZXNjcmlwdG9yLnNldCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZW50aXR5WyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF0gPSB1bnBhY2sodmFsdWUsIGFubm90YXRpb24udHlwZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgIC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0YWRhdGE8VD4sIG9wdGlvbnM/IDogSHlkcmF0ZU9wdGlvbnMpIDogUHJvbWlzZTxUICYgQWRhbWFudFJldk1ldGE+O1xuICAgIFxuICAgIGFic3RyYWN0IGRlaHlkcmF0ZTxUPihlbnRpdHkgOiBUICYgQWRhbWFudEVudGl0eU1ldGEsIG1ldGFkYXRhIDogTWV0YWRhdGE8VD4sIG9wdGlvbnM/IDogeyBpbmNsdWRlUmV2PyA6IGJvb2xlYW4gfSkgOiBQb3VjaERCLkNvcmUuRG9jdW1lbnQ8VD4gJiBQYXJ0aWFsPFBvdWNoREIuQ29yZS5SZXZpc2lvbklkTWV0YT47XG59XG5cblxuIl19

@@ -19,3 +19,4 @@ /**

export { BulkOperation, Bulk } from './bulk';
export { adamantIdFactory, createAdamantConnection, AdamantConnectionManager } from './connection-manager';
export { createAdamantConnection, AdamantConnectionManager } from './connection-manager';
export { equalCheckerFactory, adamantIdFactory } from './factories';
export { Hydrator } from './hydrator';

@@ -26,6 +27,6 @@ export { HydratorImpl } from './hydrator-impl';

export { QueryBuilder } from './query-builder';
export { equalCheckerFactory, AdamantRepository } from './repository';
export { AdamantRepository } from './repository';
export { Validator } from './validator';
export { ValidatorImpl } from './validator-impl';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AbmVvc2tvcC9hZGFtYW50LyIsInNvdXJjZXMiOlsiaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLDZDQUFjLDBCQUEwQixDQUFDO0FBQ3pDLDZDQUFjLDBCQUEwQixDQUFDO0FBQ3pDLHVDQUFjLHNCQUFzQixDQUFDO0FBQ3JDLHVDQUFjLHNCQUFzQixDQUFDO0FBQ3JDLHlDQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLCtDQUFjLDRCQUE0QixDQUFDO0FBQzNDLDJDQUFjLGtCQUFrQixDQUFD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nJvbSAnLi9hbm5vdGF0aW9ucy9yZWxhdGlvbic7XG5leHBvcnQgKiBmcm9tICcuL2Fubm90YXRpb25zL3ZhbGlkYXRlLWRvYyc7XG5leHBvcnQgKiBmcm9tICcuL2Fubm90YXRpb25zL3ZpZXcnO1xuXG5leHBvcnQgKiBmcm9tICcuL2J1bGsnO1xuZXhwb3J0ICogZnJvbSAnLi9jb25uZWN0aW9uLW1hbmFnZXInO1xuZXhwb3J0ICogZnJvbSAnLi9mYWN0b3JpZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9oeWRyYXRvcic7XG5leHBvcnQgKiBmcm9tICcuL2h5ZHJhdG9yLWltcGwnO1xuZXhwb3J0ICogZnJvbSAnLi9pbmplY3Rvci10b2tlbnMnO1xuZXhwb3J0ICogZnJvbSAnLi9tZXRhLWludGVyZmFjZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9tZXRhZGF0YSc7XG5leHBvcnQgKiBmcm9tICcuL3F1ZXJ5LWJ1aWxkZXInO1xuZXhwb3J0ICogZnJvbSAnLi9yZXBvc2l0b3J5JztcbmV4cG9ydCAqIGZyb20gJy4vdmFsaWRhdG9yJztcbmV4cG9ydCAqIGZyb20gJy4vdmFsaWRhdG9yLWltcGwnO1xuIl19

@@ -8,4 +8,4 @@ /**

*/
export { BelongsTo, BelongsToMetadata, DesignDoc, DesignDocMetadata, Entity, EntityMetadata, Filter, FilterMetadata, HasMany, HasManyMetadata, HasManyMap, HasManyMapMetadata, Id, IdStrategy, IdMetadata, Inline, InlineMetadata, InlineEntity, InlineEntityMetadata, Property, PropertyMetadata, RelationMetadata, ValidateDoc, ValidateDocMetadata, View, ViewMetadata, BulkOperation, Bulk, adamantIdFactory, createAdamantConnection, AdamantConnectionManager, Hydrator, HydratorImpl, ADAMANT_CONNECTION, ADAMANT_ENTITY_CLASS, ADAMANT_ENTITY_METADATA, ADAMANT_EQUAL_CHECKER, ADAMANT_CONNECTION_FACTORY, ADAMANT_ID, Metadata, QueryBuilder, equalCheckerFactory, AdamantRepository, Validator, ValidatorImpl } from './index';
export { BelongsTo, BelongsToMetadata, DesignDoc, DesignDocMetadata, Entity, EntityMetadata, Filter, FilterMetadata, HasMany, HasManyMetadata, HasManyMap, HasManyMapMetadata, Id, IdStrategy, IdMetadata, Inline, InlineMetadata, InlineEntity, InlineEntityMetadata, Property, PropertyMetadata, RelationMetadata, ValidateDoc, ValidateDocMetadata, View, ViewMetadata, BulkOperation, Bulk, createAdamantConnection, AdamantConnectionManager, equalCheckerFactory, adamantIdFactory, Hydrator, HydratorImpl, ADAMANT_CONNECTION, ADAMANT_ENTITY_CLASS, ADAMANT_ENTITY_METADATA, ADAMANT_EQUAL_CHECKER, ADAMANT_CONNECTION_FACTORY, ADAMANT_ID, Metadata, QueryBuilder, AdamantRepository, Validator, ValidatorImpl } from './index';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVvc2tvcC1hZGFtYW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5lb3Nrb3AvYWRhbWFudC8iLCJzb3VyY2VzIjpbIm5lb3Nrb3AtYWRhbWFudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBSUEsK3JCQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG5cbmV4cG9ydCB7Q3RvciBhcyDJtWF9IGZyb20gJy4vdXRpbHMvbWV0YWRhdGEnOyJdfQ==

@@ -13,3 +13,2 @@ /**

import { markDeleted, markIdRev } from './utils/marks';
import * as equal from 'fast-deep-equal';
import { ReadQueryBatcher } from './read-query-batcher';

@@ -23,8 +22,2 @@ import { QueryBuilder } from './query-builder';

/**
* @return {?}
*/
export function equalCheckerFactory() {
return equal;
}
/**
* @template T

@@ -66,3 +59,3 @@ */

markIdRev(entity, result);
return entity;
return /** @type {?} */ (entity);
});

@@ -82,3 +75,3 @@ }

markIdRev(entity, result);
return entity;
return /** @type {?} */ (entity);
});

@@ -114,3 +107,3 @@ }

markIdRev(entity, result);
return entity;
return /** @type {?} */ (entity);
});

@@ -132,3 +125,3 @@ }

markDeleted(entity);
return entity;
return /** @type {?} */ (entity);
});

@@ -271,2 +264,3 @@ }

for (const annotation of annotations) {
/* istanbul ignore else */
if (annotation instanceof ViewMetadata) {

@@ -277,2 +271,3 @@ /** @type {?} */

const type = typeof value;
/* istanbul ignore else */
if (type === 'string' || type === 'function') {

@@ -327,9 +322,6 @@ document.views[/** @type {?} */ (property)] = {

/** @type {?} */
const propertyAnnotation = getPropertyMetadata(designDoc, /** @type {?} */ (name), ViewMetadata);
if (!propertyAnnotation) {
const propertyAnnotations = getPropertyMetadata(designDoc, /** @type {?} */ (name), ViewMetadata);
if (0 === propertyAnnotations.length) {
throw new Error(`Unknown view "${name}"`);
}
if (!options) {
options = {};
}
options.include_docs = true;

@@ -391,2 +383,2 @@ return yield Promise.all((yield this.rawView(`${classAnnotation.name}/${name}`, options))

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3NpdG9yeS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJyZXBvc2l0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUN4QyxPQUFPLEVBQVEsc0JBQXNCLEVBQUUsZ0JBQWdCLEVBQUUsbUJBQW1CLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDakgsT0FBTyxFQUFrQixRQUF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ICAgICBfaWQgOiBzdHJpbmc7XG4gICAgICAgICAgICB2aWV3cyA6IHsgWyBrZXkgOiBzdHJpbmcgXSA6IHsgbWFwIDogc3RyaW5nLCByZWR1Y2U/IDogc3RyaW5nIH0gfTtcbiAgICAgICAgICAgIGZpbHRlcnMgOiB7IFsga2V5IDogc3RyaW5nIF0gOiBzdHJpbmcgfTtcbiAgICAgICAgICAgIHZhbGlkYXRlX2RvY191cGRhdGU/IDogc3RyaW5nO1xuICAgICAgICB9ID0ge1xuICAgICAgICAgICAgX2lkICAgIDogYF9kZXNpZ24vJHtjbGFzc0Fubm90YXRpb25zWyAwIF0ubmFtZX1gLFxuICAgICAgICAgICAgdmlld3MgIDoge30sXG4gICAgICAgICAgICBmaWx0ZXJzOiB7fVxuICAgICAgICB9O1xuICAgICAgICBcbiAgICAgICAgZm9yKGNvbnN0IFsgcHJvcGVydHksIGFubm90YXRpb25zIF0gb2YgcHJvcGVydHlBbm5vdGF0aW9ucykge1xuICAgICAgICAgICAgZm9yKGNvbnN0IGFubm90YXRpb24gb2YgYW5ub3RhdGlvbnMpIHtcbiAgICAgICAgICAgICAgICBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgVmlld01ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlIDogYW55ID0gZG9jWyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF07XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSB0eXBlb2YgdmFsdWU7XG4gICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICBpZih0eXBlID09PSAnc3RyaW5nJyB8fCB0eXBlID09PSAnZnVuY3Rpb24nKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC52aWV3c1sgcHJvcGVydHkgYXMgc3RyaW5nIF0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwOiB2YWx1ZS50b1N0cmluZygpXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYodHlwZSA9PT0gJ29iamVjdCcpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnZpZXdzWyBwcm9wZXJ0eSBhcyBzdHJpbmcgXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXAgICA6IHZhbHVlLm1hcC50b1N0cmluZygpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlZHVjZTogdmFsdWUucmVkdWNlICYmIHZhbHVlLnJlZHVjZS50b1N0cmluZygpXG4gICAgICAgICAgICAgICAgICAgICAgICB9O1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBGaWx0ZXJNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5maWx0ZXJzWyBwcm9wZXJ0eSBhcyBzdHJpbmcgXSA9IGRvY1sgcHJvcGVydHkgYXMga2V5b2YgVCBdLnRvU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBWYWxpZGF0ZURvY01ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnZhbGlkYXRlX2RvY191cGRhdGUgPSBkb2NbIHByb3BlcnR5IGFzIGtleW9mIFQgXS50b1N0cmluZygpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgYXdhaXQgdGhpcy5kYi51cHNlcnQ8YW55Pihkb2N1bWVudC5faWQsIGV4aXN0aW5nRG9jID0+IHtcbiAgICAgICAgICAgIGNvbnN0IHsgX2lkOiBfMSwgX3JldjogXzIsIC4uLmQxIH0gPSBkb2N1bWVudCBhcyBhbnk7XG4gICAgICAgICAgICBjb25zdCB7IF9pZDogXzMs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GlmKCFwcm9wZXJ0eUFubm90YXRpb24pIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgVW5rbm93biB2aWV3IFwiJHtuYW1lfVwiYCk7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGlmKCFvcHRpb25zKSB7XG4gICAgICAgICAgICBvcHRpb25zID0ge31cbiAgICAgICAgfVxuICAgICAgICBvcHRpb25zLmluY2x1ZGVfZG9jcyA9IHRydWU7XG4gICAgICAgIFxuICAgICAgICByZXR1cm4gYXdhaXQgUHJvbWlzZS5hbGwoKGF3YWl0IHRoaXMucmF3VmlldyhgJHtjbGFzc0Fubm90YXRpb24ubmFtZX0vJHtuYW1lfWAsIG9wdGlvbnMpKVxuICAgICAgICAgICAgLnJvd3MubWFwKHJvdyA9PiByb3cuZG9jISlcbiAgICAgICAgICAgIC5tYXAoYXN5bmMgZG9jID0+IHRoaXMuaHlkcmF0b3IuaHlkcmF0ZShPYmplY3QuY3JlYXRlKHRoaXMuZW50aXR5Q2xhc3MucHJvdG90eXBlKSwgZG9jLCB0aGlzLm1ldGFkYXRhLCB7XG4gICAgICAgICAgICAgICAgZGVwdGgsXG4gICAgICAgICAgICAgICAgY2lyY3VsYXJDYWNoZVxuICAgICAgICAgICAgfSkpXG4gICAgICAgIClcbiAgICB9XG4gICAgXG4gICAgcmF3VmlldzxSID0gVD4obmFtZSA6IHN0cmluZywgb3B0aW9ucz8gOiBQb3VjaERCLlF1ZXJ5Lk9wdGlvbnM8UiwgYW55Pikge1xuICAgICAgICByZXR1cm4gdGhpcy5kYi5xdWVyeShuYW1lLCBvcHRpb25zKTtcbiAgICB9XG59XG4iXX0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3NpdG9yeS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJyZXBvc2l0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFw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dGF0aW9ucyBdIG9mIHByb3BlcnR5QW5ub3RhdGlvbnMpIHtcbiAgICAgICAgICAgIGZvcihjb25zdCBhbm5vdGF0aW9uIG9mIGFubm90YXRpb25zKSB7XG4gICAgICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICAgICAgICAgICAgICBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgVmlld01ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlIDogYW55ID0gZG9jWyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF07XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHR5cGUgPSB0eXBlb2YgdmFsdWU7XG4gICAgXG4gICAgICAgICAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICAgICAgICAgIGlmKHR5cGUgPT09ICdzdHJpbmcnIHx8IHR5cGUgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnZpZXdzWyBwcm9wZXJ0eSBhcyBzdHJpbmcgXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXA6IHZhbHVlLnRvU3RyaW5nKClcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZih0eXBlID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQudmlld3NbIHByb3BlcnR5IGFzIHN0cmluZyBdID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcCAgIDogdmFsdWUubWFwLnRvU3RyaW5nKCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkdWNlOiB2YWx1ZS5yZWR1Y2UgJiYgdmFsdWUucmVkdWNlLnRvU3RyaW5nKClcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAg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bWV9LyR7bmFtZX1gLCBvcHRpb25zKSlcbiAgICAgICAgICAgIC5yb3dzLm1hcChyb3cgPT4gcm93LmRvYyEpXG4gICAgICAgICAgICAubWFwKGFzeW5jIGRvYyA9PiB0aGlzLmh5ZHJhdG9yLmh5ZHJhdGUoT2JqZWN0LmNyZWF0ZSh0aGlzLmVudGl0eUNsYXNzLnByb3RvdHlwZSksIGRvYywgdGhpcy5tZXRhZGF0YSwge1xuICAgICAgICAgICAgICAgIGRlcHRoLFxuICAgICAgICAgICAgICAgIGNpcmN1bGFyQ2FjaGVcbiAgICAgICAgICAgIH0pKVxuICAgICAgICApXG4gICAgfVxuICAgIFxuICAgIHJhd1ZpZXc8UiA9IFQ+KG5hbWUgOiBzdHJpbmcsIG9wdGlvbnM/IDogUG91Y2hEQi5RdWVyeS5PcHRpb25zPFQsIFI+KSA6IFByb21pc2U8UG91Y2hEQi5RdWVyeS5SZXNwb25zZTxSPj4ge1xuICAgICAgICByZXR1cm4gdGhpcy5kYi5xdWVyeShuYW1lLCBvcHRpb25zKTtcbiAgICB9XG59XG4iXX0=

@@ -48,3 +48,3 @@ /**

if (0 === entities.length) {
return [2 /*return*/, entities];
return [2 /*return*/, /** @type {?} */ (entities)];
}

@@ -85,3 +85,3 @@ return [4 /*yield*/, Promise.all(entities.map(function (entity) { return tslib_1.__awaiter(_this, void 0, void 0, function () {

});
return [2 /*return*/, entities];
return [2 /*return*/, /** @type {?} */ (entities)];
}

@@ -148,2 +148,2 @@ });

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVsay5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJidWxrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUN0QyxPQUFPLEVBQUUsU0FBUyxFQUFFLE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ZWQoZW50aXRpZXNbaW5kZXhdKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIG1hcmtJZFJldihlbnRpdGllc1tpbmRleF0sIHJlcyk7XG4gICAgICAgIH0pO1xuICAgICAgICBcbiAgICAgICAgcmV0dXJuIGVudGl0aWVzIGFzIChUICYgQWRhbWFudFJldk1ldGEgJiBBZGFtYW50RGVsZXRlZE1ldGEpW107XG4gICAgfVxuICAgIFxuICAgIGNyZWF0ZShlbnRpdGllcyA6IFRbXSkgOiBQcm9taXNlPChUICYgQWRhbWFudFJldk1ldGEpW10+IHtcbiAgICAgICAgcmV0dXJuIHRoaXMuYnVsayhlbnRpdGllcywgQnVsa09wZXJhdGlvbi5DcmVhdGUpO1xuICAgIH1cbiAgICBcbiAgICB1cGRhdGUoZW50aXRpZXMgOiBUW10pIDogUHJvbWlzZTwoVCAmIEFkYW1hbnRSZXZNZXRhKVtdPiB7XG4gICAgICAgIHJldHVybiB0aGlzLmJ1bGsoZW50aXRpZXMsIEJ1bGtPcGVyYXRpb24uVXBkYXRlKTtcbiAgICB9XG4gICAgXG4gICAgZGVsZXRlKGVudGl0aWVzIDogVFtdKSA6IFByb21pc2U8KFQgJiBBZGFtYW50UmV2TWV0YSAmIEFkYW1hbnREZWxldGVkTWV0YSlbXT4ge1xuICAgICAgICByZXR1cm4gdGhpcy5idWxrKGVudGl0aWVzLCBCdWxrT3BlcmF0aW9uLkRlbGV0ZSk7XG4gICAgfVxufVxuIl19

@@ -6,3 +6,3 @@ /**

import { Inject, Injectable, Injector } from '@angular/core';
import { AdamantRepository, equalCheckerFactory } from './repository';
import { AdamantRepository } from './repository';
import { Metadata } from './metadata';

@@ -15,57 +15,4 @@ import { Bulk } from './bulk';

import { ADAMANT_CONNECTION, ADAMANT_CONNECTION_FACTORY, ADAMANT_ENTITY_CLASS, ADAMANT_ENTITY_METADATA, ADAMANT_EQUAL_CHECKER, ADAMANT_ID } from './injector-tokens';
import { adamantIdFactory, equalCheckerFactory } from './factories';
/**
* @return {?}
*/
export function adamantIdFactory() {
return {
head: /**
* @param {?} name
* @return {?}
*/
function (name) {
return name + "_0";
},
tail: /**
* @param {?} name
* @return {?}
*/
function (name) {
return name + "_9";
},
build: /**
* @param {?} name
* @param {?} type
* @param {?} id
* @return {?}
*/
function (name, type, id) {
if (type === String) {
return name + "_2_" + id;
}
else if (type === Number) {
/** @type {?} */
var idStr = id.toString();
return name + "_1_" + '0'.repeat(16 - idStr.length) + idStr;
}
throw new Error("Invalid id type \"" + type + "\"");
},
parse: /**
* @param {?} id
* @return {?}
*/
function (id) {
/** @type {?} */
var match = /^(.*)_(1|2)_(.*)$/.exec(id);
if (!match) {
throw new TypeError("Invalid id \"" + id + "\"");
}
return {
name: /** @type {?} */ ((match[1])),
type: match[2] === '2' ? String : Number,
id: match[2] === '2' ? match[3] : Number.parseInt(match[3], 10)
};
}
};
}
/**
* @param {?} factory

@@ -241,2 +188,2 @@ * @return {?}

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29ubmVjdGlvbi1tYW5hZ2VyLmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5lb3Nrb3AvYWRhbWFudC8iLCJzb3VyY2VzIjpbImNvbm5lY3Rpb24tbWFuYWdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7O0FBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsUUFBUSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzdELE9BQU8sRUFDSCxpQkFBaUIsRUFBRSxtQkFBbUIsRUFDekMsTUFBTSxjQUFjLENBQUM7QUFFdEIsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLFlBQVksQ0FBQztBQUN0QyxPQUFPLEVBQUUsSUFBSSxFQUFFLE1BQU0sUUFBUSxDQUFDO0FBQzlCLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFDdEMsT0FBTyx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nVtYmVyIH0ge1xuICAgICAgICAgICAgY29uc3QgbWF0Y2ggPSAvXiguKilfKDF8MilfKC4qKSQvLmV4ZWMoaWQpO1xuICAgICAgICAgICAgXG4gICAgICAgICAgICBpZighbWF0Y2gpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgVHlwZUVycm9yKGBJbnZhbGlkIGlkIFwiJHtpZH1cImApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgXG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICAgIG5hbWU6IG1hdGNoWzFdISxcbiAgICAgICAgICAgICAgICB0eXBlOiBtYXRjaFsyXSA9PT0gJzInID8gU3RyaW5nIDogTnVtYmVyLFxuICAgICAgICAgICAgICAgIGlkOiBtYXRjaFsyXSA9PT0gJzInID8gbWF0Y2hbM10gOiBOdW1iZXIucGFyc2VJbnQobWF0Y2hbM10sIDEwKVxuICAgICAgICAgICAgfTtcbiAgICAgICAgfVxuICAgIH1cbn1cblxuXG5leHBvcnQgZnVuY3Rpb24gY3JlYXRlQWRhbWFudENvbm5lY3Rpb24oZmFjdG9yeSA6IENvbm5lY3Rpb25GYWN0b3J5KSA6IEFkYW1hbnRDb25uZWN0aW9uTWFuYWdlciB7XG4gICAgY29uc3QgaW5qZWN0b3IgPSBJbmplY3Rvci5jcmVhdGUoe1xuICAgICAgICBwcm92aWRlcnM6IFtcbiAgICAgICAgICAgIHsgcHJvdmlkZTogQURBTUFOVF9DT05ORUNUSU9OX0ZBQ1RPUlksIHVzZVZhbHVlOiBmYWN0b3J5IH0sXG4gICAgICAgICAgICB7IHByb3ZpZGU6IEFkYW1hbnRDb25uZWN0aW9uTWFuYWdlciwgZGVwczogWyBBREFNQU5UX0NPTk5FQ1RJT05fRkFDVE9SWSwgQURBTUFOVF9JRCwgSW5qZWN0b3IgXSB9LFxuICAgICAgICAgICAgeyBwcm92aWRlOiBBREFNQU5UX0lELCB1c2VGYWN0b3J5OiBhZGFtYW50SWRGYWN0b3J5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Gl0eUNsYXNzIDogQ3RvcjxUPikgOiBNZXRhZGF0YTxUPiB7XG4gICAgICAgIHJldHVybiBuZXcgTWV0YWRhdGE8VD4oZW50aXR5Q2xhc3MpO1xuICAgIH1cbn1cbiJdfQ==

@@ -46,6 +46,6 @@ /**

if (options && options.includeRev) {
doc._rev = (/** @type {?} */ (entity))._rev;
doc._rev = entity._rev;
}
if (metadata.attachments && (/** @type {?} */ (entity))._attachments) {
doc._attachments = (/** @type {?} */ (entity))._attachments;
if (metadata.attachments && entity._attachments) {
doc._attachments = entity._attachments;
}

@@ -55,2 +55,3 @@ var _loop_1 = function (property, annotation) {

var value = entity[/** @type {?} */ (property)];
/* instanbul ignore else */
if (annotation instanceof RelationMetadata) {

@@ -60,2 +61,3 @@ if (value != null) {

var relationMetadata_1 = this_1.connectionManager.getMetadata(annotation.type);
/* istanbul ignore else */
if (annotation instanceof BelongsToMetadata) {

@@ -250,3 +252,3 @@ doc[property] = relationToId(value, relationMetadata_1, this_1.id);

return [7 /*endfinally*/];
case 8: return [2 /*return*/, entity];
case 8: return [2 /*return*/, /** @type {?} */ (entity)];
}

@@ -327,2 +329,2 @@ });

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHlkcmF0b3ItaW1wbC5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJoeWRyYXRvci1pbXBsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLGdCQUFnQixFQUFRLE1BQU0sd0JBQXdCLENBQUM7QUFDaEUsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ3RELE9BQU8sRUFBRSxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBQ2hFLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDMUMsT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25NYW5hZ2VyKSB7XG4gICAgICAgIHN1cGVyKCk7XG4gICAgfVxuICAgIFxuICAgIGRlaHlkcmF0ZTxUPihlbnRpdHkgOiBULCBtZXRhZGF0YSA6IE1ldGFkYXRhPFQ+LCBvcHRpb25zPyA6IHsgaW5jbHVkZVJldj8gOiBib29sZWFuIH0pIDogUG91Y2hEQi5Db3JlLkRvY3VtZW50PFQ+ICYgUGFydGlhbDxQb3VjaERCLkNvcmUuUmV2aXNpb25JZE1ldGE+IHtcbiAgICAgICAgY29uc3QgZG9jIDogYW55ID0ge307XG4gICAgICAgIFxuICAgICAgICBpZihvcHRpb25zICYmIG9wdGlvbnMuaW5jbHVkZVJldikge1xuICAgICAgICAgICAgZG9jLl9yZXYgPSAoZW50aXR5IGFzIGFueSkuX3JldjtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgaWYobWV0YWRhdGEuYXR0YWNobWVudHMgJiYgKGVudGl0eSBhcyBhbnkpLl9hdHRhY2htZW50cykge1xuICAgICAgICAgICAgZG9jLl9hdHRhY2htZW50cyA9IChlbnRpdHkgYXMgYW55KS5fYXR0YWNobWVudHM7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGZvcihjb25zdCBbIHByb3BlcnR5LCBhbm5vdGF0aW9uIF0gb2YgbWV0YWRhdGEucHJvcGVydGllcykge1xuICAgICAgICAgICAgY29uc3QgdmFsdWUgOiBhbnkgPSBlbnRpdHlbIHByb3BlcnR5IGFzIGtleW9mIFQgXTtcbiAgICAgICAgICAgIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBSZWxhdGlvbk1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgaWYodmFsdWUgIT0gbnVsbCkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCByZWxhdGlvbk1ldGFkYXRhID0gdGhpcy5jb25uZWN0aW9uTWFuYWdlci5nZXRNZXRhZGF0YShhbm5vdGF0aW9uLnR5cGUpO1xuICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIEJlbG9uZ3NUb01ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2NbIHByb3BlcnR5IF0gPSByZWxhdGlvblRvSWQodmFsdWUsIHJlbGF0aW9uTWV0YWRhdGEsIHRoaXMuaWQpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIEhhc01hbnlNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9jWyBwcm9wZXJ0eSBdID0gKHZhbHVlIGFzIGFueVtdKS5tYXAocmVsID0+IHJlbGF0aW9uVG9JZChyZWwsIHJlbGF0aW9uTWV0YWRhdGEsIHRoaXMuaWQpKTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBIYXNNYW55TWFwTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlbCA6IGFueSA9IHt9O1xuICAgICAgICAgICAgICAgICAgICAgICAgZm9yKGNvbnN0IGtleSBpbiB2YWx1ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbFsga2V5IF0gPSByZWxhdGlvblRvSWQodmFsdWVbIGtleSBdLCByZWxhdGlvbk1ldGFkYXRhLCB0aGlzLmlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY1sgcHJvcGVydHkgXSA9IHJlbDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBJbmxpbmVNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9jWyBwcm9wZXJ0eSBdID0gdGhpcy5jb25uZWN0aW9uTWFuYWdlci5nZXRSZXBvc2l0b3J5KGFubm90YXRpb24udH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pb25SZXBvc2l0b3J5ID0gdGhpcy5jb25uZWN0aW9uTWFuYWdlci5nZXRSZXBvc2l0b3J5KGFubm90YXRpb24udHlwZSk7XG4gICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgQmVsb25nc1RvTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVudGl0eVsgcHJvcGVydHkgYXMga2V5b2YgVCBdID0gY2lyY3VsYXJDYWNoZS5oYXNPd25Qcm9wZXJ0eSh2YWx1ZSkgPyBjaXJjdWxhckNhY2hlW3ZhbHVlXSA6IGF3YWl0IHJlbGF0aW9uUmVwb3NpdG9yeVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5fcmVhZCh2YWx1ZSwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZXB0aDogZGVwdGggLSAxLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaXJjdWxhckNhY2hlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgSGFzTWFueU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRpdHlbIHByb3BlcnR5IGFzIGtleW9mIFQgXSA9IGF3YWl0IHJlYWRBbGxXaXRoQ2lyY3VsYXJDYWNoZShyZWxhdGlvblJlcG9zaXRvcnksIHZhbHVlLCBkZXB0aCAtIDEsIGNpcmN1bGFyQ2FjaGUpIGFzIGFueTtcbiAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIEhhc01hbnlNYXBNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qga2V5cyA9IE9iamVjdC5rZXlzKHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHZhbHVlcyA9IGtleXMubWFwKGsgPT4gdmFsdWVbIGsgXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGVudGl0aWVzID0gYXdhaXQgcmVhZEFsbFdpdGhDaXJjdWxhckNhY2hlKHJlbGF0aW9uUmVwb3NpdG9yeSwgdmFsdWVzLCBkZXB0aCAtIDEsIGNpcmN1bGFyQ2FjaGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVsIDogYW55ID0ge307XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IoY29uc3Qga2V5IG9mIGtleXMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWxbIGtleSBdID0gZW50aXRpZXMuZmluZChlID0+IGUuX2lkID09PSB2YWx1ZVsga2V5IF0pO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZW50aXR5WyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF0gPSByZWw7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgSW5saW5lTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVudGl0eVsgcHJvcGVydHkgYXMga2V5b2YgVCBdID0gYXdhaXQgcmVsYXRpb25SZXBvc2l0b3J5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmh5ZHJhdG9yLmh5ZHJhdGUocmVsYXRpb25SZXBvc2l0b3J5LmJ1aWxkKCksIHZhbHVlLCByZWxhdGlvbk1ldGFkYXRhKVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBQcm9wZXJ0eU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGRlc2Ny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plY3QoQURBTUFOVF9JRCkgcHJvdGVjdGVkIHJlYWRvbmx5IGlkIDogQWRhbWFudElkLFxuICAgICAgICAgICAgICAgIHByb3RlY3RlZCByZWFkb25seSBjb25uZWN0aW9uTWFuYWdlciA6IEFkYW1hbnRDb25uZWN0aW9uTWFuYWdlcikge1xuICAgICAgICBzdXBlcigpO1xuICAgIH1cbiAgICBcbiAgICBkZWh5ZHJhdGU8VD4oZW50aXR5IDogVCAmIEFkYW1hbnRFbnRpdHlNZXRhLCBtZXRhZGF0YSA6IE1ldGFkYXRhPFQ+LCBvcHRpb25zPyA6IHsgaW5jbHVkZVJldj8gOiBib29sZWFuIH0pIDogUG91Y2hEQi5Db3JlLkRvY3VtZW50PFQ+ICYgUGFydGlhbDxQb3VjaERCLkNvcmUuUmV2aXNpb25JZE1ldGE+IHtcbiAgICAgICAgY29uc3QgZG9jIDogYW55ID0ge307XG4gICAgICAgIFxuICAgICAgICBpZihvcHRpb25zICYmIG9wdGlvbnMuaW5jbHVkZVJldikge1xuICAgICAgICAgICAgZG9jLl9yZXYgPSBlbnRpdHkuX3JldjtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgaWYobWV0YWRhdGEuYXR0YWNobWVudHMgJiYgZW50aXR5Ll9hdHRhY2htZW50cykge1xuICAgICAgICAgICAgZG9jLl9hdHRhY2htZW50cyA9IGVudGl0eS5fYXR0YWNobWVudHM7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGZvcihjb25zdCBbIHByb3BlcnR5LCBhbm5vdGF0aW9uIF0gb2YgbWV0YWRhdGEucHJvcGVydGllcykge1xuICAgICAgICAgICAgY29uc3QgdmFsdWUgOiBhbnkgPSBlbnRpdHlbIHByb3BlcnR5IGFzIGtleW9mIFQgXTtcbiAgICAgICAgICAgIC8qIGluc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgICAgICAgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIFJlbGF0aW9uTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICBpZih2YWx1ZSAhPSBudWxsKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlbGF0aW9uTWV0YWRhdGEgPSB0aGlzLmNvbm5lY3Rpb25NYW5hZ2VyLmdldE1ldGFkYXRhKGFubm90YXRpb24udHlwZSk7XG4gICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgICAgICAgICAgICAgICBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgQmVsb25nc1RvTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY1sgcHJvcGVydHkgXSA9IHJlbGF0aW9uVG9JZCh2YWx1ZSwgcmVsYXRpb25NZXRhZGF0YSwgdGhpcy5pZCk7XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgSGFzTWFueU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2NbIHByb3BlcnR5IF0gPSAodmFsdWUgYXMgYW55W10pLm1hcChyZWwgPT4gcmVsYXRpb25Ub0lkKHJlbCwgcmVsYXRpb25NZXRhZGF0YSwgdGhpcy5pZCkpO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIEhhc01hbnlNYXBNZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVsIDogYW55ID0ge307XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IoY29uc3Qga2V5IGluIHZhbHVlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVsWyBrZXkgXSA9IHJlbGF0aW9uVG9JZCh2YWx1ZVsga2V5IF0sIHJlbGF0aW9uTWV0YWRhdGEsIHRoaXMuaWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgZG9jWyBwcm9wZXJ0eSBdID0gcmVsO1xuICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIElubGluZU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2NbIHByb3BlcnR5IF0gPSB0aGlzLmNvbm5lY3Rpb25NYW5hZ2VyLmdldFJlcG9zaXRvcnkoYW5ub3RhdGlvbi50eXBlKS5oeWRyYXRvci5kZWh5ZHJhdGUodmFsdWUsIHJlbGF0aW9uTWV0YWRhdGEpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBQcm9wZXJ0eU1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgZG9jWyBwcm9wZXJ0eSBdID0gdmFsdWU7XG4gICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIElkTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9jLl9pZCA9IHRoaXMuaWQuYnVpbGQobWV0YWRhdGEubmFtZSEsIG1ldGFkYXRhLmlkVHlwZSwgdmFsdWUgYXMgYW55KTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGlmKHVuZGVmaW5lZCA9PT0gZG9jWyBwcm9wZXJ0eSBdKSB7XG4gICAgICAgICAgICAgICAgZGVsZXRlIGRvY1sgcHJvcGVydHkgXTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgcmV0dXJuIGRvYyBhcyBQb3VjaERCLkNvcmUuRG9jdW1lbnQ8VD4gJiBQYXJ0aWFsPFBvdWNoREIuQ29yZS5SZXZpc2lvbklkTWV0YT47XG4gICAgfV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XMga2V5b2YgVCBdID0gbnVsbCE7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICAgICAgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIFJlbGF0aW9uTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVsYXRpb25NZXRhZGF0YSA9IHRoaXMuY29ubmVjdGlvbk1hbmFnZXIuZ2V0TWV0YWRhdGEoYW5ub3RhdGlvbi50eXBlKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVsYXRpb25SZXBvc2l0b3J5ID0gdGhpcy5jb25uZWN0aW9uTWFuYWdlci5nZXRSZXBvc2l0b3J5KGFubm90YXRpb24udHlwZSk7XG4gICAgXG4gICAgICAgICAgICAgICAgICAgIC8qIGlzdGFuYnVsIGlnbm9yZSBlbHNlICovXG4gICAgICAgICAgICAgICAgICAgIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBCZWxvbmdzVG9NZXRhZGF0YSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZW50aXR5WyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF0gPSBjaXJjdWxhckNhY2hlLmhhc093blByb3BlcnR5KHZhbHVlKSA/IGNpcmN1bGFyQ2FjaGVbdmFsdWVdIDogYXdhaXQgcmVsYXRpb25SZXBvc2l0b3J5XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLl9yZWFkKHZhbHVlLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlcHRoOiBkZXB0aCAtIDEsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNpcmN1bGFyQ2FjaGVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBIYXNNYW55TWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGVudGl0eVsgcHJvcGVydHkgYXMga2V5b2YgVCBdID0gYXdhaXQgcmVhZEFsbFdpdGhDaXJjdWxhckNhY2hlKHJlbGF0aW9uUmVwb3NpdG9yeSwgdmFsdWUsIGRlcHRoIC0gMSwgY2lyY3VsYXJDYWNoZSkgYXMgYW55O1xuICAgICAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgSGFzTWFueU1hcE1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXlzID0gT2JqZWN0LmtleXModmFsdWUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsdWVzID0ga2V5cy5tYXAoayA9PiB2YWx1ZVsgayBdKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIFxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZW50aXRpZXMgPSBhd2FpdCByZWFkQWxsV2l0aENpcmN1bGFyQ2FjaGUocmVsYXRpb25SZXBvc2l0b3J5LCB2YWx1ZXMsIGRlcHRoIC0gMSwgY2lyY3VsYXJDYWNoZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCByZWwgOiBhbnkgPSB7fTtcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvcihjb25zdCBrZXkgb2Yga2V5cykge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlbFsga2V5IF0gPSBlbnRpdGllcy5maW5kKGUgPT4gZS5faWQgPT09IHZhbHVlWyBrZXkgXSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRpdHlbIHByb3BlcnR5IGFzIGtleW9mIFQgXSA9IHJlbDtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBJbmxpbmVNZXRhZ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OiB7IGluY2x1ZGVSZXY/IDogYm9vbGVhbiB9KSA6IFBvdWNoREIuQ29yZS5Eb2N1bWVudDxUPiAmIFBhcnRpYWw8UG91Y2hEQi5Db3JlLlJldmlzaW9uSWRNZXRhPjtcbn1cblxuXG4iXX0=

@@ -19,3 +19,4 @@ /**

export { BulkOperation, Bulk } from './bulk';
export { adamantIdFactory, createAdamantConnection, AdamantConnectionManager } from './connection-manager';
export { createAdamantConnection, AdamantConnectionManager } from './connection-manager';
export { equalCheckerFactory, adamantIdFactory } from './factories';
export { Hydrator } from './hydrator';

@@ -26,6 +27,6 @@ export { HydratorImpl } from './hydrator-impl';

export { QueryBuilder } from './query-builder';
export { equalCheckerFactory, AdamantRepository } from './repository';
export { AdamantRepository } from './repository';
export { Validator } from './validator';
export { ValidatorImpl } from './validator-impl';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AbmVvc2tvcC9hZGFtYW50LyIsInNvdXJjZXMiOlsiaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLDZDQUFjLDBCQUEwQixDQUFDO0FBQ3pDLDZDQUFjLDBCQUEwQixDQUFDO0FBQ3pDLHVDQUFjLHNCQUFzQixDQUFDO0FBQ3JDLHVDQUFjLHNCQUFzQixDQUFDO0FBQ3JDLHlDQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLCtDQUFjLDRCQUE0QixDQUFDO0FBQzNDLDJDQUFjLGtCQUFrQixDQUFDO0FBQ2pDLHVDQUFjLHNCQUFzQixDQUFDO0FBQ3JDLG1EQUFjLDZCQUE2QixDQUFDO0FBQzVDLDJDQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGlDQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGlEQUFjLDRCQUE0QixDQUFDO0FBQzNDLG1DQUFjLG9CQUFvQixDQUFDO0FBRW5DLG9DQUFj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aW9uLW1hbmFnZXInO1xuZXhwb3J0ICogZnJvbSAnLi9mYWN0b3JpZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9oeWRyYXRvcic7XG5leHBvcnQgKiBmcm9tICcuL2h5ZHJhdG9yLWltcGwnO1xuZXhwb3J0ICogZnJvbSAnLi9pbmplY3Rvci10b2tlbnMnO1xuZXhwb3J0ICogZnJvbSAnLi9tZXRhLWludGVyZmFjZXMnO1xuZXhwb3J0ICogZnJvbSAnLi9tZXRhZGF0YSc7XG5leHBvcnQgKiBmcm9tICcuL3F1ZXJ5LWJ1aWxkZXInO1xuZXhwb3J0ICogZnJvbSAnLi9yZXBvc2l0b3J5JztcbmV4cG9ydCAqIGZyb20gJy4vdmFsaWRhdG9yJztcbmV4cG9ydCAqIGZyb20gJy4vdmFsaWRhdG9yLWltcGwnO1xuIl19

@@ -8,4 +8,4 @@ /**

*/
export { BelongsTo, BelongsToMetadata, DesignDoc, DesignDocMetadata, Entity, EntityMetadata, Filter, FilterMetadata, HasMany, HasManyMetadata, HasManyMap, HasManyMapMetadata, Id, IdStrategy, IdMetadata, Inline, InlineMetadata, InlineEntity, InlineEntityMetadata, Property, PropertyMetadata, RelationMetadata, ValidateDoc, ValidateDocMetadata, View, ViewMetadata, BulkOperation, Bulk, adamantIdFactory, createAdamantConnection, AdamantConnectionManager, Hydrator, HydratorImpl, ADAMANT_CONNECTION, ADAMANT_ENTITY_CLASS, ADAMANT_ENTITY_METADATA, ADAMANT_EQUAL_CHECKER, ADAMANT_CONNECTION_FACTORY, ADAMANT_ID, Metadata, QueryBuilder, equalCheckerFactory, AdamantRepository, Validator, ValidatorImpl } from './index';
export { BelongsTo, BelongsToMetadata, DesignDoc, DesignDocMetadata, Entity, EntityMetadata, Filter, FilterMetadata, HasMany, HasManyMetadata, HasManyMap, HasManyMapMetadata, Id, IdStrategy, IdMetadata, Inline, InlineMetadata, InlineEntity, InlineEntityMetadata, Property, PropertyMetadata, RelationMetadata, ValidateDoc, ValidateDocMetadata, View, ViewMetadata, BulkOperation, Bulk, createAdamantConnection, AdamantConnectionManager, equalCheckerFactory, adamantIdFactory, Hydrator, HydratorImpl, ADAMANT_CONNECTION, ADAMANT_ENTITY_CLASS, ADAMANT_ENTITY_METADATA, ADAMANT_EQUAL_CHECKER, ADAMANT_CONNECTION_FACTORY, ADAMANT_ID, Metadata, QueryBuilder, AdamantRepository, Validator, ValidatorImpl } from './index';
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmVvc2tvcC1hZGFtYW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vQG5lb3Nrb3AvYWRhbWFudC8iLCJzb3VyY2VzIjpbIm5lb3Nrb3AtYWRhbWFudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7O0FBSUEsK3JCQUFjLFNBQVMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9pbmRleCc7XG5cbmV4cG9ydCB7Q3RvciBhcyDJtWF9IGZyb20gJy4vdXRpbHMvbWV0YWRhdGEnOyJdfQ==

@@ -13,3 +13,2 @@ /**

import { markDeleted, markIdRev } from './utils/marks';
import * as equal from 'fast-deep-equal';
import { ReadQueryBatcher } from './read-query-batcher';

@@ -23,8 +22,2 @@ import { QueryBuilder } from './query-builder';

/**
* @return {?}
*/
export function equalCheckerFactory() {
return equal;
}
/**
* @template T

@@ -65,3 +58,3 @@ */

markIdRev(entity, result);
return [2 /*return*/, entity];
return [2 /*return*/, /** @type {?} */ (entity)];
}

@@ -92,3 +85,3 @@ });

markIdRev(entity, result);
return [2 /*return*/, entity];
return [2 /*return*/, /** @type {?} */ (entity)];
}

@@ -143,3 +136,3 @@ });

markIdRev(entity, result);
return [2 /*return*/, entity];
return [2 /*return*/, /** @type {?} */ (entity)];
}

@@ -172,3 +165,3 @@ });

markDeleted(entity);
return [2 /*return*/, entity];
return [2 /*return*/, /** @type {?} */ (entity)];
}

@@ -421,5 +414,7 @@ });

annotation = annotations_1_1.value;
/* istanbul ignore else */
if (annotation instanceof ViewMetadata) {
value = doc[/** @type {?} */ (property)];
type = typeof value;
/* istanbul ignore else */
if (type === 'string' || type === 'function') {

@@ -494,3 +489,3 @@ document.views[/** @type {?} */ (property)] = {

return tslib_1.__awaiter(this, void 0, void 0, function () {
var classAnnotation, propertyAnnotation, _b, _c;
var classAnnotation, propertyAnnotations, _b, _c;
var _this = this;

@@ -507,9 +502,6 @@ return tslib_1.__generator(this, function (_d) {

}
propertyAnnotation = getPropertyMetadata(designDoc, /** @type {?} */ (name), ViewMetadata);
if (!propertyAnnotation) {
propertyAnnotations = getPropertyMetadata(designDoc, /** @type {?} */ (name), ViewMetadata);
if (0 === propertyAnnotations.length) {
throw new Error("Unknown view \"" + name + "\"");
}
if (!options) {
options = {};
}
options.include_docs = true;

@@ -586,2 +578,2 @@ _c = (_b = Promise).all;

//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3NpdG9yeS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJyZXBvc2l0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUN4QyxPQUFPLEVBQVEsc0JBQXNCLEVBQUUsZ0JBQWdCLEVBQUUsbUJBQW1CLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDakgsT0FBTyxFQUFrQixRQUFRLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFDdEQsT0FBTyxFQUFFL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HsgWyBrZXkgOiBzdHJpbmcgXSA6IHN0cmluZyB9O1xuICAgICAgICAgICAgdmFsaWRhdGVfZG9jX3VwZGF0ZT8gOiBzdHJpbmc7XG4gICAgICAgIH0gPSB7XG4gICAgICAgICAgICBfaWQgICAgOiBgX2Rlc2lnbi8ke2NsYXNzQW5ub3RhdGlvbnNbIDAgXS5uYW1lfWAsXG4gICAgICAgICAgICB2aWV3cyAgOiB7fSxcbiAgICAgICAgICAgIGZpbHRlcnM6IHt9XG4gICAgICAgIH07XG4gICAgICAgIFxuICAgICAgICBmb3IoY29uc3QgWyBwcm9wZXJ0eSwgYW5ub3RhdGlvbnMgXSBvZiBwcm9wZXJ0eUFubm90YXRpb25zKSB7XG4gICAgICAgICAgICBmb3IoY29uc3QgYW5ub3RhdGlvbiBvZiBhbm5vdGF0aW9ucykge1xuICAgICAgICAgICAgICAgIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBWaWV3TWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgOiBhbnkgPSBkb2NbIHByb3BlcnR5IGFzIGtleW9mIFQgXTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdHlwZSA9IHR5cGVvZiB2YWx1ZTtcbiAgICAgICAgICAgICAgICAgICAgXG4gICAgICAgICAgICAgICAgICAgIGlmKHR5cGUgPT09ICdzdHJpbmcnIHx8IHR5cGUgPT09ICdmdW5jdGlvbicpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LnZpZXdzWyBwcm9wZXJ0eSBhcyBzdHJpbmcgXSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYXA6IHZhbHVlLnRvU3RyaW5nKClcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZih0eXBlID09PSAnb2JqZWN0Jykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQudmlld3NbIHByb3BlcnR5IGFzIHN0cmluZyBdID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcCAgIDogdmFsdWUubWFwLnRvU3RyaW5nKCksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVkdWNlOiB2YWx1ZS5yZWR1Y2UgJiYgdmFsdWUucmVkdWNlLnRvU3RyaW5nKClcbiAgICAgICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIEZpbHRlck1ldGFkYXRhKSB7XG4gICAgICAgICAgICAgICAgICAgIGRvY3VtZW50LmZpbHRlcnNbIHByb3BlcnR5IGFzIHN0cmluZyBdID0gZG9jWyBwcm9wZXJ0eSBhcyBrZXlvZiBUIF0udG9TdHJpbmcoKTtcbiAgICAgICAgICAgICAgICB9IGVsc2UgaWYoYW5ub3RhdGlvbiBpbnN0YW5jZW9mIFZhbGlkYXRlRG9jTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQudmFsaWRhdGVfZG9jX3VwZGF0ZSA9IGRvY1sgcHJvcGVydHkgYXMga2V5b2YgVCBdLnRvU3RyaW5nKCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICBhd2FpdCB0aGlzLmRiLnVwc2VydDxhbnk+KGRvY3VtZW50Ll9pZCwgZXhpc3RpbmdEb2MgPT4ge1xuICAgICAgICAgICAgY29uc3QgeyBfaWQ6IF8xLCBfcmV2OiBfMiwgLi4uZDEgfSA9IGRvY3VtZW50IGFzIGFueTtcbiAgICAgICAgICAgIGNvbnN0IHsgX2lkOiBfMywgX3JldjogXzQsIC4uLmQyIH0gPSBleGlzdGluZ0RvYyBhcyBhbnk7XG4gICAgICAgICAgICBcbiAgICAgICAgICAgIGlmKHRoaXMuZXF1YWwoZDEsIGQyKSkge1xuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIFxuICAgICAgICAgICAgcmV0dXJuIGRvY3VtZW50O1xuICAgICAgICB9KTtcbiAgICB9XG4gICAgXG4gICAgYXN5bmMgdmlldzxULCBQIGV4dGVuZHMga2V5b2YgVD4oZGVzaWduRG9jIDogQ3RvcjxUPiwgbmFtZSA6IFAsIHsgZGVwdGgsIGNpcmN1bGFyQ2FjaGUsIC4uLm9wdGlvbnMgfSA6IEh5ZHJhdGVPcHRpb25zICYgUG91Y2hEQi5RdWVyeS5PcHRpb25zPFQsIGFueT4gPSB7fSkge1xuICAgICAgICBjb25zdCBjbGFzc0Fubm90YXRpb24gPSBnZXRDbGFzc01ldGFkYXRhKGRlc2lnbkRvYywgRGVzaWduRG9jTWV0YWRhdGEpWyAwIF07XG4gICAgICAgIFxuICAgICAgICBpZighY2xhc3NBbm5vdGF0aW9uKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYERlc2lnbiBkb2MgYW5ub3RhdGlvbiByZXF1aXJlZGApO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICBpZihjbGFzc0Fubm90YXRpb24uZW50aXR5ICE9PSB0aGlzLmVudGl0eUNsYXNzKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgZGVzaWduIGRvYyBlbnRpdHlgKTtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgY29uc3QgcHJvcGVydHlBbm5vdGF0aW9uID0gZ2V0UHJvcGVydHlNZXRhZGF0YShkZXNpZ25Eb2MsIG5hbWUgYXMgc3RyaW5nLCBWaWV3TWV0YWRhdGEpO1xuICAgICAgICBcbiAgICAgICAgaWYoIXByb3BlcnR5QW5ub3RhdGlvbikge1xuICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKGBVbmtub3duIHZpZXcgXCIke25hbWV9XCJgKTtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgaWYoIW9wdGlvbnMpIHtcbiAgICAgICAgICAgIG9wdGlvbnMgPSB7fVxuICAgICAgICB9XG4gICAgICAgIG9wdGlvbnMuaW5jbHVkZV9kb2NzID0gdHJ1ZTtcbiAgICAgICAgXG4gICAgICAgIHJldHVybiBhd2FpdCBQcm9taXNlLmFsbCgoYXdhaXQgdGhpcy5yYXdWaWV3KGAke2NsYXNzQW5ub3RhdGlvbi5uYW1lfS8ke25hbWV9YCwgb3B0aW9ucykpXG4gICAgICAgICAgICAucm93cy5tYXAocm93ID0+IHJvdy5kb2MhKVxuICAgICAgICAgICAgLm1hcChhc3luYyBkb2MgPT4gdGhpcy5oeWRyYXRvci5oeWRyYXRlKE9iamVjdC5jcmVhdGUodGhpcy5lbnRpdHlDbGFzcy5wcm90b3R5cGUpLCBkb2MsIHRoaXMubWV0YWRhdGEsIHtcbiAgICAgICAgICAgICAgICBkZXB0aCxcbiAgICAgICAgICAgICAgICBjaXJjdWxhckNhY2hlXG4gICAgICAgICAgICB9KSlcbiAgICAgICAgKVxuICAgIH1cbiAgICBcbiAgICByYXdWaWV3PFIgPSBUPihuYW1lIDogc3RyaW5nLCBvcHRpb25zPyA6IFBvdWNoREIuUXVlcnkuT3B0aW9uczxSLCBhbnk+KSB7XG4gICAgICAgIHJldHVybiB0aGlzLmRiLnF1ZXJ5KG5hbWUsIG9wdGlvbnMpO1xuICAgIH1cbn1cbiJdfQ==
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVwb3NpdG9yeS5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0BuZW9za29wL2FkYW1hbnQvIiwic291cmNlcyI6WyJyZXBvc2l0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7O0FBQUEsT0FBTyxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDbkQsT0FBTyxFQUFFLFNBQ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vY01ldGFkYXRhPihkb2MuY29uc3RydWN0b3IpO1xuICAgICAgICBcbiAgICAgICAgaWYoMSAhPT0gY2xhc3NBbm5vdGF0aW9ucy5sZW5ndGgpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgRGVzaWduIGRvYyBhbm5vdGF0aW9uIHJlcXVpcmVkYCk7XG4gICAgICAgIH1cbiAgICAgICAgXG4gICAgICAgIGlmKGNsYXNzQW5ub3RhdGlvbnNbIDAgXS5lbnRpdHkgIT09IHRoaXMuZW50aXR5Q2xhc3MpIHtcbiAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihgSW52YWxpZCBkZXNpZ24gZG9jIGVudGl0eWApO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICBsZXQgZG9jdW1lbnQgOiB7XG4gICAgICAgICAgICBfaWQgOiBzdHJpbmc7XG4gICAgICAgICAgICB2aWV3cyA6IHsgWyBrZXkgOiBzdHJpbmcgXSA6IHsgbWFwIDogc3RyaW5nLCByZWR1Y2U/IDogc3RyaW5nIH0gfTtcbiAgICAgICAgICAgIGZpbHRlcnMgOiB7IFsga2V5IDogc3RyaW5nIF0gOiBzdHJpbmcgfTtcbiAgICAgICAgICAgIHZhbGlkYXRlX2RvY191cGRhdGU/IDogc3RyaW5nO1xuICAgICAgICB9ID0ge1xuICAgICAgICAgICAgX2lkICAgIDogYF9kZXNpZ24vJHtjbGFzc0Fubm90YXRpb25zWyAwIF0ubmFtZX1gLFxuICAgICAgICAgICAgdmlld3MgIDoge30sXG4gICAgICAgICAgICBmaWx0ZXJzOiB7fVxuICAgICAgICB9O1xuICAgICAgICBcbiAgICAgICAgZm9yKGNvbnN0IFsgcHJvcGVydHksIGFubm90YXRpb25zIF0gb2YgcHJvcGVydHlBbm5vdGF0aW9ucykge1xuICAgICAgICAgICAgZm9yKGNvbnN0IGFubm90YXRpb24gb2YgYW5ub3RhdGlvbnMpIHtcbiAgICAgICAgICAgICAgICAvKiBpc3RhbmJ1bCBpZ25vcmUgZWxzZSAqL1xuICAgICAgICAgICAgICAgIGlmKGFubm90YXRpb24gaW5zdGFuY2VvZiBWaWV3TWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdmFsdWUgOiBhbnkgPSBkb2NbIHByb3BlcnR5IGFzIGtleW9mIFQgXTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgdHlwZSA9IHR5cGVvZiB2YWx1ZTtcbiAgICBcbiAgICAgICAgICAgICAgICAgICAgLyogaXN0YW5idWwgaWdub3JlIGVsc2UgKi9cbiAgICAgICAgICAgICAgICAgICAgaWYodHlwZSA9PT0gJ3N0cmluZycgfHwgdHlwZSA9PT0gJ2Z1bmN0aW9uJykge1xuICAgICAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQudmlld3NbIHByb3BlcnR5IGFzIHN0cmluZyBdID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1hcDogdmFsdWUudG9TdHJpbmcoKVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfSBlbHNlIGlmKHR5cGUgPT09ICdvYmplY3QnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC52aWV3c1sgcHJvcGVydHkgYXMgc3RyaW5nIF0gPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbWFwICAgOiB2YWx1ZS5tYXAudG9TdHJpbmcoKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICByZWR1Y2U6IHZhbHVlLnJlZHVjZSAmJiB2YWx1ZS5yZWR1Y2UudG9TdHJpbmcoKVxuICAgICAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0gZWxzZSBpZihhbm5vdGF0aW9uIGluc3RhbmNlb2YgRmlsdGVyTWV0YWRhdGEpIHtcbiAgICAgICAgICAgICAgICAgICAgZG9jdW1lbnQuZmlsdGVyc1sgcHJvc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V2TWV0YSlbXT4ge1xuICAgICAgICBjb25zdCBjbGFzc0Fubm90YXRpb24gPSBnZXRDbGFzc01ldGFkYXRhKGRlc2lnbkRvYywgRGVzaWduRG9jTWV0YWRhdGEpWyAwIF07XG4gICAgICAgIFxuICAgICAgICBpZighY2xhc3NBbm5vdGF0aW9uKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYERlc2lnbiBkb2MgYW5ub3RhdGlvbiByZXF1aXJlZGApO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICBpZihjbGFzc0Fubm90YXRpb24uZW50aXR5ICE9PSB0aGlzLmVudGl0eUNsYXNzKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYEludmFsaWQgZGVzaWduIGRvYyBlbnRpdHlgKTtcbiAgICAgICAgfVxuICAgICAgICBcbiAgICAgICAgY29uc3QgcHJvcGVydHlBbm5vdGF0aW9ucyA9IGdldFByb3BlcnR5TWV0YWRhdGEoZGVzaWduRG9jLCBuYW1lIGFzIHN0cmluZywgVmlld01ldGFkYXRhKTtcbiAgICAgICAgXG4gICAgICAgIGlmKDAgPT09IHByb3BlcnR5QW5ub3RhdGlvbnMubGVuZ3RoKSB7XG4gICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFVua25vd24gdmlldyBcIiR7bmFtZX1cImApO1xuICAgICAgICB9XG4gICAgICAgIFxuICAgICAgICBvcHRpb25zLmluY2x1ZGVfZG9jcyA9IHRydWU7XG4gICAgICAgIFxuICAgICAgICByZXR1cm4gYXdhaXQgUHJvbWlzZS5hbGwoKGF3YWl0IHRoaXMucmF3VmlldyhgJHtjbGFzc0Fubm90YXRpb24ubmFtZX0vJHtuYW1lfWAsIG9wdGlvbnMpKVxuICAgICAgICAgICAgLnJvd3MubWFwKHJvdyA9PiByb3cuZG9jISlcbiAgICAgICAgICAgIC5tYXAoYXN5bmMgZG9jID0+IHRoaXMuaHlkcmF0b3IuaHlkcmF0ZShPYmplY3QuY3JlYXRlKHRoaXMuZW50aXR5Q2xhc3MucHJvdG90eXBlKSwgZG9jLCB0aGlzLm1ldGFkYXRhLCB7XG4gICAgICAgICAgICAgICAgZGVwdGgsXG4gICAgICAgICAgICAgICAgY2lyY3VsYXJDYWNoZVxuICAgICAgICAgICAgfSkpXG4gICAgICAgIClcbiAgICB9XG4gICAgXG4gICAgcmF3VmlldzxSID0gVD4obmFtZSA6IHN0cmluZywgb3B0aW9ucz8gOiBQb3VjaERCLlF1ZXJ5Lk9wdGlvbnM8VCwgUj4pIDogUHJvbWlzZTxQb3VjaERCLlF1ZXJ5LlJlc3BvbnNlPFI+PiB7XG4gICAgICAgIHJldHVybiB0aGlzLmRiLnF1ZXJ5KG5hbWUsIG9wdGlvbnMpO1xuICAgIH1cbn1cbiJdfQ==

@@ -6,2 +6,3 @@ /// <reference types="pouchdb-core" />

import { AdamantId } from './injector-tokens';
import { AdamantEntityMeta, AdamantRevMeta } from './meta-interfaces';
export declare class HydratorImpl extends Hydrator {

@@ -11,6 +12,6 @@ protected readonly id: AdamantId;

constructor(id: AdamantId, connectionManager: AdamantConnectionManager);
dehydrate<T>(entity: T, metadata: Metadata<T>, options?: {
dehydrate<T>(entity: T & AdamantEntityMeta, metadata: Metadata<T>, options?: {
includeRev?: boolean;
}): PouchDB.Core.Document<T> & Partial<PouchDB.Core.RevisionIdMeta>;
hydrate<T extends {}>(entity: T, data: PouchDB.Core.Document<T> & PouchDB.Core.GetMeta, metadata: Metadata<T>, { depth, circularCache }?: HydrateOptions): Promise<T>;
hydrate<T extends {}>(entity: T, data: PouchDB.Core.Document<T> & PouchDB.Core.GetMeta, metadata: Metadata<T>, { depth, circularCache }?: HydrateOptions): Promise<T & AdamantRevMeta>;
}
/// <reference types="pouchdb-core" />
import { Metadata } from './metadata';
import { AdamantEntityMeta, AdamantRevMeta } from './meta-interfaces';
export interface HydrateOptions {

@@ -10,6 +11,6 @@ depth?: number;

export declare abstract class Hydrator {
abstract hydrate<T>(entity: T, data: PouchDB.Core.Document<T> & PouchDB.Core.GetMeta, metadata: Metadata<T>, options?: HydrateOptions): Promise<T>;
abstract dehydrate<T>(entity: T, metadata: Metadata<T>, options?: {
abstract hydrate<T>(entity: T, data: PouchDB.Core.Document<T> & PouchDB.Core.GetMeta, metadata: Metadata<T>, options?: HydrateOptions): Promise<T & AdamantRevMeta>;
abstract dehydrate<T>(entity: T & AdamantEntityMeta, metadata: Metadata<T>, options?: {
includeRev?: boolean;
}): PouchDB.Core.Document<T> & Partial<PouchDB.Core.RevisionIdMeta>;
}

@@ -16,5 +16,7 @@ export * from './annotations/belongs-to';

export * from './connection-manager';
export * from './factories';
export * from './hydrator';
export * from './hydrator-impl';
export * from './injector-tokens';
export * from './meta-interfaces';
export * from './metadata';

@@ -21,0 +23,0 @@ export * from './query-builder';

@@ -1,1 +0,1 @@

{"__symbolic":"module","version":4,"metadata":{"BelongsToMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"RelationMetadata"},"members":{}},"BelongsTo":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":7,"character":11,"module":"./annotations/belongs-to"}},"DesignDocMetadata":{"__symbolic":"class","arity":1,"members":{}},"DesignDoc":{"__symbolic":"function","parameters":["entity","name"],"value":{"__symbolic":"error","message":"Lambda not supported","line":12,"character":11,"module":"./annotations/design-doc"}},"EntityMetadata":{"__symbolic":"class","members":{}},"Entity":{"__symbolic":"function","parameters":["name","options"],"defaults":[null,{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":16,"character":11,"module":"./annotations/entity"}},"FilterMetadata":{"__symbolic":"class","members":{}},"Filter":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":6,"character":11,"module":"./annotations/filter"}},"HasManyMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"RelationMetadata"},"members":{}},"HasMany":{"__symbolic":"function","parameters":["type","options"],"defaults":[null,{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":7,"character":11,"module":"./annotations/has-many"}},"HasManyMapMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"RelationMetadata"},"members":{}},"HasManyMap":{"__symbolic":"function","parameters":["type","options"],"defaults":[null,{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":7,"character":11,"module":"./annotations/has-many-map"}},"IdStrategy":{"Static":"static"},"IdMetadata":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PropertyMetadata"},"members":{}},"Id":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":16,"character":11,"module":"./annotations/id"}},"InlineMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"RelationMetadata"},"members":{}},"Inline":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":7,"character":11,"module":"./annotations/inline"}},"InlineEntityMetadata":{"__symbolic":"class","members":{}},"InlineEntity":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":14,"character":11,"module":"./annotations/inline-entity"}},"Type":{"__symbolic":"interface"},"PropertyMetadata":{"__symbolic":"class","members":{"validate":[{"__symbolic":"method"}]}},"Property":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":17,"character":11,"module":"./annotations/property"}},"RelationMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"PropertyMetadata"},"members":{}},"ValidateDocMetadata":{"__symbolic":"class","members":{}},"ValidateDoc":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":6,"character":11,"module":"./annotations/validate-doc"}},"ViewMetadata":{"__symbolic":"class","members":{}},"View":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":6,"character":11,"module":"./annotations/view"}},"BulkOperation":{"Create":"create","Update":"update","Delete":"delete"},"Bulk":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":16,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_CONNECTION"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":17,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ENTITY_CLASS"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":18,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ENTITY_METADATA"}]}],null,null],"parameters":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"PouchDB"},"member":"Database","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":16,"character":85,"context":{"typeName":"T"},"module":"./bulk"}]},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"Metadata"},{"__symbolic":"reference","name":"Hydrator"},{"__symbolic":"reference","name":"Validator"}]}],"bulk":[{"__symbolic":"method"}],"create":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}]}},"adamantIdFactory":{"__symbolic":"function","parameters":[],"value":{}},"createAdamantConnection":{"__symbolic":"function"},"AdamantConnectionManager":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":69,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":76,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_CONNECTION_FACTORY"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":77,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ID"}]}],null],"parameters":[{"__symbolic":"reference","name":"ConnectionFactory"},{"__symbolic":"reference","name":"AdamantId"},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":78,"character":46}]}],"getOpenConnections":[{"__symbolic":"method"}],"getConnection":[{"__symbolic":"method"}],"clearConnections":[{"__symbolic":"method"}],"createConnection":[{"__symbolic":"method"}],"getRepository":[{"__symbolic":"method"}],"createRepository":[{"__symbolic":"method"}],"getMetadata":[{"__symbolic":"method"}],"createMetadata":[{"__symbolic":"method"}]}},"HydrateOptions":{"__symbolic":"interface"},"Hydrator":{"__symbolic":"class","members":{"hydrate":[{"__symbolic":"method"}],"dehydrate":[{"__symbolic":"method"}]}},"HydratorImpl":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Hydrator"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":15,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":17,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ID"}]}],null],"parameters":[{"__symbolic":"reference","name":"AdamantId"},{"__symbolic":"reference","name":"AdamantConnectionManager"}]}],"dehydrate":[{"__symbolic":"method"}],"hydrate":[{"__symbolic":"method"}]}},"EqualChecker":{"__symbolic":"interface"},"ConnectionFactory":{"__symbolic":"interface"},"AdamantId":{"__symbolic":"interface"},"ADAMANT_CONNECTION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":20,"character":38},"arguments":["ADAMANT_CONNECTION"]},"ADAMANT_ENTITY_CLASS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":21,"character":40},"arguments":["ADAMANT_ENTITY_CLASS"]},"ADAMANT_ENTITY_METADATA":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":22,"character":43},"arguments":["ADAMANT_ENTITY_METADATA"]},"ADAMANT_EQUAL_CHECKER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":23,"character":41},"arguments":["ADAMANT_EQUAL_CHECKER"]},"ADAMANT_CONNECTION_FACTORY":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":24,"character":46},"arguments":["ADAMANT_CONNECTION_FACTORY"]},"ADAMANT_ID":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":25,"character":30},"arguments":["ADAMANT_ID"]},"Metadata":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ɵa"}]}],"parse":[{"__symbolic":"method"}],"assert":[{"__symbolic":"method"}]}},"QueryBuilder":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AdamantRepository"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}],"selector":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"sort":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"limit":[{"__symbolic":"method"}],"skip":[{"__symbolic":"method"}],"resolve":[{"__symbolic":"method"}],"toFindRequest":[{"__symbolic":"method"}]}},"equalCheckerFactory":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"reference","module":"fast-deep-equal"}},"AdamantRepository":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":30,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":34,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_CONNECTION"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":35,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ENTITY_CLASS"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":36,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ENTITY_METADATA"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":37,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_EQUAL_CHECKER"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":38,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ID"}]}],null,null,null],"parameters":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"PouchDB"},"member":"Database","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":34,"character":85,"context":{"typeName":"T"},"module":"./repository"}]},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"Metadata"},{"__symbolic":"reference","name":"EqualChecker"},{"__symbolic":"reference","name":"AdamantId"},{"__symbolic":"reference","name":"Bulk"},{"__symbolic":"reference","name":"Hydrator"},{"__symbolic":"reference","name":"Validator"}]}],"create":[{"__symbolic":"method"}],"upsert":[{"__symbolic":"method"}],"_upsert":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"read":[{"__symbolic":"method"}],"_read":[{"__symbolic":"method"}],"_readRaw":[{"__symbolic":"method"}],"readAll":[{"__symbolic":"method"}],"_readAll":[{"__symbolic":"method"}],"_readAllRaw":[{"__symbolic":"method"}],"query":[{"__symbolic":"method"}],"executeQuery":[{"__symbolic":"method"}],"build":[{"__symbolic":"method"}],"persistDesignDoc":[{"__symbolic":"method"}],"view":[{"__symbolic":"method"}],"rawView":[{"__symbolic":"method"}]}},"Validator":{"__symbolic":"class","members":{"validate":[{"__symbolic":"method"}]}},"ValidatorImpl":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Validator"},"members":{"validate":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"interface"}},"origins":{"BelongsToMetadata":"./annotations/belongs-to","BelongsTo":"./annotations/belongs-to","DesignDocMetadata":"./annotations/design-doc","DesignDoc":"./annotations/design-doc","EntityMetadata":"./annotations/entity","Entity":"./annotations/entity","FilterMetadata":"./annotations/filter","Filter":"./annotations/filter","HasManyMetadata":"./annotations/has-many","HasMany":"./annotations/has-many","HasManyMapMetadata":"./annotations/has-many-map","HasManyMap":"./annotations/has-many-map","IdStrategy":"./annotations/id","IdMetadata":"./annotations/id","Id":"./annotations/id","InlineMetadata":"./annotations/inline","Inline":"./annotations/inline","InlineEntityMetadata":"./annotations/inline-entity","InlineEntity":"./annotations/inline-entity","Type":"./annotations/property","PropertyMetadata":"./annotations/property","Property":"./annotations/property","RelationMetadata":"./annotations/relation","ValidateDocMetadata":"./annotations/validate-doc","ValidateDoc":"./annotations/validate-doc","ViewMetadata":"./annotations/view","View":"./annotations/view","BulkOperation":"./bulk","Bulk":"./bulk","adamantIdFactory":"./connection-manager","createAdamantConnection":"./connection-manager","AdamantConnectionManager":"./connection-manager","HydrateOptions":"./hydrator","Hydrator":"./hydrator","HydratorImpl":"./hydrator-impl","EqualChecker":"./injector-tokens","ConnectionFactory":"./injector-tokens","AdamantId":"./injector-tokens","ADAMANT_CONNECTION":"./injector-tokens","ADAMANT_ENTITY_CLASS":"./injector-tokens","ADAMANT_ENTITY_METADATA":"./injector-tokens","ADAMANT_EQUAL_CHECKER":"./injector-tokens","ADAMANT_CONNECTION_FACTORY":"./injector-tokens","ADAMANT_ID":"./injector-tokens","Metadata":"./metadata","QueryBuilder":"./query-builder","equalCheckerFactory":"./repository","AdamantRepository":"./repository","Validator":"./validator","ValidatorImpl":"./validator-impl","ɵa":"./utils/metadata"},"importAs":"@neoskop/adamant"}
{"__symbolic":"module","version":4,"metadata":{"BelongsToMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"RelationMetadata"},"members":{}},"BelongsTo":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":7,"character":11,"module":"./annotations/belongs-to"}},"DesignDocMetadata":{"__symbolic":"class","arity":1,"members":{}},"DesignDoc":{"__symbolic":"function","parameters":["entity","name"],"value":{"__symbolic":"error","message":"Lambda not supported","line":12,"character":11,"module":"./annotations/design-doc"}},"EntityMetadata":{"__symbolic":"class","members":{}},"Entity":{"__symbolic":"function","parameters":["name","options"],"defaults":[null,{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":16,"character":11,"module":"./annotations/entity"}},"FilterMetadata":{"__symbolic":"class","members":{}},"Filter":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":6,"character":11,"module":"./annotations/filter"}},"HasManyMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"RelationMetadata"},"members":{}},"HasMany":{"__symbolic":"function","parameters":["type","options"],"defaults":[null,{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":7,"character":11,"module":"./annotations/has-many"}},"HasManyMapMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"RelationMetadata"},"members":{}},"HasManyMap":{"__symbolic":"function","parameters":["type","options"],"defaults":[null,{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":7,"character":11,"module":"./annotations/has-many-map"}},"IdStrategy":{"Static":"static"},"IdMetadata":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"PropertyMetadata"},"members":{}},"Id":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":16,"character":11,"module":"./annotations/id"}},"InlineMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"RelationMetadata"},"members":{}},"Inline":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":7,"character":11,"module":"./annotations/inline"}},"InlineEntityMetadata":{"__symbolic":"class","members":{}},"InlineEntity":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":14,"character":11,"module":"./annotations/inline-entity"}},"Type":{"__symbolic":"interface"},"PropertyMetadata":{"__symbolic":"class","members":{"validate":[{"__symbolic":"method"}]}},"Property":{"__symbolic":"function","parameters":["options"],"defaults":[{}],"value":{"__symbolic":"error","message":"Lambda not supported","line":17,"character":11,"module":"./annotations/property"}},"RelationMetadata":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","name":"PropertyMetadata"},"members":{}},"ValidateDocMetadata":{"__symbolic":"class","members":{}},"ValidateDoc":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":6,"character":11,"module":"./annotations/validate-doc"}},"ViewMetadata":{"__symbolic":"class","members":{}},"View":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"error","message":"Lambda not supported","line":6,"character":11,"module":"./annotations/view"}},"BulkOperation":{"Create":"create","Update":"update","Delete":"delete"},"Bulk":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":17,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_CONNECTION"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":18,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ENTITY_CLASS"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":19,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ENTITY_METADATA"}]}],null,null],"parameters":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"PouchDB"},"member":"Database","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":17,"character":85,"context":{"typeName":"T"},"module":"./bulk"}]},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"Metadata"},{"__symbolic":"reference","name":"Hydrator"},{"__symbolic":"reference","name":"Validator"}]}],"bulk":[{"__symbolic":"method"}],"create":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}]}},"createAdamantConnection":{"__symbolic":"function"},"AdamantConnectionManager":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":35,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":42,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_CONNECTION_FACTORY"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":43,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ID"}]}],null],"parameters":[{"__symbolic":"reference","name":"ConnectionFactory"},{"__symbolic":"reference","name":"AdamantId"},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":44,"character":46}]}],"getOpenConnections":[{"__symbolic":"method"}],"getConnection":[{"__symbolic":"method"}],"clearConnections":[{"__symbolic":"method"}],"createConnection":[{"__symbolic":"method"}],"getRepository":[{"__symbolic":"method"}],"createRepository":[{"__symbolic":"method"}],"getMetadata":[{"__symbolic":"method"}],"createMetadata":[{"__symbolic":"method"}]}},"equalCheckerFactory":{"__symbolic":"function","parameters":[],"value":{"__symbolic":"reference","module":"fast-deep-equal"}},"adamantIdFactory":{"__symbolic":"function","parameters":[],"value":{}},"HydrateOptions":{"__symbolic":"interface"},"Hydrator":{"__symbolic":"class","members":{"hydrate":[{"__symbolic":"method"}],"dehydrate":[{"__symbolic":"method"}]}},"HydratorImpl":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Hydrator"},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":16,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":18,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ID"}]}],null],"parameters":[{"__symbolic":"reference","name":"AdamantId"},{"__symbolic":"reference","name":"AdamantConnectionManager"}]}],"dehydrate":[{"__symbolic":"method"}],"hydrate":[{"__symbolic":"method"}]}},"EqualChecker":{"__symbolic":"interface"},"ConnectionFactory":{"__symbolic":"interface"},"AdamantId":{"__symbolic":"interface"},"ADAMANT_CONNECTION":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":20,"character":38},"arguments":["ADAMANT_CONNECTION"]},"ADAMANT_ENTITY_CLASS":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":21,"character":40},"arguments":["ADAMANT_ENTITY_CLASS"]},"ADAMANT_ENTITY_METADATA":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":22,"character":43},"arguments":["ADAMANT_ENTITY_METADATA"]},"ADAMANT_EQUAL_CHECKER":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":23,"character":41},"arguments":["ADAMANT_EQUAL_CHECKER"]},"ADAMANT_CONNECTION_FACTORY":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":24,"character":46},"arguments":["ADAMANT_CONNECTION_FACTORY"]},"ADAMANT_ID":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":25,"character":30},"arguments":["ADAMANT_ID"]},"AdamantIdMeta":{"__symbolic":"interface"},"AdamantRevMeta":{"__symbolic":"interface"},"AdamantDeletedMeta":{"__symbolic":"interface"},"AdamantAttachmentsMeta":{"__symbolic":"interface"},"AdamantEntityMeta":{"__symbolic":"interface"},"Metadata":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"ɵa"}]}],"parse":[{"__symbolic":"method"}],"assert":[{"__symbolic":"method"}]}},"QueryBuilder":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"AdamantRepository"},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","name":"string"}]}],"selector":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"sort":[{"__symbolic":"method"},{"__symbolic":"method"},{"__symbolic":"method"}],"limit":[{"__symbolic":"method"}],"skip":[{"__symbolic":"method"}],"resolve":[{"__symbolic":"method"}],"toFindRequest":[{"__symbolic":"method"}]}},"AdamantRepository":{"__symbolic":"class","arity":1,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":26,"character":1}}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":30,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_CONNECTION"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":31,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ENTITY_CLASS"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":32,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ENTITY_METADATA"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":33,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_EQUAL_CHECKER"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":34,"character":17},"arguments":[{"__symbolic":"reference","name":"ADAMANT_ID"}]}],null,null,null],"parameters":[{"__symbolic":"select","expression":{"__symbolic":"reference","name":"PouchDB"},"member":"Database","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":30,"character":85,"context":{"typeName":"T"},"module":"./repository"}]},{"__symbolic":"reference","name":"ɵa"},{"__symbolic":"reference","name":"Metadata"},{"__symbolic":"reference","name":"EqualChecker"},{"__symbolic":"reference","name":"AdamantId"},{"__symbolic":"reference","name":"Bulk"},{"__symbolic":"reference","name":"Hydrator"},{"__symbolic":"reference","name":"Validator"}]}],"create":[{"__symbolic":"method"}],"upsert":[{"__symbolic":"method"}],"_upsert":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}],"delete":[{"__symbolic":"method"}],"read":[{"__symbolic":"method"}],"_read":[{"__symbolic":"method"}],"_readRaw":[{"__symbolic":"method"}],"readAll":[{"__symbolic":"method"}],"_readAll":[{"__symbolic":"method"}],"_readAllRaw":[{"__symbolic":"method"}],"query":[{"__symbolic":"method"}],"executeQuery":[{"__symbolic":"method"}],"build":[{"__symbolic":"method"}],"persistDesignDoc":[{"__symbolic":"method"}],"view":[{"__symbolic":"method"}],"rawView":[{"__symbolic":"method"}]}},"Validator":{"__symbolic":"class","members":{"validate":[{"__symbolic":"method"}]}},"ValidatorImpl":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Validator"},"members":{"validate":[{"__symbolic":"method"}]}},"ɵa":{"__symbolic":"interface"}},"origins":{"BelongsToMetadata":"./annotations/belongs-to","BelongsTo":"./annotations/belongs-to","DesignDocMetadata":"./annotations/design-doc","DesignDoc":"./annotations/design-doc","EntityMetadata":"./annotations/entity","Entity":"./annotations/entity","FilterMetadata":"./annotations/filter","Filter":"./annotations/filter","HasManyMetadata":"./annotations/has-many","HasMany":"./annotations/has-many","HasManyMapMetadata":"./annotations/has-many-map","HasManyMap":"./annotations/has-many-map","IdStrategy":"./annotations/id","IdMetadata":"./annotations/id","Id":"./annotations/id","InlineMetadata":"./annotations/inline","Inline":"./annotations/inline","InlineEntityMetadata":"./annotations/inline-entity","InlineEntity":"./annotations/inline-entity","Type":"./annotations/property","PropertyMetadata":"./annotations/property","Property":"./annotations/property","RelationMetadata":"./annotations/relation","ValidateDocMetadata":"./annotations/validate-doc","ValidateDoc":"./annotations/validate-doc","ViewMetadata":"./annotations/view","View":"./annotations/view","BulkOperation":"./bulk","Bulk":"./bulk","createAdamantConnection":"./connection-manager","AdamantConnectionManager":"./connection-manager","equalCheckerFactory":"./factories","adamantIdFactory":"./factories","HydrateOptions":"./hydrator","Hydrator":"./hydrator","HydratorImpl":"./hydrator-impl","EqualChecker":"./injector-tokens","ConnectionFactory":"./injector-tokens","AdamantId":"./injector-tokens","ADAMANT_CONNECTION":"./injector-tokens","ADAMANT_ENTITY_CLASS":"./injector-tokens","ADAMANT_ENTITY_METADATA":"./injector-tokens","ADAMANT_EQUAL_CHECKER":"./injector-tokens","ADAMANT_CONNECTION_FACTORY":"./injector-tokens","ADAMANT_ID":"./injector-tokens","AdamantIdMeta":"./meta-interfaces","AdamantRevMeta":"./meta-interfaces","AdamantDeletedMeta":"./meta-interfaces","AdamantAttachmentsMeta":"./meta-interfaces","AdamantEntityMeta":"./meta-interfaces","Metadata":"./metadata","QueryBuilder":"./query-builder","AdamantRepository":"./repository","Validator":"./validator","ValidatorImpl":"./validator-impl","ɵa":"./utils/metadata"},"importAs":"@neoskop/adamant"}

@@ -20,3 +20,3 @@ {

},
"version": "0.1.0-rc.6",
"version": "0.1.0-rc.7",
"description": "PouchDB ORM",

@@ -23,0 +23,0 @@ "repository": "git@bitbucket.org:neoskop/adamant.git",

@@ -14,3 +14,3 @@ /// <reference types="pouchdb-find" />

import { AdamantId, EqualChecker } from './injector-tokens';
export declare function equalCheckerFactory(): (a: any, b: any) => boolean;
import { AdamantDeletedMeta, AdamantEntityMeta, AdamantRevMeta } from './meta-interfaces';
export declare class AdamantRepository<T> {

@@ -27,24 +27,24 @@ protected readonly db: PouchDB.Database<T>;

constructor(db: PouchDB.Database<T>, entityClass: Ctor<T>, metadata: Metadata<T>, equal: EqualChecker, id: AdamantId, bulk: Bulk<T>, hydrator: Hydrator, validator: Validator);
create(entity: T): Promise<T>;
upsert(entity: T): Promise<T>;
create(entity: T): Promise<T & AdamantRevMeta>;
upsert(entity: T): Promise<T & AdamantRevMeta>;
/** @internal */
_upsert(id: string, document: PouchDB.Core.Document<T> & Partial<PouchDB.Core.RevisionIdMeta>): Promise<PouchDB.UpsertResponse>;
update(entity: T): Promise<T>;
delete(entity: T): Promise<T>;
read(id: number | string, options?: HydrateOptions): Promise<any>;
update(entity: T): Promise<T & AdamantRevMeta>;
delete(entity: T): Promise<T & AdamantRevMeta & AdamantDeletedMeta>;
read(id: number | string, options?: HydrateOptions): Promise<T & AdamantRevMeta>;
/** @internal */
_read(id: string, options?: HydrateOptions): Promise<any>;
_read(id: string, options?: HydrateOptions): Promise<T & AdamantRevMeta>;
/** @internal */
_readRaw(id: string): Promise<PouchDB.Core.Document<T>>;
readAll(ids?: (string | number)[], options?: HydrateOptions): Promise<any[]>;
readAll(ids?: (string | number)[], options?: HydrateOptions): Promise<(T & AdamantRevMeta)[]>;
/** @internal */
_readAll(opt: PouchDB.Core.AllDocsWithKeysOptions | PouchDB.Core.AllDocsWithinRangeOptions, options?: HydrateOptions): Promise<any[]>;
_readAll(opt: PouchDB.Core.AllDocsWithKeysOptions | PouchDB.Core.AllDocsWithinRangeOptions, options?: HydrateOptions): Promise<(T & AdamantRevMeta)[]>;
/** @internal */
_readAllRaw(opt: PouchDB.Core.AllDocsWithKeysOptions | PouchDB.Core.AllDocsWithinRangeOptions): Promise<PouchDB.Core.Document<T>[]>;
query(): QueryBuilder<T>;
executeQuery(query: QueryBuilder<T>, options?: HydrateOptions): Promise<any[]>;
build(props?: Partial<T>): T;
executeQuery(query: QueryBuilder<T>, options?: HydrateOptions): Promise<(T & AdamantRevMeta)[]>;
build(props?: Partial<T>): T & AdamantEntityMeta;
persistDesignDoc<T extends {}>(doc: T): Promise<void>;
view<T, P extends keyof T>(designDoc: Ctor<T>, name: P, { depth, circularCache, ...options }?: HydrateOptions & PouchDB.Query.Options<T, any>): Promise<any[]>;
rawView<R = T>(name: string, options?: PouchDB.Query.Options<R, any>): Promise<PouchDB.Query.Response<any>>;
view<T, P extends keyof T>(designDoc: Ctor<T>, name: P, { depth, circularCache, ...options }?: HydrateOptions & PouchDB.Query.Options<T, any>): Promise<(T & AdamantRevMeta)[]>;
rawView<R = T>(name: string, options?: PouchDB.Query.Options<T, R>): Promise<PouchDB.Query.Response<R>>;
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc