opengate-js 12.12.1 → 12.12.2

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.
@@ -41,6 +41,6 @@ timezones:["ACT","AET","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Afr
41
41
  value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchWithSummaryBuilder"),c=n(u),l=e("../../util/searchingFields/FieldFinder"),p=n(l),f="/catalog/hardwares",d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new p.default(e,f)),this._url=f}return a(t,e),o(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}(c.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./SearchWithSummaryBuilder":313}],300:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamAccess",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamAccess",this.customFilters)}}]),t}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],301:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamPeriod",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamPeriod",this.customFilters)}}]),t}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],302:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamStoragePeriod",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamStoragePeriod",this.customFilters)}}]),t}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],303:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./SearchBuilder"),u=n(s),c=e("../../util/searchingFields/FieldFinder"),l=n(c),p="/catalog/operators",f=function(e){function t(e){i(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,p)),this._url=p}return a(t,e),t}(u.default);r.default=f,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./SearchBuilder":312}],304:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../../util/searchingFields/FieldFinder"),p=n(l),f=e("../SearchWithoutLimit"),d=n(f),h="/operationTypes",m=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new p.default(e,h)),this._url=h}return a(t,e),o(t,[{key:"build",value:function(){try{return new d.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}(c.default);r.default=m,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"../SearchWithoutLimit":267,"./SearchBuilder":312}],305:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/operationalStatus",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.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}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],306:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./SearchWithSummaryBuilder"),u=n(s),c=e("../../util/searchingFields/FieldFinder"),l=n(c),p="/jobs",f=function(e){function t(e){i(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,p)),this._url=p}return a(t,e),t}(u.default);r.default=f,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./SearchWithSummaryBuilder":313}],307:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchWithSummaryBuilder"),c=n(u),l=e("../../util/searchingFields/FieldFinder"),p=n(l),f="/catalog/plans/organization",d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new p.default(e,f)),this._url=f}return a(t,e),o(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=f+"?domainName="+this._domainName,s(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./SearchWithSummaryBuilder":313}],308:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./FlattenedSearchBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,r,i){if(n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"./FlattenedSearchBuilder":298}],309:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var 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}}(),a=(e("./SearchBuilder"),e("../Search")),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t){n(this,e),this._api=t}return i(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":266,"./SearchBuilder":312}],310:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/resourceType",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"resourceType",this.customFilters)}}]),t}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],311:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./SearchBuilder"),u=n(s),c=e("../../util/searchingFields/FieldFinder"),l=n(c),p="/rules",f=function(e){function t(e){i(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,p)),this._url=p}return a(t,e),t}(u.default);r.default=f,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./SearchBuilder":312}],312:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var 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}}(),a=e("../Search"),o=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(){function e(t,r,i){var a=this;if(n(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");this._url="",this._fieldFinder=i,this._parent=t,this._routes=r,this._routesName=[],this._builderParams={summary:!1,sort:[],filter:{},limit:void 0,group:void 0,select:void 0};for(var o in this._routes)!function(e){a._routesName.push(e),a._builderParams[e]=!1,a[e]=function(){var t=arguments.length<=0||void 0===arguments[0]?e:arguments[0];return a._builderParams[t]=!0,a}}(o);this._urlParams={}}return i(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":266}],313:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./SearchBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,r,i){if(n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return i(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}}]),t}(u.default);r.default=c,t.exports=r.default},{"./SearchBuilder":312}],314:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f="serviceGroups",d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/"+f,this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,f,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}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],315:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchWithSummaryBuilder"),c=n(u),l=e("merge"),p=n(l),f=e("../../util/searchingFields/FieldFinder"),d=n(f),h=["SOFTWARE","FIRMWARE"];r.SOFTWARE_TYPES_ENUM=h;var m="/catalog/softwares",v=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new d.default(e,m)),this._url=m,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return a(t,e),o(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===h.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(h)+"'");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,p.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}(c.default);r.default=v},{"../../util/searchingFields/FieldFinder":351,"./SearchWithSummaryBuilder":313,merge:112}],316:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){
42
42
  if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./PreFilteredSearchBuilder"),c=n(u),l=e("../../util/searchingFields/FieldFinder"),p=n(l),f="/entities",d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new p.default(e,"/subscribers")),this._url=f}return a(t,e),o(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}(c.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./PreFilteredSearchBuilder":308}],317:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./PreFilteredSearchBuilder"),c=n(u),l=e("../../util/searchingFields/FieldFinder"),p=n(l),f="/entities",d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new p.default(e,"/subscriptions")),this._url=f}return a(t,e),o(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}(c.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./PreFilteredSearchBuilder":308}],318:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./SearchWithSummaryBuilder"),u=n(s),c=e("../../util/searchingFields/FieldFinder"),l=n(c),p="/tasks",f=function(e){function t(e){i(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,p)),this._url=p}return a(t,e),t}(u.default);r.default=f,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./SearchWithSummaryBuilder":313}],319:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketPriority",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketPriority",this.customFilters)}}]),t}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],320:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketSeverity",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketSeverity",this.customFilters)}}]),t}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],321:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketStatus",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketStatus",this.customFilters)}}]),t}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],322:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../../util/searchingFields/FieldFinder"),p=n(l),f="/tickets",d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new p.default(e,f)),this._url=f}return a(t,e),o(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}(c.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./SearchBuilder":312}],323:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../../util/searchingFields/FieldFinder"),p=n(l),f=e("../WPSearch"),d=n(f),h="timeseries";r.BASE_URL=h;var m=function(e){function t(e,r,n){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new p.default(e,h,{organization:r,timeserie:n})),this._url=h+"/provision/organizations/"+r+"/"+n+"/data"}return a(t,e),o(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 d.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}}]),t}(c.default);r.default=m},{"../../util/searchingFields/FieldFinder":351,"../WPSearch":270,"./SearchBuilder":312}],324:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/timezones",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"timezones",this.customFilters)}}]),t}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],325:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userLanguages",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userLanguages",this.customFilters)}}]),t}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],326:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("./SearchBuilder"),c=n(u),l=e("../StaticSearch"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userProfile",this.customFilters={}}return a(t,e),o(t,[{key:"build",value:function(){return new p.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}(c.default);r.default=f,t.exports=r.default},{"../StaticSearch":269,"./SearchBuilder":312}],327:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./SearchWithSummaryBuilder"),u=n(s),c=e("../../util/searchingFields/FieldFinder"),l=n(c),p="/users",f=function(e){function t(e){i(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,p)),this._url=p}return a(t,e),t}(u.default);r.default=f,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./SearchWithSummaryBuilder":313}],328:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./SearchWithSummaryBuilder"),u=n(s),c=e("../../util/searchingFields/FieldFinder"),l=n(c),p="/workgroups",f=function(e){function t(e){i(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,p)),this._url=p}return a(t,e),t}(u.default);r.default=f,t.exports=r.default},{"../../util/searchingFields/FieldFinder":351,"./SearchWithSummaryBuilder":313}],329:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["NOT_ACTIVE","ACTIVE","REVOKED","EXPIRED"];r.ADMINISTRATIVE_STATE_ENUM=n},{}],330:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../ProvisionGenericFinder"),c=n(u),l=e("q"),p=n(l),f=e("http-status-codes"),d=n(f),h=e("./MIME_TYPES_ENUM"),m=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"security/certificates","certificate","Certificate not found")}return a(t,e),o(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===h.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(h.MIME_TYPES_ENUM)+"'>");return this._id=e,this._type=t,this._download()}},{key:"_download",value:function(){var e=p.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:d.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=m,t.exports=r.default},{"../ProvisionGenericFinder":143,"./MIME_TYPES_ENUM":332,"http-status-codes":76,q:120}],331:[function(require,module,exports){"use strict";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)}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}},_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:"withHardware",value:function(e){var t=[];if(void 0===e||e.constructor!==Array||0===e.length)throw new Error("Parameter hardwares must be typeof Array and cannot be empty");for(var r=0;r<e.length;r++)if(this._checkHardware(e[r]))try{e[r]=JSON.parse(e[r])}catch(e){}else t.push(r+1);if(0!==t.length)throw new Error("The hardware attribute is not well formed, the message "+JSON.stringify(t)+" not correct. Remember: hardwareId or [manufacturer, model and modelVersion] must be defined");return this._hardware=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?valid=!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={},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":329,"./Security":333,"./USAGES_ENUM":334,q:120}],332:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["x-pem-file","pkcs7-mime","raw","text/plain"];r.MIME_TYPES_ENUM=n},{}],333:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,
