UNPKG

baqend

Version:

Baqend JavaScript SDK

2 lines 176 kB
/*! baqend 4.2.6 | Copyright (c) 2021 Baqend GmbH | License information baqend.es5.min.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(function(){try{return require("validator")}catch(e){}}()):"function"==typeof define&&define.amd?define("Baqend",["validator"],t):"object"==typeof exports?exports.Baqend=t(function(){try{return require("validator")}catch(e){}}()):e.Baqend=t(e.validator)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=65)}([function(e,t,r){"use strict";r.r(t),r.d(t,"__extends",(function(){return o})),r.d(t,"__assign",(function(){return i})),r.d(t,"__rest",(function(){return a})),r.d(t,"__decorate",(function(){return s})),r.d(t,"__param",(function(){return u})),r.d(t,"__esDecorate",(function(){return c})),r.d(t,"__runInitializers",(function(){return l})),r.d(t,"__propKey",(function(){return d})),r.d(t,"__setFunctionName",(function(){return p})),r.d(t,"__metadata",(function(){return f})),r.d(t,"__awaiter",(function(){return h})),r.d(t,"__generator",(function(){return y})),r.d(t,"__createBinding",(function(){return b})),r.d(t,"__exportStar",(function(){return g})),r.d(t,"__values",(function(){return m})),r.d(t,"__read",(function(){return v})),r.d(t,"__spread",(function(){return _})),r.d(t,"__spreadArrays",(function(){return O})),r.d(t,"__spreadArray",(function(){return w})),r.d(t,"__await",(function(){return P})),r.d(t,"__asyncGenerator",(function(){return E})),r.d(t,"__asyncDelegator",(function(){return T})),r.d(t,"__asyncValues",(function(){return S})),r.d(t,"__makeTemplateObject",(function(){return M})),r.d(t,"__importStar",(function(){return j})),r.d(t,"__importDefault",(function(){return C})),r.d(t,"__classPrivateFieldGet",(function(){return k})),r.d(t,"__classPrivateFieldSet",(function(){return I})),r.d(t,"__classPrivateFieldIn",(function(){return F})),r.d(t,"__addDisposableResource",(function(){return D})),r.d(t,"__disposeResources",(function(){return N}));var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function a(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function s(e,t,r,n){var o,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,r,a):o(t,r))||a);return i>3&&a&&Object.defineProperty(t,r,a),a}function u(e,t){return function(r,n){t(r,n,e)}}function c(e,t,r,n,o,i){function a(e){if(void 0!==e&&"function"!=typeof e)throw new TypeError("Function expected");return e}for(var s,u=n.kind,c="getter"===u?"get":"setter"===u?"set":"value",l=!t&&e?n.static?e:e.prototype:null,d=t||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),p=!1,f=r.length-1;f>=0;f--){var h={};for(var y in n)h[y]="access"===y?{}:n[y];for(var y in n.access)h.access[y]=n.access[y];h.addInitializer=function(e){if(p)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(e||null))};var b=(0,r[f])("accessor"===u?{get:d.get,set:d.set}:d[c],h);if("accessor"===u){if(void 0===b)continue;if(null===b||"object"!=typeof b)throw new TypeError("Object expected");(s=a(b.get))&&(d.get=s),(s=a(b.set))&&(d.set=s),(s=a(b.init))&&o.unshift(s)}else(s=a(b))&&("field"===u?o.unshift(s):d[c]=s)}l&&Object.defineProperty(l,n.name,d),p=!0}function l(e,t,r){for(var n=arguments.length>2,o=0;o<t.length;o++)r=n?t[o].call(e,r):t[o].call(e);return n?r:void 0}function d(e){return"symbol"==typeof e?e:"".concat(e)}function p(e,t,r){return"symbol"==typeof t&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:r?"".concat(r," ",t):t})}function f(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function h(e,t,r,n){return new(r||(r=Promise))((function(o,i){function a(e){try{u(n.next(e))}catch(e){i(e)}}function s(e){try{u(n.throw(e))}catch(e){i(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))}function y(e,t){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var b=Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);o&&!("get"in o?!t.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]};function g(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||b(t,e,r)}function m(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a}function _(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e}function O(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),o=0;for(t=0;t<r;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)n[o]=i[a];return n}function w(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function P(e){return this instanceof P?(this.v=e,this):new P(e)}function E(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,o=r.apply(e,t||[]),i=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(e){o[e]&&(n[e]=function(t){return new Promise((function(r,n){i.push([e,t,r,n])>1||s(e,t)}))})}function s(e,t){try{(r=o[e](t)).value instanceof P?Promise.resolve(r.value.v).then(u,c):l(i[0][2],r)}catch(e){l(i[0][3],e)}var r}function u(e){s("next",e)}function c(e){s("throw",e)}function l(e,t){e(t),i.shift(),i.length&&s(i[0][0],i[0][1])}}function T(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,o){t[n]=e[n]?function(t){return(r=!r)?{value:P(e[n](t)),done:!1}:o?o(t):t}:o}}function S(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=m(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,o){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,o,(t=e[r](t)).done,t.value)}))}}}function M(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var A=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};function j(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&b(t,e,r);return A(t,e),t}function C(e){return e&&e.__esModule?e:{default:e}}function k(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}function I(e,t,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!o:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(e,r):o?o.value=r:t.set(e,r),r}function F(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}function D(e,t,r){if(null!=t){if("object"!=typeof t)throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=t[Symbol.asyncDispose]}if(void 0===n){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=t[Symbol.dispose]}if("function"!=typeof n)throw new TypeError("Object not disposable.");e.stack.push({value:t,dispose:n,async:r})}else r&&e.stack.push({async:!0});return t}var R="function"==typeof SuppressedError?SuppressedError:function(e,t,r){var n=new Error(r);return n.name="SuppressedError",n.error=e,n.suppressed=t,n};function N(e){function t(t){e.error=e.hasError?new R(t,e.error,"An error was suppressed during disposal."):t,e.hasError=!0}return function r(){for(;e.stack.length;){var n=e.stack.pop();try{var o=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(o).then(r,(function(e){return t(e),r()}))}catch(e){t(e)}}if(e.hasError)throw e.error}()}t.default={__extends:o,__assign:i,__rest:a,__decorate:s,__param:u,__metadata:f,__awaiter:h,__generator:y,__createBinding:b,__exportStar:g,__values:m,__read:v,__spread:_,__spreadArrays:O,__spreadArray:w,__await:P,__asyncGenerator:E,__asyncDelegator:T,__asyncValues:S,__makeTemplateObject:M,__importStar:j,__importDefault:C,__classPrivateFieldGet:k,__classPrivateFieldSet:I,__classPrivateFieldIn:F,__addDisposableResource:D,__disposeResources:N}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WebStorage=t.GlobalStorage=t.TokenStorage=t.PushMessage=t.Logger=t.Modules=t.Code=t.ValidationResult=t.Validator=t.Permission=t.MetadataState=t.Metadata=void 0;var n=r(82);Object.defineProperty(t,"Metadata",{enumerable:!0,get:function(){return n.Metadata}}),Object.defineProperty(t,"MetadataState",{enumerable:!0,get:function(){return n.MetadataState}});var o=r(48);Object.defineProperty(t,"Permission",{enumerable:!0,get:function(){return o.Permission}});var i=r(49);Object.defineProperty(t,"Validator",{enumerable:!0,get:function(){return i.Validator}});var a=r(84);Object.defineProperty(t,"ValidationResult",{enumerable:!0,get:function(){return a.ValidationResult}});var s=r(85);Object.defineProperty(t,"Code",{enumerable:!0,get:function(){return s.Code}});var u=r(86);Object.defineProperty(t,"Modules",{enumerable:!0,get:function(){return u.Modules}});var c=r(87);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return c.Logger}});var l=r(88);Object.defineProperty(t,"PushMessage",{enumerable:!0,get:function(){return l.PushMessage}});var d=r(28);Object.defineProperty(t,"TokenStorage",{enumerable:!0,get:function(){return d.TokenStorage}});var p=r(89);Object.defineProperty(t,"GlobalStorage",{enumerable:!0,get:function(){return p.GlobalStorage}});var f=r(90);Object.defineProperty(t,"WebStorage",{enumerable:!0,get:function(){return f.WebStorage}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResetPassword=t.NewPassword=t.Logout=t.ValidateUser=t.Me=t.Register=t.Login=t.UpdateField=t.UpdatePartially=t.GetQueryParameters=t.RunQuery=t.GetQueryCode=t.ListThisQueryResources=t.CreateQuery=t.ListQueryResources=t.AdhocCountQueryPOST=t.AdhocCountQuery=t.AdhocQueryPOST=t.AdhocQuery=t.DeleteSchema=t.ReplaceSchema=t.UpdateSchema=t.GetSchema=t.ReplaceAllSchemas=t.UpdateAllSchemas=t.GetAllSchemas=t.DeleteObject=t.ReplaceObject=t.GetObject=t.CreateObject=t.TruncateBucket=t.ImportBucket=t.ExportBucket=t.GetBucketIds=t.GetBucketNames=t.UnbanIp=t.Unban=t.Banned=t.BannedIp=t.Status=t.ConnectViaPost=t.Connect=t.UpdateOrestesConfig=t.GetOrestesConfig=t.DeleteBloomFilter=t.GetBloomFilterExpirations=t.GetBloomFilter=t.Specification=t.ApiVersion=t.ListAllResources=void 0,t.VAPIDKeys=t.DeviceRegistered=t.DevicePush=t.DeviceRegister=t.DropAllIndexes=t.CreateDropIndex=t.ListIndexes=t.CleanUpStorage=t.CleanUpAssets=t.GetAllRevalidationStatus=t.CancelRevalidation=t.GetRevalidationStatus=t.EditRevalidationJob=t.RevalidateAssets=t.DownloadAsset=t.CreateManifest=t.DeleteFile=t.UpdateFileMetadata=t.GetFileMetadata=t.UploadFile=t.DownloadFile=t.CreateFile=t.DeleteFileBucket=t.SetFileBucketMetadata=t.GetFileBucketMetadata=t.UploadPatchArchive=t.DownloadArchive=t.ListBuckets=t.ListFiles=t.GetAllCodeContent=t.GetAllModules=t.GetBaqendModule=t.PostBaqendModule=t.DeleteBaqendCode=t.SetBaqendCode=t.GetBaqendCode=t.AssumeRole=t.MFAStatus=t.MFADelete=t.MFAToken=t.MFAInitFinish=t.MFAInitChallenge=t.RevokeUserToken=t.UserToken=t.DeletePassword=t.OAuth1=t.OAuth2=t.VerifyUsername=t.ChangeUsername=t.Verify=void 0,t.Startup=t.Live=t.Ready=t.Mail=t.DeactivateTestingInstallationById=t.GetAllDomains=t.FindSpecificInstallation=t.ActivateInstallationById=t.ActivateInstallationByDomainAndConfigVersion=t.CloneInstallationById=t.CloneInstallationByDomainAndConfigVersion=t.UpdateInstallationById=t.UpdateInstallationByDomainAndConfigVersion=t.CreateNewInstallation=t.GetInstallationById=t.ConfigAPI=t.UploadAPNSCertificate=t.GCMAKey=t.VAPIDPublicKey=void 0;var n=r(5);t.ListAllResources=n.Message.create({method:"GET",path:"/",status:[200]}),t.ApiVersion=n.Message.create({method:"GET",path:"/version",status:[200]}),t.Specification=n.Message.create({method:"GET",path:"/spec",status:[200]}),t.GetBloomFilter=n.Message.create({method:"GET",path:"/bloomfilter?rules=false",status:[200]}),t.GetBloomFilterExpirations=n.Message.create({method:"GET",path:"/bloomfilter/expirations",status:[200]}),t.DeleteBloomFilter=n.Message.create({method:"DELETE",path:"/bloomfilter?flush=true",status:[204]}),t.GetOrestesConfig=n.Message.create({method:"GET",path:"/config",status:[200]}),t.UpdateOrestesConfig=n.Message.create({method:"PUT",path:"/config",status:[200,202]}),t.Connect=n.Message.create({method:"GET",path:"/connect",status:[200]}),t.ConnectViaPost=n.Message.create({method:"POST",path:"/connect",status:[200]}),t.Status=n.Message.create({method:"GET",path:"/status",status:[200]}),t.BannedIp=n.Message.create({method:"GET",path:"/banned/:ip",status:[204]}),t.Banned=n.Message.create({method:"GET",path:"/banned",status:[]}),t.Unban=n.Message.create({method:"DELETE",path:"/banned",status:[204]}),t.UnbanIp=n.Message.create({method:"DELETE",path:"/banned/:ip",status:[204]}),t.GetBucketNames=n.Message.create({method:"GET",path:"/db",status:[200]}),t.GetBucketIds=n.Message.create({method:"GET",path:"/db/:bucket/ids?start=0&count=-1",status:[200]}),t.ExportBucket=n.Message.create({method:"GET",path:"/db/:bucket",status:[200]}),t.ImportBucket=n.Message.create({method:"PUT",path:"/db/:bucket",status:[200]}),t.TruncateBucket=n.Message.create({method:"DELETE",path:"/db/:bucket",status:[200]}),t.CreateObject=n.Message.create({method:"POST",path:"/db/:bucket",status:[201,202]}),t.GetObject=n.Message.create({method:"GET",path:"/db/:bucket/:oid",status:[200,304]}),t.ReplaceObject=n.Message.create({method:"PUT",path:"/db/:bucket/:oid",status:[200,202]}),t.DeleteObject=n.Message.create({method:"DELETE",path:"/db/:bucket/:oid",status:[202,204]}),t.GetAllSchemas=n.Message.create({method:"GET",path:"/schema",status:[200]}),t.UpdateAllSchemas=n.Message.create({method:"POST",path:"/schema",status:[200]}),t.ReplaceAllSchemas=n.Message.create({method:"PUT",path:"/schema",status:[200]}),t.GetSchema=n.Message.create({method:"GET",path:"/schema/:bucket",status:[200]}),t.UpdateSchema=n.Message.create({method:"POST",path:"/schema/:bucket",status:[200]}),t.ReplaceSchema=n.Message.create({method:"PUT",path:"/schema/:bucket",status:[200]}),t.DeleteSchema=n.Message.create({method:"DELETE",path:"/schema/:bucket",status:[204]}),t.AdhocQuery=n.Message.create({method:"GET",path:"/db/:bucket/query?q&start=0&count=-1&sort=&eager=&hinted=&triggeredBy=&ttl=",status:[200]}),t.AdhocQueryPOST=n.Message.create({method:"POST",path:"/db/:bucket/query?start=0&count=-1&sort=&triggeredBy=&ttl=",status:[200]}),t.AdhocCountQuery=n.Message.create({method:"GET",path:"/db/:bucket/count?q",status:[200]}),t.AdhocCountQueryPOST=n.Message.create({method:"POST",path:"/db/:bucket/count",status:[200]}),t.ListQueryResources=n.Message.create({method:"GET",path:"/query",status:[200]}),t.CreateQuery=n.Message.create({method:"POST",path:"/query",status:[201]}),t.ListThisQueryResources=n.Message.create({method:"GET",path:"/query/:qid",status:[200]}),t.GetQueryCode=n.Message.create({method:"GET",path:"/query/:qid/source",status:[200]}),t.RunQuery=n.Message.create({method:"GET",path:"/query/:qid/result?start=0&count=-1",status:[200]}),t.GetQueryParameters=n.Message.create({method:"GET",path:"/query/:qid/parameters",status:[200]}),t.UpdatePartially=n.Message.create({method:"POST",path:"/db/:bucket/:oid",status:[200]}),t.UpdateField=n.Message.create({method:"POST",path:"/db/:bucket/:oid/:field",status:[200]}),t.Login=n.Message.create({method:"POST",path:"/db/User/login",status:[200]}),t.Register=n.Message.create({method:"POST",path:"/db/User/register",status:[200,204]}),t.Me=n.Message.create({method:"GET",path:"/db/User/me",status:[200]}),t.ValidateUser=n.Message.create({method:"GET",path:"/db/User/validate",status:[200]}),t.Logout=n.Message.create({method:"GET",path:"/db/User/logout",status:[204]}),t.NewPassword=n.Message.create({method:"POST",path:"/db/User/password",status:[200]}),t.ResetPassword=n.Message.create({method:"POST",path:"/db/User/reset",status:[200]}),t.Verify=n.Message.create({method:"GET",path:"/db/User/verify?token=",status:[204]}),t.ChangeUsername=n.Message.create({method:"POST",path:"/db/User/changeUsername",status:[204]}),t.VerifyUsername=n.Message.create({method:"GET",path:"/db/User/verifyUsername?token=",status:[204]}),t.OAuth2=n.Message.create({method:"GET",path:"/db/User/OAuth/:provider?state=&code=&oauth_verifier=&oauth_token=&error_description=",status:[200]}),t.OAuth1=n.Message.create({method:"GET",path:"/db/User/OAuth1/:provider",status:[200]}),t.DeletePassword=n.Message.create({method:"DELETE",path:"/db/User/password",status:[204]}),t.UserToken=n.Message.create({method:"POST",path:"/db/User/:oid/token",status:[200]}),t.RevokeUserToken=n.Message.create({method:"DELETE",path:"/db/User/:oid/token",status:[204]}),t.MFAInitChallenge=n.Message.create({method:"GET",path:"/db/User/mfa/init",status:[200]}),t.MFAInitFinish=n.Message.create({method:"POST",path:"/db/User/mfa/init",status:[200]}),t.MFAToken=n.Message.create({method:"POST",path:"/db/User/mfa/token",status:[200]}),t.MFADelete=n.Message.create({method:"DELETE",path:"/db/User/mfa",status:[204]}),t.MFAStatus=n.Message.create({method:"GET",path:"/db/User/mfa/status",status:[200]}),t.AssumeRole=n.Message.create({method:"POST",path:"/db/Role/:oid/assume",status:[200]}),t.GetBaqendCode=n.Message.create({method:"GET",path:"/code/:bucket/:type",status:[200]}),t.SetBaqendCode=n.Message.create({method:"PUT",path:"/code/:bucket/:type",status:[200,202]}),t.DeleteBaqendCode=n.Message.create({method:"DELETE",path:"/code/:bucket/:type",status:[202,204]}),t.PostBaqendModule=n.Message.create({method:"POST",path:"/code/:bucket",status:[200,204]}),t.GetBaqendModule=n.Message.create({method:"GET",path:"/code/:bucket",status:[200,204]}),t.GetAllModules=n.Message.create({method:"GET",path:"/code",status:[200]}),t.GetAllCodeContent=n.Message.create({method:"GET",path:"/code-content",status:[200]}),t.ListFiles=n.Message.create({method:"GET",path:"/file/:bucket/ids?path=/&start=&count=-1&deep=false",status:[200]}),t.ListBuckets=n.Message.create({method:"GET",path:"/file/buckets",status:[200]}),t.DownloadArchive=n.Message.create({method:"GET",path:"/file",status:[200]}),t.UploadPatchArchive=n.Message.create({method:"POST",path:"/file",status:[200]}),t.GetFileBucketMetadata=n.Message.create({method:"GET",path:"/file/:bucket",status:[200]}),t.SetFileBucketMetadata=n.Message.create({method:"PUT",path:"/file/:bucket",status:[204]}),t.DeleteFileBucket=n.Message.create({method:"DELETE",path:"/file/:bucket",status:[204]}),t.CreateFile=n.Message.create({method:"POST",path:"/file/:bucket",status:[200]}),t.DownloadFile=n.Message.create({method:"GET",path:"/file/:bucket/*oid",status:[200,304]}),t.UploadFile=n.Message.create({method:"PUT",path:"/file/:bucket/*oid",status:[200]}),t.GetFileMetadata=n.Message.create({method:"HEAD",path:"/file/:bucket/*oid",status:[200]}),t.UpdateFileMetadata=n.Message.create({method:"POST",path:"/file/:bucket/*oid",status:[200]}),t.DeleteFile=n.Message.create({method:"DELETE",path:"/file/:bucket/*oid",status:[200,204]}),t.CreateManifest=n.Message.create({method:"POST",path:"/pwa/manifest",status:[202]}),t.DownloadAsset=n.Message.create({method:"GET",path:"/asset/*url",status:[200,304]}),t.RevalidateAssets=n.Message.create({method:"POST",path:"/asset/revalidate",status:[202]}),t.EditRevalidationJob=n.Message.create({method:"POST",path:"/asset/revalidate/:id",status:[204]}),t.GetRevalidationStatus=n.Message.create({method:"GET",path:"/asset/revalidate/:id",status:[200,202]}),t.CancelRevalidation=n.Message.create({method:"DELETE",path:"/asset/revalidate/:id",status:[202]}),t.GetAllRevalidationStatus=n.Message.create({method:"GET",path:"/asset/revalidate?state=",status:[200]}),t.CleanUpAssets=n.Message.create({method:"POST",path:"/asset/cleanup",status:[202]}),t.CleanUpStorage=n.Message.create({method:"POST",path:"/asset/cleanup/storage",status:[202]}),t.ListIndexes=n.Message.create({method:"GET",path:"/index/:bucket",status:[200]}),t.CreateDropIndex=n.Message.create({method:"POST",path:"/index/:bucket",status:[202]}),t.DropAllIndexes=n.Message.create({method:"DELETE",path:"/index/:bucket",status:[202]}),t.DeviceRegister=n.Message.create({method:"POST",path:"/db/Device/register",status:[200]}),t.DevicePush=n.Message.create({method:"POST",path:"/db/Device/push",status:[204]}),t.DeviceRegistered=n.Message.create({method:"GET",path:"/db/Device/registered",status:[200]}),t.VAPIDKeys=n.Message.create({method:"POST",path:"/config/VAPIDKeys",status:[200]}),t.VAPIDPublicKey=n.Message.create({method:"GET",path:"/config/VAPIDPublicKey",status:[200]}),t.GCMAKey=n.Message.create({method:"POST",path:"/config/GCMKey",status:[204]}),t.UploadAPNSCertificate=n.Message.create({method:"POST",path:"/config/APNSCert",status:[204]}),t.ConfigAPI=n.Message.create({method:"GET",path:"/speedkit/installation/:domain/:configVersion",status:[200]}),t.GetInstallationById=n.Message.create({method:"GET",path:"/speedkit/installation/:id",status:[200]}),t.CreateNewInstallation=n.Message.create({method:"POST",path:"/speedkit/installation/:domain",status:[200]}),t.UpdateInstallationByDomainAndConfigVersion=n.Message.create({method:"PUT",path:"/speedkit/installation/:domain/:configVersion",status:[200]}),t.UpdateInstallationById=n.Message.create({method:"PUT",path:"/speedkit/installation/:id",status:[200]}),t.CloneInstallationByDomainAndConfigVersion=n.Message.create({method:"POST",path:"/speedkit/installation/:domain/:configVersion/clone",status:[200]}),t.CloneInstallationById=n.Message.create({method:"POST",path:"/speedkit/installation/:id/clone",status:[200]}),t.ActivateInstallationByDomainAndConfigVersion=n.Message.create({method:"POST",path:"/speedkit/installation/:domain/:configVersion/activate?testing=",status:[200]}),t.ActivateInstallationById=n.Message.create({method:"POST",path:"/speedkit/installation/:id/activate?testing=",status:[200]}),t.FindSpecificInstallation=n.Message.create({method:"GET",path:"/speedkit/installation?domain=&status=&start=0&count=-1",status:[200]}),t.GetAllDomains=n.Message.create({method:"GET",path:"/speedkit/installation/domain",status:[200]}),t.DeactivateTestingInstallationById=n.Message.create({method:"PUT",path:"/speedkit/installation/:id/deactivate?force=",status:[200]}),t.Mail=n.Message.create({method:"POST",path:"/mail",status:[200]}),t.Ready=n.Message.create({method:"GET",path:"/-/ready",status:[200]}),t.Live=n.Message.create({method:"GET",path:"/-/live",status:[200]}),t.Startup=n.Message.create({method:"GET",path:"/-/startup",status:[200]})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.openWindow=t.trailingSlashIt=t.deprecated=t.uuid=t.Lockable=t.hmac=t.atob=t.isNode=void 0;var n=r(70);Object.defineProperty(t,"isNode",{enumerable:!0,get:function(){return n.isNode}});var o=r(71);Object.defineProperty(t,"atob",{enumerable:!0,get:function(){return o.atob}});var i=r(72);Object.defineProperty(t,"hmac",{enumerable:!0,get:function(){return i.hmac}});var a=r(73);Object.defineProperty(t,"Lockable",{enumerable:!0,get:function(){return a.Lockable}});var s=r(74);Object.defineProperty(t,"uuid",{enumerable:!0,get:function(){return s.uuid}});var u=r(76);Object.defineProperty(t,"deprecated",{enumerable:!0,get:function(){return u.deprecated}});var c=r(77);Object.defineProperty(t,"trailingSlashIt",{enumerable:!0,get:function(){return c.trailingSlashIt}});var l=r(78);Object.defineProperty(t,"openWindow",{enumerable:!0,get:function(){return l.openWindow}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.File=t.User=t.Role=t.Entity=t.Managed=t.FileFactory=t.DeviceFactory=t.UserFactory=t.LoginOption=t.EntityFactory=t.ManagedFactory=t.Factory=t.Enhancer=t.Accessor=void 0;var n=r(81);Object.defineProperty(t,"Accessor",{enumerable:!0,get:function(){return n.Accessor}});var o=r(26);Object.defineProperty(t,"Enhancer",{enumerable:!0,get:function(){return o.Enhancer}});var i=r(27);Object.defineProperty(t,"Factory",{enumerable:!0,get:function(){return i.Factory}});var a=r(47);Object.defineProperty(t,"ManagedFactory",{enumerable:!0,get:function(){return a.ManagedFactory}});var s=r(29);Object.defineProperty(t,"EntityFactory",{enumerable:!0,get:function(){return s.EntityFactory}});var u=r(91);Object.defineProperty(t,"LoginOption",{enumerable:!0,get:function(){return u.LoginOption}}),Object.defineProperty(t,"UserFactory",{enumerable:!0,get:function(){return u.UserFactory}});var c=r(92);Object.defineProperty(t,"DeviceFactory",{enumerable:!0,get:function(){return c.DeviceFactory}});var l=r(93);Object.defineProperty(t,"FileFactory",{enumerable:!0,get:function(){return l.FileFactory}});var d=r(51);Object.defineProperty(t,"Managed",{enumerable:!0,get:function(){return d.Managed}});var p=r(30);Object.defineProperty(t,"Entity",{enumerable:!0,get:function(){return p.Entity}});var f=r(96);Object.defineProperty(t,"Role",{enumerable:!0,get:function(){return f.Role}});var h=r(53);Object.defineProperty(t,"User",{enumerable:!0,get:function(){return h.User}});var y=r(50);Object.defineProperty(t,"File",{enumerable:!0,get:function(){return y.File}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeConnector=t.IFrameConnector=t.XMLHttpConnector=t.FetchConnector=t.Connector=t.StatusCode=t.OAuthMessage=t.Message=void 0;var n=r(39);Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return n.Message}}),Object.defineProperty(t,"OAuthMessage",{enumerable:!0,get:function(){return n.OAuthMessage}}),Object.defineProperty(t,"StatusCode",{enumerable:!0,get:function(){return n.StatusCode}});var o=r(25);Object.defineProperty(t,"Connector",{enumerable:!0,get:function(){return o.Connector}});var i=r(69);Object.defineProperty(t,"FetchConnector",{enumerable:!0,get:function(){return i.FetchConnector}});var a=r(40);Object.defineProperty(t,"XMLHttpConnector",{enumerable:!0,get:function(){return a.XMLHttpConnector}});var s=r(79);Object.defineProperty(t,"IFrameConnector",{enumerable:!0,get:function(){return s.IFrameConnector}});var u=r(80);Object.defineProperty(t,"NodeConnector",{enumerable:!0,get:function(){return u.NodeConnector}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EntityExistsError=t.IllegalEntityError=t.CommunicationError=t.PersistentError=void 0;var n=r(12);Object.defineProperty(t,"PersistentError",{enumerable:!0,get:function(){return n.PersistentError}});var o=r(66);Object.defineProperty(t,"CommunicationError",{enumerable:!0,get:function(){return o.CommunicationError}});var i=r(67);Object.defineProperty(t,"IllegalEntityError",{enumerable:!0,get:function(){return i.IllegalEntityError}});var a=r(68);Object.defineProperty(t,"EntityExistsError",{enumerable:!0,get:function(){return a.EntityExistsError}})},function(e,t,r){"use strict";for(var n=r(8),o=[],i=0;i<256;++i)o.push((i+256).toString(16).substr(1));t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase();if(!Object(n.a)(r))throw TypeError("Stringified UUID is invalid");return r}},function(e,t,r){"use strict";var n=r(62);t.a=function(e){return"string"==typeof e&&n.a.test(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Attribute=t.PersistentAttributeType=void 0;var n,o=r(0),i=r(4);!function(e){e[e.BASIC=0]="BASIC",e[e.ELEMENT_COLLECTION=1]="ELEMENT_COLLECTION",e[e.EMBEDDED=2]="EMBEDDED",e[e.MANY_TO_MANY=3]="MANY_TO_MANY",e[e.MANY_TO_ONE=4]="MANY_TO_ONE",e[e.ONE_TO_MANY=5]="ONE_TO_MANY",e[e.ONE_TO_ONE=6]="ONE_TO_ONE"}(n=t.PersistentAttributeType||(t.PersistentAttributeType={}));var a=Symbol("AttachedState"),s=Symbol("AttachedSize"),u=function(){function e(e,t){this.isId=!1,this.isVersion=!1,this.isAcl=!1,this.order=null,this.accessor=null,this.declaringType=null,this.metadata=null,this.isMetadata=!!t,this.name=e}return e.attachState=function(e,t,r){return void 0===r&&(r=!1),void 0===t||!r&&void 0!==e[a]||Object.defineProperty(e,a,{value:t,configurable:!0}),e[a]},e.attachSize=function(e,t){return void 0!==t&&Object.defineProperty(e,s,{value:t,configurable:!0}),e[s]||-1},Object.defineProperty(e.prototype,"persistentAttributeType",{get:function(){return-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAssociation",{get:function(){return this.persistentAttributeType>n.EMBEDDED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isCollection",{get:function(){return this.persistentAttributeType===n.ELEMENT_COLLECTION},enumerable:!1,configurable:!0}),e.prototype.init=function(e,t){if(this.declaringType)throw new Error("The attribute is already initialized.");this.order=t,this.accessor=new i.Accessor,this.declaringType=e},e.prototype.getValue=function(e){return this.accessor.getValue(e,this)},e.prototype.setValue=function(e,t){this.accessor.setValue(e,this,t)},e.prototype.hasMetadata=function(e){return!!this.metadata&&e in this.metadata},e.prototype.getMetadata=function(e){return this.hasMetadata(e)&&this.metadata[e]||null},e.prototype.toJSON=function(){return o.__assign({name:this.name,order:this.order},this.metadata&&{metadata:this.metadata})},e.PersistentAttributeType=n,e}();t.Attribute=u},function(e,t,r){"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.Type=t.PersistenceType=void 0,function(e){e[e.BASIC=0]="BASIC",e[e.EMBEDDABLE=1]="EMBEDDABLE",e[e.ENTITY=2]="ENTITY",e[e.MAPPED_SUPERCLASS=3]="MAPPED_SUPERCLASS"}(n=t.PersistenceType||(t.PersistenceType={}));var o=function(){function e(e,t){if(0!==e.indexOf("/db/"))throw new SyntaxError("Type ref ".concat(e," is invalid."));this.ref=e,this.name=e.substring(4),this._typeConstructor=t}return Object.defineProperty(e.prototype,"persistenceType",{get:function(){return-1},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isBasic",{get:function(){return this.persistenceType===n.BASIC},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEmbeddable",{get:function(){return this.persistenceType===n.EMBEDDABLE},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isEntity",{get:function(){return this.persistenceType===n.ENTITY},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isMappedSuperclass",{get:function(){return this.persistenceType===n.MAPPED_SUPERCLASS},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typeConstructor",{get:function(){return this._typeConstructor},set:function(e){if(this._typeConstructor)throw new Error("typeConstructor has already been set.");this._typeConstructor=e},enumerable:!1,configurable:!0}),e}();t.Type=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PluralAttribute=t.CollectionType=void 0;var n,o=r(0),i=r(9);!function(e){e[e.COLLECTION=0]="COLLECTION",e[e.LIST=1]="LIST",e[e.MAP=2]="MAP",e[e.SET=3]="SET"}(n=t.CollectionType||(t.CollectionType={}));var a=function(e){function t(t,r,n){var o=e.call(this,t)||this;return o.elementType=n,o.typeConstructor=r,o}return o.__extends(t,e),Object.defineProperty(t.prototype,"persistentAttributeType",{get:function(){return i.PersistentAttributeType.ELEMENT_COLLECTION},enumerable:!1,configurable:!0}),t.prototype.keyValue=function(e){return String(e&&"object"==typeof e&&"id"in e?e.id:e)},t.CollectionType=n,t}(i.Attribute);t.PluralAttribute=a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PersistentError=void 0,t.PersistentError=function(){function e(e,t){Object.prototype.hasOwnProperty.call(Error,"captureStackTrace")?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e||"An unexpected persistent error occurred.",this.name=this.constructor.name,t&&(this.cause=t,t.stack&&(this.stack+="\nCaused By: ".concat(t.stack)))}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0}}),e}(),t.PersistentError.of=function(e){return e instanceof t.PersistentError?e:new t.PersistentError(null,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PersistentAttributeType=t.Attribute=t.BasicType=t.CollectionAttribute=t.EmbeddableType=t.EntityType=t.ListAttribute=t.ManagedType=t.MapAttribute=t.ModelBuilder=t.CollectionType=t.PluralAttribute=t.SetAttribute=t.SingularAttribute=t.PersistenceType=t.Type=t.DbIndex=t.Metamodel=void 0;var n=r(98);Object.defineProperty(t,"Metamodel",{enumerable:!0,get:function(){return n.Metamodel}});var o=r(59);Object.defineProperty(t,"DbIndex",{enumerable:!0,get:function(){return o.DbIndex}});var i=r(10);Object.defineProperty(t,"Type",{enumerable:!0,get:function(){return i.Type}}),Object.defineProperty(t,"PersistenceType",{enumerable:!0,get:function(){return i.PersistenceType}});var a=r(36);Object.defineProperty(t,"SingularAttribute",{enumerable:!0,get:function(){return a.SingularAttribute}});var s=r(58);Object.defineProperty(t,"SetAttribute",{enumerable:!0,get:function(){return s.SetAttribute}});var u=r(11);Object.defineProperty(t,"PluralAttribute",{enumerable:!0,get:function(){return u.PluralAttribute}}),Object.defineProperty(t,"CollectionType",{enumerable:!0,get:function(){return u.CollectionType}});var c=r(54);Object.defineProperty(t,"ModelBuilder",{enumerable:!0,get:function(){return c.ModelBuilder}});var l=r(57);Object.defineProperty(t,"MapAttribute",{enumerable:!0,get:function(){return l.MapAttribute}});var d=r(17);Object.defineProperty(t,"ManagedType",{enumerable:!0,get:function(){return d.ManagedType}});var p=r(56);Object.defineProperty(t,"ListAttribute",{enumerable:!0,get:function(){return p.ListAttribute}});var f=r(34);Object.defineProperty(t,"EntityType",{enumerable:!0,get:function(){return f.EntityType}});var h=r(55);Object.defineProperty(t,"EmbeddableType",{enumerable:!0,get:function(){return h.EmbeddableType}});var y=r(99);Object.defineProperty(t,"CollectionAttribute",{enumerable:!0,get:function(){return y.CollectionAttribute}});var b=r(35);Object.defineProperty(t,"BasicType",{enumerable:!0,get:function(){return b.BasicType}});var g=r(9);Object.defineProperty(t,"Attribute",{enumerable:!0,get:function(){return g.Attribute}}),Object.defineProperty(t,"PersistentAttributeType",{enumerable:!0,get:function(){return g.PersistentAttributeType}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.db=void 0;var n,o,i=r(23);t.db=(n=new i.EntityManagerFactory,o=n.createEntityManager(!0),Object.assign(o,{configure:function(e){return n.configure(e),this},connect:function(e,t,r,o){return t instanceof Function?this.connect(e,void 0,t,r):(n.connect(e,t),this.ready(r,o))}}),o)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Acl=void 0;var n=r(48),o=function(){function e(){this.read=new n.Permission,this.write=new n.Permission}return e.prototype.clear=function(){this.read.clear(),this.write.clear()},e.prototype.copy=function(e){return this.read.copy(e.read),this.write.copy(e.write),this},e.prototype.isPublicReadAllowed=function(){return this.read.isPublicAllowed()},e.prototype.setPublicReadAllowed=function(){return this.read.setPublicAllowed()},e.prototype.isReadAllowed=function(e){return this.read.isAllowed(e)},e.prototype.isReadDenied=function(e){return this.read.isDenied(e)},e.prototype.allowReadAccess=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this.read).allowAccess.apply(e,t),this},e.prototype.denyReadAccess=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this.read).denyAccess.apply(e,t),this},e.prototype.deleteReadAccess=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this.read).deleteAccess.apply(e,t),this},e.prototype.isPublicWriteAllowed=function(){return this.write.isPublicAllowed()},e.prototype.setPublicWriteAllowed=function(){return this.write.setPublicAllowed()},e.prototype.isWriteAllowed=function(e){return this.write.isAllowed(e)},e.prototype.isWriteDenied=function(e){return this.write.isDenied(e)},e.prototype.allowWriteAccess=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this.write).allowAccess.apply(e,t),this},e.prototype.denyWriteAccess=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this.write).denyAccess.apply(e,t),this},e.prototype.deleteWriteAccess=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return(e=this.write).deleteAccess.apply(e,t),this},e.prototype.toJSON=function(){return{read:this.read.toJSON(),write:this.write.toJSON()}},e.prototype.fromJSON=function(e){this.read.fromJSON(e.read||{}),this.write.fromJSON(e.write||{})},e}();t.Acl=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumerable=void 0,t.enumerable=function(e){return function(t,r,n){n.enumerable=e}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ManagedType=void 0;var n=r(0),o=r(10),i=r(4),a=r(1),s=function(e){function t(t,r){var n=e.call(this,0!==t.indexOf("/db/")?"/db/".concat(t):t,r)||this;return n.enhancer=null,n.declaredAttributes=[],n.schemaAddPermission=new a.Permission,n.schemaReplacePermission=new a.Permission,n.metadata=null,n.superType=null,n._validationCode=null,n}return n.__extends(t,e),Object.defineProperty(t.prototype,"validationCode",{get:function(){return this._validationCode},set:function(e){this._validationCode=e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeConstructor",{get:function(){return this._typeConstructor||(this.typeConstructor=this.createProxyClass()),this._typeConstructor},set:function(e){if(this._typeConstructor)throw new Error("Type constructor has already been set.");var t=e.prototype instanceof i.Entity;if(this.isEntity){if(!t)throw new TypeError("Entity classes must extends the Entity class.")}else if(!(e.prototype instanceof i.Managed)||t)throw new TypeError("Embeddable classes must extends the Managed class.");this.enhancer.enhance(this,e),this._typeConstructor=e},enumerable:!1,configurable:!0}),t.prototype.init=function(e){this.enhancer=e,this._typeConstructor&&!i.Enhancer.getIdentifier(this._typeConstructor)&&i.Enhancer.setIdentifier(this._typeConstructor,this.ref)},t.prototype.create=function(){var e=Object.create(this.typeConstructor.prototype);return i.Managed.init(e),e},t.prototype.attributes=function(){var e,t,r=0,n=this;return this.superType&&(t=this.superType.attributes()),(e={})[Symbol.iterator]=function(){return this},e.next=function(){if(t){var e=t.next();if(!e.done)return e;t=null}if(r<n.declaredAttributes.length){var o=n.declaredAttributes[r];return r+=1,{value:o,done:!1}}return{done:!0,value:void 0}},e},t.prototype.addAttribute=function(e,t){if(this.getAttribute(e.name))throw new Error("An attribute with the name ".concat(e.name," is already declared."));var r;r=e.order?e.order:void 0===t?this.declaredAttributes.length:t,e.init(this,r),this.declaredAttributes.push(e),this._typeConstructor&&"Object"!==this.name&&this.enhancer.enhanceProperty(this._typeConstructor,e)},t.prototype.removeAttribute=function(e){var t=this.declaredAttributes.length;if(this.declaredAttributes=this.declaredAttributes.filter((function(t){return t.name!==e})),t===this.declaredAttributes.length)throw new Error("An Attribute with the name ".concat(e," is not declared."))},t.prototype.getAttribute=function(e){var t=this.getDeclaredAttribute(e);return!t&&this.superType&&(t=this.superType.getAttribute(e)),t},t.prototype.getDeclaredAttribute=function(e){return this.declaredAttributes.filter((function(t){return t.name===e||t.order===e}))[0]||null},t.prototype.fromJsonValue=function(e,t,r,n){if(!t||!r)return null;for(var o=this.attributes(),i=o.next();!i.done;i=o.next()){var a=i.value;n.onlyMetadata&&!a.isMetadata||a.setJsonValue(e,r,t[a.name],n)}return r},t.prototype.toJsonValue=function(e,t,r){if(!(t instanceof this.typeConstructor))return null;for(var n={},o=this.attributes(),i=o.next();!i.done;i=o.next()){var a=i.value;r.excludeMetadata&&a.isMetadata||(n[a.name]=a.getJsonValue(e,t,r))}return n},t.prototype.toJSON=function(){var e={};return this.declaredAttributes.forEach((function(t){t.isMetadata||(e[t.name]=t)})),n.__assign(n.__assign(n.__assign({class:this.ref,fields:e,acl:{schemaAdd:this.schemaAddPermission.toJSON(),schemaReplace:this.schemaReplacePermission.toJSON()}},this.superType&&{superClass:this.superType.ref}),this.isEmbeddable&&{embedded:!0}),this.metadata&&{metadata:this.metadata})},t.prototype.references=function(){var e,t,r,n=this.attributes();return(e={})[Symbol.iterator]=function(){return this},e.next=function(){for(;;){if(r){var e=r.next();if(!e.done)return{value:{path:[t.name].concat(e.value.path)}};r=null}var o=n.next();if(o.done)return{done:!0,value:void 0};var i=(t=o.value).isCollection?t.elementType:t.type;if(i.isEntity)return{value:{path:[t.name]}};i.isEmbeddable&&(r=i.references())}},e},t.prototype.hasMetadata=function(e){return!!this.metadata&&!!this.metadata[e]},t.prototype.getMetadata=function(e){return this.hasMetadata(e)?this.metadata[e]:null},t}(o.Type);t.ManagedType=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Node=void 0;var n=r(0),o=r(4),i=r(19),a=n.__importStar(r(2)),s=r(1),u=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.firstResult=0,t.maxResults=-1,t.order={},t}return n.__extends(t,e),t.prototype.resultList=function(e,t,r){var n,o=this;if(e instanceof Function)return this.resultList({},e,t);var s=this.resultClass?this.entityManager.metamodel.entity(this.resultClass):null;if(!s)throw new Error("Only typed queries can be executed.");var u,c=this.serializeQuery(),l=this.serializeSort();return u=((null===(n=this.entityManager.connection)||void 0===n?void 0:n.host.length)||0)+c.length+l.length>i.Query.MAX_URI_SIZE?new a.AdhocQueryPOST(s.name,this.firstResult,this.maxResults,l).entity(c,"text"):new a.AdhocQuery(s.name,c,this.firstResult,this.maxResults,l),this.entityManager.send(u).then((function(t){return o.createResultList(t.entity,e)})).then(t,r)},t.prototype.singleResult=function(e,t,r){var n,o=this;if(e instanceof Function)return this.singleResult({},e,t);var s=this.resultClass?this.entityManager.metamodel.entity(this.resultClass):null;if(!s)throw new Error("Only typed queries can be executed.");var u,c=this.serializeQuery(),l=this.serializeSort();return u=((null===(n=this.entityManager.connection)||void 0===n?void 0:n.host.length)||0)+c.length>i.Query.MAX_URI_SIZE?new a.AdhocQueryPOST(s.name,this.firstResult,1,l).entity(c,"text"):new a.AdhocQuery(s.name,c,this.firstResult,1,l),this.entityManager.send(u).then((function(t){return o.createResultList(t.entity,e)})).then((function(e){return e.length?e[0]:null})).then(t,r)},t.prototype.count=function(e,t){var r,n=this.resultClass?this.entityManager.metamodel.entity(this.resultClass):null;if(!n)throw new Error("Only typed queries can be executed.");var o,s=this.serializeQuery();return o=((null===(r=this.entityManager.connection)||void 0===r?void 0:r.host.length)||0)+s.length>i.Query.MAX_URI_SIZE?new a.AdhocCountQueryPOST(n.name).entity(s,"text"):new a.AdhocCountQuery(n.name,s),this.entityManager.send(o).then((function(e){return e.entity.count})).then(e,t)},t.prototype.serializeQuery=function(){return JSON.stringify(this,(function(e,t){var r=this[e];return r instanceof Date?{$date:t}:r instanceof o.Entity?r.id:t}))},t.prototype.serializeSort=function(){return JSON.stringify(this.order)},t.prototype.createResultList=function(e,t){var r=this;return e.length?Promise.all(e.map((function(e){if(e.id){var n=r.entityManager.getReference(r.resultClass,e.id),o=s.Metadata.get(n);return o.type.fromJsonValue(o,e,n,{persisting:!0}),r.entityManager.resolveDepth(n,t)}return r.entityManager.load(Object.keys(e)[0])}))).then((function(e){return e.filter((function(e){return!!e}))})):Promise.resolve([])},t.prototype.addOrder=function(e,t){return"string"==typeof e?this.order[e]=t:this.order=e,this},t.prototype.addOffset=function(e){return this.firstResult=e,this},t.prototype.addLimit=function(e){return this.maxResults=e,this},t}(i.Query);t.Node=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.flatArgs=t.Query=void 0;var n=function(){function e(e,t){this.entityManager=e,this.resultClass=t}return e.prototype.ascending=function(e){return this.addOrder(e,1)},e.prototype.descending=function(e){return this.addOrder(e,-1)},e.prototype.sort=function(e){if("object"!=typeof e||Object.getPrototypeOf(e)!==Object.prototype)throw new Error("sort must be an object.");return this.addOrder(e)},e.prototype.offset=function(e){if(e<0)throw new Error("The offset can't be nagative.");return this.addOffset(e)},e.prototype.limit=function(e){if(e<0)throw new Error("The limit can't be nagative.");return this.addLimit(e)},e.MAX_URI_SIZE=2e3,e}();t.Query=n,t.flatArgs=function(e){return Array.prototype.concat.apply([],e)}},function(e,t,r){"use strict";var n=r(8);t.a=function(e){if(!Object(n.a)(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=255&t,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=255&t,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=255&t,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=255&t,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=255&t,r}},function(e,t,r){"use strict";var n;r.d(t,"a",(function(){return i}));var o=new Uint8Array(16);function i(){if(!n&&!(n="undefined"!=typeof crypto&&