opengate-js 14.0.0 → 14.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/bower.json +1 -1
  2. package/dist/{opengate-api-bower-14.0.0.js → opengate-api-bower-14.1.0.js} +21 -16
  3. package/dist/opengate-api-bower-14.1.0.js.map +1 -0
  4. package/dist/{opengate-api-bower-14.0.0.min.js → opengate-api-bower-14.1.0.min.js} +2 -2
  5. package/dist/{opengate-api-bower-14.0.0.min.js.map → opengate-api-bower-14.1.0.min.js.map} +1 -1
  6. package/dist/src/operations/OperationActions.js +2 -0
  7. package/dist/src/operations/OperationActions.js.map +1 -1
  8. package/dist/src/operations/catalog/BaseOperationBuilder.js +14 -11
  9. package/dist/src/operations/catalog/BaseOperationBuilder.js.map +1 -1
  10. package/docs/ast/source/operations/OperationActions.js.json +8300 -7782
  11. package/docs/ast/source/operations/catalog/BaseOperationBuilder.js.json +10013 -9786
  12. package/docs/class/src/operations/OperationActions.js~OperationActions.html +2 -2
  13. package/docs/class/src/operations/catalog/BaseOperationBuilder.js~BaseOperationBuilder.html +22 -15
  14. package/docs/coverage.json +1 -1
  15. package/docs/dump.json +1970 -1914
  16. package/docs/file/src/operations/OperationActions.js.html +2 -0
  17. package/docs/file/src/operations/catalog/BaseOperationBuilder.js.html +12 -11
  18. package/docs/package.json +1 -1
  19. package/docs/source.html +239 -239
  20. package/features/features/provision/operations/actions_execution.feature +105 -52
  21. package/features/features/provision/operations/execute_operations.feature +152 -112
  22. package/features/features/provision/operations/execute_periodic_operations.feature +115 -64
  23. package/features/features/provision/operations/find_execution.feature +49 -11
  24. package/features/features/provision/operations/find_executions.feature +51 -11
  25. package/features/features/provision/operations/find_periodic_execution.feature +48 -11
  26. package/features/features/provision/operations/setting_up_period-each_operation.feature +88 -23
  27. package/features/features/provision/operations/update_periodic_operation.feature +88 -46
  28. package/features/features/provision/users/update_password.feature +0 -1
  29. package/features/features/provision/users/update_user.feature +0 -1
  30. package/features/features/searching/operations/searching_executions.feature +47 -7
  31. package/features/features/searching/operations/searching_periodic_operations.feature +51 -10
  32. package/features/step_definitions/given_step_definitions.js +12 -5
  33. package/features/step_definitions/then_step_definitions.js +44 -35
  34. package/features/step_definitions/when_step_definitions.js +16 -10
  35. package/features/support/create_provision_model.js +6 -0
  36. package/features/support/find_model.js +4 -0
  37. package/features/support/utils_model.js +26 -20
  38. package/features/support/world.js +2 -2
  39. package/package.json +1 -1
  40. package/src/operations/OperationActions.js +2 -0
  41. package/src/operations/catalog/BaseOperationBuilder.js +12 -11
  42. package/yarn-error.log +7437 -0
  43. package/dist/opengate-api-bower-14.0.0.js.map +0 -1
@@ -58,5 +58,5 @@ i.version="2.29.4",r=Rt,i.fn=Dr,i.min=function(){return Nt("isBefore",[].slice.c
58
58
  * Authors:
59
59
  * fengmk2 <fengmk2@gmail.com> (http://fengmk2.com)
60
60
  */
61
- "use strict";var n=e("iconv-lite");function i(e){return!e||("utf8"===(e=e.toLowerCase())||"utf-8"===e)}function a(e,t){if(i(t))return encodeURIComponent(e);for(var r=n.encode(e,t),a="",o="",s=0;s<r.length;s++)1===(o=r[s].toString("16")).length&&(o="0"+o),a+="%"+o;return a=a.toUpperCase()}function o(e,t){if(i(t))return decodeURIComponent(e);for(var a=[],o=0;o<e.length;)"%"===e[o]?(o++,a.push(parseInt(e.substring(o,o+2),16)),o+=2):(a.push(e.charCodeAt(o)),o++);var s=new r(a);return n.decode(s,t)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return e=String(e),e=/^[\x00-\x7F]*$/.test(e)?encodeURIComponent(e):a(e,t)}var c=function(e,t,r){"string"!=typeof t&&(r=t||{},t=null);var n=r.charset||"utf-8";return Array.isArray(e)?function(e,t,r){var n=[];if(!t)throw new TypeError("stringify expects an object");for(var i=0;i<e.length;i++)n.push(c(e[i],t+"["+i+"]",r));return n.join("&")}(e,t,r):"[object Object]"==={}.toString.call(e)?function(e,t,r){for(var n,i=[],o=Object.keys(e),s=r.charset,l=0,p=o.length;l<p;++l)""!==(n=o[l])&&(null===e[n]?i.push(a(n,s)+"="):i.push(c(e[n],t?t+"["+u(n,s)+"]":u(n,s),r)));return i.join("&")}(e,t,r):"string"==typeof e?function(e,t,r){if(!t)throw new TypeError("stringify expects an object");var n=r.charset;return t+"="+u(e,n)}(e,t,r):t+"="+u(String(e),n)};t.exports=a,t.exports.encode=a,t.exports.decode=o,t.exports.parse=function(e,t,r,n){"object"==typeof t&&(n=t,t=null),t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(t);var u=1e3,c=null;n&&("number"==typeof n.maxKeys&&(u=n.maxKeys),"string"==typeof n.charset&&(c=n.charset));var l=e.length;u>0&&l>u&&(l=u);for(var p=0;p<l;++p){var f,d,h,m,v=e[p].replace(a,"%20"),y=v.indexOf(r);if(y>=0?(f=v.substr(0,y),d=v.substr(y+1)):(f=v,d=""),f&&f.indexOf("%")>=0)try{h=o(f,c)}catch(e){h=f}else h=f;if(d&&d.indexOf("%")>=0)try{m=o(d,c)}catch(e){m=d}else m=d;s(i,h)?Array.isArray(i[h])?i[h].push(m):i[h]=[i[h],m]:i[h]=m}return i},t.exports.stringify=c}).call(this,e("buffer").Buffer)},{buffer:52,"iconv-lite":96}],139:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return u.default}});var n=f(e("./v1.js")),i=f(e("./v3.js")),a=f(e("./v4.js")),o=f(e("./v5.js")),s=f(e("./nil.js")),u=f(e("./version.js")),c=f(e("./validate.js")),l=f(e("./stringify.js")),p=f(e("./parse.js"));function f(e){return e&&e.__esModule?e:{default:e}}},{"./nil.js":142,"./parse.js":143,"./stringify.js":147,"./v1.js":148,"./v3.js":149,"./v4.js":151,"./v5.js":152,"./validate.js":153,"./version.js":154}],140:[function(e,t,r){"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function i(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e,t,r,n,a,o){return i((s=i(i(t,e),i(n,o)))<<(u=a)|s>>>32-u,r);var s,u}function o(e,t,r,n,i,o,s){return a(t&r|~t&n,e,t,i,o,s)}function s(e,t,r,n,i,o,s){return a(t&n|r&~n,e,t,i,o,s)}function u(e,t,r,n,i,o,s){return a(t^r^n,e,t,i,o,s)}function c(e,t,r,n,i,o,s){return a(r^(t|~n),e,t,i,o,s)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,n="0123456789abcdef";for(let i=0;i<r;i+=8){const r=e[i>>5]>>>i%32&255,a=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let r=1732584193,a=-271733879,l=-1732584194,p=271733878;for(let t=0;t<e.length;t+=16){const n=r,f=a,d=l,h=p;r=o(r,a,l,p,e[t],7,-680876936),p=o(p,r,a,l,e[t+1],12,-389564586),l=o(l,p,r,a,e[t+2],17,606105819),a=o(a,l,p,r,e[t+3],22,-1044525330),r=o(r,a,l,p,e[t+4],7,-176418897),p=o(p,r,a,l,e[t+5],12,1200080426),l=o(l,p,r,a,e[t+6],17,-1473231341),a=o(a,l,p,r,e[t+7],22,-45705983),r=o(r,a,l,p,e[t+8],7,1770035416),p=o(p,r,a,l,e[t+9],12,-1958414417),l=o(l,p,r,a,e[t+10],17,-42063),a=o(a,l,p,r,e[t+11],22,-1990404162),r=o(r,a,l,p,e[t+12],7,1804603682),p=o(p,r,a,l,e[t+13],12,-40341101),l=o(l,p,r,a,e[t+14],17,-1502002290),a=o(a,l,p,r,e[t+15],22,1236535329),r=s(r,a,l,p,e[t+1],5,-165796510),p=s(p,r,a,l,e[t+6],9,-1069501632),l=s(l,p,r,a,e[t+11],14,643717713),a=s(a,l,p,r,e[t],20,-373897302),r=s(r,a,l,p,e[t+5],5,-701558691),p=s(p,r,a,l,e[t+10],9,38016083),l=s(l,p,r,a,e[t+15],14,-660478335),a=s(a,l,p,r,e[t+4],20,-405537848),r=s(r,a,l,p,e[t+9],5,568446438),p=s(p,r,a,l,e[t+14],9,-1019803690),l=s(l,p,r,a,e[t+3],14,-187363961),a=s(a,l,p,r,e[t+8],20,1163531501),r=s(r,a,l,p,e[t+13],5,-1444681467),p=s(p,r,a,l,e[t+2],9,-51403784),l=s(l,p,r,a,e[t+7],14,1735328473),a=s(a,l,p,r,e[t+12],20,-1926607734),r=u(r,a,l,p,e[t+5],4,-378558),p=u(p,r,a,l,e[t+8],11,-2022574463),l=u(l,p,r,a,e[t+11],16,1839030562),a=u(a,l,p,r,e[t+14],23,-35309556),r=u(r,a,l,p,e[t+1],4,-1530992060),p=u(p,r,a,l,e[t+4],11,1272893353),l=u(l,p,r,a,e[t+7],16,-155497632),a=u(a,l,p,r,e[t+10],23,-1094730640),r=u(r,a,l,p,e[t+13],4,681279174),p=u(p,r,a,l,e[t],11,-358537222),l=u(l,p,r,a,e[t+3],16,-722521979),a=u(a,l,p,r,e[t+6],23,76029189),r=u(r,a,l,p,e[t+9],4,-640364487),p=u(p,r,a,l,e[t+12],11,-421815835),l=u(l,p,r,a,e[t+15],16,530742520),a=u(a,l,p,r,e[t+2],23,-995338651),r=c(r,a,l,p,e[t],6,-198630844),p=c(p,r,a,l,e[t+7],10,1126891415),l=c(l,p,r,a,e[t+14],15,-1416354905),a=c(a,l,p,r,e[t+5],21,-57434055),r=c(r,a,l,p,e[t+12],6,1700485571),p=c(p,r,a,l,e[t+3],10,-1894986606),l=c(l,p,r,a,e[t+10],15,-1051523),a=c(a,l,p,r,e[t+1],21,-2054922799),r=c(r,a,l,p,e[t+8],6,1873313359),p=c(p,r,a,l,e[t+15],10,-30611744),l=c(l,p,r,a,e[t+6],15,-1560198380),a=c(a,l,p,r,e[t+13],21,1309151649),r=c(r,a,l,p,e[t+4],6,-145523070),p=c(p,r,a,l,e[t+11],10,-1120210379),l=c(l,p,r,a,e[t+2],15,718787259),a=c(a,l,p,r,e[t+9],21,-343485551),r=i(r,n),a=i(a,f),l=i(l,d),p=i(p,h)}return[r,a,l,p]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))};r.default=l},{}],141:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};r.default=n},{}],142:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default="00000000-0000-0000-0000-000000000000"},{}],143:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const 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};r.default=a},{"./validate.js":153}],144:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},{}],145:[function(e,t,r){"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)};const i=new Uint8Array(16)},{}],146:[function(e,t,r){"use strict";function n(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function i(e,t){return e<<t|e>>>32-t}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const a=e.length/4+2,o=Math.ceil(a/16),s=new Array(o);for(let t=0;t<o;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];s[t]=r}s[o-1][14]=8*(e.length-1)/Math.pow(2,32),s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<o;++e){const a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=s[e][t];for(let e=16;e<80;++e)a[e]=i(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let o=r[0],u=r[1],c=r[2],l=r[3],p=r[4];for(let e=0;e<80;++e){const r=Math.floor(e/20),s=i(o,5)+n(r,u,c,l)+p+t[r]+a[e]>>>0;p=l,l=c,c=i(u,30)>>>0,u=o,o=s}r[0]=r[0]+o>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+c>>>0,r[3]=r[3]+l>>>0,r[4]=r[4]+p>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]};r.default=a},{}],147:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.unsafeStringify=o;var n,i=(n=e("./validate.js"))&&n.__esModule?n:{default:n};const a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));function o(e,t=0){return a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]}var s=function(e,t=0){const r=o(e,t);if(!(0,i.default)(r))throw TypeError("Stringified UUID is invalid");return r};r.default=s},{"./validate.js":153}],148:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./rng.js"))&&n.__esModule?n:{default:n},a=e("./stringify.js");let o,s,u=0,c=0;var l=function(e,t,r){let n=t&&r||0;const l=t||new Array(16);let p=(e=e||{}).node||o,f=void 0!==e.clockseq?e.clockseq:s;if(null==p||null==f){const t=e.random||(e.rng||i.default)();null==p&&(p=o=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==f&&(f=s=16383&(t[6]<<8|t[7]))}let d=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:c+1;const m=d-u+(h-c)/1e4;if(m<0&&void 0===e.clockseq&&(f=f+1&16383),(m<0||d>u)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=d,c=h,s=f,d+=122192928e5;const v=(1e4*(268435455&d)+h)%4294967296;l[n++]=v>>>24&255,l[n++]=v>>>16&255,l[n++]=v>>>8&255,l[n++]=255&v;const y=d/4294967296*1e4&268435455;l[n++]=y>>>8&255,l[n++]=255&y,l[n++]=y>>>24&15|16,l[n++]=y>>>16&255,l[n++]=f>>>8|128,l[n++]=255&f;for(let e=0;e<6;++e)l[n+e]=p[e];return t||(0,a.unsafeStringify)(l)};r.default=l},{"./rng.js":145,"./stringify.js":147}],149:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=a(e("./v35.js")),i=a(e("./md5.js"));function a(e){return e&&e.__esModule?e:{default:e}}var o=(0,n.default)("v3",48,i.default);r.default=o},{"./md5.js":140,"./v35.js":150}],150:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.URL=r.DNS=void 0,r.default=function(e,t,r){function n(e,n,o,s){var u;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=(0,a.default)(n)),16!==(null===(u=n)||void 0===u?void 0:u.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(n),c.set(e,n.length),c=r(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,o){s=s||0;for(let e=0;e<16;++e)o[s+e]=c[e];return o}return(0,i.unsafeStringify)(c)}try{n.name=e}catch(e){}return n.DNS=o,n.URL=s,n};var n,i=e("./stringify.js"),a=(n=e("./parse.js"))&&n.__esModule?n:{default:n};const o="6ba7b810-9dad-11d1-80b4-00c04fd430c8";r.DNS=o;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";r.URL=s},{"./parse.js":143,"./stringify.js":147}],151:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./native.js")),i=o(e("./rng.js")),a=e("./stringify.js");function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const o=(e=e||{}).random||(e.rng||i.default)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=o[e];return t}return(0,a.unsafeStringify)(o)};r.default=s},{"./native.js":141,"./rng.js":145,"./stringify.js":147}],152:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=a(e("./v35.js")),i=a(e("./sha1.js"));function a(e){return e&&e.__esModule?e:{default:e}}var o=(0,n.default)("v5",80,i.default);r.default=o},{"./sha1.js":146,"./v35.js":150}],153:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./regex.js"))&&n.__esModule?n:{default:n};var a=function(e){return"string"==typeof e&&i.default.test(e)};r.default=a},{"./regex.js":144}],154:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};r.default=a},{"./validate.js":153}],155:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("q")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/ai",void 0,["organization","file"],"north/ai"),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return this._organization+"/models/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withFile",value:function(e){this._file=e}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/models",{modelFile:this._file||void 0}}},{key:"_composeUpdateElement",value:function(){return i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this)}},{key:"prediction",value:function(e){var t=o.default.defer(),r=t.promise;return this._ogapi.Napi.post(this._buildURL()+"/prediction",e,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){t.resolve({statusCode:e.statusCode,body:e.body})})).catch((function(e){t.reject(e)})),r}},{key:"create",value:function(){var e=this._composeElement(),t=o.default.defer();return this._ogapi.Napi.post_multipart(this._resource,{modelFile:e.modelFile},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;case 201:n=e.status;var i=e.header&&e.header.location;t.resolve({location:i,statusCode:n});break;case 204:t.resolve(e);break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}})).catch((function(e){t.reject(e)})),t.promise}},{key:"update",value:function(){var e=this._composeElement(),t=o.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),{modelFile:e.modelFile},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){if(200===e.statusCode){var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n})}else t.reject({errors:e.data.errors,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),t.promise}}]),t}(a(e("../provision/BaseProvision")).default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],156:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","AIModel not found","north")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"downloadByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._filename=!0,this._download()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/models"+(this._identifier?"/"+this._identifier+(this._filename?"/file":""):"")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],157:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=i(e("http-status-codes")),s=function(){function e(t,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._api=t.Napi,this._apiSouth=t.Sapi,this._baseUrl=r,this._entity=n,this._error_not_found=i,this._id=void 0,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=a}return n(e,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._id}},{key:"_withId",value:function(e){return this._id=e,this}},{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"_execute",value:function(e){this._api;e&&this._apiSouth;var t=a.default.defer(),r=t.promise,n=this._entity,i=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!1,this._getServiceBaseURL()).then((function(e){if(204===e.statusCode)t.reject({error:i,statusCode:o.default.NOT_FOUND});else if(e.body){var r=e.body[n]&&e.body.provision?e.body:e.body[n];t.resolve({data:r||e.body,statusCode:e.statusCode})}else t.resolve({data:e.text,statusCode:e.statusCode})})).catch((function(e){400===e.statusCode&&(e.statusCode=o.default.NOT_FOUND),t.reject(e)})),r}},{key:"_downloadUrl",value:function(){return this._composeUrl()}},{key:"_download",value:function(e){var t=a.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(this._downloadUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!e,this._getServiceBaseURL()).then((function(e){204===e.statusCode?t.reject({data:n,statusCode:o.default.NOT_FOUND}):t.resolve({data:e,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}();r.default=s,t.exports=r.default},{"http-status-codes":76,q:120}],158:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a,o,s=e("./operations/Operations"),u=i(s),c=e("./users/UserFinder"),l=i(c),p=e("./geocluster/GeoclusterFinder"),f=i(p),d=e("./geocluster/Geocluster"),h=i(d),m=e("./security/Certificates"),v=i(m),y=e("./users/Users"),g=i(y),_=e("./organizations/OrganizationFinder"),b=i(_),w=e("./channels/ChannelFinder"),E=i(w),x=e("./searching/builder/AreasSearchBuilder"),O=i(x),A=e("./searching/builder/DatasetsCatalogSearchBuilder"),S=i(A),P=e("./areas/AreaFinder"),D=i(P),k=e("./searching/builder/BulkSearchBuilder"),C=i(k),j=e("./searching/builder/BulkExecutionSearchBuilder"),T=i(j),F=e("./bulk/BulkFinder"),M=i(F),R=e("./bulk/BulkExecutionFinder"),B=i(R),I=e("./channels/Channels"),N=i(I),U=e("./areas/Areas"),L=i(U),z=e("./datasets/Datasets"),G=i(z),q=e("./timeseries/Timeseries"),V=i(q),H=e("./searching/builder/ChannelsSearchBuilder"),W=i(H),Y=e("./rulesConfiguration/RuleConfigurations"),$=i(Y),K=e("./rulesConfiguration/RuleConfigurationsFinder"),J=i(K),Q=e("./rulesConfiguration/RuleConfigurationsCatalog"),X=i(Q),Z=e("./rulesConfiguration/RuleConfigurationsHelper"),ee=i(Z),te=e("./datasets/DatasetFinder"),re=i(te),ne=e("./timeseries/TimeseriesFinder"),ie=i(ne),ae=e("./timeseriesFunctionsCatalog/TimeseriesFunctionFinder"),oe=i(ae),se=e("./timeseriesFunctionsCatalog/TimeseriesFunction"),ue=i(se),ce=e("./timeseriesFunctionsCatalog/TimeseriesFunctionsHelper"),le=i(ce),pe=e("./operationTypes/OperationType"),fe=i(pe),de=e("./operationTypes/OperationTypeFinder"),he=i(de),me=e("./operationTypes/OperationTypeCatalog"),ve=i(me),ye=e("./security/CertificateFinder"),ge=i(ye),_e=e("./operations/OperationFinder"),be=i(_e),we=e("./searching/FilterBuilder"),Ee=i(we),xe=e("./searching/SelectBuilder"),Oe=i(xe),Ae=e("./operations/OperationActions"),Se=i(Ae),Pe=e("./operations/PeriodicityActions"),De=i(Pe),ke=e("./util/Expression"),Ce=i(ke),je=e("./util/SelectElement"),Te=i(je),Fe=e("./searching/builder/RawSearchBuilder"),Me=i(Fe),Re=e("./searching/builder/DevicesSearchBuilder"),Be=i(Re),Ie=e("./searching/builder/SubscribersSearchBuilder"),Ne=i(Ie),Ue=e("./searching/builder/SubscriptionsSearchBuilder"),Le=i(Ue),ze=e("./searching/builder/AssetsSearchBuilder"),Ge=i(ze),qe=e("./searching/builder/TicketsSearchBuilder"),Ve=i(qe),He=e("./searching/builder/TasksSearchBuilder"),We=i(He),Ye=e("./searching/builder/OperationsSearchBuilder"),$e=i(Ye),Ke=e("./searching/builder/ExecutionsSearchBuilder"),Je=i(Ke),Qe=i(e("./searching/builder/ExecutionsHistorySearchBuilder")),Xe=i(e("./searching/builder/AlarmsSearchBuilder")),Ze=i(e("./searching/builder/DatamodelsSearchBuilder")),et=i(e("./searching/builder/FeedsSearchBuilder")),tt=i(e("./searching/builder/DatastreamsSearchBuilder")),rt=i(e("./searching/builder/DatapointsSearchBuilder")),nt=i(e("./searching/builder/BundlesSearchBuilder")),it=i(e("./searching/builder/CertificatesSearchBuilder")),at=i(e("./searching/builder/HardwaresSearchBuilder")),ot=i(e("./searching/builder/SoftwaresSearchBuilder")),st=i(e("./searching/builder/OperationalStatusSearchBuilder")),ut=i(e("./searching/builder/ServiceGroupSearchBuilder")),ct=i(e("./searching/builder/AdministrativeStateSearchBuilder")),lt=i(e("./searching/builder/CommunicationsModuleTypeSearchBuilder")),pt=i(e("./searching/builder/FieldsDefinitionSearchBuilder")),ft=i(e("./searching/builder/BasicTypesSearchBuilder")),dt=i(e("./searching/builder/MobilePhoneProviderSearchBuilder")),ht=i(e("./searching/builder/IoTDatastreamPeriodSearchBuilder")),mt=i(e("./searching/builder/ResourceTypeSearchBuilder")),vt=i(e("./searching/builder/AllowedResourceTypeSearchBuilder")),yt=i(e("./searching/builder/IoTDatastreamAccessSearchBuilder")),gt=i(e("./searching/builder/IoTDatastreamStoragePeriodSearchBuilder")),_t=i(e("./searching/builder/TicketSeveritySearchBuilder")),bt=i(e("./searching/builder/TicketPrioritySearchBuilder")),wt=i(e("./searching/builder/TicketStatusSearchBuilder")),Et=i(e("./searching/builder/RulesSearchBuilder")),xt=i(e("./searching/builder/OperationTypesSearchBuilder")),Ot=i(e("./searching/builder/UsersSearchBuilder")),At=i(e("./searching/builder/DomainsSearchBuilder")),St=i(e("./searching/builder/PlansSearchBuilder")),Pt=i(e("./searching/builder/DevicesPlansSearchBuilder")),Dt=i(e("./bundles/Bundles")),kt=i(e("./bundles/BundleFinder")),Ct=i(e("./organizations/Organizations")),jt=i(e("./domains/Domains")),Tt=i(e("./domains/DomainsFinder")),Ft=i(e("./entities/DeviceFinder")),Mt=i(e("./entities/TicketFinder")),Rt=i(e("./entities/SubscriptionsFinder")),Bt=i(e("./entities/SubscribersFinder")),It=i(e("./collection/devices/DeviceMessage")),Nt=i(e("./collection/devices/collect/Datastreams")),Ut=i(e("./collection/devices/collect/Datapoint")),Lt=i(e("./collection/devices/collect/Hardware")),zt=i(e("./collection/devices/collect/Software")),Gt=i(e("./collection/devices/collect/Storage")),qt=i(e("./collection/devices/collect/Usage")),Vt=i(e("./collection/devices/collect/PowerSupply")),Ht=i(e("./collection/devices/collect/CommsModuleMessage")),Wt=i(e("./collection/devices/collect/Mobile")),Yt=i(e("./collection/devices/collect/Subscriber")),$t=i(e("./collection/devices/collect/Subscription")),Kt=i(e("./workgroups/WorkgroupRelations")),Jt=i(e("./workgroups/Workgroups")),Qt=i(e("./workgroups/WorkgroupFinder")),Xt=i(e("./searching/builder/WorkgroupsSearchBuilder")),Zt=i(e("./workgroups/WorkgroupRelationsFinder")),er=i(e("./searching/builder/UserProfilesSearchBuilder")),tr=i(e("./iot/datamodels/Datamodels")),rr=i(e("./iot/datamodels/DatamodelsHelper")),nr=i(e("./iot/datamodels/DatamodelsFinder")),ir=i(e("./iot/catalog/Datastream")),ar=i(e("./iot/catalog/Qrating")),or=i(e("./provision/entities/EntityBuilder")),sr=i(e("./provision/bulk/BulkExecutionBuilder")),ur=i(e("./searching/builder/EntitiesSearchBuilder")),cr=i(e("./searching/builder/DatasetEntitiesSearchBuilder")),lr=i(e("./searching/builder/DatasetSearchBuilder")),pr=i(e("./searching/builder/TimeserieSearchBuilder")),fr=i(e("./searching/builder/CountryCodesSearchBuilder")),dr=i(e("./searching/builder/TimezoneSearchBuilder")),hr=i(e("./searching/builder/UserLanguagesSearchBuilder")),mr=i(e("./provisionProcessors/provisionProcessors")),vr=i(e("./provisionProcessors/provisionProcessorsFinder")),yr=i(e("./entities/EntityFinder")),gr=i(e("./alarms/AlarmActions")),_r=i(e("superagent")),br=i(e("./connectorsFunctions/configuration/ConnectorFunctionsHelper")),wr=i(e("./connectorsFunctions/configuration/ConnectorFunctionsFinder")),Er=i(e("./connectorsFunctions/configuration/ConnectorFunctions")),xr=i(e("./connectorsFunctions/catalog/ConnectorFunctions")),Or=i(e("./connectorsFunctions/catalog/ConnectorFunctionsCatalogFinder")),Ar=i(e("./connectorsFunctions/catalog/ConnectorFunctionsCatalog")),Sr=i(e("./pipelines/PipelineFinder")),Pr=i(e("./transformers/TransformerFinder")),Dr=i(e("./AIModels/AIModelsFinder")),kr=i(e("./transformers/Transformers")),Cr=i(e("./AIModels/AIModels")),jr=i(e("./pipelines/Pipelines")),Tr=i(e("./manufacturers/Manufacturer")),Fr=i(e("./manufacturers/Model")),Mr=i(e("./manufacturers/ManufacturerFinder")),Rr=i(e("./manufacturers/ModelFinder")),Br=i(e("./organization_manufacturer/Manufacturer")),Ir=i(e("./organization_manufacturer/Model")),Nr=i(e("./organization_manufacturer/ManufacturerFinder")),Ur=i(e("./organization_manufacturer/ModelFinder")),Lr=i(e("./provision/country/CountriesCatalog")),zr=(a=void 0,o=_r.default.Request.prototype.end,_r.default.Request.prototype.end=function(e){return a&&a.call&&a(this),o.call(this,(function(t,r){"function"==typeof e&&e(t,r)}))},function(e){a=e}),Gr=function(){function e(t,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("object"!=typeof t)throw new Error("Must instance mandatory parameter: northAmpliaREST");if("object"!=typeof r)throw new Error("Must instance mandatory parameter: southAmpliaREST");n.hooks&&n.hooks.beforeStart&&"function"==typeof n.hooks.beforeStart&&zr(n.hooks.beforeStart),this.Napi=t,this.Sapi=r,this.EX=Ce.default,this.SE=Te.default,this.operations=new u.default(this),this.alarms=new gr.default(this),this.entityBuilder=new or.default(this)}return n(e,[{key:"newUserFinder",value:function(){return new l.default(this)}},{key:"newGeoclusterFinder",value:function(){return new f.default(this)}},{key:"geoclusterBuilder",value:function(){return new h.default(this)}},{key:"newOrganizationFinder",value:function(){return new b.default(this)}},{key:"newChannelFinder",value:function(){return new E.default(this)}},{key:"areasSearchBuilder",value:function(){return new O.default(this)}},{key:"datasetsCatalogSearchBuilder",value:function(){return new S.default(this)}},{key:"bulkSearchBuilder",value:function(){return new C.default(this)}},{key:"bulkExecutionSearchBuilder",value:function(){return new T.default(this)}},{key:"newBulkFinder",value:function(){return new M.default(this)}},{key:"newBulkExecutionFinder",value:function(){return new B.default(this)}},{key:"newAreaFinder",value:function(){return new D.default(this)}},{key:"newOperationFinder",value:function(){return new be.default(this)}},{key:"newOperationTypeFinder",value:function(){return new he.default(this)}},{key:"newOperationTypeCatalog",value:function(){return new ve.default(this)}},{key:"newCountriesCatalog",value:function(){return new Lr.default(this)}},{key:"operationTypeBuilder",value:function(e,t,r){return new fe.default(this,e,t,r)}},{key:"newRuleConfigurationsFinder",value:function(){return new J.default(this)}},{key:"newRuleConfigurationsHelper",value:function(){return new ee.default(this)}},{key:"newDatasetFinder",value:function(){return new re.default(this)}},{key:"newTimeserieFinder",value:function(){return new ie.default(this)}},{key:"newRuleConfigurationsCatalog",value:function(){return new X.default(this)}},{key:"ruleConfigurationBuilder",value:function(e,t,r,n){return new $.default(this,e,t,r,n)}},{key:"newCertificateFinder",value:function(){return new ge.default(this)}},{key:"newDeviceFinder",value:function(){return new Ft.default(this)}},{key:"newTicketFinder",value:function(){return new Mt.default(this)}},{key:"newSubscriptionsFinder",value:function(){return new Rt.default(this)}},{key:"newSubscribersFinder",value:function(){return new Bt.default(this)}},{key:"newEntityFinder",value:function(){return new yr.default(this)}},{key:"newFilterBuilder",value:function(){return new Ee.default}},{key:"newSelectBuilder",value:function(){return new Oe.default}},{key:"rawSearchBuilder",value:function(){return new Me.default(this)}},{key:"usersSearchBuilder",value:function(){return new Ot.default(this)}},{key:"domainsSearchBuilder",value:function(){return new At.default(this)}},{key:"devicesSearchBuilder",value:function(){return new Be.default(this)}},{key:"assetsSearchBuilder",value:function(){return new Ge.default(this)}},{key:"subscribersSearchBuilder",value:function(){return new Ne.default(this)}},{key:"subscriptionsSearchBuilder",value:function(){return new Le.default(this)}},{key:"ticketsSearchBuilder",value:function(){return new Ve.default(this)}},{key:"communicationsModuleTypeSearchBuilder",value:function(){return new lt.default(this)}},{key:"fieldsDefinitionSearchBuilder",value:function(){return new pt.default(this)}},{key:"mobilePhoneProviderSearchBuilder",value:function(){return new dt.default(this)}},{key:"ioTDatastreamPeriodSearchBuilder",value:function(){return new ht.default(this)}},{key:"resourceTypeSearchBuilder",value:function(){return new mt.default(this)}},{key:"allowedResourceTypeSearchBuilder",value:function(){return new vt.default(this)}},{key:"ioTDatastreamAccessSearchBuilder",value:function(){return new yt.default(this)}},{key:"ioTDatastreamStoragePeriodSearchBuilder",value:function(){return new gt.default(this)}},{key:"ticketSeveritySearchBuilder",value:function(){return new _t.default(this)}},{key:"ticketPrioritySearchBuilder",value:function(){return new bt.default(this)}},{key:"ticketStatusSearchBuilder",value:function(){return new wt.default(this)}},{key:"rulesSearchBuilder",value:function(){return new Et.default(this)}},{key:"operationTypesSearchBuilder",value:function(){return new xt.default(this)}},{key:"tasksSearchBuilder",value:function(){return new We.default(this)}},{key:"operationsSearchBuilder",value:function(){return new $e.default(this)}},{key:"executionsSearchBuilder",value:function(){return new Je.default(this)}},{key:"executionsHistorySearchBuilder",value:function(){return new Qe.default(this)}},{key:"alarmsSearchBuilder",value:function(){return new Xe.default(this)}},{key:"datastreamsSearchBuilder",value:function(){return new tt.default(this)}},{key:"datamodelsSearchBuilder",value:function(){return new Ze.default(this)}},{key:"feedsSearchBuilder",value:function(){return new et.default(this)}},{key:"datapointsSearchBuilder",value:function(){return new rt.default(this)}},{key:"bundlesSearchBuilder",value:function(){return new nt.default(this)}},{key:"certificatesSearchBuilder",value:function(){return new it.default(this)}},{key:"basicTypesSearchBuilder",value:function(){return new ft.default(this)}},{key:"entitiesSearchBuilder",value:function(){return new ur.default(this)}},{key:"datasetEntitiesSearchBuilder",value:function(e,t){return new cr.default(this,e,t)}},{key:"datasetSearchBuilder",value:function(e,t){return new lr.default(this,e,t)}},{key:"timeserieSearchBuilder",value:function(e,t){return new pr.default(this,e,t)}},{key:"plansSearchBuilder",value:function(){return new St.default(this)}},{key:"devicesPlansSearchBuilder",value:function(){return new Pt.default(this)}},{key:"bundlesBuilder",value:function(){return new Dt.default(this)}},{key:"newBundleFinder",value:function(){return new kt.default(this)}},{key:"organizationsBuilder",value:function(){return new Ct.default(this)}},{key:"domainsBuilder",value:function(){return new jt.default(this)}},{key:"newDomainFinder",value:function(){return new Tt.default(this)}},{key:"usersBuilder",value:function(){return new g.default(this)}},{key:"certificatesBuilder",value:function(){return new v.default(this)}},{key:"hardwaresSearchBuilder",value:function(){return new at.default(this)}},{key:"softwaresSearchBuilder",value:function(){return new ot.default(this)}},{key:"operationalStatusSearchBuilder",value:function(){return new st.default(this)}},{key:"serviceGroupSearchBuilder",value:function(){return new ut.default(this)}},{key:"administrativeStateSearchBuilder",value:function(){return new ct.default(this)}},{key:"deviceMessageBuilder",value:function(){return new It.default(this)}},{key:"datastreamBuilder",value:function(){return new Nt.default(this)}},{key:"datapointsBuilder",value:function(){return new Ut.default(this)}},{key:"hardwareMessageBuilder",value:function(){return new Lt.default(this)}},{key:"softwareMessageBuilder",value:function(){return new zt.default(this)}},{key:"storageMessageBuilder",value:function(){return new Gt.default(this)}},{key:"usageMessageBuilder",value:function(){return new qt.default(this)}},{key:"powerSupplyMessageBuilder",value:function(){return new Vt.default(this)}},{key:"commsModuleMessageMessageBuilder",value:function(){return new Ht.default(this)}},{key:"subscriberMessageBuilder",value:function(){return new Yt.default(this)}},{key:"subscriptionMessageBuilder",value:function(){return new $t.default(this)}},{key:"mobileMessageMessageBuilder",value:function(){return new Wt.default(this)}},{key:"newOperationActions",value:function(e){return new Se.default(this,e)}},{key:"newPeriodicityActions",value:function(e){return new De.default(this,e)}},{key:"workgroupRelationsBuilder",value:function(){return new Kt.default(this)}},{key:"newWorkgroupRelationsFinder",value:function(){return new Zt.default(this)}},{key:"workgroupsBuilder",value:function(){return new Jt.default(this)}},{key:"newWorkgroupFinder",value:function(){return new Qt.default(this)}},{key:"workgroupsSearchBuilder",value:function(){return new Xt.default(this)}},{key:"channelsBuilder",value:function(){return new N.default(this)}},{key:"areasBuilder",value:function(){return new L.default(this)}},{key:"datasetsBuilder",value:function(){return new G.default(this)}},{key:"timeseriesBuilder",value:function(){return new V.default(this)}},{key:"newTimeseriesFunctionFinder",value:function(){return new oe.default(this)}},{key:"timeseriesFunctionBuilder",value:function(e,t){return new ue.default(this,e,t)}},{key:"newTimeseriesFunctionsHelper",value:function(){return new le.default(this)}},{key:"channelsSearchBuilder",value:function(){return new W.default(this)}},{key:"userProfilesSearchBuilder",value:function(){return new er.default(this)}},{key:"datamodelsBuilder",value:function(e){return new tr.default(this,e)}},{key:"datamodelsHelper",value:function(e,t){return new rr.default(this,e,t)}},{key:"newDatamodelsFinder",value:function(){return new nr.default(this)}},{key:"datastreamsBuilder",value:function(){return new ir.default(this)}},{key:"bulkExecutionBuilder",value:function(e,t,r){return new sr.default(this,e,t,r)}},{key:"qratingsBuilder",value:function(){return new ar.default(this)}},{key:"countryCodesSearchBuilder",value:function(){return new fr.default(this)}},{key:"timezoneSearchBuilder",value:function(){return new dr.default(this)}},{key:"userLanguagesSearchBuilder",value:function(){return new hr.default(this)}},{key:"newConnectorFunctionsFinder",value:function(){return new wr.default(this)}},{key:"newConnectorFunctionsCatalogFinder",value:function(){return new Or.default(this)}},{key:"newConnectorFunctionsCatalog",value:function(){return new Ar.default(this)}},{key:"newConnectorFunctionsHelper",value:function(){return new br.default(this)}},{key:"connectorFunctionsBuilder",value:function(e,t,r,n){return new Er.default(this,e,t,r,n)}},{key:"connectorFunctionsCatalogBuilder",value:function(e,t){return new xr.default(this,e,t)}},{key:"provisionProcessorsBuilder",value:function(){return new mr.default(this)}},{key:"newProvisionProcessorsFinder",value:function(){return new vr.default(this)}},{key:"newPipelineFinder",value:function(){return new Sr.default(this)}},{key:"newTransformerFinder",value:function(){return new Pr.default(this)}},{key:"newAIModelFinder",value:function(){return new Dr.default(this)}},{key:"transformersBuilder",value:function(){return new kr.default(this)}},{key:"aiModelsBuilder",value:function(){return new Cr.default(this)}},{key:"pipelinesBuilder",value:function(){return new jr.default(this)}},{key:"manufacturersBuilder",value:function(){return new Tr.default(this)}},{key:"manufacturerModelsBuilder",value:function(e){return new Fr.default(this,e)}},{key:"newManufacturersFinder",value:function(){return new Mr.default(this)}},{key:"newModelFinder",value:function(){return new Rr.default(this)}},{key:"organizationManufacturersBuilder",value:function(e){return new Br.default(this,e)}},{key:"organizationManufacturerModelsBuilder",value:function(e,t){return new Ir.default(this,e,t)}},{key:"newOrganizationManufacturersFinder",value:function(){return new Nr.default(this)}},{key:"newOrganizationModelFinder",value:function(){return new Ur.default(this)}}]),e}();r.default=Gr,t.exports=r.default},{"./AIModels/AIModels":155,"./AIModels/AIModelsFinder":156,"./alarms/AlarmActions":160,"./areas/AreaFinder":165,"./areas/Areas":166,"./bulk/BulkExecutionFinder":168,"./bulk/BulkFinder":169,"./bundles/BundleFinder":171,"./bundles/Bundles":172,"./channels/ChannelFinder":179,"./channels/Channels":180,"./collection/devices/DeviceMessage":181,"./collection/devices/collect/CommsModuleMessage":182,"./collection/devices/collect/Datapoint":183,"./collection/devices/collect/Datastreams":184,"./collection/devices/collect/Hardware":186,"./collection/devices/collect/Mobile":187,"./collection/devices/collect/PowerSupply":188,"./collection/devices/collect/Software":189,"./collection/devices/collect/Storage":190,"./collection/devices/collect/Subscriber":191,"./collection/devices/collect/Subscription":192,"./collection/devices/collect/Usage":193,"./connectorsFunctions/catalog/ConnectorFunctions":203,"./connectorsFunctions/catalog/ConnectorFunctionsCatalog":204,"./connectorsFunctions/catalog/ConnectorFunctionsCatalogFinder":205,"./connectorsFunctions/configuration/ConnectorFunctions":206,"./connectorsFunctions/configuration/ConnectorFunctionsFinder":207,"./connectorsFunctions/configuration/ConnectorFunctionsHelper":208,"./datasets/DatasetFinder":209,"./datasets/Datasets":210,"./domains/Domains":211,"./domains/DomainsFinder":212,"./entities/DeviceFinder":213,"./entities/EntityFinder":214,"./entities/SubscribersFinder":215,"./entities/SubscriptionsFinder":216,"./entities/TicketFinder":217,"./geocluster/Geocluster":218,"./geocluster/GeoclusterFinder":219,"./iot/catalog/Datastream":221,"./iot/catalog/Qrating":222,"./iot/datamodels/Datamodels":223,"./iot/datamodels/DatamodelsFinder":224,"./iot/datamodels/DatamodelsHelper":225,"./manufacturers/Manufacturer":226,"./manufacturers/ManufacturerFinder":227,"./manufacturers/Model":229,"./manufacturers/ModelFinder":230,"./operationTypes/OperationType":232,"./operationTypes/OperationTypeCatalog":233,"./operationTypes/OperationTypeFinder":234,"./operations/OperationActions":235,"./operations/OperationFinder":236,"./operations/Operations":237,"./operations/PeriodicityActions":238,"./organization_manufacturer/Manufacturer":253,"./organization_manufacturer/ManufacturerFinder":254,"./organization_manufacturer/Model":255,"./organization_manufacturer/ModelFinder":256,"./organizations/OrganizationFinder":257,"./organizations/Organizations":258,"./pipelines/PipelineFinder":259,"./pipelines/Pipelines":260,"./provision/bulk/BulkExecutionBuilder":262,"./provision/country/CountriesCatalog":263,"./provision/entities/EntityBuilder":269,"./provisionProcessors/provisionProcessors":276,"./provisionProcessors/provisionProcessorsFinder":277,"./rulesConfiguration/RuleConfigurations":278,"./rulesConfiguration/RuleConfigurationsCatalog":279,"./rulesConfiguration/RuleConfigurationsFinder":280,"./rulesConfiguration/RuleConfigurationsHelper":281,"./searching/FilterBuilder":288,"./searching/SelectBuilder":291,"./searching/builder/AdministrativeStateSearchBuilder":294,"./searching/builder/AlarmsSearchBuilder":295,"./searching/builder/AllowedResourceTypeSearchBuilder":296,"./searching/builder/AreasSearchBuilder":297,"./searching/builder/AssetsSearchBuilder":298,"./searching/builder/BasicTypesSearchBuilder":299,"./searching/builder/BulkExecutionSearchBuilder":300,"./searching/builder/BulkSearchBuilder":301,"./searching/builder/BundlesSearchBuilder":302,"./searching/builder/CertificatesSearchBuilder":303,"./searching/builder/ChannelsSearchBuilder":304,"./searching/builder/CommunicationsModuleTypeSearchBuilder":305,"./searching/builder/CountryCodesSearchBuilder":306,"./searching/builder/DatamodelsSearchBuilder":307,"./searching/builder/DatapointsSearchBuilder":308,"./searching/builder/DatasetEntitiesSearchBuilder":309,"./searching/builder/DatasetSearchBuilder":310,"./searching/builder/DatasetsCatalogSearchBuilder":311,"./searching/builder/DatastreamsSearchBuilder":312,"./searching/builder/DevicesPlansSearchBuilder":313,"./searching/builder/DevicesSearchBuilder":314,"./searching/builder/DomainsSearchBuilder":315,"./searching/builder/EntitiesSearchBuilder":316,"./searching/builder/ExecutionsHistorySearchBuilder":317,"./searching/builder/ExecutionsSearchBuilder":318,"./searching/builder/FeedsSearchBuilder":319,"./searching/builder/FieldsDefinitionSearchBuilder":320,"./searching/builder/HardwaresSearchBuilder":322,"./searching/builder/IoTDatastreamAccessSearchBuilder":323,"./searching/builder/IoTDatastreamPeriodSearchBuilder":324,"./searching/builder/IoTDatastreamStoragePeriodSearchBuilder":325,"./searching/builder/MobilePhoneProviderSearchBuilder":326,"./searching/builder/OperationTypesSearchBuilder":327,"./searching/builder/OperationalStatusSearchBuilder":328,"./searching/builder/OperationsSearchBuilder":329,"./searching/builder/PlansSearchBuilder":330,"./searching/builder/RawSearchBuilder":332,"./searching/builder/ResourceTypeSearchBuilder":333,"./searching/builder/RulesSearchBuilder":334,"./searching/builder/ServiceGroupSearchBuilder":337,"./searching/builder/SoftwaresSearchBuilder":338,"./searching/builder/SubscribersSearchBuilder":339,"./searching/builder/SubscriptionsSearchBuilder":340,"./searching/builder/TasksSearchBuilder":341,"./searching/builder/TicketPrioritySearchBuilder":342,"./searching/builder/TicketSeveritySearchBuilder":343,"./searching/builder/TicketStatusSearchBuilder":344,"./searching/builder/TicketsSearchBuilder":345,"./searching/builder/TimeserieSearchBuilder":346,"./searching/builder/TimezoneSearchBuilder":347,"./searching/builder/UserLanguagesSearchBuilder":348,"./searching/builder/UserProfilesSearchBuilder":349,"./searching/builder/UsersSearchBuilder":350,"./searching/builder/WorkgroupsSearchBuilder":351,"./security/CertificateFinder":353,"./security/Certificates":354,"./timeseries/Timeseries":358,"./timeseries/TimeseriesFinder":359,"./timeseriesFunctionsCatalog/TimeseriesFunction":361,"./timeseriesFunctionsCatalog/TimeseriesFunctionFinder":362,"./timeseriesFunctionsCatalog/TimeseriesFunctionsHelper":363,"./transformers/TransformerFinder":364,"./transformers/Transformers":365,"./users/UserFinder":366,"./users/Users":367,"./util/Expression":369,"./util/SelectElement":371,"./workgroups/WorkgroupFinder":377,"./workgroups/WorkgroupRelations":378,"./workgroups/WorkgroupRelationsFinder":379,"./workgroups/Workgroups":380,superagent:131}],159:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./GenericFinder"),a=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/"+r,n,i)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./GenericFinder":157}],160:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./actions/AlarmAttendBuilder")),o=i(e("./actions/AlarmCloseBuilder")),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t}return n(e,[{key:"newCloseBuilder",value:function(){return new o.default(this._ogapi)}},{key:"newAttendBuilder",value:function(){return new a.default(this._ogapi)}}]),e}();r.default=s,t.exports=r.default},{"./actions/AlarmAttendBuilder":163,"./actions/AlarmCloseBuilder":164}],161:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._resource=r,this._postObj=n}return n(e,[{key:"execute",value:function(){var e=this,t=o.default.defer();return this._ogapi.Napi.post(this._resource,this._postObj).then((function(r){var n=void 0;try{n=JSON.parse(r.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:n||{},statusCode:r.statusCode,location:r.header.location})})).catch((function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)})),t.promise}}]),e}();r.default=s,t.exports=r.default},{q:120}],162:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./Alarm"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._action=r,this._resource="alarms",this._build={alarms:[],notes:void 0,action:r},this.constructor===e)throw new Error("Cannot construct Abstract instances directly")}return n(e,[{key:"addAlarmId",value:function(e){if("string"!=typeof e)throw new Error("Parameter alarmId must be a string");return this._build.alarms.push(e),this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("Parameter notes must be a string");return this._build.notes=e,this}},{key:"build",value:function(){if(0===this._build.alarms.length)throw new Error("Builder error. You must append at least one alarmId with addAlarmId method");return"string"!=typeof this._build.notes&&delete this._build.notes,new o.default(this._ogapi,this._resource,this._build)}}]),e}();r.default=s,t.exports=r.default},{"./Alarm":161}],163:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./AlarmActionBuilder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ATTEND")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./AlarmActionBuilder":162}],164:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./AlarmActionBuilder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"CLOSE")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./AlarmActionBuilder":162}],165:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","area","Area/s not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._checkString(e,"organization"),this._checkString(t,"identifier"),this._organization=e,this._identifier=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/areas/"+this._identifier}},{key:"_checkString",value:function(e,t){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],166:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=e("./TYPE_ENUM"),s=a(e("../provision/BaseProvision")),u=a(e("../util/formats/check_types")),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["identifier","organization","type","coordinates"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return"provision/organizations/"+this._organization+"/areas/"+this._identifier}},{key:"withOrganization",value:function(e){return u.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return u.default._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return u.default._checkStringAndLength(e,50,"name"),this._name=e,this}},{key:"withColor",value:function(e){return u.default._checkStringAndLength(e,50,"color"),this._color=e,this}},{key:"withDescription",value:function(e){return u.default._checkStringAndLength(e,50,"description"),this._description=e,this}},{key:"withOrder",value:function(e){return u.default._checkNumber(e,"order"),this._order=e,this}},{key:"withGeometry",value:function(e,t){return u.default._checkType(e,o.TYPE_ENUM),u.default._checkArray(t,"coordinates"),this._type=e,this._coordinates=t,this}},{key:"withEntities",value:function(e){return u.default._checkArray(e,"entities"),this._entities=e,this}},{key:"_composeElement",value:function(){return this._resource="provision/organizations/"+this._organization+"/areas/",{identifier:this._identifier,name:this._name,description:this._description,order:this._order,color:this._color,geometry:{type:this._type,coordinates:this._coordinates},entities:this._entities}}},{key:"_composeUpdateElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.identifier,e}}]),t}(s.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":261,"../util/formats/check_types":373,"./TYPE_ENUM":167}],167:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.TYPE_ENUM=["Polygon","Point","LineString"]},{}],168:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=(i(e("q")),i(e("http-status-codes")),["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]);r.MIME_TYPES_ENUM=o;var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","value","Bulk not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/bulk/"+this._id+(this._details?"/details":"")}},{key:"findByOrganizationAndId",value:function(e,t,r){if(this._organization=e,this._id=t,this._details=!1,r){var n="";if(void 0===o.find((function(e){return e==this}),r)&&(n=r),""!==n)throw new Error("Parameter mimetype is not allowed. Parameter value <'"+JSON.stringify(n)+"'>, mimetype allowed <'"+JSON.stringify(o)+"'>");return this._details=!0,this._setExtraHeaders({accept:r}),this._download()}return this._details=!1,this._setExtraHeaders({accept:void 0}),this._execute()}}]),t}(a.default);r.default=s},{"../GenericFinder":157,"http-status-codes":76,q:120}],169:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=(i(e("q")),i(e("http-status-codes")),function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","bulk/async","Bulk not found"),this._raw=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndId",value:function(e,t,r,n){return this._organization=e,this._id=t,this._setUrlParameters({format:r}),n&&this._setExtraHeaders({accept:n}),this._download(!0)}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._entity+"/"+this._id}}]),t}(a.default));r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159,"http-status-codes":76,q:120}],170:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ACTION_ENUM=["HARDWARE_RESET","SOFTWARE_RESET","COMMS_DOWN","COMMS_UP","COMMS_RESET"]},{}],171:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"bundles","bundle","Bundle not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._name+"/versions/"+this._version}},{key:"findByNameAndVersion",value:function(e,t){return this._name=e,this._version=t,this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],172:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=e("./ACTION_ENUM"),s=a(e("./deployment/DeploymentElement")),u=a(e("q")),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/bundles")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>255)throw new Error("OGAPI_NAME_PARAMETER_MAX_LENGTH_255");return this._name=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withHardware",value:function(e){if("string"!=typeof e)throw new Error("Parameter hardware must be a string");return this._hardware=e,this}},{key:"withWorkgroup",value:function(e){if("string"!=typeof e)throw new Error("Parameter workgroup must be a string");return this._workgroup=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withTimeout",value:function(e){if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._timeout=e,this}},{key:"_checkActions",value:function(e,t){if(void 0===e||e.constructor!==Array)throw new Error("Parameter "+t+" must be typeof Array");for(var r=[],n=0;n<e.length;n++){void 0===o.ACTION_ENUM.find((function(e){return e==this}),e[n])&&r.push(e[n])}if(0!==r.length)throw new Error("Any action into parameter "+t+" is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, "+t+" allowed <'"+JSON.stringify(o.ACTION_ENUM)+"'>");return e}},{key:"withPreaction",value:function(e){return this._preaction=this._checkActions(e,"preaction"),this}},{key:"withPostaction",value:function(e){return this._postaction=this._checkActions(e,"postaction"),this}},{key:"withUserNotes",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"notes"});return this._userNotes=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be a boolean");return this._active=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return{bundle:{name:this._name||void 0,version:this._version||void 0,hardware:this._hardware||void 0,workgroup:this._workgroup||void 0,description:this._description||void 0,preaction:this._preaction||void 0,postaction:this._postaction||void 0,userNotes:this._userNotes||void 0,active:this._active||void 0}}}},{key:"_buildURL",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return this._resource+"/"+this._name+"/versions/"+this._version}},{key:"activate",value:function(){var e=u.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),{bundle:{active:!0}},void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_BUNDLE_NOT_ACTIVE"}],statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"deactivate",value:function(){var e=u.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),{bundle:{active:!1}},void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_BUNDLE_NOT_DEACTIVE"}],statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"addDeploymentElement",value:function(e){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");this._deploymentElements||(this._deploymentElements=[]);var t=new s.default(this._parent,this._ogapi,encodeURI(this._buildURL()),e);return this._deploymentElements.push(t),this._deploymentElements[this._deploymentElements.length-1]}},{key:"deployAndActivate",value:function(){var e=this,t=u.default.defer(),r=t.promise;if(e._deploymentElements&&e._deploymentElements.length>0){var n=0,i=0;for(i=0;i<e._deploymentElements.length;i++){var a=0;if(e._deploymentElements[i]._validators&&e._deploymentElements[i]._validators.length>0)for(a=0;a<e._deploymentElements[i]._validators.length;a++)"TRUSTED_BOOT"===e._deploymentElements[i]._validators[a].mode&&(n+=1)}if(n>1)throw new Error("OGAPI_422_ONE_TRUSTED_BOOT_ALLOWED")}e._allPromisesOk=!0;var o=function(r){e.delete(),t.reject(r)};return e.create().then((function(r){var n,i;201===r.statusCode?(i=r,e._deploymentElements&&e._deploymentElements.length>0?(n=[],e._deploymentElements.forEach((function(e){n.push(e.deploy())})),Promise.all(n).then((function(){e._allPromisesOk&&e.activate().then((function(e,r){t.resolve(i)})).catch((function(e){t.reject(e)}))})).catch((function(t){e._allPromisesOk=!1,o(t)}))):t.resolve(i)):o({statusCode:r.statusCode})})).catch(o),r}},{key:"create",value:function(){var e=this;if(void 0===this._name||void 0===this._version||void 0===this._hardware||void 0===this._workgroup)throw new Error("Parameters name, version, hardware and workgroup must be defined");var r=u.default.defer(),n=r.promise,a=function(e){201===e.statusCode?r.resolve(e):o({statusCode:e.statusCode})},o=function(e){r.reject(e)};return this._ogapi.newBundleFinder().findByNameAndVersion(this._name,this._version).then((function(n){204===n.statusCode?i(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(a).catch(o):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})})).catch((function(n){404===n.statusCode?i(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(a).catch(o):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})})),n}},{key:"update",value:function(){var e=u.default.defer(),t=e.promise,r=this._composeElement();return delete r.bundle.name,delete r.bundle.version,delete r.bundle.workgroup,delete r.bundle.hardware,this._ogapi.Napi.put(this._buildURL(),r,void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_400_BUNDLE_NOT_UPDATED"}],statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a(e("../provision/BaseProvision")).default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":261,"./ACTION_ENUM":170,"./deployment/DeploymentElement":173,q:120}],173:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=e("./OPERATION_ENUM"),o=e("./OPTION_ENUM"),s=e("./TYPE_ENUM"),u=e("./TYPE_VALIDATORS_ENUM"),c=e("./MODE_VALIDATORS_ENUM"),l=i(e("q")),p=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,r,n+"/deploymentElements"),this._progressEvent=i,this._resource=n+"/deploymentElements",this.validation=!1,this._name=void 0,this._version=void 0,this._type=void 0,this._path=void 0,this._order=void 0,this._operation=void 0,this._option=void 0,this._fileName=void 0,this._downloadUrl=void 0,this._validators=void 0,this._oldName=void 0,this._oldVersion=void 0,this._oldPath=void 0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withType",value:function(e){if(void 0===e||"string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});var t="";if(void 0===s.TYPE_ENUM.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error({message:"OGAPI_NOT_ALLOWED_PARAMETER",parameter:JSON.stringify(t),allowed:JSON.stringify(s.TYPE_ENUM)});return this._type=e,this}},{key:"withPath",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"path"});return this._path=e,this}},{key:"withOrder",value:function(e){return this._order=e,this}},{key:"withOperation",value:function(e){if(void 0===e||"string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"operation"});var t="";if(void 0===a.OPERATION_ENUM.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error("Parameter operation is not allowed. Parameter value <'"+JSON.stringify(t)+"'>, operation allowed <'"+JSON.stringify(a.OPERATION_ENUM)+"'>");return this._operation=e,this}},{key:"withOption",value:function(e){if(void 0===e||"string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"option"});var t="";if(void 0===o.OPTION_ENUM.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error("Parameter option is not allowed. Parameter value <'"+JSON.stringify(t)+"'>, option allowed <'"+JSON.stringify(o.OPTION_ENUM)+"'>");return this._option=e,this}},{key:"withValidators",value:function(e){var t={},r=[];if(void 0===e||e.constructor!==Array)throw new Error("Parameter validators must be typeof Array");for(var n=!1,i=0;i<e.length;i++){if("TRUSTED_BOOT"===(t=this._checkValidator(e[i])).mode){if(n)throw new Error("OGAPI_422_ONE_TRUSTED_BOOT_ALLOWED_DEPLOY_ELEMENT");n=!0}r.push(t)}return this._validators=r,this}},{key:"_checkValidator",value:function(e){var t={};if(e.mode){var r="",n=e.mode;if(void 0===n||"string"!=typeof n)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});if(void 0===c.MODE_VALIDATORS_ENUM.find((function(e){return e==this}),n)&&(r=n),""!==r)throw new Error("Parameter type is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, type allowed <'"+JSON.stringify(c.MODE_VALIDATORS_ENUM)+"'>");if("TRUSTED_BOOT"===n&&("TRUSTED_BOOT"!==n||"FIRMWARE"!==this._type))throw new Error("TRUSTED_BOOT validator only allowed for FIRMWARE deployment element");t.mode=n}else t.mode=c.MODE_VALIDATORS_ENUM[0];if(!e.type)throw new Error("Parameter type is required");r="";var i=e.type;if(void 0===i||"string"!=typeof i)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});if(void 0===u.TYPE_VALIDATORS_ENUM.find((function(e){return e==this}),i)&&(r=i),""!==r)throw new Error("Parameter type is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, type allowed <'"+JSON.stringify(u.TYPE_VALIDATORS_ENUM)+"'>");if(t.type=i,t.mode===c.MODE_VALIDATORS_ENUM[0]){if(!e.value)throw new Error("Parameter value is required when mode is "+c.MODE_VALIDATORS_ENUM[0]);var a=e.value;if("string"!=typeof a)throw new Error("Parameter value must be a string");t.value=a}return t}},{key:"withDownloadUrl",value:function(e){if("string"!=typeof e)throw new Error("Parameter downloadUrl must be a string");return this._downloadUrl=e,this}},{key:"withFileName",value:function(e){if("string"!=typeof e)throw new Error("Parameter fileName must be a string");return this._fileName=e,this}},{key:"withValidation",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter validation must be a boolean");return this.validation=e,this}},{key:"withOldName",value:function(e){if("string"!=typeof e)throw new Error("Parameter old name must be a string");return this._oldName=e,this}},{key:"withOldVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter old version must be a string");return this._oldVersion=e,this}},{key:"withOldPath",value:function(e){if("string"!=typeof e)throw new Error("Parameter old path must be a string");return this._oldPath=e,this}},{key:"withFile",value:function(e){return this._rawFile=e,this}},{key:"_composeUrlCreate",value:function(){if(void 0===this._name||void 0===this._version||""===this._name||""===this._version)throw new Error("Method not allowed - You must to define the name and version");return this._setUrlParameters({fileValidationRequired:this.validation}),this._resource}},{key:"_composeElement",value:function(){if("UPGRADE"===this._operation){if(void 0===this._name||void 0===this._version||void 0===this._type||void 0===this._path||void 0===this._order||void 0===this._operation||void 0===this._oldName||void 0===this._oldVersion||void 0===this._oldPath)throw new Error("Method not allowed - You must define the basic element [name, version, type, path, order, operation, oldName, oldVersion and oldPath ]")}else if(void 0===this._name||void 0===this._version||void 0===this._type||void 0===this._path||void 0===this._order||void 0===this._operation||void 0===this._option)throw new Error("Method not allowed - You must define the basic element [name, version, type, path, order, option and operation]");return{deploymentElement:{name:this._name||void 0,version:this._version||void 0,type:this._type||void 0,path:this._path||void 0,order:this._order||void 0,operation:this._operation||void 0,option:this._option||void 0,fileName:this._fileName||void 0,downloadUrl:this._downloadUrl||void 0,validators:this._validators||void 0,oldName:this._oldName||void 0,oldVersion:this._oldVersion||void 0,oldPath:this._oldPath||void 0}}}},{key:"withTimeout",value:function(e){if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._timeout=e,this}},{key:"_buildURL",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return this._resource+"/"+this._name+"/version/"+this._version}},{key:"createWithFile",value:function(e){var t=void 0;if("string"!=typeof e){t=new FormData;var r=new Blob([JSON.stringify(this._composeElement())],{type:"application/octet-stream"});t.append("meta",r),e&&t.append("file",e)}else(t={}).meta=JSON.stringify(this._composeElement()),e&&(t.file=e);var n={};null!=this._progressEvent&&(n={progress:this._progressEvent});var i=l.default.defer(),a=i.promise;return this._ogapi.Napi.post_multipart(this._composeUrlCreate(),t,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){201===e.statusCode?i.resolve({location:e.header.location,statusCode:e.statusCode}):i.reject({errors:[{code:e.statusCode,message:"OGAPI_FILE_NOT_CREATE"}],statusCode:e.statusCode})})).catch((function(e){i.reject(e)})),a}},{key:"deploy",value:function(){return this.createWithFile(this._rawFile)}},{key:"update",value:function(){throw new Error("OGAPI_DEPLOYMENT_ELEMENT_NOT_UPDATED")}}]),t}(i(e("../../provision/BaseProvision")).default);r.default=p,t.exports=r.default},{"../../provision/BaseProvision":261,"./MODE_VALIDATORS_ENUM":174,"./OPERATION_ENUM":175,"./OPTION_ENUM":176,"./TYPE_ENUM":177,"./TYPE_VALIDATORS_ENUM":178,q:120}],174:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MODE_VALIDATORS_ENUM=["PLATFORM","TRUSTED_BOOT"]},{}],175:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.OPERATION_ENUM=["INSTALL","UNINSTALL","UPGRADE"]},{}],176:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.OPTION_ENUM=["MANDATORY","OPTIONAL"]},{}],177:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.TYPE_ENUM=["SOFTWARE","FIRMWARE","CONFIGURATION","PARAMETERS"]},{}],178:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.TYPE_VALIDATORS_ENUM=["MD2","MD5","SHA-1","SHA-256","SHA-384","SHA-512","CERTIFICATE_SIGN"]},{}],179:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","channel","Channel not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndName",value:function(e,t){return this._organization=e,this._name=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._name}},{key:"findByDomainAndWorkgroup",value:function(e,t){this._domain=e,this._workgroup=t;var r=this._error_not_found,n=o.default.defer(),i=n.promise;return this._executeWorkgroupRelation().then((function(e){if(204===e.statusCode)n.reject({data:r,statusCode:s.default.NO_CONTENT});else{var t=e.data,i=[];for(var a in t.channels)i.push({organization:t.channels[a].organization,name:t.channels[a].channel});n.resolve({data:i,statusCode:e.statusCode})}})).catch((function(e){n.reject(e)})),i}},{key:"findByDomainAndWorkgroupAndOrganization",value:function(e,t,r){var n=this;n._domain=e,n._workgroup=t,n._organization=r;var i=n._error_not_found,a=o.default.defer(),u=a.promise;return n._executeWorkgroupRelation().then((function(e){if(204===e.statusCode)a.reject({data:i,statusCode:s.default.NOT_FOUND});else{var t=e.data,r=[];for(var o in t.channels)n._organization===t.channels[o].organization&&r.push({organization:t.channels[o].organization,name:t.channels[o].channel});r.length>0?a.resolve({data:r,statusCode:e.statusCode}):a.reject({data:i,statusCode:s.default.NOT_FOUND})}})).catch((function(e){a.reject(e)})),u}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=o.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){204===e.statusCode?t.reject({data:n,statusCode:s.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}}]),t}(a.default);r.default=u,t.exports=r.default},{"../ProvisionGenericFinder":159,"http-status-codes":76,q:120}],180:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}a(e("q"));var o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["name","organization"]),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return"provision/organizations/"+this._organization+"/channels/"+this._name}},{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withCertificate",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"certificate"});return this._certificates||(this._certificates=[]),this._certificates.push(e),this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/organizations/"+this._organization+"/channels",{channel:{name:this._name||void 0,description:this._description||void 0,certificates:this._certificates||void 0}}}},{key:"_composeUpdateElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.channel.name,e}}]),t}(a(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],181:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("q")),s=a(e("./collect/Event")),u=a(e("../devices/collect/Datastreams")),c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._ogapi=e,this._resource="devices",this._iotMessage=void 0,this._dmmMessage=void 0,this._id=void 0,this._version=void 0,this._dataStreamVersion=void 0,this._deviceId=void 0,this._datastreams=[]}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withId",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"id"});return this._id=e,this}},{key:"withDataStreamVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._dataStreamVersion=e,this}},{key:"withDmmVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withDeviceId",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"device"});return this._deviceId=e,this}},{key:"withDataStream",value:function(e){return e instanceof u.default&&this._datastreams.push(e.composeElement()),this}},{key:"_buildIotURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id+"/collect/iot"}},{key:"_buildDmmURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id+"/collect/dmm"}},{key:"_composeIotMessage",value:function(){if(void 0===this._datastreams||void 0===this._dataStreamVersion)throw new Error("Parameters datastreams and version must be defined");return{version:this._dataStreamVersion,device:this._deviceId,datastreams:this._datastreams}}},{key:"_composeDmmMessage",value:function(){if(void 0===this._version)throw new Error("Parameters id must be defined");var e=i(Object.getPrototypeOf(t.prototype),"composeElement",this).call(this);return{version:this._version,event:e}}},{key:"create",value:function(){var e=o.default.defer(),t=e.promise,r=[];return this._datastreams.length>0&&r.push(this._ogapi.Sapi.post(this._buildIotURL(),this._composeIotMessage()).then((function(e){if(201!==e.statusCode)throw new Error("IOT NOT CREATED")}))),void 0!==this._version&&r.push(this._ogapi.Sapi.post(this._buildDmmURL(),this._composeDmmMessage()).then((function(e){if(201!==e.statusCode)throw new Error("DMM NOT CREATED")}))),o.default.all(r).catch((function(t){e.reject({errors:t,statusCode:400})})).done((function(t){e.resolve({statusCode:201})})),t}}]),t}(s.default);r.default=c,t.exports=r.default},{"../devices/collect/Datastreams":184,"./collect/Event":185,q:120}],182:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=e("./enum/ANTENNA_STATUS_ENUM"),o=i(e("./Hardware")),s=i(e("./Software")),u=i(e("./Mobile")),c=i(e("./Subscriber")),l=i(e("./Subscription")),p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._id=void 0,this._name=void 0,this._type=void 0,this._hardware=void 0,this._operationalStatus=void 0,this._antennaStatus=void 0,this._softwareList=[],this._mobile=void 0,this._subscriber=void 0,this._subscription=void 0}return n(e,[{key:"withId",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"id"});return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"name"});return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});return this._type=e,this}},{key:"withHardware",value:function(e){if(!(e instanceof o.default))throw new Error("Parameter hardware must be hardware type");return this._hardware=e,this}},{key:"withOperationalStatus",value:function(e){return this._ogapi.operationalStatusSearchBuilder().withEntityType("COMMUNICATIONS_MODULE").withId(e).build().execute().then((function(e){if(204===e.statusCode)throw new Error("Operational Status not found")})),this._operationalStatus=e,this}},{key:"withAntennaStatus",value:function(e){if("string"!=typeof e)throw new Error("Parameter antennaStatus must be a string");return this._antennaStatus=this._checkValues(e,a.ANTENNA_STATUS_ENUM),this}},{key:"withSoftware",value:function(e){if(!(e instanceof s.default))throw new Error("Parameter software must be software type");return this._softwareList.push(e.composeElement()),this}},{key:"withMobile",value:function(e){if(!(e instanceof u.default))throw new Error("Parameter mobile must be Mobile type");return this._mobile=e,this}},{key:"withSubscriber",value:function(e){if(!(e instanceof c.default))throw new Error("Parameter subscriber must be Subscriber type");return this._subscriber=e,this}},{key:"withSubscription",value:function(e){if(!(e instanceof l.default))throw new Error("Parameter subscription must be Subscription type");return this._subscription=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){var e={id:this._id,name:this._name,type:this._type,hardware:this._hardware.composeElement(),operationalStatus:this._operationalStatus,antennaStatus:this._antennaStatus};return this._softwareList.length>0&&(e.softwareList=this._softwareList),void 0!==this._mobile&&(e.mobile=this._mobile.composeElement()),void 0!==this._subscriber&&(e.subscriber=this._subscriber.composeElement()),void 0!==this._subscription&&(e.subscription=this._subscription.composeElement()),e}}]),e}();r.default=p,t.exports=r.default},{"./Hardware":186,"./Mobile":187,"./Software":189,"./Subscriber":191,"./Subscription":192,"./enum/ANTENNA_STATUS_ENUM":195}],183:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._from=void 0,this._at=void 0,this._value=void 0,this._tags=void 0}return n(e,[{key:"withFrom",value:function(e){if(null!==e){if("number"!=typeof e)throw new Error("OGAPI_MUST_BE_NUMBER_PARAMETER");this._from=e}return this}},{key:"withAt",value:function(e){if(null!==e){if("number"!=typeof e)throw new Error("OGAPI_MUST_BE_NUMBER_PARAMETER");this._at=e}return this}},{key:"withValue",value:function(e){if(void 0===e||0===e.length)throw new Error("OGAPI_DEFINED_PARAMETER");return this._value=e,this}},{key:"withTags",value:function(e){if(null!==e){if(e.constructor!==Array||0===e.length)throw new Error({message:"OGAPI_ARRAY_PARAMETER",parameter:"tags"});this._tags=e}return this}},{key:"composeElement",value:function(){if(void 0===this._value||0===this._value.length)throw new Error({message:"OGAPI_DEFINED_PARAMETER",parameter:"value"});return{from:this._from||void 0,at:this._at||void 0,value:this._value,tags:this._tags||void 0}}}]),e}();r.default=i,t.exports=r.default},{}],184:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./Datapoint"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._id=void 0,this._feed=void 0,this._datapoints=[]}return n(e,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER_ID");return this._id=e,this}},{key:"withFeed",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER_FEED");return this._feed=e,this}},{key:"withDatapoint",value:function(e){if(!(e instanceof o.default))throw new Error("OGAPI_PARAMETER_DATAPOINT");return this._datapoints.push(e.composeElement()),this}},{key:"composeElement",value:function(){if(void 0===this._id||0===this._id.length||0===this._datapoints.length)throw new Error("Parameter id must be defined and dapoint list must have at least one element");return{id:this._id,feed:this._feed,datapoints:this._datapoints}}}]),e}();r.default=s,t.exports=r.default},{"./Datapoint":183}],185:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}i(e("q"));var a=i(e("./Hardware")),o=i(e("./Software")),s=i(e("./Usage")),u=i(e("./Storage")),c=i(e("./PowerSupply")),l=i(e("./CommsModuleMessage")),p=e("./enum/TEMPERATURE_STATUS_ENUM"),f=e("./enum/LEVEL_TREND_ENUM"),d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._event_id=void 0,this._deviceId=void 0,this._path=void 0,this._name=void 0,this._description=void 0,this._hardware=void 0,this._operationalStatus=void 0,this._softwareList=[],this._location=void 0,this._temperature=void 0,this._cpuUsage=void 0,this._ram=void 0,this._volatilStorage=void 0,this._nonVolatilStorage=void 0,this._powerSupply=void 0,this._upTime=void 0,this._communicationsModulesList=[]}return n(e,[{key:"withEventId",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"EventId"});return this._event_id=e,this}},{key:"withDeviceId",value:function(e){if("string"!=typeof e)throw new Error("deviceId cannot be empty");return this._deviceId=e,this}},{key:"withPath",value:function(e){if(e.constructor!==Array||0===e.length)throw new Error("Parameter path must be an Array and cannot be empty");return this._path=e,this}},{key:"withEventName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be String type and cannot be empty");return this._name=e,this}},{key:"withEventDescription",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter description must be String type and cannot be empty");return this._description=e,this}},{key:"withHardware",value:function(e){if(!(e instanceof a.default))throw new Error("Parameter hardware must be Hardware type");return this._hardware=e,this}},{key:"withOperationalStatus",value:function(e){return this._ogapi.operationalStatusSearchBuilder().withEntityType("ASSET").withId(e).build().execute().then((function(e){if(204===e.statusCode)throw new Error("Operational Status not found")})),this._operationalStatus=e,this}},{key:"withSoftware",value:function(e){if(!(e instanceof o.default))throw new Error("Parameter software must be software type");return this._softwareList.push(e.composeElement()),this}},{key:"withDateLocation",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter date must be String type and cannot be empty");return void 0===this._location&&(this._location={coordinates:{}}),this._location.timestamp=e,this}},{key:"withLatitude",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter latitude must be number type and cannot be empty");return void 0===this._location&&(this._location={coordinates:{}}),this._location.coordinates.latitude=e,this}},{key:"withLongitude",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter longitude must be number type and cannot be empty");return void 0===this._location&&(this._location={coordinates:{}}),this._location.coordinates.longitude=e,this}},{key:"withCurrentTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter currentTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.current=e,this}},{key:"withUnitTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unitTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.unit=e,this}},{key:"withStatusTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unitTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.status=this._checkValues(e,p.TEMPERATURE_STATUS_ENUM),this}},{key:"withTrendTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unitTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.trend=this._checkValues(e,f.LEVEL_TREND_ENUM),this}},{key:"withTemperatureAverage",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter averageTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.average=e,this}},{key:"withMinimumTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter minimumTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.minimum=e,this}},{key:"withMaximumTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter maximumTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.maximum=e,this}},{key:"withCpuUsage",value:function(e){if(!(e instanceof s.default))throw new Error("Parameter cpuUsage must be Usage type");return this._cpuUsage=e,this}},{key:"withRam",value:function(e){if(!(e instanceof u.default))throw new Error("Parameter ram must be Storage type");return this._ram=e,this}},{key:"withVolatilStorage",value:function(e){if(!(e instanceof u.default))throw new Error("Parameter volatilStorage must be Storage type");return this._volatilStorage=e,this}},{key:"withNonVolatilStorage",value:function(e){if(!(e instanceof u.default))throw new Error("Parameter nonVolatilStorage must be Storage type");return this._nonVolatilStorage=e,this}},{key:"withPowerSupply",value:function(e){if(!(e instanceof c.default))throw new Error("Parameter powerSupply must be PowerSupply type");return this._powerSupply=e,this}},{key:"withCommsModule",value:function(e){if(!(e instanceof l.default))throw new Error("Parameter communicationsModules must be CommsModuleMessage type");return this._communicationsModulesList.push(e.composeElement()),this}},{key:"withUpTime",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter upTime must be number type and cannot be empty");return this._upTime=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){var e={id:this._event_id,device:{id:this._deviceId,path:this._path,name:this._name,description:this._description,operationalStatus:this._operationalStatus}};return void 0!==this._hardware&&(e.device.hardware=this._hardware.composeElement()),this._softwareList.length>0&&(e.device.softwareList=this._softwareList),void 0!==this._location&&(e.device.location=this._location),void 0!==this._temperature&&(e.device.temperature=this._temperature),void 0!==this._cpuUsage&&(e.device.cpuUsage=this._cpuUsage.composeElement()),void 0!==this._ram&&(e.device.ram=this._ram.composeElement()),void 0!==this._volatilStorage&&(e.device.volatilStorage=this._volatilStorage.composeElement()),void 0!==this._nonVolatilStorage&&(e.device.nonVolatilStorage=this._nonVolatilStorage.composeElement()),void 0!==this._powerSupply&&(e.device.powerSupply=this._powerSupply.composeElement()),this._communicationsModulesList.length>0&&(e.device.communicationsModules=this._communicationsModulesList),void 0!==this._upTime&&(e.device.upTime=this._upTime),e}}]),e}();r.default=d,t.exports=r.default},{"./CommsModuleMessage":182,"./Hardware":186,"./PowerSupply":188,"./Software":189,"./Storage":190,"./Usage":193,"./enum/LEVEL_TREND_ENUM":198,"./enum/TEMPERATURE_STATUS_ENUM":201,q:120}],186:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._serialnumber=void 0,this._manufacturerName=void 0,this._manufacturerOui=void 0,this._modelName=void 0,this._modelVersion=void 0,this._clockDate=void 0}return n(e,[{key:"withSerialnumber",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter serial number must be a string and cannot be empty");return this._serialnumber=e,this}},{key:"withManufacturerName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter manufacturer Name must be a string and cannot be empty");return this._manufacturerName=e,this}},{key:"withManufacturerOui",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter manufacturer code must be a string and cannot be empty");return this._manufacturerOui=e,this}},{key:"withModelName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter model Name must be a string and cannot be empty");return this._modelName=e,this}},{key:"withModelVersion",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter model Version must be a string and cannot be empty");return this._modelVersion=e,this}},{key:"withClockDate",value:function(e){if(!this._isValidDate(e))throw new Error("The clockDate parameter has a wrong format. Example of rigth format is 2015-07-16T19:20:30+01:00");return this._clockDate=e,this}},{key:"_isValidDate",value:function(e){if(""===e||null===e)return!1;var t=e.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\+(\d{2}):(\d{2})/);if(null===t||"object"!=typeof t)return!1;if("object"!=typeof t&&null!==t&&3!==t.size)return!1;var r=!0,n=(new Date).getFullYear();return(t[1].length<4||t[1]<1999||t[1]>n)&&(r=!1),(t[2].length<2||t[2]<1||t[2]>12)&&(r=!1),(t[3].length<2||t[3]<1||t[3]>31)&&(r=!1),r}},{key:"composeElement",value:function(){return{serialnumber:this._serialnumber,manufacturer:{name:this._manufacturerName,oui:this._manufacturerOui||""},model:{name:this._modelName||"",version:this._modelVersion||""},clockDate:this._clockDate}}}]),e}();r.default=i,t.exports=r.default},{}],187:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._mr=void 0,this._apn=void 0,this._bcch=void 0,this._cgi=void 0,this._cellId=void 0,this._lac=void 0,this._ratType=void 0,this._plmn=void 0,this._timingAdvance=void 0,this._signalStrength=void 0,this._signalStrengthMax=void 0,this._signalStrengthMin=void 0,this._signalQuality=void 0,this._signalQualityMax=void 0,this._signalQualityMin=void 0}return n(e,[{key:"withMr",value:function(e){if("string"!=typeof e)throw new Error("Parameter mr usage must be String type ");return this._mr=e,this}},{key:"withApn",value:function(e){if("string"!=typeof e)throw new Error("Parameter apn usage must be String type ");return this._apn=e,this}},{key:"withBcch",value:function(e){if("string"!=typeof e)throw new Error("Parameter bcch usage must be String type ");return this._bcch=e,this}},{key:"withCgi",value:function(e){if("string"!=typeof e)throw new Error("Parameter cgi usage must be String type ");return this._cgi=e,this}},{key:"withCellId",value:function(e){if("string"!=typeof e)throw new Error("Parameter cellId usage must be String type ");return this._cellId=e,this}},{key:"withLac",value:function(e){if("string"!=typeof e)throw new Error("Parameter lac usage must be String type ");return this._lac=e,this}},{key:"withRatType",value:function(e){if("string"!=typeof e)throw new Error("Parameter ratType usage must be String type ");return this._ratType=e,this}},{key:"withPlmn",value:function(e){if("string"!=typeof e)throw new Error("Parameter plmn usage must be String type ");return this._plmn=e,this}},{key:"withTimingAdvance",value:function(e){if("string"!=typeof e)throw new Error("Parameter timingAdvance usage must be String type ");return this._timingAdvance=e,this}},{key:"withSignalStrength",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalStrength usage must be String type ");return this._signalStrength=e,this}},{key:"withSignalStrengthMax",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalStrengthMax usage must be String type ");return this._signalStrengthMax=e,this}},{key:"withsignalStrengthMin",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalStrengthMin usage must be String type ");return this._signalStrengthMin=e,this}},{key:"withsignalQuality",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalQuality usage must be String type ");return this._signalQuality=e,this}},{key:"withsignalQualityMax",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalQualityMax usage must be String type ");return this._signalQualityMax=e,this}},{key:"withsignalQualityMin",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalQualityMin usage must be String type ");return this._signalQualityMin=e,this}},{key:"composeElement",value:function(){return{mr:this._mr,apn:this._apn,bcch:this._bcch,cgi:this._cgi,cellId:this._cellId,lac:this._lac,ratType:this._ratType,plmn:this._plmn,timingAdvance:this._timingAdvance,signalStrength:this._signalStrength,signalStrengthMax:this._signalStrengthMax,signalStrengthMin:this._signalStrengthMin,signalQuality:this._signalQuality,signalQualityMax:this._signalQualityMax,signalQualityMin:this._signalQualityMin}}}]),e}();r.default=i,t.exports=r.default},{}],188:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=e("./enum/POWER_SUPPLY_SOURCE_ENUM"),a=e("./enum/BATTERY_CHARGE_STATUS_ENUM"),o=e("./enum/BATTERY_CHARGE_LEVEL_STATUS_ENUM"),s=e("./enum/LEVEL_TREND_ENUM"),u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._source=void 0,this._status=void 0,this._trend=void 0,this._batteryStatus=void 0,this._percentage=void 0,this._outageDate=void 0,this._outageDuration=void 0}return n(e,[{key:"withSource",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter source must be string type and cannot be empty");return this._source=this._checkValues(e,i.POWER_SUPPLY_SOURCE_ENUM),this}},{key:"withStatus",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter status must be string type and cannot be empty");return this._status=this._checkValues(e,a.BATTERY_CHARGE_STATUS_ENUM),this}},{key:"withBatteryChargeLevelTrend",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter trend must be string type and cannot be empty");return this._trend=this._checkValues(e,s.LEVEL_TREND_ENUM),this}},{key:"withBatteryChargeLevelStatus",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter Battery Charge Level Status must be string type and cannot be empty");return this._batteryStatus=this._checkValues(e,o.BATTERY_CHARGE_LEVEL_STATUS_ENUM),this}},{key:"withBatteryChargeLevelPercentage",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter percentage must be string type and cannot be empty");return this._percentage=e,this}},{key:"withOutageDate",value:function(e){if(!this._isValidDate(e))throw new Error("The outageDate parameter has a wrong format. Example of rigth format is 2015-07-16T19:20:30+01:00");return this._outageDate=e,this}},{key:"withOutageDuration",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter duration must be number type and cannot be empty");return this._outageDuration=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"_isValidDate",value:function(e){if(""===e||null===e)return!1;var t=e.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\+(\d{2}):(\d{2})/);if(null===t||"object"!=typeof t)return!1;if("object"!=typeof t&&null!==t&&3!==t.size)return!1;var r=!0,n=(new Date).getFullYear();return(t[1].length<4||t[1]<1999||t[1]>n)&&(r=!1),(t[2].length<2||t[2]<1||t[2]>12)&&(r=!1),(t[3].length<2||t[3]<1||t[3]>31)&&(r=!1),r}},{key:"composeElement",value:function(){var e={source:this._source,status:this._status,batteryChargeLevel:{trend:this._trend,status:this._batteryStatus,percentage:this._percentage}};return void 0===this._outageDate&&void 0===this._outageDuration||(e.outage={timestamp:this._outageDate,duration:this._outageDuration}),e}}]),e}();r.default=u,t.exports=r.default},{"./enum/BATTERY_CHARGE_LEVEL_STATUS_ENUM":196,"./enum/BATTERY_CHARGE_STATUS_ENUM":197,"./enum/LEVEL_TREND_ENUM":198,"./enum/POWER_SUPPLY_SOURCE_ENUM":199}],189:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=((i=a)&&i.__esModule,e("./enum/SOFTWARE_TYPE_ENUM")),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=void 0,this._type=void 0,this._version=void 0,this._date=void 0}return n(e,[{key:"withName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be a string and cannot be empty");return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter type must be a string and cannot be empty");return this._type=this._checkValues(e,o.SOFTWARE_TYPE_ENUM),this}},{key:"withVersion",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter version must be a string and cannot be empty");return this._version=e,this}},{key:"withDate",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter date must be a string and cannot be empty");return this._date=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){return{name:this._name,type:this._type,version:this._version,date:this._date}}}]),e}();r.default=s,t.exports=r.default},{"./enum/SOFTWARE_TYPE_ENUM":200,q:120}],190:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};var a,o=e("./Usage"),s=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._unit=void 0,this._total=void 0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withUnit",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unit must be String type and cannot be empty");return this._unit=e,this}},{key:"withTotal",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter total must be string type and cannot be empty");return this._total=e,this}},{key:"composeElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"composeElement",this).call(this);return{unit:this._unit,total:this._total,usage:e}}}]),t}(((a=o)&&a.__esModule?a:{default:a}).default);r.default=s,t.exports=r.default},{"./Usage":193}],191:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./Hardware"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._id=void 0,this._name=void 0,this._type=void 0,this._hardware=void 0}return n(e,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter id must be a string and cannot be empty");return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be a string and cannot be empty");return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter type must be a string and cannot be empty");return this._type=e,this}},{key:"withHardware",value:function(e){if(!(e instanceof o.default))throw new Error("Parameter hardware must be hardware type");return this._hardware=e,this}},{key:"composeElement",value:function(){var e={id:this._id,name:this._name,type:this._type};return void 0!==this._hardware&&(e.hardware=this._hardware.composeElement()),e}}]),e}();r.default=s,t.exports=r.default},{"./Hardware":186}],192:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=e("./enum/ADDRESS_TYPE_ENUM"),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._id=void 0,this._name=void 0,this._type=void 0,this._description=void 0,this._operator=void 0,this._imsi=void 0,this._msisdn=void 0,this._addressType=void 0,this._addressValue=void 0,this._addressApn=void 0}return n(e,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter id must be a string and cannot be empty");return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be a string and cannot be empty");return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter type must be a string and cannot be empty");return this._type=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter description must be a string and cannot be empty");return this._description=e,this}},{key:"withOperator",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter operator must be a string and cannot be empty");return this._operator=e,this}},{key:"withImsi",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter imsi must be a string and cannot be empty");return this._imsi=e,this}},{key:"withMsisdn",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter msisdn must be a string and cannot be empty");return this._msisdn=e,this}},{key:"withAddressType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter addressType must be a string and cannot be empty");return this._addressType=this._checkValues(e,i.ADDRESS_TYPE_ENUM),this}},{key:"withAddressValue",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter addressValue must be a string and cannot be empty");return this._addressValue=e,this}},{key:"withAddressApn",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter addressApn must be a string and cannot be empty");return this._addressApn=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){return{id:this._id,name:this._name,type:this._type,description:this._description,operator:this._operator,imsi:this._imsi,msisdn:this._msisdn,address:{type:this._addressType,value:this._addressValue,apn:this._addressApn}}}}]),e}();r.default=a,t.exports=r.default},{"./enum/ADDRESS_TYPE_ENUM":194}],193:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._usageUnit=void 0,this._current=void 0,this._average=void 0,this._maximum=void 0,this._minimum=void 0}return n(e,[{key:"withUsageUnit",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unit usage must be String type and cannot be empty");return this._usageUnit=e,this}},{key:"withCurrent",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter current must be string type and cannot be empty");return this._current=e,this}},{key:"withAverage",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter average must be string type and cannot be empty");return this._average=e,this}},{key:"withMaximum",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter maximum must be string type and cannot be empty");return this._maximum=e,this}},{key:"withMinimum",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter minimum must be string type and cannot be empty");return this._minimum=e,this}},{key:"composeElement",value:function(){return{unit:this._usageUnit,current:this._current,average:this._average,maximum:this._maximum,minimum:this._minimum}}}]),e}();r.default=i,t.exports=r.default},{}],194:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ADDRESS_TYPE_ENUM=["IPV4","IPV6","MAC"]},{}],195:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ANTENNA_STATUS_ENUM=["OK","SHORT_CIRCUIT","OPEN","UNKONW"]},{}],196:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.BATTERY_CHARGE_LEVEL_STATUS_ENUM=["CHARGING","CHARGED"]},{}],197:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.BATTERY_CHARGE_STATUS_ENUM=["NORMAL","LOW_CRITICAL","LOW_WARNING","MEDIUM","COMPLETE"]},{}],198:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.LEVEL_TREND_ENUM=["RISING","DECREASING","FLAT","EMPTY"]},{}],199:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.POWER_SUPPLY_SOURCE_ENUM=["NETWORK_PLUGGED","DIESEL_GENERATOR","SOLAR","BATTERY","OTHER"]},{}],200:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.SOFTWARE_TYPE_ENUM=["FIRMWARE","SOFTWARE"]},{}],201:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.TEMPERATURE_STATUS_ENUM=["NORMAL","LOW_CRITICAL","LOW_WARNING","HIGH_WARNING","HIGH_CRITICAL"]},{}],202:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.CONNECTOR_FUNCTION_OPERATIONAL_STATUS=["DISABLED","PRODUCTION","TEST"];r.CONNECTOR_FUNCTION_TYPES=["COLLECTION","REQUEST","RESPONSE"];r.CONNECTOR_FUNCTION_PAYLOAD_TYPES=["TEXT","JSON","BINARY"];r.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS=["https://","wss://","mqtts://","snmps://","dlms://","icmp://"]},{}],203:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}a(e("../../InternalOpenGateAPI"));var o=a(e("../../provision/BaseProvision")),s=e("../_CONNECTOR_FUNCTIONS_ENUMS"),u=function(e){function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog",void 0,["name","operationalStatus","type","cloneable","javascript","payloadType"]),r&&this.withIdentifier(r),n)for(var a=Object.keys(n),o=0;o<a.length;o++){var s=a[o],u=n[s];if(null!=u)this["with"+(s.charAt(0).toUpperCase()+s.slice(1))](u)}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withOperationalStatus",value:function(e){if("string"!=typeof e||!this._checkValues(e,s.CONNECTOR_FUNCTION_OPERATIONAL_STATUS))throw new Error("Parameter operational status must be a string and must be one of these values: "+s.CONNECTOR_FUNCTION_OPERATIONAL_STATUS);return this._operationalStatus=e,this}},{key:"withOperationName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter operation name must be a string, cannot be empty and has a maximum length of 50");return this._operationName=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||!this._checkValues(e,s.CONNECTOR_FUNCTION_TYPES))throw new Error("Parameter type must be a string and must be one of these values: "+s.CONNECTOR_FUNCTION_TYPES);return this._type=e,this}},{key:"withCloneable",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter cloneable must be a boolean");return this._cloneable=e,this}},{key:"withNorthCriterias",value:function(e){if(!(e instanceof Array))throw new Error({message:"Parameter northCriterias requires an array",parameter:"northCriterias"});return this._northCriterias=e,this}},{key:"addNorthCriteria",value:function(e){if("object"!=typeof e||!e.path||"string"!=typeof e.path||!e.value||"object"!=typeof e.value)throw new Error({message:"Parameter northCriteria requires path and value",parameter:"northCriteria"});return this._northCriterias||(this._northCriterias=[]),this._northCriterias.push(e),this}},{key:"withSouthCriterias",value:function(e){var t=this;if(!(e instanceof Array))throw new Error({message:"Parameter southCriterias requires an array",parameter:"southCriterias"});return e.forEach((function(e){try{t.addSouthCriteria(e)}catch(e){throw t._southCriterias=null,e}})),this}},{key:"addSouthCriteria",value:function(e){if("string"!=typeof e)throw new Error("southCriteria must be a string");return this._southCriterias||(this._southCriterias=[]),this._southCriterias.push(e),this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter javascript must be a string");return this._javascript=e,this}},{key:"withPayloadType",value:function(e){if("string"!=typeof e||!this._checkValues(e,s.CONNECTOR_FUNCTION_PAYLOAD_TYPES))throw new Error("Parameter payload type must be a string and must be one of these values: "+s.CONNECTOR_FUNCTION_PAYLOAD_TYPES);return this._payloadType=e,this}},{key:"_composeElement",value:function(){return{name:this._name,description:this._description?this._description:void 0,operationalStatus:this._operationalStatus,operationName:"REQUEST"===this._type?this._operationName:void 0,type:this._type,cloneable:this._cloneable,northCriterias:this._northCriterias,southCriterias:this._southCriterias,javascript:this._javascript,payloadType:this._payloadType}}},{key:"_checkRequiredParameters",value:function(e){if(e&&void 0===this._identifier)throw new Error({message:"Parameter identifier must be defined",parameter:"identifier"});try{i(Object.getPrototypeOf(t.prototype),"_checkRequiredParameters",this).call(this)}catch(e){throw e}switch(this._type){case"REQUEST":if(void 0===this._operationName||void 0===this._northCriterias||0===this._northCriterias.length)throw new Error("Parameters operationName and northCriteria must be defined when type REQUEST");if("JSON"!==this._payloadType)throw new Error("Parameter payload type must be JSON when type REQUEST");break;case"COLLECTION":case"RESPONSE":if(void 0===this._southCriterias||0===this._southCriterias.length)throw new Error("Parameters southCriteria must be defined when type COLLECTION or RESPONSE")}}},{key:"_buildURL",value:function(){if(void 0===this._identifier)throw new Error({message:"Parameter identifier must be defined",parameter:"identifier"});return"connectorFunctions/"+this._resource+"/"+this._identifier}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost("connectorFunctions/"+this._resource,this._composeElement())}},{key:"_composeUpdateElement",value:function(){return this._checkRequiredParameters(!0),this._composeElement()}}]),t}(o.default);r.default=u,t.exports=r.default},{"../../InternalOpenGateAPI":158,"../../provision/BaseProvision":261,"../_CONNECTOR_FUNCTIONS_ENUMS":202}],204:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/catalog","connectorFunctions","Connector functions not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getConnectorFunctionsCatalog",value:function(){return this._execute(!0)}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../../GenericFinder":157}],205:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/catalog","connectorFunctions","Connector functions not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByConnectorFunctionsId",value:function(e){return this._withId(e),this._execute(!0)}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../../GenericFinder":157}],206:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../provision/BaseProvision")),o=e("../_CONNECTOR_FUNCTIONS_ENUMS"),s=i(e("q")),u=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),i&&this.withIdentifier(i),a&&(a.name&&this.withName(a.name),a.operationName&&this.withOperationName(a.operationName),a.operationalStatus&&this.withOperationalStatus(a.operationalStatus),a.type&&this.withType(a.type),a.payloadType&&this.withPayloadType(a.payloadType),a.description&&this.withDescription(a.description),a.northCriterias&&this.withNorthCriterias(a.northCriterias),a.southCriterias&&this.withSouthCriterias(a.southCriterias),a.javascript&&this.withJavascript(a.javascript))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withChannel",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter channel must be a string, cannot be empty and has a maximum length of 50");return this._channel=e,this}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withOperationName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter operation name must be a string, cannot be empty and has a maximum length of 50");return this._operationName=e,this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter javascript must be a string");return this._javascript=e,this}},{key:"withNorthCriterias",value:function(e){if(!(e instanceof Array)||0===e.length)throw new Error("Parameter north criteria must be an array and cannot be empty");return this._northCriterias=e,this}},{key:"withSouthCriterias",value:function(e){var t=this;if(!(e instanceof Array)||0===e.length)throw new Error("Parameter south criteria must be an array and cannot be empty");return e.forEach((function(e){try{t.addSouthCriteria(e)}catch(e){throw t._southCriterias=null,e}})),this}},{key:"addSouthCriteria",value:function(e){if("string"!=typeof e)throw new Error("South criteria must be a string");return this._southCriterias||(this._southCriterias=[]),this._southCriterias.push(e),this}},{key:"withType",value:function(e){if("string"!=typeof e||!this._checkValues(e,o.CONNECTOR_FUNCTION_TYPES))throw new Error("Parameter type must be a string and must be one of these values: "+o.CONNECTOR_FUNCTION_TYPES);return this._type=e,this}},{key:"withPayloadType",value:function(e){if("string"!=typeof e||!this._checkValues(e,o.CONNECTOR_FUNCTION_PAYLOAD_TYPES))throw new Error("Parameter payload type must be a string and must be one of these values: "+o.CONNECTOR_FUNCTION_PAYLOAD_TYPES);return this._payloadType=e,this}},{key:"withOperationalStatus",value:function(e){if("string"!=typeof e||!this._checkValues(e,o.CONNECTOR_FUNCTION_OPERATIONAL_STATUS))throw new Error("Parameter operational status must be a string and must be one of these values: "+o.CONNECTOR_FUNCTION_OPERATIONAL_STATUS);return this._operationalStatus=e,this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,operationalStatus:this._operationalStatus,operationName:"COLLECTION"!==this._type?this._operationName:void 0,type:this._type,payloadType:this._payloadType,javascript:this._javascript,description:this._description?this._description:void 0,northCriterias:"REQUEST"===this._type?this._northCriterias:void 0,southCriterias:"REQUEST"!==this._type?this._southCriterias:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._operationalStatus||void 0===this._type||void 0===this._payloadType||void 0===this._javascript)throw new Error("Parameters organization, channel, operational status, type, payloadType, javascript and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._operationalStatus||void 0===this._type||void 0===this._payloadType||void 0===this._javascript)throw new Error("Parameters organization, channel, operational status, type, payloadType, javascript and name must be defined");if("REQUEST"===this._type&&"JSON"!==this._payloadType)throw new Error("Parameter payload type must be JSON when type REQUEST")}},{key:"_buildURL",value:function(){return"connectorFunctions/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=s.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../provision/BaseProvision":261,"../_CONNECTOR_FUNCTIONS_ENUMS":202,q:120}],207:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/organizations","connectorFunctions","Connector functions not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndChannel",value:function(e,t){return this._organization=e,this._channel=t,this._execute()}},{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+(this._name?"/"+this._name:"")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../../GenericFinder":157}],208:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../GenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=e("../_CONNECTOR_FUNCTIONS_ENUMS"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="doc/jsApi/javascript",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/internal",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/client",this._execute()}},{key:"_execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){204===t.statusCode?e.reject({error:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"getSouthCriteriasProtocols",value:function(){return u.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS}},{key:"getPayloadTypes",value:function(){return u.CONNECTOR_FUNCTION_PAYLOAD_TYPES}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../GenericFinder":157,"../_CONNECTOR_FUNCTIONS_ENUMS":202,"http-status-codes":76,q:120}],209:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"datasets/provision/organizations","datasets")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndDatasetId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],210:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("../util/formats/check_types")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","columns","identifierColumn"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){var e="datasets/provision/organizations/"+this._organization+"/"+this._identifier;return this._onlyPlan&&(e+="?onlyPlan=true"),e}},{key:"withOrganization",value:function(e){return o.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return o.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return o.default._checkString(e,"name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return o.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withDescription",value:function(e){return e&&o.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return o.default._checkArray(e,"columns"),this._columns=e,this}},{key:"_composeElement",value:function(){return this._resource="datasets/provision/organizations/"+this._organization,{name:this._name,description:this._description,type:this._type,identifierColumn:this._identifierColumn,columns:this._columns}}},{key:"_composeUpdateElement",value:function(){return{name:this._name,description:this._description,type:this._type,identifierColumn:this._identifierColumn,columns:this._columns}}},{key:"onlyPlan",value:function(){return this._onlyPlan=!0,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,"../util/formats/check_types":373}],211:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}a(e("q"));var o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains"),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_NAME_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_DESCRIPTION_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withParentDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_DOMAIN_PARAMETER_MAX_LENGTH_50");return this._parentDomain=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name)throw new Error({message:"OGAPI_DEFINED_PARAMETER",parameter:"name"});return{domain:{name:this._name||void 0,description:this._description||void 0,parentDomain:this._parentDomain||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._name}},{key:"_composeUpdateElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.domain.name,e}}]),t}(a(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],212:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","domain","Domain not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._setUrlParameters({hierarchy:this._hierarchy}),this._baseUrl+"/"+this._name}},{key:"findByName",value:function(e){return this._name=e,this._hierarchy="false",this._execute()}},{key:"findByNameWithHierarchy",value:function(e){return this._name=e,this._hierarchy="true",this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],213:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./EntityFinder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"device","Device not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./EntityFinder":214}],214:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations",r||"entity",n||"Entity not found"),this._entitySource=i||"entities",this._flattened=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._entitySource+"/"+this._id}},{key:"findByOrganizationAndId",value:function(e,t,r){return this._organization=e,this._id=t,this._setUrlParameters({flattened:!!r}),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],215:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./EntityFinder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscriber","Subscriber not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./EntityFinder":214}],216:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./EntityFinder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscription","Subscription not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./EntityFinder":214}],217:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./EntityFinder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ticket","Ticket not found","tickets")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./EntityFinder":214}],218:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("q")),s=a(e("../provision/BaseProvision")),u=a(e("../util/formats/check_types")),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/geocluster",void 0,"identifier")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return"provision/geocluster/"+this._identifier+"/clustering"}},{key:"withIdentifier",value:function(e){return u.default._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"_composeElement",value:function(){this._resource="provision/geocluster/"+this._identifier+"/clustering"}},{key:"_composeElementUpdate",value:function(){return i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this)}},{key:"update",value:function(){var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeElementUpdate(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(s.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":261,"../util/formats/check_types":373,q:120}],219:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"geocluster","geocluster","Geocluster not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findById",value:function(e){return this._id=e,this._setUrlParameters(),this._execute()}},{key:"findAll",value:function(){return this._id=void 0,this._setUrlParameters(),this._execute()}},{key:"findFeatures",value:function(e,t){var r=t.zoom,n=t.topRight,i=t.bottomLeft;return this._id=e,this._setUrlParameters({zoom:r,topRight:n,bottomLeft:i}),this._execute()}},{key:"_composeUrl",value:function(){return this._id?this._getUrlParameters()?this._baseUrl+"/"+this._id+"/view":this._baseUrl+"/"+this._id:this._baseUrl}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],220:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./Datastream"),o=((i=a)&&i.__esModule,function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._isValidString(r,"identifier",50),this._identifier=r,this._datastreams=n||[]}return n(e,[{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"addDatastream",value:function(e){if(!e||"object"!=typeof e)throw new Error("Datastream must be an object");return this._datastreams.push(e),this}},{key:"addDatastreams",value:function(e){var t=this;if(!Array.isArray(e))throw new Error("Datastreams must be an array");var r=[];if(e.forEach((function(e,n){try{t.addDatastream(e)}catch(e){r.push("Error on datastream with index ["+n+"]: "+e)}})),r.length>0)throw new Error("Error adding datastreams: "+JSON.stringify(r));return this}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Category")}},{key:"_composeElement",value:function(){if(!this._identifier)throw new Error("identifier is required on Category");return{identifier:this._identifier,name:this._name?this._name:void 0,datastreams:this._datastreams}}}]),e}());r.default=o,t.exports=r.default},{"./Datastream":221}],221:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("ajv"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,[{key:"withId",value:function(e){return this._isValidString(e,"id",100),this._id=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",500),this._description=e,this}},{key:"withUnit",value:function(e,t,r){return this._isValidString(e,"type",500),this._isValidString(t,"label",500),this._isValidString(r,"symbol",10),this._unit={type:e,label:t,symbol:r},this}},{key:"withPeriod",value:function(e){return this._isValidString(e,"period",500),this._period=e,this}},{key:"withSchema",value:function(e){if(!e||"object"!=typeof e)throw new Error("Schema must be an object or a string on Datastream");return this._schema=e,this}},{key:"withTags",value:function(e){if(e){if(!Array.isArray(e))throw new Error("Tags must be an array on Datastream");this._tags=e}return this}},{key:"addQrating",value:function(e){if(!e||"object"!=typeof e)throw new Error("Qrating must be an instance of object on Datastream");return this._qrating=e,this}},{key:"withStorage",value:function(e,t){if(this._isValidString(e,"period",500),!t||"number"!=typeof t)throw new Error("Total must be a number on Datastream");return this._storage={total:t,period:e},this}},{key:"withAccess",value:function(e){if(this._isValidString(e,"access",50),!e)throw new Error("Access must be a valid string");return this._access=e,this}},{key:"build",value:function(){if(!this._id)throw new Error("Id is required on Datastream");if(!this._name)throw new Error("Name is required on Datastream");if(!this._unit)throw new Error("Unit is required on Datastream");if(!this._period)throw new Error("Period is required on Datastream");if(!this._schema)throw new Error("Schema is required on Datastream");try{(new o.default).compile(this._schema)}catch(e){throw new Error("Schema not valid: "+e)}return{identifier:this._id,name:this._name,description:this._description,period:this._period,tags:this._tags,unit:this._unit,schema:this._schema,qrating:this._qrating,storage:this._storage,hardwareIds:this._hardwares,access:this._access}}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Datastream")}}]),e}();r.default=s,t.exports=r.default},{ajv:2}],222:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,[{key:"withMinRequired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minRequired={label:e,value:t},this}},{key:"withMinDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minDesired={label:e,value:t},this}},{key:"withIdeal",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._ideal={label:e,value:t},this}},{key:"withMaxDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxDesired={label:e,value:t},this}},{key:"withMaxAllowed",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxAllowed={label:e,value:t},this}},{key:"withMaxScore",value:function(e){return this._isValidNumber(e,"maxScore"),this._maxScore=e,this}},{key:"withCumulativePeriodDivisor",value:function(e){return e&&this._isValidNumber(e,"cumulativePeriodDivisor"),this._cumulativePeriodDivisor=e,this}},{key:"withConversionMatrix",value:function(e){if(e&&"object"!=typeof e)throw new Error("ConversionMatrix must be an object on Qrating");return this._conversionMatrix=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"build",value:function(){if(!this._version)throw new Error("Version is required on Qrating");if(!this._minRequired)throw new Error("MinRequired is required on Qrating");if(!this._minDesired)throw new Error("MinDesired is required on Qrating");if(!this._ideal)throw new Error("Ideal is required on Qrating");if(!this._maxDesired)throw new Error("MaxDesired is required on Qrating");if(!this._maxAllowed)throw new Error("MaxAllowed is required on Qrating");if(!this._maxScore)throw new Error("MaxScore is required on Qrating");return{min_required:this._minRequired,min_desired:this._minDesired,ideal:this._ideal,max_desired:this._minDesired,max_allowed:this._maxAllowed,max_score:this._maxScore,cumulative_period_divisor:this._cumulativePeriodDivisor,conversion_matrix:this._conversionMatrix,version:this._version}}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Qrating")}},{key:"_isValidNumber",value:function(e,t){if("number"!=typeof e)throw new Error("Parameter "+t+" must be a number, cannot be empty on Qrating")}}]),e}();r.default=i,t.exports=r.default},{}],223:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../provision/BaseProvision")),o=i(e("../catalog/Category")),s="/organizations";r.PRE_RESOURCE=s;var u="/datamodels";r.DATAMODELS_RESOURCE=u;var c=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s),this._isValidString(r,"organization",50),this._organization=r,this._categories=[],this._resourceType=[],this._resource=this._resource+"/"+this._organization+u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){return this._isValidString(e,"identifier",100),this._identifier=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",100),this._description=e,this}},{key:"addAllowedResourceType",value:function(e){return e&&this._isValidString(e,"resourceType",100),this._resourceType.push(e),this}},{key:"addCategory",value:function(e,t){var r=e.identifier;if(!r||this._isValidString(r,"category",100))throw new Error("Category identifier is required");this._categories.forEach((function(e,t){if(r===e.identifier)throw new Error("Category "+r+" already exists.")}));var n=new o.default(this._ogapi,r);return e.name&&n.withName(e.name),t&&t.length>0&&n.addDatastreams(t),this._categories.push(n._composeElement()),this}},{key:"addDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1;if(this._categories.forEach((function(t,n){t.identifier===e&&(r=n)})),-1===r)throw new Error("Category "+e+" not exists for this datamodel. Use addCategory instead.");return this._categories[r].datastreams?this._categories[r].datastreams.push(t):this._categories[r].datastreams=[t],this}},{key:"_composeElement",value:function(){if(!this._name)throw new Error("name is required on IoTDatamodel");if(!this._version)throw new Error("version is required on IoTDatamodel");if(!this._resourceType)throw new Error("allowedResourceTypes is required on IoTDatamodel");return{identifier:this._identifier,name:this._name,version:this._version,description:this._description,allowedResourceTypes:this._resourceType,categories:this._categories.length>0?this._categories:void 0}}},{key:"_buildURL",value:function(){return this._resource}},{key:"update",value:function(){throw new Error("Update not supported on this builder. Use datamodelsHelper instead.")}},{key:"delete",value:function(){throw new Error("Delete not supported on this builder. Use datamodelsHelper instead.")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+"on IoTDatamodel")}}]),t}(a.default);r.default=c},{"../../provision/BaseProvision":261,"../catalog/Category":220}],224:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../../ProvisionGenericFinder"),o=(i=a)&&i.__esModule?i:{default:i},s="/datamodels/";r.DATAMODEL_RESOURCE=s;var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/","datamodels","Datamodel not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+this._organization+s+this._id}},{key:"findByOrganizationAndId",value:function(e,t){return this._organization=e,this._id=t,this._execute()}}]),t}(o.default);r.default=u},{"../../ProvisionGenericFinder":159}],225:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../provision/BaseProvision")),o=i(e("../catalog/Category")),s=(i(e("../catalog/Datastream")),"/organizations");r.PRE_RESOURCE=s;var u="/datamodels";r.POST_RESOURCE=u;var c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s),this._isValidString(r,"organization",50),this._organization=r,this._datamodel=n,this._name=this._datamodel.name,this._isValidString(this._name,"name of object datamodel",100),this._version=this._datamodel.version,this._isValidString(this._version,"version of object datamodel",100),this._description=this._datamodel.description,this._categories=this._datamodel.categories,this._identifier=this._datamodel.identifier}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){return this._isValidString(e,"identifier",100),this._identifier=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",100),this._description=e,this}},{key:"addCategory",value:function(e,t){this._categories?this._categories.forEach((function(t,r){if(t.identifier===e.identifier)throw new Error("Category "+e.identifier+" already exists.")})):this._categories=[];var r=new o.default(this._ogapi,e.identifier);return e.name&&r.withName(e.name),t&&t.length>0&&r.addDatastreams(t),this._categories.push(r._composeElement()),this}},{key:"addDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1;if(this._categories.forEach((function(t,n){t.identifier===e&&(r=n)})),-1===r)throw new Error("Category "+e+" not exists for this datamodel. Use addCategory instead.");return this._categories[r].datastreams?this._categories[r].datastreams.push(t):this._categories[r].datastreams=[t],this}},{key:"removeCategory",value:function(e){this._isValidString(e,"category",100);var t=-1;if(this._categories.forEach((function(r,n){r.identifier===e&&(t=n)})),-1===t)throw new Error("Category "+e+" not exists for this datamodel");return this._categories.splice(t,1),this}},{key:"removeDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1,n=-1;if(this._categories.forEach((function(i,a){i.identifier===e&&(r=a,i.datastreams.forEach((function(e,r){e.identifier===t&&(n=r)})))})),-1===r)throw new Error("Category "+e+" not exists for this datamodel");if(-1===n)throw new Error("Datastream "+t+" not exists for this datamodel and category "+e);this._categories[r].datastreams.splice(n,1);var i=new o.default(this._ogapi,e,this._categories[r].datastreams);return this._categories[r].name&&i.withName(this._categories[r].name),this._categories.splice(r,1),this._categories.push(i._composeElement()),this}},{key:"updateCategory",value:function(e,t){this._isValidString(e,"old category",100);var r=-1,n=-1;if(this._categories.forEach((function(i,a){switch(i.identifier){case e:r=a;break;case t.identifier:n=a}})),-1!=n)throw new Error("New category "+t.identifier+" already exists.");if(-1===r)throw new Error("Category "+e+" not exists for this datamodel.");return this._categories[r].name=t.name,this}},{key:"updateDatastream",value:function(e,t,r){if(this._isValidString(e,"category",100),this._isValidString(t,"id datastream",100),!r||"object"!=typeof r)throw new Error("Datastream must be an object");var n=-1,i=-1;if(this._categories.forEach((function(r,a){r.identifier===e&&(n=a,r.datastreams.forEach((function(e,r){e.identifier===t&&(i=r)})))})),-1===n)throw new Error("Category "+e+" not exists for this datamodel. Create it, use method addCategory instead");if(-1===i)throw new Error("Datastream "+t+" not exists for this datamodel and category "+e+". Create it, use method addDatastream instead.");return this._categories[n].datastreams[i]=r,this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,version:this._version,description:this._description,categories:this._categories}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._organization+u+"/"+this._identifier}},{key:"create",value:function(){throw new Error("Create not supported on this builder. Use DatamodelsBuilder instead.")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on DatamodelsHelper")}}]),t}(a.default);r.default=c},{"../../provision/BaseProvision":261,"../catalog/Category":220,"../catalog/Datastream":221}],226:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("./ManufacturerMedia")),s=i(e("./Model")),u="/manufacturers";r.MANUFACTURERS_RESOURCE=u;var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,u,void 0,["name"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._manufUrl=e,this}},{key:"withFax",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._fax=e,this}},{key:"withTelephone",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._telephone=e,this}},{key:"withAddress",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._address=e,this}},{key:"withEmail",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._email=e,this}},{key:"mediaBuilder",value:function(){if(!this._identifier)throw new Error("Required manufacturer identifier");return new o.default(this._ogapi,this._identifier)}},{key:"modelBuilder",value:function(){if(!this._identifier)throw new Error("Required manufacturer identifier and name");return new s.default(this._ogapi,this._identifier)}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{name:this._name||void 0,description:this._description||void 0,telephone:this._telephone||void 0,address:this._address||void 0,fax:this._fax||void 0,url:this._manufUrl||void 0,notes:this._notes||void 0,email:this._email||void 0}}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_buildURL",value:function(){return this._resource+(this._identifier?"/"+this._identifier:"")}}]),t}(a.default);r.default=c},{"../provision/BaseProvision":261,"./ManufacturerMedia":228,"./Model":229}],227:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"manufacturers","manufacturer","Manufacturer not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+(this._identifier?"/"+this._identifier+(this._media?"/media"+(this._mediaIdentifier?"/"+this._mediaIdentifier+"?format=raw":""):""):"")}},{key:"findAll",value:function(){return this._execute()}},{key:"findById",value:function(e){return this._identifier=e,this._execute()}},{key:"findMedias",value:function(e){return this._media=!0,this._identifier=e,this._execute()}},{key:"findMediaById",value:function(e,t){return this._media=!0,this._identifier=e,this._mediaIdentifier=t,this._download()}},{key:"_download",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!0).then((function(t){204===t.statusCode?e.reject({data:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=u,t.exports=r.default},{"../ProvisionGenericFinder":159,"http-status-codes":76,q:120}],228:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/manufacturers/"+r+"/media",void 0,["identifier","name"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withFile",value:function(e){if(!e)throw new Error("OGAPI_NOT_EMPTY_PARAMETER");return this._file=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{media:{id:this._identifier||void 0,name:this._name||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._identifier}},{key:"update",value:function(){throw new Exception("OGAPI_METHOD_NOT_SUPPORTED")}},{key:"create",value:function(e){var t=void 0;if(e)if("string"!=typeof e){t=new FormData;var r=new Blob([this._composeElement()],{type:"application/json"});t.append("json",r),e&&t.append("file",e)}else(t={}).json=JSON.stringify(this._composeElement()),e&&(t.hardwareMedia=e);else{t=new FormData;r=new Blob([JSON.stringify(this._composeElement())],{type:"application/octet-stream"});t.append("json",r),t.append("file",this._file)}var n={};null!=this._progressEvent&&(n={progress:this._progressEvent});var i=a.default.defer(),o=i.promise;return this._ogapi.Napi.post_multipart(this._resource,t,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){201===e.statusCode?i.resolve({location:e.header.location,statusCode:e.statusCode}):i.reject({errors:[{code:e.statusCode,message:"OGAPI_FILE_NOT_CREATE"}],statusCode:e.statusCode})})).catch((function(e){i.reject(e)})),o}}]),t}(i(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],229:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("./ModelMedia")),s=e("./Manufacturer"),u="/models";r.MODELS_RESOURCE=u;var c=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s.MANUFACTURERS_RESOURCE,void 0,["name"]),this._isValidString(r,"manufacturer",50),this._resource=this._resource+"/"+r+u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._modelUrl=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._version=e,this}},{key:"mediaBuilder",value:function(){if(!this._manufacturer||!this._identifier)throw new Error("Required manufacturer and model identifier");return new o.default(this._ogapi,this._manufacturer,this._identifier)}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{name:this._name||void 0,description:this._description||void 0,version:this._version||void 0,notes:this._notes||void 0,url:this._modelUrl||void 0}}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_buildURL",value:function(){return this._resource+(this._identifier?"/"+this._identifier:"")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r)}}]),t}(a.default);r.default=c},{"../provision/BaseProvision":261,"./Manufacturer":226,"./ModelMedia":231}],230:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=e("./Model"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"manufacturers",void 0,"Model not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._manufacturer+u.MODELS_RESOURCE+(this._identifier?"/"+this._identifier+(this._media?"/media"+(this._mediaIdentifier?"/"+this._mediaIdentifier+"?format=raw":""):""):"")}},{key:"findByManufacturer",value:function(e){return this._manufacturer=e,this._execute()}},{key:"findByManufacturerAndId",value:function(e,t){return this._manufacturer=e,this._identifier=t,this._execute()}},{key:"findMediasByManufacturerAndModel",value:function(e,t){return this._media=!0,this._manufacturer=e,this._identifier=t,this._execute()}},{key:"findMediaByManufacturerAndModelAndId",value:function(e,t,r){return this._media=!0,this._manufacturer=e,this._identifier=t,this._mediaIdentifier=r,this._download()}},{key:"_download",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!0).then((function(t){204===t.statusCode?e.reject({data:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":159,"./Model":229,"http-status-codes":76,q:120}],231:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=i(e("../provision/BaseProvision")),s=e("./Manufacturer"),u=e("./Model"),c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s.MANUFACTURERS_RESOURCE+"/"+r+u.MODELS_RESOURCE+"/"+n+"/media",void 0,["identifier"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withFileName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._fileName=e,this}},{key:"withFile",value:function(e){if(!e)throw new Error("OGAPI_NOT_EMPTY_PARAMETER");return this._file=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{media:{id:this._identifier||void 0,name:this._name||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._identifier}},{key:"update",value:function(){throw new Exception("OGAPI_METHOD_NOT_SUPPORTED")}},{key:"create",value:function(e){var t=void 0;if(e)if("string"!=typeof e){t=new FormData;var r=new Blob([this._composeElement()],{type:"application/json"});t.append("json",r),e&&t.append("file",e)}else(t={}).json=JSON.stringify(this._composeElement()),e&&(t.hardwareMedia=e);else{t=new FormData;r=new Blob([JSON.stringify(this._composeElement())],{type:"application/octet-stream"});t.append("json",r),t.append("file",this._file)}var n={};null!=this._progressEvent&&(n={progress:this._progressEvent});var i=a.default.defer(),o=i.promise;return this._ogapi.Napi.post_multipart(this._resource,t,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){201===e.statusCode?i.resolve({location:e.header.location,statusCode:e.statusCode}):i.reject({errors:[{code:e.statusCode,message:"OGAPI_FILE_NOT_CREATE"}],statusCode:e.statusCode})})).catch((function(e){i.reject(e)})),o}}]),t}(o.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":261,"./Manufacturer":226,"./Model":229,q:120}],232:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("q")),s=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),n&&this.withIdentifier(n),i&&(i.name&&this.withName(i.name),i.title&&this.withTitle(i.title),i.description&&this.withDescription(i.description),i.fromCatalog&&this.fromCatalog(i.fromCatalog),!n&&i.fromCatalog||(i.steps&&this.withSteps(i.steps),i.parameters&&this.withParameters(i.parameters),i.applicableTo&&this.applicableTo(i.applicableTo)))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withTitle",value:function(e){if("string"!=typeof e)throw new Error("Parameter title must be a string, cannot be empty and has a maximum length of 50");return this._title=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){return this._description=e||void 0,this}},{key:"withParameters",value:function(e){return this._parameters=e||void 0,this}},{key:"fromCatalog",value:function(e){return this._fromCatalog=e,this}},{key:"withSteps",value:function(e){return this._steps=e||void 0,this}},{key:"withModels",value:function(e){return this._models=e||void 0,this}},{key:"applicableTo",value:function(e){return this._applicableTo=e||void 0,this}},{key:"_composeElement",value:function(e){return{name:this._name,title:this._title,description:this._description?this._description:void 0,parameters:this._parameters||void 0,fromCatalog:this._fromCatalog||void 0,steps:this._steps||void 0,models:this._models||void 0,applicableTo:this._applicableTo||void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._name||void 0===this._title)throw new Error("Parameters organization, title and name must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._title)throw new Error("Parameters organization, title and name must be defined")}},{key:"_buildURL",value:function(){return"operationTypes/"+this._resource+"/"+this._organization}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+"/"+this._identifier,this._composeElement(!0))}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization)throw new Error("Parameters organization and name must be defined");var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+"/"+this._identifier).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],233:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/catalog","operationType","Operation types not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getOperationTypes",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],234:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/provision/organizations","operationTypes","Operation type not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndName",value:function(e,t){return this._organization=e,this._name=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._name}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],235:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=i(e("moment")),s="/jobs/",u="/tasks/",c=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof r)throw new Error("Parameter operationId must be a string");this._ogapi=t,this._resource="operation",this._operationId=r}return n(e,[{key:"active",value:function(){return this._key="job",this._resource=this._resource+s+this._operationId,this._update({request:{active:!0}})}},{key:"pause",value:function(){return this._key="job",this._resource=this._resource+s+this._operationId,this._update({request:{active:!1}})}},{key:"cancel",value:function(){return this._id=this._operationId,this._resource=this._resource+s+this._id,this._cancel(this._resource)}},{key:"activePeriodicity",value:function(){return this._key="task",this._resource=this._resource+u,this._periodicityActions("ACTIVE",{active:!0})}},{key:"pausePeriodicity",value:function(){return this._key="task",this._resource=this._resource+u,this._periodicityActions("PAUSE",{active:!1})}},{key:"cancelPeriodicity",value:function(){return this._resource=this._resource+u,this._periodicityActions("CANCEL")}},{key:"executeNow",value:function(){return this._readAndUpdate({request:{schedule:{start:{}}}},!0)}},{key:"executeLater",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");var t={request:{schedule:{start:{delayed:o.default.duration(e,"minutes").asMilliseconds()}}}};return this._readAndUpdate(t)}},{key:"changeCallback",value:function(e){if("string"!=typeof e)throw new Error("Parameter url must be a string");var t={request:{callback:e}};return this._readAndUpdate(t)}},{key:"_cancel",value:function(){var e=this,t=a.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then((function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})})).catch((function(r){t.reject(e._formatError(r))})),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=a.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findById(r._operationId).then((function(i){var a=i.data;if(a&&0!=Object.keys(a).length){var o=a.taskId;if(o)switch(r._resource=r._resource+o,e){case"PAUSE":case"ACTIVE":r._update(t).then((function(e){n.resolve(e)})).catch((function(e){n.reject(e)}));break;case"CANCEL":r._id=o,r._cancel().then((function(e){n.resolve(e)})).catch((function(e){n.reject(e)}));break;default:n.reject({errors:"Not implemented action: "+e})}else n.reject({errors:"Operation is not periodic!"})}else n.reject({errors:"Operation with id "+r._operationId+" not exists"})})).catch((function(e){n.reject(e)})),i}},{key:"_readAndUpdate",value:function(e,t){var r=a.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findById(i._operationId).then((function(n){var a,o=n.data;o?(a=!!o.operation&&o.operation.active)?i.pause().then((function(n){i._update(e,t||a).then((function(e){r.resolve(e)})).catch((function(e){r.reject(i._formatError(e))}))})).catch((function(e){r.reject(i._formatError(e))})):i._update(e,t||a).then((function(e){r.resolve(e)})).catch((function(e){r.reject(i._formatError(e))})):r.reject("Operation with id "+i._operationId+" not exists")})).catch((function(e){r.reject(i._formatError(e))})),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=a.default.defer(),o=i.promise,s={};return s[n._key]=e,this._ogapi.Napi.put(this._resource,s).then((function(e){if(t)n.active().then((function(e){i.resolve(e)})).catch((function(e){i.reject(this._formatError(e))}));else if(200===e.status){var r=""!=e.text?JSON.parse(e.text):{};e.status;i.resolve(e)}else i.reject({errors:e.errors,statusCode:e.status})})).catch((function(e){i.reject(r._formatError(e))})),o}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=c,t.exports=r.default},{moment:116,q:120}],236:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=i(e("q")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._limit=void 0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findById",value:function(e){return this._id=e,this._baseUrl="operation/jobs",this._entity="job",this._error_not_found="Operation not found",this._execute()}},{key:"findPeriodicityById",value:function(e){this._id=e;var t=this,r=o.default.defer(),n=r.promise;return t.findById(e).then((function(e){var n=e.data;n&&0!=Object.keys(n).length?(t._id=e.data.taskId,t._baseUrl="operation/tasks",t._entity="task",t._error_not_found="Operation is not periodic!",t._execute().then((function(e){e.data.id=t._id,r.resolve(e)})).catch((function(e){r.reject(e)}))):r.reject({errors:t._error_not_found})})).catch((function(e){r.reject(e)})),n}},{key:"findPeriodicityByPeriodicityId",value:function(e){var t=this,r=o.default.defer(),n=r.promise;return t._id=e,t._baseUrl="operation/tasks",t._entity="task",t._execute().then((function(e){e.data.id=t._id,r.resolve(e)})).catch((function(e){r.reject(e)})),n}},{key:"findExecutionsById",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?10:arguments[1],r=arguments.length<=2||void 0===arguments[2]?1:arguments[2];if(this._id=e,this._baseUrl="operation/jobs",this._entity="operations",this._error_not_found="Executions not found","number"!=typeof t)throw new Error("size parameter must be a number");return("number"!=typeof r||r<1)&&(r=1),this._limit={size:t,start:r},this._execute()}},{key:"_composeUrl",value:function(){return"operations"===this._entity?(this._limit&&this._setUrlParameters({start:this._limit.start,size:this._limit.size}),this._baseUrl+"/"+this._id+"/operations"):this._baseUrl+"/"+this._id}}]),t}(a.default);r.default=s,t.exports=r.default},{"../GenericFinder":157,q:120}],237:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./catalog/BaseOperationBuilder")),o=i(e("./catalog/period/PeriodicityUpdateBuilder")),s=i(e("q")),u=i(e("merge")),c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._operations=[],this._operationNames=[]}return n(e,[{key:"updatePeriodicityBuilder",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"operationId"});var t=s.default.defer(),r=t.promise,n=this;return this._ogapi.newOperationFinder().findPeriodicityById(e).then((function(e){t.resolve(n._createPeriodicBuilder(e.data))})).catch((function(e){t.reject(e)})),r}},{key:"builderByOperationName",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"name"});var t=s.default.defer(),r=t.promise,n=e.toUpperCase(),i=this._findOperation(n),a=this;return void 0===i?this._loadOperationCatalog().then((function(){var e=a._findOperation(n);void 0===e?t.reject("Operation <'"+n+"'> unavailable."):t.resolve(a._createBuilder(e.config))})):t.resolve(this._createBuilder(i.config)),r}},{key:"getOperationList",value:function(){return(0,u.default)(!0,this._operationNames)}},{key:"_createBuilder",value:function(e){return new a.default(this._ogapi,e)}},{key:"_createPeriodicBuilder",value:function(e){return new o.default(this._ogapi,e.id,e)}},{key:"_loadOperationCatalog",value:function(){var e=this,t=s.default.defer(),r=t.promise;return this._ogapi.operationTypesSearchBuilder().build().execute().then((function(r){if(200===r.statusCode){var n=r.data;for(var i in n){var a=n[i].name.toUpperCase();e._operationNames.push(a),e._operations.push({name:a,config:n[i]})}}t.resolve(e)})).catch((function(r){t.resolve(e)})),r}},{key:"_findOperation",value:function(e){return this._operations.find((function(e){return e.name==this}),e)}}]),e}();r.default=c,t.exports=r.default},{"./catalog/BaseOperationBuilder":240,"./catalog/period/PeriodicityUpdateBuilder":248,merge:112,q:120}],238:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof r)throw new Error("Parameter taskId must be a string");this._ogapi=t,this._resource="operation/tasks/",this._taskId=r,this._key="task"}return n(e,[{key:"activate",value:function(){return this._periodicityActions("ACTIVE",{active:!0})}},{key:"pause",value:function(){return this._periodicityActions("PAUSE",{active:!1})}},{key:"cancel",value:function(){return this._periodicityActions("CANCEL")}},{key:"_cancel",value:function(){var e=this,t=o.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then((function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})})).catch((function(r){t.reject(e._formatError(r))})),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=o.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(r._taskId).then((function(i){var a=i.data;if(a&&0!=Object.keys(a).length){var o=a.id;switch(r._resource=r._resource+o,e){case"PAUSE":case"ACTIVE":r._update(t).then((function(e){n.resolve(e)})).catch((function(e){n.reject(e)}));break;case"CANCEL":r._id=o,r._cancel().then((function(e){n.resolve(e)})).catch((function(e){n.reject(e)}));break;default:n.reject({errors:"Not implemented action: "+e})}}else n.reject("Periodicity with id "+r._taskId+" not exists")})).catch((function(e){n.reject(e)})),i}},{key:"_readAndUpdate",value:function(e,t){var r=o.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(i._taskId).then((function(n){var a,o=n.data;o?(a=!!o.task&&"ACTIVE"===o.task.state)?i.pause().then((function(n){i._update(e,t||a).then((function(e){r.resolve(e)})).catch((function(e){r.reject(i._formatError(e))}))})).catch((function(e){r.reject(i._formatError(e))})):i._update(e,t||a).then((function(e){r.resolve(e)})).catch((function(e){r.reject(i._formatError(e))})):r.reject("Periodicity with id "+i._taskId+" not exists")})).catch((function(e){r.reject(i._formatError(e))})),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=o.default.defer(),a=i.promise,s={};return s[n._key]=e,this._ogapi.Napi.put(this._resource,s).then((function(e){t?n.active().then((function(e){i.resolve(e)})).catch((function(e){i.reject(this._formatError(e))})):200===e.status?i.resolve(e):i.reject({errors:e.errors,statusCode:e.status})})).catch((function(e){i.reject(r._formatError(e))})),a}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=s,t.exports=r.default},{q:120}],239:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._parent=r}return n(e,[{key:"filter",value:function(e,t){if(void 0===this._parent._config.applicableTo.find((function(e){return e==this}),t))throw new Error("Entity type <'"+t+"'> not allowed to operation <'"+this._parent._config.name+"'>. Entity types allowed <'"+JSON.stringify(this._parent._config.applicableTo)+"'>");return this._parent._resourceTypeWhenFilter=t,void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Filter will remove the last way appended ."),void 0!==e._filterTemplate?this._parent._build.target={filter:e._filterTemplate.filter}:this._parent._build.target={filter:e},this._parent}},{key:"list",value:function(e){var t=this;if(void 0===e||e.constructor!==Array)throw new Error("Parameter entities must be typeof Array");return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now List of entities will remove the last way appended ."),this._parent._build.target={append:{}},e.forEach((function(e){if(e.constructor===String)t._parent._build.target.append.entities||(t._parent._build.target.append.entities=[]),t._parent._build.target.append.entities.push(e);else{if(!e.id||!e.parameters)throw new Error("Entity parameters must include id and parameters: "+JSON.stringify(e));t._parent._build.target.append.entitiesWithParameters||(t._parent._build.target.append.entitiesWithParameters=[]),t._parent._build.target.append.entitiesWithParameters.push(e)}})),this._parent}},{key:"tag",value:function(e){return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Tag will remove the last way appended ."),this._parent._build.target={append:{tags:[e]}},this._parent}}]),e}();r.default=i,t.exports=r.default},{}],240:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("merge")),o=i(e("./Operation")),s=(i(e("./parameters/ParameterBuilderFactory")),i(e("./AppendEntitiesBy"))),u=i(e("./period/ExecuteEachBuilder")),c=i(e("./period/ExecuteEveryBuilder")),l=i(e("moment")),p=e("./../../util/DATE_FORMAT"),f=i(e("ajv")),d={gte:function(e){if(e<this)throw new Error("Value expected must be greater than <"+this+">. Value setted <"+e+">")},list:function(e){if(void 0===this.find((function(e){return e==this}),e))throw new Error("Value must be one of these: "+JSON.stringify(this))},editable:function(e){return!0}},h=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ajv=new f.default({useDefaults:"empty",coerceTypes:!0}),this.appendEntitiesBy=new s.default(t,this),this._config=r,this._ogapi=t,this._resourcesAvailables={job:"/jobs",task:"/tasks"},this._resourceTypeWhenFilter=void 0,this._build={operationParameters:{ackTimeout:0,timeout:9e4,retries:0,retriesDelay:0,retryResultList:[]},name:r.name,schedule:{}},void 0!==r.parameters&&(this._build.parameters={})}return n(e,[{key:"withNotes",value:function(e){if(null===e)return delete this._build.userNotes,this;if("string"!=typeof e)throw new Error("Parameter notes must be a string");return this._build.userNotes=e,this}},{key:"withCallback",value:function(e){if(null===e)return delete this._build.callback,delete this._build.notify,this;if("string"!=typeof e)throw new Error("Parameter url must be a string");return this._build.callback=e,this._build.notify=!0,this}},{key:"withScatteringMaxSpread",value:function(e){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.maxSpread,this;if("number"!=typeof e)throw new Error("Parameter percentage must be a number");if(e<0||e>100)throw new Error("The value of percentage parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.maxSpread=e,this}},{key:"withScatteringStrategy",value:function(e,t){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.strategy,this;if("number"!=typeof e)throw new Error("Parameter factor must be a number");if(e<0||e>100)throw new Error("The value of factor parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.strategy={field:"subscription.collected.cellInfo",factor:e},"number"==typeof t&&(this._build.schedule.scattering.strategy.warningMaxRate=t),this}},{key:"executeImmediately",value:function(){return this._build.active=!0,void 0!==this._build.schedule&&delete this._build.schedule.start,delete this._build.task,this}},{key:"executeIDLE",value:function(){throw new Error("Not implemented yet")}},{key:"executeLater",value:function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._build.active=t,void 0===this._build.schedule&&(this._build.schedule={}),this._build.schedule.start={delayed:l.default.duration(e,"minutes").asMilliseconds()},delete this._build.task,this}},{key:"executeEvery",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var a=Array.prototype.slice.call(arguments),o=this._getName(a.slice(1,3)),s=this._getEnd(a.slice(1,3));return this._build.active=n,new c.default(this,e,o,s,i)}},{key:"executeEach",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var a=Array.prototype.slice.call(arguments),o=this._getName(a.slice(1,3)),s=this._getEnd(a.slice(1,3));return this._build.active=n,new u.default(this,e,o,s,i)}},{key:"_getName",value:function(e){for(var t=0;t<e.length;t++)if("string"==typeof e[t])return e[t];return this._build.name+" "+this._ogapi.Napi._options.apiKey}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t]&&e[t].constructor===Date)return e[t]}},{key:"withJobTimeout",value:function(e){if(null===e)return delete this._build.schedule.stop,this;if("number"!=typeof e)throw new Error("Parameter minutes must be a number");return this._build.schedule.stop={delayed:l.default.duration(e,"minutes").asMilliseconds()},this}},{key:"withAckTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(l.default.duration(e,t).asMilliseconds(),"ackTimeout"),this}},{key:"withTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(l.default.duration(e,t).asMilliseconds(),"timeout"),this}},{key:"withRetriesDelay",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(l.default.duration(e,t).asMilliseconds(),"retriesDelay"),this}},{key:"withOperationRetries",value:function(e){return this._addSpecificParameter(e,"retryResultList"),this}},{key:"withRetries",value:function(e){return this._addSpecificParameter(e,"retries"),this}},{key:"withParameters",value:function(e){if(this._config.parameters)return this._build.parameters=e,this._checkMandatoryParameters(),this;throw new Error("This operation does not support parameters")}},{key:"withParameter",value:function(e,t){if(this._config.parameters)return this._build.parameters||(this._build.parameters={}),this._build.parameters[e]=t,this;throw new Error("This operation does not support parameters")}},{key:"build",value:function(){var e=void 0,t=(0,a.default)(!0,this._build),r=void 0,n=[];try{this._checkMandatoryParameters()}catch(e){n.push(e.message)}if(void 0===this._build.task&&void 0===this._build.schedule.start&&void 0===this._build.active&&(console.info("Not specified the way to execute [executeImmediately, executeIDLE, executeLater]. By default executeImmediately will be the way"),this.executeImmediately()),void 0===this._build.target&&this._build.active&&n.push("Must be entities appended if you want execute immediately. You must invoke appendEntitiesBy.list or appendEntitiesBy.tags or appendEntitiesBy.filter"),void 0!==this._build.target&&void 0!==this._build.target.filter&&"string"!=typeof this._resourceTypeWhenFilter&&n.push("Must be selected the entity type allowed when filter is the way to append entities. Allowed entity types <'"+JSON.stringify(this._config.applicableTo)+"'>"),void 0!==this._build.task){var i=this._build.task,s=this._build.schedule.stop;if(void 0!==i.repeating.period){var u=void 0;switch(i.repeating.period.unit){case"DAYS":u=l.default.duration(i.repeating.period.each,"days").asMilliseconds();break;case"HOURS":u=l.default.duration(i.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":u=l.default.duration(i.repeating.period.each,"minutes").asMilliseconds()}void 0!==s&&"number"==typeof s.delayed?s.delayed>=u&&n.push("You can not execute an operation with a job timeout greater than the repetition period."):(s=l.default.duration(u,"milliseconds").asMinutes()-1,console.info("Not specified the job timeout. By default, timeout will be "+s+" minutes"),this.withJobTimeout(s))}}if(n.length>0)throw this._build=t,n;void 0===this._build.schedule.stop&&(console.info("Not specified the job timeout. By default, timeout will be 30 days"),this.withJobTimeout(43200)),void 0!==this._build.task?(e=this._resourcesAvailables.task,r=this._convertToTask(this._build)):(e=this._resourcesAvailables.job,r=this._convertToJob(this._build)),void 0!==this._build.target&&void 0!==this._build.target.filter&&(e=e+"?resourceType="+this._resourceTypeWhenFilter);var c=new o.default(this._ogapi,e,r);return this._build=t,c}},{key:"_convertToTask",value:function(e){var t=e.task;this.executeImmediately();var r=this._convertToJob(this._build),n=(0,l.default)(new Date),i=(0,l.default)(t.start),a={task:{active:!0,name:t.name,description:t.description,job:r.job,schedule:{start:{date:i.format(p.DATE_FORMAT)},repeating:t.repeating}}};if(void 0!==t.stop&&(void 0!==t.stop.date?a.task.schedule.stop={date:(0,l.default)(t.stop.date).format(p.DATE_FORMAT)}:a.task.schedule.stop=t.stop),l.default.max(n,i)==n){if(void 0!==t.stop&&void 0!==t.stop.date){var o=(0,l.default)(t.stop.date);if(l.default.max(n,o)==n)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete a.task.schedule.start}return a}},{key:"_convertToJob",value:function(e){return 0===e.operationParameters.ackTimeout&&delete e.operationParameters.ackTimeout,{job:{request:e}}}},{key:"_addSpecificParameter",value:function(e,t){this._build.operationParameters[t]=e}},{key:"_checkParam",value:function(e,t){if("number"===t.type&&"number"!=typeof e)throw new Error(t.name+": Expected number but found "+typeof e);for(var r in t.attributes)"function"==typeof d[r]&&d[r].call(t.attributes[r],e)}},{key:"_checkMandatoryParameters",value:function(){if(this._config.parameters&&this._config.parameters.schema){var e=this._ajv.compile(this._config.parameters.schema);if(!e(this._build.parameters))throw new Error(e.errors)}}}]),e}();r.default=h,t.exports=r.default},{"./../../util/DATE_FORMAT":368,"./AppendEntitiesBy":239,"./Operation":241,"./parameters/ParameterBuilderFactory":243,"./period/ExecuteEachBuilder":245,"./period/ExecuteEveryBuilder":246,ajv:2,merge:112,moment:116}],241:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._resource="operation"+r,this._postObj=n}return n(e,[{key:"updatePeriodicity",value:function(){var e=this,t=o.default.defer(),r=this._resource.substring(this._resource.lastIndexOf("/")+1);return this._ogapi.Napi.put(this._resource,this._postObj).then((function(n){var i=void 0;try{i=JSON.parse(n.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:i||{},statusCode:n.statusCode,id:r})})).catch((function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)})),t.promise}},{key:"execute",value:function(){var e=this,t=o.default.defer();return this._ogapi.Napi.post(this._resource,this._postObj).then((function(r){var n=void 0;try{n=JSON.parse(r.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:n||{},statusCode:r.statusCode,location:r.header.location})})).catch((function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)})),t.promise}}]),e}();r.default=s,t.exports=r.default},{q:120}],242:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a,o=e("moment"),s=((a=o)&&a.__esModule,function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._parent=n,this._build="array"===r.type?[]:void 0,this._config=r,this[function(e){var t=function(e){var t=void 0;if("array"===e.type)t="add";else t="with";return t}(e);return t+e.name[0].toUpperCase()+e.name.slice(1)}(r)]=this._appendParameterValue}return n(e,[{key:"_appendParameterValue",value:function(e){return this._isTypeValueAllow(e)?this._isAllowValue(e)?("array"===this._config.type?this._build.push(e):this._build=e,this):(console.warn("Parameter <'"+this._config.name+"'> not allow value setted <'"+e+"'>. Only are allowed this configuration:"+JSON.stringify(this._config.attributes)),this):(console.warn("Parameter <'"+this._config.name+"'> not allow type of value setted <'"+typeof e+"'>. Only are allowed this type: "+this._getType()),this)}},{key:"_isString",value:function(){return"string"===this._config.type||"string"===this._config.subtype}},{key:"_isObject",value:function(){return"object"===this._config.type||"object"===this._config.subtype}},{key:"_isNumber",value:function(){return"number"===this._config.type||"number"===this._config.subtype}},{key:"_isArray",value:function(){return"array"===this._config.type||"array"===this._config.subtype}},{key:"_isBoolean",value:function(){return"boolean"===this._config.type||"boolean"===this._config.subtype}},{key:"_isDate",value:function(){return"date"===this._config.type||"date"===this._config.subtype}},{key:"_isTime",value:function(){return"time"===this._config.type||"time"===this._config.subtype}},{key:"_getType",value:function(){return this._isArray()?"array":this._isString()||this._isDate()||this._isTime()?"string":this._isObject()?"object":this._isNumber()?"number":this._isBoolean()?"boolean":"unknown"}},{key:"_isTypeValueAllow",value:function(e){var t=!0,r=typeof e;return(this._isString()||this._isTime()||this._isDate())&&"string"!==r&&(t=!1),this._isNumber()&&"number"!==r&&(t=!1),this._isObject()&&"object"!==r&&(t=!1),this._isBoolean()&&"boolean"!==r&&(t=!1),t}},{key:"_isAllowValue",value:function(e){if(void 0!==this._config.attributes){var t=this._config.attributes;if(void 0!==t.list)return void 0!==t.list.find((function(e){return e==this}),e)}return!0}},{key:"build",value:function(){if(this._config.required&&(void 0===this._build||0===this._build.length))throw new Error("Parameter <'"+this._config.name+"'> is required and their value is not defined");var e={name:this._config.name,value:i({},this._getType(),this._build)};return void 0!==this._build&&0!==this._build.length||(e=void 0),e}},{key:"buildAndAppend",value:function(){var e=this.build();if(void 0!==e){var t=this._parent._build.parameters.findIndex((function(e){return e.name==this.name}),e);-1===t?this._parent._build.parameters.push(e):this._parent._build.parameters[t]=e}return this._parent}}]),e}());r.default=s,t.exports=r.default},{moment:116}],243:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./BaseParameterBuilderWithParent");(n=i)&&n.__esModule;r.default=function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t.exports=r.default},{"./BaseParameterBuilderWithParent":242}],244:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DAYS_ENUM=["MON","TUE","WED","THU","FRI","SAT","SUN"]},{}],245:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("merge")),o=i(e("moment")),s=function(){function e(t,r,n,i,a){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._parent=t,this._skeleton={start:r,stop:i,name:n,description:a,repeating:{period:{each:void 0,unit:void 0}}},void 0!==i){var s=void 0;if("number"==typeof i){if(i<=0)throw new Error("Invalid stop value. Number of repetitions must be greater than 0.");s={executions:i}}else if(i.constructor===Date){var u=(0,o.default)(r),c=(0,o.default)(i);if(o.default.max(u,c)==u)throw new Error("Invalid stop date on executeEach method. Start date must be earlier than stop date.");s={date:i}}this._skeleton.stop=s}}return n(e,[{key:"minutes",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._addPeriod(e,"MINUTES")}},{key:"hours",value:function(e){if("number"!=typeof e)throw new Error("Parameter hours must be typeof number");return this._addPeriod(e,"HOURS")}},{key:"days",value:function(e){if("number"!=typeof e)throw new Error("Parameter days must be typeof number");return this._addPeriod(e,"DAYS")}},{key:"_addPeriod",value:function(e,t){var r=(0,a.default)(!0,this._skeleton);return r.repeating.period.each=e,r.repeating.period.unit=t,this._parent._build.task=r,this._parent}}]),e}();r.default=s,t.exports=r.default},{merge:112,moment:116}],246:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=e("./MONTHS_ENUM"),o=i(e("./pattern/ByWeek")),s=i(e("./pattern/ByYear")),u=i(e("./pattern/ByMonth")),c=i(e("./pattern/ByGeneric")),l=function(){function e(t,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.year=new s.default(t,r,n,i,a),this.week=new o.default(t,r,n,i,a),this._day=new c.default(t,r,n,i,a),this._date=r,this._end=i,this._parent=t,this._periodicityName=n,this._description=a}return n(e,[{key:"day",value:function(){return this._day._build()}},{key:"month",value:function(e){var t=this._parent._task;if(void 0===e||e.constructor!==Array){var r=!0;if(t){var n=t.schedule.repeating.pattern;if(n){var i=n.monthly;i&&(r=!1,e=i.months)}}if(r)throw new Error("Parameter months must be typeof Array")}if(0===e.length)throw new Error("Parameter months must have at least one month");for(var o=[],s=0;s<e.length;s++){var c=a.MONTHS_ENUM.find((function(e){return e==this}),e[s]);void 0===c&&o.push(c)}if(0!==o.length)throw new Error("Any month into parameter months is not allowed. Parameter value <'"+JSON.stringify(o)+"'>, Months allowed <'"+JSON.stringify(a.MONTHS_ENUM)+"'>");return new u.default(this._parent,this._date,this._periodicityName,e,this._end,this._description)}}]),e}();r.default=l,t.exports=r.default},{"./MONTHS_ENUM":247,"./pattern/ByGeneric":249,"./pattern/ByMonth":250,"./pattern/ByWeek":251,"./pattern/ByYear":252}],247:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MONTHS_ENUM=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]},{}],248:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("merge")),o=i(e("moment")),s=i(e("../Operation")),u=i(e("./ExecuteEveryBuilder")),c=i(e("./ExecuteEachBuilder")),l=i(e("./pattern/ByGeneric")),p=e("./../../../util/DATE_FORMAT"),f=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._task=n,this.task_id=r,this._resource="/tasks/"+this.task_id,this._build=(0,a.default)(!0,this._task.job.request)}return n(e,[{key:"executeEvery",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3));return e=this._getStart(e),this._byGeneric=new l.default(this,e,null,t)._build(),new u.default(this,e,null,n)}},{key:"executeEach",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3)),i=this._task.schedule;if(e=this._getStart(e),i&&i.repeating&&i.repeating.period){var a=i.repeating.period;return new c.default(this,e,null,n)._addPeriod(a.each,a.unit)}return new c.default(this,e,null,n)}},{key:"_getStart",value:function(e){var t=this._task.schedule;return!e&&t.start&&t.start.date&&(e=new Date(t.start.date)),e}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t].constructor===Date)return e[t];var r=this._task.schedule;if(r.stop&&r.stop.date)return new Date(r.stop.date)}},{key:"build",value:function(){var e=(0,a.default)(!0,this._build),t=void 0,r=[];if(void 0!==this._build.task){var n=this._build.task,i=this._build.schedule.stop;if(void 0!==n.repeating.period){var u=void 0;switch(n.repeating.period.unit){case"DAYS":u=o.default.duration(n.repeating.period.each,"days").asMilliseconds();break;case"HOURS":u=o.default.duration(n.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":u=o.default.duration(n.repeating.period.each,"minutes").asMilliseconds()}void 0!==i&&"number"==typeof i.delayed&&i.delayed>=u&&r.push("You can not execute an operation with a job timeout greater than the repetition period.")}}if(r.length>0)throw this._build=e,r;void 0!==this._build.task&&(t=this._updateTask(this._build));var c=new s.default(this._ogapi,this._resource,t);return this._build=e,c}},{key:"_updateTask",value:function(e){var t=e.task,r=(0,o.default)(new Date),n=(0,o.default)(t.start),i={task:{schedule:{}}};try{t.start&&(i.task.schedule.start={date:n.format(p.DATE_FORMAT)}),t.stop&&(i.task.schedule.stop={date:(0,o.default)(t.stop).format(p.DATE_FORMAT)}),t.repeating&&(i.task.schedule.repeating=t.repeating)}catch(e){}if(delete i.task.schedule.name,void 0!==t.stop&&(void 0!==t.stop.date?i.task.schedule.stop={date:(0,o.default)(t.stop.date).format(p.DATE_FORMAT)}:i.task.schedule.stop=t.stop),o.default.max(r,n)==r){if(void 0!==t.stop&&void 0!==t.stop.date){var a=(0,o.default)(t.stop.date);if(o.default.max(r,a)==r)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete i.task.schedule.start}return i}}]),e}();r.default=f,t.exports=r.default},{"../Operation":241,"./../../../util/DATE_FORMAT":368,"./ExecuteEachBuilder":245,"./ExecuteEveryBuilder":246,"./pattern/ByGeneric":249,merge:112,moment:116}],249:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("moment")),o=i(e("merge")),s=e("./../../../../util/DATE_FORMAT"),u=function(){function e(t,r,n,i,o){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._parent=t,this._skeleton={start:r,stop:i,name:n,description:o,repeating:{pattern:{time:(0,a.default)(r).format(s.TIME_FORMAT)}}},void 0!==i){var u=void 0;if("number"==typeof i)u={executions:i};else if(i.constructor===Date){var c=(0,a.default)(r),l=(0,a.default)(i);if(a.default.max(c,l)==c)throw new Error("Invalid stop date on executeEvery method. Start date must be earlier than stop date.");u={date:i}}this._skeleton.stop=u}}return n(e,[{key:"_create",value:function(){return(0,o.default)(!0,this._skeleton)}},{key:"_build",value:function(){return this._parent._build.task=this._create(),this._parent}}]),e}();r.default=u,t.exports=r.default},{"./../../../../util/DATE_FORMAT":368,merge:112,moment:116}],250:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};var a,o=e("./ByGeneric"),s=function(e){function t(e,r,n,a,o,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,s),this._months=a;var u=e._task;if(u){var c=u.schedule.repeating.pattern;if(c){var l=c.monthly;l&&(this._day=l.day,i(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"day",value:function(e){if("number"!=typeof e)throw new Error("Parameter day must be typeof number");if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,this._build()}},{key:"_create",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.monthly={day:this._day,months:this._months},e}}]),t}(((a=o)&&a.__esModule?a:{default:a}).default);r.default=s,t.exports=r.default},{"./ByGeneric":249}],251:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};var a,o=e("./ByGeneric"),s=(a=o)&&a.__esModule?a:{default:a},u=e("./../DAYS_ENUM"),c=function(e){function t(e,r,n,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"days",value:function(e){if(void 0===e||e.constructor!==Array)throw new Error("Parameter days must be typeof Array");if(0===e.length)throw new Error("Parameter days must have at least one day");for(var t=[],r=0;r<e.length;r++){var n=u.DAYS_ENUM.find((function(e){return e==this}),e[r]);void 0===n&&t.push(n)}if(0!==t.length)throw new Error("Any day into parameter days is not allowed. Parameter value <'"+JSON.stringify(e)+"'>, Months allowed <'"+JSON.stringify(u.DAYS_ENUM)+"'>");return this._days=e,this._build()}},{key:"_create",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.weekly={days:this._days},e}}]),t}(s.default);r.default=c,t.exports=r.default},{"./../DAYS_ENUM":244,"./ByGeneric":249}],252:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};var a,o=e("./ByGeneric"),s=(a=o)&&a.__esModule?a:{default:a},u=e("./../MONTHS_ENUM"),c=function(e){function t(e,r,n,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,a,o);var s=e._task;if(s){var u=s.schedule.repeating.pattern;if(u){var c=u.yearly;c&&(this._day=c.day,this._month=c.month,i(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"day",value:function(e){if("number"!=typeof e){if(!this._day)throw new Error("Parameter day must be typeof number");month=this._day}if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,void 0===this._month?this:this._parent._task?(this._build(),this):this._build()}},{key:"month",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){if("string"!=typeof e){if(!this._month)throw new Error("OGAPI_PARAMETER_MONTH_MUST_BE_STRING");e=this._month}if(void 0===u.MONTHS_ENUM.find((function(e){return e==this}),e))throw new Error("Any month into parameter months is not allowed. Parameter value <'"+e+"'>, Months allowed <'"+JSON.stringify(u.MONTHS_ENUM)+"'>");return this._month=e,void 0===this._day?this:this._parent._task?(this._build(),this):this._build()}))},{key:"_create",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.yearly={day:this._day,month:this._month},e}}]),t}(s.default);r.default=c,t.exports=r.default},{"./../MONTHS_ENUM":247,"./ByGeneric":249}],253:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("./Model")),s="/organizations";r.PRE_RESOURCE=s;var u="/manufacturers";r.MANUFACTURERS_RESOURCE=u;var c=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s,void 0,["name"]),this._isValidString(r,"organization",50),this._organization=r,this._resource=this._resource+"/"+this._organization+u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._manufUrl=e,this}},{key:"withFax",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._fax=e,this}},{key:"withTelephone",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._telephone=e,this}},{key:"withAddress",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._address=e,this}},{key:"withEmail",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._email=e,this}},{key:"modelBuilder",value:function(){if(!this._identifier)throw new Error("Required manufacturer identifier");return new o.default(this._ogapi,this._organization,this._identifier)}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{name:this._name||void 0,description:this._description||void 0,telephone:this._telephone||void 0,address:this._address||void 0,fax:this._fax||void 0,url:this._manufUrl||void 0,notes:this._notes||void 0,email:this._email||void 0}}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_buildURL",value:function(){return this._resource+(this._identifier?"/"+this._identifier:"")}},{key:"deleteInCascade",value:function(){return this._setUrlParameters({updateDevices:!0}),this.delete()}},{key:"updateInCascade",value:function(){return this._setUrlParameters({updateDevices:!0}),this.update()}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r)}}]),t}(a.default);r.default=c},{"../provision/BaseProvision":261,"./Model":255}],254:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=(i=a)&&i.__esModule?i:{default:i},s=e("./Manufacturer"),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s.PRE_RESOURCE,"manufacturer","Manufacturer not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._setUrlParameters({visibility:this._visibility||"assignable"}),this._baseUrl+"/"+this._organization+s.MANUFACTURERS_RESOURCE+(this._identifier?"/"+this._identifier:"")}},{key:"assignable",value:function(){return this._visibility="assignable",this}},{key:"administrable",value:function(){return this._visibility="administrable",this}},{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndId",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}}]),t}(o.default);r.default=u,t.exports=r.default},{"../ProvisionGenericFinder":159,"./Manufacturer":253}],255:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../provision/BaseProvision"),o=(i=a)&&i.__esModule?i:{default:i},s=e("./Manufacturer"),u="/organizations";r.PRE_RESOURCE=u;var c="/models";r.MODELS_RESOURCE=c;var l=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,u,void 0,["name"]),this._isValidString(r,"organization",50),this._isValidString(n,"manufacturer",50),this._organization=r,this._manufacturer=n,this._resource=this._resource+"/"+this._organization+s.MANUFACTURERS_RESOURCE+"/"+n+c}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._modelUrl=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._version=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{name:this._name||void 0,description:this._description||void 0,version:this._version||void 0,notes:this._notes||void 0,url:this._modelUrl||void 0}}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_buildURL",value:function(){return this._resource+(this._identifier?"/"+this._identifier:"")}},{key:"deleteInCascade",value:function(){return this._setUrlParameters({updateDevices:!0}),this.delete()}},{key:"updateInCascade",value:function(){return this._setUrlParameters({updateDevices:!0}),this.update()}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r)}}]),t}(o.default);r.default=l},{"../provision/BaseProvision":261,"./Manufacturer":253}],256:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=(i=a)&&i.__esModule?i:{default:i},s=e("./Manufacturer"),u=e("./Model"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,u.PRE_RESOURCE,"model","Model not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+s.MANUFACTURERS_RESOURCE+"/"+this._manufacturer+u.MODELS_RESOURCE+(this._identifier?"/"+this._identifier:"")}},{key:"findByOrganizationAndManufacturer",value:function(e,t){return this._organization=e,this._manufacturer=t,this._execute()}},{key:"findByOrganizationAndManufacturerAndId",value:function(e,t,r){return this._organization=e,this._manufacturer=t,this._identifier=r,this._execute()}}]),t}(o.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":159,"./Manufacturer":253,"./Model":255}],257:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","organization","Organization not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByName",value:function(e){return this._id=e,this._execute()}},{key:"findByDomainAndWorkgroup",value:function(e,t){this._domain=e,this._workgroup=t;var r=o.default.defer(),n=r.promise,i=this._error_not_found;return this._executeWorkgroupRelation().then((function(e){if(204===e.statusCode)r.reject({data:i,statusCode:s.default.NOT_FOUND});else{var t=e.data,n={},a=[];for(var o in t.channels)n[t.channels[o].organization]||(n[t.channels[o].organization]=t.channels[o].organization,a.push({name:t.channels[o].organization}));a.length>0?r.resolve({data:a,statusCode:e.statusCode}):r.reject({data:i,statusCode:s.default.NOT_FOUND})}})).catch((function(e){r.reject(e)})),n}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=o.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){204===e.statusCode?t.reject({data:n,statusCode:s.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}}]),t}(a.default);r.default=u,t.exports=r.default},{"../ProvisionGenericFinder":159,"http-status-codes":76,q:120}],258:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../provision/BaseProvision"),o=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"+(void 0===r?"":r)),this._name=void 0,this._description=void 0,this._countryCode=void 0,this._langCode=void 0,this._timeZone=void 0,this._zoom=void 0,this._location=void 0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._domain=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._countryCode=e.toUpperCase(),this}},{key:"withLangCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._langCode=e.toLowerCase(),this}},{key:"withTimeZone",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._timeZone=e,this}},{key:"withPlan",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._plan=e,this}},{key:"withOnlyAssignedDomainCertificates",value:function(e){if("boolean"!=typeof e||!0!==e&&!1!==e)throw new Error("Parameter OnlyAssignedDomainCertificates must be a boolean and cannot be empty");return this._onlyDomainCerts=e,this}},{key:"withZoom",value:function(e){if("number"!=typeof(e*=1)||e<0||e>19)throw new Error("Parameter zoom must be a number between 0 and 19");return this._zoom=e,this}},{key:"withLocation",value:function(e,t){if(t*=1,"number"!=typeof(e*=1)||"number"!=typeof t)throw new Error("Latitude and longitude parameters must be numbers");if(e<-90||e>90)throw new Error("Parameter latitude value must be between -90 and 90");if(t<-180||t>180)throw new Error("Parameter longitude value must be between -180 and 180");return this._location={latitude:e,longitude:t},this}},{key:"withAuth",value:function(e){if(!e||!e.type)throw new Error("Auth cannot be empty and must have type at least");this._security||(this._security={}),this._security.auth=e}},{key:"withPasswordPolicy",value:function(e){if(!e)throw new Error("Password policy cannot be empty");this._security||(this._security={}),this._security.policies={password:{checkStrength:!!e.checkStrength,expirationPeriod:e.expirationPeriod||0}}}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._langCode||void 0===this._countryCode)throw new Error("Parameters name, country code and lang code must be defined");var e={};null!=this._zoom&&(e.zoom=this._zoom),null!=this._location&&(e.location=this._location);var t={organization:{name:this._name||void 0,description:this._description||void 0,plan:this._plan||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timeZone||void 0,onlyAssignedDomainCertificates:"boolean"!=typeof this._onlyDomainCerts?this._onlyDomainCerts:void 0}};return this._domain&&(t.organization.domain=this._domain),(e.zoom||e.location)&&(t.organization.mapDefault=e),this._security&&(t.organization.security=this._security),t}},{key:"_composeUpdateElement",value:function(){if(this._domain)throw new Error("The domain parameter is not allowed in the update");var e=this._composeElement();return delete e.organization.name,e}},{key:"_buildURL",value:function(){if(void 0===this._name)throw new Error("Parameter name must be defined");return this._resource+"/"+this._name}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261}],259:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Pipeline not found","north")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/pipelines"+(this._identifier?"/"+this._identifier:"")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],260:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["name","actions","organization"],"north/ai"),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return this._organization+"/pipelines/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withActions",value:function(e){var t=this;if(!(e instanceof Array))throw new Error({message:"Parameter actions requires an array",parameter:"actions"});this._actions=[],e.forEach((function(e){t.addAction(e)}))}},{key:"addAction",value:function(e){if("object"!=typeof e||!e.name||"string"!=typeof e.name||!e.type||"string"!=typeof e.type)throw new Error({message:"Parameter action requires name and type",parameter:"actions"});this._actions||(this._actions=[]),this._actions.push(e)}},{key:"prediction",value:function(e,t,r){var n=(o=a.default.defer()).promise,i={input:e};t&&r&&(i.collect={deviceId:t,datastream:r});var o;n=(o=a.default.defer()).promise;return this._ogapi.Napi.post(this._buildURL()+"/prediction",i,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){o.resolve({statusCode:e.statusCode,body:e.body})})).catch((function(e){o.reject(e)})),n}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/pipelines",{name:this._name||void 0,actions:this._actions||void 0}}}]),t}(i(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],261:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r,n,i,a){if(void 0===i&&(i=[]),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._composeElement)throw new Error("Must override method: composeElement");if("function"!=typeof this._buildURL)throw new Error("Must override method: _buildURL");n&&(this._timeout="number"!=typeof n?t.Napi._options.timeout:n),this._ogapi=t,this._resource="provision"+r,this._requiredParameters=i,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=a}return n(e,[{key:"_checkRequiredParameters",value:function(){var e=[];if(this._requiredParameters&&this._requiredParameters.length>0){for(var t=0;t<this._requiredParameters.length;t++)void 0===this[this._requiredParameters[t]]&&void 0===this["_"+this._requiredParameters[t]]&&e.push(this._requiredParameters[t]);if(e.length>0)throw new Error("There are required parameters that have not been set. Missing parameters: "+JSON.stringify(e).replace(new RegExp('"',"g"),""))}}},{key:"create",value:function(){var e=this;this._checkRequiredParameters();var t=o.default.defer(),r=t.promise,n=this._composeElement();return this._ogapi.Napi.post(this._resource,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(r){201===r.statusCode?("function"==typeof e._onCreated&&e._onCreated(r.header.location),t.resolve({data:r.body,location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})})).catch((function(e){t.reject(e)})),r}},{key:"delete",value:function(e){var t=o.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),e,this._getServiceBaseURL()).then((function(e){200===e.statusCode?t.resolve({statusCode:e.statusCode}):t.reject({errors:e.errors,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}},{key:"_doSouthDelete",value:function(e){var t=o.default.defer(),r=t.promise;return this._ogapi.Sapi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),e,this._getServiceBaseURL()).then((function(e){200===e.statusCode?t.resolve({statusCode:e.statusCode}):t.reject({errors:e.errors,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}},{key:"update",value:function(){var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){200===t.statusCode?e.resolve({data:t.body,statusCode:t.statusCode}):200===t.status?e.resolve({data:t.body,statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_doNorthPut",value:function(e,t){var r=o.default.defer(),n=r.promise;return this._ogapi.Napi.put(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){200===e.statusCode?r.resolve({statusCode:e.statusCode}):200===e.status?r.resolve({statusCode:e.status}):r.reject({errors:e.errors,statusCode:e.statusCode})})).catch((function(e){r.reject(e)})),n}},{key:"_doSouthPut",value:function(e,t){var r=o.default.defer(),n=r.promise;return this._ogapi.Sapi.put(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){200===e.statusCode?r.resolve({statusCode:e.statusCode}):200===e.status?r.resolve({statusCode:e.status}):r.reject({errors:e.errors,statusCode:e.statusCode})})).catch((function(e){r.reject(e)})),n}},{key:"_doNorthPost",value:function(e,t,r){var n=this,i=o.default.defer(),a=i.promise;return this._ogapi.Napi.post(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){var t={statusCode:e.statusCode};201===e.statusCode?("function"==typeof n._onCreated&&n._onCreated(e.header.location),t.location=e.header.location,r&&(t.data=e.body),i.resolve(t)):200===e.statusCode?(r&&(t.data=e.body),i.resolve(t)):(t.errors=e.errors,i.reject(t))})).catch((function(e){i.reject(e)})),a}},{key:"_doSouthPost",value:function(e,t,r){var n=this,i=o.default.defer(),a=i.promise;return this._ogapi.Sapi.post(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){var t={statusCode:e.statusCode};201===e.statusCode?("function"==typeof n._onCreated&&n._onCreated(e.header.location),t.location=e.header.location,r&&(t.data=e.body),i.resolve(t)):200===e.statusCode?(r&&(t.data=e.body),i.resolve(t)):(t.errors=e.errors,i.reject(t))})).catch((function(e){i.reject(e)})),a}},{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}();r.default=s,t.exports=r.default},{q:120}],262:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../BaseProvision")),o=i(e("q")),s={xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};r.TYPES=s;var u=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,void 0,i,["organization","processorId"]),this._timeout=i,this._organization=r,this._processorId=n,this._resource="provisionProcessors/provision/organizations/"+r+"/"+n+"/"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource+this._type}},{key:"plan",value:function(e,t,r){if("string"!=typeof t)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._extension=s[t],this._setUrlParameters({numberOfEntriesToProcess:r||1}),this._type="plan",this._setExtraHeaders({accept:"application/json"}),this._executeOperation(e)}},{key:"bulk",value:function(e,t){if(this._extension=s[t],"string"!=typeof this._extension)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._type="bulk",this._setExtraHeaders({accept:this._extension}),this._executeOperation(e)}},{key:"_executeOperation",value:function(e){var t=void 0;"string"!=typeof e?(t=new FormData).append("file",e):(t={}).processorBulkFile=e;var r=o.default.defer(),n=this._buildURL();return this._ogapi.Napi.post_multipart(n,t,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){switch(e.statusCode){case 200:var t=""!=e.text?JSON.parse(e.text):{},n=e.status;r.resolve({data:t,statusCode:n});break;case 201:n=e.status;var i=e.location||e.headers.location||e.header.location;r.resolve({location:i,statusCode:n});break;case 204:r.resolve(e);break;default:r.reject({errors:e.data.errors,statusCode:e.statusCode})}})).catch((function(e){r.reject(e)})),r.promise}}]),t}(a.default);r.default=u},{"../BaseProvision":261,q:120}],263:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../ProvisionGenericFinder")),o=i(e("jsonpath")),s=i(e("q")),u=i(e("http-status-codes")),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","entity","Countries not found"),this.__filter=this._api._options._internalCountriesFilter}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getCountries",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this.__filter.organization+"/entities/"+this.__filter.identifier}},{key:"_execute",value:function(){var e=s.default.defer(),t=e.promise,r=this,n=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!1,this._getServiceBaseURL()).then((function(t){if(204===t.statusCode)e.reject({error:n,statusCode:u.default.NOT_FOUND});else{var i=(o.default.query(t.body,"$."+r.__filter.ds+"._current.value")||[])[0];e.resolve({data:i,statusCode:t.statusCode})}})).catch((function(t){400===t.statusCode&&(t.statusCode=u.default.NOT_FOUND),e.reject(t)})),t}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../ProvisionGenericFinder":159,"http-status-codes":76,jsonpath:104,q:120}],264:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=(i=a)&&i.__esModule?i:{default:i},s="provision.asset.identifier";r.AssetID=s;var u=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/entities",n,i,a,o),this._entity.resourceType={_value:{_current:{value:"entity.asset"}}}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_getEntityKey",value:function(){return this._entity[s]}}]),t}(o.default);r.default=u},{"./SimpleBuilder":272}],265:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../BaseProvision")),o=i(e("q")),s=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._timeout=i,this._resource=r,this._extension=n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource}},{key:"create",value:function(e,t){return this._executeOperation(e,"CREATE",t)}},{key:"delete",value:function(e,t){return this._executeOperation(e,"DELETE",t)}},{key:"deleteAll",value:function(e,t){return this._executeOperation(e,"DELETE&full=true",t)}},{key:"update",value:function(e,t){return this._executeOperation(e,"UPDATE",t)}},{key:"patch",value:function(e,t){return this._executeOperation(e,"PATCH",t)}},{key:"_executeOperation",value:function(e,t,r){var n=void 0;if("string"!=typeof e){if(n={},e){var i=new Blob([e]);n.bulkFile=i}}else n={},e&&(n.bulkFile=e);var a=o.default.defer();n.ext=this._extension;var s=this._buildURL();return r&&this._setExtraHeaders({accept:"text/plain"}),this._setUrlParameters({action:t}),this._ogapi.Napi.post_multipart(s,n,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){var t=e.statusCode;if(200===t||201===t)if(r&&!e.location){var n=e,i=e.statusCode;a.resolve({data:n,statusCode:i})}else a.resolve(e);else 204===t?a.resolve(e):a.reject({errors:e.data.errors,statusCode:e.statusCode})})).catch((function(e){a.reject(e)})),a.promise}}]),t}(a.default);r.default=s,t.exports=r.default},{"../BaseProvision":261,q:120}],266:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,i,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach((function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];n.forEach?n.forEach((function(e){e._index.value&&e._value&&e._value._current&&t.withComplex(r,e._index.value._current.value,e._value._current.value)})):t.with(r,n._value._current.value)}}))}},{key:"_initFormJson",value:function(e,t,r){var n=this;e&&Object.keys(e).forEach((function(i){var a=e[i],o=a._current,s=t?t+"."+i:i;if(o){var u=o.value;r?n.withComplex(s,r,u):n.with(s,u)}else Array.isArray(a)?a.forEach((function(e){n._initFromJson(e,s+"[]",e.identifier._current.value)})):n._initFromJson(a,s,r)}))}},{key:"initFromJson",value:function(e){var t={};e&&(t=e.provision)&&this._initFromJson(t,"provision")}},{key:"withComplex",value:function(e,t,r){if(!t)return console.warn("Communication module identifier not defined. This value wil be ignored"),this;if(1!==this.getAllowedDatastreams().filter((function(t){return t.identifier===e})).length)return console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this;this._entity[e]||(this._entity[e]=[]);for(var n=!1,i=0;i<this._entity[e].length;i++){var a=this._entity[e][i];a._index&&a._index.value&&a._index.value===t&&(this._entity[e][i]={_index:{value:t},_value:{_current:{value:r}}},n=!0)}return n||this._entity[e].push({_index:{value:t},_value:{_current:{value:r}}}),this}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"./SimpleBuilder":272}],267:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./BulkBuilder"),a=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(a?"async":n.toLowerCase()),"text/plain",i),a&&this._setUrlParameters({type:n.toUpperCase()})}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./BulkBuilder":265}],268:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=i(e("./ComplexBuilder")),s=e("./SubscriberBuilder"),u=e("./SubscriptionBuilder"),c=i(e("http-status-codes")),l=i(e("q")),p=i(e("jsonpath")),f=function(){function e(t,r,n,i,o,c){a(this,e);var l=this,p={},f={};this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._timeout=c||null,this._objClone=Object.assign({},r),this._deviceKeys=Object.keys(r).filter((function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")})),this._subscriberKeys=Object.keys(r).filter((function(e){return-1!==e.indexOf("subscriber")})),this._subscriptionKeys=Object.keys(r).filter((function(e){return-1!==e.indexOf("subscription")})),this._administrationKeys=Object.keys(r).filter((function(e){return-1!==e.indexOf("provision.administration")})),this._wrappers=[],this._urlParameters=o,this._subscriberKeys.forEach((function(e){l._obj[e].forEach((function(t){p[t._index.value]||(p[t._index.value]={}),p[t._index.value][e]={_value:t._value}}))})),this._subscriptionKeys.forEach((function(e){l._obj[e].forEach((function(t){f[t._index.value]||(f[t._index.value]={}),f[t._index.value][e]={_value:t._value}}))})),Object.keys(f).forEach((function(e){var t=f[e];l._administrationKeys.forEach((function(e){t[e]=l._obj[e]})),l._wrappers.push(new d(l._ogapi,t,l._url.replace("devices","subscriptions").replace("/"+l._key._value._current.value,""),t[u.SubscriptionID]._value._current.value))})),Object.keys(p).forEach((function(e){var t=p[e];l._administrationKeys.forEach((function(e){t[e]=l._obj[e]})),l._wrappers.push(new d(l._ogapi,t,l._url.replace("devices","subscribers").replace("/"+l._key._value._current.value,""),t[s.SubscriberID]._value._current.value))}))}return n(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key._value._current.value}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"create",value:function(){var e=this,t=l.default.defer(),r={},n=this._objClone,i=[],a=this;return Object.keys(n).filter((function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")})).forEach((function(e){r[e]=n[e]})),this._wrappers.forEach((function(e){i.push({wrapper:e,promise:e.execute(t,10)})})),l.default.allSettled(i.reduce((function(e,t){return e.push(t.promise),e}),[])).then((function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:20}),t.notify({entity:a._key._value._current.value,message:"OGAPI_CREATING_DEVICE",type:"success",percentage:25}),a._ogapi.Napi.post(a._url,r,null,null,{flattened:!0}).then((function(r){if(a._wrappers.length>0)return t.notify({message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:55}),e._setUrlParameters({flattened:!0}),a._ogapi.Napi.put(a._urlWithKey(),n,e._timeout,null,e._getUrlParameters()).then((function(e){e.statusCode===c.default.OK?("function"==typeof a._onCreated&&a._onCreated(e.header.location),t.notify({entity:a._key._value._current.value,message:"OGAPI_DEVICE_CREATED ",type:"success",percentage:75}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})}));r.statusCode===c.default.CREATED?("function"==typeof a._onCreated&&a._onCreated(r.header.location),t.notify({entity:a._key._value._current.value,message:"OGAPI_DEVICE_CREATED",type:"success",percentage:75}),t.resolve({location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})})).catch((function(e){e.statusCode===c.default.BAD_REQUEST?(p.default.query(e,"$..message")[0].includes("Entity duplicated"),t.reject({errors:e.data.errors,statusCode:e.statusCode})):t.reject({errors:e.data,statusCode:e.statusCode})}))})).catch((function(e){e.data.errors.forEach((function(e){var r=e.description;e.label&&(r+=":"+e.label),t.notify({message:"Error: "+r,type:"error",percentage:80})}));var r=[a.delete(t,90)];i.forEach((function(e){r.push(e.wrapper.delete(t,90))})),l.default.allSettled(r).then((function(){t.reject(e)})).catch((function(){t.reject(e)}))})),t.promise}},{key:"update",value:function(){var e=this,t=l.default.defer(),r=this._objClone,n=[],i=this;return this._wrappers.forEach((function(e){n.push({wrapper:e,promise:e.execute(t,20)})})),l.default.allSettled(n.reduce((function(e,t){return e.push(t.promise),e}),[])).then((function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.put(i._url,r,e._timeout,null,e._getUrlParameters()).then((function(e){e.statusCode===c.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})}))})).catch((function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)})),t.promise}},{key:"patch",value:function(){var e=this,t=l.default.defer(),r=this._obj,n=[],i=this;return this._wrappers.forEach((function(e){n.push({wrapper:e,promise:e.execute(t,20)})})),l.default.allSettled(n.reduce((function(e,t){return e.push(t.promise),e}),[])).then((function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.patch(i._url,r,e._timeout,null,e._getUrlParameters()).then((function(e){e.statusCode===c.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})}))})).catch((function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)})),t.promise}},{key:"delete",value:function(e,t){var r=this;return this._ogapi.Napi.delete(this._urlWithKey()).then((function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})}))}}]),e}(),d=function(){function e(t,r,n,i){a(this,e),this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._created=!1}return n(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key}},{key:"_checkExists",value:function(){return this._ogapi.Napi.get(this._urlWithKey()).then((function(e){return e.statusCode===c.default.OK})).catch((function(e){return console.warn(e),!1}))}},{key:"execute",value:function(e,t){var r=l.default.defer(),n=this;return this._checkExists().then((function(a){a?r.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:n._key}):i(e,r,t)})).catch((function(a){a?r.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:n._key}):i(e,r,t)})),r.promise;function i(e,t,r){n._obj["provision.administration.serviceGroup"]={_value:{_current:{value:"emptyServiceGroup"}}},n._ogapi.Napi.post(n._url,n._obj,null,null,{flattened:!0}).then((function(i){n._created=!0,e.notify({entity:n._key,message:"OGAPI_ENTITY_CREATED",type:"success",percentage:r}),t.resolve({message:"OGAPI_ENTITY_CREATED",entity:n._key})})).catch((function(i){console.error(i),e.notify({entity:n._key,message:"OGAPI_ENTITY_CREATED",type:"warning",percentage:r}),t.reject({entity:n._key,message:"OGAPI_SOMETHING_WRONG_CREATING"})}))}}},{key:"delete",value:function(e,t){var r=this;return this._created?this._ogapi.Napi.delete(this._urlWithKey()).then((function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})})):Q.fcall((function(){}))}}]),e}(),h=function(e){function t(e,r,n,i,o,s){a(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/devices",n,i,o,s),this._organization=r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"create",value:function(){return this._checkRequiredParameters(),new f(this._ogapi,this._composeElement(),this._resource,this._getEntityKey(),this._getUrlParameters(),this._timeout).create()}},{key:"update",value:function(){return new f(this._ogapi,this._composeElement(),this._buildURL(),this._getEntityKey(),this._getUrlParameters(),this._timeout).update()}},{key:"_getEntityKey",value:function(){return this._entity["provision.device.identifier"]}}]),t}(o.default);r.default=h,t.exports=r.default},{"./ComplexBuilder":266,"./SubscriberBuilder":273,"./SubscriptionBuilder":274,"http-status-codes":76,jsonpath:104,q:120}],269:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=i(e("jsonpath")),s=i(e("ajv")),u=i(e("./AssetBuilder")),c=i(e("./DeviceBuilder")),l=i(e("./TicketBuilder")),p=i(e("./SubscriberBuilder")),f=i(e("./SubscriptionBuilder")),d=i(e("./CsvBulkBuilder")),h=i(e("./JsonFlattenedBulkBuilder")),m=i(e("./JsonBulkBuilder")),v=new s.default,y="Parameters organization must be defined",g=["entities","tickets"],_="/og_basic_types.json",b=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);this._ogapi=t}return n(e,[{key:"_loadAllowedDatastreams",value:function(e,t,r){var n=this,i=a.default.defer(),o=i.promise,s=n._ogapi.newFilterBuilder();return s.and({like:{"datamodels.categories.datastreams.identifier":"provision"}}).and({eq:{"datamodels.organizationName":t}}).and({eq:{"datamodels.allowedResourceTypes":r}}),this._ogapi.datamodelsSearchBuilder().filter(s).build().execute().then((function(e){return n.schema={},e})).then((function(t){200!==t.statusCode&&i.reject({data:"OGAPI_DATASTREAM_NOT_FOUND",statusCode:204}),n._getJsonPathElements().then((function(){t.data=n._setDevicesProperties(t.data,e),i.resolve(t)})).catch((function(e){i.reject(e)}))})).catch((function(e){i.reject(e)})),o}},{key:"_getJsonPathElements",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.basicTypesSearchBuilder().withPath("$").build().execute().then((function(t){v.getSchema(_)&&v.removeSchema(_),v.addSchema(t.data,_),e.resolve()})).catch((function(t){e.reject(t)})),t}},{key:"_setDevicesProperties",value:function(e,t){var r=this,n=o.default.query(e,"$.datamodels[*].categories[*].datastreams[?(@.calculated === false)]"),i={allowedDatastreams:[],schemas:{}};return r.complexFunctions=[],r.simpleFunctions=[],n.forEach((function(e,n){var a=e.identifier;if(a.startsWith("provision.administration")||a.startsWith(t))if(i.allowedDatastreams.push(e),a.includes("communicationModules")){var o=t.includes("subscriber")||t.includes("subscription");r.schema[a]={value:e.schema,complex:!o,function:o?"with":"withComplex"}}else r.schema[a]={value:e.schema,complex:!1,function:"with"}})),i.schemas=r.schema,i}},{key:"devicesBuilder",value:function(e,t){return this._genericBuilder(e,"entity.device","provision",(function(r,n){return new c.default(this._ogapi,e,r,n,v,t)}))}},{key:"assetsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.asset","provision",(function(r,n){return new u.default(this._ogapi,e,r,n,v,t)}))}},{key:"ticketsBuilder",value:function(e,t){return this._genericBuilder(e,"ticket","provision",(function(r,n){return new l.default(this._ogapi,e,r,n,v,t)}))}},{key:"subscribersBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscriber","provision.device.communicationModules[].subscriber",(function(r,n){return new p.default(this._ogapi,e,r,n,v,t)}))}},{key:"subscriptionsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscription","provision",(function(r,n){return new f.default(this._ogapi,e,r,n,v,t)}))}},{key:"newCsvBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new d.default(this._ogapi,e,t,r,n)}},{key:"newJsonBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new m.default(this._ogapi,e,t,r,n)}},{key:"newJsonFlattenedBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new h.default(this._ogapi,e,t,r,n)}},{key:"_validateBulk",value:function(e,t){if(!e)throw new Error(y);if(!t||-1===g.indexOf(t))throw new Error("The parameters resources must be defined and must be some of these values: entities or tickets")}},{key:"_genericBuilder",value:function(e,t,r,n){var i=this,o=a.default.defer();if(!e)throw new Error(y);return this._loadAllowedDatastreams(r,e,t).then((function(e){200===e.statusCode?o.resolve(n.call(i,e.data.allowedDatastreams,e.data.schemas)):o.reject("OGAPI_DATASTREAM_NOT_FOUND")})).catch((function(e){o.reject(e)})),o.promise}}]),e}();r.default=b,t.exports=r.default},{"./AssetBuilder":264,"./CsvBulkBuilder":267,"./DeviceBuilder":268,"./JsonBulkBuilder":270,"./JsonFlattenedBulkBuilder":271,"./SubscriberBuilder":273,"./SubscriptionBuilder":274,"./TicketBuilder":275,ajv:2,jsonpath:104,q:120}],270:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./BulkBuilder"),a=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(a?"async":n.toLowerCase()),"application/json",i),a&&this._setUrlParameters({type:n.toUpperCase()})}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./BulkBuilder":265}],271:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./BulkBuilder"),a=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(a?"async":n.toLowerCase()),"application/json",i),this._setUrlParameters({flattened:!0}),a&&this._setUrlParameters({flattened:!0,type:n.toUpperCase()})}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./BulkBuilder":265}],272:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("http-status-codes")),o=i(e("../BaseProvision")),s=i(e("q")),u=i(e("lodash")),c="value is not allowed. The value should be formatted as follows: ",l="/og_basic_types.json",p=function(e){function t(e,r,n,i,a,o){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/"+r,o),"function"!=typeof this._getEntityKey)throw new Error("Must override method: _getEntityKey");this._setUrlParameters({flattened:!0}),this._entity={},this._allowedDatastreams=n,this._definedSchemas=i,this._jsonSchemaValidator=a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return this._resource+"/"+this.getEntityKey()}},{key:"_validate",value:function(){var e=this,t=[];if(Object.keys(this._entity).forEach((function(r){"resourceType"!=r&&function(){if(!e._definedSchemas[r])throw new Error("Datastream is not allowed: "+r);var n=e._definedSchemas[r].value;if(e._entity[r].constructor===Array)e._entity[r].forEach((function(i){var a=i._value._current.value;e._jsonSchemaValidator.validate(l,a)||t.push(r+" ["+a+"] "+c+JSON.stringify(n))}));else{var i=e._entity[r]._value._current.value;e._jsonSchemaValidator.validate(l,i)||t.push(r+" ["+i+"] "+c+JSON.stringify(n))}}()})),t.length>0)throw new Error(JSON.stringify(t).replace(new RegExp('"',"g"),""))}},{key:"_composeElement",value:function(){return this._validate(),this._entity}},{key:"getEntityKey",value:function(){return null!==this._getEntityKey()?this._getEntityKey()._value._current.value:null}},{key:"with",value:function(e,t){return void 0!==t&&0!==t.length||u.default.isArray(t)?1!==this.getAllowedDatastreams().filter((function(t){return t.identifier===e})).length?(console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this):(this._entity[e]={_value:{_current:{value:t}}},this):(delete this._entity[e],this)}},{key:"getAllowedDatastreams",value:function(){return this._allowedDatastreams}},{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach((function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];Array.isArray(n)&&(n=n[0]),t.with(r,n._value._current.value)}}))}},{key:"_initFromJson",value:function(e,t){var r=this;e&&Object.keys(e).forEach((function(n){var i=e[n],a=i._current,o=t?t+"."+n:n;a?r.with(o,a.value):Array.isArray(i)?r._initFromJson(i[0],o+"[]"):r._initFromJson(i,o)}))}},{key:"initFromJson",value:function(e){var t={};e&&(t=e.provision)&&this._initFromJson(t,"provision")}},{key:"deleteAll",value:function(){var e=s.default.defer(),t=e.promise;return this._setUrlParameters({full:!0}),this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){t.statusCode===a.default.OK?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"update",value:function(){var e=s.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"patch",value:function(){var e=s.default.defer(),t=e.promise;return this._ogapi.Napi.patch(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(o.default);r.default=p,t.exports=r.default},{"../BaseProvision":261,"http-status-codes":76,lodash:111,q:120}],273:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=(i=a)&&i.__esModule?i:{default:i},s="provision.device.communicationModules[].subscriber.identifier";r.SubscriberID=s;var u=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscribers",n,i,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_getEntityKey",value:function(){return this._entity[s]}}]),t}(o.default);r.default=u},{"./SimpleBuilder":272}],274:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=(i=a)&&i.__esModule?i:{default:i},s="provision.device.communicationModules[].subscription.identifier";r.SubscriptionID=s;var u=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscriptions",n,i,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_getEntityKey",value:function(){return this._entity[s]}}]),t}(o.default);r.default=u},{"./SimpleBuilder":272}],275:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=(i=a)&&i.__esModule?i:{default:i},s="provision.ticket.identifier";r.TicketID=s;var u=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/tickets",n,i,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_getEntityKey",value:function(){return this._entity[s]}}]),t}(o.default);r.default=u},{"./SimpleBuilder":272}],276:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("../util/formats/check_types")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/",void 0,["name","organization","configurationParams","scriptProcessor"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return"provisionProcessors/provision/organizations/"+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return o.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return o.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return o.default._checkString(e,"name"),this._name=e,this}},{key:"withConfigurationParams",value:function(e){return o.default._checkObject(e,"configurationParams"),this._configurationParams=e,this}},{key:"withScriptProcessor",value:function(e){return o.default._checkObject(e,"scriptProcessor"),this._scriptProcessor=e,this}},{key:"_composeElement",value:function(){return this._resource="provisionProcessors/provision/organizations/"+this._organization,{name:this._name,configurationParams:this._configurationParams,scriptProcessor:this._scriptProcessor}}}]),t}(a.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,"../util/formats/check_types":373}],277:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","provisionPrecessors")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndProvisionProcessorId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],278:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=(i(e("./_RuleCondition")),i(e("./_RuleNotification")),i(e("q"))),s=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),i&&this.withIdentifier(i),a&&(a.name&&this.withName(a.name),a.mode&&this.withMode(a.mode),a.type&&this.withType(a.type),a.description&&this.withDescription(a.description),null!==a.active&&void 0!==a.active&&this.withActive(a.active),null!==a.condition&&void 0!==a.condition&&this.withCondition(a.condition),a.actionsDelay&&this.withActionsDelay(a.actionsDelay),a.actions&&this.withActions(a.actions),a.parameters&&this.withParameters(a.parameters),a.javascript&&this.withJavascript(a.javascript))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withChannel",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter channel must be a string, cannot be empty and has a maximum length of 50");return this._channel=e,this}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter name must be a string and cannot be empty");return this._javascript=e,this}},{key:"withMode",value:function(e){return this._mode=e,this}},{key:"withType",value:function(e){return this._type=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be true or false");return this._active=e,this}},{key:"withActionsDelay",value:function(e){if("number"!=typeof e)throw new Error("Parameter actionsDelay must be a number");return this._actionsDelay=e,this}},{key:"withCondition",value:function(e){return this._condition=e||{},this}},{key:"withActions",value:function(e){return this._actions=e||{},this}},{key:"withParameters",value:function(e){return this._parameters=e||[],this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,active:this._active,mode:this._mode,type:this._type,severity:this._severity,description:this._description?this._description:void 0,parameters:this._parameters,condition:"EASY"===this._mode?this._condition:void 0,actionsDelay:this._actionsDelay,actions:"EASY"===this._mode?this._actions:void 0,javascript:"ADVANCED"===this._mode?this._javascript:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and name must be defined")}},{key:"_buildURL",value:function(){return"rules/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"updateParameters",value:function(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and identifier must be defined");return this._doNorthPut(this._buildURL()+this._identifier+"/parameters",e||this._parameters||[])}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,"./_RuleCondition":282,"./_RuleNotification":283,q:120}],279:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/catalog","rulesTemplate","Rule templates not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getTemplates",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],280:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/provision/organizations","rules","Rule configurations not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+"/"+this._name}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],281:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="js/dummyFunctions",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/private/javascriptFunctions",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/javascriptFunctions",this._execute()}},{key:"_execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){204===t.statusCode?e.reject({error:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=u,t.exports=r.default},{"../GenericFinder":157,"http-status-codes":76,q:120}],282:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./RuleConfigurations"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.constructor!==o.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._condition=r}return n(e,[{key:"setDelay",value:function(e){if("number"!=typeof e||typeof e<1)throw new Error("Parameter delay must be typeof number and higher than -1");return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=1e3*e,this}},{key:"deactivateDelay",value:function(){return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=-1,this}},{key:"setParameterValue",value:function(e,t){if(this._condition.parameters&&this._condition.parameters.length>0){for(var r in this._condition.parameters){var n=this._condition.parameters[r];if(n.name===e){if(void 0===n.value)throw new Error("Value not allowed for parameter "+e+" in condition "+this._condition.name);return n.value=t||"",this}}throw new Error("Parameter "+e+" not exists for condition "+this._condition.name)}}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=s,t.exports=r.default},{"./RuleConfigurations":278}],283:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./RuleConfigurations"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.constructor!==o.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._notification=r}return n(e,[{key:"setEnabled",value:function(e){if("boolean"!=typeof e)throw new Error("Bearer enabled must be true or false");return this._notification.enabled=e,this}},{key:"setBearerRecipients",value:function(e,t){if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.recipients=t,this}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return this}},{key:"enableBearer",value:function(e){if(this._notification.bearers&&this._notification.bearers.length>0){for(var t in this._notification.bearers){var r=this._notification.bearers[t];if(r.name===e)return r.enabled=!0,this}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return this}},{key:"disableBearer",value:function(e){if(this._notification.bearers&&this._notification.bearers.length>0){for(var t in this._notification.bearers){var r=this._notification.bearers[t];if(r.name===e)return r.enabled=!1,this}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return this}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=s,t.exports=r.default},{"./RuleConfigurations":278}],284:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./Search")),o=i(e("q")),s=function(e){function t(e,r,n,i,a,o,s,u,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,i,a,o,s,u,c)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then((function(t){var r=t.body,n=t.statusCode;200===n&&(r.assets=r.entities,delete r.entities),e.resolve({data:r,statusCode:n})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"./Search":289,q:120}],285:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=(i(e("merge")),function(){function e(t,r,n,i){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._filter)throw new Error("Must override method: filter");this._timeout="number"!=typeof n?t.Napi._options.timeout:n,this._ogapi=t,this._resource=r,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=i}return n(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){var r=t.body,n=t.statusCode;e.resolve({data:r,statusCode:n})})).catch((function(t){e.reject(t)})),t}},{key:"downloadCsv",value:function(){var e=a.default.defer(),t=e.promise,r=this._filter();return r&&r.limit&&delete r.limit,this._setExtraHeaders({Accept:"text/plain"}),this._ogapi.Napi.post(this._resource,r,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){var r=t,n=t.statusCode;e.resolve({data:r,statusCode:n})})).catch((function(t){e.reject(t)})),t}},{key:"_asyncPagingFilter",value:function(){var e=this._filter();return e.limit&&e.limit.size?e.limit.start=1:e.limit={size:1e3,start:1},e}},{key:"cancelAsyncPaging",value:function(e){"string"==typeof e&&e.length>0?this.cancel=e:this.cancel=!0}},{key:"_loadData",value:function(e){var t=this,r=a.default.defer(),n=t._asyncPagingFilter(),i=!1;return function a(){if(t.cancel||"string"==typeof t.cancel){var o="string"==typeof t.cancel?t.cancel:"Cancel process";r.reject({data:o,statusCode:403})}else t._ogapi.Napi.post(t._resource,n,t._timeout,t._getExtraHeaders(),t._getUrlParameters(),t._getServiceBaseURL()).then((function(t){var o=t.statusCode,s=t.body;if(!s&&t.text)try{var u=JSON.parse(t.text);u&&(s=u)}catch(e){console.error("Impossible to parse text from response")}if(200===o||200===o){i=!0;var c=s.data?s.data[e]:s[e];r.notify(c),c.length===n.limit.size?(n.limit.start+=1,a()):r.resolve({data:"DONE",statusCode:200})}else i?r.resolve({data:"DONE",statusCode:200}):r.reject({data:s,statusCode:o})})).catch((function(e){r.reject(e)}))}(),r.promise}},{key:"executeWithAsyncPaging",value:function(e){var t=a.default.defer(),r=t.promise;return this._loadData(e).then((function(e){t.resolve(e)}),null,(function(e){t.notify(e)})).catch((function(e){t.reject(e)})),r}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}());r.default=o,t.exports=r.default},{merge:112,q:120}],286:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./Search")),o=i(e("q")),s=function(e){function t(e,r,n,i,a,o,s,u,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,i,a,o,s,u,c)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then((function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities){if(n.devices=n.entities,n.devices.length>0){var a=!1,o=r&&r.flattened||!1;for(a=0;a<n.devices.length;a++)if(o){if(n.devices[a]["device.identifier"]){var s=n.devices[a]["device.identifier"];(!s._value||s._value&&!s._value._current)&&delete n.devices[a]["device.identifier"]}}else n.devices[a].device&&n.devices[a].device.identifier&&!n.devices[a].device.identifier._current&&delete n.devices[a].device.identifier}delete n.entities}e.resolve({data:n,statusCode:i})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"./Search":289,q:120}],287:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./Search")),o=i(e("q")),s=function(e){function t(e,r,n,i,a,o,s,u,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,i,a,o,s,u,c)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then((function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities&&n.entities.length>0){var a=!1,o=r&&r.flattened||!1;for(a=0;a<n.entities.length;a++)if(o){if(n.entities[a]["device.identifier"]){var s=n.entities[a]["device.identifier"];(!s._value||s._value&&!s._value._current)&&delete n.entities[a]["device.identifier"]}}else n.entities[a].device&&n.entities[a].device.identifier&&!n.entities[a].device.identifier._current&&delete n.entities[a].device.identifier}e.resolve({data:n,statusCode:i})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"./Search":289,q:120}],288:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./../util/Expression"),o=((i=a)&&i.__esModule,function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._filterTemplate={filter:{}}}return n(e,[{key:"or",value:function(){void 0===this._filterTemplate.filter.or&&(this._filterTemplate.filter.or=[]),void 0!==this._filterTemplate.filter.and&&(console.warn('The filter not allow both elements [and,or], the item "and" are going to be removed.'),delete this._filterTemplate.filter.and);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.or.push(t[n]);return this}},{key:"and",value:function(){void 0===this._filterTemplate.filter.and&&(this._filterTemplate.filter.and=[]),void 0!==this._filterTemplate.filter.or&&(console.warn('The filter not allow both elements [and,or], the item "or" are going to be removed.'),delete this._filterTemplate.filter.or);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.and.push(t[n]);return this}}]),e}());r.default=o,t.exports=r.default},{"./../util/Expression":369}],289:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./BaseSearch")),o=i(e("merge")),s=function(e){function t(e,r,n,i,a,s,u,c,l){void 0===i&&(i={limit:{}}),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"search"+r,c),this._setUrlParameters(l),this._postObj=(0,o.default)(n,i,s,u),"object"==typeof a&&(this._postObj=(0,o.default)(this._postObj,a))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_filter",value:function(){return this._postObj}}]),t}(a.default);r.default=s,t.exports=r.default},{"./BaseSearch":285,merge:112}],290:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./BaseSearch")),o=i(e("merge")),s=function(e){function t(e,r,n,i,a,s,u,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"search"+r,u),this._setUrlParameters(c),this._postObj=(0,o.default)(n,a,s),"object"==typeof i&&(this._postObj=(0,o.default)(this._postObj,i))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_filter",value:function(){return this._postObj}}]),t}(a.default);r.default=s,t.exports=r.default},{"./BaseSearch":285,merge:112}],291:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./../util/SelectElement"),o=((i=a)&&i.__esModule,function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._selectTemplate={select:[]}}return n(e,[{key:"add",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n],a=this._selectTemplate.select;if(0===a.length)this._selectTemplate.select.push(i);else{for(var o=!1,s=0;s<a.length;s++){var u=a[s];if(u.name===i.name){o=!0;for(var c=i.fields,l=0;l<c.length;l++){for(var p=c[n],f=!1,d=0;d<u.fields.length;d++)u.fields[d].field===p.field&&(f=!0,p.alias&&(u.fields[d].alias=p.alias));f||this._selectTemplate.select[s].fields.push(p)}}}o||this._selectTemplate.select.push(i)}}return this}}]),e}());r.default=o,t.exports=r.default},{"./../util/SelectElement":371}],292:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./Search")),o=i(e("q")),s=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog"+r,n,null,null,i),this._contentType=a,this._customFilters=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"execute",value:function(){var e=this,t=[],r="entityType",n=o.default.defer(),i=n.promise,a=e._content(e._contentType),s=e._customFilters&&e._customFilters[r],u=Object.keys(e._customFilters).length,c=u>1||1===u&&!s,l={};switch(s?l[s]=a[s]:l=a,e._contentType){case"operationalStatus":for(var p in l)l[p].forEach((function(r){(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===r)&&t.push({entityType:p,id:r})}));break;case"administrativeState":var f=function(e){var n=e;n[r]=d,t.push(n)};for(var d in l){var h=l[d];for(var m in h)if(c){for(var v in e._customFilters)if(h[m][v]===e._customFilters[v]){f(h[m]);break}}else f(h[m])}break;case"fieldsDefinition":case"communicationsModuleType":var y=c&&e._customFilters.type;if(void 0===y){n.resolve({error:"Filters not allowed",statusCode:400});break}var g=y?l[y]:l;t=g;break;case"userProfile":for(var _ in l)(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===_)&&l[_].length>0&&t.push({id:_,managed:l[_]});break;case"serviceGroups":s&&(t=l[s]);break;case"allowedResourceType":for(var b in l)(!e._customFilters.type||e._customFilters.type&&l[b].types.indexOf(e._customFilters.type)>-1)&&t.push(l[b].resourceType);break;case"ticketSeverity":case"ticketPriority":case"ticketStatus":case"ruleConfigurationSeverity":case"ruleMode":case"ruleType":case"ioTDatastreamPeriod":case"ioTDatastreamAccess":case"resourceType":case"countryCodes":case"timezones":case"userLanguages":case"ioTDatastreamStoragePeriod":if(y){n.resolve({error:"Filters not supported",statuscode:400});break}t=t.concat(l);break;default:n.resolve({data:{},statusCode:400})}if(t&&Object.keys(t).length>0){var w={};w[e._contentType]=t,n.resolve({data:w,statusCode:200})}else n.resolve({data:{},statusCode:204});return i}},{key:"_content",value:function(e){return{ticketSeverity:["CRITICAL","URGENT","WARNING","NORMAL"],ticketPriority:["MAJOR","MINOR","CRITICAL","BLOCKER"],ticketStatus:["CREATED","ASSIGNED","ANSWERED","RESTORED","RESOLVED","CLOSED"],serviceGroups:{ASSET:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"],SUBSCRIBER:["emptyServiceGroup"],SUBSCRIPTION:["emptyServiceGroup"],GATEWAY:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"]},administrativeState:{ASSET:[{id:"BANNED",description:"Asset banned, It means that received information of this asset is not going to be collected"},{id:"DELETED",description:"Asset removed from available stock"},{id:"IN_MAINTENANCE",description:"Asset in maintenance"},{id:"IN_STOCK",description:"Asset in stock"},{id:"IN_TRANSIT",description:"Asset in transit"},{id:"IN_USE",description:"Asset in use"},{id:"MISSING",description:"Asset missing"},{id:"ORDERED",description:"Asset ordered"},{id:"READY",description:"Asset ready for installation"},{id:"RETIRED",description:"Field entity withdrawal"}],GATEWAY:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],COMMUNICATIONS_MODULE:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIBER:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIPTION:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],CERTIFICATE:[{id:"NOT_ACTIVE",description:"NOT_ACTIVE"},{id:"ACTIVE",description:"ACTIVE"},{id:"REVOKED",description:"REVOKED"},{id:"EXPIRED",description:"EXPIRED"}]},operationalStatus:{ASSET:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],GATEWAY:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],COMMUNICATIONS_MODULE:["UNKNOWN","STOPPED","STARTING","RUNNING","STOPPING","ERROR"]},communicationsModuleType:{ADSL:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","ADDRESS","HOME_OPERATOR","LOCATION"]}},CAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},ETH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["subscriptionName","description","administrativeState","ADDRESS"]}},GENERIC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","description","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","description","administrativeState","ICC","SERIAL_NUMBER"]}},GSM:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","description","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","description","administrativeState","ICC"]}},HAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},I2C:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},LOWPAN:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}},LTE_M:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},MESH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]}},MOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},MULTIMOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},NARROWBAND:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","LOCATION"]},SUBSCRIBER:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriberName","description","ICC"]}},PLC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}},RS232:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS422:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS485:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},SIGFOX:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:["PAC"]},SUBSCRIPTION:{mandatory:["generatedEntityKey","subscriptionName","HOME_OPERATOR","administrativeState","description","SIGFOX_DEVICE_TYPE"]}},ZIGBEE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}}},ruleMode:["EASY","ADVANCED"],ruleType:["DATASTREAM","OPERATION","EVENT"],ruleConfigurationSeverity:["INFORMATIVE","URGENT","CRITICAL"],userProfile:{root:["admin_domain","admin","advanced","viewer","super_admin_domain"],super_admin_domain:["admin_domain","admin","advanced","viewer"],admin_domain:["admin_domain","admin","advanced","viewer"],admin:["admin","advanced","viewer"],advanced:[],viewer:[]},ioTDatastreamAccess:["READ","WRITE"],ioTDatastreamStoragePeriod:["SECONDS","MINUTES","HOURS","DAYS","MONTHS","YEARS","NEVER"],ioTDatastreamPeriod:["PULSE","CUMULATIVE","INSTANT"],resourceType:[{identifier:"entity.asset"},{identifier:"entity.device"},{identifier:"entity.subscriber"},{identifier:"entity.subscription"},{identifier:"ticket"}],allowedResourceType:[{resourceType:"entity.asset",types:["entity","asset"]},{resourceType:"entity.device",types:["entity","device"]},{resourceType:"entity.subscriber",types:["entity","subscriber"]},{resourceType:"entity.subscription",types:["entity","subscription"]},{resourceType:"ticket",types:["ticket"]},{resourceType:"organization",types:["organization"]},{resourceType:"channel",types:["channel"]}],fieldsDefinition:{string:{description:"Text based value",subtype:["text","password"]},boolean:{description:"Boolean based value",subtype:[]},calendar:{description:"Format is described in the ISO 8601 or in http://www.w3.org/TR/NOTE-datetime",subtype:["datetime","date","time"]},address:{description:"Network address value",subtype:["ip","ipv4","ipv6","mac48"]},number:{description:"Numeric value",subtype:["integer","float","percentage"]},enumeration:{description:"Choice list values",subtype:["string","number"]},array:{description:"Array of values",subtype:["string","number"]},coordinates:{description:"Object indicating coordinates and timestamp in geotime subtype",subtype:["geo","geotime","geojson"]},topology:{description:"Object indicating relations",subtype:["path","tree (not supported yet)"]},object:{description:"Not yet supported. For future uses only",subtype:[]}},userLanguages:[{code:"es",language:"Español/Spanish"},{code:"en",language:"Inglés/English"},{code:"pt",language:"Portugués/Portuguese"}],countryCodes:[{code:"AD",country:"Andorra",zone:"Europe/Andorra"},{code:"AE",country:"United Arab Emirates",zone:"Asia/Dubai"},{code:"AF",country:"Afghanistan",zone:"Asia/Kabul"},{code:"AG",country:"Antigua and Barbuda",zone:"America/Antigua"},{code:"AI",country:"Anguilla",zone:"America/Anguilla"},{code:"AL",country:"Albania",zone:"Europe/Tirane"},{code:"AM",country:"Armenia",zone:"Asia/Yerevan"},{code:"AN",country:"Netherlands Antilles",zone:"Netherlands Antilles"},{code:"AO",country:"Angola",zone:"Africa/Luanda"},{code:"AQ",country:"Antarctica",zone:"Antarctica/McMurdo"},{code:"AR",country:"Argentina",zone:"America/Argentina/Buenos_Aires"},{code:"AS",country:"American Samoa",zone:"Pacific/Pago_Pago"},{code:"AT",country:"Austria",zone:"Europe/Vienna"},{code:"AU",country:"Australia",zone:"Australia/Lord_Howe"},{code:"AW",country:"Aruba",zone:"America/Aruba"},{code:"AX",country:"Aland Islands",zone:"Europe/Mariehamn"},{code:"AZ",country:"Azerbaijan",zone:"Asia/Baku"},{code:"BA",country:"Bosnia and Herzegovina",zone:"Europe/Sarajevo"},{code:"BB",country:"Barbados",zone:"America/Barbados"},{code:"BD",country:"Bangladesh",zone:"Asia/Dhaka"},{code:"BE",country:"Belgium",zone:"Europe/Brussels"},{code:"BF",country:"Burkina Faso",zone:"Africa/Ouagadougou"},{code:"BG",country:"Bulgaria",zone:"Europe/Sofia"},{code:"BH",country:"Bahrain",zone:"Asia/Bahrain"},{code:"BI",country:"Burundi",zone:"Africa/Bujumbura"},{code:"BJ",country:"Benin",zone:"Africa/Porto-Novo"},{code:"BL",country:"Saint Barthélemy",zone:"America/St_Barthelemy"},{code:"BM",country:"Bermuda",zone:"Atlantic/Bermuda"},{code:"BN",country:"Brunei",zone:"Asia/Brunei"},{code:"BO",country:"Bolivia",zone:"America/La_Paz"},{code:"BQ",country:"Bonaire, Saint Eustatius and Saba",zone:"America/Kralendijk"},{code:"BR",country:"Brazil",zone:"America/Noronha"},{code:"BS",country:"Bahamas",zone:"America/Nassau"},{code:"BT",country:"Bhutan",zone:"Asia/Thimphu"},{code:"BV",country:"Bouvet Island",zone:"Bouvet Island"},{code:"BW",country:"Botswana",zone:"Africa/Gaborone"},{code:"BY",country:"Belarus",zone:"Europe/Minsk"},{code:"BZ",country:"Belize",zone:"America/Belize"},{code:"CA",country:"Canada",zone:"America/St_Johns"},{code:"CC",country:"Cocos Islands",zone:"Indian/Cocos"},{code:"CD",country:"Democratic Republic of the Congo",zone:"Africa/Kinshasa"},{code:"CF",country:"Central African Republic",zone:"Africa/Bangui"},{code:"CG",country:"Republic of the Congo",zone:"Africa/Brazzaville"},{code:"CH",country:"Switzerland",zone:"Europe/Zurich"},{code:"CI",country:"Ivory Coast",zone:"Africa/Abidjan"},{code:"CK",country:"Cook Islands",zone:"Pacific/Rarotonga"},{code:"CL",country:"Chile",zone:"America/Santiago"},{code:"CM",country:"Cameroon",zone:"Africa/Douala"},{code:"CN",country:"China",zone:"Asia/Shanghai"},{code:"CO",country:"Colombia",zone:"America/Bogota"},{code:"CR",country:"Costa Rica",zone:"America/Costa_Rica"},{code:"CS",country:"Serbia and Montenegro",zone:"Serbia and Montenegro"},{code:"CU",country:"Cuba",zone:"America/Havana"},{code:"CV",country:"Cape Verde",zone:"Atlantic/Cape_Verde"},{code:"CW",country:"Curaçao",zone:"America/Curacao"},{code:"CX",country:"Christmas Island",zone:"Indian/Christmas"},{code:"CY",country:"Cyprus",zone:"Asia/Nicosia"},{code:"CZ",country:"Czech Republic",zone:"Europe/Prague"},{code:"DE",country:"Germany",zone:"Europe/Berlin"},{code:"DJ",country:"Djibouti",zone:"Africa/Djibouti"},{code:"DK",country:"Denmark",zone:"Europe/Copenhagen"},{code:"DM",country:"Dominica",zone:"America/Dominica"},{code:"DO",country:"Dominican Republic",zone:"America/Santo_Domingo"},{code:"DZ",country:"Algeria",zone:"Africa/Algiers"},{code:"EC",country:"Ecuador",zone:"America/Guayaquil"},{code:"EE",country:"Estonia",zone:"Europe/Tallinn"},{code:"EG",country:"Egypt",zone:"Africa/Cairo"},{code:"EH",country:"Western Sahara",zone:"Africa/El_Aaiun"},{code:"ER",country:"Eritrea",zone:"Africa/Asmara"},{code:"ES",country:"Spain",zone:"Europe/Madrid"},{code:"ET",country:"Ethiopia",zone:"Africa/Addis_Ababa"},{code:"FI",country:"Finland",zone:"Europe/Helsinki"},{code:"FJ",country:"Fiji",zone:"Pacific/Fiji"},{code:"FK",country:"Falkland Islands",zone:"Atlantic/Stanley"},{code:"FM",country:"Micronesia",zone:"Pacific/Chuuk"},{code:"FO",country:"Faroe Islands",zone:"Atlantic/Faroe"},{code:"FR",country:"France",zone:"Europe/Paris"},{code:"GA",country:"Gabon",zone:"Africa/Libreville"},{code:"GB",country:"United Kingdom",zone:"Europe/London"},{code:"GD",country:"Grenada",zone:"America/Grenada"},{code:"GE",country:"Georgia",zone:"Asia/Tbilisi"},{code:"GF",country:"French Guiana",zone:"America/Cayenne"},{code:"GG",country:"Guernsey",zone:"Europe/Guernsey"},{code:"GH",country:"Ghana",zone:"Africa/Accra"},{code:"GI",country:"Gibraltar",zone:"Europe/Gibraltar"},{code:"GL",country:"Greenland",zone:"America/Godthab"},{code:"GM",country:"Gambia",zone:"Africa/Banjul"},{code:"GN",country:"Guinea",zone:"Africa/Conakry"},{code:"GP",country:"Guadeloupe",zone:"America/Guadeloupe"},{code:"GQ",country:"Equatorial Guinea",zone:"Africa/Malabo"},{code:"GR",country:"Greece",zone:"Europe/Athens"},{code:"GS",country:"South Georgia and the South Sandwich Islands",zone:"Atlantic/South_Georgia"},{code:"GT",country:"Guatemala",zone:"America/Guatemala"},{code:"GU",country:"Guam",zone:"Pacific/Guam"},{code:"GW",country:"Guinea-Bissau",zone:"Africa/Bissau"},{code:"GY",country:"Guyana",zone:"America/Guyana"},{code:"HK",country:"Hong Kong",zone:"Asia/Hong_Kong"},{code:"HM",country:"Heard Island and McDonald Islands",zone:"Heard Island and McDonald Islands"},{code:"HN",country:"Honduras",zone:"America/Tegucigalpa"},{code:"HR",country:"Croatia",zone:"Europe/Zagreb"},{code:"HT",country:"Haiti",zone:"America/Port-au-Prince"},{code:"HU",country:"Hungary",zone:"Europe/Budapest"},{code:"ID",country:"Indonesia",zone:"Asia/Jakarta"},{code:"IE",country:"Ireland",zone:"Europe/Dublin"},{code:"IL",country:"Israel",zone:"Asia/Jerusalem"},{code:"IM",country:"Isle of Man",zone:"Europe/Isle_of_Man"},{code:"IN",country:"India",zone:"Asia/Kolkata"},{code:"IO",country:"British Indian Ocean Territory",zone:"Indian/Chagos"},{code:"IQ",country:"Iraq",zone:"Asia/Baghdad"},{code:"IR",country:"Iran",zone:"Asia/Tehran"},{code:"IS",country:"Iceland",zone:"Atlantic/Reykjavik"},{code:"IT",country:"Italy",zone:"Europe/Rome"},{code:"JE",country:"Jersey",zone:"Europe/Jersey"},{code:"JM",country:"Jamaica",zone:"America/Jamaica"},{code:"JO",country:"Jordan",zone:"Asia/Amman"},{code:"JP",country:"Japan",zone:"Asia/Tokyo"},{code:"KE",country:"Kenya",zone:"Africa/Nairobi"},{code:"KG",country:"Kyrgyzstan",zone:"Asia/Bishkek"},{code:"KH",country:"Cambodia",zone:"Asia/Phnom_Penh"},{code:"KI",country:"Kiribati",zone:"Pacific/Tarawa"},{code:"KM",country:"Comoros",zone:"Indian/Comoro"},{code:"KN",country:"Saint Kitts and Nevis",zone:"America/St_Kitts"},{code:"KP",country:"North Korea",zone:"Asia/Pyongyang"},{code:"KR",country:"South Korea",zone:"Asia/Seoul"},{code:"KW",country:"Kuwait",zone:"Asia/Kuwait"},{code:"KY",country:"Cayman Islands",zone:"America/Cayman"},{code:"KZ",country:"Kazakhstan",zone:"Asia/Almaty"},{code:"LA",country:"Laos",zone:"Asia/Vientiane"},{code:"LB",country:"Lebanon",zone:"Asia/Beirut"},{code:"LC",country:"Saint Lucia",zone:"America/St_Lucia"},{code:"LI",country:"Liechtenstein",zone:"Europe/Vaduz"},{code:"LK",country:"Sri Lanka",zone:"Asia/Colombo"},{code:"LR",country:"Liberia",zone:"Africa/Monrovia"},{code:"LS",country:"Lesotho",zone:"Africa/Maseru"},{code:"LT",country:"Lithuania",zone:"Europe/Vilnius"},{code:"LU",country:"Luxembourg",zone:"Europe/Luxembourg"},{code:"LV",country:"Latvia",zone:"Europe/Riga"},{code:"LY",country:"Libya",zone:"Africa/Tripoli"},{code:"MA",country:"Morocco",zone:"Africa/Casablanca"},{code:"MC",country:"Monaco",zone:"Europe/Monaco"},{code:"MD",country:"Moldova",zone:"Europe/Chisinau"},{code:"ME",country:"Montenegro",zone:"Europe/Podgorica"},{code:"MF",country:"Saint Martin",zone:"America/Marigot"},{code:"MG",country:"Madagascar",zone:"Indian/Antananarivo"},{code:"MH",country:"Marshall Islands",zone:"Pacific/Majuro"},{code:"MK",country:"Macedonia",zone:"Europe/Skopje"},{code:"ML",country:"Mali",zone:"Africa/Bamako"},{code:"MM",country:"Myanmar",zone:"Asia/Yangon"},{code:"MN",country:"Mongolia",zone:"Asia/Ulaanbaatar"},{code:"MO",country:"Macao",zone:"Asia/Macau"},{code:"MP",country:"Northern Mariana Islands",zone:"Pacific/Saipan"},{code:"MQ",country:"Martinique",zone:"America/Martinique"},{code:"MR",country:"Mauritania",zone:"Africa/Nouakchott"},{code:"MS",country:"Montserrat",zone:"America/Montserrat"},{code:"MT",country:"Malta",zone:"Europe/Malta"},{code:"MU",country:"Mauritius",zone:"Indian/Mauritius"},{code:"MV",country:"Maldives",zone:"Indian/Maldives"},{code:"MW",country:"Malawi",zone:"Africa/Blantyre"},{code:"MX",country:"Mexico",zone:"America/Mexico_City"},{code:"MY",country:"Malaysia",zone:"Asia/Kuala_Lumpur"},{code:"MZ",country:"Mozambique",zone:"Africa/Maputo"},{code:"NA",country:"Namibia",zone:"Africa/Windhoek"},{code:"NC",country:"New Caledonia",zone:"Pacific/Noumea"},{code:"NE",country:"Niger",zone:"Africa/Niamey"},{code:"NF",country:"Norfolk Island",zone:"Pacific/Norfolk"},{code:"NG",country:"Nigeria",zone:"Africa/Lagos"},{code:"NI",country:"Nicaragua",zone:"America/Managua"},{code:"NL",country:"Netherlands",zone:"Europe/Amsterdam"},{code:"NO",country:"Norway",zone:"Europe/Oslo"},{code:"NP",country:"Nepal",zone:"Asia/Kathmandu"},{code:"NR",country:"Nauru",zone:"Pacific/Nauru"},{code:"NU",country:"Niue",zone:"Pacific/Niue"},{code:"NZ",country:"New Zealand",zone:"Pacific/Auckland"},{code:"OM",country:"Oman",zone:"Asia/Muscat"},{code:"PA",country:"Panama",zone:"America/Panama"},{code:"PE",country:"Peru",zone:"America/Lima"},{code:"PF",country:"French Polynesia",zone:"Pacific/Tahiti"},{code:"PG",country:"Papua New Guinea",zone:"Pacific/Port_Moresby"},{code:"PH",country:"Philippines",zone:"Asia/Manila"},{code:"PK",country:"Pakistan",zone:"Asia/Karachi"},{code:"PL",country:"Poland",zone:"Europe/Warsaw"},{code:"PM",country:"Saint Pierre and Miquelon",zone:"America/Miquelon"},{code:"PN",country:"Pitcairn",zone:"Pacific/Pitcairn"},{code:"PR",country:"Puerto Rico",zone:"America/Puerto_Rico"},{code:"PS",country:"Palestinian Territory",zone:"Asia/Gaza"},{code:"PT",country:"Portugal",zone:"Europe/Lisbon"},{code:"PW",country:"Palau",zone:"Pacific/Palau"},{code:"PY",country:"Paraguay",zone:"America/Asuncion"},{code:"QA",country:"Qatar",zone:"Asia/Qatar"},{code:"RE",country:"Reunion",zone:"Indian/Reunion"},{code:"RO",country:"Romania",zone:"Europe/Bucharest"},{code:"RS",country:"Serbia",zone:"Europe/Belgrade"},{code:"RU",country:"Russia",zone:"Europe/Kaliningrad"},{code:"RW",country:"Rwanda",zone:"Africa/Kigali"},{code:"SA",country:"Saudi Arabia",zone:"Asia/Riyadh"},{code:"SB",country:"Solomon Islands",zone:"Pacific/Guadalcanal"},{code:"SC",country:"Seychelles",zone:"Indian/Mahe"},{code:"SD",country:"Sudan",zone:"Africa/Khartoum"},{code:"SE",country:"Sweden",zone:"Europe/Stockholm"},{code:"SG",country:"Singapore",zone:"Asia/Singapore"},{code:"SH",country:"Saint Helena",zone:"Atlantic/St_Helena"},{code:"SI",country:"Slovenia",zone:"Europe/Ljubljana"},{code:"SJ",country:"Svalbard and Jan Mayen",zone:"Arctic/Longyearbyen"},{code:"SK",country:"Slovakia",zone:"Europe/Bratislava"},{code:"SL",country:"Sierra Leone",zone:"Africa/Freetown"},{code:"SM",country:"San Marino",zone:"Europe/San_Marino"},{code:"SN",country:"Senegal",zone:"Africa/Dakar"},{code:"SO",country:"Somalia",zone:"Africa/Mogadishu"},{code:"SR",country:"Suriname",zone:"America/Paramaribo"},{code:"SS",country:"South Sudan",zone:"Africa/Juba"},{code:"ST",country:"Sao Tome and Principe",zone:"Africa/Sao_Tome"},{code:"SV",country:"El Salvador",zone:"America/El_Salvador"},{code:"SX",country:"Sint Maarten",zone:"America/Lower_Princes"},{code:"SY",country:"Syria",zone:"Asia/Damascus"},{code:"SZ",country:"Swaziland",zone:"Africa/Mbabane"},{code:"TC",country:"Turks and Caicos Islands",zone:"America/Grand_Turk"},{code:"TD",country:"Chad",zone:"Africa/Ndjamena"},{code:"TF",country:"French Southern Territories",zone:"Indian/Kerguelen"},{code:"TG",country:"Togo",zone:"Africa/Lome"},{code:"TH",country:"Thailand",zone:"Asia/Bangkok"},{code:"TJ",country:"Tajikistan",zone:"Asia/Dushanbe"},{code:"TK",country:"Tokelau",zone:"Pacific/Fakaofo"},{code:"TL",country:"East Timor",zone:"Asia/Dili"},{code:"TM",country:"Turkmenistan",zone:"Asia/Ashgabat"},{code:"TN",country:"Tunisia",zone:"Africa/Tunis"},{code:"TO",country:"Tonga",zone:"Pacific/Tongatapu"},{code:"TR",country:"Turkey",zone:"Europe/Istanbul"},{code:"TT",country:"Trinidad and Tobago",zone:"America/Port_of_Spain"},{code:"TV",country:"Tuvalu",zone:"Pacific/Funafuti"},{code:"TW",country:"Taiwan",zone:"Asia/Taipei"},{code:"TZ",country:"Tanzania",zone:"Africa/Dar_es_Salaam"},{code:"UA",country:"Ukraine",zone:"Europe/Kiev"},{code:"UG",country:"Uganda",zone:"Africa/Kampala"},{code:"UM",country:"United States Minor Outlying Islands",zone:"Pacific/Midway"},{code:"US",country:"United States",zone:"America/New_York"},{code:"UY",country:"Uruguay",zone:"America/Montevideo"},{code:"UZ",country:"Uzbekistan",zone:"Asia/Samarkand"},{code:"VA",country:"Vatican",zone:"Europe/Vatican"},{code:"VC",country:"Saint Vincent and the Grenadines",zone:"America/St_Vincent"},{code:"VE",country:"Venezuela",zone:"America/Caracas"},{code:"VG",country:"British Virgin Islands",zone:"America/Tortola"},{code:"VI",country:"U.S. Virgin Islands",zone:"America/St_Thomas"},{code:"VN",country:"Vietnam",zone:"Asia/Ho_Chi_Minh"},{code:"VU",country:"Vanuatu",zone:"Pacific/Efate"},{code:"WF",country:"Wallis and Futuna",zone:"Pacific/Wallis"},{code:"WS",country:"Samoa",zone:"Pacific/Apia"},{code:"XK",country:"Kosovo",zone:"Kosovo"},{code:"YE",country:"Yemen",zone:"Asia/Aden"},{code:"YT",country:"Mayotte",zone:"Indian/Mayotte"},{code:"ZA",country:"South Africa",zone:"Africa/Johannesburg"},{code:"ZM",country:"Zambia",zone:"Africa/Lusaka"},{code:"ZW",country:"Zimbabwe",zone:"Africa/Harare"}],timezones:["ACT","AET","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","AGT","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port_of_Spain","America/Port-au-Prince","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","ART","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","AST","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/North","Australia/NSW","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","BET","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","BST","Canada/Atlantic","Canada/Central","Canada/East-Saskatchewan","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","CAT","CET","Chile/Continental","Chile/EasterIsland","CNT","CST","CST6CDT","CTT","Cuba","EAT","ECT","EET","Egypt","Eire","EST","EST5EDT","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT0","Greenwich","Hongkong","HST","Iceland","IET","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","IST","Jamaica","Japan","JST","Kwajalein","Libya","MET","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","MIT","MST","MST7MDT","Navajo","NET","NST","NZ","NZ-CHAT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","PLT","PNT","Poland","Portugal","PRC","PRT","PST","PST8PDT","ROK","Singapore","SST","SystemV/AST4","SystemV/AST4ADT","SystemV/CST6","SystemV/CST6CDT","SystemV/EST5","SystemV/EST5EDT","SystemV/HST10","SystemV/MST7","SystemV/MST7MDT","SystemV/PST8","SystemV/PST8PDT","SystemV/YST9","SystemV/YST9YDT","Turkey","UCT","Universal","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","VST","W-SU","WET","Zulu"]}[e]}}]),t}(a.default);r.default=s,t.exports=r.default},{"./Search":289,q:120}],293:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./BaseSearch")),o=i(e("merge")),s=i(e("q")),u=function(e){function t(e,r,n,i,a,s,u,c,l){void 0===i&&(i={limit:{}}),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,c),this._setUrlParameters(l),this._postObj=(0,o.default)(n,i,s,u),"object"==typeof a&&(this._postObj=(0,o.default)(this._postObj,a))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_filter",value:function(){return this._postObj}},{key:"_loadData",value:function(e){var t=this,r=s.default.defer(),n=t._asyncPagingFilter(),i=!1;return function e(){if(t.cancel||"string"==typeof t.cancel){var a="string"==typeof t.cancel?t.cancel:"Cancel process";r.reject({data:a,statusCode:403})}else t._ogapi.Napi.post(t._resource,n,t._timeout,t._getExtraHeaders(),t._getUrlParameters()).then((function(t){var a=t.statusCode,o=t.body;if(!o&&t.text)try{var s=JSON.parse(t.text);s&&(o=s)}catch(e){console.warn("Impossible to parse text from response: "+t.text)}200===a?(i=!0,r.notify(o),o.data.length===n.limit.size?(n.limit.start+=1,e()):r.resolve({data:"DONE",statusCode:200})):i?r.resolve({data:"DONE",statusCode:200}):r.reject({data:o,statusCode:a})})).catch((function(e){r.reject(e)}))}(),r.promise}}]),t}(a.default);r.default=u,t.exports=r.default},{"./BaseSearch":285,merge:112,q:120}],294:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/administrativeState",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"administrativeState",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],295:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="$_token";r.TOKEN_URL=u;var c=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new s.default(e,"/alarms"):arguments[1];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscriptions:"/subscriptions"},r),this._url="/entities"+u+"/alarms"}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(u,this._routes[e]));return this._url=this._url.replace(u,""),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],296:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/allowedResourceType",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"allowedResourceType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e.toLowerCase(),this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],297:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/areas",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],298:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./PreFilteredSearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../AssetSearch")),u="/entities",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.asset.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}},{key:"select",value:function(e){return this._builderParams.select=e||void 0,this}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"../AssetSearch":284,"./PreFilteredSearchBuilder":331}],299:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=(i(e("merge")),i(e("jsonpath"))),s=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._resource="resources/schemaTypes/og_basic_types",this._headers=void 0,this._og_basic_types={},this.publicParameters=!1,this._urlParameters=void 0}return n(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=this,t=a.default.defer(),r=t.promise;return this._setExtraHeaders({Accept:"application/json"}),this._ogapi.Napi.get(this._resource,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(r){var n=r.body,i=r.statusCode;if(e._og_basic_types=n,o.default.apply(e._og_basic_types,"$..['$ref']",(function(e,t){var r="$.."+e.replace("#/definitions/","");return o.default.query(n,r)[0]})).forEach((function(e){var t=o.default.stringify(e.path);o.default.value(n,t,e.value)})),e.path){var a=e.path.includes("$")?e.path:"$.."+e.path,s=o.default.query(n,a)[0]||{msg:"not Found"};t.resolve({data:s,statusCode:i})}else{if(e.publicParameters)for(var u in n.definitions)n.definitions[u].public&&!1!==n.definitions[u].public||delete n.definitions[u];t.resolve({data:n,statusCode:i})}})).catch((function(e){t.reject(e)})),r}},{key:"withPath",value:function(e){return this.path=e,this}},{key:"withPublicParameters",value:function(e){return this.publicParameters=e,this}},{key:"build",value:function(){return this}}]),e}();r.default=s,t.exports=r.default},{jsonpath:104,merge:112,q:120}],300:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../WPSearch")),u="provisionProcessors/bulk/search",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"../WPSearch":293,"./SearchBuilder":335}],301:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/bulk/async",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],302:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/bundles",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],303:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s="/certificates",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,s)),this._url=s,this._fetch=!1,this._assignable=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"assignable",value:function(){return this._assignable=!0,this}},{key:"administrable",value:function(){return this._assignable=!1,this}},{key:"withFetch",value:function(e){if(!0!==e&&!1!==e)throw new Error("Flag fecth incorrect");return this._fetch=e,this}},{key:"_buildUrl",value:function(){var e=this._url;return!0===this._fetch&&(this._urlParams.fetch=1),!0===this._assignable&&(this._urlParams.visibility="assignable"),e}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],304:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="/channels",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,u)),this._url=u,this._summary=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],305:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/communicationsModuleType",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"communicationsModuleType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],306:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/countryCodes",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"countryCodes",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],307:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/datamodels",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],308:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("merge")),s=i(e("moment")),u=i(e("../../util/searchingFields/FieldFinder")),c=e("../../util/DATE_FORMAT"),l="/datapoints",p=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new u.default(e,l)),this._url=l,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withDeviceId",value:function(e){if("string"!=typeof e)throw new Error("Parameter deviceId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.device",e)),this}},{key:"withDatastream",value:function(e){if("string"!=typeof e)throw new Error("Parameter datastreamId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.datastream",e)),this}},{key:"withFeed",value:function(e){if("string"!=typeof e)throw new Error("Parameter feedId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.feed",e)),this}},{key:"betweenDates",value:function(e,t){if("object"!=typeof e||e.constructor!==Date)throw new Error("Parameter fromDate must be a Date");if(this.fluentFilter.and(this._parent.EX.gt("datapoint.at",(0,s.default)(e).format(c.DATE_FORMAT))),void 0!==t){if(t.constructor!==Date)throw new Error("Parameter toDate must be a Date");this.fluentFilter.and(this._parent.EX.lt("datapoint.at",(0,s.default)(t).format(c.DATE_FORMAT)))}return this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,o.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [betweenDates, addTag, withDatastreamId, withDeviceId] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}},{key:"select",value:function(e){return this._builderParams.select=e,this}}]),t}(a.default);r.default=p,t.exports=r.default},{"../../util/DATE_FORMAT":368,"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335,merge:112,moment:116}],309:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u=a(e("../EntitySearch")),c="$_token";r.TOKEN_URL=c;var l=function(e){function t(e,r,n){var a=arguments.length<=3||void 0===arguments[3]?new s.default(e,"/entities"):arguments[3];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/"},a),this._url="/organizations/"+r+"/datasets/"+n+c}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(c,this._routes[e]));return this._url=this._url.replace(c,""),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new u.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(o.default);r.default=l},{"../../util/searchingFields/FieldFinder":374,"../EntitySearch":287,"./SearchWithSummaryBuilder":336}],310:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../WPSearch")),u="datasets";r.BASE_URL=u;var c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u,{organization:r,dataset:n})),this._url=u+"/provision/organizations/"+r+"/"+n+"/data"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(a.default);r.default=c},{"../../util/searchingFields/FieldFinder":374,"../WPSearch":293,"./SearchBuilder":335}],311:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/catalog/datasets",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],312:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=(n(e("../Search")),n(e("../../util/searchingFields/FieldFinder"))),o="/datastreams",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"../Search":289,"./SearchBuilder":335}],313:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="/catalog/plans/device",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("Parameter domainName must be a string");return this._domainName=e,this}},{key:"_buildUrl",value:function(){if(!this._domainName)throw new Error("Parameter domainName must be defined");return this._url=u+"?domainName="+this._domainName,i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],314:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./PreFilteredSearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s="/entities",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,s)),this._url=s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.device.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./PreFilteredSearchBuilder":331}],315:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="/domains",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,u)),this._url=u,this._summary=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],316:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u=a(e("../EntitySearch")),c="$_token";r.TOKEN_URL=c;var l=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new s.default(e,"/entities"):arguments[1];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices"},r),this._url="/entities"+c}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(c,this._routes[e]));return this._url=this._url.replace(c,""),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new u.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(o.default);r.default=l},{"../../util/searchingFields/FieldFinder":374,"../EntitySearch":287,"./SearchWithSummaryBuilder":336}],317:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new a.default(e,"/operations/history"):arguments[1];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},r),this._url="/entities/operations/history"}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=o,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],318:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="$_token";r.TOKEN_URL=u;var c=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new s.default(e,"/operations"):arguments[1];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscribers:"/subscribers",onSubscriptions:"/subscriptions",onCommunicationsModules:"/communicationsModules"},r),this._url="/entities"+u+"/operations"}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildUrl",value:function(){for(var e in this._checkConstraintRoutes(),this._routes)this._builderParams[e]&&(this._url=this._url.replace(u,this._routes[e]));return i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],319:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/feeds",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],320:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/fieldsDefinition",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"fieldsDefinition",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],321:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchBuilder")),s=a(e("../DeviceSearch")),u=function(e){function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"_buildUrl",value:function(){return i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(o.default);r.default=u,t.exports=r.default},{"../DeviceSearch":286,"./SearchBuilder":335}],322:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchWithSummaryBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s="/catalog/hardwares",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,s)),this._url=s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e,this}},{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],323:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamAccess",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamAccess",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],324:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamPeriod",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamPeriod",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],325:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamStoragePeriod",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamStoragePeriod",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],326:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/catalog/operators",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],327:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../SearchWithoutLimit")),u="/operationTypes",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){try{return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}catch(e){console.error("!errrrror!!!!!!",e)}}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"../SearchWithoutLimit":290,"./SearchBuilder":335}],328:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/operationalStatus",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"operationalStatus",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],329:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/jobs",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],330:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="/catalog/plans/organization",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("Parameter domainName must be a string");return this._domainName=e,this}},{key:"_buildUrl",value:function(){if(!this._domainName)throw new Error("Parameter domainName must be defined");return this._url=u+"?domainName="+this._domainName,i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],331:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./FlattenedSearchBuilder"),o=function(e){function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"provisioned",value:function(){return this._provisioned=!0,this}},{key:"collected",value:function(){return this._collected=!0,this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"./FlattenedSearchBuilder":321}],332:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();e("./SearchBuilder");var i,a=e("../Search"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._api=t}return n(e,[{key:"from",value:function(e){if("string"!=typeof e)throw new Error("Url parameter is mandatory and must be a string");return this._url=e,this}},{key:"filter",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this._filter={filter:e},this}},{key:"limit",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this._limit={limit:e},this}},{key:"build",value:function(){if("string"!=typeof this._url)throw new Error("Url parameter is mandatory and must be a string");return new o.default(this._api,this._url,this._filter,this._limit,{})}}]),e}();r.default=s,t.exports=r.default},{"../Search":289,"./SearchBuilder":335}],333:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/resourceType",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"resourceType",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],334:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/rules",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],335:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../Search"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r,n){var i=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");this._url="",this._fieldFinder=n,this._parent=t,this._routes=r,this._routesName=[],this._builderParams={summary:!1,sort:[],filter:{},limit:void 0,group:void 0,select:void 0};var a=function(e){i._routesName.push(e),i._builderParams[e]=!1,i[e]=function(){var t=arguments.length<=0||void 0===arguments[0]?e:arguments[0];return i._builderParams[t]=!0,i}};for(var o in this._routes)a(o);this._urlParams={}}return n(e,[{key:"findFields",value:function(e){return this._fieldFinder.find(e)}},{key:"findAllFields",value:function(e){return this._fieldFinder.findAll(e)}},{key:"findFieldPath",value:function(e){return this._fieldFinder.findFieldPath(e)}},{key:"withTimeout",value:function(){var e=arguments.length<=0||void 0===arguments[0]?2e3:arguments[0];if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._builderParams.timeout=e,this}},{key:"filter",value:function(e){return this._builderParams.filter=e||{},this}},{key:"addSortAscendingBy",value:function(e){return this.addSortBy(e,"ASCENDING")}},{key:"addSortDescendingBy",value:function(e){return this.addSortBy(e,"DESCENDING")}},{key:"addSortBy",value:function(e,t){if(e&&t)if(this._builderParams.sort.length>0){var r=0,n=!1;for(r=0;r<this._builderParams.sort.length;r++)this._builderParams.sort[r].name===e&&(this._builderParams.sort[r].type=t,n=!0);n||this._builderParams.sort.push({name:e,type:t})}else this._builderParams.sort.push({name:e,type:t});return this}},{key:"removeSortBy",value:function(e){if(e){if(this._builderParams.sort.length>0){var t=0;for(t=0;t<this._builderParams.sort.length;t++)this._builderParams.sort[t].name===e&&(this._builderParams.sort.splice(t,t+1),t--)}}else this._builderParams.sort=[];return this}},{key:"limit",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if("number"!=typeof e)throw new Error("size parameter must be a number");return("number"!=typeof t||t<1)&&(t=1),this._builderParams.limit={size:e,start:t},this}},{key:"build",value:function(){try{return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}catch(e){console.error("!errrrror!!!!!!",e)}}},{key:"_buildFilter",value:function(){var e=this._builderParams.filter;return void 0!==e._filterTemplate?e._filterTemplate:{filter:e}}},{key:"_buildSelect",value:function(){var e=this._builderParams.select;return void 0!==e&&void 0!==e._selectTemplate?e._selectTemplate:{select:e}}},{key:"_buildGroup",value:function(){var e=this._builderParams.group;return void 0!==e&&void 0!==e._groupTemplate?e._groupTemplate:{group:e}}},{key:"_buildLimit",value:function(){return void 0===this._builderParams.limit?{limit:{size:1e3,start:1}}:{limit:this._builderParams.limit}}},{key:"_buildSort",value:function(){if(0!==this._builderParams.sort.length)return{sort:{parameters:this._builderParams.sort}}}},{key:"_buildUrl",value:function(){if("string"!=typeof this._url||0===this._url.trim().length)throw new Error("Error on extends SearchBuilder, this._url is not defined.");return this._url}},{key:"_checkConstraintRoutes",value:function(){var e=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=!1;for(var r in this._routes){if(t&&this._builderParams[r]&&!e)throw new Error("Must select only one of this:"+JSON.stringify(this._routesName));t=t||this._builderParams[r]}if(!t)throw new Error("Must select one at least: "+JSON.stringify(this._routesName))}}]),e}();r.default=s,t.exports=r.default},{"../Search":289}],336:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SearchBuilder"),o=function(e){function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"./SearchBuilder":335}],337:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s="serviceGroups",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/"+s,this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,s,this.customFilters)}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(a.default);r.default=u,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],338:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchWithSummaryBuilder")),o=i(e("merge")),s=i(e("../../util/searchingFields/FieldFinder")),u=["SOFTWARE","FIRMWARE"];r.SOFTWARE_TYPES_ENUM=u;var c="/catalog/softwares",l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,c)),this._url=c,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter softwareId must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareId",e)),this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("Parameter softwareName must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareName",e)),this}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter version must be a string");var t="";if(void 0===u.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error("Parameter in TYPE is not allowed. Parameter value '"+JSON.stringify(t)+"', parameters allowed in administrativeState are: '"+JSON.stringify(u)+"'");return this.fluentFilter.and(this._parent.EX.eq("softwareType",e)),this}},{key:"withVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter version must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareVersion",e)),this}},{key:"withHardwareId",value:function(e){if("string"!=typeof e)throw new Error("Parameter hardwareId must be a string");return this.fluentFilter.and(this._parent.EX.eq("hardwareId",e)),this}},{key:"withModel",value:function(e){if("string"!=typeof e)throw new Error("Parameter modelName must be a string");return this.fluentFilter.and(this._parent.EX.eq("modelName",e)),this}},{key:"withModelVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter modelVersion must be a string");return this.fluentFilter.and(this._parent.EX.eq("modelVersion",e)),this}},{key:"withManufacturer",value:function(e){if("string"!=typeof e)throw new Error("Parameter manufacturerName must be a string");return this.fluentFilter.and(this._parent.EX.eq("manufacturerName",e)),this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,o.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [withId, withName, withVersion, withType, withHardwareId, withModel, withModelVersion, withManufacturer] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}}]),t}(a.default);r.default=l},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336,merge:112}],339:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./PreFilteredSearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,"/subscribers")),this._url="/entities"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildFilter",value:function(){var e={and:[{or:[]}]};if(!this._provisioned&&this._collected||e.and[0].or.push({exists:{"provision.device.communicationModules[].subscriber.identifier":!0}}),!this._collected&&this._provisioned||e.and[0].or.push({exists:{"device.communicationModules[].subscriber.identifier":!0}}),this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}}]),t}(a.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./PreFilteredSearchBuilder":331}],340:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./PreFilteredSearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,"/subscriptions")),this._url="/entities"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildFilter",value:function(){var e={and:[{or:[]}]};if(!this._provisioned&&this._collected||e.and[0].or.push({exists:{"provision.device.communicationModules[].subscription.identifier":!0}}),!this._collected&&this._provisioned||e.and[0].or.push({exists:{"device.communicationModules[].subscription.identifier":!0}}),this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}}]),t}(a.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./PreFilteredSearchBuilder":331}],341:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/tasks",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],342:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketPriority",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketPriority",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],343:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketSeverity",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketSeverity",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],344:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketStatus",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketStatus",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],345:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s="/tickets",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,s)),this._url=s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e,this}},{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],346:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../WPSearch")),u="timeseries";r.BASE_URL=u;var c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u,{organization:r,timeserie:n})),this._url=u+"/provision/organizations/"+r+"/"+n+"/data"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(a.default);r.default=c},{"../../util/searchingFields/FieldFinder":374,"../WPSearch":293,"./SearchBuilder":335}],347:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/timezones",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"timezones",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],348:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userLanguages",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userLanguages",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],349:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userProfile",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userProfile",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],350:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/users",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],351:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/workgroups",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],352:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ADMINISTRATIVE_STATE_ENUM=["NOT_ACTIVE","ACTIVE","REVOKED","EXPIRED"]},{}],353:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=e("./MIME_TYPES_ENUM"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"security/certificates","certificate","Certificate not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findById",value:function(e){return this._id=e,this._execute()}},{key:"_downloadUrl",value:function(){return this._setUrlParameters({format:this._type}),this._composeUrl()}},{key:"findByIdAndFormat",value:function(e,t){var r="";if(void 0===u.MIME_TYPES_ENUM.find((function(e){return e==this}),t)&&(r=t),""!==r)throw new Error("Parameter mimetype is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, mimetype allowed <'"+JSON.stringify(u.MIME_TYPES_ENUM)+"'>");return this._id=e,this._type=t,this._download()}},{key:"_download",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._downloadUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){204===t.statusCode?e.reject({data:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":159,"./MIME_TYPES_ENUM":355,"http-status-codes":76,q:120}],354:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_get=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _Security2=require("./Security"),_Security3=_interopRequireDefault(_Security2),_q=require("q"),_q2=_interopRequireDefault(_q),_ADMINISTRATIVE_STATE_ENUM=require("./ADMINISTRATIVE_STATE_ENUM"),_USAGES_ENUM=require("./USAGES_ENUM"),max_length_name=50,max_length_id=50,max_length_description=200,Certificates=function(_Security){function Certificates(e){_classCallCheck(this,Certificates),_get(Object.getPrototypeOf(Certificates.prototype),"constructor",this).call(this,e,"/certificates")}return _inherits(Certificates,_Security),_createClass(Certificates,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_id)throw new Error("Parameter id must be a string, cannot be empty and has a maximum length of "+max_length_id);return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_name)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of "+max_length_name);return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_description)throw new Error("Parameter description must be a string, cannot be empty and has a maximum length of "+max_length_description);return this._description=e,this}},{key:"withAdministrativeState",value:function(e){if("string"!=typeof e||e.length<=0)throw new Error("Parameter administrativeState must be typeof string and cannot be empty");var t="";if(void 0===_ADMINISTRATIVE_STATE_ENUM.ADMINISTRATIVE_STATE_ENUM.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error("Parameter in administrativeState is not allowed. Parameter value '"+JSON.stringify(t)+"', parameters allowed in administrativeState are: '"+JSON.stringify(_ADMINISTRATIVE_STATE_ENUM.ADMINISTRATIVE_STATE_ENUM)+"'");return this._administrativeState=e,this}},{key:"withUsages",value:function(e){if(void 0===e||e.constructor!==Array||0===e.length)throw new Error("Parameter usages must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++){void 0===_USAGES_ENUM.USAGES_ENUM.find((function(e){return e==this}),e[r])&&t.push(e[r])}if(0!==t.length)throw new Error("There are not any parameters allowed. Parameters value: '"+JSON.stringify(t)+"'. Usages parameters allowed are: '"+JSON.stringify(_USAGES_ENUM.USAGES_ENUM)+"'");return this._usages=e,this}},{key:"_checkHardware",value:function _checkHardware(hardware){"string"==typeof hardware&&(hardware=eval("("+hardware+")"));var length=Object.keys(hardware).length,valid=!1;return(1===length&&hardware.hardwareId&&"string"==typeof hardware.hardwareId&&hardware.hardwareId.length>0||3===length&&hardware.manufacturer&&hardware.model&&hardware.modelVersion&&"string"==typeof hardware.manufacturer&&"string"==typeof hardware.model&&"string"==typeof hardware.modelVersion&&hardware.manufacturer.length>0&&hardware.model.length>0&&hardware.modelVersion.length>0)&&(valid=!0),valid}},{key:"withTags",value:function(e){if(void 0===e||e.constructor!==Array||e.length<=0)throw new Error("Parameter tags must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++)(void 0===e[r]||"string"!=typeof e[r]||typeof e[r].length<=0)&&t.push(e[r]);if(0!==t.length)throw new Error("The following tags values are not allowed:"+JSON.stringify(t));return this._tags=e,this}},{key:"withParameters",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter parameters must be a string, cannot be empty");return this._parameters=e,this}},{key:"withDomains",value:function(e){if(void 0===e||e.constructor!==Array||e.length<=0)throw new Error("Parameter domains must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++)(void 0===e[r]||"string"!=typeof e[r]||typeof e[r].length<=0)&&t.push(e[r]);if(0!==t.length)throw new Error("The following domains values are not allowed:"+JSON.stringify(t));return this._domains=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._administrativeState||void 0===this._usages)throw new Error("Parameters name, usages, administrativeState must be defined");return{certificate:{id:this._id||void 0,name:this._name||void 0,description:this._description||void 0,administrativeState:this._administrativeState||void 0,usages:this._usages||void 0,hardware:this._hardware||void 0,tags:this._tags||void 0,parameters:this._parameters||void 0,domains:this._domains||void 0}}}},{key:"create",value:function(e){var t=this,r=void 0;if("string"!=typeof e){r=new FormData;var n=new Blob([JSON.stringify(this._composeElement())],{type:"application/json"});r.append("json",n);var i=new Blob([e],{type:"application/x-pem-file"});e&&r.append("certificate",i)}else(r={}).json=JSON.stringify(this._composeElement()),r.certificate=e;var a=_q2.default.defer(),o=a.promise;return this._ogapi.Napi.post_multipart(this._resource,r,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){var r=e.statusCode;201===r?("function"==typeof t._onCreated&&t._onCreated(e.header.location),a.resolve({location:e.header.location,statusCode:r})):a.reject({errors:e.errors,statusCode:r})})).catch((function(e){a.reject(e)})),o}},{key:"_onCreated",value:function(e){var t=e.split("/").pop(-1);this.withId(t)}},{key:"update",value:function(){var e=this._composeElement();delete e.certificate.id;var t=_q2.default.defer(),r=t.promise;return this._ogapi.Napi.put(this._buildURL(),e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){var r=e.body;void 0===r?t.reject("Cannot update the certificate"):t.resolve(r,e.statusCode)})).catch((function(e){t.reject(e)})),r}},{key:"_buildURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id}}]),Certificates}(_Security3.default);exports.default=Certificates,module.exports=exports.default},{"./ADMINISTRATIVE_STATE_ENUM":352,"./Security":356,"./USAGES_ENUM":357,q:120}],355:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MIME_TYPES_ENUM=["x-pem-file","pkcs7-mime","raw","text/plain"]},{}],356:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("../provision/BaseProvision"),a=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/security"+(void 0===r?"":r),n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"../provision/BaseProvision":261}],357:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.USAGES_ENUM=["FILE_VALIDATION","DEVICE_COMMUNICATIONS","DEVICE_ACCESS","CERT_SIGN"]},{}],358:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("../util/formats/check_types")),s="timeseries/provision/organizations/";r.URL=s;var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","timeBucket","identifierColumn"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){var e=s+this._organization+"/"+this._identifier;return this._onlyPlan&&(e+="?onlyPlan=true"),e}},{key:"withOrganization",value:function(e){return o.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return o.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return o.default._checkStringAndPattern(e,"^[a-zA-Z0-9_@.-]*$","name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return o.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withTimeBucket",value:function(e){return o.default._checkNumber(e,"timeBucket"),this._timeBucket=e,this}},{key:"withDescription",value:function(e){return e&&o.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return o.default._checkArray(e,"columns"),this._columns=e,this}},{key:"withBucketColumn",value:function(e){return o.default._checkStringAndPattern(e,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketColumn=e,this}},{key:"withBucketInitColumn",value:function(e){return o.default._checkStringAndPattern(e,"^[a-zA-Z0-9 _-]*$","bucketInitColumn"),this._bucketInitColumn=e,this}},{key:"withRetention",value:function(e){return o.default._checkNumber(e,"retention"),this._retention=e,this}},{key:"withOrigin",value:function(e){return o.default._checkISODateTime(e,"origin"),this._origin=e,this}},{key:"withContext",value:function(e){return o.default._checkArray(e,"context"),this._context=e,this}},{key:"_composeElement",value:function(){return this._resource=s+this._organization,this._timeBucket>0&&(o.default._checkStringAndPattern(this._bucketColumn,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketInitColumn&&o.default._checkStringAndPattern(this._bucketInitColumn,"^[a-zA-Z0-9 _-]*$","bucketInitColumn")),{name:this._name,description:this._description,timeBucket:this._timeBucket,bucketColumn:this._timeBucket?this._bucketColumn:void 0,bucketInitColumn:this._timeBucket?this._bucketInitColumn:void 0,retention:this._retention,origin:this._origin,context:this._context||[],identifierColumn:this._identifierColumn,columns:this._columns||[]}}},{key:"_composeUpdateElement",value:function(){return this._timeBucket>0&&(o.default._checkStringAndPattern(this._bucketColumn,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketInitColumn&&o.default._checkStringAndPattern(this._bucketInitColumn,"^[a-zA-Z0-9 _-]*$","bucketInitColumn")),{name:this._name,description:this._description,timeBucket:this._timeBucket,bucketColumn:this._timeBucket?this._bucketColumn:void 0,bucketInitColumn:this._timeBucket?this._bucketInitColumn:void 0,retention:this._retention,origin:this._origin,context:this._context||[],identifierColumn:this._identifierColumn,columns:this._columns||[]}}},{key:"onlyPlan",value:function(){return this._onlyPlan=!0,this}}]),t}(a.default);r.default=u},{"../provision/BaseProvision":261,"../util/formats/check_types":373}],359:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations","timeseries")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndTimeserieId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],360:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.VALUE_TYPES_ENUM=["integer","number","string","boolean","date-time"]},{}],361:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("q")),s=i(e("../util/formats/check_types")),u=e("./TYPES_ENUM"),c="timeseries/provision/organizations";r.URL=c;var l=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations"),r&&(this.withOrganization(r),n&&this.withIdentifier(n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){return s.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withOrganization",value:function(e){return s.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withName",value:function(e){return s.default._checkString(e,"name"),this._name=e,this}},{key:"withDescription",value:function(e){return s.default._checkString(e,"description"),this._description=e,this}},{key:"withScript",value:function(e){return s.default._checkString(e,"script"),this._script=e,this}},{key:"withValueTypes",value:function(e){return s.default._checkArray(e,"valueTypes"),e.forEach((function(e){s.default._checkType(e,u.VALUE_TYPES_ENUM)})),this._valueTypes=e,this}},{key:"withReturnType",value:function(e){return s.default._checkString(e,"returnType"),s.default._checkType(e,u.VALUE_TYPES_ENUM),this._returnType=e,this}},{key:"withMetadataFile",value:function(e){this._metadataFile=e}},{key:"_composeElement",value:function(e){this._checkRequiredParameters(e);var t={script:this._script};if(this._metadataFile)t.metadata=this._metadataFile;else{var r=new Blob([JSON.stringify({name:this._name,description:this._description,valueTypes:this._valueTypes||[],returnType:this._returnType||void 0})],{type:"application/json"});t.metadata=r}return t}},{key:"_checkRequiredParameters",value:function(e){if(e){if(!this._script||!(this._metadataFile||this._identifier&&this._organization&&this._name&&this._description))throw new Error("Parameters organization, identifier, name, description and script must be defined")}else if(!this._script||!(this._metadataFile||this._organization&&this._name&&this._description))throw new Error("Parameters organization, name, description and script must be defined")}},{key:"_buildURL",value:function(){return c+"/"+this._organization+"/catalog"+(this._identifier?"/"+this._identifier:"")}},{key:"create",value:function(){var e=o.default.defer();return this._ogapi.Napi.post_multipart(this._buildURL(),this._composeElement(),{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){switch(t.statusCode){case 200:var r=""!=t.text?JSON.parse(t.text):{},n=t.status;e.resolve({data:r,statusCode:n});break;case 201:n=t.status;var i=t.header&&t.header.location;e.resolve({location:i,statusCode:n});break;case 204:e.resolve(t);break;default:e.reject({errors:t.data.errors,statusCode:t.statusCode})}})).catch((function(t){e.reject(t)})),e.promise}},{key:"update",value:function(){var e=o.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),this._composeElement(!0),{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){switch(t.statusCode){case 200:var r=""!=t.text?JSON.parse(t.text):{},n=t.status;e.resolve({data:r,statusCode:n});break;case 204:e.resolve(t);break;default:e.reject({errors:t.data.errors,statusCode:t.statusCode})}})).catch((function(t){e.reject(t)})),e.promise}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization)throw new Error("Parameters organization and name must be defined");var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=l},{"../provision/BaseProvision":261,"../util/formats/check_types":373,"./TYPES_ENUM":360,q:120}],362:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations","TimeseriesFunctions","Timeseries function not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndName",value:function(e,t,r){var n=this;return n._organization=e,n._name=t,n._script=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/catalog"+(this._name?"/"+this._name:"")+(this._script?"/script":"")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],363:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=e("./TYPES_ENUM"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseriesFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getValueTypes",value:function(){return u.VALUE_TYPES_ENUM}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/internal",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/client",this._execute()}},{key:"_execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){204===t.statusCode?e.reject({error:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=c,t.exports=r.default},{"../GenericFinder":157,"./TYPES_ENUM":360,"http-status-codes":76,q:120}],364:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=(i(e("q")),i(e("http-status-codes")),function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Transformer not found","north")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"downloadByOrganizationAndIdentifierAndFilename",value:function(e,t,r){return this._organization=e,this._identifier=t,this._filename=r,this._download()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/transformers"+(this._identifier?"/"+this._identifier+(this._filename?"/"+this._filename:""):"")}}]),t}(a.default));r.default=o,t.exports=r.default},{"../GenericFinder":157,"http-status-codes":76,q:120}],365:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("q")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["organization","files"],"north/ai"),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return this._organization+"/transformers/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"addFile",value:function(e){this._files||(this._files=[]),this._files.push(e)}},{key:"withFiles",value:function(e){if(!(e instanceof Array))throw new Error({message:"Parameter files requires an array",parameter:"files"});this._files=e}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/transformers",{files:this._files||void 0}}},{key:"_composeUpdateElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.name,e}},{key:"performTest",value:function(e){var t=o.default.defer(),r=t.promise;return this._ogapi.Napi.post(this._buildURL()+"/transform",e,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){t.resolve({statusCode:e.statusCode,body:e.body})})).catch((function(e){t.reject(e)})),r}},{key:"create",value:function(){var e=this._composeElement(),t=o.default.defer();return this._ogapi.Napi.post_multipart(this._resource,{files:e.files},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;case 201:n=e.status;var i=e.header&&e.header.location;t.resolve({location:i,statusCode:n});break;case 204:t.resolve(e);break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}})).catch((function(e){t.reject(e)})),t.promise}},{key:"update",value:function(){var e=this._composeElement(),t=o.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),{files:e.files},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){if(200===e.statusCode){var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n})}else t.reject({errors:e.data.errors,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),t.promise}}]),t}(a(e("../provision/BaseProvision")).default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],366:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"users","user","User not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByEmail",value:function(e){return this._id=e,this._execute()}},{key:"findByEmailAndPassword",value:function(e,t){return this._id=e,this._setExtraHeaders({"X-ApiPass":t}),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],367:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("lodash")),s=e("uuid"),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/users",void 0,["email","workgroup","domain","profile","countryCode","langCode"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter name must be a string and has a maximum length of 100");return this._name=e,this}},{key:"withSurname",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter surname must be a string and has a maximum length of 100");return this._surname=e,this}},{key:"withEmail",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter email must be a string and has a maximum length of 100");return this._email=e,this}},{key:"withPassword",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("Parameter password must be a string and has a maximum length of 50");return this._password=e,this}},{key:"withApiKey",value:function(e){if(!this._validateUUID(e))throw new Error({message:"OGAPI_USER_UPDATE_APIKEY_PARAMETER_INVALID",parameter:"apiKey"});return this._apiKey=e,this}},{key:"withWorkgroup",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_WORKGROUP");return this._workgroup=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_DOMAIN");return this._domain=e,this}},{key:"withProfile",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_PROFILE");return this._profile=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_COUNTRY_CODE");return this._countryCode=e,this}},{key:"withLangCode",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_LANGUAGE");return this._langCode=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_DESCRIPTION");return this._description=e,this}},{key:"withTimezone",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_TIMEZONE");return this._timezone=e,this}},{key:"with2FaType",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter twoFaType must be a string and has a maximum length of 100");return this._twoFaType=e,this}},{key:"_buildURL",value:function(){if(void 0===this._email)throw new Error("OGAPI_EMAIL_MUST_BE_DEFINED");return this._resource+"/"+this._email}},{key:"_composeElement",value:function(){return{user:{name:this._name||void 0,surname:this._surname||void 0,password:this._password||void 0,description:this._description||void 0,email:this._email||void 0,workgroup:this._workgroup||void 0,domain:this._domain||void 0,profile:this._profile||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timezone||void 0,"2FaType":this._twoFaType||void 0}}}},{key:"_composeUpdateElement",value:function(){if(void 0===this._email)throw new Error("OGAPI_USER_UPDATE_PARAMETER_MUST_BE_DEFINED");return{user:{name:this._name||void 0,surname:this._surname||void 0,description:this._description||void 0,email:this._email||void 0,workgroup:this._workgroup||void 0,domain:this._domain||void 0,profile:this._profile||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timezone||void 0,apiKey:this._apiKey||void 0,password:this._password||void 0,"2FaType":this._twoFaType||void 0}}}},{key:"changePassword",value:function(e){if(this._newPassword=e,o.default.isEmpty(this._email)||o.default.isEmpty(this._password)||o.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_UPDATE_PASSWORD_PARAMETER_MUST_BE_DEFINED");var t={user:{password:this._newPassword}};return this._setExtraHeaders({"X-ApiPass":this._password}),this._doNorthPut(this._buildURL(),t)}},{key:"_validateUUID",value:function(e){return(0,s.validate)(e)&&4===(0,s.version)(e)}},{key:"changeApiKey",value:function(e){if(this._apiKey=e,o.default.isEmpty(this._email)||o.default.isEmpty(this._password)||o.default.isEmpty(this._apiKey))throw new Error("OGAPI_USER_UPDATE_APIKEY_PARAMETER_MUST_BE_DEFINED");if(!this._validateUUID(e))throw new Error({message:"OGAPI_USER_UPDATE_APIKEY_PARAMETER_INVALID",parameter:"apiKey"});var t={user:{apiKey:this._apiKey}};return this._setExtraHeaders({"X-ApiPass":this._password}),this._doNorthPut(this._buildURL(),t)}},{key:"requestResetPassword",value:function(){if(o.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");var e=this._buildURL()+"/reset";return this._doNorthPost(e)}},{key:"updatePassword",value:function(e,t){if(this._newPassword=e,this._tokenId=t,o.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(o.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_PASSWORD_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(o.default.isEmpty(t))throw new Error("OGAPI_USER_TOKENID_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");var r={password:this._newPassword},n=this._buildURL()+"/reset/"+t;return this._doNorthPost(n,r)}},{key:"login",value:function(e,t,r){if(this._email=e,this._password=t,this._twoFaCode=r,o.default.isEmpty(this._email)||o.default.isEmpty(this._password))throw new Error("OGAPI_USER_LOGIN_EMAIL_AND_PASSWORD_PARAMETER_MUST_BE_DEFINED");var n={email:this._email,password:this._password,"2FaCode":this._twoFaCode||void 0},i=this._resource+"/login";return this._doNorthPost(i,n,!0)}},{key:"generateApiKey",value:function(){return(0,s.v4)()}}]),t}(a.default);r.default=u,t.exports=r.default},{"../provision/BaseProvision":261,lodash:111,uuid:139}],368:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DATE_FORMAT="";r.TIME_FORMAT="HH:mm:ssZ"},{}],369:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,null,[{key:"eq",value:function(e,t){return{eq:i({},e,t)}}},{key:"neq",value:function(e,t){return{neq:i({},e,t)}}},{key:"like",value:function(e,t){return{like:i({},e,t)}}},{key:"gt",value:function(e,t){return{gt:i({},e,t)}}},{key:"lt",value:function(e,t){return{lt:i({},e,t)}}},{key:"gte",value:function(e,t){return{gte:i({},e,t)}}},{key:"lte",value:function(e,t){return{lte:i({},e,t)}}},{key:"in",value:function(e,t){return{in:i({},e,t)}}},{key:"or",value:function(){for(var e={or:[]},t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0;i<r.length;i++)e.or.push(r[i]);return e}},{key:"and",value:function(){for(var e={and:[]},t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0;i<r.length;i++)e.and.push(r[i]);return e}}]),e}();r.default=a,t.exports=r.default},{}],370:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("merge")),o=i(e("urlencode")),s=i(e("superagent")),u=i(e("q")),c=i(e("lodash")),l=i(e("mime-types")),p=(0,i(e("superagent-mocker")).default)(s.default),f=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._options=a.default.recursive(!0,this.default(),t),this._headers=r,c.default.isEmpty(t.mocks)||this._applyMocks(t.mocks)}return n(e,[{key:"_applyMocks",value:function(e){var t=this;Object.keys(e).filter((function(t){return!c.default.isEmpty(e[t])})).forEach((function(r){console.log("Mocking "+r.toLocaleUpperCase()+" requests"),Object.keys(e[r]).forEach((function(n){console.log("Mocking url:",n);var i=e[r][n];p[r](t._options.url+n,(function(t){if("function"==typeof i)return console.log("Function returned"),i(t);var a=e[r][n];return console.log("Data returned:",a),a.headers||(a.headers={}),a}))}))}))}},{key:"default",value:function(){return{timeout:5e3}}},{key:"_url",value:function(e){return e.url}},{key:"get",value:function(e,t,r,n,i,a){var o=this._createUrl(e,n,a);console.info("GET",o);var u=s.default.get(o);return this._createPromiseRequest(u,null,t,r,i)}},{key:"patch",value:function(e,t,r,n,i,a){var o=this._createUrl(e,i,a);console.info("PATCH",o);var u=s.default.patch(o).send(t);return this._createPromiseRequest(u,null,r,n)}},{key:"post",value:function(e,t,r,n,i,a){var o=this._createUrl(e,i,a);console.info("POST",o);var u=s.default.post(o).send(t);return this._createPromiseRequest(u,null,r,n)}},{key:"post_multipart",value:function(e,t,r,n,i,a,o){var u=this._createUrl(e,a,o);console.info("POST_MULTIPART",u);var c=s.default.post(u);return this._prepareMultipartForm(t,c),this._createPromiseRequest(c,r,n,i)}},{key:"put",value:function(e,t,r,n,i,a){var o=this._createUrl(e,i,a);console.info("PUT",o);var u=s.default.put(o).send(t);return n?n["Content-Type"]="application/json":n={"Content-Type":"application/json"},this._createPromiseRequest(u,null,r,n)}},{key:"put_multipart",value:function(e,t,r,n,i,a,o){var u=this._createUrl(e,a,o);console.info("PUT_MULTIPART",u);var c=s.default.put(u);return this._prepareMultipartForm(t,c),this._createPromiseRequest(c,r,n,i)}},{key:"_prepareMultipartForm",value:function(e,t){var r=!0;Object.keys(e).forEach((function(n){switch(n){case"meta":case"json":case"file":t.field(n,e[n]),delete e[n];break;case"metadata":t.attach(n,e[n]),r=!1;break;case"hardwareMedia":case"certificate":case"processorBulkFile":t.attach("file",e[n]),r=!1;break;case"files":e[n].forEach((function(e,r){if(e.path){var i=e.path.replace(/^.*[\\\/]/,""),a=l.default.lookup(i);a?t.attach(n,e,{filename:i,contentType:a}):i.endsWith(".py")?t.attach(n,e,{filename:i,contentType:"text/x-python"}):t.attach(n,e,{filename:i})}else t.attach(n,e)})),delete e[n],r=!1;break;case"script":case"modelFile":t.field(n,e[n]),delete e[n],r=!1;break;case"bulkFile":t.set("Content-Type",e.ext),e=e.bulkFile}})),r&&t.send(e)}},{key:"delete",value:function(e,t,r,n,i,a){var o,u=this._createUrl(e,n,a);return console.info("DELETE",u),o=i?s.default.del(u).send(i):s.default.del(u),this._createPromiseRequest(o,null,t,r)}},{key:"_createUrl",value:function(e,t,r){var n=[];if(t)for(var i=Object.keys(t),a=0;a<i.length;a++){var s=i[a],u=s+"="+t[s];e=0===a?e+"?"+u:e+"&"+u}var c=e.split("/"),l=c.length;return c.forEach((function(e,t){if(t===l-1&&e.indexOf("?")>0){var r=e.substring(e.indexOf("?"),e.length),i=e.substring(0,e.indexOf("?"));n.push((0,o.default)(i)+r)}else n.push((0,o.default)(e))})),this._url(this._options)+"/"+this._getDefaultBaseURL(r)+"/"+n.join("/")}},{key:"_getDefaultBaseURL",value:function(e){return e||(this._isSouth?"v80":"north/v80")}},{key:"_createPromiseRequest",value:function(e,t,r,n,i){var a=r;null==a&&(a=this._options.timeout);var o=u.default.defer(),s=o.promise,c=this._options.apiKey,l=this._options.jwt,p=-1===a?e:e.timeout(a);if(l&&!this._isSouth?p=p.set("Authorization","Bearer "+l):c&&(p=p.set("X-ApiKey",this._options.apiKey)),n)for(var f=Object.keys(n),d=0;d<f.length;d++){var h=f[d];void 0!==n[h]&&(p=p.set(h,n[h]))}if(t)for(var m in t)p=p.on(m,t[m]);return i&&e.responseType("blob"),p=p.end((function(e,t){if(null!==e){console.error("OGAPI ERROR: ");try{console.log(JSON.stringify(e))}catch(e){console.log(e)}var r=void 0,n=void 0,i=e.status?e.status:void 0,a={errors:[{code:i,message:"OGAPI: Something is broken. Please contact with your administrator."}]};void 0!==e.response?(r=e.response.body?e.response.body:a,n=e.response.headers,i=e.status):i?(r=e.message,i=408):(r=a,i=500),o.reject({statusCode:i,data:r,headers:n})}else o.resolve(t)})),s}}]),e}();r.default=f,t.exports=r.default},{lodash:111,merge:112,"mime-types":115,q:120,superagent:131,"superagent-mocker":129,urlencode:138}],371:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,null,[{key:"element",value:function(e,t){return{name:e,fields:t}}}]),e}();r.default=i,t.exports=r.default},{}],372:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./NorthAmpliaREST"),o=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._isSouth=!0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_url",value:function(e){return e.south.url}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"./NorthAmpliaREST":370}],373:[function(e,t,r){"use strict";t.exports={_checkType:function(e,t){var r=[];if(void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length)throw new Error({message:"OGAPI_NOT_ALLOWED_PARAMETER",parameter:JSON.stringify(r),allowed:JSON.stringify(t)});return e},_checkISODateTime:function(e,t){if("string"!=typeof e||new RegExp("(d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d:[0-5]d.d+([+-][0-2]d:[0-5]d|Z))|(d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d:[0-5]d([+-][0-2]d:[0-5]d|Z))|(d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d([+-][0-2]d:[0-5]d|Z))").test(e))throw new Error([{message:"OGAPI_ISO_DATE_TIME_PARAMETER",parameter:t},{message:"OGAPI_STRING_PATTERN",parameter:t}]);try{new Date(e)}catch(e){throw new Error([{message:"OGAPI_ISO_DATE_TIME_PARAMETER",parameter:t},{message:"OGAPI_STRING_PATTERN",parameter:t}])}},_checkStringAndPattern:function(e,t,r){if("string"!=typeof e||!new RegExp(t).test(e))throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:r},{message:"OGAPI_STRING_PATTERN",parameter:r,pattern:t}])},_checkStringAndLength:function(e,t,r){if("string"!=typeof e||e.length>t)throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:r},{message:"OGAPI_MAX_LENGTH",parameter:t}])},_checkString:function(e,t){if("string"!=typeof e)throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:t}])},_checkNumber:function(e,t){if("number"!=typeof e)throw new Error([{message:"OGAPI_NUMBER_PARAMETER",parameter:t}])},_checkArray:function(e,t){if(!Array.isArray(e)||0===e.length)throw new Error({message:"OGAPI_ARRAY_PARAMETER",parameter:t})},_checkObject:function(e,t){if("object"!=typeof e)throw new Error({message:"OGAPI_OBJECT_PARAMETER",parameter:t})}}},{}],374:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=a(e("q")),u=a(e("lodash")),c=e("./source-precompiled/Fields"),l=e("./IotFields"),p=c.GENERATED_FIELDS;for(var f in l.IOT_FIELDS)if(p[f])for(var d in l.IOT_FIELDS[f])p[f][d]=l.IOT_FIELDS[f][d];else p[f]=l.IOT_FIELDS[f];var h=new RegExp("^(.+)._current\\.?(.+)?$"),m=new RegExp("\\[[0-9]+\\]"),v=(new RegExp("value\\.?"),{"/jobs":"JOB","/tasks":"TASKS","/alarms":"ENTITY_ALARM","/operations":"ENTITY_OPERATION","/operations/history":"ENTITY_OPERATION_HISTORY","/certificates":"CERTIFICATE","/bundles":"UPDATE_BUNDLE_VERSION","/datapoints":"DATAPOINTS","/datastreams":"DATASTREAMS","/datamodels":"DATAMODELS","/dmmQRating":"DMMQRATING","/iotQRating":"IOTQRATING","/catalog/softwares":"SOFTWARE_VERSION","/catalog/hardwares":"MANUFACTURER","/catalog/operators":"OPERATORS","/domains":"DOMAIN","/users":"USER","/areas":"AREAS","/bulk/async":"LEGACY_BULK","provisionProcessors/bulk/search":"BULK","/devices":"SearchOnDatamodel","/subscriptions":"SearchOnDatamodel","/subscribers":"SearchOnDatamodel","/entities":"SearchOnDatamodel","entity-asset":"SearchOnDatamodel","/tickets":"SearchOnDatamodel","/channels":"SearchOnDatamodel",datasets:"SearchOnDataset",timeseries:"SearchOnTimeseries","/catalog/plans/organization":"PLANS","/catalog/plans/device":"PLANS"}),y={ENTITY_ALARM:"alarm",UPDATE_BUNDLE_VERSION:"bundle",DATAPOINTS:"datapoints",ENTITY_OPERATION:["operation","job"]},g=function(e){switch(e){case"entity-asset":return["entity.asset"];case"/tickets":return["ticket"];case"/channels":return["channel"];default:return}},_={subscriber:"DEVICE_PART_SUBSCRIBER",subscription:"DEVICE_PART_SUBSCRIPTION",communicationsModule:"DEVICE_PART_COMMSMODULE",device:"DEVICE_PART_DEVICE"},b={DEVICE_PART_SUBSCRIBER:"subscriber",DEVICE_PART_SUBSCRIPTION:"subscription",DEVICE_PART_COMMSMODULE:"communicationsModule",DEVICE_PART_DEVICE:"device"},w=["relColl","relProv"],E=["DEVICE_PART_SUBSCRIBER","DEVICE_PART_SUBSCRIPTION","DEVICE_PART_COMMSMODULE","DEVICE_PART_DEVICE"],x=["subscriber","subscription","communicationsModule","device"],O="simple",A="complex",S="search",P="dataset",D="timeserie",k=function(e){if(E.indexOf(v[e])>=0)return A;switch(v[e]){case"SearchOnDatamodel":return S;case"SearchOnDataset":return P;case"SearchOnTimeseries":return D;default:return O}},C=function(e,t){var r=s.default.defer(),n=t.selectedField,i=t.selectAll,a=t.extraData&&t.extraData.organization,o=e._ogapi.datamodelsSearchBuilder(),u={and:[]};return e._resourceTypes&&u.and.push({in:{"datamodels.allowedResourceTypes":e._resourceTypes}}),a&&u.and.push({eq:{"datamodels.organizationName":a}}),n&&u.and.push({eq:{"datamodels.categories.datastreams.identifier":n}}),u.and.length>0&&o.filter(u),o.build().execute().then((function(e){var t=[];200===e.statusCode&&(t=function(e){var t=!0;for(;t;){var r=e;if(t=!1,!(r.length>0&&r[0].constructor===Array))return r;e=r=r.reduce((function(e,t){return e.concat(t)})),t=!0}}(t=e.data.datamodels.map((function(e){return(e.categories||[]).map((function(e){return(e.datastreams||[]).map((function(e){return n||i?e:e.identifier}))}))})))),n?r.resolve(t.find((function(e){return n===e.identifier}))):r.resolve(t)})).catch((function(e){r.reject(e)})),r.promise},j=function(e,t,r,n){var i=r.selectedField,a=[],o=r.extraData.organization,s=r.extraData[t.entity];e._ogapi[t.api]()[t.method](o,s).then((function(t){if(200===t.statusCode){t.data.identifierColumn&&a.push({identifier:t.data.identifierColumn,name:t.data.identifierColumn,path:"provision.administration.identifier._current.value",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"string",schema:{type:"string"}}),t.data.bucketColumn&&a.push({identifier:t.data.bucketColumn,name:t.data.bucketColumn,path:"provision.administration.identifier._current.at",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"date-time",schema:{type:"string",format:"datetime"}}),t.data.bucketInitColumn&&a.push({identifier:t.data.bucketInitColumn,name:t.data.bucketInitColumn,path:"provision.administration.identifier._current.at",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"date-time",schema:{type:"string",format:"datetime"}});var o=u.default.concat(t.data.columns||[],t.data.context||[]);e._ogapi.basicTypesSearchBuilder().withPath("$").build().execute().then((function(t){t.data.definitions;if(r.selectAll=!0,i){o=o.filter((function(e){return i===(e.name||e.alias)}));var s=o[0].path.match(h)[1].replace(m,"[]");r.selectedField=s}C(e,r).then((function(e){o.forEach((function(t){"date-time"!==t.type?t.schema={type:t.type}:t.schema={type:"string",format:"datetime"},t.path.endsWith("._current.value")&&function(){var r=t.path.substring(0,t.path.indexOf("._current.value"));Array.isArray(e)&&e.find((function(e){return r===e.identifier}))}(),t.identifier=t.name||t.alias,t.indexed="NO"!==t.filter,t.notFilterable="NO"===t.filter,a.push(t)})),n.resolve(a)})).catch((function(e){console.error(e),n.reject(e)}))})).catch((function(e){console.error(e),n.reject(e)}))}})).catch((function(e){console.error(e),n.reject(e)}))},T=(o(n={},S,(function(e,t){C(this,e).then((function(e){t.resolve(e)})).catch((function(e){t.reject(e)}))})),o(n,O,(function(e,t){var r=e.context,n=e.primaryType,i=e.selectedField,a=[];if(r[n]instanceof Array)i?function(){var e=0,t=null,o=function(){var a=r[n][e];a.toLowerCase()===i.toLowerCase()||a.toLowerCase()===i.toLowerCase()+"name"?t=a:y[n]&&(y[n]instanceof Array?y[n].forEach((function(e){a.toLowerCase()!==e+i.toLowerCase()&&a.toLowerCase()!==e+"."+i.toLowerCase()&&a.toLowerCase()!==e+i.toLowerCase()+"name"&&a.toLowerCase()!==e+"."+i.toLowerCase()+"name"||t||(t=a)})):a.toLowerCase()!==y[n]+i.toLowerCase()&&a.toLowerCase()!==y[n]+"."+i.toLowerCase()&&a.toLowerCase()!==y[n]+i.toLowerCase()+"name"&&a.toLowerCase()!==y[n]+"."+i.toLowerCase()+"name"||(t=a))};for(e=0;null===t&&e<r[n].length;e++)o();t&&a.push(t)}():a=r[n].slice();else if(i)if(r[n][i])a.push(r[n][i]);else for(var o=Object.keys(r[n]),s=0;s<o.length;s++)r[n][o[s]].toLowerCase().indexOf(i.toLowerCase())>-1&&a.push(r[n][o[s]]);else for(o=Object.keys(r[n]),s=0;s<o.length;s++)a.push(r[n][o[s]]);t.resolve(a.slice())})),o(n,A,(function(e,t){var r=e.states,n=e.context,i=e.primaryType,a={1:function(e,t){return t[i].concat(x.filter(u,b[i]))},2:function(e,t){try{return c(e,s(e[0],t).concat(w))}catch(e){return[]}},3:function(e,t){var r=e[1];if(-1===w.indexOf(r))return[];try{return c(e,s(e[0],t))}catch(e){return[]}}},o=a[r.length];return void 0===o?t.resolve([]):t.resolve(o(r,n));function s(e,t){var r=void 0;if(!(s=_[e])||!(r=t[s]))throw new Error("Invalid primaryType: "+e);return r.slice()}function u(e){return e!=this}function c(e,t){var r=[];return t.forEach((function(t){var n=e.slice(0,-1);n.push(t),r.push(n.join("."))})),r}})),o(n,P,(function(e,t){j(this,{api:"newDatasetFinder",method:"findByOrganizationAndDatasetId",entity:"dataset"},e,t)})),o(n,D,(function(e,t){j(this,{api:"newTimeserieFinder",method:"findByOrganizationAndTimeserieId",entity:"timeserie"},e,t)})),n),F=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._url=r,this._type=k(r),this._extraData=n,this._type===S&&(this._resourceTypes=g(r))}return i(e,[{key:"find",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=s.default.defer(),r={states:e.split("."),context:p[v[this._url]],primaryType:v[this._url],extraData:this._extraData};return T[this._type].call(this,r,t),t.promise}},{key:"findAll",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=s.default.defer(),r={states:e.split("."),context:p[v[this._url]],primaryType:v[this._url],selectAll:!0,extraData:this._extraData};return T[this._type].call(this,r,t),t.promise}},{key:"findFieldPath",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=s.default.defer(),r={states:e,context:p[v[this._url]],primaryType:v[this._url],selectedField:e,extraData:this._extraData};return T[this._type].call(this,r,t),t.promise}}]),e}();r.default=F,t.exports=r.default},{"./IotFields":375,"./source-precompiled/Fields":376,lodash:111,q:120}],375:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.IOT_FIELDS={DATAPOINTS:{DATAPOINTS:["datapoints.organization","datapoints.channel","datapoints.datastreamId","datapoints.entityIdentifier","datapoints.subEntityIdentifier","datapoints.entityRelated","datapoints._current.feedId","datapoints._current.date","datapoints._current.at","datapoints._current.value","datapoints._current.tags","datapoints._current.scoring.performance","datapoints._current.scoring.qrating.min_required.value","datapoints._current.scoring.qrating.min_required.label","datapoints._current.scoring.qrating.min_desired.value","datapoints._current.scoring.qrating.min_desired.label","datapoints._current.scoring.qrating.ideal.value","datapoints._current.scoring.qrating.ideal.label","datapoints._current.scoring.qrating.max_desired.value","datapoints._current.scoring.qrating.max_desired.label","datapoints._current.scoring.qrating.max_allowed.value","datapoints._current.scoring.qrating.max_allowed.label","datapoints._current.scoring.qrating.max_score","datapoints._current.scoring.qrating.cumulative_period_divisor","datapoints._current.scoring.qrating.conversion_matrix","datapoints._current.scoring.qrating.version"]},DATAMODELS:{DATAMODELS:["datamodels.organizationName","datamodels.identifier","datamodels.name","datamodels.description","datamodels.version","datamodels.categories.name","datamodels.categories.identifier","datamodels.categories.datastreams.identifier","datamodels.categories.datastreams.name","datamodels.categories.datastreams.description","datamodels.categories.datastreams.hardwareIds","datamodels.categories.datastreams.unit","datamodels.categories.datastreams.unit.type","datamodels.categories.datastreams.unit.label","datamodels.categories.datastreams.unit.symbol","datamodels.categories.datastreams.period","datamodels.categories.datastreams.access","datamodels.categories.datastreams.schema","datamodels.categories.datastreams.storage","datamodels.categories.datastreams.storage.period","datamodels.categories.datastreams.storage.total","datamodels.categories.datastreams.tags","datamodels.categories.datastreams.views","datamodels.categories.datastreams.icon","datamodels.categories.datastreams.modifiable","datamodels.categories.datastreams.required","datamodels.categories.datastreams.qrating.min_required.value","datamodels.categories.datastreams.qrating.min_required.label","datamodels.categories.datastreams.qrating.min_desired.value","datamodels.categories.datastreams.qrating.min_desired.label","datamodels.categories.datastreams.qrating.ideal.value","datamodels.categories.datastreams.qrating.ideal.label","datamodels.categories.datastreams.qrating.max_desired.value","datamodels.categories.datastreams.qrating.max_desired.label","datamodels.categories.datastreams.qrating.max_allowed.value","datamodels.categories.datastreams.qrating.max_allowed.label","datamodels.categories.datastreams.qrating.max_score","datamodels.categories.datastreams.qrating.cumulative_period_divisor","datamodels.categories.datastreams.qrating.conversion_matrix","datamodels.categories.datastreams.qrating.version"]},DATASTREAMS:{DATASTREAMS:["datastreams.datastreamId","datastreams.name","datastreams.description","datastreams.unit.type","datastreams.unit.label","datastreams.unit.symbol","datastreams.period","datastreams._current.tags","datastreams._current.date","datastreams._current.value","datastreams.categoryId","datastreams.datamodelId","datastreams.access","datastreams.channel","datastreams.organization","datastreams.entityIdentifier","feeds.entityIdentifier","datastreams._id.subEntityIdentifier","datastreams._current.scoring.qrating.min_required.value","datastreams._current.scoring.qrating.min_required.label","datastreams._current.scoring.qrating.min_desired.value","datastreams._current.scoring.qrating.min_desired.label","datastreams._current.scoring.qrating.ideal.value","datastreams._current.scoring.qrating.ideal.label","datastreams._current.scoring.qrating.max_desired.value","datastreams._current.scoring.qrating.max_desired.label","datastreams._current.scoring.qrating.max_allowed.value","datastreams._current.scoring.qrating.max_allowed.label","datastreams._current.scoring.qrating.max_score","datastreams._current.scoring.qrating.cumulative_period_divisor","datastreams._current.scoring.qrating.max_score","datastreams._current.scoring.qrating.conversion_matrix","datastreams.version","feeds.identifier","datastreams._current.scoring.qrating.version","datastreams._current.scoring.scoringPerformance"]},DEVICE_PART_DEVICE:{IOT:["datastream.id","datastream.name","datastream.feed","datastream.device","datastream.description","datastream.unit.type","datastream.unit.label","datastream.unit.symbol","datastream.period","datastream.tags","datastream.updated","datastream.minValue","datastream.maxValue","datastream.currentValue","datastream.categoryName","datastream.profileId","datastream.profileName","datastream.profileDescription","datastream.profileVersion","datastream.qratingScoringQValue","datastream.qratingScoringQScore","datastream.qratingScoringQuality","datastream.qratingScoringPerformance","datastream.qratingMinRequiredValue","datastream.qratingMinRequiredLabel","datastream.qratingMinDesiredValue","datastream.qratingMinDesiredLabel","datastream.qratingIdealValue","datastream.qratingIdealLabel","datastream.qratingMaxDesiredValue","datastream.qratingMaxDesiredLabel","datastream.qratingMaxAllowedValue","datastream.qratingMaxAllowedLabel","datastream.qratingMaxScore","deviceId","feedId","deviceOrganization","profile.Name","profile.Description","profile.Version","profile.Score","profile.MaxScore","profile.Performance","profile.AvgPerformance","profile.Quality","category.Name","category.Score","category.MaxScore","category.Performance","category.AvgPerformance","category.Quality","device.Score","device.MaxScore","device.Performance","device.AvgPerformance","device.Quality","device.Channel","device.EntityType"]},USER:{USER:{email:"user.email",description:"user.description",workgroup:"workgroup.name",domain:"domain.name",profile:"profile.name",name:"user.name",surname:"user.surname",countryCode:"country.code",langCode:"language.code",timezone:"user.timezone"}},DOMAIN:{DOMAIN:["domain.name","domain.description"]},AREAS:{AREAS:{identifier:"areas.identifier",name:"areas.name",description:"areas.description",entities:"areas.entities",geometry:"areas.geometry",color:"areas.color",organization:"areas.organization"}},TASKS:{TASKS:["tasks.id","tasks.name","tasks.description","tasks.state","tasks.domain","tasks.workgroup","tasks.job.request.user"]},LEGACY_BULK:{LEGACY_BULK:{identifier:"bulks.identifier",organization:"bulks.organization",fileName:"bulks.request.fileName",userEmail:"bulks.request.userEmail",headerAccept:"bulks.request.header.accept",contentType:"bulks.request.header.contentType",headerCsvFormat:"bulks.request.header.csvFormat",paramsFlattened:"bulks.request.params.flattened",paramsAction:"bulks.request.params.action",paramsFull:"bulks.request.params.full",paramsType:"bulks.request.params.type",status:"bulks.status",startedDate:"bulks.startedDate",finishedDate:"bulks.finishedDate",processed:"bulks.summary.processed",successful:"bulks.summary.successful",error:"bulks.summary.error"}},BULK:{BULK:{identifier:"bulks.identifier",provisionProcessorId:"bulks.provisionProcessorId",organization:"bulks.organization",userEmail:"bulks.request.userEmail",fileName:"bulks.request.fileName",headerAccept:"bulks.request.header.accept",contentType:"bulks.request.header.contentType",status:"bulks.status",startedDate:"bulks.startedDate",finishedDate:"bulks.finishedDate",processed:"bulks.summary.processed",successful:"bulks.summary.successful",error:"bulks.summary.error"}},RULE:{RULE:{organizationId:"rule.organizationId",channelId:"rule.channelId",name:"rule.name",active:"rule.active"}},ENTITY_ALARM:{ENTITY_ALARM:{alarmId:"alarm.identifier",alarmSubEntityIdentifier:"alarm.subEntityIdentifier",entityId:"alarm.entityIdentifier",entityType:"alarm.resourceType",organizationName:"alarm.organization",channelName:"alarm.channel",alarmRuleName:"alarm.rule",alarmName:"alarm.name",alarmSeverity:"alarm.severity",alarmPriority:"alarm.priority",alarmDescription:"alarm.description",alarmStatus:"alarm.status",alarmOpenDate:"alarm.openingDate",alarmAttentionDate:"alarm.attentionDate",alarmAttentionUser:"alarm.attentionUser",alarmAttentionNote:"alarm.attentionNote",alarmClosureDate:"alarm.closureDate",alarmClosureUser:"alarm.closureUser",alarmClosureNote:"alarm.closureNote",alarmExtraInfo:"alarm.extra_info"}},GENERAL:{GENERAL:[]},EMPTY:{EMPTY:[]},OPERATORS:{OPERATORS:["operator.name"]},PLANS:{PLANS:["plan.identifier","plan.name","plan.flowRate.value","plan.flowRate.unit","plan.maxDeviceAmount","plan.maxStorageLifeTime.period","plan.maxStorageLifeTime.total","plan.defaultAssigned","plan.defaultProvision"]}}},{}],376:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.GENERATED_FIELDS={ENTITY_OPERATION_HISTORY:{ENTITY_OPERATION_HISTORY:["applicationEmail","entityId","resourceType","jobActivatedDate","jobId","jobUserNotes","operationAttemptCurrent","operationAttemptMax","operationDate","operationDetails","operationEndDate","operationId","operationInitDate","operationName","operationNotify","operationParameters","operationResult","operationStatus","operationSteps"]},ENTITY_OPERATION:{ENTITY_OPERATION:["applicationEmail","channelKey","channelName","domainKey","entityId","resourceType","entityUk","jobActivatedDate","jobEntityTotal","jobErrorCode","jobErrorDescription","jobFinishedCancelledByEngine","jobFinishedCancelledByExternal","jobFinishedCancelledByExternalTimeout","jobFinishedCancelledByTimeout","jobFinishedCancelledByUser","jobFinishedCancelledTotal","jobFinishedDate","jobFinishedError","jobFinishedOotError","jobFinishedOotSuccessful","jobFinishedOotTotal","jobFinishedSuccessful","jobFinishedTotal","jobId","jobInProgressPendingExecution","jobInProgressScheduled","jobInProgressStarted","jobInProgressTotal","jobInProgressWaitingForConnection","jobJson","jobStartedDate","jobState","jobStatus","jobTotal","jobUser","jobUserNotes","notDeletable","operationAttemptCurrent","operationAttemptMax","operationDate","operationDetails","operationEndDate","operationId","operationInitDate","operationJson","operationName","operationNotify","operationResult","operationScheduleTimestamp","operationStatus","operationStatusKey","operationStepDescription","operationStepName","operationStepResponse","operationStepResult","operationStepTimestamp","operationTimeoutTimestamp","operationUserNotes","organizationKey","organizationName","profileKey","provAdministrativeState","provAdministrativeStateKey","provDefaultFeed","serviceGroupName","tag","taskEmpty_null","taskId","taskKey","taskName","taskState","taskStatus","workgroupKey","workgroupName"]},MANUFACTURER:{MANUFACTURER:["manufacturerAddress","manufacturerDescription","manufacturerEmail","manufacturerFax","manufacturerIdentifier","manufacturerMediaFileName","manufacturerMediaHeight","manufacturerMediaIdentifier","manufacturerMediaName","manufacturerMediaSize","manufacturerMediaTypeName","manufacturerMediaWidth","manufacturerName","manufacturerNotes","manufacturerTelephone","manufacturerUrl","modelDescription","modelIdentifier","modelMediaFileName","modelMediaHeight","modelMediaIdentifier","modelMediaName","modelMediaSize","modelMediaTypeName","modelMediaWidth","modelName","modelNotes","modelUrl","modelVersion"]},MODEL:{MODEL:["modelDescription","modelIdentifier","modelName","modelNotes","modelUrl","modelVersion"]},JOB:{JOB:["jobActivatedDate","jobActivatedTime","jobCallback","jobEntityTotal","jobErrorCode","jobErrorDescription","jobFinishedCancelledByEngine","jobFinishedCancelledByExternal","jobFinishedCancelledByExternalTimeout","jobFinishedCancelledByTimeout","jobFinishedCancelledByUser","jobFinishedCancelledTotal","jobFinishedDate","jobFinishedError","jobFinishedOotError","jobFinishedOotSuccessful","jobFinishedOotTotal","jobFinishedSuccessful","jobFinishedTime","jobFinishedTotal","jobId","jobInProgressPendingExecution","jobInProgressScheduled","jobInProgressStarted","jobInProgressTotal","jobInProgressWaitingForConnection","jobJson","jobOperationName","jobScheduledTime","jobStartedDate","jobState","jobStatus","jobTotal","jobTrap","jobUser","jobUserNotes","jobVisible","operationId","operationName","operationResult","operationStatusKey","taskCoremessage","taskId","taskKey","taskName","taskNextExecution","taskState","taskStatus"]},SOFTWARE_VERSION:{SOFTWARE_VERSION:["manufacturerAddress","manufacturerDescription","manufacturerEmail","manufacturerFax","manufacturerIdentifier","manufacturerName","manufacturerNotes","manufacturerTelephone","manufacturerUrl","modelDescription","modelIdentifier","modelName","modelNotes","modelUrl","modelVersion","softwareId","softwareName","softwareType","softwareVersion"]},UPDATE_BUNDLE_VERSION:{UPDATE_BUNDLE_VERSION:["bundleActionDef","bundleActionOrder","bundleActionType","bundleActive","bundleConstrained","bundleCreationDate","bundleDeploymentElementDownloadUrl","bundleDeploymentElementId","bundleDeploymentElementName","bundleDeploymentElementOperation","bundleDeploymentElementOption","bundleDeploymentElementOrder","bundleDeploymentElementPath","bundleDeploymentElementSize","bundleDeploymentElementType","bundleDeploymentElementValidators","bundleDeploymentElementVersion","bundleDescription","bundleHardware","bundleId","bundleName","bundleUserNotes","bundleVersion","bundleWorkgroup","updateBundleDate","updateBundleManufacturer","updateBundleModel","updateBundleName","updateBundleVersion","updateBundleVersionUuid","updateDescription"]},CERTIFICATE:{CERTIFICATE:["certificateAdministrativeState","certificateDescription","certificateDomain","certificateId","certificateIssuer","certificateManufacturer","certificateModel","certificateModelIdentifier","certificateModelVersion","certificateName","certificatePublicKeyAlgorithm","certificatePublicKeyFormat","certificatePublicKeySize","certificateSerialNumber","certificateSubject","certificateTag","certificateTrustChain","certificateUsage","certificateValidFrom","certificateValidUntil","certificateVersion"]}}},{}],377:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._domain+"/workgroups/"+this._name}},{key:"findByDomainAndName",value:function(e,t){return this._domain=e,this._name=t,this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],378:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("./Workgroups")),s=i(e("../channels/Channels")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["workgroup","channels"]),this._ogapi=e,this._action="CREATE"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withWorkgroup",value:function(e){if(e.constructor.prototype!=o.default.prototype)throw new Error("Parameter workgroup must be a workgroup");return this._workgroup=e,this}},{key:"withChannel",value:function(e){if(e.constructor.prototype!=s.default.prototype)throw new Error("Parameter channel must be a channel");return this._channels||(this._channels=[]),this._channels.push({organization:e._organization,channel:e._name}),this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._workgroup._domainName+"/workgroups/"+this._workgroup._name+"/relations",{workgroupRelation:{channels:this._channels?this._channels:void 0}}}},{key:"_buildURL",value:function(){return"provision/domains/"+this._workgroup._domainName+"/workgroups/"+this._workgroup._name+"/relations"}},{key:"create",value:function(){var e=this._composeElement(),t=this._resource;return this._setUrlParameters({action:"CREATE"}),this._doNorthPost(t,e)}},{key:"delete",value:function(){this._setUrlParameters({action:"DELETE"});var e=this._buildURL();if(this._channels){var t=this._composeElement();return this._doNorthPost(e,t)}return this._doNorthPost(e,{workgroupRelation:{channels:[]}})}},{key:"update",value:function(){throw new Error("Workgroup relation update not allowed")}}]),t}(a.default);r.default=u,t.exports=r.default},{"../channels/Channels":180,"../provision/BaseProvision":261,"./Workgroups":380}],379:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup relation not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._domain+"/workgroups/"+this._name+"/relations"}},{key:"findByDomainAndName",value:function(e,t){return this._domain=e,this._name=t,this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],380:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["name","domainName"]),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withAdministrative",value:function(e){return this._administrative=e,this}},{key:"withDomainName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"domainName"});return this._domainName=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._domainName+"/workgroups",{workgroup:{name:this._name||void 0,description:this._description||void 0,administrative:this._administrative||!1}}}},{key:"_composeElementUpdate",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._domainName+"/workgroups",{workgroup:{description:this._description||void 0}}}},{key:"_buildURL",value:function(){return"provision/domains/"+this._domainName+"/workgroups/"+this._name}},{key:"update",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeElementUpdate(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(i(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}]},{},[1]);
62
- //# sourceMappingURL=opengate-api-bower-14.0.0.min.js.map
61
+ "use strict";var n=e("iconv-lite");function i(e){return!e||("utf8"===(e=e.toLowerCase())||"utf-8"===e)}function a(e,t){if(i(t))return encodeURIComponent(e);for(var r=n.encode(e,t),a="",o="",s=0;s<r.length;s++)1===(o=r[s].toString("16")).length&&(o="0"+o),a+="%"+o;return a=a.toUpperCase()}function o(e,t){if(i(t))return decodeURIComponent(e);for(var a=[],o=0;o<e.length;)"%"===e[o]?(o++,a.push(parseInt(e.substring(o,o+2),16)),o+=2):(a.push(e.charCodeAt(o)),o++);var s=new r(a);return n.decode(s,t)}function s(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return e=String(e),e=/^[\x00-\x7F]*$/.test(e)?encodeURIComponent(e):a(e,t)}var c=function(e,t,r){"string"!=typeof t&&(r=t||{},t=null);var n=r.charset||"utf-8";return Array.isArray(e)?function(e,t,r){var n=[];if(!t)throw new TypeError("stringify expects an object");for(var i=0;i<e.length;i++)n.push(c(e[i],t+"["+i+"]",r));return n.join("&")}(e,t,r):"[object Object]"==={}.toString.call(e)?function(e,t,r){for(var n,i=[],o=Object.keys(e),s=r.charset,l=0,p=o.length;l<p;++l)""!==(n=o[l])&&(null===e[n]?i.push(a(n,s)+"="):i.push(c(e[n],t?t+"["+u(n,s)+"]":u(n,s),r)));return i.join("&")}(e,t,r):"string"==typeof e?function(e,t,r){if(!t)throw new TypeError("stringify expects an object");var n=r.charset;return t+"="+u(e,n)}(e,t,r):t+"="+u(String(e),n)};t.exports=a,t.exports.encode=a,t.exports.decode=o,t.exports.parse=function(e,t,r,n){"object"==typeof t&&(n=t,t=null),t=t||"&",r=r||"=";var i={};if("string"!=typeof e||0===e.length)return i;var a=/\+/g;e=e.split(t);var u=1e3,c=null;n&&("number"==typeof n.maxKeys&&(u=n.maxKeys),"string"==typeof n.charset&&(c=n.charset));var l=e.length;u>0&&l>u&&(l=u);for(var p=0;p<l;++p){var f,d,h,m,v=e[p].replace(a,"%20"),y=v.indexOf(r);if(y>=0?(f=v.substr(0,y),d=v.substr(y+1)):(f=v,d=""),f&&f.indexOf("%")>=0)try{h=o(f,c)}catch(e){h=f}else h=f;if(d&&d.indexOf("%")>=0)try{m=o(d,c)}catch(e){m=d}else m=d;s(i,h)?Array.isArray(i[h])?i[h].push(m):i[h]=[i[h],m]:i[h]=m}return i},t.exports.stringify=c}).call(this,e("buffer").Buffer)},{buffer:52,"iconv-lite":96}],139:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return u.default}});var n=f(e("./v1.js")),i=f(e("./v3.js")),a=f(e("./v4.js")),o=f(e("./v5.js")),s=f(e("./nil.js")),u=f(e("./version.js")),c=f(e("./validate.js")),l=f(e("./stringify.js")),p=f(e("./parse.js"));function f(e){return e&&e.__esModule?e:{default:e}}},{"./nil.js":142,"./parse.js":143,"./stringify.js":147,"./v1.js":148,"./v3.js":149,"./v4.js":151,"./v5.js":152,"./validate.js":153,"./version.js":154}],140:[function(e,t,r){"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function i(e,t){const r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}function a(e,t,r,n,a,o){return i((s=i(i(t,e),i(n,o)))<<(u=a)|s>>>32-u,r);var s,u}function o(e,t,r,n,i,o,s){return a(t&r|~t&n,e,t,i,o,s)}function s(e,t,r,n,i,o,s){return a(t&n|r&~n,e,t,i,o,s)}function u(e,t,r,n,i,o,s){return a(t^r^n,e,t,i,o,s)}function c(e,t,r,n,i,o,s){return a(r^(t|~n),e,t,i,o,s)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var l=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let r=0;r<t.length;++r)e[r]=t.charCodeAt(r)}return function(e){const t=[],r=32*e.length,n="0123456789abcdef";for(let i=0;i<r;i+=8){const r=e[i>>5]>>>i%32&255,a=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);t.push(a)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let r=1732584193,a=-271733879,l=-1732584194,p=271733878;for(let t=0;t<e.length;t+=16){const n=r,f=a,d=l,h=p;r=o(r,a,l,p,e[t],7,-680876936),p=o(p,r,a,l,e[t+1],12,-389564586),l=o(l,p,r,a,e[t+2],17,606105819),a=o(a,l,p,r,e[t+3],22,-1044525330),r=o(r,a,l,p,e[t+4],7,-176418897),p=o(p,r,a,l,e[t+5],12,1200080426),l=o(l,p,r,a,e[t+6],17,-1473231341),a=o(a,l,p,r,e[t+7],22,-45705983),r=o(r,a,l,p,e[t+8],7,1770035416),p=o(p,r,a,l,e[t+9],12,-1958414417),l=o(l,p,r,a,e[t+10],17,-42063),a=o(a,l,p,r,e[t+11],22,-1990404162),r=o(r,a,l,p,e[t+12],7,1804603682),p=o(p,r,a,l,e[t+13],12,-40341101),l=o(l,p,r,a,e[t+14],17,-1502002290),a=o(a,l,p,r,e[t+15],22,1236535329),r=s(r,a,l,p,e[t+1],5,-165796510),p=s(p,r,a,l,e[t+6],9,-1069501632),l=s(l,p,r,a,e[t+11],14,643717713),a=s(a,l,p,r,e[t],20,-373897302),r=s(r,a,l,p,e[t+5],5,-701558691),p=s(p,r,a,l,e[t+10],9,38016083),l=s(l,p,r,a,e[t+15],14,-660478335),a=s(a,l,p,r,e[t+4],20,-405537848),r=s(r,a,l,p,e[t+9],5,568446438),p=s(p,r,a,l,e[t+14],9,-1019803690),l=s(l,p,r,a,e[t+3],14,-187363961),a=s(a,l,p,r,e[t+8],20,1163531501),r=s(r,a,l,p,e[t+13],5,-1444681467),p=s(p,r,a,l,e[t+2],9,-51403784),l=s(l,p,r,a,e[t+7],14,1735328473),a=s(a,l,p,r,e[t+12],20,-1926607734),r=u(r,a,l,p,e[t+5],4,-378558),p=u(p,r,a,l,e[t+8],11,-2022574463),l=u(l,p,r,a,e[t+11],16,1839030562),a=u(a,l,p,r,e[t+14],23,-35309556),r=u(r,a,l,p,e[t+1],4,-1530992060),p=u(p,r,a,l,e[t+4],11,1272893353),l=u(l,p,r,a,e[t+7],16,-155497632),a=u(a,l,p,r,e[t+10],23,-1094730640),r=u(r,a,l,p,e[t+13],4,681279174),p=u(p,r,a,l,e[t],11,-358537222),l=u(l,p,r,a,e[t+3],16,-722521979),a=u(a,l,p,r,e[t+6],23,76029189),r=u(r,a,l,p,e[t+9],4,-640364487),p=u(p,r,a,l,e[t+12],11,-421815835),l=u(l,p,r,a,e[t+15],16,530742520),a=u(a,l,p,r,e[t+2],23,-995338651),r=c(r,a,l,p,e[t],6,-198630844),p=c(p,r,a,l,e[t+7],10,1126891415),l=c(l,p,r,a,e[t+14],15,-1416354905),a=c(a,l,p,r,e[t+5],21,-57434055),r=c(r,a,l,p,e[t+12],6,1700485571),p=c(p,r,a,l,e[t+3],10,-1894986606),l=c(l,p,r,a,e[t+10],15,-1051523),a=c(a,l,p,r,e[t+1],21,-2054922799),r=c(r,a,l,p,e[t+8],6,1873313359),p=c(p,r,a,l,e[t+15],10,-30611744),l=c(l,p,r,a,e[t+6],15,-1560198380),a=c(a,l,p,r,e[t+13],21,1309151649),r=c(r,a,l,p,e[t+4],6,-145523070),p=c(p,r,a,l,e[t+11],10,-1120210379),l=c(l,p,r,a,e[t+2],15,718787259),a=c(a,l,p,r,e[t+9],21,-343485551),r=i(r,n),a=i(a,f),l=i(l,d),p=i(p,h)}return[r,a,l,p]}(function(e){if(0===e.length)return[];const t=8*e.length,r=new Uint32Array(n(t));for(let n=0;n<t;n+=8)r[n>>5]|=(255&e[n/8])<<n%32;return r}(e),8*e.length))};r.default=l},{}],141:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};r.default=n},{}],142:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default="00000000-0000-0000-0000-000000000000"},{}],143:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");let t;const 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};r.default=a},{"./validate.js":153}],144:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;r.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},{}],145:[function(e,t,r){"use strict";let n;Object.defineProperty(r,"__esModule",{value:!0}),r.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(i)};const i=new Uint8Array(16)},{}],146:[function(e,t,r){"use strict";function n(e,t,r,n){switch(e){case 0:return t&r^~t&n;case 1:case 3:return t^r^n;case 2:return t&r^t&n^r&n}}function i(e,t){return e<<t|e>>>32-t}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var a=function(e){const t=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const a=e.length/4+2,o=Math.ceil(a/16),s=new Array(o);for(let t=0;t<o;++t){const r=new Uint32Array(16);for(let n=0;n<16;++n)r[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];s[t]=r}s[o-1][14]=8*(e.length-1)/Math.pow(2,32),s[o-1][14]=Math.floor(s[o-1][14]),s[o-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<o;++e){const a=new Uint32Array(80);for(let t=0;t<16;++t)a[t]=s[e][t];for(let e=16;e<80;++e)a[e]=i(a[e-3]^a[e-8]^a[e-14]^a[e-16],1);let o=r[0],u=r[1],c=r[2],l=r[3],p=r[4];for(let e=0;e<80;++e){const r=Math.floor(e/20),s=i(o,5)+n(r,u,c,l)+p+t[r]+a[e]>>>0;p=l,l=c,c=i(u,30)>>>0,u=o,o=s}r[0]=r[0]+o>>>0,r[1]=r[1]+u>>>0,r[2]=r[2]+c>>>0,r[3]=r[3]+l>>>0,r[4]=r[4]+p>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]};r.default=a},{}],147:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0,r.unsafeStringify=o;var n,i=(n=e("./validate.js"))&&n.__esModule?n:{default:n};const a=[];for(let e=0;e<256;++e)a.push((e+256).toString(16).slice(1));function o(e,t=0){return a[e[t+0]]+a[e[t+1]]+a[e[t+2]]+a[e[t+3]]+"-"+a[e[t+4]]+a[e[t+5]]+"-"+a[e[t+6]]+a[e[t+7]]+"-"+a[e[t+8]]+a[e[t+9]]+"-"+a[e[t+10]]+a[e[t+11]]+a[e[t+12]]+a[e[t+13]]+a[e[t+14]]+a[e[t+15]]}var s=function(e,t=0){const r=o(e,t);if(!(0,i.default)(r))throw TypeError("Stringified UUID is invalid");return r};r.default=s},{"./validate.js":153}],148:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./rng.js"))&&n.__esModule?n:{default:n},a=e("./stringify.js");let o,s,u=0,c=0;var l=function(e,t,r){let n=t&&r||0;const l=t||new Array(16);let p=(e=e||{}).node||o,f=void 0!==e.clockseq?e.clockseq:s;if(null==p||null==f){const t=e.random||(e.rng||i.default)();null==p&&(p=o=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==f&&(f=s=16383&(t[6]<<8|t[7]))}let d=void 0!==e.msecs?e.msecs:Date.now(),h=void 0!==e.nsecs?e.nsecs:c+1;const m=d-u+(h-c)/1e4;if(m<0&&void 0===e.clockseq&&(f=f+1&16383),(m<0||d>u)&&void 0===e.nsecs&&(h=0),h>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=d,c=h,s=f,d+=122192928e5;const v=(1e4*(268435455&d)+h)%4294967296;l[n++]=v>>>24&255,l[n++]=v>>>16&255,l[n++]=v>>>8&255,l[n++]=255&v;const y=d/4294967296*1e4&268435455;l[n++]=y>>>8&255,l[n++]=255&y,l[n++]=y>>>24&15|16,l[n++]=y>>>16&255,l[n++]=f>>>8|128,l[n++]=255&f;for(let e=0;e<6;++e)l[n+e]=p[e];return t||(0,a.unsafeStringify)(l)};r.default=l},{"./rng.js":145,"./stringify.js":147}],149:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=a(e("./v35.js")),i=a(e("./md5.js"));function a(e){return e&&e.__esModule?e:{default:e}}var o=(0,n.default)("v3",48,i.default);r.default=o},{"./md5.js":140,"./v35.js":150}],150:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.URL=r.DNS=void 0,r.default=function(e,t,r){function n(e,n,o,s){var u;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t}(e)),"string"==typeof n&&(n=(0,a.default)(n)),16!==(null===(u=n)||void 0===u?void 0:u.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+e.length);if(c.set(n),c.set(e,n.length),c=r(c),c[6]=15&c[6]|t,c[8]=63&c[8]|128,o){s=s||0;for(let e=0;e<16;++e)o[s+e]=c[e];return o}return(0,i.unsafeStringify)(c)}try{n.name=e}catch(e){}return n.DNS=o,n.URL=s,n};var n,i=e("./stringify.js"),a=(n=e("./parse.js"))&&n.__esModule?n:{default:n};const o="6ba7b810-9dad-11d1-80b4-00c04fd430c8";r.DNS=o;const s="6ba7b811-9dad-11d1-80b4-00c04fd430c8";r.URL=s},{"./parse.js":143,"./stringify.js":147}],151:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(e("./native.js")),i=o(e("./rng.js")),a=e("./stringify.js");function o(e){return e&&e.__esModule?e:{default:e}}var s=function(e,t,r){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const o=(e=e||{}).random||(e.rng||i.default)();if(o[6]=15&o[6]|64,o[8]=63&o[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=o[e];return t}return(0,a.unsafeStringify)(o)};r.default=s},{"./native.js":141,"./rng.js":145,"./stringify.js":147}],152:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=a(e("./v35.js")),i=a(e("./sha1.js"));function a(e){return e&&e.__esModule?e:{default:e}}var o=(0,n.default)("v5",80,i.default);r.default=o},{"./sha1.js":146,"./v35.js":150}],153:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./regex.js"))&&n.__esModule?n:{default:n};var a=function(e){return"string"==typeof e&&i.default.test(e)};r.default=a},{"./regex.js":144}],154:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n,i=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var a=function(e){if(!(0,i.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};r.default=a},{"./validate.js":153}],155:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("q")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/ai",void 0,["organization","file"],"north/ai"),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return this._organization+"/models/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withFile",value:function(e){this._file=e}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/models",{modelFile:this._file||void 0}}},{key:"_composeUpdateElement",value:function(){return i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this)}},{key:"prediction",value:function(e){var t=o.default.defer(),r=t.promise;return this._ogapi.Napi.post(this._buildURL()+"/prediction",e,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){t.resolve({statusCode:e.statusCode,body:e.body})})).catch((function(e){t.reject(e)})),r}},{key:"create",value:function(){var e=this._composeElement(),t=o.default.defer();return this._ogapi.Napi.post_multipart(this._resource,{modelFile:e.modelFile},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;case 201:n=e.status;var i=e.header&&e.header.location;t.resolve({location:i,statusCode:n});break;case 204:t.resolve(e);break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}})).catch((function(e){t.reject(e)})),t.promise}},{key:"update",value:function(){var e=this._composeElement(),t=o.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),{modelFile:e.modelFile},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){if(200===e.statusCode){var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n})}else t.reject({errors:e.data.errors,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),t.promise}}]),t}(a(e("../provision/BaseProvision")).default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],156:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","AIModel not found","north")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"downloadByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._filename=!0,this._download()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/models"+(this._identifier?"/"+this._identifier+(this._filename?"/file":""):"")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],157:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=i(e("http-status-codes")),s=function(){function e(t,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._api=t.Napi,this._apiSouth=t.Sapi,this._baseUrl=r,this._entity=n,this._error_not_found=i,this._id=void 0,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=a}return n(e,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._id}},{key:"_withId",value:function(e){return this._id=e,this}},{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"_execute",value:function(e){this._api;e&&this._apiSouth;var t=a.default.defer(),r=t.promise,n=this._entity,i=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!1,this._getServiceBaseURL()).then((function(e){if(204===e.statusCode)t.reject({error:i,statusCode:o.default.NOT_FOUND});else if(e.body){var r=e.body[n]&&e.body.provision?e.body:e.body[n];t.resolve({data:r||e.body,statusCode:e.statusCode})}else t.resolve({data:e.text,statusCode:e.statusCode})})).catch((function(e){400===e.statusCode&&(e.statusCode=o.default.NOT_FOUND),t.reject(e)})),r}},{key:"_downloadUrl",value:function(){return this._composeUrl()}},{key:"_download",value:function(e){var t=a.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(this._downloadUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!e,this._getServiceBaseURL()).then((function(e){204===e.statusCode?t.reject({data:n,statusCode:o.default.NOT_FOUND}):t.resolve({data:e,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}();r.default=s,t.exports=r.default},{"http-status-codes":76,q:120}],158:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a,o,s=e("./operations/Operations"),u=i(s),c=e("./users/UserFinder"),l=i(c),p=e("./geocluster/GeoclusterFinder"),f=i(p),d=e("./geocluster/Geocluster"),h=i(d),m=e("./security/Certificates"),v=i(m),y=e("./users/Users"),g=i(y),_=e("./organizations/OrganizationFinder"),b=i(_),w=e("./channels/ChannelFinder"),E=i(w),x=e("./searching/builder/AreasSearchBuilder"),O=i(x),A=e("./searching/builder/DatasetsCatalogSearchBuilder"),S=i(A),P=e("./areas/AreaFinder"),D=i(P),k=e("./searching/builder/BulkSearchBuilder"),C=i(k),j=e("./searching/builder/BulkExecutionSearchBuilder"),T=i(j),F=e("./bulk/BulkFinder"),M=i(F),R=e("./bulk/BulkExecutionFinder"),B=i(R),I=e("./channels/Channels"),N=i(I),U=e("./areas/Areas"),L=i(U),z=e("./datasets/Datasets"),G=i(z),q=e("./timeseries/Timeseries"),V=i(q),H=e("./searching/builder/ChannelsSearchBuilder"),W=i(H),Y=e("./rulesConfiguration/RuleConfigurations"),$=i(Y),K=e("./rulesConfiguration/RuleConfigurationsFinder"),J=i(K),Q=e("./rulesConfiguration/RuleConfigurationsCatalog"),X=i(Q),Z=e("./rulesConfiguration/RuleConfigurationsHelper"),ee=i(Z),te=e("./datasets/DatasetFinder"),re=i(te),ne=e("./timeseries/TimeseriesFinder"),ie=i(ne),ae=e("./timeseriesFunctionsCatalog/TimeseriesFunctionFinder"),oe=i(ae),se=e("./timeseriesFunctionsCatalog/TimeseriesFunction"),ue=i(se),ce=e("./timeseriesFunctionsCatalog/TimeseriesFunctionsHelper"),le=i(ce),pe=e("./operationTypes/OperationType"),fe=i(pe),de=e("./operationTypes/OperationTypeFinder"),he=i(de),me=e("./operationTypes/OperationTypeCatalog"),ve=i(me),ye=e("./security/CertificateFinder"),ge=i(ye),_e=e("./operations/OperationFinder"),be=i(_e),we=e("./searching/FilterBuilder"),Ee=i(we),xe=e("./searching/SelectBuilder"),Oe=i(xe),Ae=e("./operations/OperationActions"),Se=i(Ae),Pe=e("./operations/PeriodicityActions"),De=i(Pe),ke=e("./util/Expression"),Ce=i(ke),je=e("./util/SelectElement"),Te=i(je),Fe=e("./searching/builder/RawSearchBuilder"),Me=i(Fe),Re=e("./searching/builder/DevicesSearchBuilder"),Be=i(Re),Ie=e("./searching/builder/SubscribersSearchBuilder"),Ne=i(Ie),Ue=e("./searching/builder/SubscriptionsSearchBuilder"),Le=i(Ue),ze=e("./searching/builder/AssetsSearchBuilder"),Ge=i(ze),qe=e("./searching/builder/TicketsSearchBuilder"),Ve=i(qe),He=e("./searching/builder/TasksSearchBuilder"),We=i(He),Ye=e("./searching/builder/OperationsSearchBuilder"),$e=i(Ye),Ke=e("./searching/builder/ExecutionsSearchBuilder"),Je=i(Ke),Qe=i(e("./searching/builder/ExecutionsHistorySearchBuilder")),Xe=i(e("./searching/builder/AlarmsSearchBuilder")),Ze=i(e("./searching/builder/DatamodelsSearchBuilder")),et=i(e("./searching/builder/FeedsSearchBuilder")),tt=i(e("./searching/builder/DatastreamsSearchBuilder")),rt=i(e("./searching/builder/DatapointsSearchBuilder")),nt=i(e("./searching/builder/BundlesSearchBuilder")),it=i(e("./searching/builder/CertificatesSearchBuilder")),at=i(e("./searching/builder/HardwaresSearchBuilder")),ot=i(e("./searching/builder/SoftwaresSearchBuilder")),st=i(e("./searching/builder/OperationalStatusSearchBuilder")),ut=i(e("./searching/builder/ServiceGroupSearchBuilder")),ct=i(e("./searching/builder/AdministrativeStateSearchBuilder")),lt=i(e("./searching/builder/CommunicationsModuleTypeSearchBuilder")),pt=i(e("./searching/builder/FieldsDefinitionSearchBuilder")),ft=i(e("./searching/builder/BasicTypesSearchBuilder")),dt=i(e("./searching/builder/MobilePhoneProviderSearchBuilder")),ht=i(e("./searching/builder/IoTDatastreamPeriodSearchBuilder")),mt=i(e("./searching/builder/ResourceTypeSearchBuilder")),vt=i(e("./searching/builder/AllowedResourceTypeSearchBuilder")),yt=i(e("./searching/builder/IoTDatastreamAccessSearchBuilder")),gt=i(e("./searching/builder/IoTDatastreamStoragePeriodSearchBuilder")),_t=i(e("./searching/builder/TicketSeveritySearchBuilder")),bt=i(e("./searching/builder/TicketPrioritySearchBuilder")),wt=i(e("./searching/builder/TicketStatusSearchBuilder")),Et=i(e("./searching/builder/RulesSearchBuilder")),xt=i(e("./searching/builder/OperationTypesSearchBuilder")),Ot=i(e("./searching/builder/UsersSearchBuilder")),At=i(e("./searching/builder/DomainsSearchBuilder")),St=i(e("./searching/builder/PlansSearchBuilder")),Pt=i(e("./searching/builder/DevicesPlansSearchBuilder")),Dt=i(e("./bundles/Bundles")),kt=i(e("./bundles/BundleFinder")),Ct=i(e("./organizations/Organizations")),jt=i(e("./domains/Domains")),Tt=i(e("./domains/DomainsFinder")),Ft=i(e("./entities/DeviceFinder")),Mt=i(e("./entities/TicketFinder")),Rt=i(e("./entities/SubscriptionsFinder")),Bt=i(e("./entities/SubscribersFinder")),It=i(e("./collection/devices/DeviceMessage")),Nt=i(e("./collection/devices/collect/Datastreams")),Ut=i(e("./collection/devices/collect/Datapoint")),Lt=i(e("./collection/devices/collect/Hardware")),zt=i(e("./collection/devices/collect/Software")),Gt=i(e("./collection/devices/collect/Storage")),qt=i(e("./collection/devices/collect/Usage")),Vt=i(e("./collection/devices/collect/PowerSupply")),Ht=i(e("./collection/devices/collect/CommsModuleMessage")),Wt=i(e("./collection/devices/collect/Mobile")),Yt=i(e("./collection/devices/collect/Subscriber")),$t=i(e("./collection/devices/collect/Subscription")),Kt=i(e("./workgroups/WorkgroupRelations")),Jt=i(e("./workgroups/Workgroups")),Qt=i(e("./workgroups/WorkgroupFinder")),Xt=i(e("./searching/builder/WorkgroupsSearchBuilder")),Zt=i(e("./workgroups/WorkgroupRelationsFinder")),er=i(e("./searching/builder/UserProfilesSearchBuilder")),tr=i(e("./iot/datamodels/Datamodels")),rr=i(e("./iot/datamodels/DatamodelsHelper")),nr=i(e("./iot/datamodels/DatamodelsFinder")),ir=i(e("./iot/catalog/Datastream")),ar=i(e("./iot/catalog/Qrating")),or=i(e("./provision/entities/EntityBuilder")),sr=i(e("./provision/bulk/BulkExecutionBuilder")),ur=i(e("./searching/builder/EntitiesSearchBuilder")),cr=i(e("./searching/builder/DatasetEntitiesSearchBuilder")),lr=i(e("./searching/builder/DatasetSearchBuilder")),pr=i(e("./searching/builder/TimeserieSearchBuilder")),fr=i(e("./searching/builder/CountryCodesSearchBuilder")),dr=i(e("./searching/builder/TimezoneSearchBuilder")),hr=i(e("./searching/builder/UserLanguagesSearchBuilder")),mr=i(e("./provisionProcessors/provisionProcessors")),vr=i(e("./provisionProcessors/provisionProcessorsFinder")),yr=i(e("./entities/EntityFinder")),gr=i(e("./alarms/AlarmActions")),_r=i(e("superagent")),br=i(e("./connectorsFunctions/configuration/ConnectorFunctionsHelper")),wr=i(e("./connectorsFunctions/configuration/ConnectorFunctionsFinder")),Er=i(e("./connectorsFunctions/configuration/ConnectorFunctions")),xr=i(e("./connectorsFunctions/catalog/ConnectorFunctions")),Or=i(e("./connectorsFunctions/catalog/ConnectorFunctionsCatalogFinder")),Ar=i(e("./connectorsFunctions/catalog/ConnectorFunctionsCatalog")),Sr=i(e("./pipelines/PipelineFinder")),Pr=i(e("./transformers/TransformerFinder")),Dr=i(e("./AIModels/AIModelsFinder")),kr=i(e("./transformers/Transformers")),Cr=i(e("./AIModels/AIModels")),jr=i(e("./pipelines/Pipelines")),Tr=i(e("./manufacturers/Manufacturer")),Fr=i(e("./manufacturers/Model")),Mr=i(e("./manufacturers/ManufacturerFinder")),Rr=i(e("./manufacturers/ModelFinder")),Br=i(e("./organization_manufacturer/Manufacturer")),Ir=i(e("./organization_manufacturer/Model")),Nr=i(e("./organization_manufacturer/ManufacturerFinder")),Ur=i(e("./organization_manufacturer/ModelFinder")),Lr=i(e("./provision/country/CountriesCatalog")),zr=(a=void 0,o=_r.default.Request.prototype.end,_r.default.Request.prototype.end=function(e){return a&&a.call&&a(this),o.call(this,(function(t,r){"function"==typeof e&&e(t,r)}))},function(e){a=e}),Gr=function(){function e(t,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("object"!=typeof t)throw new Error("Must instance mandatory parameter: northAmpliaREST");if("object"!=typeof r)throw new Error("Must instance mandatory parameter: southAmpliaREST");n.hooks&&n.hooks.beforeStart&&"function"==typeof n.hooks.beforeStart&&zr(n.hooks.beforeStart),this.Napi=t,this.Sapi=r,this.EX=Ce.default,this.SE=Te.default,this.operations=new u.default(this),this.alarms=new gr.default(this),this.entityBuilder=new or.default(this)}return n(e,[{key:"newUserFinder",value:function(){return new l.default(this)}},{key:"newGeoclusterFinder",value:function(){return new f.default(this)}},{key:"geoclusterBuilder",value:function(){return new h.default(this)}},{key:"newOrganizationFinder",value:function(){return new b.default(this)}},{key:"newChannelFinder",value:function(){return new E.default(this)}},{key:"areasSearchBuilder",value:function(){return new O.default(this)}},{key:"datasetsCatalogSearchBuilder",value:function(){return new S.default(this)}},{key:"bulkSearchBuilder",value:function(){return new C.default(this)}},{key:"bulkExecutionSearchBuilder",value:function(){return new T.default(this)}},{key:"newBulkFinder",value:function(){return new M.default(this)}},{key:"newBulkExecutionFinder",value:function(){return new B.default(this)}},{key:"newAreaFinder",value:function(){return new D.default(this)}},{key:"newOperationFinder",value:function(){return new be.default(this)}},{key:"newOperationTypeFinder",value:function(){return new he.default(this)}},{key:"newOperationTypeCatalog",value:function(){return new ve.default(this)}},{key:"newCountriesCatalog",value:function(){return new Lr.default(this)}},{key:"operationTypeBuilder",value:function(e,t,r){return new fe.default(this,e,t,r)}},{key:"newRuleConfigurationsFinder",value:function(){return new J.default(this)}},{key:"newRuleConfigurationsHelper",value:function(){return new ee.default(this)}},{key:"newDatasetFinder",value:function(){return new re.default(this)}},{key:"newTimeserieFinder",value:function(){return new ie.default(this)}},{key:"newRuleConfigurationsCatalog",value:function(){return new X.default(this)}},{key:"ruleConfigurationBuilder",value:function(e,t,r,n){return new $.default(this,e,t,r,n)}},{key:"newCertificateFinder",value:function(){return new ge.default(this)}},{key:"newDeviceFinder",value:function(){return new Ft.default(this)}},{key:"newTicketFinder",value:function(){return new Mt.default(this)}},{key:"newSubscriptionsFinder",value:function(){return new Rt.default(this)}},{key:"newSubscribersFinder",value:function(){return new Bt.default(this)}},{key:"newEntityFinder",value:function(){return new yr.default(this)}},{key:"newFilterBuilder",value:function(){return new Ee.default}},{key:"newSelectBuilder",value:function(){return new Oe.default}},{key:"rawSearchBuilder",value:function(){return new Me.default(this)}},{key:"usersSearchBuilder",value:function(){return new Ot.default(this)}},{key:"domainsSearchBuilder",value:function(){return new At.default(this)}},{key:"devicesSearchBuilder",value:function(){return new Be.default(this)}},{key:"assetsSearchBuilder",value:function(){return new Ge.default(this)}},{key:"subscribersSearchBuilder",value:function(){return new Ne.default(this)}},{key:"subscriptionsSearchBuilder",value:function(){return new Le.default(this)}},{key:"ticketsSearchBuilder",value:function(){return new Ve.default(this)}},{key:"communicationsModuleTypeSearchBuilder",value:function(){return new lt.default(this)}},{key:"fieldsDefinitionSearchBuilder",value:function(){return new pt.default(this)}},{key:"mobilePhoneProviderSearchBuilder",value:function(){return new dt.default(this)}},{key:"ioTDatastreamPeriodSearchBuilder",value:function(){return new ht.default(this)}},{key:"resourceTypeSearchBuilder",value:function(){return new mt.default(this)}},{key:"allowedResourceTypeSearchBuilder",value:function(){return new vt.default(this)}},{key:"ioTDatastreamAccessSearchBuilder",value:function(){return new yt.default(this)}},{key:"ioTDatastreamStoragePeriodSearchBuilder",value:function(){return new gt.default(this)}},{key:"ticketSeveritySearchBuilder",value:function(){return new _t.default(this)}},{key:"ticketPrioritySearchBuilder",value:function(){return new bt.default(this)}},{key:"ticketStatusSearchBuilder",value:function(){return new wt.default(this)}},{key:"rulesSearchBuilder",value:function(){return new Et.default(this)}},{key:"operationTypesSearchBuilder",value:function(){return new xt.default(this)}},{key:"tasksSearchBuilder",value:function(){return new We.default(this)}},{key:"operationsSearchBuilder",value:function(){return new $e.default(this)}},{key:"executionsSearchBuilder",value:function(){return new Je.default(this)}},{key:"executionsHistorySearchBuilder",value:function(){return new Qe.default(this)}},{key:"alarmsSearchBuilder",value:function(){return new Xe.default(this)}},{key:"datastreamsSearchBuilder",value:function(){return new tt.default(this)}},{key:"datamodelsSearchBuilder",value:function(){return new Ze.default(this)}},{key:"feedsSearchBuilder",value:function(){return new et.default(this)}},{key:"datapointsSearchBuilder",value:function(){return new rt.default(this)}},{key:"bundlesSearchBuilder",value:function(){return new nt.default(this)}},{key:"certificatesSearchBuilder",value:function(){return new it.default(this)}},{key:"basicTypesSearchBuilder",value:function(){return new ft.default(this)}},{key:"entitiesSearchBuilder",value:function(){return new ur.default(this)}},{key:"datasetEntitiesSearchBuilder",value:function(e,t){return new cr.default(this,e,t)}},{key:"datasetSearchBuilder",value:function(e,t){return new lr.default(this,e,t)}},{key:"timeserieSearchBuilder",value:function(e,t){return new pr.default(this,e,t)}},{key:"plansSearchBuilder",value:function(){return new St.default(this)}},{key:"devicesPlansSearchBuilder",value:function(){return new Pt.default(this)}},{key:"bundlesBuilder",value:function(){return new Dt.default(this)}},{key:"newBundleFinder",value:function(){return new kt.default(this)}},{key:"organizationsBuilder",value:function(){return new Ct.default(this)}},{key:"domainsBuilder",value:function(){return new jt.default(this)}},{key:"newDomainFinder",value:function(){return new Tt.default(this)}},{key:"usersBuilder",value:function(){return new g.default(this)}},{key:"certificatesBuilder",value:function(){return new v.default(this)}},{key:"hardwaresSearchBuilder",value:function(){return new at.default(this)}},{key:"softwaresSearchBuilder",value:function(){return new ot.default(this)}},{key:"operationalStatusSearchBuilder",value:function(){return new st.default(this)}},{key:"serviceGroupSearchBuilder",value:function(){return new ut.default(this)}},{key:"administrativeStateSearchBuilder",value:function(){return new ct.default(this)}},{key:"deviceMessageBuilder",value:function(){return new It.default(this)}},{key:"datastreamBuilder",value:function(){return new Nt.default(this)}},{key:"datapointsBuilder",value:function(){return new Ut.default(this)}},{key:"hardwareMessageBuilder",value:function(){return new Lt.default(this)}},{key:"softwareMessageBuilder",value:function(){return new zt.default(this)}},{key:"storageMessageBuilder",value:function(){return new Gt.default(this)}},{key:"usageMessageBuilder",value:function(){return new qt.default(this)}},{key:"powerSupplyMessageBuilder",value:function(){return new Vt.default(this)}},{key:"commsModuleMessageMessageBuilder",value:function(){return new Ht.default(this)}},{key:"subscriberMessageBuilder",value:function(){return new Yt.default(this)}},{key:"subscriptionMessageBuilder",value:function(){return new $t.default(this)}},{key:"mobileMessageMessageBuilder",value:function(){return new Wt.default(this)}},{key:"newOperationActions",value:function(e){return new Se.default(this,e)}},{key:"newPeriodicityActions",value:function(e){return new De.default(this,e)}},{key:"workgroupRelationsBuilder",value:function(){return new Kt.default(this)}},{key:"newWorkgroupRelationsFinder",value:function(){return new Zt.default(this)}},{key:"workgroupsBuilder",value:function(){return new Jt.default(this)}},{key:"newWorkgroupFinder",value:function(){return new Qt.default(this)}},{key:"workgroupsSearchBuilder",value:function(){return new Xt.default(this)}},{key:"channelsBuilder",value:function(){return new N.default(this)}},{key:"areasBuilder",value:function(){return new L.default(this)}},{key:"datasetsBuilder",value:function(){return new G.default(this)}},{key:"timeseriesBuilder",value:function(){return new V.default(this)}},{key:"newTimeseriesFunctionFinder",value:function(){return new oe.default(this)}},{key:"timeseriesFunctionBuilder",value:function(e,t){return new ue.default(this,e,t)}},{key:"newTimeseriesFunctionsHelper",value:function(){return new le.default(this)}},{key:"channelsSearchBuilder",value:function(){return new W.default(this)}},{key:"userProfilesSearchBuilder",value:function(){return new er.default(this)}},{key:"datamodelsBuilder",value:function(e){return new tr.default(this,e)}},{key:"datamodelsHelper",value:function(e,t){return new rr.default(this,e,t)}},{key:"newDatamodelsFinder",value:function(){return new nr.default(this)}},{key:"datastreamsBuilder",value:function(){return new ir.default(this)}},{key:"bulkExecutionBuilder",value:function(e,t,r){return new sr.default(this,e,t,r)}},{key:"qratingsBuilder",value:function(){return new ar.default(this)}},{key:"countryCodesSearchBuilder",value:function(){return new fr.default(this)}},{key:"timezoneSearchBuilder",value:function(){return new dr.default(this)}},{key:"userLanguagesSearchBuilder",value:function(){return new hr.default(this)}},{key:"newConnectorFunctionsFinder",value:function(){return new wr.default(this)}},{key:"newConnectorFunctionsCatalogFinder",value:function(){return new Or.default(this)}},{key:"newConnectorFunctionsCatalog",value:function(){return new Ar.default(this)}},{key:"newConnectorFunctionsHelper",value:function(){return new br.default(this)}},{key:"connectorFunctionsBuilder",value:function(e,t,r,n){return new Er.default(this,e,t,r,n)}},{key:"connectorFunctionsCatalogBuilder",value:function(e,t){return new xr.default(this,e,t)}},{key:"provisionProcessorsBuilder",value:function(){return new mr.default(this)}},{key:"newProvisionProcessorsFinder",value:function(){return new vr.default(this)}},{key:"newPipelineFinder",value:function(){return new Sr.default(this)}},{key:"newTransformerFinder",value:function(){return new Pr.default(this)}},{key:"newAIModelFinder",value:function(){return new Dr.default(this)}},{key:"transformersBuilder",value:function(){return new kr.default(this)}},{key:"aiModelsBuilder",value:function(){return new Cr.default(this)}},{key:"pipelinesBuilder",value:function(){return new jr.default(this)}},{key:"manufacturersBuilder",value:function(){return new Tr.default(this)}},{key:"manufacturerModelsBuilder",value:function(e){return new Fr.default(this,e)}},{key:"newManufacturersFinder",value:function(){return new Mr.default(this)}},{key:"newModelFinder",value:function(){return new Rr.default(this)}},{key:"organizationManufacturersBuilder",value:function(e){return new Br.default(this,e)}},{key:"organizationManufacturerModelsBuilder",value:function(e,t){return new Ir.default(this,e,t)}},{key:"newOrganizationManufacturersFinder",value:function(){return new Nr.default(this)}},{key:"newOrganizationModelFinder",value:function(){return new Ur.default(this)}}]),e}();r.default=Gr,t.exports=r.default},{"./AIModels/AIModels":155,"./AIModels/AIModelsFinder":156,"./alarms/AlarmActions":160,"./areas/AreaFinder":165,"./areas/Areas":166,"./bulk/BulkExecutionFinder":168,"./bulk/BulkFinder":169,"./bundles/BundleFinder":171,"./bundles/Bundles":172,"./channels/ChannelFinder":179,"./channels/Channels":180,"./collection/devices/DeviceMessage":181,"./collection/devices/collect/CommsModuleMessage":182,"./collection/devices/collect/Datapoint":183,"./collection/devices/collect/Datastreams":184,"./collection/devices/collect/Hardware":186,"./collection/devices/collect/Mobile":187,"./collection/devices/collect/PowerSupply":188,"./collection/devices/collect/Software":189,"./collection/devices/collect/Storage":190,"./collection/devices/collect/Subscriber":191,"./collection/devices/collect/Subscription":192,"./collection/devices/collect/Usage":193,"./connectorsFunctions/catalog/ConnectorFunctions":203,"./connectorsFunctions/catalog/ConnectorFunctionsCatalog":204,"./connectorsFunctions/catalog/ConnectorFunctionsCatalogFinder":205,"./connectorsFunctions/configuration/ConnectorFunctions":206,"./connectorsFunctions/configuration/ConnectorFunctionsFinder":207,"./connectorsFunctions/configuration/ConnectorFunctionsHelper":208,"./datasets/DatasetFinder":209,"./datasets/Datasets":210,"./domains/Domains":211,"./domains/DomainsFinder":212,"./entities/DeviceFinder":213,"./entities/EntityFinder":214,"./entities/SubscribersFinder":215,"./entities/SubscriptionsFinder":216,"./entities/TicketFinder":217,"./geocluster/Geocluster":218,"./geocluster/GeoclusterFinder":219,"./iot/catalog/Datastream":221,"./iot/catalog/Qrating":222,"./iot/datamodels/Datamodels":223,"./iot/datamodels/DatamodelsFinder":224,"./iot/datamodels/DatamodelsHelper":225,"./manufacturers/Manufacturer":226,"./manufacturers/ManufacturerFinder":227,"./manufacturers/Model":229,"./manufacturers/ModelFinder":230,"./operationTypes/OperationType":232,"./operationTypes/OperationTypeCatalog":233,"./operationTypes/OperationTypeFinder":234,"./operations/OperationActions":235,"./operations/OperationFinder":236,"./operations/Operations":237,"./operations/PeriodicityActions":238,"./organization_manufacturer/Manufacturer":253,"./organization_manufacturer/ManufacturerFinder":254,"./organization_manufacturer/Model":255,"./organization_manufacturer/ModelFinder":256,"./organizations/OrganizationFinder":257,"./organizations/Organizations":258,"./pipelines/PipelineFinder":259,"./pipelines/Pipelines":260,"./provision/bulk/BulkExecutionBuilder":262,"./provision/country/CountriesCatalog":263,"./provision/entities/EntityBuilder":269,"./provisionProcessors/provisionProcessors":276,"./provisionProcessors/provisionProcessorsFinder":277,"./rulesConfiguration/RuleConfigurations":278,"./rulesConfiguration/RuleConfigurationsCatalog":279,"./rulesConfiguration/RuleConfigurationsFinder":280,"./rulesConfiguration/RuleConfigurationsHelper":281,"./searching/FilterBuilder":288,"./searching/SelectBuilder":291,"./searching/builder/AdministrativeStateSearchBuilder":294,"./searching/builder/AlarmsSearchBuilder":295,"./searching/builder/AllowedResourceTypeSearchBuilder":296,"./searching/builder/AreasSearchBuilder":297,"./searching/builder/AssetsSearchBuilder":298,"./searching/builder/BasicTypesSearchBuilder":299,"./searching/builder/BulkExecutionSearchBuilder":300,"./searching/builder/BulkSearchBuilder":301,"./searching/builder/BundlesSearchBuilder":302,"./searching/builder/CertificatesSearchBuilder":303,"./searching/builder/ChannelsSearchBuilder":304,"./searching/builder/CommunicationsModuleTypeSearchBuilder":305,"./searching/builder/CountryCodesSearchBuilder":306,"./searching/builder/DatamodelsSearchBuilder":307,"./searching/builder/DatapointsSearchBuilder":308,"./searching/builder/DatasetEntitiesSearchBuilder":309,"./searching/builder/DatasetSearchBuilder":310,"./searching/builder/DatasetsCatalogSearchBuilder":311,"./searching/builder/DatastreamsSearchBuilder":312,"./searching/builder/DevicesPlansSearchBuilder":313,"./searching/builder/DevicesSearchBuilder":314,"./searching/builder/DomainsSearchBuilder":315,"./searching/builder/EntitiesSearchBuilder":316,"./searching/builder/ExecutionsHistorySearchBuilder":317,"./searching/builder/ExecutionsSearchBuilder":318,"./searching/builder/FeedsSearchBuilder":319,"./searching/builder/FieldsDefinitionSearchBuilder":320,"./searching/builder/HardwaresSearchBuilder":322,"./searching/builder/IoTDatastreamAccessSearchBuilder":323,"./searching/builder/IoTDatastreamPeriodSearchBuilder":324,"./searching/builder/IoTDatastreamStoragePeriodSearchBuilder":325,"./searching/builder/MobilePhoneProviderSearchBuilder":326,"./searching/builder/OperationTypesSearchBuilder":327,"./searching/builder/OperationalStatusSearchBuilder":328,"./searching/builder/OperationsSearchBuilder":329,"./searching/builder/PlansSearchBuilder":330,"./searching/builder/RawSearchBuilder":332,"./searching/builder/ResourceTypeSearchBuilder":333,"./searching/builder/RulesSearchBuilder":334,"./searching/builder/ServiceGroupSearchBuilder":337,"./searching/builder/SoftwaresSearchBuilder":338,"./searching/builder/SubscribersSearchBuilder":339,"./searching/builder/SubscriptionsSearchBuilder":340,"./searching/builder/TasksSearchBuilder":341,"./searching/builder/TicketPrioritySearchBuilder":342,"./searching/builder/TicketSeveritySearchBuilder":343,"./searching/builder/TicketStatusSearchBuilder":344,"./searching/builder/TicketsSearchBuilder":345,"./searching/builder/TimeserieSearchBuilder":346,"./searching/builder/TimezoneSearchBuilder":347,"./searching/builder/UserLanguagesSearchBuilder":348,"./searching/builder/UserProfilesSearchBuilder":349,"./searching/builder/UsersSearchBuilder":350,"./searching/builder/WorkgroupsSearchBuilder":351,"./security/CertificateFinder":353,"./security/Certificates":354,"./timeseries/Timeseries":358,"./timeseries/TimeseriesFinder":359,"./timeseriesFunctionsCatalog/TimeseriesFunction":361,"./timeseriesFunctionsCatalog/TimeseriesFunctionFinder":362,"./timeseriesFunctionsCatalog/TimeseriesFunctionsHelper":363,"./transformers/TransformerFinder":364,"./transformers/Transformers":365,"./users/UserFinder":366,"./users/Users":367,"./util/Expression":369,"./util/SelectElement":371,"./workgroups/WorkgroupFinder":377,"./workgroups/WorkgroupRelations":378,"./workgroups/WorkgroupRelationsFinder":379,"./workgroups/Workgroups":380,superagent:131}],159:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./GenericFinder"),a=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/"+r,n,i)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./GenericFinder":157}],160:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./actions/AlarmAttendBuilder")),o=i(e("./actions/AlarmCloseBuilder")),s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t}return n(e,[{key:"newCloseBuilder",value:function(){return new o.default(this._ogapi)}},{key:"newAttendBuilder",value:function(){return new a.default(this._ogapi)}}]),e}();r.default=s,t.exports=r.default},{"./actions/AlarmAttendBuilder":163,"./actions/AlarmCloseBuilder":164}],161:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._resource=r,this._postObj=n}return n(e,[{key:"execute",value:function(){var e=this,t=o.default.defer();return this._ogapi.Napi.post(this._resource,this._postObj).then((function(r){var n=void 0;try{n=JSON.parse(r.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:n||{},statusCode:r.statusCode,location:r.header.location})})).catch((function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)})),t.promise}}]),e}();r.default=s,t.exports=r.default},{q:120}],162:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./Alarm"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._action=r,this._resource="alarms",this._build={alarms:[],notes:void 0,action:r},this.constructor===e)throw new Error("Cannot construct Abstract instances directly")}return n(e,[{key:"addAlarmId",value:function(e){if("string"!=typeof e)throw new Error("Parameter alarmId must be a string");return this._build.alarms.push(e),this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("Parameter notes must be a string");return this._build.notes=e,this}},{key:"build",value:function(){if(0===this._build.alarms.length)throw new Error("Builder error. You must append at least one alarmId with addAlarmId method");return"string"!=typeof this._build.notes&&delete this._build.notes,new o.default(this._ogapi,this._resource,this._build)}}]),e}();r.default=s,t.exports=r.default},{"./Alarm":161}],163:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./AlarmActionBuilder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ATTEND")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./AlarmActionBuilder":162}],164:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./AlarmActionBuilder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"CLOSE")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./AlarmActionBuilder":162}],165:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","area","Area/s not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._checkString(e,"organization"),this._checkString(t,"identifier"),this._organization=e,this._identifier=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/areas/"+this._identifier}},{key:"_checkString",value:function(e,t){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],166:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=e("./TYPE_ENUM"),s=a(e("../provision/BaseProvision")),u=a(e("../util/formats/check_types")),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["identifier","organization","type","coordinates"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return"provision/organizations/"+this._organization+"/areas/"+this._identifier}},{key:"withOrganization",value:function(e){return u.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return u.default._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return u.default._checkStringAndLength(e,50,"name"),this._name=e,this}},{key:"withColor",value:function(e){return u.default._checkStringAndLength(e,50,"color"),this._color=e,this}},{key:"withDescription",value:function(e){return u.default._checkStringAndLength(e,50,"description"),this._description=e,this}},{key:"withOrder",value:function(e){return u.default._checkNumber(e,"order"),this._order=e,this}},{key:"withGeometry",value:function(e,t){return u.default._checkType(e,o.TYPE_ENUM),u.default._checkArray(t,"coordinates"),this._type=e,this._coordinates=t,this}},{key:"withEntities",value:function(e){return u.default._checkArray(e,"entities"),this._entities=e,this}},{key:"_composeElement",value:function(){return this._resource="provision/organizations/"+this._organization+"/areas/",{identifier:this._identifier,name:this._name,description:this._description,order:this._order,color:this._color,geometry:{type:this._type,coordinates:this._coordinates},entities:this._entities}}},{key:"_composeUpdateElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.identifier,e}}]),t}(s.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":261,"../util/formats/check_types":373,"./TYPE_ENUM":167}],167:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.TYPE_ENUM=["Polygon","Point","LineString"]},{}],168:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=(i(e("q")),i(e("http-status-codes")),["application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]);r.MIME_TYPES_ENUM=o;var s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","value","Bulk not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/bulk/"+this._id+(this._details?"/details":"")}},{key:"findByOrganizationAndId",value:function(e,t,r){if(this._organization=e,this._id=t,this._details=!1,r){var n="";if(void 0===o.find((function(e){return e==this}),r)&&(n=r),""!==n)throw new Error("Parameter mimetype is not allowed. Parameter value <'"+JSON.stringify(n)+"'>, mimetype allowed <'"+JSON.stringify(o)+"'>");return this._details=!0,this._setExtraHeaders({accept:r}),this._download()}return this._details=!1,this._setExtraHeaders({accept:void 0}),this._execute()}}]),t}(a.default);r.default=s},{"../GenericFinder":157,"http-status-codes":76,q:120}],169:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=(i(e("q")),i(e("http-status-codes")),function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","bulk/async","Bulk not found"),this._raw=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndId",value:function(e,t,r,n){return this._organization=e,this._id=t,this._setUrlParameters({format:r}),n&&this._setExtraHeaders({accept:n}),this._download(!0)}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._entity+"/"+this._id}}]),t}(a.default));r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159,"http-status-codes":76,q:120}],170:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ACTION_ENUM=["HARDWARE_RESET","SOFTWARE_RESET","COMMS_DOWN","COMMS_UP","COMMS_RESET"]},{}],171:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"bundles","bundle","Bundle not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._name+"/versions/"+this._version}},{key:"findByNameAndVersion",value:function(e,t){return this._name=e,this._version=t,this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],172:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=e("./ACTION_ENUM"),s=a(e("./deployment/DeploymentElement")),u=a(e("q")),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/bundles")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>255)throw new Error("OGAPI_NAME_PARAMETER_MAX_LENGTH_255");return this._name=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withHardware",value:function(e){if("string"!=typeof e)throw new Error("Parameter hardware must be a string");return this._hardware=e,this}},{key:"withWorkgroup",value:function(e){if("string"!=typeof e)throw new Error("Parameter workgroup must be a string");return this._workgroup=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withTimeout",value:function(e){if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._timeout=e,this}},{key:"_checkActions",value:function(e,t){if(void 0===e||e.constructor!==Array)throw new Error("Parameter "+t+" must be typeof Array");for(var r=[],n=0;n<e.length;n++){void 0===o.ACTION_ENUM.find((function(e){return e==this}),e[n])&&r.push(e[n])}if(0!==r.length)throw new Error("Any action into parameter "+t+" is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, "+t+" allowed <'"+JSON.stringify(o.ACTION_ENUM)+"'>");return e}},{key:"withPreaction",value:function(e){return this._preaction=this._checkActions(e,"preaction"),this}},{key:"withPostaction",value:function(e){return this._postaction=this._checkActions(e,"postaction"),this}},{key:"withUserNotes",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"notes"});return this._userNotes=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be a boolean");return this._active=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return{bundle:{name:this._name||void 0,version:this._version||void 0,hardware:this._hardware||void 0,workgroup:this._workgroup||void 0,description:this._description||void 0,preaction:this._preaction||void 0,postaction:this._postaction||void 0,userNotes:this._userNotes||void 0,active:this._active||void 0}}}},{key:"_buildURL",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return this._resource+"/"+this._name+"/versions/"+this._version}},{key:"activate",value:function(){var e=u.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),{bundle:{active:!0}},void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_BUNDLE_NOT_ACTIVE"}],statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"deactivate",value:function(){var e=u.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),{bundle:{active:!1}},void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_BUNDLE_NOT_DEACTIVE"}],statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"addDeploymentElement",value:function(e){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");this._deploymentElements||(this._deploymentElements=[]);var t=new s.default(this._parent,this._ogapi,encodeURI(this._buildURL()),e);return this._deploymentElements.push(t),this._deploymentElements[this._deploymentElements.length-1]}},{key:"deployAndActivate",value:function(){var e=this,t=u.default.defer(),r=t.promise;if(e._deploymentElements&&e._deploymentElements.length>0){var n=0,i=0;for(i=0;i<e._deploymentElements.length;i++){var a=0;if(e._deploymentElements[i]._validators&&e._deploymentElements[i]._validators.length>0)for(a=0;a<e._deploymentElements[i]._validators.length;a++)"TRUSTED_BOOT"===e._deploymentElements[i]._validators[a].mode&&(n+=1)}if(n>1)throw new Error("OGAPI_422_ONE_TRUSTED_BOOT_ALLOWED")}e._allPromisesOk=!0;var o=function(r){e.delete(),t.reject(r)};return e.create().then((function(r){var n,i;201===r.statusCode?(i=r,e._deploymentElements&&e._deploymentElements.length>0?(n=[],e._deploymentElements.forEach((function(e){n.push(e.deploy())})),Promise.all(n).then((function(){e._allPromisesOk&&e.activate().then((function(e,r){t.resolve(i)})).catch((function(e){t.reject(e)}))})).catch((function(t){e._allPromisesOk=!1,o(t)}))):t.resolve(i)):o({statusCode:r.statusCode})})).catch(o),r}},{key:"create",value:function(){var e=this;if(void 0===this._name||void 0===this._version||void 0===this._hardware||void 0===this._workgroup)throw new Error("Parameters name, version, hardware and workgroup must be defined");var r=u.default.defer(),n=r.promise,a=function(e){201===e.statusCode?r.resolve(e):o({statusCode:e.statusCode})},o=function(e){r.reject(e)};return this._ogapi.newBundleFinder().findByNameAndVersion(this._name,this._version).then((function(n){204===n.statusCode?i(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(a).catch(o):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})})).catch((function(n){404===n.statusCode?i(Object.getPrototypeOf(t.prototype),"create",e).call(e).then(a).catch(o):r.reject({errors:[{code:204,message:"OGAPI_400_BUNDLE_EXIST"}],statusCode:400})})),n}},{key:"update",value:function(){var e=u.default.defer(),t=e.promise,r=this._composeElement();return delete r.bundle.name,delete r.bundle.version,delete r.bundle.workgroup,delete r.bundle.hardware,this._ogapi.Napi.put(this._buildURL(),r,void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:[{code:t.statusCode,message:"OGAPI_400_BUNDLE_NOT_UPDATED"}],statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a(e("../provision/BaseProvision")).default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":261,"./ACTION_ENUM":170,"./deployment/DeploymentElement":173,q:120}],173:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=e("./OPERATION_ENUM"),o=e("./OPTION_ENUM"),s=e("./TYPE_ENUM"),u=e("./TYPE_VALIDATORS_ENUM"),c=e("./MODE_VALIDATORS_ENUM"),l=i(e("q")),p=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,r,n+"/deploymentElements"),this._progressEvent=i,this._resource=n+"/deploymentElements",this.validation=!1,this._name=void 0,this._version=void 0,this._type=void 0,this._path=void 0,this._order=void 0,this._operation=void 0,this._option=void 0,this._fileName=void 0,this._downloadUrl=void 0,this._validators=void 0,this._oldName=void 0,this._oldVersion=void 0,this._oldPath=void 0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withType",value:function(e){if(void 0===e||"string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});var t="";if(void 0===s.TYPE_ENUM.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error({message:"OGAPI_NOT_ALLOWED_PARAMETER",parameter:JSON.stringify(t),allowed:JSON.stringify(s.TYPE_ENUM)});return this._type=e,this}},{key:"withPath",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"path"});return this._path=e,this}},{key:"withOrder",value:function(e){return this._order=e,this}},{key:"withOperation",value:function(e){if(void 0===e||"string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"operation"});var t="";if(void 0===a.OPERATION_ENUM.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error("Parameter operation is not allowed. Parameter value <'"+JSON.stringify(t)+"'>, operation allowed <'"+JSON.stringify(a.OPERATION_ENUM)+"'>");return this._operation=e,this}},{key:"withOption",value:function(e){if(void 0===e||"string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"option"});var t="";if(void 0===o.OPTION_ENUM.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error("Parameter option is not allowed. Parameter value <'"+JSON.stringify(t)+"'>, option allowed <'"+JSON.stringify(o.OPTION_ENUM)+"'>");return this._option=e,this}},{key:"withValidators",value:function(e){var t={},r=[];if(void 0===e||e.constructor!==Array)throw new Error("Parameter validators must be typeof Array");for(var n=!1,i=0;i<e.length;i++){if("TRUSTED_BOOT"===(t=this._checkValidator(e[i])).mode){if(n)throw new Error("OGAPI_422_ONE_TRUSTED_BOOT_ALLOWED_DEPLOY_ELEMENT");n=!0}r.push(t)}return this._validators=r,this}},{key:"_checkValidator",value:function(e){var t={};if(e.mode){var r="",n=e.mode;if(void 0===n||"string"!=typeof n)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});if(void 0===c.MODE_VALIDATORS_ENUM.find((function(e){return e==this}),n)&&(r=n),""!==r)throw new Error("Parameter type is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, type allowed <'"+JSON.stringify(c.MODE_VALIDATORS_ENUM)+"'>");if("TRUSTED_BOOT"===n&&("TRUSTED_BOOT"!==n||"FIRMWARE"!==this._type))throw new Error("TRUSTED_BOOT validator only allowed for FIRMWARE deployment element");t.mode=n}else t.mode=c.MODE_VALIDATORS_ENUM[0];if(!e.type)throw new Error("Parameter type is required");r="";var i=e.type;if(void 0===i||"string"!=typeof i)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});if(void 0===u.TYPE_VALIDATORS_ENUM.find((function(e){return e==this}),i)&&(r=i),""!==r)throw new Error("Parameter type is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, type allowed <'"+JSON.stringify(u.TYPE_VALIDATORS_ENUM)+"'>");if(t.type=i,t.mode===c.MODE_VALIDATORS_ENUM[0]){if(!e.value)throw new Error("Parameter value is required when mode is "+c.MODE_VALIDATORS_ENUM[0]);var a=e.value;if("string"!=typeof a)throw new Error("Parameter value must be a string");t.value=a}return t}},{key:"withDownloadUrl",value:function(e){if("string"!=typeof e)throw new Error("Parameter downloadUrl must be a string");return this._downloadUrl=e,this}},{key:"withFileName",value:function(e){if("string"!=typeof e)throw new Error("Parameter fileName must be a string");return this._fileName=e,this}},{key:"withValidation",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter validation must be a boolean");return this.validation=e,this}},{key:"withOldName",value:function(e){if("string"!=typeof e)throw new Error("Parameter old name must be a string");return this._oldName=e,this}},{key:"withOldVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter old version must be a string");return this._oldVersion=e,this}},{key:"withOldPath",value:function(e){if("string"!=typeof e)throw new Error("Parameter old path must be a string");return this._oldPath=e,this}},{key:"withFile",value:function(e){return this._rawFile=e,this}},{key:"_composeUrlCreate",value:function(){if(void 0===this._name||void 0===this._version||""===this._name||""===this._version)throw new Error("Method not allowed - You must to define the name and version");return this._setUrlParameters({fileValidationRequired:this.validation}),this._resource}},{key:"_composeElement",value:function(){if("UPGRADE"===this._operation){if(void 0===this._name||void 0===this._version||void 0===this._type||void 0===this._path||void 0===this._order||void 0===this._operation||void 0===this._oldName||void 0===this._oldVersion||void 0===this._oldPath)throw new Error("Method not allowed - You must define the basic element [name, version, type, path, order, operation, oldName, oldVersion and oldPath ]")}else if(void 0===this._name||void 0===this._version||void 0===this._type||void 0===this._path||void 0===this._order||void 0===this._operation||void 0===this._option)throw new Error("Method not allowed - You must define the basic element [name, version, type, path, order, option and operation]");return{deploymentElement:{name:this._name||void 0,version:this._version||void 0,type:this._type||void 0,path:this._path||void 0,order:this._order||void 0,operation:this._operation||void 0,option:this._option||void 0,fileName:this._fileName||void 0,downloadUrl:this._downloadUrl||void 0,validators:this._validators||void 0,oldName:this._oldName||void 0,oldVersion:this._oldVersion||void 0,oldPath:this._oldPath||void 0}}}},{key:"withTimeout",value:function(e){if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._timeout=e,this}},{key:"_buildURL",value:function(){if(void 0===this._name||void 0===this._version)throw new Error("Parameters name, version must be defined");return this._resource+"/"+this._name+"/version/"+this._version}},{key:"createWithFile",value:function(e){var t=void 0;if("string"!=typeof e){t=new FormData;var r=new Blob([JSON.stringify(this._composeElement())],{type:"application/octet-stream"});t.append("meta",r),e&&t.append("file",e)}else(t={}).meta=JSON.stringify(this._composeElement()),e&&(t.file=e);var n={};null!=this._progressEvent&&(n={progress:this._progressEvent});var i=l.default.defer(),a=i.promise;return this._ogapi.Napi.post_multipart(this._composeUrlCreate(),t,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){201===e.statusCode?i.resolve({location:e.header.location,statusCode:e.statusCode}):i.reject({errors:[{code:e.statusCode,message:"OGAPI_FILE_NOT_CREATE"}],statusCode:e.statusCode})})).catch((function(e){i.reject(e)})),a}},{key:"deploy",value:function(){return this.createWithFile(this._rawFile)}},{key:"update",value:function(){throw new Error("OGAPI_DEPLOYMENT_ELEMENT_NOT_UPDATED")}}]),t}(i(e("../../provision/BaseProvision")).default);r.default=p,t.exports=r.default},{"../../provision/BaseProvision":261,"./MODE_VALIDATORS_ENUM":174,"./OPERATION_ENUM":175,"./OPTION_ENUM":176,"./TYPE_ENUM":177,"./TYPE_VALIDATORS_ENUM":178,q:120}],174:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MODE_VALIDATORS_ENUM=["PLATFORM","TRUSTED_BOOT"]},{}],175:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.OPERATION_ENUM=["INSTALL","UNINSTALL","UPGRADE"]},{}],176:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.OPTION_ENUM=["MANDATORY","OPTIONAL"]},{}],177:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.TYPE_ENUM=["SOFTWARE","FIRMWARE","CONFIGURATION","PARAMETERS"]},{}],178:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.TYPE_VALIDATORS_ENUM=["MD2","MD5","SHA-1","SHA-256","SHA-384","SHA-512","CERTIFICATE_SIGN"]},{}],179:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","channel","Channel not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndName",value:function(e,t){return this._organization=e,this._name=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._name}},{key:"findByDomainAndWorkgroup",value:function(e,t){this._domain=e,this._workgroup=t;var r=this._error_not_found,n=o.default.defer(),i=n.promise;return this._executeWorkgroupRelation().then((function(e){if(204===e.statusCode)n.reject({data:r,statusCode:s.default.NO_CONTENT});else{var t=e.data,i=[];for(var a in t.channels)i.push({organization:t.channels[a].organization,name:t.channels[a].channel});n.resolve({data:i,statusCode:e.statusCode})}})).catch((function(e){n.reject(e)})),i}},{key:"findByDomainAndWorkgroupAndOrganization",value:function(e,t,r){var n=this;n._domain=e,n._workgroup=t,n._organization=r;var i=n._error_not_found,a=o.default.defer(),u=a.promise;return n._executeWorkgroupRelation().then((function(e){if(204===e.statusCode)a.reject({data:i,statusCode:s.default.NOT_FOUND});else{var t=e.data,r=[];for(var o in t.channels)n._organization===t.channels[o].organization&&r.push({organization:t.channels[o].organization,name:t.channels[o].channel});r.length>0?a.resolve({data:r,statusCode:e.statusCode}):a.reject({data:i,statusCode:s.default.NOT_FOUND})}})).catch((function(e){a.reject(e)})),u}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=o.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){204===e.statusCode?t.reject({data:n,statusCode:s.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}}]),t}(a.default);r.default=u,t.exports=r.default},{"../ProvisionGenericFinder":159,"http-status-codes":76,q:120}],180:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}a(e("q"));var o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["name","organization"]),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return"provision/organizations/"+this._organization+"/channels/"+this._name}},{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withCertificate",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"certificate"});return this._certificates||(this._certificates=[]),this._certificates.push(e),this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/organizations/"+this._organization+"/channels",{channel:{name:this._name||void 0,description:this._description||void 0,certificates:this._certificates||void 0}}}},{key:"_composeUpdateElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.channel.name,e}}]),t}(a(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],181:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("q")),s=a(e("./collect/Event")),u=a(e("../devices/collect/Datastreams")),c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._ogapi=e,this._resource="devices",this._iotMessage=void 0,this._dmmMessage=void 0,this._id=void 0,this._version=void 0,this._dataStreamVersion=void 0,this._deviceId=void 0,this._datastreams=[]}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withId",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"id"});return this._id=e,this}},{key:"withDataStreamVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._dataStreamVersion=e,this}},{key:"withDmmVersion",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"version"});return this._version=e,this}},{key:"withDeviceId",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"device"});return this._deviceId=e,this}},{key:"withDataStream",value:function(e){return e instanceof u.default&&this._datastreams.push(e.composeElement()),this}},{key:"_buildIotURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id+"/collect/iot"}},{key:"_buildDmmURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id+"/collect/dmm"}},{key:"_composeIotMessage",value:function(){if(void 0===this._datastreams||void 0===this._dataStreamVersion)throw new Error("Parameters datastreams and version must be defined");return{version:this._dataStreamVersion,device:this._deviceId,datastreams:this._datastreams}}},{key:"_composeDmmMessage",value:function(){if(void 0===this._version)throw new Error("Parameters id must be defined");var e=i(Object.getPrototypeOf(t.prototype),"composeElement",this).call(this);return{version:this._version,event:e}}},{key:"create",value:function(){var e=o.default.defer(),t=e.promise,r=[];return this._datastreams.length>0&&r.push(this._ogapi.Sapi.post(this._buildIotURL(),this._composeIotMessage()).then((function(e){if(201!==e.statusCode)throw new Error("IOT NOT CREATED")}))),void 0!==this._version&&r.push(this._ogapi.Sapi.post(this._buildDmmURL(),this._composeDmmMessage()).then((function(e){if(201!==e.statusCode)throw new Error("DMM NOT CREATED")}))),o.default.all(r).catch((function(t){e.reject({errors:t,statusCode:400})})).done((function(t){e.resolve({statusCode:201})})),t}}]),t}(s.default);r.default=c,t.exports=r.default},{"../devices/collect/Datastreams":184,"./collect/Event":185,q:120}],182:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=e("./enum/ANTENNA_STATUS_ENUM"),o=i(e("./Hardware")),s=i(e("./Software")),u=i(e("./Mobile")),c=i(e("./Subscriber")),l=i(e("./Subscription")),p=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._id=void 0,this._name=void 0,this._type=void 0,this._hardware=void 0,this._operationalStatus=void 0,this._antennaStatus=void 0,this._softwareList=[],this._mobile=void 0,this._subscriber=void 0,this._subscription=void 0}return n(e,[{key:"withId",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"id"});return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"name"});return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"type"});return this._type=e,this}},{key:"withHardware",value:function(e){if(!(e instanceof o.default))throw new Error("Parameter hardware must be hardware type");return this._hardware=e,this}},{key:"withOperationalStatus",value:function(e){return this._ogapi.operationalStatusSearchBuilder().withEntityType("COMMUNICATIONS_MODULE").withId(e).build().execute().then((function(e){if(204===e.statusCode)throw new Error("Operational Status not found")})),this._operationalStatus=e,this}},{key:"withAntennaStatus",value:function(e){if("string"!=typeof e)throw new Error("Parameter antennaStatus must be a string");return this._antennaStatus=this._checkValues(e,a.ANTENNA_STATUS_ENUM),this}},{key:"withSoftware",value:function(e){if(!(e instanceof s.default))throw new Error("Parameter software must be software type");return this._softwareList.push(e.composeElement()),this}},{key:"withMobile",value:function(e){if(!(e instanceof u.default))throw new Error("Parameter mobile must be Mobile type");return this._mobile=e,this}},{key:"withSubscriber",value:function(e){if(!(e instanceof c.default))throw new Error("Parameter subscriber must be Subscriber type");return this._subscriber=e,this}},{key:"withSubscription",value:function(e){if(!(e instanceof l.default))throw new Error("Parameter subscription must be Subscription type");return this._subscription=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){var e={id:this._id,name:this._name,type:this._type,hardware:this._hardware.composeElement(),operationalStatus:this._operationalStatus,antennaStatus:this._antennaStatus};return this._softwareList.length>0&&(e.softwareList=this._softwareList),void 0!==this._mobile&&(e.mobile=this._mobile.composeElement()),void 0!==this._subscriber&&(e.subscriber=this._subscriber.composeElement()),void 0!==this._subscription&&(e.subscription=this._subscription.composeElement()),e}}]),e}();r.default=p,t.exports=r.default},{"./Hardware":186,"./Mobile":187,"./Software":189,"./Subscriber":191,"./Subscription":192,"./enum/ANTENNA_STATUS_ENUM":195}],183:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._from=void 0,this._at=void 0,this._value=void 0,this._tags=void 0}return n(e,[{key:"withFrom",value:function(e){if(null!==e){if("number"!=typeof e)throw new Error("OGAPI_MUST_BE_NUMBER_PARAMETER");this._from=e}return this}},{key:"withAt",value:function(e){if(null!==e){if("number"!=typeof e)throw new Error("OGAPI_MUST_BE_NUMBER_PARAMETER");this._at=e}return this}},{key:"withValue",value:function(e){if(void 0===e||0===e.length)throw new Error("OGAPI_DEFINED_PARAMETER");return this._value=e,this}},{key:"withTags",value:function(e){if(null!==e){if(e.constructor!==Array||0===e.length)throw new Error({message:"OGAPI_ARRAY_PARAMETER",parameter:"tags"});this._tags=e}return this}},{key:"composeElement",value:function(){if(void 0===this._value||0===this._value.length)throw new Error({message:"OGAPI_DEFINED_PARAMETER",parameter:"value"});return{from:this._from||void 0,at:this._at||void 0,value:this._value,tags:this._tags||void 0}}}]),e}();r.default=i,t.exports=r.default},{}],184:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./Datapoint"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._id=void 0,this._feed=void 0,this._datapoints=[]}return n(e,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER_ID");return this._id=e,this}},{key:"withFeed",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER_FEED");return this._feed=e,this}},{key:"withDatapoint",value:function(e){if(!(e instanceof o.default))throw new Error("OGAPI_PARAMETER_DATAPOINT");return this._datapoints.push(e.composeElement()),this}},{key:"composeElement",value:function(){if(void 0===this._id||0===this._id.length||0===this._datapoints.length)throw new Error("Parameter id must be defined and dapoint list must have at least one element");return{id:this._id,feed:this._feed,datapoints:this._datapoints}}}]),e}();r.default=s,t.exports=r.default},{"./Datapoint":183}],185:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}i(e("q"));var a=i(e("./Hardware")),o=i(e("./Software")),s=i(e("./Usage")),u=i(e("./Storage")),c=i(e("./PowerSupply")),l=i(e("./CommsModuleMessage")),p=e("./enum/TEMPERATURE_STATUS_ENUM"),f=e("./enum/LEVEL_TREND_ENUM"),d=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._event_id=void 0,this._deviceId=void 0,this._path=void 0,this._name=void 0,this._description=void 0,this._hardware=void 0,this._operationalStatus=void 0,this._softwareList=[],this._location=void 0,this._temperature=void 0,this._cpuUsage=void 0,this._ram=void 0,this._volatilStorage=void 0,this._nonVolatilStorage=void 0,this._powerSupply=void 0,this._upTime=void 0,this._communicationsModulesList=[]}return n(e,[{key:"withEventId",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"EventId"});return this._event_id=e,this}},{key:"withDeviceId",value:function(e){if("string"!=typeof e)throw new Error("deviceId cannot be empty");return this._deviceId=e,this}},{key:"withPath",value:function(e){if(e.constructor!==Array||0===e.length)throw new Error("Parameter path must be an Array and cannot be empty");return this._path=e,this}},{key:"withEventName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be String type and cannot be empty");return this._name=e,this}},{key:"withEventDescription",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter description must be String type and cannot be empty");return this._description=e,this}},{key:"withHardware",value:function(e){if(!(e instanceof a.default))throw new Error("Parameter hardware must be Hardware type");return this._hardware=e,this}},{key:"withOperationalStatus",value:function(e){return this._ogapi.operationalStatusSearchBuilder().withEntityType("ASSET").withId(e).build().execute().then((function(e){if(204===e.statusCode)throw new Error("Operational Status not found")})),this._operationalStatus=e,this}},{key:"withSoftware",value:function(e){if(!(e instanceof o.default))throw new Error("Parameter software must be software type");return this._softwareList.push(e.composeElement()),this}},{key:"withDateLocation",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter date must be String type and cannot be empty");return void 0===this._location&&(this._location={coordinates:{}}),this._location.timestamp=e,this}},{key:"withLatitude",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter latitude must be number type and cannot be empty");return void 0===this._location&&(this._location={coordinates:{}}),this._location.coordinates.latitude=e,this}},{key:"withLongitude",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter longitude must be number type and cannot be empty");return void 0===this._location&&(this._location={coordinates:{}}),this._location.coordinates.longitude=e,this}},{key:"withCurrentTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter currentTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.current=e,this}},{key:"withUnitTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unitTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.unit=e,this}},{key:"withStatusTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unitTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.status=this._checkValues(e,p.TEMPERATURE_STATUS_ENUM),this}},{key:"withTrendTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unitTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.trend=this._checkValues(e,f.LEVEL_TREND_ENUM),this}},{key:"withTemperatureAverage",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter averageTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.average=e,this}},{key:"withMinimumTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter minimumTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.minimum=e,this}},{key:"withMaximumTemperature",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter maximumTemperature must be string type and cannot be empty");return void 0===this._temperature&&(this._temperature={}),this._temperature.maximum=e,this}},{key:"withCpuUsage",value:function(e){if(!(e instanceof s.default))throw new Error("Parameter cpuUsage must be Usage type");return this._cpuUsage=e,this}},{key:"withRam",value:function(e){if(!(e instanceof u.default))throw new Error("Parameter ram must be Storage type");return this._ram=e,this}},{key:"withVolatilStorage",value:function(e){if(!(e instanceof u.default))throw new Error("Parameter volatilStorage must be Storage type");return this._volatilStorage=e,this}},{key:"withNonVolatilStorage",value:function(e){if(!(e instanceof u.default))throw new Error("Parameter nonVolatilStorage must be Storage type");return this._nonVolatilStorage=e,this}},{key:"withPowerSupply",value:function(e){if(!(e instanceof c.default))throw new Error("Parameter powerSupply must be PowerSupply type");return this._powerSupply=e,this}},{key:"withCommsModule",value:function(e){if(!(e instanceof l.default))throw new Error("Parameter communicationsModules must be CommsModuleMessage type");return this._communicationsModulesList.push(e.composeElement()),this}},{key:"withUpTime",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter upTime must be number type and cannot be empty");return this._upTime=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){var e={id:this._event_id,device:{id:this._deviceId,path:this._path,name:this._name,description:this._description,operationalStatus:this._operationalStatus}};return void 0!==this._hardware&&(e.device.hardware=this._hardware.composeElement()),this._softwareList.length>0&&(e.device.softwareList=this._softwareList),void 0!==this._location&&(e.device.location=this._location),void 0!==this._temperature&&(e.device.temperature=this._temperature),void 0!==this._cpuUsage&&(e.device.cpuUsage=this._cpuUsage.composeElement()),void 0!==this._ram&&(e.device.ram=this._ram.composeElement()),void 0!==this._volatilStorage&&(e.device.volatilStorage=this._volatilStorage.composeElement()),void 0!==this._nonVolatilStorage&&(e.device.nonVolatilStorage=this._nonVolatilStorage.composeElement()),void 0!==this._powerSupply&&(e.device.powerSupply=this._powerSupply.composeElement()),this._communicationsModulesList.length>0&&(e.device.communicationsModules=this._communicationsModulesList),void 0!==this._upTime&&(e.device.upTime=this._upTime),e}}]),e}();r.default=d,t.exports=r.default},{"./CommsModuleMessage":182,"./Hardware":186,"./PowerSupply":188,"./Software":189,"./Storage":190,"./Usage":193,"./enum/LEVEL_TREND_ENUM":198,"./enum/TEMPERATURE_STATUS_ENUM":201,q:120}],186:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._serialnumber=void 0,this._manufacturerName=void 0,this._manufacturerOui=void 0,this._modelName=void 0,this._modelVersion=void 0,this._clockDate=void 0}return n(e,[{key:"withSerialnumber",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter serial number must be a string and cannot be empty");return this._serialnumber=e,this}},{key:"withManufacturerName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter manufacturer Name must be a string and cannot be empty");return this._manufacturerName=e,this}},{key:"withManufacturerOui",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter manufacturer code must be a string and cannot be empty");return this._manufacturerOui=e,this}},{key:"withModelName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter model Name must be a string and cannot be empty");return this._modelName=e,this}},{key:"withModelVersion",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter model Version must be a string and cannot be empty");return this._modelVersion=e,this}},{key:"withClockDate",value:function(e){if(!this._isValidDate(e))throw new Error("The clockDate parameter has a wrong format. Example of rigth format is 2015-07-16T19:20:30+01:00");return this._clockDate=e,this}},{key:"_isValidDate",value:function(e){if(""===e||null===e)return!1;var t=e.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\+(\d{2}):(\d{2})/);if(null===t||"object"!=typeof t)return!1;if("object"!=typeof t&&null!==t&&3!==t.size)return!1;var r=!0,n=(new Date).getFullYear();return(t[1].length<4||t[1]<1999||t[1]>n)&&(r=!1),(t[2].length<2||t[2]<1||t[2]>12)&&(r=!1),(t[3].length<2||t[3]<1||t[3]>31)&&(r=!1),r}},{key:"composeElement",value:function(){return{serialnumber:this._serialnumber,manufacturer:{name:this._manufacturerName,oui:this._manufacturerOui||""},model:{name:this._modelName||"",version:this._modelVersion||""},clockDate:this._clockDate}}}]),e}();r.default=i,t.exports=r.default},{}],187:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._mr=void 0,this._apn=void 0,this._bcch=void 0,this._cgi=void 0,this._cellId=void 0,this._lac=void 0,this._ratType=void 0,this._plmn=void 0,this._timingAdvance=void 0,this._signalStrength=void 0,this._signalStrengthMax=void 0,this._signalStrengthMin=void 0,this._signalQuality=void 0,this._signalQualityMax=void 0,this._signalQualityMin=void 0}return n(e,[{key:"withMr",value:function(e){if("string"!=typeof e)throw new Error("Parameter mr usage must be String type ");return this._mr=e,this}},{key:"withApn",value:function(e){if("string"!=typeof e)throw new Error("Parameter apn usage must be String type ");return this._apn=e,this}},{key:"withBcch",value:function(e){if("string"!=typeof e)throw new Error("Parameter bcch usage must be String type ");return this._bcch=e,this}},{key:"withCgi",value:function(e){if("string"!=typeof e)throw new Error("Parameter cgi usage must be String type ");return this._cgi=e,this}},{key:"withCellId",value:function(e){if("string"!=typeof e)throw new Error("Parameter cellId usage must be String type ");return this._cellId=e,this}},{key:"withLac",value:function(e){if("string"!=typeof e)throw new Error("Parameter lac usage must be String type ");return this._lac=e,this}},{key:"withRatType",value:function(e){if("string"!=typeof e)throw new Error("Parameter ratType usage must be String type ");return this._ratType=e,this}},{key:"withPlmn",value:function(e){if("string"!=typeof e)throw new Error("Parameter plmn usage must be String type ");return this._plmn=e,this}},{key:"withTimingAdvance",value:function(e){if("string"!=typeof e)throw new Error("Parameter timingAdvance usage must be String type ");return this._timingAdvance=e,this}},{key:"withSignalStrength",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalStrength usage must be String type ");return this._signalStrength=e,this}},{key:"withSignalStrengthMax",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalStrengthMax usage must be String type ");return this._signalStrengthMax=e,this}},{key:"withsignalStrengthMin",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalStrengthMin usage must be String type ");return this._signalStrengthMin=e,this}},{key:"withsignalQuality",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalQuality usage must be String type ");return this._signalQuality=e,this}},{key:"withsignalQualityMax",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalQualityMax usage must be String type ");return this._signalQualityMax=e,this}},{key:"withsignalQualityMin",value:function(e){if("string"!=typeof e)throw new Error("Parameter signalQualityMin usage must be String type ");return this._signalQualityMin=e,this}},{key:"composeElement",value:function(){return{mr:this._mr,apn:this._apn,bcch:this._bcch,cgi:this._cgi,cellId:this._cellId,lac:this._lac,ratType:this._ratType,plmn:this._plmn,timingAdvance:this._timingAdvance,signalStrength:this._signalStrength,signalStrengthMax:this._signalStrengthMax,signalStrengthMin:this._signalStrengthMin,signalQuality:this._signalQuality,signalQualityMax:this._signalQualityMax,signalQualityMin:this._signalQualityMin}}}]),e}();r.default=i,t.exports=r.default},{}],188:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=e("./enum/POWER_SUPPLY_SOURCE_ENUM"),a=e("./enum/BATTERY_CHARGE_STATUS_ENUM"),o=e("./enum/BATTERY_CHARGE_LEVEL_STATUS_ENUM"),s=e("./enum/LEVEL_TREND_ENUM"),u=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._source=void 0,this._status=void 0,this._trend=void 0,this._batteryStatus=void 0,this._percentage=void 0,this._outageDate=void 0,this._outageDuration=void 0}return n(e,[{key:"withSource",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter source must be string type and cannot be empty");return this._source=this._checkValues(e,i.POWER_SUPPLY_SOURCE_ENUM),this}},{key:"withStatus",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter status must be string type and cannot be empty");return this._status=this._checkValues(e,a.BATTERY_CHARGE_STATUS_ENUM),this}},{key:"withBatteryChargeLevelTrend",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter trend must be string type and cannot be empty");return this._trend=this._checkValues(e,s.LEVEL_TREND_ENUM),this}},{key:"withBatteryChargeLevelStatus",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter Battery Charge Level Status must be string type and cannot be empty");return this._batteryStatus=this._checkValues(e,o.BATTERY_CHARGE_LEVEL_STATUS_ENUM),this}},{key:"withBatteryChargeLevelPercentage",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter percentage must be string type and cannot be empty");return this._percentage=e,this}},{key:"withOutageDate",value:function(e){if(!this._isValidDate(e))throw new Error("The outageDate parameter has a wrong format. Example of rigth format is 2015-07-16T19:20:30+01:00");return this._outageDate=e,this}},{key:"withOutageDuration",value:function(e){if("number"!=typeof e||0===e.length)throw new Error("Parameter duration must be number type and cannot be empty");return this._outageDuration=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"_isValidDate",value:function(e){if(""===e||null===e)return!1;var t=e.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\+(\d{2}):(\d{2})/);if(null===t||"object"!=typeof t)return!1;if("object"!=typeof t&&null!==t&&3!==t.size)return!1;var r=!0,n=(new Date).getFullYear();return(t[1].length<4||t[1]<1999||t[1]>n)&&(r=!1),(t[2].length<2||t[2]<1||t[2]>12)&&(r=!1),(t[3].length<2||t[3]<1||t[3]>31)&&(r=!1),r}},{key:"composeElement",value:function(){var e={source:this._source,status:this._status,batteryChargeLevel:{trend:this._trend,status:this._batteryStatus,percentage:this._percentage}};return void 0===this._outageDate&&void 0===this._outageDuration||(e.outage={timestamp:this._outageDate,duration:this._outageDuration}),e}}]),e}();r.default=u,t.exports=r.default},{"./enum/BATTERY_CHARGE_LEVEL_STATUS_ENUM":196,"./enum/BATTERY_CHARGE_STATUS_ENUM":197,"./enum/LEVEL_TREND_ENUM":198,"./enum/POWER_SUPPLY_SOURCE_ENUM":199}],189:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=((i=a)&&i.__esModule,e("./enum/SOFTWARE_TYPE_ENUM")),s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._name=void 0,this._type=void 0,this._version=void 0,this._date=void 0}return n(e,[{key:"withName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be a string and cannot be empty");return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter type must be a string and cannot be empty");return this._type=this._checkValues(e,o.SOFTWARE_TYPE_ENUM),this}},{key:"withVersion",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter version must be a string and cannot be empty");return this._version=e,this}},{key:"withDate",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter date must be a string and cannot be empty");return this._date=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){return{name:this._name,type:this._type,version:this._version,date:this._date}}}]),e}();r.default=s,t.exports=r.default},{"./enum/SOFTWARE_TYPE_ENUM":200,q:120}],190:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};var a,o=e("./Usage"),s=function(e){function t(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this),this._unit=void 0,this._total=void 0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withUnit",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unit must be String type and cannot be empty");return this._unit=e,this}},{key:"withTotal",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter total must be string type and cannot be empty");return this._total=e,this}},{key:"composeElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"composeElement",this).call(this);return{unit:this._unit,total:this._total,usage:e}}}]),t}(((a=o)&&a.__esModule?a:{default:a}).default);r.default=s,t.exports=r.default},{"./Usage":193}],191:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./Hardware"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._id=void 0,this._name=void 0,this._type=void 0,this._hardware=void 0}return n(e,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter id must be a string and cannot be empty");return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be a string and cannot be empty");return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter type must be a string and cannot be empty");return this._type=e,this}},{key:"withHardware",value:function(e){if(!(e instanceof o.default))throw new Error("Parameter hardware must be hardware type");return this._hardware=e,this}},{key:"composeElement",value:function(){var e={id:this._id,name:this._name,type:this._type};return void 0!==this._hardware&&(e.hardware=this._hardware.composeElement()),e}}]),e}();r.default=s,t.exports=r.default},{"./Hardware":186}],192:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=e("./enum/ADDRESS_TYPE_ENUM"),a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._id=void 0,this._name=void 0,this._type=void 0,this._description=void 0,this._operator=void 0,this._imsi=void 0,this._msisdn=void 0,this._addressType=void 0,this._addressValue=void 0,this._addressApn=void 0}return n(e,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter id must be a string and cannot be empty");return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter name must be a string and cannot be empty");return this._name=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter type must be a string and cannot be empty");return this._type=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter description must be a string and cannot be empty");return this._description=e,this}},{key:"withOperator",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter operator must be a string and cannot be empty");return this._operator=e,this}},{key:"withImsi",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter imsi must be a string and cannot be empty");return this._imsi=e,this}},{key:"withMsisdn",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter msisdn must be a string and cannot be empty");return this._msisdn=e,this}},{key:"withAddressType",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter addressType must be a string and cannot be empty");return this._addressType=this._checkValues(e,i.ADDRESS_TYPE_ENUM),this}},{key:"withAddressValue",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter addressValue must be a string and cannot be empty");return this._addressValue=e,this}},{key:"withAddressApn",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter addressApn must be a string and cannot be empty");return this._addressApn=e,this}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"composeElement",value:function(){return{id:this._id,name:this._name,type:this._type,description:this._description,operator:this._operator,imsi:this._imsi,msisdn:this._msisdn,address:{type:this._addressType,value:this._addressValue,apn:this._addressApn}}}}]),e}();r.default=a,t.exports=r.default},{"./enum/ADDRESS_TYPE_ENUM":194}],193:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._usageUnit=void 0,this._current=void 0,this._average=void 0,this._maximum=void 0,this._minimum=void 0}return n(e,[{key:"withUsageUnit",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter unit usage must be String type and cannot be empty");return this._usageUnit=e,this}},{key:"withCurrent",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter current must be string type and cannot be empty");return this._current=e,this}},{key:"withAverage",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter average must be string type and cannot be empty");return this._average=e,this}},{key:"withMaximum",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter maximum must be string type and cannot be empty");return this._maximum=e,this}},{key:"withMinimum",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter minimum must be string type and cannot be empty");return this._minimum=e,this}},{key:"composeElement",value:function(){return{unit:this._usageUnit,current:this._current,average:this._average,maximum:this._maximum,minimum:this._minimum}}}]),e}();r.default=i,t.exports=r.default},{}],194:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ADDRESS_TYPE_ENUM=["IPV4","IPV6","MAC"]},{}],195:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ANTENNA_STATUS_ENUM=["OK","SHORT_CIRCUIT","OPEN","UNKONW"]},{}],196:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.BATTERY_CHARGE_LEVEL_STATUS_ENUM=["CHARGING","CHARGED"]},{}],197:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.BATTERY_CHARGE_STATUS_ENUM=["NORMAL","LOW_CRITICAL","LOW_WARNING","MEDIUM","COMPLETE"]},{}],198:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.LEVEL_TREND_ENUM=["RISING","DECREASING","FLAT","EMPTY"]},{}],199:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.POWER_SUPPLY_SOURCE_ENUM=["NETWORK_PLUGGED","DIESEL_GENERATOR","SOLAR","BATTERY","OTHER"]},{}],200:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.SOFTWARE_TYPE_ENUM=["FIRMWARE","SOFTWARE"]},{}],201:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.TEMPERATURE_STATUS_ENUM=["NORMAL","LOW_CRITICAL","LOW_WARNING","HIGH_WARNING","HIGH_CRITICAL"]},{}],202:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.CONNECTOR_FUNCTION_OPERATIONAL_STATUS=["DISABLED","PRODUCTION","TEST"];r.CONNECTOR_FUNCTION_TYPES=["COLLECTION","REQUEST","RESPONSE"];r.CONNECTOR_FUNCTION_PAYLOAD_TYPES=["TEXT","JSON","BINARY"];r.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS=["https://","wss://","mqtts://","snmps://","dlms://","icmp://"]},{}],203:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}a(e("../../InternalOpenGateAPI"));var o=a(e("../../provision/BaseProvision")),s=e("../_CONNECTOR_FUNCTIONS_ENUMS"),u=function(e){function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog",void 0,["name","operationalStatus","type","cloneable","javascript","payloadType"]),r&&this.withIdentifier(r),n)for(var a=Object.keys(n),o=0;o<a.length;o++){var s=a[o],u=n[s];if(null!=u)this["with"+(s.charAt(0).toUpperCase()+s.slice(1))](u)}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withOperationalStatus",value:function(e){if("string"!=typeof e||!this._checkValues(e,s.CONNECTOR_FUNCTION_OPERATIONAL_STATUS))throw new Error("Parameter operational status must be a string and must be one of these values: "+s.CONNECTOR_FUNCTION_OPERATIONAL_STATUS);return this._operationalStatus=e,this}},{key:"withOperationName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter operation name must be a string, cannot be empty and has a maximum length of 50");return this._operationName=e,this}},{key:"withType",value:function(e){if("string"!=typeof e||!this._checkValues(e,s.CONNECTOR_FUNCTION_TYPES))throw new Error("Parameter type must be a string and must be one of these values: "+s.CONNECTOR_FUNCTION_TYPES);return this._type=e,this}},{key:"withCloneable",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter cloneable must be a boolean");return this._cloneable=e,this}},{key:"withNorthCriterias",value:function(e){if(!(e instanceof Array))throw new Error({message:"Parameter northCriterias requires an array",parameter:"northCriterias"});return this._northCriterias=e,this}},{key:"addNorthCriteria",value:function(e){if("object"!=typeof e||!e.path||"string"!=typeof e.path||!e.value||"object"!=typeof e.value)throw new Error({message:"Parameter northCriteria requires path and value",parameter:"northCriteria"});return this._northCriterias||(this._northCriterias=[]),this._northCriterias.push(e),this}},{key:"withSouthCriterias",value:function(e){var t=this;if(!(e instanceof Array))throw new Error({message:"Parameter southCriterias requires an array",parameter:"southCriterias"});return e.forEach((function(e){try{t.addSouthCriteria(e)}catch(e){throw t._southCriterias=null,e}})),this}},{key:"addSouthCriteria",value:function(e){if("string"!=typeof e)throw new Error("southCriteria must be a string");return this._southCriterias||(this._southCriterias=[]),this._southCriterias.push(e),this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter javascript must be a string");return this._javascript=e,this}},{key:"withPayloadType",value:function(e){if("string"!=typeof e||!this._checkValues(e,s.CONNECTOR_FUNCTION_PAYLOAD_TYPES))throw new Error("Parameter payload type must be a string and must be one of these values: "+s.CONNECTOR_FUNCTION_PAYLOAD_TYPES);return this._payloadType=e,this}},{key:"_composeElement",value:function(){return{name:this._name,description:this._description?this._description:void 0,operationalStatus:this._operationalStatus,operationName:"REQUEST"===this._type?this._operationName:void 0,type:this._type,cloneable:this._cloneable,northCriterias:this._northCriterias,southCriterias:this._southCriterias,javascript:this._javascript,payloadType:this._payloadType}}},{key:"_checkRequiredParameters",value:function(e){if(e&&void 0===this._identifier)throw new Error({message:"Parameter identifier must be defined",parameter:"identifier"});try{i(Object.getPrototypeOf(t.prototype),"_checkRequiredParameters",this).call(this)}catch(e){throw e}switch(this._type){case"REQUEST":if(void 0===this._operationName||void 0===this._northCriterias||0===this._northCriterias.length)throw new Error("Parameters operationName and northCriteria must be defined when type REQUEST");if("JSON"!==this._payloadType)throw new Error("Parameter payload type must be JSON when type REQUEST");break;case"COLLECTION":case"RESPONSE":if(void 0===this._southCriterias||0===this._southCriterias.length)throw new Error("Parameters southCriteria must be defined when type COLLECTION or RESPONSE")}}},{key:"_buildURL",value:function(){if(void 0===this._identifier)throw new Error({message:"Parameter identifier must be defined",parameter:"identifier"});return"connectorFunctions/"+this._resource+"/"+this._identifier}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost("connectorFunctions/"+this._resource,this._composeElement())}},{key:"_composeUpdateElement",value:function(){return this._checkRequiredParameters(!0),this._composeElement()}}]),t}(o.default);r.default=u,t.exports=r.default},{"../../InternalOpenGateAPI":158,"../../provision/BaseProvision":261,"../_CONNECTOR_FUNCTIONS_ENUMS":202}],204:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/catalog","connectorFunctions","Connector functions not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getConnectorFunctionsCatalog",value:function(){return this._execute(!0)}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../../GenericFinder":157}],205:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/catalog","connectorFunctions","Connector functions not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByConnectorFunctionsId",value:function(e){return this._withId(e),this._execute(!0)}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../../GenericFinder":157}],206:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../provision/BaseProvision")),o=e("../_CONNECTOR_FUNCTIONS_ENUMS"),s=i(e("q")),u=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),i&&this.withIdentifier(i),a&&(a.name&&this.withName(a.name),a.operationName&&this.withOperationName(a.operationName),a.operationalStatus&&this.withOperationalStatus(a.operationalStatus),a.type&&this.withType(a.type),a.payloadType&&this.withPayloadType(a.payloadType),a.description&&this.withDescription(a.description),a.northCriterias&&this.withNorthCriterias(a.northCriterias),a.southCriterias&&this.withSouthCriterias(a.southCriterias),a.javascript&&this.withJavascript(a.javascript))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withChannel",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter channel must be a string, cannot be empty and has a maximum length of 50");return this._channel=e,this}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withOperationName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter operation name must be a string, cannot be empty and has a maximum length of 50");return this._operationName=e,this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter javascript must be a string");return this._javascript=e,this}},{key:"withNorthCriterias",value:function(e){if(!(e instanceof Array)||0===e.length)throw new Error("Parameter north criteria must be an array and cannot be empty");return this._northCriterias=e,this}},{key:"withSouthCriterias",value:function(e){var t=this;if(!(e instanceof Array)||0===e.length)throw new Error("Parameter south criteria must be an array and cannot be empty");return e.forEach((function(e){try{t.addSouthCriteria(e)}catch(e){throw t._southCriterias=null,e}})),this}},{key:"addSouthCriteria",value:function(e){if("string"!=typeof e)throw new Error("South criteria must be a string");return this._southCriterias||(this._southCriterias=[]),this._southCriterias.push(e),this}},{key:"withType",value:function(e){if("string"!=typeof e||!this._checkValues(e,o.CONNECTOR_FUNCTION_TYPES))throw new Error("Parameter type must be a string and must be one of these values: "+o.CONNECTOR_FUNCTION_TYPES);return this._type=e,this}},{key:"withPayloadType",value:function(e){if("string"!=typeof e||!this._checkValues(e,o.CONNECTOR_FUNCTION_PAYLOAD_TYPES))throw new Error("Parameter payload type must be a string and must be one of these values: "+o.CONNECTOR_FUNCTION_PAYLOAD_TYPES);return this._payloadType=e,this}},{key:"withOperationalStatus",value:function(e){if("string"!=typeof e||!this._checkValues(e,o.CONNECTOR_FUNCTION_OPERATIONAL_STATUS))throw new Error("Parameter operational status must be a string and must be one of these values: "+o.CONNECTOR_FUNCTION_OPERATIONAL_STATUS);return this._operationalStatus=e,this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,operationalStatus:this._operationalStatus,operationName:"COLLECTION"!==this._type?this._operationName:void 0,type:this._type,payloadType:this._payloadType,javascript:this._javascript,description:this._description?this._description:void 0,northCriterias:"REQUEST"===this._type?this._northCriterias:void 0,southCriterias:"REQUEST"!==this._type?this._southCriterias:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._operationalStatus||void 0===this._type||void 0===this._payloadType||void 0===this._javascript)throw new Error("Parameters organization, channel, operational status, type, payloadType, javascript and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._operationalStatus||void 0===this._type||void 0===this._payloadType||void 0===this._javascript)throw new Error("Parameters organization, channel, operational status, type, payloadType, javascript and name must be defined");if("REQUEST"===this._type&&"JSON"!==this._payloadType)throw new Error("Parameter payload type must be JSON when type REQUEST")}},{key:"_buildURL",value:function(){return"connectorFunctions/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=s.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../provision/BaseProvision":261,"../_CONNECTOR_FUNCTIONS_ENUMS":202,q:120}],207:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/organizations","connectorFunctions","Connector functions not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndChannel",value:function(e,t){return this._organization=e,this._channel=t,this._execute()}},{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+(this._name?"/"+this._name:"")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../../GenericFinder":157}],208:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../GenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=e("../_CONNECTOR_FUNCTIONS_ENUMS"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="doc/jsApi/javascript",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/internal",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/client",this._execute()}},{key:"_execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){204===t.statusCode?e.reject({error:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"getSouthCriteriasProtocols",value:function(){return u.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS}},{key:"getPayloadTypes",value:function(){return u.CONNECTOR_FUNCTION_PAYLOAD_TYPES}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../GenericFinder":157,"../_CONNECTOR_FUNCTIONS_ENUMS":202,"http-status-codes":76,q:120}],209:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"datasets/provision/organizations","datasets")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndDatasetId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],210:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("../util/formats/check_types")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","columns","identifierColumn"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){var e="datasets/provision/organizations/"+this._organization+"/"+this._identifier;return this._onlyPlan&&(e+="?onlyPlan=true"),e}},{key:"withOrganization",value:function(e){return o.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return o.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return o.default._checkString(e,"name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return o.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withDescription",value:function(e){return e&&o.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return o.default._checkArray(e,"columns"),this._columns=e,this}},{key:"_composeElement",value:function(){return this._resource="datasets/provision/organizations/"+this._organization,{name:this._name,description:this._description,type:this._type,identifierColumn:this._identifierColumn,columns:this._columns}}},{key:"_composeUpdateElement",value:function(){return{name:this._name,description:this._description,type:this._type,identifierColumn:this._identifierColumn,columns:this._columns}}},{key:"onlyPlan",value:function(){return this._onlyPlan=!0,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,"../util/formats/check_types":373}],211:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}a(e("q"));var o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains"),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_NAME_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_DESCRIPTION_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withParentDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_DOMAIN_PARAMETER_MAX_LENGTH_50");return this._parentDomain=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name)throw new Error({message:"OGAPI_DEFINED_PARAMETER",parameter:"name"});return{domain:{name:this._name||void 0,description:this._description||void 0,parentDomain:this._parentDomain||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._name}},{key:"_composeUpdateElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.domain.name,e}}]),t}(a(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],212:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","domain","Domain not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._setUrlParameters({hierarchy:this._hierarchy}),this._baseUrl+"/"+this._name}},{key:"findByName",value:function(e){return this._name=e,this._hierarchy="false",this._execute()}},{key:"findByNameWithHierarchy",value:function(e){return this._name=e,this._hierarchy="true",this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],213:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./EntityFinder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"device","Device not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./EntityFinder":214}],214:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations",r||"entity",n||"Entity not found"),this._entitySource=i||"entities",this._flattened=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._entitySource+"/"+this._id}},{key:"findByOrganizationAndId",value:function(e,t,r){return this._organization=e,this._id=t,this._setUrlParameters({flattened:!!r}),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],215:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./EntityFinder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscriber","Subscriber not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./EntityFinder":214}],216:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./EntityFinder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscription","Subscription not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./EntityFinder":214}],217:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./EntityFinder"),a=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ticket","Ticket not found","tickets")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./EntityFinder":214}],218:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("q")),s=a(e("../provision/BaseProvision")),u=a(e("../util/formats/check_types")),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/geocluster",void 0,"identifier")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return"provision/geocluster/"+this._identifier+"/clustering"}},{key:"withIdentifier",value:function(e){return u.default._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"_composeElement",value:function(){this._resource="provision/geocluster/"+this._identifier+"/clustering"}},{key:"_composeElementUpdate",value:function(){return i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this)}},{key:"update",value:function(){var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeElementUpdate(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(s.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":261,"../util/formats/check_types":373,q:120}],219:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"geocluster","geocluster","Geocluster not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findById",value:function(e){return this._id=e,this._setUrlParameters(),this._execute()}},{key:"findAll",value:function(){return this._id=void 0,this._setUrlParameters(),this._execute()}},{key:"findFeatures",value:function(e,t){var r=t.zoom,n=t.topRight,i=t.bottomLeft;return this._id=e,this._setUrlParameters({zoom:r,topRight:n,bottomLeft:i}),this._execute()}},{key:"_composeUrl",value:function(){return this._id?this._getUrlParameters()?this._baseUrl+"/"+this._id+"/view":this._baseUrl+"/"+this._id:this._baseUrl}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],220:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./Datastream"),o=((i=a)&&i.__esModule,function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._isValidString(r,"identifier",50),this._identifier=r,this._datastreams=n||[]}return n(e,[{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"addDatastream",value:function(e){if(!e||"object"!=typeof e)throw new Error("Datastream must be an object");return this._datastreams.push(e),this}},{key:"addDatastreams",value:function(e){var t=this;if(!Array.isArray(e))throw new Error("Datastreams must be an array");var r=[];if(e.forEach((function(e,n){try{t.addDatastream(e)}catch(e){r.push("Error on datastream with index ["+n+"]: "+e)}})),r.length>0)throw new Error("Error adding datastreams: "+JSON.stringify(r));return this}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Category")}},{key:"_composeElement",value:function(){if(!this._identifier)throw new Error("identifier is required on Category");return{identifier:this._identifier,name:this._name?this._name:void 0,datastreams:this._datastreams}}}]),e}());r.default=o,t.exports=r.default},{"./Datastream":221}],221:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("ajv"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,[{key:"withId",value:function(e){return this._isValidString(e,"id",100),this._id=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",500),this._description=e,this}},{key:"withUnit",value:function(e,t,r){return this._isValidString(e,"type",500),this._isValidString(t,"label",500),this._isValidString(r,"symbol",10),this._unit={type:e,label:t,symbol:r},this}},{key:"withPeriod",value:function(e){return this._isValidString(e,"period",500),this._period=e,this}},{key:"withSchema",value:function(e){if(!e||"object"!=typeof e)throw new Error("Schema must be an object or a string on Datastream");return this._schema=e,this}},{key:"withTags",value:function(e){if(e){if(!Array.isArray(e))throw new Error("Tags must be an array on Datastream");this._tags=e}return this}},{key:"addQrating",value:function(e){if(!e||"object"!=typeof e)throw new Error("Qrating must be an instance of object on Datastream");return this._qrating=e,this}},{key:"withStorage",value:function(e,t){if(this._isValidString(e,"period",500),!t||"number"!=typeof t)throw new Error("Total must be a number on Datastream");return this._storage={total:t,period:e},this}},{key:"withAccess",value:function(e){if(this._isValidString(e,"access",50),!e)throw new Error("Access must be a valid string");return this._access=e,this}},{key:"build",value:function(){if(!this._id)throw new Error("Id is required on Datastream");if(!this._name)throw new Error("Name is required on Datastream");if(!this._unit)throw new Error("Unit is required on Datastream");if(!this._period)throw new Error("Period is required on Datastream");if(!this._schema)throw new Error("Schema is required on Datastream");try{(new o.default).compile(this._schema)}catch(e){throw new Error("Schema not valid: "+e)}return{identifier:this._id,name:this._name,description:this._description,period:this._period,tags:this._tags,unit:this._unit,schema:this._schema,qrating:this._qrating,storage:this._storage,hardwareIds:this._hardwares,access:this._access}}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Datastream")}}]),e}();r.default=s,t.exports=r.default},{ajv:2}],222:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,[{key:"withMinRequired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minRequired={label:e,value:t},this}},{key:"withMinDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minDesired={label:e,value:t},this}},{key:"withIdeal",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._ideal={label:e,value:t},this}},{key:"withMaxDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxDesired={label:e,value:t},this}},{key:"withMaxAllowed",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxAllowed={label:e,value:t},this}},{key:"withMaxScore",value:function(e){return this._isValidNumber(e,"maxScore"),this._maxScore=e,this}},{key:"withCumulativePeriodDivisor",value:function(e){return e&&this._isValidNumber(e,"cumulativePeriodDivisor"),this._cumulativePeriodDivisor=e,this}},{key:"withConversionMatrix",value:function(e){if(e&&"object"!=typeof e)throw new Error("ConversionMatrix must be an object on Qrating");return this._conversionMatrix=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"build",value:function(){if(!this._version)throw new Error("Version is required on Qrating");if(!this._minRequired)throw new Error("MinRequired is required on Qrating");if(!this._minDesired)throw new Error("MinDesired is required on Qrating");if(!this._ideal)throw new Error("Ideal is required on Qrating");if(!this._maxDesired)throw new Error("MaxDesired is required on Qrating");if(!this._maxAllowed)throw new Error("MaxAllowed is required on Qrating");if(!this._maxScore)throw new Error("MaxScore is required on Qrating");return{min_required:this._minRequired,min_desired:this._minDesired,ideal:this._ideal,max_desired:this._minDesired,max_allowed:this._maxAllowed,max_score:this._maxScore,cumulative_period_divisor:this._cumulativePeriodDivisor,conversion_matrix:this._conversionMatrix,version:this._version}}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Qrating")}},{key:"_isValidNumber",value:function(e,t){if("number"!=typeof e)throw new Error("Parameter "+t+" must be a number, cannot be empty on Qrating")}}]),e}();r.default=i,t.exports=r.default},{}],223:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../provision/BaseProvision")),o=i(e("../catalog/Category")),s="/organizations";r.PRE_RESOURCE=s;var u="/datamodels";r.DATAMODELS_RESOURCE=u;var c=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s),this._isValidString(r,"organization",50),this._organization=r,this._categories=[],this._resourceType=[],this._resource=this._resource+"/"+this._organization+u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){return this._isValidString(e,"identifier",100),this._identifier=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",100),this._description=e,this}},{key:"addAllowedResourceType",value:function(e){return e&&this._isValidString(e,"resourceType",100),this._resourceType.push(e),this}},{key:"addCategory",value:function(e,t){var r=e.identifier;if(!r||this._isValidString(r,"category",100))throw new Error("Category identifier is required");this._categories.forEach((function(e,t){if(r===e.identifier)throw new Error("Category "+r+" already exists.")}));var n=new o.default(this._ogapi,r);return e.name&&n.withName(e.name),t&&t.length>0&&n.addDatastreams(t),this._categories.push(n._composeElement()),this}},{key:"addDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1;if(this._categories.forEach((function(t,n){t.identifier===e&&(r=n)})),-1===r)throw new Error("Category "+e+" not exists for this datamodel. Use addCategory instead.");return this._categories[r].datastreams?this._categories[r].datastreams.push(t):this._categories[r].datastreams=[t],this}},{key:"_composeElement",value:function(){if(!this._name)throw new Error("name is required on IoTDatamodel");if(!this._version)throw new Error("version is required on IoTDatamodel");if(!this._resourceType)throw new Error("allowedResourceTypes is required on IoTDatamodel");return{identifier:this._identifier,name:this._name,version:this._version,description:this._description,allowedResourceTypes:this._resourceType,categories:this._categories.length>0?this._categories:void 0}}},{key:"_buildURL",value:function(){return this._resource}},{key:"update",value:function(){throw new Error("Update not supported on this builder. Use datamodelsHelper instead.")}},{key:"delete",value:function(){throw new Error("Delete not supported on this builder. Use datamodelsHelper instead.")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+"on IoTDatamodel")}}]),t}(a.default);r.default=c},{"../../provision/BaseProvision":261,"../catalog/Category":220}],224:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../../ProvisionGenericFinder"),o=(i=a)&&i.__esModule?i:{default:i},s="/datamodels/";r.DATAMODEL_RESOURCE=s;var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/","datamodels","Datamodel not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+this._organization+s+this._id}},{key:"findByOrganizationAndId",value:function(e,t){return this._organization=e,this._id=t,this._execute()}}]),t}(o.default);r.default=u},{"../../ProvisionGenericFinder":159}],225:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../provision/BaseProvision")),o=i(e("../catalog/Category")),s=(i(e("../catalog/Datastream")),"/organizations");r.PRE_RESOURCE=s;var u="/datamodels";r.POST_RESOURCE=u;var c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s),this._isValidString(r,"organization",50),this._organization=r,this._datamodel=n,this._name=this._datamodel.name,this._isValidString(this._name,"name of object datamodel",100),this._version=this._datamodel.version,this._isValidString(this._version,"version of object datamodel",100),this._description=this._datamodel.description,this._categories=this._datamodel.categories,this._identifier=this._datamodel.identifier}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){return this._isValidString(e,"identifier",100),this._identifier=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",100),this._description=e,this}},{key:"addCategory",value:function(e,t){this._categories?this._categories.forEach((function(t,r){if(t.identifier===e.identifier)throw new Error("Category "+e.identifier+" already exists.")})):this._categories=[];var r=new o.default(this._ogapi,e.identifier);return e.name&&r.withName(e.name),t&&t.length>0&&r.addDatastreams(t),this._categories.push(r._composeElement()),this}},{key:"addDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1;if(this._categories.forEach((function(t,n){t.identifier===e&&(r=n)})),-1===r)throw new Error("Category "+e+" not exists for this datamodel. Use addCategory instead.");return this._categories[r].datastreams?this._categories[r].datastreams.push(t):this._categories[r].datastreams=[t],this}},{key:"removeCategory",value:function(e){this._isValidString(e,"category",100);var t=-1;if(this._categories.forEach((function(r,n){r.identifier===e&&(t=n)})),-1===t)throw new Error("Category "+e+" not exists for this datamodel");return this._categories.splice(t,1),this}},{key:"removeDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1,n=-1;if(this._categories.forEach((function(i,a){i.identifier===e&&(r=a,i.datastreams.forEach((function(e,r){e.identifier===t&&(n=r)})))})),-1===r)throw new Error("Category "+e+" not exists for this datamodel");if(-1===n)throw new Error("Datastream "+t+" not exists for this datamodel and category "+e);this._categories[r].datastreams.splice(n,1);var i=new o.default(this._ogapi,e,this._categories[r].datastreams);return this._categories[r].name&&i.withName(this._categories[r].name),this._categories.splice(r,1),this._categories.push(i._composeElement()),this}},{key:"updateCategory",value:function(e,t){this._isValidString(e,"old category",100);var r=-1,n=-1;if(this._categories.forEach((function(i,a){switch(i.identifier){case e:r=a;break;case t.identifier:n=a}})),-1!=n)throw new Error("New category "+t.identifier+" already exists.");if(-1===r)throw new Error("Category "+e+" not exists for this datamodel.");return this._categories[r].name=t.name,this}},{key:"updateDatastream",value:function(e,t,r){if(this._isValidString(e,"category",100),this._isValidString(t,"id datastream",100),!r||"object"!=typeof r)throw new Error("Datastream must be an object");var n=-1,i=-1;if(this._categories.forEach((function(r,a){r.identifier===e&&(n=a,r.datastreams.forEach((function(e,r){e.identifier===t&&(i=r)})))})),-1===n)throw new Error("Category "+e+" not exists for this datamodel. Create it, use method addCategory instead");if(-1===i)throw new Error("Datastream "+t+" not exists for this datamodel and category "+e+". Create it, use method addDatastream instead.");return this._categories[n].datastreams[i]=r,this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,version:this._version,description:this._description,categories:this._categories}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._organization+u+"/"+this._identifier}},{key:"create",value:function(){throw new Error("Create not supported on this builder. Use DatamodelsBuilder instead.")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on DatamodelsHelper")}}]),t}(a.default);r.default=c},{"../../provision/BaseProvision":261,"../catalog/Category":220,"../catalog/Datastream":221}],226:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("./ManufacturerMedia")),s=i(e("./Model")),u="/manufacturers";r.MANUFACTURERS_RESOURCE=u;var c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,u,void 0,["name"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._manufUrl=e,this}},{key:"withFax",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._fax=e,this}},{key:"withTelephone",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._telephone=e,this}},{key:"withAddress",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._address=e,this}},{key:"withEmail",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._email=e,this}},{key:"mediaBuilder",value:function(){if(!this._identifier)throw new Error("Required manufacturer identifier");return new o.default(this._ogapi,this._identifier)}},{key:"modelBuilder",value:function(){if(!this._identifier)throw new Error("Required manufacturer identifier and name");return new s.default(this._ogapi,this._identifier)}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{name:this._name||void 0,description:this._description||void 0,telephone:this._telephone||void 0,address:this._address||void 0,fax:this._fax||void 0,url:this._manufUrl||void 0,notes:this._notes||void 0,email:this._email||void 0}}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_buildURL",value:function(){return this._resource+(this._identifier?"/"+this._identifier:"")}}]),t}(a.default);r.default=c},{"../provision/BaseProvision":261,"./ManufacturerMedia":228,"./Model":229}],227:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"manufacturers","manufacturer","Manufacturer not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+(this._identifier?"/"+this._identifier+(this._media?"/media"+(this._mediaIdentifier?"/"+this._mediaIdentifier+"?format=raw":""):""):"")}},{key:"findAll",value:function(){return this._execute()}},{key:"findById",value:function(e){return this._identifier=e,this._execute()}},{key:"findMedias",value:function(e){return this._media=!0,this._identifier=e,this._execute()}},{key:"findMediaById",value:function(e,t){return this._media=!0,this._identifier=e,this._mediaIdentifier=t,this._download()}},{key:"_download",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!0).then((function(t){204===t.statusCode?e.reject({data:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=u,t.exports=r.default},{"../ProvisionGenericFinder":159,"http-status-codes":76,q:120}],228:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/manufacturers/"+r+"/media",void 0,["identifier","name"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withFile",value:function(e){if(!e)throw new Error("OGAPI_NOT_EMPTY_PARAMETER");return this._file=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{media:{id:this._identifier||void 0,name:this._name||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._identifier}},{key:"update",value:function(){throw new Exception("OGAPI_METHOD_NOT_SUPPORTED")}},{key:"create",value:function(e){var t=void 0;if(e)if("string"!=typeof e){t=new FormData;var r=new Blob([this._composeElement()],{type:"application/json"});t.append("json",r),e&&t.append("file",e)}else(t={}).json=JSON.stringify(this._composeElement()),e&&(t.hardwareMedia=e);else{t=new FormData;r=new Blob([JSON.stringify(this._composeElement())],{type:"application/octet-stream"});t.append("json",r),t.append("file",this._file)}var n={};null!=this._progressEvent&&(n={progress:this._progressEvent});var i=a.default.defer(),o=i.promise;return this._ogapi.Napi.post_multipart(this._resource,t,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){201===e.statusCode?i.resolve({location:e.header.location,statusCode:e.statusCode}):i.reject({errors:[{code:e.statusCode,message:"OGAPI_FILE_NOT_CREATE"}],statusCode:e.statusCode})})).catch((function(e){i.reject(e)})),o}}]),t}(i(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],229:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("./ModelMedia")),s=e("./Manufacturer"),u="/models";r.MODELS_RESOURCE=u;var c=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s.MANUFACTURERS_RESOURCE,void 0,["name"]),this._isValidString(r,"manufacturer",50),this._resource=this._resource+"/"+r+u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._modelUrl=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._version=e,this}},{key:"mediaBuilder",value:function(){if(!this._manufacturer||!this._identifier)throw new Error("Required manufacturer and model identifier");return new o.default(this._ogapi,this._manufacturer,this._identifier)}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{name:this._name||void 0,description:this._description||void 0,version:this._version||void 0,notes:this._notes||void 0,url:this._modelUrl||void 0}}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_buildURL",value:function(){return this._resource+(this._identifier?"/"+this._identifier:"")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r)}}]),t}(a.default);r.default=c},{"../provision/BaseProvision":261,"./Manufacturer":226,"./ModelMedia":231}],230:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=e("./Model"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"manufacturers",void 0,"Model not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._manufacturer+u.MODELS_RESOURCE+(this._identifier?"/"+this._identifier+(this._media?"/media"+(this._mediaIdentifier?"/"+this._mediaIdentifier+"?format=raw":""):""):"")}},{key:"findByManufacturer",value:function(e){return this._manufacturer=e,this._execute()}},{key:"findByManufacturerAndId",value:function(e,t){return this._manufacturer=e,this._identifier=t,this._execute()}},{key:"findMediasByManufacturerAndModel",value:function(e,t){return this._media=!0,this._manufacturer=e,this._identifier=t,this._execute()}},{key:"findMediaByManufacturerAndModelAndId",value:function(e,t,r){return this._media=!0,this._manufacturer=e,this._identifier=t,this._mediaIdentifier=r,this._download()}},{key:"_download",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!0).then((function(t){204===t.statusCode?e.reject({data:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":159,"./Model":229,"http-status-codes":76,q:120}],231:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=i(e("../provision/BaseProvision")),s=e("./Manufacturer"),u=e("./Model"),c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s.MANUFACTURERS_RESOURCE+"/"+r+u.MODELS_RESOURCE+"/"+n+"/media",void 0,["identifier"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withFileName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._fileName=e,this}},{key:"withFile",value:function(e){if(!e)throw new Error("OGAPI_NOT_EMPTY_PARAMETER");return this._file=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{media:{id:this._identifier||void 0,name:this._name||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._identifier}},{key:"update",value:function(){throw new Exception("OGAPI_METHOD_NOT_SUPPORTED")}},{key:"create",value:function(e){var t=void 0;if(e)if("string"!=typeof e){t=new FormData;var r=new Blob([this._composeElement()],{type:"application/json"});t.append("json",r),e&&t.append("file",e)}else(t={}).json=JSON.stringify(this._composeElement()),e&&(t.hardwareMedia=e);else{t=new FormData;r=new Blob([JSON.stringify(this._composeElement())],{type:"application/octet-stream"});t.append("json",r),t.append("file",this._file)}var n={};null!=this._progressEvent&&(n={progress:this._progressEvent});var i=a.default.defer(),o=i.promise;return this._ogapi.Napi.post_multipart(this._resource,t,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){201===e.statusCode?i.resolve({location:e.header.location,statusCode:e.statusCode}):i.reject({errors:[{code:e.statusCode,message:"OGAPI_FILE_NOT_CREATE"}],statusCode:e.statusCode})})).catch((function(e){i.reject(e)})),o}}]),t}(o.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":261,"./Manufacturer":226,"./Model":229,q:120}],232:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("q")),s=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),n&&this.withIdentifier(n),i&&(i.name&&this.withName(i.name),i.title&&this.withTitle(i.title),i.description&&this.withDescription(i.description),i.fromCatalog&&this.fromCatalog(i.fromCatalog),!n&&i.fromCatalog||(i.steps&&this.withSteps(i.steps),i.parameters&&this.withParameters(i.parameters),i.applicableTo&&this.applicableTo(i.applicableTo)))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withTitle",value:function(e){if("string"!=typeof e)throw new Error("Parameter title must be a string, cannot be empty and has a maximum length of 50");return this._title=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){return this._description=e||void 0,this}},{key:"withParameters",value:function(e){return this._parameters=e||void 0,this}},{key:"fromCatalog",value:function(e){return this._fromCatalog=e,this}},{key:"withSteps",value:function(e){return this._steps=e||void 0,this}},{key:"withModels",value:function(e){return this._models=e||void 0,this}},{key:"applicableTo",value:function(e){return this._applicableTo=e||void 0,this}},{key:"_composeElement",value:function(e){return{name:this._name,title:this._title,description:this._description?this._description:void 0,parameters:this._parameters||void 0,fromCatalog:this._fromCatalog||void 0,steps:this._steps||void 0,models:this._models||void 0,applicableTo:this._applicableTo||void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._name||void 0===this._title)throw new Error("Parameters organization, title and name must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._title)throw new Error("Parameters organization, title and name must be defined")}},{key:"_buildURL",value:function(){return"operationTypes/"+this._resource+"/"+this._organization}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+"/"+this._identifier,this._composeElement(!0))}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization)throw new Error("Parameters organization and name must be defined");var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+"/"+this._identifier).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],233:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/catalog","operationType","Operation types not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getOperationTypes",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],234:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/provision/organizations","operationTypes","Operation type not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndName",value:function(e,t){return this._organization=e,this._name=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._name}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],235:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=i(e("moment")),s="/jobs/",u="/tasks/",c=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof r)throw new Error("Parameter operationId must be a string");this._ogapi=t,this._resource="operation",this._operationId=r}return n(e,[{key:"active",value:function(){return this._key="job",this._resource=this._resource+s+this._operationId,this._update({request:{active:!0}})}},{key:"pause",value:function(){return this._key="job",this._resource=this._resource+s+this._operationId,this._update({request:{active:!1}})}},{key:"cancel",value:function(){return this._id=this._operationId,this._resource=this._resource+s+this._id,this._cancel(this._resource)}},{key:"activePeriodicity",value:function(){return this._key="task",this._resource=this._resource+u,this._periodicityActions("ACTIVE",{active:!0})}},{key:"pausePeriodicity",value:function(){return this._key="task",this._resource=this._resource+u,this._periodicityActions("PAUSE",{active:!1})}},{key:"cancelPeriodicity",value:function(){return this._resource=this._resource+u,this._periodicityActions("CANCEL")}},{key:"executeNow",value:function(){return this._key="job",this._readAndUpdate({request:{schedule:{start:{}}}},!0)}},{key:"executeLater",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");var t={request:{schedule:{start:{delayed:o.default.duration(e,"minutes").asMilliseconds()}}}};return this._key="job",this._readAndUpdate(t)}},{key:"changeCallback",value:function(e){if("string"!=typeof e)throw new Error("Parameter url must be a string");var t={request:{callback:e}};return this._readAndUpdate(t)}},{key:"_cancel",value:function(){var e=this,t=a.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then((function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})})).catch((function(r){t.reject(e._formatError(r))})),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=a.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findById(r._operationId).then((function(i){var a=i.data;if(a&&0!=Object.keys(a).length){var o=a.taskId;if(o)switch(r._resource=r._resource+o,e){case"PAUSE":case"ACTIVE":r._update(t).then((function(e){n.resolve(e)})).catch((function(e){n.reject(e)}));break;case"CANCEL":r._id=o,r._cancel().then((function(e){n.resolve(e)})).catch((function(e){n.reject(e)}));break;default:n.reject({errors:"Not implemented action: "+e})}else n.reject({errors:"Operation is not periodic!"})}else n.reject({errors:"Operation with id "+r._operationId+" not exists"})})).catch((function(e){n.reject(e)})),i}},{key:"_readAndUpdate",value:function(e,t){var r=a.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findById(i._operationId).then((function(n){var a,o=n.data;o?(a=!!o.operation&&o.operation.active)?i.pause().then((function(n){i._update(e,t||a).then((function(e){r.resolve(e)})).catch((function(e){r.reject(i._formatError(e))}))})).catch((function(e){r.reject(i._formatError(e))})):i._update(e,t||a).then((function(e){r.resolve(e)})).catch((function(e){r.reject(i._formatError(e))})):r.reject("Operation with id "+i._operationId+" not exists")})).catch((function(e){r.reject(i._formatError(e))})),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=a.default.defer(),o=i.promise,s={};return s[n._key]=e,this._ogapi.Napi.put(this._resource,s).then((function(e){if(t)n.active().then((function(e){i.resolve(e)})).catch((function(e){i.reject(this._formatError(e))}));else if(200===e.status){var r=""!=e.text?JSON.parse(e.text):{};e.status;i.resolve(e)}else i.reject({errors:e.errors,statusCode:e.status})})).catch((function(e){i.reject(r._formatError(e))})),o}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=c,t.exports=r.default},{moment:116,q:120}],236:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=i(e("q")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._limit=void 0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findById",value:function(e){return this._id=e,this._baseUrl="operation/jobs",this._entity="job",this._error_not_found="Operation not found",this._execute()}},{key:"findPeriodicityById",value:function(e){this._id=e;var t=this,r=o.default.defer(),n=r.promise;return t.findById(e).then((function(e){var n=e.data;n&&0!=Object.keys(n).length?(t._id=e.data.taskId,t._baseUrl="operation/tasks",t._entity="task",t._error_not_found="Operation is not periodic!",t._execute().then((function(e){e.data.id=t._id,r.resolve(e)})).catch((function(e){r.reject(e)}))):r.reject({errors:t._error_not_found})})).catch((function(e){r.reject(e)})),n}},{key:"findPeriodicityByPeriodicityId",value:function(e){var t=this,r=o.default.defer(),n=r.promise;return t._id=e,t._baseUrl="operation/tasks",t._entity="task",t._execute().then((function(e){e.data.id=t._id,r.resolve(e)})).catch((function(e){r.reject(e)})),n}},{key:"findExecutionsById",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?10:arguments[1],r=arguments.length<=2||void 0===arguments[2]?1:arguments[2];if(this._id=e,this._baseUrl="operation/jobs",this._entity="operations",this._error_not_found="Executions not found","number"!=typeof t)throw new Error("size parameter must be a number");return("number"!=typeof r||r<1)&&(r=1),this._limit={size:t,start:r},this._execute()}},{key:"_composeUrl",value:function(){return"operations"===this._entity?(this._limit&&this._setUrlParameters({start:this._limit.start,size:this._limit.size}),this._baseUrl+"/"+this._id+"/operations"):this._baseUrl+"/"+this._id}}]),t}(a.default);r.default=s,t.exports=r.default},{"../GenericFinder":157,q:120}],237:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./catalog/BaseOperationBuilder")),o=i(e("./catalog/period/PeriodicityUpdateBuilder")),s=i(e("q")),u=i(e("merge")),c=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._operations=[],this._operationNames=[]}return n(e,[{key:"updatePeriodicityBuilder",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"operationId"});var t=s.default.defer(),r=t.promise,n=this;return this._ogapi.newOperationFinder().findPeriodicityById(e).then((function(e){t.resolve(n._createPeriodicBuilder(e.data))})).catch((function(e){t.reject(e)})),r}},{key:"builderByOperationName",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"name"});var t=s.default.defer(),r=t.promise,n=e.toUpperCase(),i=this._findOperation(n),a=this;return void 0===i?this._loadOperationCatalog().then((function(){var e=a._findOperation(n);void 0===e?t.reject("Operation <'"+n+"'> unavailable."):t.resolve(a._createBuilder(e.config))})):t.resolve(this._createBuilder(i.config)),r}},{key:"getOperationList",value:function(){return(0,u.default)(!0,this._operationNames)}},{key:"_createBuilder",value:function(e){return new a.default(this._ogapi,e)}},{key:"_createPeriodicBuilder",value:function(e){return new o.default(this._ogapi,e.id,e)}},{key:"_loadOperationCatalog",value:function(){var e=this,t=s.default.defer(),r=t.promise;return this._ogapi.operationTypesSearchBuilder().build().execute().then((function(r){if(200===r.statusCode){var n=r.data;for(var i in n){var a=n[i].name.toUpperCase();e._operationNames.push(a),e._operations.push({name:a,config:n[i]})}}t.resolve(e)})).catch((function(r){t.resolve(e)})),r}},{key:"_findOperation",value:function(e){return this._operations.find((function(e){return e.name==this}),e)}}]),e}();r.default=c,t.exports=r.default},{"./catalog/BaseOperationBuilder":240,"./catalog/period/PeriodicityUpdateBuilder":248,merge:112,q:120}],238:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),"string"!=typeof r)throw new Error("Parameter taskId must be a string");this._ogapi=t,this._resource="operation/tasks/",this._taskId=r,this._key="task"}return n(e,[{key:"activate",value:function(){return this._periodicityActions("ACTIVE",{active:!0})}},{key:"pause",value:function(){return this._periodicityActions("PAUSE",{active:!1})}},{key:"cancel",value:function(){return this._periodicityActions("CANCEL")}},{key:"_cancel",value:function(){var e=this,t=o.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then((function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})})).catch((function(r){t.reject(e._formatError(r))})),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=o.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(r._taskId).then((function(i){var a=i.data;if(a&&0!=Object.keys(a).length){var o=a.id;switch(r._resource=r._resource+o,e){case"PAUSE":case"ACTIVE":r._update(t).then((function(e){n.resolve(e)})).catch((function(e){n.reject(e)}));break;case"CANCEL":r._id=o,r._cancel().then((function(e){n.resolve(e)})).catch((function(e){n.reject(e)}));break;default:n.reject({errors:"Not implemented action: "+e})}}else n.reject("Periodicity with id "+r._taskId+" not exists")})).catch((function(e){n.reject(e)})),i}},{key:"_readAndUpdate",value:function(e,t){var r=o.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(i._taskId).then((function(n){var a,o=n.data;o?(a=!!o.task&&"ACTIVE"===o.task.state)?i.pause().then((function(n){i._update(e,t||a).then((function(e){r.resolve(e)})).catch((function(e){r.reject(i._formatError(e))}))})).catch((function(e){r.reject(i._formatError(e))})):i._update(e,t||a).then((function(e){r.resolve(e)})).catch((function(e){r.reject(i._formatError(e))})):r.reject("Periodicity with id "+i._taskId+" not exists")})).catch((function(e){r.reject(i._formatError(e))})),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=o.default.defer(),a=i.promise,s={};return s[n._key]=e,this._ogapi.Napi.put(this._resource,s).then((function(e){t?n.active().then((function(e){i.resolve(e)})).catch((function(e){i.reject(this._formatError(e))})):200===e.status?i.resolve(e):i.reject({errors:e.errors,statusCode:e.status})})).catch((function(e){i.reject(r._formatError(e))})),a}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=s,t.exports=r.default},{q:120}],239:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._parent=r}return n(e,[{key:"filter",value:function(e,t){if(void 0===this._parent._config.applicableTo.find((function(e){return e==this}),t))throw new Error("Entity type <'"+t+"'> not allowed to operation <'"+this._parent._config.name+"'>. Entity types allowed <'"+JSON.stringify(this._parent._config.applicableTo)+"'>");return this._parent._resourceTypeWhenFilter=t,void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Filter will remove the last way appended ."),void 0!==e._filterTemplate?this._parent._build.target={filter:e._filterTemplate.filter}:this._parent._build.target={filter:e},this._parent}},{key:"list",value:function(e){var t=this;if(void 0===e||e.constructor!==Array)throw new Error("Parameter entities must be typeof Array");return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now List of entities will remove the last way appended ."),this._parent._build.target={append:{}},e.forEach((function(e){if(e.constructor===String)t._parent._build.target.append.entities||(t._parent._build.target.append.entities=[]),t._parent._build.target.append.entities.push(e);else{if(!e.id||!e.parameters)throw new Error("Entity parameters must include id and parameters: "+JSON.stringify(e));t._parent._build.target.append.entitiesWithParameters||(t._parent._build.target.append.entitiesWithParameters=[]),t._parent._build.target.append.entitiesWithParameters.push(e)}})),this._parent}},{key:"tag",value:function(e){return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Tag will remove the last way appended ."),this._parent._build.target={append:{tags:[e]}},this._parent}}]),e}();r.default=i,t.exports=r.default},{}],240:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("merge")),o=i(e("./Operation")),s=(i(e("./parameters/ParameterBuilderFactory")),i(e("./AppendEntitiesBy"))),u=i(e("./period/ExecuteEachBuilder")),c=i(e("./period/ExecuteEveryBuilder")),l=i(e("moment")),p=e("./../../util/DATE_FORMAT"),f=i(e("ajv")),d={gte:function(e){if(e<this)throw new Error("Value expected must be greater than <"+this+">. Value setted <"+e+">")},list:function(e){if(void 0===this.find((function(e){return e==this}),e))throw new Error("Value must be one of these: "+JSON.stringify(this))},editable:function(e){return!0}},h=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ajv=new f.default({useDefaults:"empty",coerceTypes:!0}),this.appendEntitiesBy=new s.default(t,this),this._config=r,this._ogapi=t,this._resourcesAvailables={job:"/jobs",task:"/tasks"},this._resourceTypeWhenFilter=void 0,this._build={operationParameters:{ackTimeout:0,timeout:9e4,retries:0,retriesDelay:0,retryResultList:[]},name:r.name,schedule:{}},void 0!==r.parameters&&(this._build.parameters={})}return n(e,[{key:"withNotes",value:function(e){if(null===e)return delete this._build.userNotes,this;if("string"!=typeof e)throw new Error("Parameter notes must be a string");return this._build.userNotes=e,this}},{key:"withCallback",value:function(e){if(null===e)return delete this._build.callback,delete this._build.notify,this;if("string"!=typeof e)throw new Error("Parameter url must be a string");return this._build.callback=e,this._build.notify=!0,this}},{key:"withScatteringMaxSpread",value:function(e){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.maxSpread,this;if("number"!=typeof e)throw new Error("Parameter percentage must be a number");if(e<0||e>100)throw new Error("The value of percentage parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.maxSpread=e,this}},{key:"withScatteringStrategy",value:function(e,t){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.strategy,this;if("number"!=typeof e)throw new Error("Parameter factor must be a number");if(e<0||e>100)throw new Error("The value of factor parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.strategy={field:"subscription.collected.cellInfo",factor:e},"number"==typeof t&&(this._build.schedule.scattering.strategy.warningMaxRate=t),this}},{key:"executeImmediately",value:function(){return this._build.active=!0,void 0!==this._build.schedule&&delete this._build.schedule.start,delete this._build.task,this}},{key:"executeIDLE",value:function(){throw new Error("Not implemented yet")}},{key:"executeLater",value:function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._build.active=t,void 0===this._build.schedule&&(this._build.schedule={}),this._build.schedule.start={delayed:l.default.duration(e,"minutes").asMilliseconds()},delete this._build.task,this}},{key:"executeEvery",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var a=Array.prototype.slice.call(arguments),o=this._getName(a.slice(1,3)),s=this._getEnd(a.slice(1,3));return this._build.active=n,new c.default(this,e,o,s,i)}},{key:"executeEach",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var a=Array.prototype.slice.call(arguments),o=this._getName(a.slice(1,3)),s=this._getEnd(a.slice(1,3));return this._build.active=n,new u.default(this,e,o,s,i)}},{key:"_getName",value:function(e){for(var t=0;t<e.length;t++)if("string"==typeof e[t])return e[t];return this._build.name+" "+this._ogapi.Napi._options.apiKey}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t]&&e[t].constructor===Date)return e[t]}},{key:"withJobTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];if(null===e)return delete this._build.schedule.stop,this;if("number"!=typeof e)throw new Error("Parameter milliseconds must be a number");return this._build.schedule.stop={delayed:l.default.duration(e,t).asMilliseconds()},this}},{key:"withAckTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(l.default.duration(e,t).asMilliseconds(),"ackTimeout"),this}},{key:"withTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(l.default.duration(e,t).asMilliseconds(),"timeout"),this}},{key:"withRetriesDelay",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(l.default.duration(e,t).asMilliseconds(),"retriesDelay"),this}},{key:"withOperationRetries",value:function(e){return this._addSpecificParameter(e,"retryResultList"),this}},{key:"withRetries",value:function(e){return this._addSpecificParameter(e,"retries"),this}},{key:"withParameters",value:function(e){if(this._config.parameters)return this._build.parameters=e,this._checkMandatoryParameters(),this;throw new Error("This operation does not support parameters")}},{key:"withParameter",value:function(e,t){if(this._config.parameters)return this._build.parameters||(this._build.parameters={}),this._build.parameters[e]=t,this;throw new Error("This operation does not support parameters")}},{key:"build",value:function(){var e=void 0,t=(0,a.default)(!0,this._build),r=void 0,n=[];try{this._checkMandatoryParameters()}catch(e){n.push(e.message)}if(void 0===this._build.task&&void 0===this._build.schedule.start&&void 0===this._build.active&&(console.info("Not specified the way to execute [executeImmediately, executeIDLE, executeLater]. By default executeImmediately will be the way"),this.executeImmediately()),void 0===this._build.target&&this._build.active&&n.push("Must be entities appended if you want execute immediately. You must invoke appendEntitiesBy.list or appendEntitiesBy.tags or appendEntitiesBy.filter"),void 0!==this._build.target&&void 0!==this._build.target.filter&&"string"!=typeof this._resourceTypeWhenFilter&&n.push("Must be selected the entity type allowed when filter is the way to append entities. Allowed entity types <'"+JSON.stringify(this._config.applicableTo)+"'>"),void 0!==this._build.task){var i=this._build.task,s=this._build.schedule.stop;if(void 0!==i.repeating.period){var u=void 0;switch(i.repeating.period.unit){case"DAYS":u=l.default.duration(i.repeating.period.each,"days").asMilliseconds();break;case"HOURS":u=l.default.duration(i.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":u=l.default.duration(i.repeating.period.each,"minutes").asMilliseconds()}void 0!==s&&"number"==typeof s.delayed?s.delayed>=u&&n.push("You can not execute an operation with a job timeout greater than the repetition period."):(s=l.default.duration(u,"milliseconds").asSeconds()-1,console.info("Not specified the job timeout. By default, timeout will be "+s+" seconds"),this.withJobTimeout(s,"seconds"))}}if(n.length>0)throw this._build=t,n;void 0===this._build.schedule.stop&&(console.info("Not specified the job timeout. By default, timeout will be 30 days"),this.withJobTimeout(43200)),void 0!==this._build.task?(e=this._resourcesAvailables.task,r=this._convertToTask(this._build)):(e=this._resourcesAvailables.job,r=this._convertToJob(this._build)),void 0!==this._build.target&&void 0!==this._build.target.filter&&(e=e+"?resourceType="+this._resourceTypeWhenFilter);var c=new o.default(this._ogapi,e,r);return this._build=t,c}},{key:"_convertToTask",value:function(e){var t=e.task;this.executeImmediately();var r=this._convertToJob(this._build),n=(0,l.default)(new Date),i=(0,l.default)(t.start),a={task:{active:!0,name:t.name,description:t.description,job:r.job,schedule:{start:{date:i.format(p.DATE_FORMAT)},repeating:t.repeating}}};if(void 0!==t.stop&&(void 0!==t.stop.date?a.task.schedule.stop={date:(0,l.default)(t.stop.date).format(p.DATE_FORMAT)}:a.task.schedule.stop=t.stop),l.default.max(n,i)==n){if(void 0!==t.stop&&void 0!==t.stop.date){var o=(0,l.default)(t.stop.date);if(l.default.max(n,o)==n)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete a.task.schedule.start}return a}},{key:"_convertToJob",value:function(e){return 0===e.operationParameters.ackTimeout&&delete e.operationParameters.ackTimeout,{job:{request:e}}}},{key:"_addSpecificParameter",value:function(e,t){this._build.operationParameters[t]=e}},{key:"_checkParam",value:function(e,t){if("number"===t.type&&"number"!=typeof e)throw new Error(t.name+": Expected number but found "+typeof e);for(var r in t.attributes)"function"==typeof d[r]&&d[r].call(t.attributes[r],e)}},{key:"_checkMandatoryParameters",value:function(){if(this._config.parameters&&this._config.parameters.schema){var e=this._ajv.compile(this._config.parameters.schema);if(!e(this._build.parameters))throw new Error(e.errors)}}}]),e}();r.default=h,t.exports=r.default},{"./../../util/DATE_FORMAT":368,"./AppendEntitiesBy":239,"./Operation":241,"./parameters/ParameterBuilderFactory":243,"./period/ExecuteEachBuilder":245,"./period/ExecuteEveryBuilder":246,ajv:2,merge:112,moment:116}],241:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._resource="operation"+r,this._postObj=n}return n(e,[{key:"updatePeriodicity",value:function(){var e=this,t=o.default.defer(),r=this._resource.substring(this._resource.lastIndexOf("/")+1);return this._ogapi.Napi.put(this._resource,this._postObj).then((function(n){var i=void 0;try{i=JSON.parse(n.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:i||{},statusCode:n.statusCode,id:r})})).catch((function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)})),t.promise}},{key:"execute",value:function(){var e=this,t=o.default.defer();return this._ogapi.Napi.post(this._resource,this._postObj).then((function(r){var n=void 0;try{n=JSON.parse(r.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:n||{},statusCode:r.statusCode,location:r.header.location})})).catch((function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)})),t.promise}}]),e}();r.default=s,t.exports=r.default},{q:120}],242:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a,o=e("moment"),s=((a=o)&&a.__esModule,function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._parent=n,this._build="array"===r.type?[]:void 0,this._config=r,this[function(e){var t=function(e){var t=void 0;if("array"===e.type)t="add";else t="with";return t}(e);return t+e.name[0].toUpperCase()+e.name.slice(1)}(r)]=this._appendParameterValue}return n(e,[{key:"_appendParameterValue",value:function(e){return this._isTypeValueAllow(e)?this._isAllowValue(e)?("array"===this._config.type?this._build.push(e):this._build=e,this):(console.warn("Parameter <'"+this._config.name+"'> not allow value setted <'"+e+"'>. Only are allowed this configuration:"+JSON.stringify(this._config.attributes)),this):(console.warn("Parameter <'"+this._config.name+"'> not allow type of value setted <'"+typeof e+"'>. Only are allowed this type: "+this._getType()),this)}},{key:"_isString",value:function(){return"string"===this._config.type||"string"===this._config.subtype}},{key:"_isObject",value:function(){return"object"===this._config.type||"object"===this._config.subtype}},{key:"_isNumber",value:function(){return"number"===this._config.type||"number"===this._config.subtype}},{key:"_isArray",value:function(){return"array"===this._config.type||"array"===this._config.subtype}},{key:"_isBoolean",value:function(){return"boolean"===this._config.type||"boolean"===this._config.subtype}},{key:"_isDate",value:function(){return"date"===this._config.type||"date"===this._config.subtype}},{key:"_isTime",value:function(){return"time"===this._config.type||"time"===this._config.subtype}},{key:"_getType",value:function(){return this._isArray()?"array":this._isString()||this._isDate()||this._isTime()?"string":this._isObject()?"object":this._isNumber()?"number":this._isBoolean()?"boolean":"unknown"}},{key:"_isTypeValueAllow",value:function(e){var t=!0,r=typeof e;return(this._isString()||this._isTime()||this._isDate())&&"string"!==r&&(t=!1),this._isNumber()&&"number"!==r&&(t=!1),this._isObject()&&"object"!==r&&(t=!1),this._isBoolean()&&"boolean"!==r&&(t=!1),t}},{key:"_isAllowValue",value:function(e){if(void 0!==this._config.attributes){var t=this._config.attributes;if(void 0!==t.list)return void 0!==t.list.find((function(e){return e==this}),e)}return!0}},{key:"build",value:function(){if(this._config.required&&(void 0===this._build||0===this._build.length))throw new Error("Parameter <'"+this._config.name+"'> is required and their value is not defined");var e={name:this._config.name,value:i({},this._getType(),this._build)};return void 0!==this._build&&0!==this._build.length||(e=void 0),e}},{key:"buildAndAppend",value:function(){var e=this.build();if(void 0!==e){var t=this._parent._build.parameters.findIndex((function(e){return e.name==this.name}),e);-1===t?this._parent._build.parameters.push(e):this._parent._build.parameters[t]=e}return this._parent}}]),e}());r.default=s,t.exports=r.default},{moment:116}],243:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./BaseParameterBuilderWithParent");(n=i)&&n.__esModule;r.default=function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)},t.exports=r.default},{"./BaseParameterBuilderWithParent":242}],244:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DAYS_ENUM=["MON","TUE","WED","THU","FRI","SAT","SUN"]},{}],245:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("merge")),o=i(e("moment")),s=function(){function e(t,r,n,i,a){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._parent=t,this._skeleton={start:r,stop:i,name:n,description:a,repeating:{period:{each:void 0,unit:void 0}}},void 0!==i){var s=void 0;if("number"==typeof i){if(i<=0)throw new Error("Invalid stop value. Number of repetitions must be greater than 0.");s={executions:i}}else if(i.constructor===Date){var u=(0,o.default)(r),c=(0,o.default)(i);if(o.default.max(u,c)==u)throw new Error("Invalid stop date on executeEach method. Start date must be earlier than stop date.");s={date:i}}this._skeleton.stop=s}}return n(e,[{key:"minutes",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._addPeriod(e,"MINUTES")}},{key:"hours",value:function(e){if("number"!=typeof e)throw new Error("Parameter hours must be typeof number");return this._addPeriod(e,"HOURS")}},{key:"days",value:function(e){if("number"!=typeof e)throw new Error("Parameter days must be typeof number");return this._addPeriod(e,"DAYS")}},{key:"_addPeriod",value:function(e,t){var r=(0,a.default)(!0,this._skeleton);return r.repeating.period.each=e,r.repeating.period.unit=t,this._parent._build.task=r,this._parent}}]),e}();r.default=s,t.exports=r.default},{merge:112,moment:116}],246:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=e("./MONTHS_ENUM"),o=i(e("./pattern/ByWeek")),s=i(e("./pattern/ByYear")),u=i(e("./pattern/ByMonth")),c=i(e("./pattern/ByGeneric")),l=function(){function e(t,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.year=new s.default(t,r,n,i,a),this.week=new o.default(t,r,n,i,a),this._day=new c.default(t,r,n,i,a),this._date=r,this._end=i,this._parent=t,this._periodicityName=n,this._description=a}return n(e,[{key:"day",value:function(){return this._day._build()}},{key:"month",value:function(e){var t=this._parent._task;if(void 0===e||e.constructor!==Array){var r=!0;if(t){var n=t.schedule.repeating.pattern;if(n){var i=n.monthly;i&&(r=!1,e=i.months)}}if(r)throw new Error("Parameter months must be typeof Array")}if(0===e.length)throw new Error("Parameter months must have at least one month");for(var o=[],s=0;s<e.length;s++){var c=a.MONTHS_ENUM.find((function(e){return e==this}),e[s]);void 0===c&&o.push(c)}if(0!==o.length)throw new Error("Any month into parameter months is not allowed. Parameter value <'"+JSON.stringify(o)+"'>, Months allowed <'"+JSON.stringify(a.MONTHS_ENUM)+"'>");return new u.default(this._parent,this._date,this._periodicityName,e,this._end,this._description)}}]),e}();r.default=l,t.exports=r.default},{"./MONTHS_ENUM":247,"./pattern/ByGeneric":249,"./pattern/ByMonth":250,"./pattern/ByWeek":251,"./pattern/ByYear":252}],247:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MONTHS_ENUM=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"]},{}],248:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("merge")),o=i(e("moment")),s=i(e("../Operation")),u=i(e("./ExecuteEveryBuilder")),c=i(e("./ExecuteEachBuilder")),l=i(e("./pattern/ByGeneric")),p=e("./../../../util/DATE_FORMAT"),f=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._task=n,this.task_id=r,this._resource="/tasks/"+this.task_id,this._build=(0,a.default)(!0,this._task.job.request)}return n(e,[{key:"executeEvery",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3));return e=this._getStart(e),this._byGeneric=new l.default(this,e,null,t)._build(),new u.default(this,e,null,n)}},{key:"executeEach",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3)),i=this._task.schedule;if(e=this._getStart(e),i&&i.repeating&&i.repeating.period){var a=i.repeating.period;return new c.default(this,e,null,n)._addPeriod(a.each,a.unit)}return new c.default(this,e,null,n)}},{key:"_getStart",value:function(e){var t=this._task.schedule;return!e&&t.start&&t.start.date&&(e=new Date(t.start.date)),e}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t].constructor===Date)return e[t];var r=this._task.schedule;if(r.stop&&r.stop.date)return new Date(r.stop.date)}},{key:"build",value:function(){var e=(0,a.default)(!0,this._build),t=void 0,r=[];if(void 0!==this._build.task){var n=this._build.task,i=this._build.schedule.stop;if(void 0!==n.repeating.period){var u=void 0;switch(n.repeating.period.unit){case"DAYS":u=o.default.duration(n.repeating.period.each,"days").asMilliseconds();break;case"HOURS":u=o.default.duration(n.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":u=o.default.duration(n.repeating.period.each,"minutes").asMilliseconds()}void 0!==i&&"number"==typeof i.delayed&&i.delayed>=u&&r.push("You can not execute an operation with a job timeout greater than the repetition period.")}}if(r.length>0)throw this._build=e,r;void 0!==this._build.task&&(t=this._updateTask(this._build));var c=new s.default(this._ogapi,this._resource,t);return this._build=e,c}},{key:"_updateTask",value:function(e){var t=e.task,r=(0,o.default)(new Date),n=(0,o.default)(t.start),i={task:{schedule:{}}};try{t.start&&(i.task.schedule.start={date:n.format(p.DATE_FORMAT)}),t.stop&&(i.task.schedule.stop={date:(0,o.default)(t.stop).format(p.DATE_FORMAT)}),t.repeating&&(i.task.schedule.repeating=t.repeating)}catch(e){}if(delete i.task.schedule.name,void 0!==t.stop&&(void 0!==t.stop.date?i.task.schedule.stop={date:(0,o.default)(t.stop.date).format(p.DATE_FORMAT)}:i.task.schedule.stop=t.stop),o.default.max(r,n)==r){if(void 0!==t.stop&&void 0!==t.stop.date){var a=(0,o.default)(t.stop.date);if(o.default.max(r,a)==r)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete i.task.schedule.start}return i}}]),e}();r.default=f,t.exports=r.default},{"../Operation":241,"./../../../util/DATE_FORMAT":368,"./ExecuteEachBuilder":245,"./ExecuteEveryBuilder":246,"./pattern/ByGeneric":249,merge:112,moment:116}],249:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("moment")),o=i(e("merge")),s=e("./../../../../util/DATE_FORMAT"),u=function(){function e(t,r,n,i,o){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._parent=t,this._skeleton={start:r,stop:i,name:n,description:o,repeating:{pattern:{time:(0,a.default)(r).format(s.TIME_FORMAT)}}},void 0!==i){var u=void 0;if("number"==typeof i)u={executions:i};else if(i.constructor===Date){var c=(0,a.default)(r),l=(0,a.default)(i);if(a.default.max(c,l)==c)throw new Error("Invalid stop date on executeEvery method. Start date must be earlier than stop date.");u={date:i}}this._skeleton.stop=u}}return n(e,[{key:"_create",value:function(){return(0,o.default)(!0,this._skeleton)}},{key:"_build",value:function(){return this._parent._build.task=this._create(),this._parent}}]),e}();r.default=u,t.exports=r.default},{"./../../../../util/DATE_FORMAT":368,merge:112,moment:116}],250:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};var a,o=e("./ByGeneric"),s=function(e){function t(e,r,n,a,o,s){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,s),this._months=a;var u=e._task;if(u){var c=u.schedule.repeating.pattern;if(c){var l=c.monthly;l&&(this._day=l.day,i(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"day",value:function(e){if("number"!=typeof e)throw new Error("Parameter day must be typeof number");if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,this._build()}},{key:"_create",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.monthly={day:this._day,months:this._months},e}}]),t}(((a=o)&&a.__esModule?a:{default:a}).default);r.default=s,t.exports=r.default},{"./ByGeneric":249}],251:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};var a,o=e("./ByGeneric"),s=(a=o)&&a.__esModule?a:{default:a},u=e("./../DAYS_ENUM"),c=function(e){function t(e,r,n,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"days",value:function(e){if(void 0===e||e.constructor!==Array)throw new Error("Parameter days must be typeof Array");if(0===e.length)throw new Error("Parameter days must have at least one day");for(var t=[],r=0;r<e.length;r++){var n=u.DAYS_ENUM.find((function(e){return e==this}),e[r]);void 0===n&&t.push(n)}if(0!==t.length)throw new Error("Any day into parameter days is not allowed. Parameter value <'"+JSON.stringify(e)+"'>, Months allowed <'"+JSON.stringify(u.DAYS_ENUM)+"'>");return this._days=e,this._build()}},{key:"_create",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.weekly={days:this._days},e}}]),t}(s.default);r.default=c,t.exports=r.default},{"./../DAYS_ENUM":244,"./ByGeneric":249}],252:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};var a,o=e("./ByGeneric"),s=(a=o)&&a.__esModule?a:{default:a},u=e("./../MONTHS_ENUM"),c=function(e){function t(e,r,n,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,a,o);var s=e._task;if(s){var u=s.schedule.repeating.pattern;if(u){var c=u.yearly;c&&(this._day=c.day,this._month=c.month,i(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"day",value:function(e){if("number"!=typeof e){if(!this._day)throw new Error("Parameter day must be typeof number");month=this._day}if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,void 0===this._month?this:this._parent._task?(this._build(),this):this._build()}},{key:"month",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}((function(e){if("string"!=typeof e){if(!this._month)throw new Error("OGAPI_PARAMETER_MONTH_MUST_BE_STRING");e=this._month}if(void 0===u.MONTHS_ENUM.find((function(e){return e==this}),e))throw new Error("Any month into parameter months is not allowed. Parameter value <'"+e+"'>, Months allowed <'"+JSON.stringify(u.MONTHS_ENUM)+"'>");return this._month=e,void 0===this._day?this:this._parent._task?(this._build(),this):this._build()}))},{key:"_create",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.yearly={day:this._day,month:this._month},e}}]),t}(s.default);r.default=c,t.exports=r.default},{"./../MONTHS_ENUM":247,"./ByGeneric":249}],253:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("./Model")),s="/organizations";r.PRE_RESOURCE=s;var u="/manufacturers";r.MANUFACTURERS_RESOURCE=u;var c=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s,void 0,["name"]),this._isValidString(r,"organization",50),this._organization=r,this._resource=this._resource+"/"+this._organization+u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._manufUrl=e,this}},{key:"withFax",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._fax=e,this}},{key:"withTelephone",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._telephone=e,this}},{key:"withAddress",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._address=e,this}},{key:"withEmail",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._email=e,this}},{key:"modelBuilder",value:function(){if(!this._identifier)throw new Error("Required manufacturer identifier");return new o.default(this._ogapi,this._organization,this._identifier)}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{name:this._name||void 0,description:this._description||void 0,telephone:this._telephone||void 0,address:this._address||void 0,fax:this._fax||void 0,url:this._manufUrl||void 0,notes:this._notes||void 0,email:this._email||void 0}}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_buildURL",value:function(){return this._resource+(this._identifier?"/"+this._identifier:"")}},{key:"deleteInCascade",value:function(){return this._setUrlParameters({updateDevices:!0}),this.delete()}},{key:"updateInCascade",value:function(){return this._setUrlParameters({updateDevices:!0}),this.update()}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r)}}]),t}(a.default);r.default=c},{"../provision/BaseProvision":261,"./Model":255}],254:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=(i=a)&&i.__esModule?i:{default:i},s=e("./Manufacturer"),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,s.PRE_RESOURCE,"manufacturer","Manufacturer not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._setUrlParameters({visibility:this._visibility||"assignable"}),this._baseUrl+"/"+this._organization+s.MANUFACTURERS_RESOURCE+(this._identifier?"/"+this._identifier:"")}},{key:"assignable",value:function(){return this._visibility="assignable",this}},{key:"administrable",value:function(){return this._visibility="administrable",this}},{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndId",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}}]),t}(o.default);r.default=u,t.exports=r.default},{"../ProvisionGenericFinder":159,"./Manufacturer":253}],255:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../provision/BaseProvision"),o=(i=a)&&i.__esModule?i:{default:i},s=e("./Manufacturer"),u="/organizations";r.PRE_RESOURCE=u;var c="/models";r.MODELS_RESOURCE=c;var l=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,u,void 0,["name"]),this._isValidString(r,"organization",50),this._isValidString(n,"manufacturer",50),this._organization=r,this._manufacturer=n,this._resource=this._resource+"/"+this._organization+s.MANUFACTURERS_RESOURCE+"/"+n+c}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._description=e,this}},{key:"withNotes",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._notes=e,this}},{key:"withUrl",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._modelUrl=e,this}},{key:"withVersion",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER");return this._version=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),{name:this._name||void 0,description:this._description||void 0,version:this._version||void 0,notes:this._notes||void 0,url:this._modelUrl||void 0}}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_buildURL",value:function(){return this._resource+(this._identifier?"/"+this._identifier:"")}},{key:"deleteInCascade",value:function(){return this._setUrlParameters({updateDevices:!0}),this.delete()}},{key:"updateInCascade",value:function(){return this._setUrlParameters({updateDevices:!0}),this.update()}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r)}}]),t}(o.default);r.default=l},{"../provision/BaseProvision":261,"./Manufacturer":253}],256:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=(i=a)&&i.__esModule?i:{default:i},s=e("./Manufacturer"),u=e("./Model"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,u.PRE_RESOURCE,"model","Model not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+s.MANUFACTURERS_RESOURCE+"/"+this._manufacturer+u.MODELS_RESOURCE+(this._identifier?"/"+this._identifier:"")}},{key:"findByOrganizationAndManufacturer",value:function(e,t){return this._organization=e,this._manufacturer=t,this._execute()}},{key:"findByOrganizationAndManufacturerAndId",value:function(e,t,r){return this._organization=e,this._manufacturer=t,this._identifier=r,this._execute()}}]),t}(o.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":159,"./Manufacturer":253,"./Model":255}],257:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","organization","Organization not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByName",value:function(e){return this._id=e,this._execute()}},{key:"findByDomainAndWorkgroup",value:function(e,t){this._domain=e,this._workgroup=t;var r=o.default.defer(),n=r.promise,i=this._error_not_found;return this._executeWorkgroupRelation().then((function(e){if(204===e.statusCode)r.reject({data:i,statusCode:s.default.NOT_FOUND});else{var t=e.data,n={},a=[];for(var o in t.channels)n[t.channels[o].organization]||(n[t.channels[o].organization]=t.channels[o].organization,a.push({name:t.channels[o].organization}));a.length>0?r.resolve({data:a,statusCode:e.statusCode}):r.reject({data:i,statusCode:s.default.NOT_FOUND})}})).catch((function(e){r.reject(e)})),n}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=o.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){204===e.statusCode?t.reject({data:n,statusCode:s.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}}]),t}(a.default);r.default=u,t.exports=r.default},{"../ProvisionGenericFinder":159,"http-status-codes":76,q:120}],258:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../provision/BaseProvision"),o=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"+(void 0===r?"":r)),this._name=void 0,this._description=void 0,this._countryCode=void 0,this._langCode=void 0,this._timeZone=void 0,this._zoom=void 0,this._location=void 0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._domain=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._countryCode=e.toUpperCase(),this}},{key:"withLangCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._langCode=e.toLowerCase(),this}},{key:"withTimeZone",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._timeZone=e,this}},{key:"withPlan",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._plan=e,this}},{key:"withOnlyAssignedDomainCertificates",value:function(e){if("boolean"!=typeof e||!0!==e&&!1!==e)throw new Error("Parameter OnlyAssignedDomainCertificates must be a boolean and cannot be empty");return this._onlyDomainCerts=e,this}},{key:"withZoom",value:function(e){if("number"!=typeof(e*=1)||e<0||e>19)throw new Error("Parameter zoom must be a number between 0 and 19");return this._zoom=e,this}},{key:"withLocation",value:function(e,t){if(t*=1,"number"!=typeof(e*=1)||"number"!=typeof t)throw new Error("Latitude and longitude parameters must be numbers");if(e<-90||e>90)throw new Error("Parameter latitude value must be between -90 and 90");if(t<-180||t>180)throw new Error("Parameter longitude value must be between -180 and 180");return this._location={latitude:e,longitude:t},this}},{key:"withAuth",value:function(e){if(!e||!e.type)throw new Error("Auth cannot be empty and must have type at least");this._security||(this._security={}),this._security.auth=e}},{key:"withPasswordPolicy",value:function(e){if(!e)throw new Error("Password policy cannot be empty");this._security||(this._security={}),this._security.policies={password:{checkStrength:!!e.checkStrength,expirationPeriod:e.expirationPeriod||0}}}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._langCode||void 0===this._countryCode)throw new Error("Parameters name, country code and lang code must be defined");var e={};null!=this._zoom&&(e.zoom=this._zoom),null!=this._location&&(e.location=this._location);var t={organization:{name:this._name||void 0,description:this._description||void 0,plan:this._plan||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timeZone||void 0,onlyAssignedDomainCertificates:"boolean"!=typeof this._onlyDomainCerts?this._onlyDomainCerts:void 0}};return this._domain&&(t.organization.domain=this._domain),(e.zoom||e.location)&&(t.organization.mapDefault=e),this._security&&(t.organization.security=this._security),t}},{key:"_composeUpdateElement",value:function(){if(this._domain)throw new Error("The domain parameter is not allowed in the update");var e=this._composeElement();return delete e.organization.name,e}},{key:"_buildURL",value:function(){if(void 0===this._name)throw new Error("Parameter name must be defined");return this._resource+"/"+this._name}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261}],259:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Pipeline not found","north")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/pipelines"+(this._identifier?"/"+this._identifier:"")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],260:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["name","actions","organization"],"north/ai"),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return this._organization+"/pipelines/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"withActions",value:function(e){var t=this;if(!(e instanceof Array))throw new Error({message:"Parameter actions requires an array",parameter:"actions"});this._actions=[],e.forEach((function(e){t.addAction(e)}))}},{key:"addAction",value:function(e){if("object"!=typeof e||!e.name||"string"!=typeof e.name||!e.type||"string"!=typeof e.type)throw new Error({message:"Parameter action requires name and type",parameter:"actions"});this._actions||(this._actions=[]),this._actions.push(e)}},{key:"prediction",value:function(e,t,r){var n=(o=a.default.defer()).promise,i={input:e};t&&r&&(i.collect={deviceId:t,datastream:r});var o;n=(o=a.default.defer()).promise;return this._ogapi.Napi.post(this._buildURL()+"/prediction",i,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){o.resolve({statusCode:e.statusCode,body:e.body})})).catch((function(e){o.reject(e)})),n}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/pipelines",{name:this._name||void 0,actions:this._actions||void 0}}}]),t}(i(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],261:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("q"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r,n,i,a){if(void 0===i&&(i=[]),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._composeElement)throw new Error("Must override method: composeElement");if("function"!=typeof this._buildURL)throw new Error("Must override method: _buildURL");n&&(this._timeout="number"!=typeof n?t.Napi._options.timeout:n),this._ogapi=t,this._resource="provision"+r,this._requiredParameters=i,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=a}return n(e,[{key:"_checkRequiredParameters",value:function(){var e=[];if(this._requiredParameters&&this._requiredParameters.length>0){for(var t=0;t<this._requiredParameters.length;t++)void 0===this[this._requiredParameters[t]]&&void 0===this["_"+this._requiredParameters[t]]&&e.push(this._requiredParameters[t]);if(e.length>0)throw new Error("There are required parameters that have not been set. Missing parameters: "+JSON.stringify(e).replace(new RegExp('"',"g"),""))}}},{key:"create",value:function(){var e=this;this._checkRequiredParameters();var t=o.default.defer(),r=t.promise,n=this._composeElement();return this._ogapi.Napi.post(this._resource,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(r){201===r.statusCode?("function"==typeof e._onCreated&&e._onCreated(r.header.location),t.resolve({data:r.body,location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})})).catch((function(e){t.reject(e)})),r}},{key:"delete",value:function(e){var t=o.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),e,this._getServiceBaseURL()).then((function(e){200===e.statusCode?t.resolve({statusCode:e.statusCode}):t.reject({errors:e.errors,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}},{key:"_doSouthDelete",value:function(e){var t=o.default.defer(),r=t.promise;return this._ogapi.Sapi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),e,this._getServiceBaseURL()).then((function(e){200===e.statusCode?t.resolve({statusCode:e.statusCode}):t.reject({errors:e.errors,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),r}},{key:"update",value:function(){var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){200===t.statusCode?e.resolve({data:t.body,statusCode:t.statusCode}):200===t.status?e.resolve({data:t.body,statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_doNorthPut",value:function(e,t){var r=o.default.defer(),n=r.promise;return this._ogapi.Napi.put(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){200===e.statusCode?r.resolve({statusCode:e.statusCode}):200===e.status?r.resolve({statusCode:e.status}):r.reject({errors:e.errors,statusCode:e.statusCode})})).catch((function(e){r.reject(e)})),n}},{key:"_doSouthPut",value:function(e,t){var r=o.default.defer(),n=r.promise;return this._ogapi.Sapi.put(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){200===e.statusCode?r.resolve({statusCode:e.statusCode}):200===e.status?r.resolve({statusCode:e.status}):r.reject({errors:e.errors,statusCode:e.statusCode})})).catch((function(e){r.reject(e)})),n}},{key:"_doNorthPost",value:function(e,t,r){var n=this,i=o.default.defer(),a=i.promise;return this._ogapi.Napi.post(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){var t={statusCode:e.statusCode};201===e.statusCode?("function"==typeof n._onCreated&&n._onCreated(e.header.location),t.location=e.header.location,r&&(t.data=e.body),i.resolve(t)):200===e.statusCode?(r&&(t.data=e.body),i.resolve(t)):(t.errors=e.errors,i.reject(t))})).catch((function(e){i.reject(e)})),a}},{key:"_doSouthPost",value:function(e,t,r){var n=this,i=o.default.defer(),a=i.promise;return this._ogapi.Sapi.post(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){var t={statusCode:e.statusCode};201===e.statusCode?("function"==typeof n._onCreated&&n._onCreated(e.header.location),t.location=e.header.location,r&&(t.data=e.body),i.resolve(t)):200===e.statusCode?(r&&(t.data=e.body),i.resolve(t)):(t.errors=e.errors,i.reject(t))})).catch((function(e){i.reject(e)})),a}},{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}();r.default=s,t.exports=r.default},{q:120}],262:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../BaseProvision")),o=i(e("q")),s={xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};r.TYPES=s;var u=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,void 0,i,["organization","processorId"]),this._timeout=i,this._organization=r,this._processorId=n,this._resource="provisionProcessors/provision/organizations/"+r+"/"+n+"/"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource+this._type}},{key:"plan",value:function(e,t,r){if("string"!=typeof t)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._extension=s[t],this._setUrlParameters({numberOfEntriesToProcess:r||1}),this._type="plan",this._setExtraHeaders({accept:"application/json"}),this._executeOperation(e)}},{key:"bulk",value:function(e,t){if(this._extension=s[t],"string"!=typeof this._extension)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._type="bulk",this._setExtraHeaders({accept:this._extension}),this._executeOperation(e)}},{key:"_executeOperation",value:function(e){var t=void 0;"string"!=typeof e?(t=new FormData).append("file",e):(t={}).processorBulkFile=e;var r=o.default.defer(),n=this._buildURL();return this._ogapi.Napi.post_multipart(n,t,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){switch(e.statusCode){case 200:var t=""!=e.text?JSON.parse(e.text):{},n=e.status;r.resolve({data:t,statusCode:n});break;case 201:n=e.status;var i=e.location||e.headers.location||e.header.location;r.resolve({location:i,statusCode:n});break;case 204:r.resolve(e);break;default:r.reject({errors:e.data.errors,statusCode:e.statusCode})}})).catch((function(e){r.reject(e)})),r.promise}}]),t}(a.default);r.default=u},{"../BaseProvision":261,q:120}],263:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../../ProvisionGenericFinder")),o=i(e("jsonpath")),s=i(e("q")),u=i(e("http-status-codes")),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","entity","Countries not found"),this.__filter=this._api._options._internalCountriesFilter}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getCountries",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this.__filter.organization+"/entities/"+this.__filter.identifier}},{key:"_execute",value:function(){var e=s.default.defer(),t=e.promise,r=this,n=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters(),!1,this._getServiceBaseURL()).then((function(t){if(204===t.statusCode)e.reject({error:n,statusCode:u.default.NOT_FOUND});else{var i=(o.default.query(t.body,"$."+r.__filter.ds+"._current.value")||[])[0];e.resolve({data:i,statusCode:t.statusCode})}})).catch((function(t){400===t.statusCode&&(t.statusCode=u.default.NOT_FOUND),e.reject(t)})),t}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../ProvisionGenericFinder":159,"http-status-codes":76,jsonpath:104,q:120}],264:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=(i=a)&&i.__esModule?i:{default:i},s="provision.asset.identifier";r.AssetID=s;var u=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/entities",n,i,a,o),this._entity.resourceType={_value:{_current:{value:"entity.asset"}}}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_getEntityKey",value:function(){return this._entity[s]}}]),t}(o.default);r.default=u},{"./SimpleBuilder":272}],265:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../BaseProvision")),o=i(e("q")),s=function(e){function t(e,r,n,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._timeout=i,this._resource=r,this._extension=n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource}},{key:"create",value:function(e,t){return this._executeOperation(e,"CREATE",t)}},{key:"delete",value:function(e,t){return this._executeOperation(e,"DELETE",t)}},{key:"deleteAll",value:function(e,t){return this._executeOperation(e,"DELETE&full=true",t)}},{key:"update",value:function(e,t){return this._executeOperation(e,"UPDATE",t)}},{key:"patch",value:function(e,t){return this._executeOperation(e,"PATCH",t)}},{key:"_executeOperation",value:function(e,t,r){var n=void 0;if("string"!=typeof e){if(n={},e){var i=new Blob([e]);n.bulkFile=i}}else n={},e&&(n.bulkFile=e);var a=o.default.defer();n.ext=this._extension;var s=this._buildURL();return r&&this._setExtraHeaders({accept:"text/plain"}),this._setUrlParameters({action:t}),this._ogapi.Napi.post_multipart(s,n,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){var t=e.statusCode;if(200===t||201===t)if(r&&!e.location){var n=e,i=e.statusCode;a.resolve({data:n,statusCode:i})}else a.resolve(e);else 204===t?a.resolve(e):a.reject({errors:e.data.errors,statusCode:e.statusCode})})).catch((function(e){a.reject(e)})),a.promise}}]),t}(a.default);r.default=s,t.exports=r.default},{"../BaseProvision":261,q:120}],266:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,i,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach((function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];n.forEach?n.forEach((function(e){e._index.value&&e._value&&e._value._current&&t.withComplex(r,e._index.value._current.value,e._value._current.value)})):t.with(r,n._value._current.value)}}))}},{key:"_initFormJson",value:function(e,t,r){var n=this;e&&Object.keys(e).forEach((function(i){var a=e[i],o=a._current,s=t?t+"."+i:i;if(o){var u=o.value;r?n.withComplex(s,r,u):n.with(s,u)}else Array.isArray(a)?a.forEach((function(e){n._initFromJson(e,s+"[]",e.identifier._current.value)})):n._initFromJson(a,s,r)}))}},{key:"initFromJson",value:function(e){var t={};e&&(t=e.provision)&&this._initFromJson(t,"provision")}},{key:"withComplex",value:function(e,t,r){if(!t)return console.warn("Communication module identifier not defined. This value wil be ignored"),this;if(1!==this.getAllowedDatastreams().filter((function(t){return t.identifier===e})).length)return console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this;this._entity[e]||(this._entity[e]=[]);for(var n=!1,i=0;i<this._entity[e].length;i++){var a=this._entity[e][i];a._index&&a._index.value&&a._index.value===t&&(this._entity[e][i]={_index:{value:t},_value:{_current:{value:r}}},n=!0)}return n||this._entity[e].push({_index:{value:t},_value:{_current:{value:r}}}),this}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"./SimpleBuilder":272}],267:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./BulkBuilder"),a=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(a?"async":n.toLowerCase()),"text/plain",i),a&&this._setUrlParameters({type:n.toUpperCase()})}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./BulkBuilder":265}],268:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=i(e("./ComplexBuilder")),s=e("./SubscriberBuilder"),u=e("./SubscriptionBuilder"),c=i(e("http-status-codes")),l=i(e("q")),p=i(e("jsonpath")),f=function(){function e(t,r,n,i,o,c){a(this,e);var l=this,p={},f={};this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._timeout=c||null,this._objClone=Object.assign({},r),this._deviceKeys=Object.keys(r).filter((function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")})),this._subscriberKeys=Object.keys(r).filter((function(e){return-1!==e.indexOf("subscriber")})),this._subscriptionKeys=Object.keys(r).filter((function(e){return-1!==e.indexOf("subscription")})),this._administrationKeys=Object.keys(r).filter((function(e){return-1!==e.indexOf("provision.administration")})),this._wrappers=[],this._urlParameters=o,this._subscriberKeys.forEach((function(e){l._obj[e].forEach((function(t){p[t._index.value]||(p[t._index.value]={}),p[t._index.value][e]={_value:t._value}}))})),this._subscriptionKeys.forEach((function(e){l._obj[e].forEach((function(t){f[t._index.value]||(f[t._index.value]={}),f[t._index.value][e]={_value:t._value}}))})),Object.keys(f).forEach((function(e){var t=f[e];l._administrationKeys.forEach((function(e){t[e]=l._obj[e]})),l._wrappers.push(new d(l._ogapi,t,l._url.replace("devices","subscriptions").replace("/"+l._key._value._current.value,""),t[u.SubscriptionID]._value._current.value))})),Object.keys(p).forEach((function(e){var t=p[e];l._administrationKeys.forEach((function(e){t[e]=l._obj[e]})),l._wrappers.push(new d(l._ogapi,t,l._url.replace("devices","subscribers").replace("/"+l._key._value._current.value,""),t[s.SubscriberID]._value._current.value))}))}return n(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key._value._current.value}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"create",value:function(){var e=this,t=l.default.defer(),r={},n=this._objClone,i=[],a=this;return Object.keys(n).filter((function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")})).forEach((function(e){r[e]=n[e]})),this._wrappers.forEach((function(e){i.push({wrapper:e,promise:e.execute(t,10)})})),l.default.allSettled(i.reduce((function(e,t){return e.push(t.promise),e}),[])).then((function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:20}),t.notify({entity:a._key._value._current.value,message:"OGAPI_CREATING_DEVICE",type:"success",percentage:25}),a._ogapi.Napi.post(a._url,r,null,null,{flattened:!0}).then((function(r){if(a._wrappers.length>0)return t.notify({message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:55}),e._setUrlParameters({flattened:!0}),a._ogapi.Napi.put(a._urlWithKey(),n,e._timeout,null,e._getUrlParameters()).then((function(e){e.statusCode===c.default.OK?("function"==typeof a._onCreated&&a._onCreated(e.header.location),t.notify({entity:a._key._value._current.value,message:"OGAPI_DEVICE_CREATED ",type:"success",percentage:75}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})}));r.statusCode===c.default.CREATED?("function"==typeof a._onCreated&&a._onCreated(r.header.location),t.notify({entity:a._key._value._current.value,message:"OGAPI_DEVICE_CREATED",type:"success",percentage:75}),t.resolve({location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})})).catch((function(e){e.statusCode===c.default.BAD_REQUEST?(p.default.query(e,"$..message")[0].includes("Entity duplicated"),t.reject({errors:e.data.errors,statusCode:e.statusCode})):t.reject({errors:e.data,statusCode:e.statusCode})}))})).catch((function(e){e.data.errors.forEach((function(e){var r=e.description;e.label&&(r+=":"+e.label),t.notify({message:"Error: "+r,type:"error",percentage:80})}));var r=[a.delete(t,90)];i.forEach((function(e){r.push(e.wrapper.delete(t,90))})),l.default.allSettled(r).then((function(){t.reject(e)})).catch((function(){t.reject(e)}))})),t.promise}},{key:"update",value:function(){var e=this,t=l.default.defer(),r=this._objClone,n=[],i=this;return this._wrappers.forEach((function(e){n.push({wrapper:e,promise:e.execute(t,20)})})),l.default.allSettled(n.reduce((function(e,t){return e.push(t.promise),e}),[])).then((function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.put(i._url,r,e._timeout,null,e._getUrlParameters()).then((function(e){e.statusCode===c.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})}))})).catch((function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)})),t.promise}},{key:"patch",value:function(){var e=this,t=l.default.defer(),r=this._obj,n=[],i=this;return this._wrappers.forEach((function(e){n.push({wrapper:e,promise:e.execute(t,20)})})),l.default.allSettled(n.reduce((function(e,t){return e.push(t.promise),e}),[])).then((function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.patch(i._url,r,e._timeout,null,e._getUrlParameters()).then((function(e){e.statusCode===c.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})}))})).catch((function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)})),t.promise}},{key:"delete",value:function(e,t){var r=this;return this._ogapi.Napi.delete(this._urlWithKey()).then((function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})}))}}]),e}(),d=function(){function e(t,r,n,i){a(this,e),this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._created=!1}return n(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key}},{key:"_checkExists",value:function(){return this._ogapi.Napi.get(this._urlWithKey()).then((function(e){return e.statusCode===c.default.OK})).catch((function(e){return console.warn(e),!1}))}},{key:"execute",value:function(e,t){var r=l.default.defer(),n=this;return this._checkExists().then((function(a){a?r.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:n._key}):i(e,r,t)})).catch((function(a){a?r.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:n._key}):i(e,r,t)})),r.promise;function i(e,t,r){n._obj["provision.administration.serviceGroup"]={_value:{_current:{value:"emptyServiceGroup"}}},n._ogapi.Napi.post(n._url,n._obj,null,null,{flattened:!0}).then((function(i){n._created=!0,e.notify({entity:n._key,message:"OGAPI_ENTITY_CREATED",type:"success",percentage:r}),t.resolve({message:"OGAPI_ENTITY_CREATED",entity:n._key})})).catch((function(i){console.error(i),e.notify({entity:n._key,message:"OGAPI_ENTITY_CREATED",type:"warning",percentage:r}),t.reject({entity:n._key,message:"OGAPI_SOMETHING_WRONG_CREATING"})}))}}},{key:"delete",value:function(e,t){var r=this;return this._created?this._ogapi.Napi.delete(this._urlWithKey()).then((function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})})):Q.fcall((function(){}))}}]),e}(),h=function(e){function t(e,r,n,i,o,s){a(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/devices",n,i,o,s),this._organization=r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"create",value:function(){return this._checkRequiredParameters(),new f(this._ogapi,this._composeElement(),this._resource,this._getEntityKey(),this._getUrlParameters(),this._timeout).create()}},{key:"update",value:function(){return new f(this._ogapi,this._composeElement(),this._buildURL(),this._getEntityKey(),this._getUrlParameters(),this._timeout).update()}},{key:"_getEntityKey",value:function(){return this._entity["provision.device.identifier"]}}]),t}(o.default);r.default=h,t.exports=r.default},{"./ComplexBuilder":266,"./SubscriberBuilder":273,"./SubscriptionBuilder":274,"http-status-codes":76,jsonpath:104,q:120}],269:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=i(e("jsonpath")),s=i(e("ajv")),u=i(e("./AssetBuilder")),c=i(e("./DeviceBuilder")),l=i(e("./TicketBuilder")),p=i(e("./SubscriberBuilder")),f=i(e("./SubscriptionBuilder")),d=i(e("./CsvBulkBuilder")),h=i(e("./JsonFlattenedBulkBuilder")),m=i(e("./JsonBulkBuilder")),v=new s.default,y="Parameters organization must be defined",g=["entities","tickets"],_="/og_basic_types.json",b=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);this._ogapi=t}return n(e,[{key:"_loadAllowedDatastreams",value:function(e,t,r){var n=this,i=a.default.defer(),o=i.promise,s=n._ogapi.newFilterBuilder();return s.and({like:{"datamodels.categories.datastreams.identifier":"provision"}}).and({eq:{"datamodels.organizationName":t}}).and({eq:{"datamodels.allowedResourceTypes":r}}),this._ogapi.datamodelsSearchBuilder().filter(s).build().execute().then((function(e){return n.schema={},e})).then((function(t){200!==t.statusCode&&i.reject({data:"OGAPI_DATASTREAM_NOT_FOUND",statusCode:204}),n._getJsonPathElements().then((function(){t.data=n._setDevicesProperties(t.data,e),i.resolve(t)})).catch((function(e){i.reject(e)}))})).catch((function(e){i.reject(e)})),o}},{key:"_getJsonPathElements",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.basicTypesSearchBuilder().withPath("$").build().execute().then((function(t){v.getSchema(_)&&v.removeSchema(_),v.addSchema(t.data,_),e.resolve()})).catch((function(t){e.reject(t)})),t}},{key:"_setDevicesProperties",value:function(e,t){var r=this,n=o.default.query(e,"$.datamodels[*].categories[*].datastreams[?(@.calculated === false)]"),i={allowedDatastreams:[],schemas:{}};return r.complexFunctions=[],r.simpleFunctions=[],n.forEach((function(e,n){var a=e.identifier;if(a.startsWith("provision.administration")||a.startsWith(t))if(i.allowedDatastreams.push(e),a.includes("communicationModules")){var o=t.includes("subscriber")||t.includes("subscription");r.schema[a]={value:e.schema,complex:!o,function:o?"with":"withComplex"}}else r.schema[a]={value:e.schema,complex:!1,function:"with"}})),i.schemas=r.schema,i}},{key:"devicesBuilder",value:function(e,t){return this._genericBuilder(e,"entity.device","provision",(function(r,n){return new c.default(this._ogapi,e,r,n,v,t)}))}},{key:"assetsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.asset","provision",(function(r,n){return new u.default(this._ogapi,e,r,n,v,t)}))}},{key:"ticketsBuilder",value:function(e,t){return this._genericBuilder(e,"ticket","provision",(function(r,n){return new l.default(this._ogapi,e,r,n,v,t)}))}},{key:"subscribersBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscriber","provision.device.communicationModules[].subscriber",(function(r,n){return new p.default(this._ogapi,e,r,n,v,t)}))}},{key:"subscriptionsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscription","provision",(function(r,n){return new f.default(this._ogapi,e,r,n,v,t)}))}},{key:"newCsvBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new d.default(this._ogapi,e,t,r,n)}},{key:"newJsonBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new m.default(this._ogapi,e,t,r,n)}},{key:"newJsonFlattenedBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new h.default(this._ogapi,e,t,r,n)}},{key:"_validateBulk",value:function(e,t){if(!e)throw new Error(y);if(!t||-1===g.indexOf(t))throw new Error("The parameters resources must be defined and must be some of these values: entities or tickets")}},{key:"_genericBuilder",value:function(e,t,r,n){var i=this,o=a.default.defer();if(!e)throw new Error(y);return this._loadAllowedDatastreams(r,e,t).then((function(e){200===e.statusCode?o.resolve(n.call(i,e.data.allowedDatastreams,e.data.schemas)):o.reject("OGAPI_DATASTREAM_NOT_FOUND")})).catch((function(e){o.reject(e)})),o.promise}}]),e}();r.default=b,t.exports=r.default},{"./AssetBuilder":264,"./CsvBulkBuilder":267,"./DeviceBuilder":268,"./JsonBulkBuilder":270,"./JsonFlattenedBulkBuilder":271,"./SubscriberBuilder":273,"./SubscriptionBuilder":274,"./TicketBuilder":275,ajv:2,jsonpath:104,q:120}],270:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./BulkBuilder"),a=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(a?"async":n.toLowerCase()),"application/json",i),a&&this._setUrlParameters({type:n.toUpperCase()})}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./BulkBuilder":265}],271:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("./BulkBuilder"),a=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(a?"async":n.toLowerCase()),"application/json",i),this._setUrlParameters({flattened:!0}),a&&this._setUrlParameters({flattened:!0,type:n.toUpperCase()})}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"./BulkBuilder":265}],272:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("http-status-codes")),o=i(e("../BaseProvision")),s=i(e("q")),u=i(e("lodash")),c="value is not allowed. The value should be formatted as follows: ",l="/og_basic_types.json",p=function(e){function t(e,r,n,i,a,o){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/"+r,o),"function"!=typeof this._getEntityKey)throw new Error("Must override method: _getEntityKey");this._setUrlParameters({flattened:!0}),this._entity={},this._allowedDatastreams=n,this._definedSchemas=i,this._jsonSchemaValidator=a}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return this._resource+"/"+this.getEntityKey()}},{key:"_validate",value:function(){var e=this,t=[];if(Object.keys(this._entity).forEach((function(r){"resourceType"!=r&&function(){if(!e._definedSchemas[r])throw new Error("Datastream is not allowed: "+r);var n=e._definedSchemas[r].value;if(e._entity[r].constructor===Array)e._entity[r].forEach((function(i){var a=i._value._current.value;e._jsonSchemaValidator.validate(l,a)||t.push(r+" ["+a+"] "+c+JSON.stringify(n))}));else{var i=e._entity[r]._value._current.value;e._jsonSchemaValidator.validate(l,i)||t.push(r+" ["+i+"] "+c+JSON.stringify(n))}}()})),t.length>0)throw new Error(JSON.stringify(t).replace(new RegExp('"',"g"),""))}},{key:"_composeElement",value:function(){return this._validate(),this._entity}},{key:"getEntityKey",value:function(){return null!==this._getEntityKey()?this._getEntityKey()._value._current.value:null}},{key:"with",value:function(e,t){return void 0!==t&&0!==t.length||u.default.isArray(t)?1!==this.getAllowedDatastreams().filter((function(t){return t.identifier===e})).length?(console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this):(this._entity[e]={_value:{_current:{value:t}}},this):(delete this._entity[e],this)}},{key:"getAllowedDatastreams",value:function(){return this._allowedDatastreams}},{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach((function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];Array.isArray(n)&&(n=n[0]),t.with(r,n._value._current.value)}}))}},{key:"_initFromJson",value:function(e,t){var r=this;e&&Object.keys(e).forEach((function(n){var i=e[n],a=i._current,o=t?t+"."+n:n;a?r.with(o,a.value):Array.isArray(i)?r._initFromJson(i[0],o+"[]"):r._initFromJson(i,o)}))}},{key:"initFromJson",value:function(e){var t={};e&&(t=e.provision)&&this._initFromJson(t,"provision")}},{key:"deleteAll",value:function(){var e=s.default.defer(),t=e.promise;return this._setUrlParameters({full:!0}),this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){t.statusCode===a.default.OK?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"update",value:function(){var e=s.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}},{key:"patch",value:function(){var e=s.default.defer(),t=e.promise;return this._ogapi.Napi.patch(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(o.default);r.default=p,t.exports=r.default},{"../BaseProvision":261,"http-status-codes":76,lodash:111,q:120}],273:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=(i=a)&&i.__esModule?i:{default:i},s="provision.device.communicationModules[].subscriber.identifier";r.SubscriberID=s;var u=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscribers",n,i,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_getEntityKey",value:function(){return this._entity[s]}}]),t}(o.default);r.default=u},{"./SimpleBuilder":272}],274:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=(i=a)&&i.__esModule?i:{default:i},s="provision.device.communicationModules[].subscription.identifier";r.SubscriptionID=s;var u=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscriptions",n,i,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_getEntityKey",value:function(){return this._entity[s]}}]),t}(o.default);r.default=u},{"./SimpleBuilder":272}],275:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SimpleBuilder"),o=(i=a)&&i.__esModule?i:{default:i},s="provision.ticket.identifier";r.TicketID=s;var u=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/tickets",n,i,a,o)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_getEntityKey",value:function(){return this._entity[s]}}]),t}(o.default);r.default=u},{"./SimpleBuilder":272}],276:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("../util/formats/check_types")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/",void 0,["name","organization","configurationParams","scriptProcessor"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return"provisionProcessors/provision/organizations/"+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return o.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return o.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return o.default._checkString(e,"name"),this._name=e,this}},{key:"withConfigurationParams",value:function(e){return o.default._checkObject(e,"configurationParams"),this._configurationParams=e,this}},{key:"withScriptProcessor",value:function(e){return o.default._checkObject(e,"scriptProcessor"),this._scriptProcessor=e,this}},{key:"_composeElement",value:function(){return this._resource="provisionProcessors/provision/organizations/"+this._organization,{name:this._name,configurationParams:this._configurationParams,scriptProcessor:this._scriptProcessor}}}]),t}(a.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,"../util/formats/check_types":373}],277:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","provisionPrecessors")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndProvisionProcessorId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],278:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=(i(e("./_RuleCondition")),i(e("./_RuleNotification")),i(e("q"))),s=function(e){function t(e,r,n,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),i&&this.withIdentifier(i),a&&(a.name&&this.withName(a.name),a.mode&&this.withMode(a.mode),a.type&&this.withType(a.type),a.description&&this.withDescription(a.description),null!==a.active&&void 0!==a.active&&this.withActive(a.active),null!==a.condition&&void 0!==a.condition&&this.withCondition(a.condition),a.actionsDelay&&this.withActionsDelay(a.actionsDelay),a.actions&&this.withActions(a.actions),a.parameters&&this.withParameters(a.parameters),a.javascript&&this.withJavascript(a.javascript))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withChannel",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter channel must be a string, cannot be empty and has a maximum length of 50");return this._channel=e,this}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter name must be a string and cannot be empty");return this._javascript=e,this}},{key:"withMode",value:function(e){return this._mode=e,this}},{key:"withType",value:function(e){return this._type=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be true or false");return this._active=e,this}},{key:"withActionsDelay",value:function(e){if("number"!=typeof e)throw new Error("Parameter actionsDelay must be a number");return this._actionsDelay=e,this}},{key:"withCondition",value:function(e){return this._condition=e||{},this}},{key:"withActions",value:function(e){return this._actions=e||{},this}},{key:"withParameters",value:function(e){return this._parameters=e||[],this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,active:this._active,mode:this._mode,type:this._type,severity:this._severity,description:this._description?this._description:void 0,parameters:this._parameters,condition:"EASY"===this._mode?this._condition:void 0,actionsDelay:this._actionsDelay,actions:"EASY"===this._mode?this._actions:void 0,javascript:"ADVANCED"===this._mode?this._javascript:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and name must be defined")}},{key:"_buildURL",value:function(){return"rules/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"updateParameters",value:function(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and identifier must be defined");return this._doNorthPut(this._buildURL()+this._identifier+"/parameters",e||this._parameters||[])}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,"./_RuleCondition":282,"./_RuleNotification":283,q:120}],279:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/catalog","rulesTemplate","Rule templates not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getTemplates",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],280:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/provision/organizations","rules","Rule configurations not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+"/"+this._name}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],281:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="js/dummyFunctions",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/private/javascriptFunctions",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/javascriptFunctions",this._execute()}},{key:"_execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){204===t.statusCode?e.reject({error:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=u,t.exports=r.default},{"../GenericFinder":157,"http-status-codes":76,q:120}],282:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./RuleConfigurations"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.constructor!==o.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._condition=r}return n(e,[{key:"setDelay",value:function(e){if("number"!=typeof e||typeof e<1)throw new Error("Parameter delay must be typeof number and higher than -1");return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=1e3*e,this}},{key:"deactivateDelay",value:function(){return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=-1,this}},{key:"setParameterValue",value:function(e,t){if(this._condition.parameters&&this._condition.parameters.length>0){for(var r in this._condition.parameters){var n=this._condition.parameters[r];if(n.name===e){if(void 0===n.value)throw new Error("Value not allowed for parameter "+e+" in condition "+this._condition.name);return n.value=t||"",this}}throw new Error("Parameter "+e+" not exists for condition "+this._condition.name)}}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=s,t.exports=r.default},{"./RuleConfigurations":278}],283:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./RuleConfigurations"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t.constructor!==o.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._notification=r}return n(e,[{key:"setEnabled",value:function(e){if("boolean"!=typeof e)throw new Error("Bearer enabled must be true or false");return this._notification.enabled=e,this}},{key:"setBearerRecipients",value:function(e,t){if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.recipients=t,this}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return this}},{key:"enableBearer",value:function(e){if(this._notification.bearers&&this._notification.bearers.length>0){for(var t in this._notification.bearers){var r=this._notification.bearers[t];if(r.name===e)return r.enabled=!0,this}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return this}},{key:"disableBearer",value:function(e){if(this._notification.bearers&&this._notification.bearers.length>0){for(var t in this._notification.bearers){var r=this._notification.bearers[t];if(r.name===e)return r.enabled=!1,this}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return this}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=s,t.exports=r.default},{"./RuleConfigurations":278}],284:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./Search")),o=i(e("q")),s=function(e){function t(e,r,n,i,a,o,s,u,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,i,a,o,s,u,c)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then((function(t){var r=t.body,n=t.statusCode;200===n&&(r.assets=r.entities,delete r.entities),e.resolve({data:r,statusCode:n})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"./Search":289,q:120}],285:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=(i(e("merge")),function(){function e(t,r,n,i){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._filter)throw new Error("Must override method: filter");this._timeout="number"!=typeof n?t.Napi._options.timeout:n,this._ogapi=t,this._resource=r,this._headers=void 0,this._urlParameters=void 0,this._serviceBaseURL=i}return n(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){var r=t.body,n=t.statusCode;e.resolve({data:r,statusCode:n})})).catch((function(t){e.reject(t)})),t}},{key:"downloadCsv",value:function(){var e=a.default.defer(),t=e.promise,r=this._filter();return r&&r.limit&&delete r.limit,this._setExtraHeaders({Accept:"text/plain"}),this._ogapi.Napi.post(this._resource,r,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){var r=t,n=t.statusCode;e.resolve({data:r,statusCode:n})})).catch((function(t){e.reject(t)})),t}},{key:"_asyncPagingFilter",value:function(){var e=this._filter();return e.limit&&e.limit.size?e.limit.start=1:e.limit={size:1e3,start:1},e}},{key:"cancelAsyncPaging",value:function(e){"string"==typeof e&&e.length>0?this.cancel=e:this.cancel=!0}},{key:"_loadData",value:function(e){var t=this,r=a.default.defer(),n=t._asyncPagingFilter(),i=!1;return function a(){if(t.cancel||"string"==typeof t.cancel){var o="string"==typeof t.cancel?t.cancel:"Cancel process";r.reject({data:o,statusCode:403})}else t._ogapi.Napi.post(t._resource,n,t._timeout,t._getExtraHeaders(),t._getUrlParameters(),t._getServiceBaseURL()).then((function(t){var o=t.statusCode,s=t.body;if(!s&&t.text)try{var u=JSON.parse(t.text);u&&(s=u)}catch(e){console.error("Impossible to parse text from response")}if(200===o||200===o){i=!0;var c=s.data?s.data[e]:s[e];r.notify(c),c.length===n.limit.size?(n.limit.start+=1,a()):r.resolve({data:"DONE",statusCode:200})}else i?r.resolve({data:"DONE",statusCode:200}):r.reject({data:s,statusCode:o})})).catch((function(e){r.reject(e)}))}(),r.promise}},{key:"executeWithAsyncPaging",value:function(e){var t=a.default.defer(),r=t.promise;return this._loadData(e).then((function(e){t.resolve(e)}),null,(function(e){t.notify(e)})).catch((function(e){t.reject(e)})),r}},{key:"_getServiceBaseURL",value:function(){return this._serviceBaseURL}}]),e}());r.default=o,t.exports=r.default},{merge:112,q:120}],286:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./Search")),o=i(e("q")),s=function(e){function t(e,r,n,i,a,o,s,u,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,i,a,o,s,u,c)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then((function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities){if(n.devices=n.entities,n.devices.length>0){var a=!1,o=r&&r.flattened||!1;for(a=0;a<n.devices.length;a++)if(o){if(n.devices[a]["device.identifier"]){var s=n.devices[a]["device.identifier"];(!s._value||s._value&&!s._value._current)&&delete n.devices[a]["device.identifier"]}}else n.devices[a].device&&n.devices[a].device.identifier&&!n.devices[a].device.identifier._current&&delete n.devices[a].device.identifier}delete n.entities}e.resolve({data:n,statusCode:i})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"./Search":289,q:120}],287:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./Search")),o=i(e("q")),s=function(e){function t(e,r,n,i,a,o,s,u,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,i,a,o,s,u,c)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then((function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities&&n.entities.length>0){var a=!1,o=r&&r.flattened||!1;for(a=0;a<n.entities.length;a++)if(o){if(n.entities[a]["device.identifier"]){var s=n.entities[a]["device.identifier"];(!s._value||s._value&&!s._value._current)&&delete n.entities[a]["device.identifier"]}}else n.entities[a].device&&n.entities[a].device.identifier&&!n.entities[a].device.identifier._current&&delete n.entities[a].device.identifier}e.resolve({data:n,statusCode:i})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=s,t.exports=r.default},{"./Search":289,q:120}],288:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./../util/Expression"),o=((i=a)&&i.__esModule,function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._filterTemplate={filter:{}}}return n(e,[{key:"or",value:function(){void 0===this._filterTemplate.filter.or&&(this._filterTemplate.filter.or=[]),void 0!==this._filterTemplate.filter.and&&(console.warn('The filter not allow both elements [and,or], the item "and" are going to be removed.'),delete this._filterTemplate.filter.and);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.or.push(t[n]);return this}},{key:"and",value:function(){void 0===this._filterTemplate.filter.and&&(this._filterTemplate.filter.and=[]),void 0!==this._filterTemplate.filter.or&&(console.warn('The filter not allow both elements [and,or], the item "or" are going to be removed.'),delete this._filterTemplate.filter.or);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.and.push(t[n]);return this}}]),e}());r.default=o,t.exports=r.default},{"./../util/Expression":369}],289:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./BaseSearch")),o=i(e("merge")),s=function(e){function t(e,r,n,i,a,s,u,c,l){void 0===i&&(i={limit:{}}),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"search"+r,c),this._setUrlParameters(l),this._postObj=(0,o.default)(n,i,s,u),"object"==typeof a&&(this._postObj=(0,o.default)(this._postObj,a))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_filter",value:function(){return this._postObj}}]),t}(a.default);r.default=s,t.exports=r.default},{"./BaseSearch":285,merge:112}],290:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./BaseSearch")),o=i(e("merge")),s=function(e){function t(e,r,n,i,a,s,u,c){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"search"+r,u),this._setUrlParameters(c),this._postObj=(0,o.default)(n,a,s),"object"==typeof i&&(this._postObj=(0,o.default)(this._postObj,i))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_filter",value:function(){return this._postObj}}]),t}(a.default);r.default=s,t.exports=r.default},{"./BaseSearch":285,merge:112}],291:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./../util/SelectElement"),o=((i=a)&&i.__esModule,function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._selectTemplate={select:[]}}return n(e,[{key:"add",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n],a=this._selectTemplate.select;if(0===a.length)this._selectTemplate.select.push(i);else{for(var o=!1,s=0;s<a.length;s++){var u=a[s];if(u.name===i.name){o=!0;for(var c=i.fields,l=0;l<c.length;l++){for(var p=c[n],f=!1,d=0;d<u.fields.length;d++)u.fields[d].field===p.field&&(f=!0,p.alias&&(u.fields[d].alias=p.alias));f||this._selectTemplate.select[s].fields.push(p)}}}o||this._selectTemplate.select.push(i)}}return this}}]),e}());r.default=o,t.exports=r.default},{"./../util/SelectElement":371}],292:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./Search")),o=i(e("q")),s=function(e){function t(e,r,n,i,a,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog"+r,n,null,null,i),this._contentType=a,this._customFilters=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"execute",value:function(){var e=this,t=[],r="entityType",n=o.default.defer(),i=n.promise,a=e._content(e._contentType),s=e._customFilters&&e._customFilters[r],u=Object.keys(e._customFilters).length,c=u>1||1===u&&!s,l={};switch(s?l[s]=a[s]:l=a,e._contentType){case"operationalStatus":for(var p in l)l[p].forEach((function(r){(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===r)&&t.push({entityType:p,id:r})}));break;case"administrativeState":var f=function(e){var n=e;n[r]=d,t.push(n)};for(var d in l){var h=l[d];for(var m in h)if(c){for(var v in e._customFilters)if(h[m][v]===e._customFilters[v]){f(h[m]);break}}else f(h[m])}break;case"fieldsDefinition":case"communicationsModuleType":var y=c&&e._customFilters.type;if(void 0===y){n.resolve({error:"Filters not allowed",statusCode:400});break}var g=y?l[y]:l;t=g;break;case"userProfile":for(var _ in l)(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===_)&&l[_].length>0&&t.push({id:_,managed:l[_]});break;case"serviceGroups":s&&(t=l[s]);break;case"allowedResourceType":for(var b in l)(!e._customFilters.type||e._customFilters.type&&l[b].types.indexOf(e._customFilters.type)>-1)&&t.push(l[b].resourceType);break;case"ticketSeverity":case"ticketPriority":case"ticketStatus":case"ruleConfigurationSeverity":case"ruleMode":case"ruleType":case"ioTDatastreamPeriod":case"ioTDatastreamAccess":case"resourceType":case"countryCodes":case"timezones":case"userLanguages":case"ioTDatastreamStoragePeriod":if(y){n.resolve({error:"Filters not supported",statuscode:400});break}t=t.concat(l);break;default:n.resolve({data:{},statusCode:400})}if(t&&Object.keys(t).length>0){var w={};w[e._contentType]=t,n.resolve({data:w,statusCode:200})}else n.resolve({data:{},statusCode:204});return i}},{key:"_content",value:function(e){return{ticketSeverity:["CRITICAL","URGENT","WARNING","NORMAL"],ticketPriority:["MAJOR","MINOR","CRITICAL","BLOCKER"],ticketStatus:["CREATED","ASSIGNED","ANSWERED","RESTORED","RESOLVED","CLOSED"],serviceGroups:{ASSET:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"],SUBSCRIBER:["emptyServiceGroup"],SUBSCRIPTION:["emptyServiceGroup"],GATEWAY:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"]},administrativeState:{ASSET:[{id:"BANNED",description:"Asset banned, It means that received information of this asset is not going to be collected"},{id:"DELETED",description:"Asset removed from available stock"},{id:"IN_MAINTENANCE",description:"Asset in maintenance"},{id:"IN_STOCK",description:"Asset in stock"},{id:"IN_TRANSIT",description:"Asset in transit"},{id:"IN_USE",description:"Asset in use"},{id:"MISSING",description:"Asset missing"},{id:"ORDERED",description:"Asset ordered"},{id:"READY",description:"Asset ready for installation"},{id:"RETIRED",description:"Field entity withdrawal"}],GATEWAY:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],COMMUNICATIONS_MODULE:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIBER:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIPTION:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],CERTIFICATE:[{id:"NOT_ACTIVE",description:"NOT_ACTIVE"},{id:"ACTIVE",description:"ACTIVE"},{id:"REVOKED",description:"REVOKED"},{id:"EXPIRED",description:"EXPIRED"}]},operationalStatus:{ASSET:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],GATEWAY:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],COMMUNICATIONS_MODULE:["UNKNOWN","STOPPED","STARTING","RUNNING","STOPPING","ERROR"]},communicationsModuleType:{ADSL:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","ADDRESS","HOME_OPERATOR","LOCATION"]}},CAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},ETH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["subscriptionName","description","administrativeState","ADDRESS"]}},GENERIC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","description","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","description","administrativeState","ICC","SERIAL_NUMBER"]}},GSM:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","description","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","description","administrativeState","ICC"]}},HAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},I2C:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},LOWPAN:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}},LTE_M:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},MESH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]}},MOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},MULTIMOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","subscriptionName","administrativeState","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","subscriberName","administrativeState","description","ICC"]}},NARROWBAND:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","LOCATION"]},SUBSCRIBER:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriberName","description","ICC"]}},PLC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}},RS232:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS422:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS485:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},SIGFOX:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:["PAC"]},SUBSCRIPTION:{mandatory:["generatedEntityKey","subscriptionName","HOME_OPERATOR","administrativeState","description","SIGFOX_DEVICE_TYPE"]}},ZIGBEE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","subscriptionName","description"]}}},ruleMode:["EASY","ADVANCED"],ruleType:["DATASTREAM","OPERATION","EVENT"],ruleConfigurationSeverity:["INFORMATIVE","URGENT","CRITICAL"],userProfile:{root:["admin_domain","admin","advanced","viewer","super_admin_domain"],super_admin_domain:["admin_domain","admin","advanced","viewer"],admin_domain:["admin_domain","admin","advanced","viewer"],admin:["admin","advanced","viewer"],advanced:[],viewer:[]},ioTDatastreamAccess:["READ","WRITE"],ioTDatastreamStoragePeriod:["SECONDS","MINUTES","HOURS","DAYS","MONTHS","YEARS","NEVER"],ioTDatastreamPeriod:["PULSE","CUMULATIVE","INSTANT"],resourceType:[{identifier:"entity.asset"},{identifier:"entity.device"},{identifier:"entity.subscriber"},{identifier:"entity.subscription"},{identifier:"ticket"}],allowedResourceType:[{resourceType:"entity.asset",types:["entity","asset"]},{resourceType:"entity.device",types:["entity","device"]},{resourceType:"entity.subscriber",types:["entity","subscriber"]},{resourceType:"entity.subscription",types:["entity","subscription"]},{resourceType:"ticket",types:["ticket"]},{resourceType:"organization",types:["organization"]},{resourceType:"channel",types:["channel"]}],fieldsDefinition:{string:{description:"Text based value",subtype:["text","password"]},boolean:{description:"Boolean based value",subtype:[]},calendar:{description:"Format is described in the ISO 8601 or in http://www.w3.org/TR/NOTE-datetime",subtype:["datetime","date","time"]},address:{description:"Network address value",subtype:["ip","ipv4","ipv6","mac48"]},number:{description:"Numeric value",subtype:["integer","float","percentage"]},enumeration:{description:"Choice list values",subtype:["string","number"]},array:{description:"Array of values",subtype:["string","number"]},coordinates:{description:"Object indicating coordinates and timestamp in geotime subtype",subtype:["geo","geotime","geojson"]},topology:{description:"Object indicating relations",subtype:["path","tree (not supported yet)"]},object:{description:"Not yet supported. For future uses only",subtype:[]}},userLanguages:[{code:"es",language:"Español/Spanish"},{code:"en",language:"Inglés/English"},{code:"pt",language:"Portugués/Portuguese"}],countryCodes:[{code:"AD",country:"Andorra",zone:"Europe/Andorra"},{code:"AE",country:"United Arab Emirates",zone:"Asia/Dubai"},{code:"AF",country:"Afghanistan",zone:"Asia/Kabul"},{code:"AG",country:"Antigua and Barbuda",zone:"America/Antigua"},{code:"AI",country:"Anguilla",zone:"America/Anguilla"},{code:"AL",country:"Albania",zone:"Europe/Tirane"},{code:"AM",country:"Armenia",zone:"Asia/Yerevan"},{code:"AN",country:"Netherlands Antilles",zone:"Netherlands Antilles"},{code:"AO",country:"Angola",zone:"Africa/Luanda"},{code:"AQ",country:"Antarctica",zone:"Antarctica/McMurdo"},{code:"AR",country:"Argentina",zone:"America/Argentina/Buenos_Aires"},{code:"AS",country:"American Samoa",zone:"Pacific/Pago_Pago"},{code:"AT",country:"Austria",zone:"Europe/Vienna"},{code:"AU",country:"Australia",zone:"Australia/Lord_Howe"},{code:"AW",country:"Aruba",zone:"America/Aruba"},{code:"AX",country:"Aland Islands",zone:"Europe/Mariehamn"},{code:"AZ",country:"Azerbaijan",zone:"Asia/Baku"},{code:"BA",country:"Bosnia and Herzegovina",zone:"Europe/Sarajevo"},{code:"BB",country:"Barbados",zone:"America/Barbados"},{code:"BD",country:"Bangladesh",zone:"Asia/Dhaka"},{code:"BE",country:"Belgium",zone:"Europe/Brussels"},{code:"BF",country:"Burkina Faso",zone:"Africa/Ouagadougou"},{code:"BG",country:"Bulgaria",zone:"Europe/Sofia"},{code:"BH",country:"Bahrain",zone:"Asia/Bahrain"},{code:"BI",country:"Burundi",zone:"Africa/Bujumbura"},{code:"BJ",country:"Benin",zone:"Africa/Porto-Novo"},{code:"BL",country:"Saint Barthélemy",zone:"America/St_Barthelemy"},{code:"BM",country:"Bermuda",zone:"Atlantic/Bermuda"},{code:"BN",country:"Brunei",zone:"Asia/Brunei"},{code:"BO",country:"Bolivia",zone:"America/La_Paz"},{code:"BQ",country:"Bonaire, Saint Eustatius and Saba",zone:"America/Kralendijk"},{code:"BR",country:"Brazil",zone:"America/Noronha"},{code:"BS",country:"Bahamas",zone:"America/Nassau"},{code:"BT",country:"Bhutan",zone:"Asia/Thimphu"},{code:"BV",country:"Bouvet Island",zone:"Bouvet Island"},{code:"BW",country:"Botswana",zone:"Africa/Gaborone"},{code:"BY",country:"Belarus",zone:"Europe/Minsk"},{code:"BZ",country:"Belize",zone:"America/Belize"},{code:"CA",country:"Canada",zone:"America/St_Johns"},{code:"CC",country:"Cocos Islands",zone:"Indian/Cocos"},{code:"CD",country:"Democratic Republic of the Congo",zone:"Africa/Kinshasa"},{code:"CF",country:"Central African Republic",zone:"Africa/Bangui"},{code:"CG",country:"Republic of the Congo",zone:"Africa/Brazzaville"},{code:"CH",country:"Switzerland",zone:"Europe/Zurich"},{code:"CI",country:"Ivory Coast",zone:"Africa/Abidjan"},{code:"CK",country:"Cook Islands",zone:"Pacific/Rarotonga"},{code:"CL",country:"Chile",zone:"America/Santiago"},{code:"CM",country:"Cameroon",zone:"Africa/Douala"},{code:"CN",country:"China",zone:"Asia/Shanghai"},{code:"CO",country:"Colombia",zone:"America/Bogota"},{code:"CR",country:"Costa Rica",zone:"America/Costa_Rica"},{code:"CS",country:"Serbia and Montenegro",zone:"Serbia and Montenegro"},{code:"CU",country:"Cuba",zone:"America/Havana"},{code:"CV",country:"Cape Verde",zone:"Atlantic/Cape_Verde"},{code:"CW",country:"Curaçao",zone:"America/Curacao"},{code:"CX",country:"Christmas Island",zone:"Indian/Christmas"},{code:"CY",country:"Cyprus",zone:"Asia/Nicosia"},{code:"CZ",country:"Czech Republic",zone:"Europe/Prague"},{code:"DE",country:"Germany",zone:"Europe/Berlin"},{code:"DJ",country:"Djibouti",zone:"Africa/Djibouti"},{code:"DK",country:"Denmark",zone:"Europe/Copenhagen"},{code:"DM",country:"Dominica",zone:"America/Dominica"},{code:"DO",country:"Dominican Republic",zone:"America/Santo_Domingo"},{code:"DZ",country:"Algeria",zone:"Africa/Algiers"},{code:"EC",country:"Ecuador",zone:"America/Guayaquil"},{code:"EE",country:"Estonia",zone:"Europe/Tallinn"},{code:"EG",country:"Egypt",zone:"Africa/Cairo"},{code:"EH",country:"Western Sahara",zone:"Africa/El_Aaiun"},{code:"ER",country:"Eritrea",zone:"Africa/Asmara"},{code:"ES",country:"Spain",zone:"Europe/Madrid"},{code:"ET",country:"Ethiopia",zone:"Africa/Addis_Ababa"},{code:"FI",country:"Finland",zone:"Europe/Helsinki"},{code:"FJ",country:"Fiji",zone:"Pacific/Fiji"},{code:"FK",country:"Falkland Islands",zone:"Atlantic/Stanley"},{code:"FM",country:"Micronesia",zone:"Pacific/Chuuk"},{code:"FO",country:"Faroe Islands",zone:"Atlantic/Faroe"},{code:"FR",country:"France",zone:"Europe/Paris"},{code:"GA",country:"Gabon",zone:"Africa/Libreville"},{code:"GB",country:"United Kingdom",zone:"Europe/London"},{code:"GD",country:"Grenada",zone:"America/Grenada"},{code:"GE",country:"Georgia",zone:"Asia/Tbilisi"},{code:"GF",country:"French Guiana",zone:"America/Cayenne"},{code:"GG",country:"Guernsey",zone:"Europe/Guernsey"},{code:"GH",country:"Ghana",zone:"Africa/Accra"},{code:"GI",country:"Gibraltar",zone:"Europe/Gibraltar"},{code:"GL",country:"Greenland",zone:"America/Godthab"},{code:"GM",country:"Gambia",zone:"Africa/Banjul"},{code:"GN",country:"Guinea",zone:"Africa/Conakry"},{code:"GP",country:"Guadeloupe",zone:"America/Guadeloupe"},{code:"GQ",country:"Equatorial Guinea",zone:"Africa/Malabo"},{code:"GR",country:"Greece",zone:"Europe/Athens"},{code:"GS",country:"South Georgia and the South Sandwich Islands",zone:"Atlantic/South_Georgia"},{code:"GT",country:"Guatemala",zone:"America/Guatemala"},{code:"GU",country:"Guam",zone:"Pacific/Guam"},{code:"GW",country:"Guinea-Bissau",zone:"Africa/Bissau"},{code:"GY",country:"Guyana",zone:"America/Guyana"},{code:"HK",country:"Hong Kong",zone:"Asia/Hong_Kong"},{code:"HM",country:"Heard Island and McDonald Islands",zone:"Heard Island and McDonald Islands"},{code:"HN",country:"Honduras",zone:"America/Tegucigalpa"},{code:"HR",country:"Croatia",zone:"Europe/Zagreb"},{code:"HT",country:"Haiti",zone:"America/Port-au-Prince"},{code:"HU",country:"Hungary",zone:"Europe/Budapest"},{code:"ID",country:"Indonesia",zone:"Asia/Jakarta"},{code:"IE",country:"Ireland",zone:"Europe/Dublin"},{code:"IL",country:"Israel",zone:"Asia/Jerusalem"},{code:"IM",country:"Isle of Man",zone:"Europe/Isle_of_Man"},{code:"IN",country:"India",zone:"Asia/Kolkata"},{code:"IO",country:"British Indian Ocean Territory",zone:"Indian/Chagos"},{code:"IQ",country:"Iraq",zone:"Asia/Baghdad"},{code:"IR",country:"Iran",zone:"Asia/Tehran"},{code:"IS",country:"Iceland",zone:"Atlantic/Reykjavik"},{code:"IT",country:"Italy",zone:"Europe/Rome"},{code:"JE",country:"Jersey",zone:"Europe/Jersey"},{code:"JM",country:"Jamaica",zone:"America/Jamaica"},{code:"JO",country:"Jordan",zone:"Asia/Amman"},{code:"JP",country:"Japan",zone:"Asia/Tokyo"},{code:"KE",country:"Kenya",zone:"Africa/Nairobi"},{code:"KG",country:"Kyrgyzstan",zone:"Asia/Bishkek"},{code:"KH",country:"Cambodia",zone:"Asia/Phnom_Penh"},{code:"KI",country:"Kiribati",zone:"Pacific/Tarawa"},{code:"KM",country:"Comoros",zone:"Indian/Comoro"},{code:"KN",country:"Saint Kitts and Nevis",zone:"America/St_Kitts"},{code:"KP",country:"North Korea",zone:"Asia/Pyongyang"},{code:"KR",country:"South Korea",zone:"Asia/Seoul"},{code:"KW",country:"Kuwait",zone:"Asia/Kuwait"},{code:"KY",country:"Cayman Islands",zone:"America/Cayman"},{code:"KZ",country:"Kazakhstan",zone:"Asia/Almaty"},{code:"LA",country:"Laos",zone:"Asia/Vientiane"},{code:"LB",country:"Lebanon",zone:"Asia/Beirut"},{code:"LC",country:"Saint Lucia",zone:"America/St_Lucia"},{code:"LI",country:"Liechtenstein",zone:"Europe/Vaduz"},{code:"LK",country:"Sri Lanka",zone:"Asia/Colombo"},{code:"LR",country:"Liberia",zone:"Africa/Monrovia"},{code:"LS",country:"Lesotho",zone:"Africa/Maseru"},{code:"LT",country:"Lithuania",zone:"Europe/Vilnius"},{code:"LU",country:"Luxembourg",zone:"Europe/Luxembourg"},{code:"LV",country:"Latvia",zone:"Europe/Riga"},{code:"LY",country:"Libya",zone:"Africa/Tripoli"},{code:"MA",country:"Morocco",zone:"Africa/Casablanca"},{code:"MC",country:"Monaco",zone:"Europe/Monaco"},{code:"MD",country:"Moldova",zone:"Europe/Chisinau"},{code:"ME",country:"Montenegro",zone:"Europe/Podgorica"},{code:"MF",country:"Saint Martin",zone:"America/Marigot"},{code:"MG",country:"Madagascar",zone:"Indian/Antananarivo"},{code:"MH",country:"Marshall Islands",zone:"Pacific/Majuro"},{code:"MK",country:"Macedonia",zone:"Europe/Skopje"},{code:"ML",country:"Mali",zone:"Africa/Bamako"},{code:"MM",country:"Myanmar",zone:"Asia/Yangon"},{code:"MN",country:"Mongolia",zone:"Asia/Ulaanbaatar"},{code:"MO",country:"Macao",zone:"Asia/Macau"},{code:"MP",country:"Northern Mariana Islands",zone:"Pacific/Saipan"},{code:"MQ",country:"Martinique",zone:"America/Martinique"},{code:"MR",country:"Mauritania",zone:"Africa/Nouakchott"},{code:"MS",country:"Montserrat",zone:"America/Montserrat"},{code:"MT",country:"Malta",zone:"Europe/Malta"},{code:"MU",country:"Mauritius",zone:"Indian/Mauritius"},{code:"MV",country:"Maldives",zone:"Indian/Maldives"},{code:"MW",country:"Malawi",zone:"Africa/Blantyre"},{code:"MX",country:"Mexico",zone:"America/Mexico_City"},{code:"MY",country:"Malaysia",zone:"Asia/Kuala_Lumpur"},{code:"MZ",country:"Mozambique",zone:"Africa/Maputo"},{code:"NA",country:"Namibia",zone:"Africa/Windhoek"},{code:"NC",country:"New Caledonia",zone:"Pacific/Noumea"},{code:"NE",country:"Niger",zone:"Africa/Niamey"},{code:"NF",country:"Norfolk Island",zone:"Pacific/Norfolk"},{code:"NG",country:"Nigeria",zone:"Africa/Lagos"},{code:"NI",country:"Nicaragua",zone:"America/Managua"},{code:"NL",country:"Netherlands",zone:"Europe/Amsterdam"},{code:"NO",country:"Norway",zone:"Europe/Oslo"},{code:"NP",country:"Nepal",zone:"Asia/Kathmandu"},{code:"NR",country:"Nauru",zone:"Pacific/Nauru"},{code:"NU",country:"Niue",zone:"Pacific/Niue"},{code:"NZ",country:"New Zealand",zone:"Pacific/Auckland"},{code:"OM",country:"Oman",zone:"Asia/Muscat"},{code:"PA",country:"Panama",zone:"America/Panama"},{code:"PE",country:"Peru",zone:"America/Lima"},{code:"PF",country:"French Polynesia",zone:"Pacific/Tahiti"},{code:"PG",country:"Papua New Guinea",zone:"Pacific/Port_Moresby"},{code:"PH",country:"Philippines",zone:"Asia/Manila"},{code:"PK",country:"Pakistan",zone:"Asia/Karachi"},{code:"PL",country:"Poland",zone:"Europe/Warsaw"},{code:"PM",country:"Saint Pierre and Miquelon",zone:"America/Miquelon"},{code:"PN",country:"Pitcairn",zone:"Pacific/Pitcairn"},{code:"PR",country:"Puerto Rico",zone:"America/Puerto_Rico"},{code:"PS",country:"Palestinian Territory",zone:"Asia/Gaza"},{code:"PT",country:"Portugal",zone:"Europe/Lisbon"},{code:"PW",country:"Palau",zone:"Pacific/Palau"},{code:"PY",country:"Paraguay",zone:"America/Asuncion"},{code:"QA",country:"Qatar",zone:"Asia/Qatar"},{code:"RE",country:"Reunion",zone:"Indian/Reunion"},{code:"RO",country:"Romania",zone:"Europe/Bucharest"},{code:"RS",country:"Serbia",zone:"Europe/Belgrade"},{code:"RU",country:"Russia",zone:"Europe/Kaliningrad"},{code:"RW",country:"Rwanda",zone:"Africa/Kigali"},{code:"SA",country:"Saudi Arabia",zone:"Asia/Riyadh"},{code:"SB",country:"Solomon Islands",zone:"Pacific/Guadalcanal"},{code:"SC",country:"Seychelles",zone:"Indian/Mahe"},{code:"SD",country:"Sudan",zone:"Africa/Khartoum"},{code:"SE",country:"Sweden",zone:"Europe/Stockholm"},{code:"SG",country:"Singapore",zone:"Asia/Singapore"},{code:"SH",country:"Saint Helena",zone:"Atlantic/St_Helena"},{code:"SI",country:"Slovenia",zone:"Europe/Ljubljana"},{code:"SJ",country:"Svalbard and Jan Mayen",zone:"Arctic/Longyearbyen"},{code:"SK",country:"Slovakia",zone:"Europe/Bratislava"},{code:"SL",country:"Sierra Leone",zone:"Africa/Freetown"},{code:"SM",country:"San Marino",zone:"Europe/San_Marino"},{code:"SN",country:"Senegal",zone:"Africa/Dakar"},{code:"SO",country:"Somalia",zone:"Africa/Mogadishu"},{code:"SR",country:"Suriname",zone:"America/Paramaribo"},{code:"SS",country:"South Sudan",zone:"Africa/Juba"},{code:"ST",country:"Sao Tome and Principe",zone:"Africa/Sao_Tome"},{code:"SV",country:"El Salvador",zone:"America/El_Salvador"},{code:"SX",country:"Sint Maarten",zone:"America/Lower_Princes"},{code:"SY",country:"Syria",zone:"Asia/Damascus"},{code:"SZ",country:"Swaziland",zone:"Africa/Mbabane"},{code:"TC",country:"Turks and Caicos Islands",zone:"America/Grand_Turk"},{code:"TD",country:"Chad",zone:"Africa/Ndjamena"},{code:"TF",country:"French Southern Territories",zone:"Indian/Kerguelen"},{code:"TG",country:"Togo",zone:"Africa/Lome"},{code:"TH",country:"Thailand",zone:"Asia/Bangkok"},{code:"TJ",country:"Tajikistan",zone:"Asia/Dushanbe"},{code:"TK",country:"Tokelau",zone:"Pacific/Fakaofo"},{code:"TL",country:"East Timor",zone:"Asia/Dili"},{code:"TM",country:"Turkmenistan",zone:"Asia/Ashgabat"},{code:"TN",country:"Tunisia",zone:"Africa/Tunis"},{code:"TO",country:"Tonga",zone:"Pacific/Tongatapu"},{code:"TR",country:"Turkey",zone:"Europe/Istanbul"},{code:"TT",country:"Trinidad and Tobago",zone:"America/Port_of_Spain"},{code:"TV",country:"Tuvalu",zone:"Pacific/Funafuti"},{code:"TW",country:"Taiwan",zone:"Asia/Taipei"},{code:"TZ",country:"Tanzania",zone:"Africa/Dar_es_Salaam"},{code:"UA",country:"Ukraine",zone:"Europe/Kiev"},{code:"UG",country:"Uganda",zone:"Africa/Kampala"},{code:"UM",country:"United States Minor Outlying Islands",zone:"Pacific/Midway"},{code:"US",country:"United States",zone:"America/New_York"},{code:"UY",country:"Uruguay",zone:"America/Montevideo"},{code:"UZ",country:"Uzbekistan",zone:"Asia/Samarkand"},{code:"VA",country:"Vatican",zone:"Europe/Vatican"},{code:"VC",country:"Saint Vincent and the Grenadines",zone:"America/St_Vincent"},{code:"VE",country:"Venezuela",zone:"America/Caracas"},{code:"VG",country:"British Virgin Islands",zone:"America/Tortola"},{code:"VI",country:"U.S. Virgin Islands",zone:"America/St_Thomas"},{code:"VN",country:"Vietnam",zone:"Asia/Ho_Chi_Minh"},{code:"VU",country:"Vanuatu",zone:"Pacific/Efate"},{code:"WF",country:"Wallis and Futuna",zone:"Pacific/Wallis"},{code:"WS",country:"Samoa",zone:"Pacific/Apia"},{code:"XK",country:"Kosovo",zone:"Kosovo"},{code:"YE",country:"Yemen",zone:"Asia/Aden"},{code:"YT",country:"Mayotte",zone:"Indian/Mayotte"},{code:"ZA",country:"South Africa",zone:"Africa/Johannesburg"},{code:"ZM",country:"Zambia",zone:"Africa/Lusaka"},{code:"ZW",country:"Zimbabwe",zone:"Africa/Harare"}],timezones:["ACT","AET","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","AGT","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port_of_Spain","America/Port-au-Prince","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","ART","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","AST","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/North","Australia/NSW","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","BET","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","BST","Canada/Atlantic","Canada/Central","Canada/East-Saskatchewan","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","CAT","CET","Chile/Continental","Chile/EasterIsland","CNT","CST","CST6CDT","CTT","Cuba","EAT","ECT","EET","Egypt","Eire","EST","EST5EDT","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT0","Greenwich","Hongkong","HST","Iceland","IET","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","IST","Jamaica","Japan","JST","Kwajalein","Libya","MET","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","MIT","MST","MST7MDT","Navajo","NET","NST","NZ","NZ-CHAT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","PLT","PNT","Poland","Portugal","PRC","PRT","PST","PST8PDT","ROK","Singapore","SST","SystemV/AST4","SystemV/AST4ADT","SystemV/CST6","SystemV/CST6CDT","SystemV/EST5","SystemV/EST5EDT","SystemV/HST10","SystemV/MST7","SystemV/MST7MDT","SystemV/PST8","SystemV/PST8PDT","SystemV/YST9","SystemV/YST9YDT","Turkey","UCT","Universal","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","VST","W-SU","WET","Zulu"]}[e]}}]),t}(a.default);r.default=s,t.exports=r.default},{"./Search":289,q:120}],293:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./BaseSearch")),o=i(e("merge")),s=i(e("q")),u=function(e){function t(e,r,n,i,a,s,u,c,l){void 0===i&&(i={limit:{}}),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,c),this._setUrlParameters(l),this._postObj=(0,o.default)(n,i,s,u),"object"==typeof a&&(this._postObj=(0,o.default)(this._postObj,a))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_filter",value:function(){return this._postObj}},{key:"_loadData",value:function(e){var t=this,r=s.default.defer(),n=t._asyncPagingFilter(),i=!1;return function e(){if(t.cancel||"string"==typeof t.cancel){var a="string"==typeof t.cancel?t.cancel:"Cancel process";r.reject({data:a,statusCode:403})}else t._ogapi.Napi.post(t._resource,n,t._timeout,t._getExtraHeaders(),t._getUrlParameters()).then((function(t){var a=t.statusCode,o=t.body;if(!o&&t.text)try{var s=JSON.parse(t.text);s&&(o=s)}catch(e){console.warn("Impossible to parse text from response: "+t.text)}200===a?(i=!0,r.notify(o),o.data.length===n.limit.size?(n.limit.start+=1,e()):r.resolve({data:"DONE",statusCode:200})):i?r.resolve({data:"DONE",statusCode:200}):r.reject({data:o,statusCode:a})})).catch((function(e){r.reject(e)}))}(),r.promise}}]),t}(a.default);r.default=u,t.exports=r.default},{"./BaseSearch":285,merge:112,q:120}],294:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/administrativeState",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"administrativeState",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],295:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="$_token";r.TOKEN_URL=u;var c=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new s.default(e,"/alarms"):arguments[1];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscriptions:"/subscriptions"},r),this._url="/entities"+u+"/alarms"}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(u,this._routes[e]));return this._url=this._url.replace(u,""),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],296:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/allowedResourceType",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"allowedResourceType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e.toLowerCase(),this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],297:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/areas",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],298:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./PreFilteredSearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../AssetSearch")),u="/entities",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.asset.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}},{key:"select",value:function(e){return this._builderParams.select=e||void 0,this}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"../AssetSearch":284,"./PreFilteredSearchBuilder":331}],299:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=(i(e("merge")),i(e("jsonpath"))),s=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._resource="resources/schemaTypes/og_basic_types",this._headers=void 0,this._og_basic_types={},this.publicParameters=!1,this._urlParameters=void 0}return n(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=this,t=a.default.defer(),r=t.promise;return this._setExtraHeaders({Accept:"application/json"}),this._ogapi.Napi.get(this._resource,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(r){var n=r.body,i=r.statusCode;if(e._og_basic_types=n,o.default.apply(e._og_basic_types,"$..['$ref']",(function(e,t){var r="$.."+e.replace("#/definitions/","");return o.default.query(n,r)[0]})).forEach((function(e){var t=o.default.stringify(e.path);o.default.value(n,t,e.value)})),e.path){var a=e.path.includes("$")?e.path:"$.."+e.path,s=o.default.query(n,a)[0]||{msg:"not Found"};t.resolve({data:s,statusCode:i})}else{if(e.publicParameters)for(var u in n.definitions)n.definitions[u].public&&!1!==n.definitions[u].public||delete n.definitions[u];t.resolve({data:n,statusCode:i})}})).catch((function(e){t.reject(e)})),r}},{key:"withPath",value:function(e){return this.path=e,this}},{key:"withPublicParameters",value:function(e){return this.publicParameters=e,this}},{key:"build",value:function(){return this}}]),e}();r.default=s,t.exports=r.default},{jsonpath:104,merge:112,q:120}],300:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../WPSearch")),u="provisionProcessors/bulk/search",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"../WPSearch":293,"./SearchBuilder":335}],301:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/bulk/async",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],302:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/bundles",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],303:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s="/certificates",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,s)),this._url=s,this._fetch=!1,this._assignable=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"assignable",value:function(){return this._assignable=!0,this}},{key:"administrable",value:function(){return this._assignable=!1,this}},{key:"withFetch",value:function(e){if(!0!==e&&!1!==e)throw new Error("Flag fecth incorrect");return this._fetch=e,this}},{key:"_buildUrl",value:function(){var e=this._url;return!0===this._fetch&&(this._urlParams.fetch=1),!0===this._assignable&&(this._urlParams.visibility="assignable"),e}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],304:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="/channels",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,u)),this._url=u,this._summary=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],305:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/communicationsModuleType",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"communicationsModuleType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],306:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/countryCodes",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"countryCodes",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],307:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/datamodels",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],308:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("merge")),s=i(e("moment")),u=i(e("../../util/searchingFields/FieldFinder")),c=e("../../util/DATE_FORMAT"),l="/datapoints",p=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new u.default(e,l)),this._url=l,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withDeviceId",value:function(e){if("string"!=typeof e)throw new Error("Parameter deviceId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.device",e)),this}},{key:"withDatastream",value:function(e){if("string"!=typeof e)throw new Error("Parameter datastreamId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.datastream",e)),this}},{key:"withFeed",value:function(e){if("string"!=typeof e)throw new Error("Parameter feedId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.feed",e)),this}},{key:"betweenDates",value:function(e,t){if("object"!=typeof e||e.constructor!==Date)throw new Error("Parameter fromDate must be a Date");if(this.fluentFilter.and(this._parent.EX.gt("datapoint.at",(0,s.default)(e).format(c.DATE_FORMAT))),void 0!==t){if(t.constructor!==Date)throw new Error("Parameter toDate must be a Date");this.fluentFilter.and(this._parent.EX.lt("datapoint.at",(0,s.default)(t).format(c.DATE_FORMAT)))}return this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,o.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [betweenDates, addTag, withDatastreamId, withDeviceId] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}},{key:"select",value:function(e){return this._builderParams.select=e,this}}]),t}(a.default);r.default=p,t.exports=r.default},{"../../util/DATE_FORMAT":368,"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335,merge:112,moment:116}],309:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u=a(e("../EntitySearch")),c="$_token";r.TOKEN_URL=c;var l=function(e){function t(e,r,n){var a=arguments.length<=3||void 0===arguments[3]?new s.default(e,"/entities"):arguments[3];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/"},a),this._url="/organizations/"+r+"/datasets/"+n+c}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(c,this._routes[e]));return this._url=this._url.replace(c,""),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new u.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(o.default);r.default=l},{"../../util/searchingFields/FieldFinder":374,"../EntitySearch":287,"./SearchWithSummaryBuilder":336}],310:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../WPSearch")),u="datasets";r.BASE_URL=u;var c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u,{organization:r,dataset:n})),this._url=u+"/provision/organizations/"+r+"/"+n+"/data"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(a.default);r.default=c},{"../../util/searchingFields/FieldFinder":374,"../WPSearch":293,"./SearchBuilder":335}],311:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/catalog/datasets",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],312:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=(n(e("../Search")),n(e("../../util/searchingFields/FieldFinder"))),o="/datastreams",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"../Search":289,"./SearchBuilder":335}],313:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="/catalog/plans/device",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("Parameter domainName must be a string");return this._domainName=e,this}},{key:"_buildUrl",value:function(){if(!this._domainName)throw new Error("Parameter domainName must be defined");return this._url=u+"?domainName="+this._domainName,i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],314:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./PreFilteredSearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s="/entities",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,s)),this._url=s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.device.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./PreFilteredSearchBuilder":331}],315:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="/domains",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,u)),this._url=u,this._summary=!1}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],316:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u=a(e("../EntitySearch")),c="$_token";r.TOKEN_URL=c;var l=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new s.default(e,"/entities"):arguments[1];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices"},r),this._url="/entities"+c}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(c,this._routes[e]));return this._url=this._url.replace(c,""),i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new u.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(o.default);r.default=l},{"../../util/searchingFields/FieldFinder":374,"../EntitySearch":287,"./SearchWithSummaryBuilder":336}],317:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new a.default(e,"/operations/history"):arguments[1];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},r),this._url="/entities/operations/history"}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=o,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],318:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="$_token";r.TOKEN_URL=u;var c=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new s.default(e,"/operations"):arguments[1];return function(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscribers:"/subscribers",onSubscriptions:"/subscriptions",onCommunicationsModules:"/communicationsModules"},r),this._url="/entities"+u+"/operations"}.apply(this,arguments)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildUrl",value:function(){for(var e in this._checkConstraintRoutes(),this._routes)this._builderParams[e]&&(this._url=this._url.replace(u,this._routes[e]));return i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],319:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/feeds",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],320:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/fieldsDefinition",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"fieldsDefinition",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],321:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchBuilder")),s=a(e("../DeviceSearch")),u=function(e){function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"_buildUrl",value:function(){return i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(o.default);r.default=u,t.exports=r.default},{"../DeviceSearch":286,"./SearchBuilder":335}],322:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchWithSummaryBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s="/catalog/hardwares",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,s)),this._url=s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e,this}},{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],323:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamAccess",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamAccess",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],324:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamPeriod",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamPeriod",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],325:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamStoragePeriod",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamStoragePeriod",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],326:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/catalog/operators",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],327:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../SearchWithoutLimit")),u="/operationTypes",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){try{return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}catch(e){console.error("!errrrror!!!!!!",e)}}}]),t}(a.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"../SearchWithoutLimit":290,"./SearchBuilder":335}],328:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/operationalStatus",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"operationalStatus",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],329:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/jobs",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],330:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("./SearchWithSummaryBuilder")),s=a(e("../../util/searchingFields/FieldFinder")),u="/catalog/plans/organization",c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,u)),this._url=u}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("Parameter domainName must be a string");return this._domainName=e,this}},{key:"_buildUrl",value:function(){if(!this._domainName)throw new Error("Parameter domainName must be defined");return this._url=u+"?domainName="+this._domainName,i(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(o.default);r.default=c,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],331:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./FlattenedSearchBuilder"),o=function(e){function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"provisioned",value:function(){return this._provisioned=!0,this}},{key:"collected",value:function(){return this._collected=!0,this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"./FlattenedSearchBuilder":321}],332:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();e("./SearchBuilder");var i,a=e("../Search"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._api=t}return n(e,[{key:"from",value:function(e){if("string"!=typeof e)throw new Error("Url parameter is mandatory and must be a string");return this._url=e,this}},{key:"filter",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this._filter={filter:e},this}},{key:"limit",value:function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];return this._limit={limit:e},this}},{key:"build",value:function(){if("string"!=typeof this._url)throw new Error("Url parameter is mandatory and must be a string");return new o.default(this._api,this._url,this._filter,this._limit,{})}}]),e}();r.default=s,t.exports=r.default},{"../Search":289,"./SearchBuilder":335}],333:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/resourceType",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"resourceType",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],334:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/rules",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],335:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../Search"),o=(i=a)&&i.__esModule?i:{default:i},s=function(){function e(t,r,n){var i=this;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");this._url="",this._fieldFinder=n,this._parent=t,this._routes=r,this._routesName=[],this._builderParams={summary:!1,sort:[],filter:{},limit:void 0,group:void 0,select:void 0};var a=function(e){i._routesName.push(e),i._builderParams[e]=!1,i[e]=function(){var t=arguments.length<=0||void 0===arguments[0]?e:arguments[0];return i._builderParams[t]=!0,i}};for(var o in this._routes)a(o);this._urlParams={}}return n(e,[{key:"findFields",value:function(e){return this._fieldFinder.find(e)}},{key:"findAllFields",value:function(e){return this._fieldFinder.findAll(e)}},{key:"findFieldPath",value:function(e){return this._fieldFinder.findFieldPath(e)}},{key:"withTimeout",value:function(){var e=arguments.length<=0||void 0===arguments[0]?2e3:arguments[0];if("number"!=typeof e)throw new Error("Parameter ms must be a number");return this._builderParams.timeout=e,this}},{key:"filter",value:function(e){return this._builderParams.filter=e||{},this}},{key:"addSortAscendingBy",value:function(e){return this.addSortBy(e,"ASCENDING")}},{key:"addSortDescendingBy",value:function(e){return this.addSortBy(e,"DESCENDING")}},{key:"addSortBy",value:function(e,t){if(e&&t)if(this._builderParams.sort.length>0){var r=0,n=!1;for(r=0;r<this._builderParams.sort.length;r++)this._builderParams.sort[r].name===e&&(this._builderParams.sort[r].type=t,n=!0);n||this._builderParams.sort.push({name:e,type:t})}else this._builderParams.sort.push({name:e,type:t});return this}},{key:"removeSortBy",value:function(e){if(e){if(this._builderParams.sort.length>0){var t=0;for(t=0;t<this._builderParams.sort.length;t++)this._builderParams.sort[t].name===e&&(this._builderParams.sort.splice(t,t+1),t--)}}else this._builderParams.sort=[];return this}},{key:"limit",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?1:arguments[1];if("number"!=typeof e)throw new Error("size parameter must be a number");return("number"!=typeof t||t<1)&&(t=1),this._builderParams.limit={size:e,start:t},this}},{key:"build",value:function(){try{return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}catch(e){console.error("!errrrror!!!!!!",e)}}},{key:"_buildFilter",value:function(){var e=this._builderParams.filter;return void 0!==e._filterTemplate?e._filterTemplate:{filter:e}}},{key:"_buildSelect",value:function(){var e=this._builderParams.select;return void 0!==e&&void 0!==e._selectTemplate?e._selectTemplate:{select:e}}},{key:"_buildGroup",value:function(){var e=this._builderParams.group;return void 0!==e&&void 0!==e._groupTemplate?e._groupTemplate:{group:e}}},{key:"_buildLimit",value:function(){return void 0===this._builderParams.limit?{limit:{size:1e3,start:1}}:{limit:this._builderParams.limit}}},{key:"_buildSort",value:function(){if(0!==this._builderParams.sort.length)return{sort:{parameters:this._builderParams.sort}}}},{key:"_buildUrl",value:function(){if("string"!=typeof this._url||0===this._url.trim().length)throw new Error("Error on extends SearchBuilder, this._url is not defined.");return this._url}},{key:"_checkConstraintRoutes",value:function(){var e=!(arguments.length<=0||void 0===arguments[0])&&arguments[0],t=!1;for(var r in this._routes){if(t&&this._builderParams[r]&&!e)throw new Error("Must select only one of this:"+JSON.stringify(this._routesName));t=t||this._builderParams[r]}if(!t)throw new Error("Must select one at least: "+JSON.stringify(this._routesName))}}]),e}();r.default=s,t.exports=r.default},{"../Search":289}],336:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./SearchBuilder"),o=function(e){function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"./SearchBuilder":335}],337:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s="serviceGroups",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/"+s,this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,s,this.customFilters)}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(a.default);r.default=u,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],338:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchWithSummaryBuilder")),o=i(e("merge")),s=i(e("../../util/searchingFields/FieldFinder")),u=["SOFTWARE","FIRMWARE"];r.SOFTWARE_TYPES_ENUM=u;var c="/catalog/softwares",l=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new s.default(e,c)),this._url=c,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter softwareId must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareId",e)),this}},{key:"withName",value:function(e){if("string"!=typeof e)throw new Error("Parameter softwareName must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareName",e)),this}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter version must be a string");var t="";if(void 0===u.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error("Parameter in TYPE is not allowed. Parameter value '"+JSON.stringify(t)+"', parameters allowed in administrativeState are: '"+JSON.stringify(u)+"'");return this.fluentFilter.and(this._parent.EX.eq("softwareType",e)),this}},{key:"withVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter version must be a string");return this.fluentFilter.and(this._parent.EX.eq("softwareVersion",e)),this}},{key:"withHardwareId",value:function(e){if("string"!=typeof e)throw new Error("Parameter hardwareId must be a string");return this.fluentFilter.and(this._parent.EX.eq("hardwareId",e)),this}},{key:"withModel",value:function(e){if("string"!=typeof e)throw new Error("Parameter modelName must be a string");return this.fluentFilter.and(this._parent.EX.eq("modelName",e)),this}},{key:"withModelVersion",value:function(e){if("string"!=typeof e)throw new Error("Parameter modelVersion must be a string");return this.fluentFilter.and(this._parent.EX.eq("modelVersion",e)),this}},{key:"withManufacturer",value:function(e){if("string"!=typeof e)throw new Error("Parameter manufacturerName must be a string");return this.fluentFilter.and(this._parent.EX.eq("manufacturerName",e)),this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,o.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [withId, withName, withVersion, withType, withHardwareId, withModel, withModelVersion, withManufacturer] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}}]),t}(a.default);r.default=l},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336,merge:112}],339:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./PreFilteredSearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,"/subscribers")),this._url="/entities"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildFilter",value:function(){var e={and:[{or:[]}]};if(!this._provisioned&&this._collected||e.and[0].or.push({exists:{"provision.device.communicationModules[].subscriber.identifier":!0}}),!this._collected&&this._provisioned||e.and[0].or.push({exists:{"device.communicationModules[].subscriber.identifier":!0}}),this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}}]),t}(a.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./PreFilteredSearchBuilder":331}],340:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./PreFilteredSearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,"/subscriptions")),this._url="/entities"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildFilter",value:function(){var e={and:[{or:[]}]};if(!this._provisioned&&this._collected||e.and[0].or.push({exists:{"provision.device.communicationModules[].subscription.identifier":!0}}),!this._collected&&this._provisioned||e.and[0].or.push({exists:{"device.communicationModules[].subscription.identifier":!0}}),this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}}]),t}(a.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./PreFilteredSearchBuilder":331}],341:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/tasks",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],342:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketPriority",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketPriority",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],343:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketSeverity",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketSeverity",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],344:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketStatus",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketStatus",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],345:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s="/tickets",u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,s)),this._url=s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e,this}},{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}}]),t}(a.default);r.default=u,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchBuilder":335}],346:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../../util/searchingFields/FieldFinder")),s=i(e("../WPSearch")),u="timeseries";r.BASE_URL=u;var c=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new o.default(e,u,{organization:r,timeserie:n})),this._url=u+"/provision/organizations/"+r+"/"+n+"/data"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new s.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(a.default);r.default=c},{"../../util/searchingFields/FieldFinder":374,"../WPSearch":293,"./SearchBuilder":335}],347:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/timezones",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"timezones",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],348:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userLanguages",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userLanguages",this.customFilters)}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],349:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("./SearchBuilder")),o=i(e("../StaticSearch")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userProfile",this.customFilters={}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"build",value:function(){return new o.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userProfile",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}}]),t}(a.default);r.default=s,t.exports=r.default},{"../StaticSearch":292,"./SearchBuilder":335}],350:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/users",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],351:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e("./SearchWithSummaryBuilder")),a=n(e("../../util/searchingFields/FieldFinder")),o="/workgroups",s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new a.default(e,o)),this._url=o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(i.default);r.default=s,t.exports=r.default},{"../../util/searchingFields/FieldFinder":374,"./SearchWithSummaryBuilder":336}],352:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.ADMINISTRATIVE_STATE_ENUM=["NOT_ACTIVE","ACTIVE","REVOKED","EXPIRED"]},{}],353:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../ProvisionGenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=e("./MIME_TYPES_ENUM"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"security/certificates","certificate","Certificate not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findById",value:function(e){return this._id=e,this._execute()}},{key:"_downloadUrl",value:function(){return this._setUrlParameters({format:this._type}),this._composeUrl()}},{key:"findByIdAndFormat",value:function(e,t){var r="";if(void 0===u.MIME_TYPES_ENUM.find((function(e){return e==this}),t)&&(r=t),""!==r)throw new Error("Parameter mimetype is not allowed. Parameter value <'"+JSON.stringify(r)+"'>, mimetype allowed <'"+JSON.stringify(u.MIME_TYPES_ENUM)+"'>");return this._id=e,this._type=t,this._download()}},{key:"_download",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._downloadUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){204===t.statusCode?e.reject({data:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":159,"./MIME_TYPES_ENUM":355,"http-status-codes":76,q:120}],354:[function(require,module,exports){"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var _createClass=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),_get=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var _Security2=require("./Security"),_Security3=_interopRequireDefault(_Security2),_q=require("q"),_q2=_interopRequireDefault(_q),_ADMINISTRATIVE_STATE_ENUM=require("./ADMINISTRATIVE_STATE_ENUM"),_USAGES_ENUM=require("./USAGES_ENUM"),max_length_name=50,max_length_id=50,max_length_description=200,Certificates=function(_Security){function Certificates(e){_classCallCheck(this,Certificates),_get(Object.getPrototypeOf(Certificates.prototype),"constructor",this).call(this,e,"/certificates")}return _inherits(Certificates,_Security),_createClass(Certificates,[{key:"withId",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_id)throw new Error("Parameter id must be a string, cannot be empty and has a maximum length of "+max_length_id);return this._id=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_name)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of "+max_length_name);return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||0===e.length||e.length>max_length_description)throw new Error("Parameter description must be a string, cannot be empty and has a maximum length of "+max_length_description);return this._description=e,this}},{key:"withAdministrativeState",value:function(e){if("string"!=typeof e||e.length<=0)throw new Error("Parameter administrativeState must be typeof string and cannot be empty");var t="";if(void 0===_ADMINISTRATIVE_STATE_ENUM.ADMINISTRATIVE_STATE_ENUM.find((function(e){return e==this}),e)&&(t=e),""!==t)throw new Error("Parameter in administrativeState is not allowed. Parameter value '"+JSON.stringify(t)+"', parameters allowed in administrativeState are: '"+JSON.stringify(_ADMINISTRATIVE_STATE_ENUM.ADMINISTRATIVE_STATE_ENUM)+"'");return this._administrativeState=e,this}},{key:"withUsages",value:function(e){if(void 0===e||e.constructor!==Array||0===e.length)throw new Error("Parameter usages must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++){void 0===_USAGES_ENUM.USAGES_ENUM.find((function(e){return e==this}),e[r])&&t.push(e[r])}if(0!==t.length)throw new Error("There are not any parameters allowed. Parameters value: '"+JSON.stringify(t)+"'. Usages parameters allowed are: '"+JSON.stringify(_USAGES_ENUM.USAGES_ENUM)+"'");return this._usages=e,this}},{key:"_checkHardware",value:function _checkHardware(hardware){"string"==typeof hardware&&(hardware=eval("("+hardware+")"));var length=Object.keys(hardware).length,valid=!1;return(1===length&&hardware.hardwareId&&"string"==typeof hardware.hardwareId&&hardware.hardwareId.length>0||3===length&&hardware.manufacturer&&hardware.model&&hardware.modelVersion&&"string"==typeof hardware.manufacturer&&"string"==typeof hardware.model&&"string"==typeof hardware.modelVersion&&hardware.manufacturer.length>0&&hardware.model.length>0&&hardware.modelVersion.length>0)&&(valid=!0),valid}},{key:"withTags",value:function(e){if(void 0===e||e.constructor!==Array||e.length<=0)throw new Error("Parameter tags must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++)(void 0===e[r]||"string"!=typeof e[r]||typeof e[r].length<=0)&&t.push(e[r]);if(0!==t.length)throw new Error("The following tags values are not allowed:"+JSON.stringify(t));return this._tags=e,this}},{key:"withParameters",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("Parameter parameters must be a string, cannot be empty");return this._parameters=e,this}},{key:"withDomains",value:function(e){if(void 0===e||e.constructor!==Array||e.length<=0)throw new Error("Parameter domains must be typeof Array and cannot be empty");for(var t=[],r=0;r<e.length;r++)(void 0===e[r]||"string"!=typeof e[r]||typeof e[r].length<=0)&&t.push(e[r]);if(0!==t.length)throw new Error("The following domains values are not allowed:"+JSON.stringify(t));return this._domains=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._administrativeState||void 0===this._usages)throw new Error("Parameters name, usages, administrativeState must be defined");return{certificate:{id:this._id||void 0,name:this._name||void 0,description:this._description||void 0,administrativeState:this._administrativeState||void 0,usages:this._usages||void 0,hardware:this._hardware||void 0,tags:this._tags||void 0,parameters:this._parameters||void 0,domains:this._domains||void 0}}}},{key:"create",value:function(e){var t=this,r=void 0;if("string"!=typeof e){r=new FormData;var n=new Blob([JSON.stringify(this._composeElement())],{type:"application/json"});r.append("json",n);var i=new Blob([e],{type:"application/x-pem-file"});e&&r.append("certificate",i)}else(r={}).json=JSON.stringify(this._composeElement()),r.certificate=e;var a=_q2.default.defer(),o=a.promise;return this._ogapi.Napi.post_multipart(this._resource,r,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){var r=e.statusCode;201===r?("function"==typeof t._onCreated&&t._onCreated(e.header.location),a.resolve({location:e.header.location,statusCode:r})):a.reject({errors:e.errors,statusCode:r})})).catch((function(e){a.reject(e)})),o}},{key:"_onCreated",value:function(e){var t=e.split("/").pop(-1);this.withId(t)}},{key:"update",value:function(){var e=this._composeElement();delete e.certificate.id;var t=_q2.default.defer(),r=t.promise;return this._ogapi.Napi.put(this._buildURL(),e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(e){var r=e.body;void 0===r?t.reject("Cannot update the certificate"):t.resolve(r,e.statusCode)})).catch((function(e){t.reject(e)})),r}},{key:"_buildURL",value:function(){if(void 0===this._id)throw new Error("Parameters id must be defined");return this._resource+"/"+this._id}}]),Certificates}(_Security3.default);exports.default=Certificates,module.exports=exports.default},{"./ADMINISTRATIVE_STATE_ENUM":352,"./Security":356,"./USAGES_ENUM":357,q:120}],355:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.MIME_TYPES_ENUM=["x-pem-file","pkcs7-mime","raw","text/plain"]},{}],356:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=e("../provision/BaseProvision"),a=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/security"+(void 0===r?"":r),n)}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t}(((n=i)&&n.__esModule?n:{default:n}).default);r.default=a,t.exports=r.default},{"../provision/BaseProvision":261}],357:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.USAGES_ENUM=["FILE_VALIDATION","DEVICE_COMMUNICATIONS","DEVICE_ACCESS","CERT_SIGN"]},{}],358:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("../util/formats/check_types")),s="timeseries/provision/organizations/";r.URL=s;var u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","timeBucket","identifierColumn"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){var e=s+this._organization+"/"+this._identifier;return this._onlyPlan&&(e+="?onlyPlan=true"),e}},{key:"withOrganization",value:function(e){return o.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return o.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return o.default._checkStringAndPattern(e,"^[a-zA-Z0-9_@.-]*$","name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return o.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withTimeBucket",value:function(e){return o.default._checkNumber(e,"timeBucket"),this._timeBucket=e,this}},{key:"withDescription",value:function(e){return e&&o.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return o.default._checkArray(e,"columns"),this._columns=e,this}},{key:"withBucketColumn",value:function(e){return o.default._checkStringAndPattern(e,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketColumn=e,this}},{key:"withBucketInitColumn",value:function(e){return o.default._checkStringAndPattern(e,"^[a-zA-Z0-9 _-]*$","bucketInitColumn"),this._bucketInitColumn=e,this}},{key:"withRetention",value:function(e){return o.default._checkNumber(e,"retention"),this._retention=e,this}},{key:"withOrigin",value:function(e){return o.default._checkISODateTime(e,"origin"),this._origin=e,this}},{key:"withContext",value:function(e){return o.default._checkArray(e,"context"),this._context=e,this}},{key:"_composeElement",value:function(){return this._resource=s+this._organization,this._timeBucket>0&&(o.default._checkStringAndPattern(this._bucketColumn,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketInitColumn&&o.default._checkStringAndPattern(this._bucketInitColumn,"^[a-zA-Z0-9 _-]*$","bucketInitColumn")),{name:this._name,description:this._description,timeBucket:this._timeBucket,bucketColumn:this._timeBucket?this._bucketColumn:void 0,bucketInitColumn:this._timeBucket?this._bucketInitColumn:void 0,retention:this._retention,origin:this._origin,context:this._context||[],identifierColumn:this._identifierColumn,columns:this._columns||[]}}},{key:"_composeUpdateElement",value:function(){return this._timeBucket>0&&(o.default._checkStringAndPattern(this._bucketColumn,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketInitColumn&&o.default._checkStringAndPattern(this._bucketInitColumn,"^[a-zA-Z0-9 _-]*$","bucketInitColumn")),{name:this._name,description:this._description,timeBucket:this._timeBucket,bucketColumn:this._timeBucket?this._bucketColumn:void 0,bucketInitColumn:this._timeBucket?this._bucketInitColumn:void 0,retention:this._retention,origin:this._origin,context:this._context||[],identifierColumn:this._identifierColumn,columns:this._columns||[]}}},{key:"onlyPlan",value:function(){return this._onlyPlan=!0,this}}]),t}(a.default);r.default=u},{"../provision/BaseProvision":261,"../util/formats/check_types":373}],359:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations","timeseries")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndTimeserieId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],360:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.VALUE_TYPES_ENUM=["integer","number","string","boolean","date-time"]},{}],361:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("q")),s=i(e("../util/formats/check_types")),u=e("./TYPES_ENUM"),c="timeseries/provision/organizations";r.URL=c;var l=function(e){function t(e,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations"),r&&(this.withOrganization(r),n&&this.withIdentifier(n))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withIdentifier",value:function(e){return s.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withOrganization",value:function(e){return s.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withName",value:function(e){return s.default._checkString(e,"name"),this._name=e,this}},{key:"withDescription",value:function(e){return s.default._checkString(e,"description"),this._description=e,this}},{key:"withScript",value:function(e){return s.default._checkString(e,"script"),this._script=e,this}},{key:"withValueTypes",value:function(e){return s.default._checkArray(e,"valueTypes"),e.forEach((function(e){s.default._checkType(e,u.VALUE_TYPES_ENUM)})),this._valueTypes=e,this}},{key:"withReturnType",value:function(e){return s.default._checkString(e,"returnType"),s.default._checkType(e,u.VALUE_TYPES_ENUM),this._returnType=e,this}},{key:"withMetadataFile",value:function(e){this._metadataFile=e}},{key:"_composeElement",value:function(e){this._checkRequiredParameters(e);var t={script:this._script};if(this._metadataFile)t.metadata=this._metadataFile;else{var r=new Blob([JSON.stringify({name:this._name,description:this._description,valueTypes:this._valueTypes||[],returnType:this._returnType||void 0})],{type:"application/json"});t.metadata=r}return t}},{key:"_checkRequiredParameters",value:function(e){if(e){if(!this._script||!(this._metadataFile||this._identifier&&this._organization&&this._name&&this._description))throw new Error("Parameters organization, identifier, name, description and script must be defined")}else if(!this._script||!(this._metadataFile||this._organization&&this._name&&this._description))throw new Error("Parameters organization, name, description and script must be defined")}},{key:"_buildURL",value:function(){return c+"/"+this._organization+"/catalog"+(this._identifier?"/"+this._identifier:"")}},{key:"create",value:function(){var e=o.default.defer();return this._ogapi.Napi.post_multipart(this._buildURL(),this._composeElement(),{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){switch(t.statusCode){case 200:var r=""!=t.text?JSON.parse(t.text):{},n=t.status;e.resolve({data:r,statusCode:n});break;case 201:n=t.status;var i=t.header&&t.header.location;e.resolve({location:i,statusCode:n});break;case 204:e.resolve(t);break;default:e.reject({errors:t.data.errors,statusCode:t.statusCode})}})).catch((function(t){e.reject(t)})),e.promise}},{key:"update",value:function(){var e=o.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),this._composeElement(!0),{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(t){switch(t.statusCode){case 200:var r=""!=t.text?JSON.parse(t.text):{},n=t.status;e.resolve({data:r,statusCode:n});break;case 204:e.resolve(t);break;default:e.reject({errors:t.data.errors,statusCode:t.statusCode})}})).catch((function(t){e.reject(t)})),e.promise}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization)throw new Error("Parameters organization and name must be defined");var e=o.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=l},{"../provision/BaseProvision":261,"../util/formats/check_types":373,"./TYPES_ENUM":360,q:120}],362:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../GenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations","TimeseriesFunctions","Timeseries function not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndName",value:function(e,t,r){var n=this;return n._organization=e,n._name=t,n._script=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/catalog"+(this._name?"/"+this._name:"")+(this._script?"/script":"")}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../GenericFinder":157}],363:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=i(e("q")),s=i(e("http-status-codes")),u=e("./TYPES_ENUM"),c=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseriesFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"getValueTypes",value:function(){return u.VALUE_TYPES_ENUM}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/internal",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/client",this._execute()}},{key:"_execute",value:function(){var e=o.default.defer(),t=e.promise,r=this._error_not_found;return this._api.get(this._composeUrl(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){204===t.statusCode?e.reject({error:r,statusCode:s.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(a.default);r.default=c,t.exports=r.default},{"../GenericFinder":157,"./TYPES_ENUM":360,"http-status-codes":76,q:120}],364:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../GenericFinder")),o=(i(e("q")),i(e("http-status-codes")),function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Transformer not found","north")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByOrganization",value:function(e){return this._organization=e,this._execute()}},{key:"findByOrganizationAndIdentifier",value:function(e,t){return this._organization=e,this._identifier=t,this._execute()}},{key:"downloadByOrganizationAndIdentifierAndFilename",value:function(e,t,r){return this._organization=e,this._identifier=t,this._filename=r,this._download()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/transformers"+(this._identifier?"/"+this._identifier+(this._filename?"/"+this._filename:""):"")}}]),t}(a.default));r.default=o,t.exports=r.default},{"../GenericFinder":157,"http-status-codes":76,q:120}],365:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),i=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}};function a(e){return e&&e.__esModule?e:{default:e}}var o=a(e("q")),s=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),i(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["organization","files"],"north/ai"),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_buildURL",value:function(){return this._organization+"/transformers/"+this._identifier}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"identifier"});return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"organization"});return this._organization=e,this}},{key:"addFile",value:function(e){this._files||(this._files=[]),this._files.push(e)}},{key:"withFiles",value:function(e){if(!(e instanceof Array))throw new Error({message:"Parameter files requires an array",parameter:"files"});this._files=e}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource=this._organization+"/transformers",{files:this._files||void 0}}},{key:"_composeUpdateElement",value:function(){var e=i(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.name,e}},{key:"performTest",value:function(e){var t=o.default.defer(),r=t.promise;return this._ogapi.Napi.post(this._buildURL()+"/transform",e,this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){t.resolve({statusCode:e.statusCode,body:e.body})})).catch((function(e){t.reject(e)})),r}},{key:"create",value:function(){var e=this._composeElement(),t=o.default.defer();return this._ogapi.Napi.post_multipart(this._resource,{files:e.files},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){switch(e.statusCode){case 200:var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n});break;case 201:n=e.status;var i=e.header&&e.header.location;t.resolve({location:i,statusCode:n});break;case 204:t.resolve(e);break;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}})).catch((function(e){t.reject(e)})),t.promise}},{key:"update",value:function(){var e=this._composeElement(),t=o.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),{files:e.files},{},this._timeout,this._getExtraHeaders(),this._getUrlParameters(),this._getServiceBaseURL()).then((function(e){if(200===e.statusCode){var r=""!=e.text?JSON.parse(e.text):{},n=e.status;t.resolve({data:r,statusCode:n})}else t.reject({errors:e.data.errors,statusCode:e.statusCode})})).catch((function(e){t.reject(e)})),t.promise}}]),t}(a(e("../provision/BaseProvision")).default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":261,q:120}],366:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"users","user","User not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"findByEmail",value:function(e){return this._id=e,this._execute()}},{key:"findByEmailAndPassword",value:function(e,t){return this._id=e,this._setExtraHeaders({"X-ApiPass":t}),this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],367:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("lodash")),s=e("uuid"),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/users",void 0,["email","workgroup","domain","profile","countryCode","langCode"])}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter name must be a string and has a maximum length of 100");return this._name=e,this}},{key:"withSurname",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter surname must be a string and has a maximum length of 100");return this._surname=e,this}},{key:"withEmail",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter email must be a string and has a maximum length of 100");return this._email=e,this}},{key:"withPassword",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("Parameter password must be a string and has a maximum length of 50");return this._password=e,this}},{key:"withApiKey",value:function(e){if(!this._validateUUID(e))throw new Error({message:"OGAPI_USER_UPDATE_APIKEY_PARAMETER_INVALID",parameter:"apiKey"});return this._apiKey=e,this}},{key:"withWorkgroup",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_WORKGROUP");return this._workgroup=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_DOMAIN");return this._domain=e,this}},{key:"withProfile",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_PROFILE");return this._profile=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_COUNTRY_CODE");return this._countryCode=e,this}},{key:"withLangCode",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_LANGUAGE");return this._langCode=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_DESCRIPTION");return this._description=e,this}},{key:"withTimezone",value:function(e){if("string"!=typeof e)throw new Error("OGAPI_STRING_PARAMETER_TIMEZONE");return this._timezone=e,this}},{key:"with2FaType",value:function(e){if("string"!=typeof e||e.length>100)throw new Error("Parameter twoFaType must be a string and has a maximum length of 100");return this._twoFaType=e,this}},{key:"_buildURL",value:function(){if(void 0===this._email)throw new Error("OGAPI_EMAIL_MUST_BE_DEFINED");return this._resource+"/"+this._email}},{key:"_composeElement",value:function(){return{user:{name:this._name||void 0,surname:this._surname||void 0,password:this._password||void 0,description:this._description||void 0,email:this._email||void 0,workgroup:this._workgroup||void 0,domain:this._domain||void 0,profile:this._profile||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timezone||void 0,"2FaType":this._twoFaType||void 0}}}},{key:"_composeUpdateElement",value:function(){if(void 0===this._email)throw new Error("OGAPI_USER_UPDATE_PARAMETER_MUST_BE_DEFINED");return{user:{name:this._name||void 0,surname:this._surname||void 0,description:this._description||void 0,email:this._email||void 0,workgroup:this._workgroup||void 0,domain:this._domain||void 0,profile:this._profile||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timezone||void 0,apiKey:this._apiKey||void 0,password:this._password||void 0,"2FaType":this._twoFaType||void 0}}}},{key:"changePassword",value:function(e){if(this._newPassword=e,o.default.isEmpty(this._email)||o.default.isEmpty(this._password)||o.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_UPDATE_PASSWORD_PARAMETER_MUST_BE_DEFINED");var t={user:{password:this._newPassword}};return this._setExtraHeaders({"X-ApiPass":this._password}),this._doNorthPut(this._buildURL(),t)}},{key:"_validateUUID",value:function(e){return(0,s.validate)(e)&&4===(0,s.version)(e)}},{key:"changeApiKey",value:function(e){if(this._apiKey=e,o.default.isEmpty(this._email)||o.default.isEmpty(this._password)||o.default.isEmpty(this._apiKey))throw new Error("OGAPI_USER_UPDATE_APIKEY_PARAMETER_MUST_BE_DEFINED");if(!this._validateUUID(e))throw new Error({message:"OGAPI_USER_UPDATE_APIKEY_PARAMETER_INVALID",parameter:"apiKey"});var t={user:{apiKey:this._apiKey}};return this._setExtraHeaders({"X-ApiPass":this._password}),this._doNorthPut(this._buildURL(),t)}},{key:"requestResetPassword",value:function(){if(o.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");var e=this._buildURL()+"/reset";return this._doNorthPost(e)}},{key:"updatePassword",value:function(e,t){if(this._newPassword=e,this._tokenId=t,o.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(o.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_PASSWORD_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(o.default.isEmpty(t))throw new Error("OGAPI_USER_TOKENID_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");var r={password:this._newPassword},n=this._buildURL()+"/reset/"+t;return this._doNorthPost(n,r)}},{key:"login",value:function(e,t,r){if(this._email=e,this._password=t,this._twoFaCode=r,o.default.isEmpty(this._email)||o.default.isEmpty(this._password))throw new Error("OGAPI_USER_LOGIN_EMAIL_AND_PASSWORD_PARAMETER_MUST_BE_DEFINED");var n={email:this._email,password:this._password,"2FaCode":this._twoFaCode||void 0},i=this._resource+"/login";return this._doNorthPost(i,n,!0)}},{key:"generateApiKey",value:function(){return(0,s.v4)()}}]),t}(a.default);r.default=u,t.exports=r.default},{"../provision/BaseProvision":261,lodash:111,uuid:139}],368:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DATE_FORMAT="";r.TIME_FORMAT="HH:mm:ssZ"},{}],369:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var a=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,null,[{key:"eq",value:function(e,t){return{eq:i({},e,t)}}},{key:"neq",value:function(e,t){return{neq:i({},e,t)}}},{key:"like",value:function(e,t){return{like:i({},e,t)}}},{key:"gt",value:function(e,t){return{gt:i({},e,t)}}},{key:"lt",value:function(e,t){return{lt:i({},e,t)}}},{key:"gte",value:function(e,t){return{gte:i({},e,t)}}},{key:"lte",value:function(e,t){return{lte:i({},e,t)}}},{key:"in",value:function(e,t){return{in:i({},e,t)}}},{key:"or",value:function(){for(var e={or:[]},t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0;i<r.length;i++)e.or.push(r[i]);return e}},{key:"and",value:function(){for(var e={and:[]},t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];for(var i=0;i<r.length;i++)e.and.push(r[i]);return e}}]),e}();r.default=a,t.exports=r.default},{}],370:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("merge")),o=i(e("urlencode")),s=i(e("superagent")),u=i(e("q")),c=i(e("lodash")),l=i(e("mime-types")),p=(0,i(e("superagent-mocker")).default)(s.default),f=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._options=a.default.recursive(!0,this.default(),t),this._headers=r,c.default.isEmpty(t.mocks)||this._applyMocks(t.mocks)}return n(e,[{key:"_applyMocks",value:function(e){var t=this;Object.keys(e).filter((function(t){return!c.default.isEmpty(e[t])})).forEach((function(r){console.log("Mocking "+r.toLocaleUpperCase()+" requests"),Object.keys(e[r]).forEach((function(n){console.log("Mocking url:",n);var i=e[r][n];p[r](t._options.url+n,(function(t){if("function"==typeof i)return console.log("Function returned"),i(t);var a=e[r][n];return console.log("Data returned:",a),a.headers||(a.headers={}),a}))}))}))}},{key:"default",value:function(){return{timeout:5e3}}},{key:"_url",value:function(e){return e.url}},{key:"get",value:function(e,t,r,n,i,a){var o=this._createUrl(e,n,a);console.info("GET",o);var u=s.default.get(o);return this._createPromiseRequest(u,null,t,r,i)}},{key:"patch",value:function(e,t,r,n,i,a){var o=this._createUrl(e,i,a);console.info("PATCH",o);var u=s.default.patch(o).send(t);return this._createPromiseRequest(u,null,r,n)}},{key:"post",value:function(e,t,r,n,i,a){var o=this._createUrl(e,i,a);console.info("POST",o);var u=s.default.post(o).send(t);return this._createPromiseRequest(u,null,r,n)}},{key:"post_multipart",value:function(e,t,r,n,i,a,o){var u=this._createUrl(e,a,o);console.info("POST_MULTIPART",u);var c=s.default.post(u);return this._prepareMultipartForm(t,c),this._createPromiseRequest(c,r,n,i)}},{key:"put",value:function(e,t,r,n,i,a){var o=this._createUrl(e,i,a);console.info("PUT",o);var u=s.default.put(o).send(t);return n?n["Content-Type"]="application/json":n={"Content-Type":"application/json"},this._createPromiseRequest(u,null,r,n)}},{key:"put_multipart",value:function(e,t,r,n,i,a,o){var u=this._createUrl(e,a,o);console.info("PUT_MULTIPART",u);var c=s.default.put(u);return this._prepareMultipartForm(t,c),this._createPromiseRequest(c,r,n,i)}},{key:"_prepareMultipartForm",value:function(e,t){var r=!0;Object.keys(e).forEach((function(n){switch(n){case"meta":case"json":case"file":t.field(n,e[n]),delete e[n];break;case"metadata":t.attach(n,e[n]),r=!1;break;case"hardwareMedia":case"certificate":case"processorBulkFile":t.attach("file",e[n]),r=!1;break;case"files":e[n].forEach((function(e,r){if(e.path){var i=e.path.replace(/^.*[\\\/]/,""),a=l.default.lookup(i);a?t.attach(n,e,{filename:i,contentType:a}):i.endsWith(".py")?t.attach(n,e,{filename:i,contentType:"text/x-python"}):t.attach(n,e,{filename:i})}else t.attach(n,e)})),delete e[n],r=!1;break;case"script":case"modelFile":t.field(n,e[n]),delete e[n],r=!1;break;case"bulkFile":t.set("Content-Type",e.ext),e=e.bulkFile}})),r&&t.send(e)}},{key:"delete",value:function(e,t,r,n,i,a){var o,u=this._createUrl(e,n,a);return console.info("DELETE",u),o=i?s.default.del(u).send(i):s.default.del(u),this._createPromiseRequest(o,null,t,r)}},{key:"_createUrl",value:function(e,t,r){var n=[];if(t)for(var i=Object.keys(t),a=0;a<i.length;a++){var s=i[a],u=s+"="+t[s];e=0===a?e+"?"+u:e+"&"+u}var c=e.split("/"),l=c.length;return c.forEach((function(e,t){if(t===l-1&&e.indexOf("?")>0){var r=e.substring(e.indexOf("?"),e.length),i=e.substring(0,e.indexOf("?"));n.push((0,o.default)(i)+r)}else n.push((0,o.default)(e))})),this._url(this._options)+"/"+this._getDefaultBaseURL(r)+"/"+n.join("/")}},{key:"_getDefaultBaseURL",value:function(e){return e||(this._isSouth?"v80":"north/v80")}},{key:"_createPromiseRequest",value:function(e,t,r,n,i){var a=r;null==a&&(a=this._options.timeout);var o=u.default.defer(),s=o.promise,c=this._options.apiKey,l=this._options.jwt,p=-1===a?e:e.timeout(a);if(l&&!this._isSouth?p=p.set("Authorization","Bearer "+l):c&&(p=p.set("X-ApiKey",this._options.apiKey)),n)for(var f=Object.keys(n),d=0;d<f.length;d++){var h=f[d];void 0!==n[h]&&(p=p.set(h,n[h]))}if(t)for(var m in t)p=p.on(m,t[m]);return i&&e.responseType("blob"),p=p.end((function(e,t){if(null!==e){console.error("OGAPI ERROR: ");try{console.log(JSON.stringify(e))}catch(e){console.log(e)}var r=void 0,n=void 0,i=e.status?e.status:void 0,a={errors:[{code:i,message:"OGAPI: Something is broken. Please contact with your administrator."}]};void 0!==e.response?(r=e.response.body?e.response.body:a,n=e.response.headers,i=e.status):i?(r=e.message,i=408):(r=a,i=500),o.reject({statusCode:i,data:r,headers:n})}else o.resolve(t)})),s}}]),e}();r.default=f,t.exports=r.default},{lodash:111,merge:112,"mime-types":115,q:120,superagent:131,"superagent-mocker":129,urlencode:138}],371:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}return n(e,null,[{key:"element",value:function(e,t){return{name:e,fields:t}}}]),e}();r.default=i,t.exports=r.default},{}],372:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("./NorthAmpliaREST"),o=function(e){function t(e,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._isSouth=!0}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_url",value:function(e){return e.south.url}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"./NorthAmpliaREST":370}],373:[function(e,t,r){"use strict";t.exports={_checkType:function(e,t){var r=[];if(void 0===t.find((function(e){return e==this}),e)&&r.push(e),0!==r.length)throw new Error({message:"OGAPI_NOT_ALLOWED_PARAMETER",parameter:JSON.stringify(r),allowed:JSON.stringify(t)});return e},_checkISODateTime:function(e,t){if("string"!=typeof e||new RegExp("(d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d:[0-5]d.d+([+-][0-2]d:[0-5]d|Z))|(d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d:[0-5]d([+-][0-2]d:[0-5]d|Z))|(d{4}-[01]d-[0-3]dT[0-2]d:[0-5]d([+-][0-2]d:[0-5]d|Z))").test(e))throw new Error([{message:"OGAPI_ISO_DATE_TIME_PARAMETER",parameter:t},{message:"OGAPI_STRING_PATTERN",parameter:t}]);try{new Date(e)}catch(e){throw new Error([{message:"OGAPI_ISO_DATE_TIME_PARAMETER",parameter:t},{message:"OGAPI_STRING_PATTERN",parameter:t}])}},_checkStringAndPattern:function(e,t,r){if("string"!=typeof e||!new RegExp(t).test(e))throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:r},{message:"OGAPI_STRING_PATTERN",parameter:r,pattern:t}])},_checkStringAndLength:function(e,t,r){if("string"!=typeof e||e.length>t)throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:r},{message:"OGAPI_MAX_LENGTH",parameter:t}])},_checkString:function(e,t){if("string"!=typeof e)throw new Error([{message:"OGAPI_STRING_PARAMETER",parameter:t}])},_checkNumber:function(e,t){if("number"!=typeof e)throw new Error([{message:"OGAPI_NUMBER_PARAMETER",parameter:t}])},_checkArray:function(e,t){if(!Array.isArray(e)||0===e.length)throw new Error({message:"OGAPI_ARRAY_PARAMETER",parameter:t})},_checkObject:function(e,t){if("object"!=typeof e)throw new Error({message:"OGAPI_OBJECT_PARAMETER",parameter:t})}}},{}],374:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n,i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=a(e("q")),u=a(e("lodash")),c=e("./source-precompiled/Fields"),l=e("./IotFields"),p=c.GENERATED_FIELDS;for(var f in l.IOT_FIELDS)if(p[f])for(var d in l.IOT_FIELDS[f])p[f][d]=l.IOT_FIELDS[f][d];else p[f]=l.IOT_FIELDS[f];var h=new RegExp("^(.+)._current\\.?(.+)?$"),m=new RegExp("\\[[0-9]+\\]"),v=(new RegExp("value\\.?"),{"/jobs":"JOB","/tasks":"TASKS","/alarms":"ENTITY_ALARM","/operations":"ENTITY_OPERATION","/operations/history":"ENTITY_OPERATION_HISTORY","/certificates":"CERTIFICATE","/bundles":"UPDATE_BUNDLE_VERSION","/datapoints":"DATAPOINTS","/datastreams":"DATASTREAMS","/datamodels":"DATAMODELS","/dmmQRating":"DMMQRATING","/iotQRating":"IOTQRATING","/catalog/softwares":"SOFTWARE_VERSION","/catalog/hardwares":"MANUFACTURER","/catalog/operators":"OPERATORS","/domains":"DOMAIN","/users":"USER","/areas":"AREAS","/bulk/async":"LEGACY_BULK","provisionProcessors/bulk/search":"BULK","/devices":"SearchOnDatamodel","/subscriptions":"SearchOnDatamodel","/subscribers":"SearchOnDatamodel","/entities":"SearchOnDatamodel","entity-asset":"SearchOnDatamodel","/tickets":"SearchOnDatamodel","/channels":"SearchOnDatamodel",datasets:"SearchOnDataset",timeseries:"SearchOnTimeseries","/catalog/plans/organization":"PLANS","/catalog/plans/device":"PLANS"}),y={ENTITY_ALARM:"alarm",UPDATE_BUNDLE_VERSION:"bundle",DATAPOINTS:"datapoints",ENTITY_OPERATION:["operation","job"]},g=function(e){switch(e){case"entity-asset":return["entity.asset"];case"/tickets":return["ticket"];case"/channels":return["channel"];default:return}},_={subscriber:"DEVICE_PART_SUBSCRIBER",subscription:"DEVICE_PART_SUBSCRIPTION",communicationsModule:"DEVICE_PART_COMMSMODULE",device:"DEVICE_PART_DEVICE"},b={DEVICE_PART_SUBSCRIBER:"subscriber",DEVICE_PART_SUBSCRIPTION:"subscription",DEVICE_PART_COMMSMODULE:"communicationsModule",DEVICE_PART_DEVICE:"device"},w=["relColl","relProv"],E=["DEVICE_PART_SUBSCRIBER","DEVICE_PART_SUBSCRIPTION","DEVICE_PART_COMMSMODULE","DEVICE_PART_DEVICE"],x=["subscriber","subscription","communicationsModule","device"],O="simple",A="complex",S="search",P="dataset",D="timeserie",k=function(e){if(E.indexOf(v[e])>=0)return A;switch(v[e]){case"SearchOnDatamodel":return S;case"SearchOnDataset":return P;case"SearchOnTimeseries":return D;default:return O}},C=function(e,t){var r=s.default.defer(),n=t.selectedField,i=t.selectAll,a=t.extraData&&t.extraData.organization,o=e._ogapi.datamodelsSearchBuilder(),u={and:[]};return e._resourceTypes&&u.and.push({in:{"datamodels.allowedResourceTypes":e._resourceTypes}}),a&&u.and.push({eq:{"datamodels.organizationName":a}}),n&&u.and.push({eq:{"datamodels.categories.datastreams.identifier":n}}),u.and.length>0&&o.filter(u),o.build().execute().then((function(e){var t=[];200===e.statusCode&&(t=function(e){var t=!0;for(;t;){var r=e;if(t=!1,!(r.length>0&&r[0].constructor===Array))return r;e=r=r.reduce((function(e,t){return e.concat(t)})),t=!0}}(t=e.data.datamodels.map((function(e){return(e.categories||[]).map((function(e){return(e.datastreams||[]).map((function(e){return n||i?e:e.identifier}))}))})))),n?r.resolve(t.find((function(e){return n===e.identifier}))):r.resolve(t)})).catch((function(e){r.reject(e)})),r.promise},j=function(e,t,r,n){var i=r.selectedField,a=[],o=r.extraData.organization,s=r.extraData[t.entity];e._ogapi[t.api]()[t.method](o,s).then((function(t){if(200===t.statusCode){t.data.identifierColumn&&a.push({identifier:t.data.identifierColumn,name:t.data.identifierColumn,path:"provision.administration.identifier._current.value",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"string",schema:{type:"string"}}),t.data.bucketColumn&&a.push({identifier:t.data.bucketColumn,name:t.data.bucketColumn,path:"provision.administration.identifier._current.at",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"date-time",schema:{type:"string",format:"datetime"}}),t.data.bucketInitColumn&&a.push({identifier:t.data.bucketInitColumn,name:t.data.bucketInitColumn,path:"provision.administration.identifier._current.at",indexed:!0,sort:!0,notFilterable:!1,filter:"YES",type:"date-time",schema:{type:"string",format:"datetime"}});var o=u.default.concat(t.data.columns||[],t.data.context||[]);e._ogapi.basicTypesSearchBuilder().withPath("$").build().execute().then((function(t){t.data.definitions;if(r.selectAll=!0,i){o=o.filter((function(e){return i===(e.name||e.alias)}));var s=o[0].path.match(h)[1].replace(m,"[]");r.selectedField=s}C(e,r).then((function(e){o.forEach((function(t){"date-time"!==t.type?t.schema={type:t.type}:t.schema={type:"string",format:"datetime"},t.path.endsWith("._current.value")&&function(){var r=t.path.substring(0,t.path.indexOf("._current.value"));Array.isArray(e)&&e.find((function(e){return r===e.identifier}))}(),t.identifier=t.name||t.alias,t.indexed="NO"!==t.filter,t.notFilterable="NO"===t.filter,a.push(t)})),n.resolve(a)})).catch((function(e){console.error(e),n.reject(e)}))})).catch((function(e){console.error(e),n.reject(e)}))}})).catch((function(e){console.error(e),n.reject(e)}))},T=(o(n={},S,(function(e,t){C(this,e).then((function(e){t.resolve(e)})).catch((function(e){t.reject(e)}))})),o(n,O,(function(e,t){var r=e.context,n=e.primaryType,i=e.selectedField,a=[];if(r[n]instanceof Array)i?function(){var e=0,t=null,o=function(){var a=r[n][e];a.toLowerCase()===i.toLowerCase()||a.toLowerCase()===i.toLowerCase()+"name"?t=a:y[n]&&(y[n]instanceof Array?y[n].forEach((function(e){a.toLowerCase()!==e+i.toLowerCase()&&a.toLowerCase()!==e+"."+i.toLowerCase()&&a.toLowerCase()!==e+i.toLowerCase()+"name"&&a.toLowerCase()!==e+"."+i.toLowerCase()+"name"||t||(t=a)})):a.toLowerCase()!==y[n]+i.toLowerCase()&&a.toLowerCase()!==y[n]+"."+i.toLowerCase()&&a.toLowerCase()!==y[n]+i.toLowerCase()+"name"&&a.toLowerCase()!==y[n]+"."+i.toLowerCase()+"name"||(t=a))};for(e=0;null===t&&e<r[n].length;e++)o();t&&a.push(t)}():a=r[n].slice();else if(i)if(r[n][i])a.push(r[n][i]);else for(var o=Object.keys(r[n]),s=0;s<o.length;s++)r[n][o[s]].toLowerCase().indexOf(i.toLowerCase())>-1&&a.push(r[n][o[s]]);else for(o=Object.keys(r[n]),s=0;s<o.length;s++)a.push(r[n][o[s]]);t.resolve(a.slice())})),o(n,A,(function(e,t){var r=e.states,n=e.context,i=e.primaryType,a={1:function(e,t){return t[i].concat(x.filter(u,b[i]))},2:function(e,t){try{return c(e,s(e[0],t).concat(w))}catch(e){return[]}},3:function(e,t){var r=e[1];if(-1===w.indexOf(r))return[];try{return c(e,s(e[0],t))}catch(e){return[]}}},o=a[r.length];return void 0===o?t.resolve([]):t.resolve(o(r,n));function s(e,t){var r=void 0;if(!(s=_[e])||!(r=t[s]))throw new Error("Invalid primaryType: "+e);return r.slice()}function u(e){return e!=this}function c(e,t){var r=[];return t.forEach((function(t){var n=e.slice(0,-1);n.push(t),r.push(n.join("."))})),r}})),o(n,P,(function(e,t){j(this,{api:"newDatasetFinder",method:"findByOrganizationAndDatasetId",entity:"dataset"},e,t)})),o(n,D,(function(e,t){j(this,{api:"newTimeserieFinder",method:"findByOrganizationAndTimeserieId",entity:"timeserie"},e,t)})),n),F=function(){function e(t,r,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._ogapi=t,this._url=r,this._type=k(r),this._extraData=n,this._type===S&&(this._resourceTypes=g(r))}return i(e,[{key:"find",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=s.default.defer(),r={states:e.split("."),context:p[v[this._url]],primaryType:v[this._url],extraData:this._extraData};return T[this._type].call(this,r,t),t.promise}},{key:"findAll",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=s.default.defer(),r={states:e.split("."),context:p[v[this._url]],primaryType:v[this._url],selectAll:!0,extraData:this._extraData};return T[this._type].call(this,r,t),t.promise}},{key:"findFieldPath",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=s.default.defer(),r={states:e,context:p[v[this._url]],primaryType:v[this._url],selectedField:e,extraData:this._extraData};return T[this._type].call(this,r,t),t.promise}}]),e}();r.default=F,t.exports=r.default},{"./IotFields":375,"./source-precompiled/Fields":376,lodash:111,q:120}],375:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.IOT_FIELDS={DATAPOINTS:{DATAPOINTS:["datapoints.organization","datapoints.channel","datapoints.datastreamId","datapoints.entityIdentifier","datapoints.subEntityIdentifier","datapoints.entityRelated","datapoints._current.feedId","datapoints._current.date","datapoints._current.at","datapoints._current.value","datapoints._current.tags","datapoints._current.scoring.performance","datapoints._current.scoring.qrating.min_required.value","datapoints._current.scoring.qrating.min_required.label","datapoints._current.scoring.qrating.min_desired.value","datapoints._current.scoring.qrating.min_desired.label","datapoints._current.scoring.qrating.ideal.value","datapoints._current.scoring.qrating.ideal.label","datapoints._current.scoring.qrating.max_desired.value","datapoints._current.scoring.qrating.max_desired.label","datapoints._current.scoring.qrating.max_allowed.value","datapoints._current.scoring.qrating.max_allowed.label","datapoints._current.scoring.qrating.max_score","datapoints._current.scoring.qrating.cumulative_period_divisor","datapoints._current.scoring.qrating.conversion_matrix","datapoints._current.scoring.qrating.version"]},DATAMODELS:{DATAMODELS:["datamodels.organizationName","datamodels.identifier","datamodels.name","datamodels.description","datamodels.version","datamodels.categories.name","datamodels.categories.identifier","datamodels.categories.datastreams.identifier","datamodels.categories.datastreams.name","datamodels.categories.datastreams.description","datamodels.categories.datastreams.hardwareIds","datamodels.categories.datastreams.unit","datamodels.categories.datastreams.unit.type","datamodels.categories.datastreams.unit.label","datamodels.categories.datastreams.unit.symbol","datamodels.categories.datastreams.period","datamodels.categories.datastreams.access","datamodels.categories.datastreams.schema","datamodels.categories.datastreams.storage","datamodels.categories.datastreams.storage.period","datamodels.categories.datastreams.storage.total","datamodels.categories.datastreams.tags","datamodels.categories.datastreams.views","datamodels.categories.datastreams.icon","datamodels.categories.datastreams.modifiable","datamodels.categories.datastreams.required","datamodels.categories.datastreams.qrating.min_required.value","datamodels.categories.datastreams.qrating.min_required.label","datamodels.categories.datastreams.qrating.min_desired.value","datamodels.categories.datastreams.qrating.min_desired.label","datamodels.categories.datastreams.qrating.ideal.value","datamodels.categories.datastreams.qrating.ideal.label","datamodels.categories.datastreams.qrating.max_desired.value","datamodels.categories.datastreams.qrating.max_desired.label","datamodels.categories.datastreams.qrating.max_allowed.value","datamodels.categories.datastreams.qrating.max_allowed.label","datamodels.categories.datastreams.qrating.max_score","datamodels.categories.datastreams.qrating.cumulative_period_divisor","datamodels.categories.datastreams.qrating.conversion_matrix","datamodels.categories.datastreams.qrating.version"]},DATASTREAMS:{DATASTREAMS:["datastreams.datastreamId","datastreams.name","datastreams.description","datastreams.unit.type","datastreams.unit.label","datastreams.unit.symbol","datastreams.period","datastreams._current.tags","datastreams._current.date","datastreams._current.value","datastreams.categoryId","datastreams.datamodelId","datastreams.access","datastreams.channel","datastreams.organization","datastreams.entityIdentifier","feeds.entityIdentifier","datastreams._id.subEntityIdentifier","datastreams._current.scoring.qrating.min_required.value","datastreams._current.scoring.qrating.min_required.label","datastreams._current.scoring.qrating.min_desired.value","datastreams._current.scoring.qrating.min_desired.label","datastreams._current.scoring.qrating.ideal.value","datastreams._current.scoring.qrating.ideal.label","datastreams._current.scoring.qrating.max_desired.value","datastreams._current.scoring.qrating.max_desired.label","datastreams._current.scoring.qrating.max_allowed.value","datastreams._current.scoring.qrating.max_allowed.label","datastreams._current.scoring.qrating.max_score","datastreams._current.scoring.qrating.cumulative_period_divisor","datastreams._current.scoring.qrating.max_score","datastreams._current.scoring.qrating.conversion_matrix","datastreams.version","feeds.identifier","datastreams._current.scoring.qrating.version","datastreams._current.scoring.scoringPerformance"]},DEVICE_PART_DEVICE:{IOT:["datastream.id","datastream.name","datastream.feed","datastream.device","datastream.description","datastream.unit.type","datastream.unit.label","datastream.unit.symbol","datastream.period","datastream.tags","datastream.updated","datastream.minValue","datastream.maxValue","datastream.currentValue","datastream.categoryName","datastream.profileId","datastream.profileName","datastream.profileDescription","datastream.profileVersion","datastream.qratingScoringQValue","datastream.qratingScoringQScore","datastream.qratingScoringQuality","datastream.qratingScoringPerformance","datastream.qratingMinRequiredValue","datastream.qratingMinRequiredLabel","datastream.qratingMinDesiredValue","datastream.qratingMinDesiredLabel","datastream.qratingIdealValue","datastream.qratingIdealLabel","datastream.qratingMaxDesiredValue","datastream.qratingMaxDesiredLabel","datastream.qratingMaxAllowedValue","datastream.qratingMaxAllowedLabel","datastream.qratingMaxScore","deviceId","feedId","deviceOrganization","profile.Name","profile.Description","profile.Version","profile.Score","profile.MaxScore","profile.Performance","profile.AvgPerformance","profile.Quality","category.Name","category.Score","category.MaxScore","category.Performance","category.AvgPerformance","category.Quality","device.Score","device.MaxScore","device.Performance","device.AvgPerformance","device.Quality","device.Channel","device.EntityType"]},USER:{USER:{email:"user.email",description:"user.description",workgroup:"workgroup.name",domain:"domain.name",profile:"profile.name",name:"user.name",surname:"user.surname",countryCode:"country.code",langCode:"language.code",timezone:"user.timezone"}},DOMAIN:{DOMAIN:["domain.name","domain.description"]},AREAS:{AREAS:{identifier:"areas.identifier",name:"areas.name",description:"areas.description",entities:"areas.entities",geometry:"areas.geometry",color:"areas.color",organization:"areas.organization"}},TASKS:{TASKS:["tasks.id","tasks.name","tasks.description","tasks.state","tasks.domain","tasks.workgroup","tasks.job.request.user"]},LEGACY_BULK:{LEGACY_BULK:{identifier:"bulks.identifier",organization:"bulks.organization",fileName:"bulks.request.fileName",userEmail:"bulks.request.userEmail",headerAccept:"bulks.request.header.accept",contentType:"bulks.request.header.contentType",headerCsvFormat:"bulks.request.header.csvFormat",paramsFlattened:"bulks.request.params.flattened",paramsAction:"bulks.request.params.action",paramsFull:"bulks.request.params.full",paramsType:"bulks.request.params.type",status:"bulks.status",startedDate:"bulks.startedDate",finishedDate:"bulks.finishedDate",processed:"bulks.summary.processed",successful:"bulks.summary.successful",error:"bulks.summary.error"}},BULK:{BULK:{identifier:"bulks.identifier",provisionProcessorId:"bulks.provisionProcessorId",organization:"bulks.organization",userEmail:"bulks.request.userEmail",fileName:"bulks.request.fileName",headerAccept:"bulks.request.header.accept",contentType:"bulks.request.header.contentType",status:"bulks.status",startedDate:"bulks.startedDate",finishedDate:"bulks.finishedDate",processed:"bulks.summary.processed",successful:"bulks.summary.successful",error:"bulks.summary.error"}},RULE:{RULE:{organizationId:"rule.organizationId",channelId:"rule.channelId",name:"rule.name",active:"rule.active"}},ENTITY_ALARM:{ENTITY_ALARM:{alarmId:"alarm.identifier",alarmSubEntityIdentifier:"alarm.subEntityIdentifier",entityId:"alarm.entityIdentifier",entityType:"alarm.resourceType",organizationName:"alarm.organization",channelName:"alarm.channel",alarmRuleName:"alarm.rule",alarmName:"alarm.name",alarmSeverity:"alarm.severity",alarmPriority:"alarm.priority",alarmDescription:"alarm.description",alarmStatus:"alarm.status",alarmOpenDate:"alarm.openingDate",alarmAttentionDate:"alarm.attentionDate",alarmAttentionUser:"alarm.attentionUser",alarmAttentionNote:"alarm.attentionNote",alarmClosureDate:"alarm.closureDate",alarmClosureUser:"alarm.closureUser",alarmClosureNote:"alarm.closureNote",alarmExtraInfo:"alarm.extra_info"}},GENERAL:{GENERAL:[]},EMPTY:{EMPTY:[]},OPERATORS:{OPERATORS:["operator.name"]},PLANS:{PLANS:["plan.identifier","plan.name","plan.flowRate.value","plan.flowRate.unit","plan.maxDeviceAmount","plan.maxStorageLifeTime.period","plan.maxStorageLifeTime.total","plan.defaultAssigned","plan.defaultProvision"]}}},{}],376:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.GENERATED_FIELDS={ENTITY_OPERATION_HISTORY:{ENTITY_OPERATION_HISTORY:["applicationEmail","entityId","resourceType","jobActivatedDate","jobId","jobUserNotes","operationAttemptCurrent","operationAttemptMax","operationDate","operationDetails","operationEndDate","operationId","operationInitDate","operationName","operationNotify","operationParameters","operationResult","operationStatus","operationSteps"]},ENTITY_OPERATION:{ENTITY_OPERATION:["applicationEmail","channelKey","channelName","domainKey","entityId","resourceType","entityUk","jobActivatedDate","jobEntityTotal","jobErrorCode","jobErrorDescription","jobFinishedCancelledByEngine","jobFinishedCancelledByExternal","jobFinishedCancelledByExternalTimeout","jobFinishedCancelledByTimeout","jobFinishedCancelledByUser","jobFinishedCancelledTotal","jobFinishedDate","jobFinishedError","jobFinishedOotError","jobFinishedOotSuccessful","jobFinishedOotTotal","jobFinishedSuccessful","jobFinishedTotal","jobId","jobInProgressPendingExecution","jobInProgressScheduled","jobInProgressStarted","jobInProgressTotal","jobInProgressWaitingForConnection","jobJson","jobStartedDate","jobState","jobStatus","jobTotal","jobUser","jobUserNotes","notDeletable","operationAttemptCurrent","operationAttemptMax","operationDate","operationDetails","operationEndDate","operationId","operationInitDate","operationJson","operationName","operationNotify","operationResult","operationScheduleTimestamp","operationStatus","operationStatusKey","operationStepDescription","operationStepName","operationStepResponse","operationStepResult","operationStepTimestamp","operationTimeoutTimestamp","operationUserNotes","organizationKey","organizationName","profileKey","provAdministrativeState","provAdministrativeStateKey","provDefaultFeed","serviceGroupName","tag","taskEmpty_null","taskId","taskKey","taskName","taskState","taskStatus","workgroupKey","workgroupName"]},MANUFACTURER:{MANUFACTURER:["manufacturerAddress","manufacturerDescription","manufacturerEmail","manufacturerFax","manufacturerIdentifier","manufacturerMediaFileName","manufacturerMediaHeight","manufacturerMediaIdentifier","manufacturerMediaName","manufacturerMediaSize","manufacturerMediaTypeName","manufacturerMediaWidth","manufacturerName","manufacturerNotes","manufacturerTelephone","manufacturerUrl","modelDescription","modelIdentifier","modelMediaFileName","modelMediaHeight","modelMediaIdentifier","modelMediaName","modelMediaSize","modelMediaTypeName","modelMediaWidth","modelName","modelNotes","modelUrl","modelVersion"]},MODEL:{MODEL:["modelDescription","modelIdentifier","modelName","modelNotes","modelUrl","modelVersion"]},JOB:{JOB:["jobActivatedDate","jobActivatedTime","jobCallback","jobEntityTotal","jobErrorCode","jobErrorDescription","jobFinishedCancelledByEngine","jobFinishedCancelledByExternal","jobFinishedCancelledByExternalTimeout","jobFinishedCancelledByTimeout","jobFinishedCancelledByUser","jobFinishedCancelledTotal","jobFinishedDate","jobFinishedError","jobFinishedOotError","jobFinishedOotSuccessful","jobFinishedOotTotal","jobFinishedSuccessful","jobFinishedTime","jobFinishedTotal","jobId","jobInProgressPendingExecution","jobInProgressScheduled","jobInProgressStarted","jobInProgressTotal","jobInProgressWaitingForConnection","jobJson","jobOperationName","jobScheduledTime","jobStartedDate","jobState","jobStatus","jobTotal","jobTrap","jobUser","jobUserNotes","jobVisible","operationId","operationName","operationResult","operationStatusKey","taskCoremessage","taskId","taskKey","taskName","taskNextExecution","taskState","taskStatus"]},SOFTWARE_VERSION:{SOFTWARE_VERSION:["manufacturerAddress","manufacturerDescription","manufacturerEmail","manufacturerFax","manufacturerIdentifier","manufacturerName","manufacturerNotes","manufacturerTelephone","manufacturerUrl","modelDescription","modelIdentifier","modelName","modelNotes","modelUrl","modelVersion","softwareId","softwareName","softwareType","softwareVersion"]},UPDATE_BUNDLE_VERSION:{UPDATE_BUNDLE_VERSION:["bundleActionDef","bundleActionOrder","bundleActionType","bundleActive","bundleConstrained","bundleCreationDate","bundleDeploymentElementDownloadUrl","bundleDeploymentElementId","bundleDeploymentElementName","bundleDeploymentElementOperation","bundleDeploymentElementOption","bundleDeploymentElementOrder","bundleDeploymentElementPath","bundleDeploymentElementSize","bundleDeploymentElementType","bundleDeploymentElementValidators","bundleDeploymentElementVersion","bundleDescription","bundleHardware","bundleId","bundleName","bundleUserNotes","bundleVersion","bundleWorkgroup","updateBundleDate","updateBundleManufacturer","updateBundleModel","updateBundleName","updateBundleVersion","updateBundleVersionUuid","updateDescription"]},CERTIFICATE:{CERTIFICATE:["certificateAdministrativeState","certificateDescription","certificateDomain","certificateId","certificateIssuer","certificateManufacturer","certificateModel","certificateModelIdentifier","certificateModelVersion","certificateName","certificatePublicKeyAlgorithm","certificatePublicKeyFormat","certificatePublicKeySize","certificateSerialNumber","certificateSubject","certificateTag","certificateTrustChain","certificateUsage","certificateValidFrom","certificateValidUntil","certificateVersion"]}}},{}],377:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._domain+"/workgroups/"+this._name}},{key:"findByDomainAndName",value:function(e,t){return this._domain=e,this._name=t,this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],378:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("../provision/BaseProvision")),o=i(e("./Workgroups")),s=i(e("../channels/Channels")),u=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["workgroup","channels"]),this._ogapi=e,this._action="CREATE"}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withWorkgroup",value:function(e){if(e.constructor.prototype!=o.default.prototype)throw new Error("Parameter workgroup must be a workgroup");return this._workgroup=e,this}},{key:"withChannel",value:function(e){if(e.constructor.prototype!=s.default.prototype)throw new Error("Parameter channel must be a channel");return this._channels||(this._channels=[]),this._channels.push({organization:e._organization,channel:e._name}),this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._workgroup._domainName+"/workgroups/"+this._workgroup._name+"/relations",{workgroupRelation:{channels:this._channels?this._channels:void 0}}}},{key:"_buildURL",value:function(){return"provision/domains/"+this._workgroup._domainName+"/workgroups/"+this._workgroup._name+"/relations"}},{key:"create",value:function(){var e=this._composeElement(),t=this._resource;return this._setUrlParameters({action:"CREATE"}),this._doNorthPost(t,e)}},{key:"delete",value:function(){this._setUrlParameters({action:"DELETE"});var e=this._buildURL();if(this._channels){var t=this._composeElement();return this._doNorthPost(e,t)}return this._doNorthPost(e,{workgroupRelation:{channels:[]}})}},{key:"update",value:function(){throw new Error("Workgroup relation update not allowed")}}]),t}(a.default);r.default=u,t.exports=r.default},{"../channels/Channels":180,"../provision/BaseProvision":261,"./Workgroups":380}],379:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();var i,a=e("../ProvisionGenericFinder"),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup relation not found")}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._domain+"/workgroups/"+this._name+"/relations"}},{key:"findByDomainAndName",value:function(e,t){return this._domain=e,this._name=t,this._execute()}}]),t}(((i=a)&&i.__esModule?i:{default:i}).default);r.default=o,t.exports=r.default},{"../ProvisionGenericFinder":159}],380:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function i(e){return e&&e.__esModule?e:{default:e}}var a=i(e("q")),o=function(e){function t(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}}(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["name","domainName"]),this._ogapi=e}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),n(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"name"});return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withAdministrative",value:function(e){return this._administrative=e,this}},{key:"withDomainName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_50",parameter:"domainName"});return this._domainName=e,this}},{key:"_composeElement",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._domainName+"/workgroups",{workgroup:{name:this._name||void 0,description:this._description||void 0,administrative:this._administrative||!1}}}},{key:"_composeElementUpdate",value:function(){return this._checkRequiredParameters(),this._resource="provision/domains/"+this._domainName+"/workgroups",{workgroup:{description:this._description||void 0}}}},{key:"_buildURL",value:function(){return"provision/domains/"+this._domainName+"/workgroups/"+this._name}},{key:"update",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeElementUpdate(),void 0,this._getExtraHeaders(),this._getUrlParameters()).then((function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})})).catch((function(t){e.reject(t)})),t}}]),t}(i(e("../provision/BaseProvision")).default);r.default=o,t.exports=r.default},{"../provision/BaseProvision":261,q:120}]},{},[1]);
62
+ //# sourceMappingURL=opengate-api-bower-14.1.0.min.js.map