43
43
  enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},o=e("../provision/BaseProvision"),s=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(e){function t(e,r,i){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/security"+(void 0===r?"":r),i)}return i(t,e),t}(s.default);r.default=u,t.exports=r.default},{"../provision/BaseProvision":238}],334:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["FILE_VALIDATION","DEVICE_COMMUNICATIONS","DEVICE_ACCESS","CERT_SIGN"];r.USAGES_ENUM=n},{}],335:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("../util/formats/check_types"),p=n(l),f="timeseries/provision/organizations/";r.URL=f;var d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","timeBucket","identifierColumn"])}return a(t,e),o(t,[{key:"_buildURL",value:function(){var e=f+this._organization+"/"+this._identifier;return this._onlyPlan&&(e+="?onlyPlan=true"),e}},{key:"withOrganization",value:function(e){return p.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return p.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return p.default._checkStringAndPattern(e,"^[a-zA-Z0-9_@.-]*$","name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return p.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withTimeBucket",value:function(e){return p.default._checkNumber(e,"timeBucket"),this._timeBucket=e,this}},{key:"withDescription",value:function(e){return e&&p.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return p.default._checkArray(e,"columns"),this._columns=e,this}},{key:"withBucketColumn",value:function(e){return p.default._checkStringAndPattern(e,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketColumn=e,this}},{key:"withBucketInitColumn",value:function(e){return p.default._checkStringAndPattern(e,"^[a-zA-Z0-9 _-]*$","bucketInitColumn"),this._bucketInitColumn=e,this}},{key:"withRetention",value:function(e){return p.default._checkNumber(e,"retention"),this._retention=e,this}},{key:"withOrigin",value:function(e){return p.default._checkISODateTime(e,"origin"),this._origin=e,this}},{key:"withContext",value:function(e){return p.default._checkArray(e,"context"),this._context=e,this}},{key:"_composeElement",value:function(){return this._resource=f+this._organization,this._timeBucket>0&&(p.default._checkStringAndPattern(this._bucketColumn,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketInitColumn&&p.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&&(p.default._checkStringAndPattern(this._bucketColumn,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketInitColumn&&p.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}(c.default);r.default=d},{"../provision/BaseProvision":238,"../util/formats/check_types":350}],336:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations","timeseries")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../GenericFinder":141}],337:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["integer","number","string","boolean","date-time"];r.VALUE_TYPES_ENUM=n},{}],338:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("q"),p=n(l),f=e("../util/formats/check_types"),d=n(f),h=e("./TYPES_ENUM"),m="timeseries/provision/organizations";r.URL=m;var v=function(e){function t(e,r,n){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations"),r&&(this.withOrganization(r),n&&this.withIdentifier(n))}return a(t,e),o(t,[{key:"withIdentifier",value:function(e){return d.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withOrganization",value:function(e){return d.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withName",value:function(e){return d.default._checkString(e,"name"),this._name=e,this}},{key:"withDescription",value:function(e){return d.default._checkString(e,"description"),this._description=e,this}},{key:"withScript",value:function(e){return d.default._checkString(e,"script"),this._script=e,this}},{key:"withValueTypes",value:function(e){return d.default._checkArray(e,"valueTypes"),e.forEach(function(e){d.default._checkType(e,h.VALUE_TYPES_ENUM)}),this._valueTypes=e,this}},{key:"withReturnType",value:function(e){return d.default._checkString(e,"returnType"),d.default._checkType(e,h.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 m+"/"+this._organization+"/catalog"+(this._identifier?"/"+this._identifier:"")}},{key:"create",value:function(){var e=p.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:var n=t.status,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=p.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=p.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}(c.default);r.default=v},{"../provision/BaseProvision":238,"../util/formats/check_types":350,"./TYPES_ENUM":337,q:120}],339:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../GenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations","TimeseriesFunctions","Timeseries function not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../GenericFinder":141}],340:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../GenericFinder"),c=n(u),l=e("q"),p=n(l),f=e("http-status-codes"),d=n(f),h=e("./TYPES_ENUM"),m=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseriesFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return a(t,e),o(t,[{key:"getValueTypes",value:function(){return h.VALUE_TYPES_ENUM}},{key:"getDummyFunctions",value:function(){this._setExtraHeaders(this._jsHeaders),this._id="doc/jsApi/javascript";var e=p.default.defer(),t=e.promise;return e.resolve({data:{text:'const date = {\n "fromString": function (stringDate) {\n return new Date(stringDate);\n },\n \n "toString": function (date) {\n return date.toISOString();\n },\n "compare": function (date1, date2) {\n if (typeof date1 === \'string\') date1 = this.fromString(date1);\n if (typeof date2 === \'string\') date2 = this.fromString(date2);\n return date1.getTime() - date2.getTime();\n }\n };\n \n const data = {\n "exists": function (value) {\n return value !== null && value !== undefined;\n },\n "undefinedToNull": function (obj) {\n if(!this.exists(obj)) return null;\n \n if(obj.constructor === Array) {\n for(var element in obj){\n obj[element] = this.undefinedToNull(obj[element]);\n }\n return obj;\n } else if(obj.constructor === Object) {\n Object.keys(obj).forEach((key) => {\n obj[key] = this.undefinedToNull(obj[key]);\n });\n return obj;\n } else {\n return obj;\n }\n }\n };\n \n const result = {\n "OK_RESULT": "OK",\n "columns": {},\n \n "ok": function (value, ...extraParams) {\n var result = {\n "executionResult": this.OK_RESULT,\n "value": value,\n "extra": {}\n };\n \n for (var extraArg in extraParams) {\n Object.assign(result.extra, extraParams[extraArg]);\n }\n log.trace("aggResult: ", result);\n return result;\n },\n \n "error": function (caughtError) {\n if (caughtError instanceof Error) {\n log.error("Caught error: ", caughtError.message, " - ", caughtError.cause);\n var exceptionResult = {\n "executionResult": caughtError.message\n };\n log.trace("exceptionResult: ", exceptionResult);\n return exceptionResult;\n } else {\n log.error("Caught error: ", caughtError);\n var exceptionResult = {\n "executionResult": caughtError\n };\n log.trace("exceptionResult: ", exceptionResult);\n return exceptionResult;\n }\n }\n };\n \n const aggFunct = {\n "AVG": function (receivedValues, currentValue, extra) {\n var newCount = receivedValues.length;\n var newSum = 0;\n for (var recVal in receivedValues) {\n newSum = newSum + receivedValues[recVal].value;\n }\n if (extra) {\n if (data.exists(extra.COUNT)) newCount = newCount + extra.COUNT;\n if (data.exists(extra.SUM)) newSum = newSum + extra.SUM;\n }\n var newValue = newSum / newCount;\n return result.ok(newValue, { "SUM": newSum }, { "COUNT": newCount });\n },\n \n "MIN": function (receivedValues, currentValue, extra) {\n var newValue = currentValue;\n for (var recVal in receivedValues) {\n if (!data.exists(newValue) || receivedValues[recVal].value < newValue) {\n newValue = receivedValues[recVal].value;\n }\n }\n return result.ok(newValue);\n },\n \n "LAST": function (receivedValues, currentValue, extra) {\n var newAt;\n var newValue = currentValue;\n if (extra) {\n if (data.exists(extra.AT)) newAt = extra.AT;\n }\n for (var recVal in receivedValues) {\n if (!data.exists(newAt) || date.compare(receivedValues[recVal].at, newAt) > 0) {\n newAt = receivedValues[recVal].at;\n newValue = receivedValues[recVal].value;\n }\n }\n return result.ok(newValue, { "AT": newAt });\n },\n \n "MAX": function (receivedValues, currentValue, extra) {\n var newValue = currentValue;\n for (var recVal in receivedValues) {\n if (!data.exists(newValue) || receivedValues[recVal].value > newValue) {\n newValue = receivedValues[recVal].value;\n }\n }\n return result.ok(newValue);\n },\n \n "COUNT": function (receivedValues, currentValue, extra) {\n var newValue = receivedValues.length;\n if (data.exists(currentValue)) {\n newValue = newValue + currentValue;\n }\n return result.ok(newValue);\n },\n \n "GEO_AVG": function (receivedValues, currentValue, extra) {\n var newCount = receivedValues.length;\n var newProduct = 1;\n for (var recVal in receivedValues) {\n newProduct = newProduct * receivedValues[recVal].value;\n }\n if (extra) {\n if (data.exists(extra.COUNT)) newCount = newCount + extra.COUNT;\n if (data.exists(extra.PRODUCT)) newProduct = newProduct * extra.PRODUCT;\n }\n var newValue = Math.pow(newProduct, 1 / newCount);\n return result.ok(newValue, { "PRODUCT": newProduct }, { "COUNT": newCount });\n },\n \n "SUM": function (receivedValues, currentValue, extra) {\n var newValue = 0;\n for (var recVal in receivedValues) {\n newValue = newValue + receivedValues[recVal].value;\n }\n if (data.exists(currentValue)) {\n newValue = newValue + currentValue;\n }\n return result.ok(newValue);\n },\n \n "MEDIAN": function (receivedValues, currentValue, extra) {\n var receivedValuesFlattened = receivedValues.map(function (rv) { return rv.value });\n var completeArray;\n if (extra && extra.VAL_ARRAY) {\n completeArray = extra.VAL_ARRAY.concat(receivedValuesFlattened)\n } else {\n completeArray = receivedValuesFlattened;\n }\n completeArray.sort(function (a, b) { return a - b });\n var middle_index = Math.floor(completeArray.length / 2);\n var newMedian;\n if (completeArray.length % 2) {\n newMedian = completeArray[middle_index];\n } else {\n newMedian = (completeArray[middle_index - 1] + completeArray[middle_index]) / 2.0;\n }\n return result.ok(newMedian, { "VAL_ARRAY": completeArray });\n },\n \n "VARIANCE": function (receivedValues, currentValue, extra) {\n var receivedValuesFlattened = receivedValues.map(function (rv) { return rv.value });\n var completeArray;\n if (extra && extra.VAL_ARRAY) {\n completeArray = extra.VAL_ARRAY.concat(receivedValuesFlattened)\n } else {\n completeArray = receivedValuesFlattened;\n }\n \n var sum = 0;\n completeArray.map(e => sum += e);\n var avg = sum / completeArray.length;\n var newValue = 0;\n for (var item in completeArray) {\n newValue = newValue + Math.pow(completeArray[item] - avg, 2);\n }\n newValue = newValue / completeArray.length;\n return result.ok(newValue, { "VAL_ARRAY": completeArray });\n },\n \n "FIRST": function (receivedValues, currentValue, extra) {\n var newAt;\n var newValue = currentValue;\n if (extra) {\n if (data.exists(extra.AT)) newAt = extra.AT;\n }\n for (var recVal in receivedValues) {\n if (!data.exists(newAt) || date.compare(receivedValues[recVal].at, newAt) < 0) {\n newAt = receivedValues[recVal].at;\n newValue = receivedValues[recVal].value;\n }\n }\n return result.ok(newValue, { "AT": newAt });\n },\n \n "STD_DEVIATION": function (receivedValues, currentValue, extra) {\n var variance = this.VARIANCE(receivedValues, currentValue, extra);\n var newValue = Math.sqrt(variance.value);\n return result.ok(newValue, { "VAL_ARRAY": variance.extra.VAL_ARRAY });\n }\n };\n \n module.exports = {\n date,\n data,\n result,\n aggFunct\n } \n '},statusCode:200}),t}},{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=p.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:d.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=m,t.exports=r.default},{"../GenericFinder":141,"./TYPES_ENUM":337,"http-status-codes":76,q:120}],341:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../GenericFinder"),c=n(u),l=e("q"),p=(n(l),e("http-status-codes")),f=(n(p),function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ai","list","Transformer not found","north")}return a(t,e),o(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}(c.default));r.default=f,t.exports=r.default},{"../GenericFinder":141,"http-status-codes":76,q:120}],342:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=n(u),l=e("../provision/BaseProvision"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations",void 0,["organization","files"],"north/ai"),this._ogapi=e}return a(t,e),o(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=s(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.name,e}},{key:"performTest",value:function(e){var t=c.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=c.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:var n=e.status,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=c.default.defer();return this._ogapi.Napi.put_multipart(this._buildURL(),{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;default:t.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){t.reject(e)}),t.promise}}]),t}(p.default)
44
- ;r.default=f,t.exports=r.default},{"../provision/BaseProvision":238,q:120}],343:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"users","user","User not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],344:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("q"),p=(n(l),e("lodash")),f=n(p),d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/users",void 0,["email","workgroup","domain","profile","countryCode","langCode"])}return a(t,e),o(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:"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(this._password)throw new Error("OGAPI_PASSWORD_NOT_ALLOWED");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,"2FaType":this._twoFaType||void 0}}}},{key:"changePassword",value:function(e){if(this._newPassword=e,f.default.isEmpty(this._email)||f.default.isEmpty(this._password)||f.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:"requestResetPassword",value:function(){if(f.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,f.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(f.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_PASSWORD_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(f.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,f.default.isEmpty(this._email)||f.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)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":238,lodash:111,q:120}],345:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DATE_FORMAT="";r.TIME_FORMAT="HH:mm:ssZ"},{}],346:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){i(this,e)}return a(e,null,[{key:"eq",value:function(e,t){return{eq:n({},e,t)}}},{key:"neq",value:function(e,t){return{neq:n({},e,t)}}},{key:"like",value:function(e,t){return{like:n({},e,t)}}},{key:"gt",value:function(e,t){return{gt:n({},e,t)}}},{key:"lt",value:function(e,t){return{lt:n({},e,t)}}},{key:"gte",value:function(e,t){return{gte:n({},e,t)}}},{key:"lte",value:function(e,t){return{lte:n({},e,t)}}},{key:"in",value:function(e,t){return{in:n({},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=o,t.exports=r.default},{}],347:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("merge"),s=n(o),u=e("urlencode"),c=n(u),l=e("superagent"),p=n(l),f=e("q"),d=n(f),h=e("lodash"),m=n(h),v=e("mime-types"),y=n(v),g=e("superagent-mocker"),_=n(g),b=(0,_.default)(p.default),w=function(){function e(t,r){i(this,e),this._options=s.default.recursive(!0,this.default(),t),this._headers=r,m.default.isEmpty(t.mocks)||this._applyMocks(t.mocks)}return a(e,[{key:"_applyMocks",value:function(e){var t=this;Object.keys(e).filter(function(t){return!m.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];b[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 s=p.default.get(o);return this._createPromiseRequest(s,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 s=p.default.patch(o).send(t);return this._createPromiseRequest(s,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 s=p.default.post(o).send(t);return this._createPromiseRequest(s,null,r,n)}},{key:"post_multipart",value:function(e,t,r,n,i,a,o){var s=this._createUrl(e,a,o);console.info("POST_MULTIPART",s);var u=p.default.post(s);return this._prepareMultipartForm(t,u),this._createPromiseRequest(u,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 s=p.default.put(o).send(t);return n?n["Content-Type"]="application/json":n={"Content-Type":"application/json"},this._createPromiseRequest(s,null,r,n)}},{key:"put_multipart",value:function(e,t,r,n,i,a,o){var s=this._createUrl(e,a,o);console.info("PUT_MULTIPART",s);var u=p.default.put(s);return this._prepareMultipartForm(t,u),this._createPromiseRequest(u,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=y.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&&Object.keys(e).length>0&&t.send(e)}},{key:"delete",value:function(e,t,r,n,i,a){var o=this._createUrl(e,n,a);console.info("DELETE",o);var s;return s=i?p.default.del(o).send(i):p.default.del(o),this._createPromiseRequest(s,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 o=i[a],s=o+"="+t[o];e=0===a?e+"?"+s:e+"&"+s}var u=e.split("/"),l=u.length;return u.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,c.default)(i)+r)}else n.push((0,c.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;void 0!==a&&null!==a||(a=this._options.timeout);var o=d.default.defer(),s=o.promise,u=this._options.apiKey,c=this._options.jwt,l=-1===a?e:e.timeout(a);if(c&&!this._isSouth?l=l.set("Authorization","Bearer "+c):u&&(l=l.set("X-ApiKey",this._options.apiKey)),n)for(var p=Object.keys(n),f=0;f<p.length;f++){var h=p[f];void 0!==n[h]&&(l=l.set(h,n[h]))}if(t)for(var m in t)l=l.on(m,t[m]);return i&&e.responseType("blob"),l=l.end(function(e,t){if(null!==e){console.error("OGAPI ERROR: "),console.error(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=w,t.exports=r.default},{lodash:111,merge:112,"mime-types":115,q:120,superagent:131,"superagent-mocker":129,urlencode:138}],348:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var 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}}(),a=function(){function e(){n(this,e)}return i(e,null,[{key:"element",value:function(e,t){return{name:e,fields:t}}}]),e}();r.default=a,t.exports=r.default},{}],349:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./NorthAmpliaREST"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,r){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._isSouth=!0}return i(t,e),a(t,[{key:"_url",value:function(e){return e.south.url}}]),t}(u.default);r.default=c,t.exports=r.default},{"./NorthAmpliaREST":347}],350:[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})}}},{}],351:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(r,"__esModule",{value:!0});var o,s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=e("q"),c=n(u),l=e("lodash"),p=n(l),f=e("./source-precompiled/Fields"),d=e("./IotFields"),h=f.GENERATED_FIELDS;for(var m in d.IOT_FIELDS)if(h[m])for(var v in d.IOT_FIELDS[m])h[m][v]=d.IOT_FIELDS[m][v];else h[m]=d.IOT_FIELDS[m];var y=new RegExp("^(.+)._current\\.?(.+)?$"),g=new RegExp("\\[[0-9]+\\]"),_=(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"}),b={ENTITY_ALARM:"alarm",UPDATE_BUNDLE_VERSION:"bundle",DATAPOINTS:"datapoints",ENTITY_OPERATION:["operation","job"]},w={get:function(e){switch(e){case"entity-asset":return["entity.asset"];case"/tickets":return["ticket"];case"/channels":return["channel"];default:return}}},E={subscriber:"DEVICE_PART_SUBSCRIBER",subscription:"DEVICE_PART_SUBSCRIPTION",communicationsModule:"DEVICE_PART_COMMSMODULE",device:"DEVICE_PART_DEVICE"},x={DEVICE_PART_SUBSCRIBER:"subscriber",DEVICE_PART_SUBSCRIPTION:"subscription",DEVICE_PART_COMMSMODULE:"communicationsModule",DEVICE_PART_DEVICE:"device"},A=["relColl","relProv"],O=["DEVICE_PART_SUBSCRIBER","DEVICE_PART_SUBSCRIPTION","DEVICE_PART_COMMSMODULE","DEVICE_PART_DEVICE"],S=["subscriber","subscription","communicationsModule","device"],P="search",D={get:function(e){if(O.indexOf(_[e])>=0)return"complex";switch(_[e]){case"SearchOnDatamodel":return P;case"SearchOnDataset":return"dataset";case"SearchOnTimeseries":return"timeserie";default:return"simple"}}},k=function(e,t){function r(e){for(var t=!0;t;){var r=e;t=!1;{if(!(r.length>0&&r[0].constructor===Array))return r;r=r.reduce(function(e,t){return e.concat(t)}),e=r,t=!0}}}var n=c.default.defer(),i=t.selectedField,a=t.selectAll,o=t.extraData&&t.extraData.organization,s=e._ogapi.datamodelsSearchBuilder(),u={and:[]};return e._resourceTypes&&u.and.push({in:{"datamodels.allowedResourceTypes":e._resourceTypes}}),o&&u.and.push({eq:{"datamodels.organizationName":o}}),i&&u.and.push({eq:{"datamodels.categories.datastreams.identifier":i}}),u.and.length>0&&s.filter(u),s.build().execute().then(function(e){var t=[];200===e.statusCode&&(t=e.data.datamodels.map(function(e){return(e.categories||[]).map(function(e){return(e.datastreams||[]).map(function(e){return i||a?e:e.identifier})})}),t=r(t)),i?n.resolve(t.find(function(e){return i===e.identifier})):n.resolve(t)}).catch(function(e){n.reject(e)}),n.promise},C=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=p.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],u=s.path.match(y),c=u[1].replace(g,"[]");r.selectedField=c}k(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)})},j=(o={},a(o,P,function(e,t){k(this,e).then(function(e){t.resolve(e)}).catch(function(e){t.reject(e)})}),a(o,"simple",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;for(e=0;null===t&&e<r[n].length;e++)!function(){var a=r[n][e];a.toLowerCase()===i.toLowerCase()||a.toLowerCase()===i.toLowerCase()+"name"?t=a:b[n]&&(b[n]instanceof Array?b[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()!==b[n]+i.toLowerCase()&&a.toLowerCase()!==b[n]+"."+i.toLowerCase()&&a.toLowerCase()!==b[n]+i.toLowerCase()+"name"&&a.toLowerCase()!==b[n]+"."+i.toLowerCase()+"name"||(t=a))}();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(var o=Object.keys(r[n]),s=0;s<o.length;s++)a.push(r[n][o[s]]);t.resolve(a.slice())}),a(o,"complex",function(e,t){function r(e,t){var n=void 0;if(!(r=E[e])||!(n=t[r]))throw new Error("Invalid primaryType: "+e);return n.slice()}function n(e){return e!=this}function i(e,t){var r=[];return t.forEach(function(t){var n=e.slice(0,-1);n.push(t),r.push(n.join("."))}),r}var a=e.states,o=e.context,s=e.primaryType,u={1:function(e,t){return t[s].concat(S.filter(n,x[s]))},2:function(e,t){try{return i(e,r(e[0],t).concat(A))}catch(e){return[]}},3:function(e,t){var n=e[1];if(-1===A.indexOf(n))return[];try{return i(e,r(e[0],t))}catch(e){return[]}}},c=a.length,l=u[c];return void 0===l?t.resolve([]):t.resolve(l(a,o))}),a(o,"dataset",function(e,t){C(this,{api:"newDatasetFinder",method:"findByOrganizationAndDatasetId",entity:"dataset"},e,t)}),a(o,"timeserie",function(e,t){C(this,{api:"newTimeserieFinder",method:"findByOrganizationAndTimeserieId",entity:"timeserie"},e,t)}),o),T=function(){function e(t,r,n){i(this,e),this._ogapi=t,this._url=r,this._type=D.get(r),this._extraData=n,this._type===P&&(this._resourceTypes=w.get(r))}return s(e,[{key:"find",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e.split("."),context:h[_[this._url]],primaryType:_[this._url],extraData:this._extraData};return j[this._type].call(this,r,t),t.promise}},{key:"findAll",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e.split("."),context:h[_[this._url]],primaryType:_[this._url],selectAll:!0,extraData:this._extraData};return j[this._type].call(this,r,t),t.promise}},{key:"findFieldPath",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e,context:h[_[this._url]],primaryType:_[this._url],selectedField:e,extraData:this._extraData};return j[this._type].call(this,r,t),t.promise}}]),e}();r.default=T,t.exports=r.default},{"./IotFields":352,"./source-precompiled/Fields":353,lodash:111,q:120}],352:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={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:{
44
+ ;r.default=f,t.exports=r.default},{"../provision/BaseProvision":238,q:120}],343:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"users","user","User not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],344:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("q"),p=(n(l),e("lodash")),f=n(p),d=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/users",void 0,["email","workgroup","domain","profile","countryCode","langCode"])}return a(t,e),o(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:"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(this._password)throw new Error("OGAPI_PASSWORD_NOT_ALLOWED");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,"2FaType":this._twoFaType||void 0}}}},{key:"changePassword",value:function(e){if(this._newPassword=e,f.default.isEmpty(this._email)||f.default.isEmpty(this._password)||f.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:"requestResetPassword",value:function(){if(f.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,f.default.isEmpty(this._email))throw new Error("OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(f.default.isEmpty(this._newPassword))throw new Error("OGAPI_USER_PASSWORD_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED");if(f.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,f.default.isEmpty(this._email)||f.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)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":238,lodash:111,q:120}],345:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DATE_FORMAT="";r.TIME_FORMAT="HH:mm:ssZ"},{}],346:[function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(){function e(){i(this,e)}return a(e,null,[{key:"eq",value:function(e,t){return{eq:n({},e,t)}}},{key:"neq",value:function(e,t){return{neq:n({},e,t)}}},{key:"like",value:function(e,t){return{like:n({},e,t)}}},{key:"gt",value:function(e,t){return{gt:n({},e,t)}}},{key:"lt",value:function(e,t){return{lt:n({},e,t)}}},{key:"gte",value:function(e,t){return{gte:n({},e,t)}}},{key:"lte",value:function(e,t){return{lte:n({},e,t)}}},{key:"in",value:function(e,t){return{in:n({},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=o,t.exports=r.default},{}],347:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=e("merge"),s=n(o),u=e("urlencode"),c=n(u),l=e("superagent"),p=n(l),f=e("q"),d=n(f),h=e("lodash"),m=n(h),v=e("mime-types"),y=n(v),g=e("superagent-mocker"),_=n(g),b=(0,_.default)(p.default),w=function(){function e(t,r){i(this,e),this._options=s.default.recursive(!0,this.default(),t),this._headers=r,m.default.isEmpty(t.mocks)||this._applyMocks(t.mocks)}return a(e,[{key:"_applyMocks",value:function(e){var t=this;Object.keys(e).filter(function(t){return!m.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];b[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 s=p.default.get(o);return this._createPromiseRequest(s,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 s=p.default.patch(o).send(t);return this._createPromiseRequest(s,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 s=p.default.post(o).send(t);return this._createPromiseRequest(s,null,r,n)}},{key:"post_multipart",value:function(e,t,r,n,i,a,o){var s=this._createUrl(e,a,o);console.info("POST_MULTIPART",s);var u=p.default.post(s);return this._prepareMultipartForm(t,u),this._createPromiseRequest(u,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 s=p.default.put(o).send(t);return n?n["Content-Type"]="application/json":n={"Content-Type":"application/json"},this._createPromiseRequest(s,null,r,n)}},{key:"put_multipart",value:function(e,t,r,n,i,a,o){var s=this._createUrl(e,a,o);console.info("PUT_MULTIPART",s);var u=p.default.put(s);return this._prepareMultipartForm(t,u),this._createPromiseRequest(u,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=y.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=this._createUrl(e,n,a);console.info("DELETE",o);var s;return s=i?p.default.del(o).send(i):p.default.del(o),this._createPromiseRequest(s,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 o=i[a],s=o+"="+t[o];e=0===a?e+"?"+s:e+"&"+s}var u=e.split("/"),l=u.length;return u.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,c.default)(i)+r)}else n.push((0,c.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;void 0!==a&&null!==a||(a=this._options.timeout);var o=d.default.defer(),s=o.promise,u=this._options.apiKey,c=this._options.jwt,l=-1===a?e:e.timeout(a);if(c&&!this._isSouth?l=l.set("Authorization","Bearer "+c):u&&(l=l.set("X-ApiKey",this._options.apiKey)),n)for(var p=Object.keys(n),f=0;f<p.length;f++){var h=p[f];void 0!==n[h]&&(l=l.set(h,n[h]))}if(t)for(var m in t)l=l.on(m,t[m]);return i&&e.responseType("blob"),l=l.end(function(e,t){if(null!==e){console.error("OGAPI ERROR: "),console.error(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=w,t.exports=r.default},{lodash:111,merge:112,"mime-types":115,q:120,superagent:131,"superagent-mocker":129,urlencode:138}],348:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(r,"__esModule",{value:!0});var 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}}(),a=function(){function e(){n(this,e)}return i(e,null,[{key:"element",value:function(e,t){return{name:e,fields:t}}}]),e}();r.default=a,t.exports=r.default},{}],349:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("./NorthAmpliaREST"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e,r){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._isSouth=!0}return i(t,e),a(t,[{key:"_url",value:function(e){return e.south.url}}]),t}(u.default);r.default=c,t.exports=r.default},{"./NorthAmpliaREST":347}],350:[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})}}},{}],351:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Object.defineProperty(r,"__esModule",{value:!0});var o,s=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),u=e("q"),c=n(u),l=e("lodash"),p=n(l),f=e("./source-precompiled/Fields"),d=e("./IotFields"),h=f.GENERATED_FIELDS;for(var m in d.IOT_FIELDS)if(h[m])for(var v in d.IOT_FIELDS[m])h[m][v]=d.IOT_FIELDS[m][v];else h[m]=d.IOT_FIELDS[m];var y=new RegExp("^(.+)._current\\.?(.+)?$"),g=new RegExp("\\[[0-9]+\\]"),_=(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"}),b={ENTITY_ALARM:"alarm",UPDATE_BUNDLE_VERSION:"bundle",DATAPOINTS:"datapoints",ENTITY_OPERATION:["operation","job"]},w={get:function(e){switch(e){case"entity-asset":return["entity.asset"];case"/tickets":return["ticket"];case"/channels":return["channel"];default:return}}},E={subscriber:"DEVICE_PART_SUBSCRIBER",subscription:"DEVICE_PART_SUBSCRIPTION",communicationsModule:"DEVICE_PART_COMMSMODULE",device:"DEVICE_PART_DEVICE"},x={DEVICE_PART_SUBSCRIBER:"subscriber",DEVICE_PART_SUBSCRIPTION:"subscription",DEVICE_PART_COMMSMODULE:"communicationsModule",DEVICE_PART_DEVICE:"device"},A=["relColl","relProv"],O=["DEVICE_PART_SUBSCRIBER","DEVICE_PART_SUBSCRIPTION","DEVICE_PART_COMMSMODULE","DEVICE_PART_DEVICE"],S=["subscriber","subscription","communicationsModule","device"],P="search",D={get:function(e){if(O.indexOf(_[e])>=0)return"complex";switch(_[e]){case"SearchOnDatamodel":return P;case"SearchOnDataset":return"dataset";case"SearchOnTimeseries":return"timeserie";default:return"simple"}}},k=function(e,t){function r(e){for(var t=!0;t;){var r=e;t=!1;{if(!(r.length>0&&r[0].constructor===Array))return r;r=r.reduce(function(e,t){return e.concat(t)}),e=r,t=!0}}}var n=c.default.defer(),i=t.selectedField,a=t.selectAll,o=t.extraData&&t.extraData.organization,s=e._ogapi.datamodelsSearchBuilder(),u={and:[]};return e._resourceTypes&&u.and.push({in:{"datamodels.allowedResourceTypes":e._resourceTypes}}),o&&u.and.push({eq:{"datamodels.organizationName":o}}),i&&u.and.push({eq:{"datamodels.categories.datastreams.identifier":i}}),u.and.length>0&&s.filter(u),s.build().execute().then(function(e){var t=[];200===e.statusCode&&(t=e.data.datamodels.map(function(e){return(e.categories||[]).map(function(e){return(e.datastreams||[]).map(function(e){return i||a?e:e.identifier})})}),t=r(t)),i?n.resolve(t.find(function(e){return i===e.identifier})):n.resolve(t)}).catch(function(e){n.reject(e)}),n.promise},C=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=p.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],u=s.path.match(y),c=u[1].replace(g,"[]");r.selectedField=c}k(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)})},j=(o={},a(o,P,function(e,t){k(this,e).then(function(e){t.resolve(e)}).catch(function(e){t.reject(e)})}),a(o,"simple",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;for(e=0;null===t&&e<r[n].length;e++)!function(){var a=r[n][e];a.toLowerCase()===i.toLowerCase()||a.toLowerCase()===i.toLowerCase()+"name"?t=a:b[n]&&(b[n]instanceof Array?b[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()!==b[n]+i.toLowerCase()&&a.toLowerCase()!==b[n]+"."+i.toLowerCase()&&a.toLowerCase()!==b[n]+i.toLowerCase()+"name"&&a.toLowerCase()!==b[n]+"."+i.toLowerCase()+"name"||(t=a))}();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(var o=Object.keys(r[n]),s=0;s<o.length;s++)a.push(r[n][o[s]]);t.resolve(a.slice())}),a(o,"complex",function(e,t){function r(e,t){var n=void 0;if(!(r=E[e])||!(n=t[r]))throw new Error("Invalid primaryType: "+e);return n.slice()}function n(e){return e!=this}function i(e,t){var r=[];return t.forEach(function(t){var n=e.slice(0,-1);n.push(t),r.push(n.join("."))}),r}var a=e.states,o=e.context,s=e.primaryType,u={1:function(e,t){return t[s].concat(S.filter(n,x[s]))},2:function(e,t){try{return i(e,r(e[0],t).concat(A))}catch(e){return[]}},3:function(e,t){var n=e[1];if(-1===A.indexOf(n))return[];try{return i(e,r(e[0],t))}catch(e){return[]}}},c=a.length,l=u[c];return void 0===l?t.resolve([]):t.resolve(l(a,o))}),a(o,"dataset",function(e,t){C(this,{api:"newDatasetFinder",method:"findByOrganizationAndDatasetId",entity:"dataset"},e,t)}),a(o,"timeserie",function(e,t){C(this,{api:"newTimeserieFinder",method:"findByOrganizationAndTimeserieId",entity:"timeserie"},e,t)}),o),T=function(){function e(t,r,n){i(this,e),this._ogapi=t,this._url=r,this._type=D.get(r),this._extraData=n,this._type===P&&(this._resourceTypes=w.get(r))}return s(e,[{key:"find",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e.split("."),context:h[_[this._url]],primaryType:_[this._url],extraData:this._extraData};return j[this._type].call(this,r,t),t.promise}},{key:"findAll",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e.split("."),context:h[_[this._url]],primaryType:_[this._url],selectAll:!0,extraData:this._extraData};return j[this._type].call(this,r,t),t.promise}},{key:"findFieldPath",value:function(){var e=arguments.length<=0||void 0===arguments[0]?"":arguments[0],t=c.default.defer(),r={states:e,context:h[_[this._url]],primaryType:_[this._url],selectedField:e,extraData:this._extraData};return j[this._type].call(this,r,t),t.promise}}]),e}();r.default=T,t.exports=r.default},{"./IotFields":352,"./source-precompiled/Fields":353,lodash:111,q:120}],352:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={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:{
45
45
  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"}},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"]}};r.IOT_FIELDS=n},{}],353:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={ENTITY_OPERATION_HISTORY:{ENTITY_OPERATION_HISTORY:["applicationEmail","entityId","entityType","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","entityType","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"]}};r.GENERATED_FIELDS=n},{}],354:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],355:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("../provision/BaseProvision"),c=n(u),l=e("./Workgroups"),p=n(l),f=e("../channels/Channels"),d=n(f),h=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["workgroup","channels"]),this._ogapi=e,this._action="CREATE"}return a(t,e),o(t,[{key:"withWorkgroup",value:function(e){if(e.constructor.prototype!=p.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!=d.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}(c.default);r.default=h,t.exports=r.default},{"../channels/Channels":164,"../provision/BaseProvision":238,"./Workgroups":357}],356:[function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var a=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},s=e("../ProvisionGenericFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(s),c=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup relation not found")}return i(t,e),a(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}(u.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":143}],357:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var o=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),s=function(e,t,r){for(var n=!0;n;){var i=e,a=t,o=r;n=!1,null===i&&(i=Function.prototype);var s=Object.getOwnPropertyDescriptor(i,a);if(void 0!==s){if("value"in s)return s.value;var u=s.get;if(void 0===u)return;return u.call(o)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=a,r=o,n=!0,s=c=void 0}},u=e("q"),c=n(u),l=e("../provision/BaseProvision"),p=n(l),f=function(e){function t(e){i(this,t),s(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["name","domainName"]),this._ogapi=e}return a(t,e),o(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=c.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}(p.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":238,q:120}]},{},[1]);
46
- //# sourceMappingURL=opengate-api-bower-12.12.1.min.js.map
46
+ //# sourceMappingURL=opengate-api-bower-12.12.2.min.js.map