opengate-js 11.16.1 → 11.16.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.
@@ -26,14 +26,14 @@ e("./Hardware")),s=n(u),c=e("./Software"),l=n(c),f=e("./Usage"),d=n(f),h=e("./St
26
26
  key:"withNorthCriterias",value:function(e){if(!(e instanceof Array)||0===e.length)throw new Error("Parameter north criteria must be an array and cannot be empty");return this._northCriterias=e,this}},{key:"withSouthCriterias",value:function(e){var t=this;if(!(e instanceof Array)||0===e.length)throw new Error("Parameter south criteria must be an array and cannot be empty");return e.forEach(function(e){try{t.addSouthCriteria(e)}catch(e){throw t._southCriterias=null,e}}),this}},{key:"addSouthCriteria",value:function(e){if("string"!=typeof e)throw new Error("South criteria must be a string");return this._southCriterias||(this._southCriterias=[]),this._southCriterias.push(e),this}},{key:"withType",value:function(e){if("string"!=typeof e||!this._checkValues(e,l.CONNECTOR_FUNCTION_TYPES))throw new Error("Parameter type must be a string and must be one of these values: "+l.CONNECTOR_FUNCTION_TYPES);return this._type=e,this}},{key:"withPayloadType",value:function(e){if("string"!=typeof e||!this._checkValues(e,l.CONNECTOR_FUNCTION_PAYLOAD_TYPES))throw new Error("Parameter payload type must be a string and must be one of these values: "+l.CONNECTOR_FUNCTION_PAYLOAD_TYPES);return this._payloadType=e,this}},{key:"withOperationalStatus",value:function(e){if("string"!=typeof e||!this._checkValues(e,l.CONNECTOR_FUNCTION_OPERATIONAL_STATUS))throw new Error("Parameter operational status must be a string and must be one of these values: "+l.CONNECTOR_FUNCTION_OPERATIONAL_STATUS);return this._operationalStatus=e,this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,operationalStatus:this._operationalStatus,operationName:"COLLECTION"!==this._type?this._operationName:void 0,type:this._type,payloadType:this._payloadType,javascript:this._javascript,description:this._description?this._description:void 0,northCriterias:"REQUEST"===this._type?this._northCriterias:void 0,southCriterias:"REQUEST"!==this._type?this._southCriterias:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._operationalStatus||void 0===this._type||void 0===this._payloadType||void 0===this._javascript)throw new Error("Parameters organization, channel, operational status, type, payloadType, javascript and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._operationalStatus||void 0===this._type||void 0===this._payloadType||void 0===this._javascript)throw new Error("Parameters organization, channel, operational status, type, payloadType, javascript and name must be defined");if("REQUEST"===this._type&&"JSON"!==this._payloadType)throw new Error("Parameter payload type must be JSON when type REQUEST")}},{key:"_buildURL",value:function(){return"connectorFunctions/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=d.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=h,t.exports=r.default},{"../provision/BaseProvision":225,"./enum/_CONNECTOR_FUNCTIONS_ENUMS":184,q:109}],182:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions/provision/organizations","connectorFunctions","Connector functions not found")}return i(t,e),o(t,[{key:"findByOrganizationAndChannel",value:function(e,t){var r=this;return r._organization=e,r._channel=t,this._execute()}},{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+(this._name?"/"+this._name:"")}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],183:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=e("./enum/_CONNECTOR_FUNCTIONS_ENUMS"),m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"connectorFunctions"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return o(t,e),a(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="doc/jsApi/javascript",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/internal",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/jsApi/client",this._execute()}},{key:"_execute",value:function(){var e=f.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:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"getSouthCriteriasProtocols",value:function(){return p.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS}},{key:"getPayloadTypes",value:function(){return p.CONNECTOR_FUNCTION_PAYLOAD_TYPES}}]),t}(c.default);r.default=m,t.exports=r.default},{"../GenericFinder":136,"./enum/_CONNECTOR_FUNCTIONS_ENUMS":184,"http-status-codes":68,q:109}],184:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["DISABLED","PRODUCTION","TEST"];r.CONNECTOR_FUNCTION_OPERATIONAL_STATUS=n;var i=["COLLECTION","REQUEST","RESPONSE"];r.CONNECTOR_FUNCTION_TYPES=i;var o=["TEXT","JSON","BINARY"];r.CONNECTOR_FUNCTION_PAYLOAD_TYPES=o;var a=["https://","wss://","mqtts://"];r.CONNECTOR_FUNCTION_SOUTH_PROTOCOLS=a},{}],185:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"datasets/provision/organizations","datasets")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndDatasetId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],186:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","columns","identifierColumn"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"datasets/provision/organizations/"+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkString(e,"name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return f.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withDescription",value:function(e){return e&&f.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return f.default._checkArray(e,"columns"),this._columns=e,this}},{key:"_composeElement",value:function(){return this._resource="datasets/provision/organizations/"+this._organization,{name:this._name,description:this._description,type:this._type,identifierColumn:this._identifierColumn,columns:this._columns}}},{key:"update",value:function(){throw new Error("OGAPI_DAATASET_NOT_UPDATED")}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":225,"../util/formats/check_types":328}],187:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=(n(s),e("../provision/BaseProvision")),l=n(c),f=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains"),this._ogapi=e}return o(t,e),a(t,[{key:"withName",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_NAME_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_DESCRIPTION_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withParentDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_DOMAIN_PARAMETER_MAX_LENGTH_50");return this._parentDomain=e,this}},{key:"_composeElement",value:function(){if(void 0===this._name)throw new Error({message:"OGAPI_DEFINED_PARAMETER",parameter:"name"});return{domain:{name:this._name||void 0,description:this._description||void 0,parentDomain:this._parentDomain||void 0}}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._name}},{key:"_composeUpdateElement",value:function(){var e=u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this);return delete e.domain.name,e}}]),t}(l.default);r.default=f,t.exports=r.default},{"../provision/BaseProvision":225,q:109}],188:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","domain","Domain not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._setUrlParameters({hierarchy:this._hierarchy}),this._baseUrl+"/"+this._name}},{key:"findByName",value:function(e){return this._name=e,this._hierarchy="false",this._execute()}},{key:"findByNameWithHierarchy",value:function(e){return this._name=e,this._hierarchy="true",this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":138}],189:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"device","Device not found")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":190}],190:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i,o){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations",r||"entity",i||"Entity not found"),this._entitySource=o||"entities",this._flattened=!1}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._entitySource+"/"+this._id}},{key:"findByOrganizationAndId",value:function(e,t,r){return this._organization=e,this._id=t,this._setUrlParameters({flattened:r}),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":138}],191:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscriber","Subscriber not found")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":190}],192:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"subscription","Subscription not found")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":190}],193:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./EntityFinder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"ticket","Ticket not found","tickets")}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./EntityFinder":190}],194:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=e("../util/formats/check_types"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/geocluster",void 0,"identifier")}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provision/geocluster/"+this._identifier+"/clustering"}},{key:"withIdentifier",value:function(e){return h.default._checkStringAndLength(e,50,"identifier"),this._identifier=e,this}},{key:"_composeElement",value:function(){this._resource="provision/geocluster/"+this._identifier+"/clustering"}},{key:"_composeElementUpdate",value:function(){return u(Object.getPrototypeOf(t.prototype),"_composeUpdateElement",this).call(this)}},{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}(f.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":225,"../util/formats/check_types":328,q:109}],195:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"geocluster","geocluster","Geocluster not found")}return i(t,e),o(t,[{key:"findById",value:function(e){return this._id=e,this._setUrlParameters(),this._execute()}},{key:"findAll",value:function(){return this._id=void 0,this._setUrlParameters(),this._execute()}},{key:"findFeatures",value:function(e,t){var r=t.zoom,n=t.topRight,i=t.bottomLeft;return this._id=e,this._setUrlParameters({zoom:r,topRight:n,bottomLeft:i}),this._execute()}},{key:"_composeUrl",value:function(){return this._id?this._getUrlParameters()?this._baseUrl+"/"+this._id+"/view":this._baseUrl+"/"+this._id:this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":138}],196:[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}}(),o=e("./Datastream"),a=(function(e){e&&e.__esModule}(o),function(){function e(t,r,i){n(this,e),this._ogapi=t,this._isValidString(r,"identifier",50),this._identifier=r,this._datastreams=i||[]}return i(e,[{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"addDatastream",value:function(e){if(!e||"object"!=typeof e)throw new Error("Datastream must be an object");return this._datastreams.push(e),this}},{key:"addDatastreams",value:function(e){var t=this;if(!Array.isArray(e))throw new Error("Datastreams must be an array");var r=[];if(e.forEach(function(e,n){try{t.addDatastream(e)}catch(e){r.push("Error on datastream with index ["+n+"]: "+e)}}),r.length>0)throw new Error("Error adding datastreams: "+JSON.stringify(r));return this}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Category")}},{key:"_composeElement",value:function(){if(!this._identifier)throw new Error("identifier is required on Category");return{identifier:this._identifier,name:this._name?this._name:void 0,datastreams:this._datastreams}}}]),e}());r.default=a,t.exports=r.default},{"./Datastream":197}],197:[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}}(),o=e("ajv"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(){n(this,e)}return i(e,[{key:"withId",value:function(e){return this._isValidString(e,"id",100),this._id=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",500),this._description=e,this}},{key:"withUnit",value:function(e,t,r){return this._isValidString(e,"type",500),this._isValidString(t,"label",500),this._isValidString(r,"symbol",10),this._unit={type:e,label:t,symbol:r},this}},{key:"withPeriod",value:function(e){return this._isValidString(e,"period",500),this._period=e,this}},{key:"withSchema",value:function(e){if(!e||"object"!=typeof e)throw new Error("Schema must be an object or a string on Datastream");return this._schema=e,this}},{key:"withTags",value:function(e){if(e){if(!Array.isArray(e))throw new Error("Tags must be an array on Datastream");this._tags=e}return this}},{key:"addQrating",value:function(e){if(!e||"object"!=typeof e)throw new Error("Qrating must be an instance of object on Datastream");return this._qrating=e,this}},{key:"withStorage",value:function(e,t){if(this._isValidString(e,"period",500),!t||"number"!=typeof t)throw new Error("Total must be a number on Datastream");return this._storage={total:t,period:e},this}},{key:"withAccess",value:function(e){if(this._isValidString(e,"access",50),!e)throw new Error("Access must be a valid string");return this._access=e,this}},{key:"withHardwaresIds",value:function(e){if(e&&!Array.isArray(e))throw new Error("hardware Ids must be an array on Datastream");return this._hardwares=e,this}},{key:"build",value:function(){if(!this._id)throw new Error("Id is required on Datastream");if(!this._name)throw new Error("Name is required on Datastream");if(!this._unit)throw new Error("Unit is required on Datastream");if(!this._period)throw new Error("Period is required on Datastream");if(!this._schema)throw new Error("Schema is required on Datastream");try{(new a.default).compile(this._schema)}catch(e){throw new Error("Schema not valid: "+e)}return{identifier:this._id,name:this._name,description:this._description,period:this._period,tags:this._tags,unit:this._unit,schema:this._schema,qrating:this._qrating,storage:this._storage,hardwareIds:this._hardwares,access:this._access}}},{key:"_isValidString",value:function(e,t,r){
27
27
  if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Datastream")}}]),e}();r.default=u,t.exports=r.default},{ajv:2}],198:[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}}(),o=function(){function e(){n(this,e)}return i(e,[{key:"withMinRequired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minRequired={label:e,value:t},this}},{key:"withMinDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._minDesired={label:e,value:t},this}},{key:"withIdeal",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._ideal={label:e,value:t},this}},{key:"withMaxDesired",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxDesired={label:e,value:t},this}},{key:"withMaxAllowed",value:function(e,t){return this._isValidString(e,"label",50),this._isValidNumber(t,"value"),this._maxAllowed={label:e,value:t},this}},{key:"withMaxScore",value:function(e){return this._isValidNumber(e,"maxScore"),this._maxScore=e,this}},{key:"withCumulativePeriodDivisor",value:function(e){return e&&this._isValidNumber(e,"cumulativePeriodDivisor"),this._cumulativePeriodDivisor=e,this}},{key:"withConversionMatrix",value:function(e){if(e&&"object"!=typeof e)throw new Error("ConversionMatrix must be an object on Qrating");return this._conversionMatrix=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"build",value:function(){if(!this._version)throw new Error("Version is required on Qrating");if(!this._minRequired)throw new Error("MinRequired is required on Qrating");if(!this._minDesired)throw new Error("MinDesired is required on Qrating");if(!this._ideal)throw new Error("Ideal is required on Qrating");if(!this._maxDesired)throw new Error("MaxDesired is required on Qrating");if(!this._maxAllowed)throw new Error("MaxAllowed is required on Qrating");if(!this._maxScore)throw new Error("MaxScore is required on Qrating");return{min_required:this._minRequired,min_desired:this._minDesired,ideal:this._ideal,max_desired:this._minDesired,max_allowed:this._maxAllowed,max_score:this._maxScore,cumulative_period_divisor:this._cumulativePeriodDivisor,conversion_matrix:this._conversionMatrix,version:this._version}}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on Qrating")}},{key:"_isValidNumber",value:function(e,t){if("number"!=typeof e)throw new Error("Parameter "+t+" must be a number, cannot be empty on Qrating")}}]),e}();r.default=o,t.exports=r.default},{}],199:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../../provision/BaseProvision"),c=n(s),l=e("../catalog/Category"),f=n(l),d=e("../catalog/Datastream"),h=(n(d),"/organizations");r.PRE_RESOURCE=h;var p="/datamodels";r.DATAMODELS_RESOURCE=p;var m=function(e){function t(e,r){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,h),this._isValidString(r,"organization",50),this._organization=r,this._categories=[],this._resourceType=[],this._resource=this._resource+"/"+this._organization+p}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){return this._isValidString(e,"identifier",100),this._identifier=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",100),this._description=e,this}},{key:"addAllowedResourceType",value:function(e){return e&&this._isValidString(e,"resourceType",100),this._resourceType.push(e),this}},{key:"addCategory",value:function(e,t){var r=e.identifier;if(!r||this._isValidString(r,"category",100))throw new Error("Category identifier is required");this._categories.forEach(function(e,t){if(r===e.identifier)throw new Error("Category "+r+" already exists.")});var n=new f.default(this._ogapi,r);return e.name&&n.withName(e.name),t&&t.length>0&&n.addDatastreams(t),this._categories.push(n._composeElement()),this}},{key:"addDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1;if(this._categories.forEach(function(t,n){t.identifier===e&&(r=n)}),-1===r)throw new Error("Category "+e+" not exists for this datamodel. Use addCategory instead.");return this._categories[r].datastreams?this._categories[r].datastreams.push(t):this._categories[r].datastreams=[t],this}},{key:"_composeElement",value:function(){if(!this._name)throw new Error("name is required on IoTDatamodel");if(!this._version)throw new Error("version is required on IoTDatamodel");if(!this._resourceType)throw new Error("allowedResourceTypes is required on IoTDatamodel");return{identifier:this._identifier,name:this._name,version:this._version,description:this._description,allowedResourceTypes:this._resourceType,categories:this._categories.length>0?this._categories:void 0}}},{key:"_buildURL",value:function(){return this._resource}},{key:"update",value:function(){throw new Error("Update not supported on this builder. Use datamodelsHelper instead.")}},{key:"delete",value:function(){throw new Error("Delete not supported on this builder. Use datamodelsHelper instead.")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+"on IoTDatamodel")}}]),t}(c.default);r.default=m},{"../../provision/BaseProvision":225,"../catalog/Category":196,"../catalog/Datastream":197}],200:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u);r.DATAMODEL_RESOURCE="/datamodels/";var c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/","datamodels","Datamodel not found")}return i(t,e),o(t,[{key:"_composeUrl",value:function(){return this._baseUrl+this._organization+"/datamodels/"+this._id}},{key:"findByOrganizationAndId",value:function(e,t){return this._organization=e,this._id=t,this._execute()}}]),t}(s.default);r.default=c},{"../../ProvisionGenericFinder":138}],201:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../../provision/BaseProvision"),c=n(s),l=e("../catalog/Category"),f=n(l),d=e("../catalog/Datastream"),h=(n(d),"/organizations");r.PRE_RESOURCE=h;r.POST_RESOURCE="/datamodels";var p=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,h),this._isValidString(r,"organization",50),this._organization=r,this._datamodel=n,this._name=this._datamodel.name,this._isValidString(this._name,"name of object datamodel",100),this._version=this._datamodel.version,this._isValidString(this._version,"version of object datamodel",100),this._description=this._datamodel.description,this._categories=this._datamodel.categories,this._identifier=this._datamodel.identifier}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){return this._isValidString(e,"identifier",100),this._identifier=e,this}},{key:"withName",value:function(e){return this._isValidString(e,"name",100),this._name=e,this}},{key:"withVersion",value:function(e){return this._isValidString(e,"version",100),this._version=e,this}},{key:"withDescription",value:function(e){return e&&this._isValidString(e,"description",100),this._description=e,this}},{key:"addCategory",value:function(e,t){this._categories?this._categories.forEach(function(t,r){if(t.identifier===e.identifier)throw new Error("Category "+e.identifier+" already exists.")}):this._categories=[];var r=new f.default(this._ogapi,e.identifier);return e.name&&r.withName(e.name),t&&t.length>0&&r.addDatastreams(t),this._categories.push(r._composeElement()),this}},{key:"addDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1;if(this._categories.forEach(function(t,n){t.identifier===e&&(r=n)}),-1===r)throw new Error("Category "+e+" not exists for this datamodel. Use addCategory instead.");return this._categories[r].datastreams?this._categories[r].datastreams.push(t):this._categories[r].datastreams=[t],this}},{key:"removeCategory",value:function(e){this._isValidString(e,"category",100);var t=-1;if(this._categories.forEach(function(r,n){r.identifier===e&&(t=n)}),-1===t)throw new Error("Category "+e+" not exists for this datamodel");return this._categories.splice(t,1),this}},{key:"removeDatastream",value:function(e,t){this._isValidString(e,"category",100);var r=-1,n=-1;if(this._categories.forEach(function(i,o){i.identifier===e&&(r=o,i.datastreams.forEach(function(e,r){e.identifier===t&&(n=r)}))}),-1===r)throw new Error("Category "+e+" not exists for this datamodel");if(-1===n)throw new Error("Datastream "+t+" not exists for this datamodel and category "+e);this._categories[r].datastreams.splice(n,1);var i=new f.default(this._ogapi,e,this._categories[r].datastreams);return this._categories[r].name&&i.withName(this._categories[r].name),this._categories.splice(r,1),this._categories.push(i._composeElement()),this}},{key:"updateCategory",value:function(e,t){this._isValidString(e,"old category",100);var r=-1,n=-1;if(this._categories.forEach(function(i,o){switch(i.identifier){case e:r=o;break;case t.identifier:n=o}}),-1!=n)throw new Error("New category "+t.identifier+" already exists.");if(-1===r)throw new Error("Category "+e+" not exists for this datamodel.");return this._categories[r].name=t.name,this}},{key:"updateDatastream",value:function(e,t,r){if(this._isValidString(e,"category",100),this._isValidString(t,"id datastream",100),!r||"object"!=typeof r)throw new Error("Datastream must be an object");var n=-1,i=-1;if(this._categories.forEach(function(r,o){r.identifier===e&&(n=o,r.datastreams.forEach(function(e,r){e.identifier===t&&(i=r)}))}),-1===n)throw new Error("Category "+e+" not exists for this datamodel. Create it, use method addCategory instead");if(-1===i)throw new Error("Datastream "+t+" not exists for this datamodel and category "+e+". Create it, use method addDatastream instead.");return this._categories[n].datastreams[i]=r,this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,version:this._version,description:this._description,categories:this._categories}}},{key:"_buildURL",value:function(){return this._resource+"/"+this._organization+"/datamodels/"+this._identifier}},{key:"create",value:function(){throw new Error("Create not supported on this builder. Use DatamodelsBuilder instead.")}},{key:"_isValidString",value:function(e,t,r){if("string"!=typeof e||0===e.length||e.length>r)throw new Error("Parameter "+t+" must be a string, cannot be empty and has a maximum length of "+r+" on DatamodelsHelper")}}]),t}(c.default);r.default=p},{"../../provision/BaseProvision":225,"../catalog/Category":196,"../catalog/Datastream":197}],202:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),n&&this.withIdentifier(n),o&&(o.name&&this.withName(o.name),o.title&&this.withTitle(o.title),o.description&&this.withDescription(o.description),o.fromCatalog&&this.fromCatalog(o.fromCatalog),!n&&o.fromCatalog||(o.steps&&this.withSteps(o.steps),o.parameters&&this.withParameters(o.parameters),o.models&&this.withModels(o.models),o.applicableTo&&this.applicableTo(o.applicableTo)))}return o(t,e),a(t,[{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withTitle",value:function(e){if("string"!=typeof e)throw new Error("Parameter title must be a string, cannot be empty and has a maximum length of 50");return this._title=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){return this._description=e||void 0,this}},{key:"withParameters",value:function(e){return this._parameters=e||void 0,this}},{key:"fromCatalog",value:function(e){return this._fromCatalog=e,this}},{key:"withSteps",value:function(e){return this._steps=e||void 0,this}},{key:"withModels",value:function(e){return this._models=e||void 0,this}},{key:"applicableTo",value:function(e){return this._applicableTo=e||void 0,this}},{key:"_composeElement",value:function(e){return{name:this._name,title:this._title,description:this._description?this._description:void 0,parameters:this._parameters||void 0,fromCatalog:this._fromCatalog||void 0,steps:this._steps||void 0,models:this._models||void 0,applicableTo:this._applicableTo||void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._name||void 0===this._title)throw new Error("Parameters organization, title and name must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._title)throw new Error("Parameters organization, title and name must be defined")}},{key:"_buildURL",value:function(){return"operationTypes/"+this._resource+"/"+this._organization}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+"/"+this._identifier,this._composeElement(!0))}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization)throw new Error("Parameters organization and name must be defined");var e=f.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+"/"+this._identifier).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":225,q:109}],203:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/catalog","operationType","Operation types not found")}return i(t,e),o(t,[{key:"getOperationTypes",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],204:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"operationTypes/provision/organizations","operationTypes","Operation type not found")}return i(t,e),o(t,[{key:"findByOrganizationAndName",value:function(e,t){var r=this;return r._organization=e,r._name=t,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],205:[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 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}}(),a=e("q"),u=n(a),s=e("moment"),c=n(s),l=function(){function e(t,r){if(i(this,e),"string"!=typeof r)throw new Error("Parameter operationId must be a string");this._ogapi=t,this._resource="operation",this._operationId=r}return o(e,[{key:"active",value:function(){var e={request:{active:!0}};return this._key="job",this._resource=this._resource+"/jobs/"+this._operationId,this._update(e)}},{key:"pause",value:function(){var e={request:{active:!1}};return this._key="job",this._resource=this._resource+"/jobs/"+this._operationId,this._update(e)}},{key:"cancel",value:function(){return this._id=this._operationId,this._resource=this._resource+"/jobs/"+this._id,this._cancel(this._resource)}},{key:"activePeriodicity",value:function(){var e={active:!0};return this._key="task",this._resource=this._resource+"/tasks/",this._periodicityActions("ACTIVE",e)}},{key:"pausePeriodicity",value:function(){var e={active:!1};return this._key="task",this._resource=this._resource+"/tasks/",this._periodicityActions("PAUSE",e)}},{key:"cancelPeriodicity",value:function(){return this._resource=this._resource+"/tasks/",this._periodicityActions("CANCEL")}},{key:"executeNow",value:function(){var e={request:{schedule:{start:{}}}};return this._readAndUpdate(e,!0)}},{key:"executeLater",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");var t={request:{schedule:{start:{delayed:c.default.duration(e,"minutes").asMilliseconds()}}}};return this._readAndUpdate(t)}},{key:"changeCallback",value:function(e){if("string"!=typeof e)throw new Error("Parameter url must be a string");var t={request:{callback:e}};return this._readAndUpdate(t)}},{key:"_cancel",value:function(){var e=this,t=u.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then(function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(r){t.reject(e._formatError(r))}),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=u.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findById(r._operationId).then(function(i){var o=i.data;if(o&&0!=Object.keys(o).length){var a=o.taskId;if(a)switch(r._resource=r._resource+a,e){case"PAUSE":case"ACTIVE":r._update(t).then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;case"CANCEL":r._id=a,r._cancel().then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;default:n.reject({errors:"Not implemented action: "+e})}else n.reject({errors:"Operation is not periodic!"})}else n.reject({errors:"Operation with id "+r._operationId+" not exists"})}).catch(function(e){n.reject(e)}),i}},{key:"_readAndUpdate",value:function(e,t){var r=u.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findById(i._operationId).then(function(n){var o=n.data;o?function(){var n=!!o.operation&&o.operation.active;n?i.pause().then(function(o){i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}).catch(function(e){r.reject(i._formatError(e))}):i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}():r.reject("Operation with id "+i._operationId+" not exists")}).catch(function(e){r.reject(i._formatError(e))}),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=u.default.defer(),o=i.promise,a={};return a[n._key]=e,this._ogapi.Napi.put(this._resource,a).then(function(e){if(t)n.active().then(function(e){i.resolve(e)}).catch(function(e){i.reject(this._formatError(e))});else if(200===e.status){var r=""!=e.text?JSON.parse(e.text):{};e.status;i.resolve(e)}else i.reject({errors:e.errors,statusCode:e.status})}).catch(function(e){i.reject(r._formatError(e))}),o}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=l,t.exports=r.default},{moment:105,q:109}],206:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e),this._limit=void 0}return o(t,e),a(t,[{key:"findById",value:function(e){return this._id=e,this._baseUrl="operation/jobs",this._entity="job",this._error_not_found="Operation not found",this._execute()}},{key:"findPeriodicityById",value:function(e){this._id=e;var t=this,r=f.default.defer(),n=r.promise;return t.findById(e).then(function(e){var n=e.data;n&&0!=Object.keys(n).length?(t._id=e.data.taskId,t._baseUrl="operation/tasks",t._entity="task",t._error_not_found="Operation is not periodic!",t._execute().then(function(e){e.data.id=t._id,r.resolve(e)}).catch(function(e){r.reject(e)})):r.reject({errors:t._error_not_found})}).catch(function(e){r.reject(e)}),n}},{key:"findPeriodicityByPeriodicityId",value:function(e){var t=this,r=f.default.defer(),n=r.promise;return t._id=e,t._baseUrl="operation/tasks",t._entity="task",t._execute().then(function(e){e.data.id=t._id,r.resolve(e)}).catch(function(e){r.reject(e)}),n}},{key:"findExecutionsById",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?10:arguments[1],r=arguments.length<=2||void 0===arguments[2]?1:arguments[2];if(this._id=e,this._baseUrl="operation/jobs",this._entity="operations",this._error_not_found="Executions not found","number"!=typeof t)throw new Error("size parameter must be a number");return("number"!=typeof r||r<1)&&(r=1),this._limit={size:t,start:r},this._execute()}},{key:"_composeUrl",value:function(){if("operations"===this._entity){this._limit&&this._setUrlParameters({start:this._limit.start,size:this._limit.size});return this._baseUrl+"/"+this._id+"/operations"}return this._baseUrl+"/"+this._id}}]),t}(c.default);r.default=d,t.exports=r.default},{"../GenericFinder":136,q:109}],207:[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 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}}(),a=e("./catalog/BaseOperationBuilder"),u=n(a),s=e("./catalog/period/PeriodicityUpdateBuilder"),c=n(s),l=e("q"),f=n(l),d=e("merge"),h=n(d),p=function(){function e(t){i(this,e),this._ogapi=t,this._operations=[],this._operationNames=[]}return o(e,[{key:"updatePeriodicityBuilder",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"operationId"});var t=f.default.defer(),r=t.promise,n=this;return this._ogapi.newOperationFinder().findPeriodicityById(e).then(function(e){t.resolve(n._createPeriodicBuilder(e.data))}).catch(function(e){t.reject(e)}),r}},{key:"builderByOperationName",value:function(e){if("string"!=typeof e)throw new Error({message:"OGAPI_STRING_PARAMETER",parameter:"name"});var t=f.default.defer(),r=t.promise,n=e.toUpperCase(),i=this._findOperation(n),o=this;return void 0===i?this._loadOperationCatalog().then(function(){var e=o._findOperation(n);void 0===e?t.reject("Operation <'"+n+"'> unavailable."):t.resolve(o._createBuilder(e.config))}):t.resolve(this._createBuilder(i.config)),r}},{key:"getOperationList",value:function(){return(0,h.default)(!0,this._operationNames)}},{key:"_createBuilder",value:function(e){return new u.default(this._ogapi,e)}},{key:"_createPeriodicBuilder",value:function(e){return new c.default(this._ogapi,e.id,e)}},{key:"_loadOperationCatalog",value:function(){var e=this,t=f.default.defer(),r=t.promise;return this._ogapi.operationTypesSearchBuilder().build().execute().then(function(r){if(200===r.statusCode){var n=r.data;for(var i in n){var o=n[i].name.toUpperCase();e._operationNames.push(o),e._operations.push({name:o,config:n[i]})}}t.resolve(e)}).catch(function(r){t.resolve(e)}),r}},{key:"_findOperation",value:function(e){
28
28
  return this._operations.find(function(e){return e.name==this},e)}}]),e}();r.default=p,t.exports=r.default},{"./catalog/BaseOperationBuilder":210,"./catalog/period/PeriodicityUpdateBuilder":218,merge:104,q:109}],208:[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}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),"string"!=typeof r)throw new Error("Parameter taskId must be a string");this._ogapi=t,this._resource="operation/tasks/",this._taskId=r,this._key="task"}return i(e,[{key:"activate",value:function(){var e={active:!0};return this._periodicityActions("ACTIVE",e)}},{key:"pause",value:function(){var e={active:!1};return this._periodicityActions("PAUSE",e)}},{key:"cancel",value:function(){return this._periodicityActions("CANCEL")}},{key:"_cancel",value:function(){var e=this,t=a.default.defer(),r=t.promise;return this._ogapi.Napi.delete(this._resource).then(function(r){200===r.statusCode?t.resolve({statusCode:r.statusCode,data:{id:e._id}}):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(r){t.reject(e._formatError(r))}),r}},{key:"_periodicityActions",value:function(e,t){var r=this,n=a.default.defer(),i=n.promise;return r._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(r._taskId).then(function(i){var o=i.data;if(o&&0!=Object.keys(o).length){var a=o.id;switch(r._resource=r._resource+a,e){case"PAUSE":case"ACTIVE":r._update(t).then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;case"CANCEL":r._id=a,r._cancel().then(function(e){n.resolve(e)}).catch(function(e){n.reject(e)});break;default:n.reject({errors:"Not implemented action: "+e})}}else n.reject("Periodicity with id "+r._taskId+" not exists")}).catch(function(e){n.reject(e)}),i}},{key:"_readAndUpdate",value:function(e,t){var r=a.default.defer(),n=r.promise,i=this;return i._ogapi.newOperationFinder().findPeriodicityByPeriodicityId(i._taskId).then(function(n){var o=n.data;o?function(){var n=!!o.task&&"ACTIVE"===o.task.state;n?i.pause().then(function(o){i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}).catch(function(e){r.reject(i._formatError(e))}):i._update(e,t||n).then(function(e){r.resolve(e)}).catch(function(e){r.reject(i._formatError(e))})}():r.reject("Periodicity with id "+i._taskId+" not exists")}).catch(function(e){r.reject(i._formatError(e))}),n}},{key:"_update",value:function(e,t){var r=this,n=this,i=a.default.defer(),o=i.promise,u={};return u[n._key]=e,this._ogapi.Napi.put(this._resource,u).then(function(e){t?n.active().then(function(e){i.resolve(e)}).catch(function(e){i.reject(this._formatError(e))}):200===e.status?i.resolve(e):i.reject({errors:e.errors,statusCode:e.status})}).catch(function(e){i.reject(r._formatError(e))}),o}},{key:"_formatError",value:function(e){return e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),e}}]),e}();r.default=u,t.exports=r.default},{q:109}],209:[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}}(),o=function(){function e(t,r){n(this,e),this._ogapi=t,this._parent=r}return i(e,[{key:"filter",value:function(e,t){if(void 0===this._parent._config.applicableTo.find(function(e){return e==this},t))throw new Error("Entity type <'"+t+"'> not allowed to operation <'"+this._parent._config.name+"'>. Entity types allowed <'"+JSON.stringify(this._parent._config.applicableTo)+"'>");return this._parent._entityTypeWhenFilter=t,void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Filter will remove the last way appended ."),void 0!==e._filterTemplate?this._parent._build.target={filter:e._filterTemplate.filter}:this._parent._build.target={filter:e},this._parent}},{key:"list",value:function(e){var t=this;if(void 0===e||e.constructor!==Array)throw new Error("Parameter entities must be typeof Array");return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now List of entities will remove the last way appended ."),this._parent._build.target={append:{}},e.forEach(function(e){if(e.constructor===String)t._parent._build.target.append.entities||(t._parent._build.target.append.entities=[]),t._parent._build.target.append.entities.push(e);else{if(!e.id||!e.parameters)throw new Error("Entity parameters must include id and parameters: "+JSON.stringify(e));t._parent._build.target.append.entitiesWithParameters||(t._parent._build.target.append.entitiesWithParameters=[]),t._parent._build.target.append.entitiesWithParameters.push(e)}}),this._parent}},{key:"tag",value:function(e){return void 0!==this._parent._build.target&&console.warn("An Operation only allow one kind of way to append entities. Filter | Tag | List of entities. Now Tag will remove the last way appended ."),this._parent._build.target={append:{tags:[e]}},this._parent}}]),e}();r.default=o,t.exports=r.default},{}],210:[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 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}}(),a=e("merge"),u=n(a),s=e("./Operation"),c=n(s),l=e("./parameters/ParameterBuilderFactory"),f=(n(l),e("./AppendEntitiesBy")),d=n(f),h=e("./period/ExecuteEachBuilder"),p=n(h),m=e("./period/ExecuteEveryBuilder"),y=n(m),v=e("moment"),g=n(v),_=e("./../../util/DATE_FORMAT"),b=e("ajv"),E=n(b),w={gte:function(e){if(e<this)throw new Error("Value expected must be greater than <"+this+">. Value setted <"+e+">")},list:function(e){if(void 0===this.find(function(e){return e==this},e))throw new Error("Value must be one of these: "+JSON.stringify(this))},editable:function(e){return!0}},A=function(){function e(t,r){i(this,e),this._ajv=new E.default({useDefaults:"empty",coerceTypes:!0}),this.appendEntitiesBy=new d.default(t,this),this._config=r,this._ogapi=t,this._resourcesAvailables={job:"/jobs",task:"/tasks"},this._entityTypeWhenFilter=void 0,this._build={operationParameters:{ackTimeout:0,timeout:9e4,retries:0,retriesDelay:0,retryResultList:[]},name:r.name,schedule:{}},void 0!==r.parameters&&(this._build.parameters={})}return o(e,[{key:"withNotes",value:function(e){if(null===e)return delete this._build.userNotes,this;if("string"!=typeof e)throw new Error("Parameter notes must be a string");return this._build.userNotes=e,this}},{key:"withCallback",value:function(e){if(null===e)return delete this._build.callback,delete this._build.notify,this;if("string"!=typeof e)throw new Error("Parameter url must be a string");return this._build.callback=e,this._build.notify=!0,this}},{key:"withScatteringMaxSpread",value:function(e){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.maxSpread,this;if("number"!=typeof e)throw new Error("Parameter percentage must be a number");if(e<0||e>100)throw new Error("The value of percentage parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.maxSpread=e,this}},{key:"withScatteringStrategy",value:function(e,t){if(null===e&&void 0!==this._build.schedule.scattering)return delete this._build.schedule.scattering.strategy,this;if("number"!=typeof e)throw new Error("Parameter factor must be a number");if(e<0||e>100)throw new Error("The value of factor parameter must be between 0-100");return void 0===this._build.schedule.scattering&&(this._build.schedule.scattering={}),this._build.schedule.scattering.strategy={field:"subscription.collected.cellInfo",factor:e},"number"==typeof t&&(this._build.schedule.scattering.strategy.warningMaxRate=t),this}},{key:"executeImmediately",value:function(){return this._build.active=!0,void 0!==this._build.schedule&&delete this._build.schedule.start,delete this._build.task,this}},{key:"executeIDLE",value:function(){throw new Error("Not implemented yet")}},{key:"executeLater",value:function(e){var t=arguments.length<=1||void 0===arguments[1]||arguments[1];if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._build.active=t,void 0===this._build.schedule&&(this._build.schedule={}),this._build.schedule.start={delayed:g.default.duration(e,"minutes").asMilliseconds()},delete this._build.task,this}},{key:"executeEvery",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var o=Array.prototype.slice.call(arguments),a=this._getName(o.slice(1,3)),u=this._getEnd(o.slice(1,3));return this._build.active=n,new y.default(this,e,a,u,i)}},{key:"executeEach",value:function(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===e||e.constructor!==Date)throw new Error("Parameter date must be typeof Date");var o=Array.prototype.slice.call(arguments),a=this._getName(o.slice(1,3)),u=this._getEnd(o.slice(1,3));return this._build.active=n,new p.default(this,e,a,u,i)}},{key:"_getName",value:function(e){for(var t=0;t<e.length;t++)if("string"==typeof e[t])return e[t];return this._build.name+" "+this._ogapi.Napi._options.apiKey}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t]&&e[t].constructor===Date)return e[t]}},{key:"withJobTimeout",value:function(e){if(null===e)return delete this._build.schedule.stop,this;if("number"!=typeof e)throw new Error("Parameter minutes must be a number");return this._build.schedule.stop={delayed:g.default.duration(e,"minutes").asMilliseconds()},this}},{key:"withAckTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(g.default.duration(e,t).asMilliseconds(),"ackTimeout"),this}},{key:"withTimeout",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(g.default.duration(e,t).asMilliseconds(),"timeout"),this}},{key:"withRetriesDelay",value:function(e){var t=arguments.length<=1||void 0===arguments[1]?"milliseconds":arguments[1];return this._addSpecificParameter(g.default.duration(e,t).asMilliseconds(),"retriesDelay"),this}},{key:"withOperationRetries",value:function(e){return this._addSpecificParameter(e,"retryResultList"),this}},{key:"withRetries",value:function(e){return this._addSpecificParameter(e,"retries"),this}},{key:"withParameters",value:function(e){if(this._config.parameters)return this._build.parameters=e,this._checkMandatoryParameters(),this;throw new Error("This operation does not support parameters")}},{key:"withParameter",value:function(e,t){if(this._config.parameters)return this._build.parameters||(this._build.parameters={}),this._build.parameters[e]=t,this;throw new Error("This operation does not support parameters")}},{key:"build",value:function(){var e=void 0,t=(0,u.default)(!0,this._build),r=void 0,n=[];try{this._checkMandatoryParameters()}catch(e){n.push(e.message)}if(void 0===this._build.task&&void 0===this._build.schedule.start&&void 0===this._build.active&&(console.info("Not specified the way to execute [executeImmediately, executeIDLE, executeLater]. By default executeImmediately will be the way"),this.executeImmediately()),void 0===this._build.target&&this._build.active&&n.push("Must be entities appended if you want execute immediately. You must invoke appendEntitiesBy.list or appendEntitiesBy.tags or appendEntitiesBy.filter"),void 0!==this._build.target&&void 0!==this._build.target.filter&&"string"!=typeof this._entityTypeWhenFilter&&n.push("Must be selected the entity type allowed when filter is the way to append entities. Allowed entity types <'"+JSON.stringify(this._config.applicableTo)+"'>"),void 0!==this._build.task){var i=this._build.task,o=this._build.schedule.stop;if(void 0!==i.repeating.period){var a=void 0;switch(i.repeating.period.unit){case"DAYS":a=g.default.duration(i.repeating.period.each,"days").asMilliseconds();break;case"HOURS":a=g.default.duration(i.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":a=g.default.duration(i.repeating.period.each,"minutes").asMilliseconds()}void 0!==o&&"number"==typeof o.delayed?o.delayed>=a&&n.push("You can not execute an operation with a job timeout greater than the repetition period."):(o=g.default.duration(a,"milliseconds").asMinutes()-1,console.info("Not specified the job timeout. By default, timeout will be "+o+" minutes"),this.withJobTimeout(o))}}if(n.length>0)throw this._build=t,n;void 0===this._build.schedule.stop&&(console.info("Not specified the job timeout. By default, timeout will be 30 days"),this.withJobTimeout(43200)),void 0!==this._build.task?(e=this._resourcesAvailables.task,r=this._convertToTask(this._build)):(e=this._resourcesAvailables.job,r=this._convertToJob(this._build)),void 0!==this._build.target&&void 0!==this._build.target.filter&&(e=e+"?entityType="+this._entityTypeWhenFilter);var s=new c.default(this._ogapi,e,r);return this._build=t,s}},{key:"_convertToTask",value:function(e){var t=e.task;this.executeImmediately();var r=this._convertToJob(this._build),n=(0,g.default)(new Date),i=(0,g.default)(t.start),o={task:{active:!0,name:t.name,description:t.description,job:r.job,schedule:{start:{date:i.format(_.DATE_FORMAT)},repeating:t.repeating}}};if(void 0!==t.stop&&(void 0!==t.stop.date?o.task.schedule.stop={date:(0,g.default)(t.stop.date).format(_.DATE_FORMAT)}:o.task.schedule.stop=t.stop),g.default.max(n,i)==n){if(void 0!==t.stop&&void 0!==t.stop.date){var a=(0,g.default)(t.stop.date);if(g.default.max(n,a)==n)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete o.task.schedule.start}return o}},{key:"_convertToJob",value:function(e){return 0===e.operationParameters.ackTimeout&&delete e.operationParameters.ackTimeout,{job:{request:e}}}},{key:"_addSpecificParameter",value:function(e,t){this._build.operationParameters[t]=e}},{key:"_checkParam",value:function(e,t){if("number"===t.type&&"number"!=typeof e)throw new Error(t.name+": Expected number but found "+typeof e);for(var r in t.attributes)"function"==typeof w[r]&&w[r].call(t.attributes[r],e)}},{key:"_checkMandatoryParameters",value:function(){if(this._config.parameters&&this._config.parameters.schema){var e=this._ajv.compile(this._config.parameters.schema);if(!e(this._build.parameters))throw new Error(e.errors)}}}]),e}();r.default=A,t.exports=r.default},{"./../../util/DATE_FORMAT":323,"./AppendEntitiesBy":209,"./Operation":211,"./parameters/ParameterBuilderFactory":213,"./period/ExecuteEachBuilder":215,"./period/ExecuteEveryBuilder":216,ajv:2,merge:104,moment:105}],211:[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}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){n(this,e),this._ogapi=t,this._resource="operation"+r,this._postObj=i}return i(e,[{key:"updatePeriodicity",value:function(){var e=this,t=a.default.defer(),r=this._resource.substring(this._resource.lastIndexOf("/")+1);return this._ogapi.Napi.put(this._resource,this._postObj).then(function(n){var i=void 0;try{i=JSON.parse(n.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:i||{},statusCode:n.statusCode,id:r})}).catch(function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)}),t.promise}},{key:"execute",value:function(){var e=this,t=a.default.defer();return this._ogapi.Napi.post(this._resource,this._postObj).then(function(r){var n=void 0;try{n=JSON.parse(r.text)}catch(t){console.warn("Error parsing response data when execute post action to "+e._resource)}t.resolve({data:n||{},statusCode:r.statusCode,location:r.header.location})}).catch(function(e){e.data||(e.data={}),e.data.errors||(e.data.errors=["string"==typeof e?{message:e}:e]),t.reject(e)}),t.promise}}]),e}();r.default=u,t.exports=r.default},{q:109}],212:[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 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}}(),a=e("moment"),u=(function(e){e&&e.__esModule}(a),function(){function e(t,r,n){i(this,e),this._parent=n,this._build="array"===r.type?[]:void 0,this._config=r,this[function(e){return function(e){var t=void 0;switch(e.type){case"array":t="add";break;default:t="with"}return t}(e)+e.name[0].toUpperCase()+e.name.slice(1)}(r)]=this._appendParameterValue}return o(e,[{key:"_appendParameterValue",value:function(e){return this._isTypeValueAllow(e)?this._isAllowValue(e)?("array"===this._config.type?this._build.push(e):this._build=e,this):(console.warn("Parameter <'"+this._config.name+"'> not allow value setted <'"+e+"'>. Only are allowed this configuration:"+JSON.stringify(this._config.attributes)),this):(console.warn("Parameter <'"+this._config.name+"'> not allow type of value setted <'"+typeof e+"'>. Only are allowed this type: "+this._getType()),this)}},{key:"_isString",value:function(){return"string"===this._config.type||"string"===this._config.subtype}},{key:"_isObject",value:function(){return"object"===this._config.type||"object"===this._config.subtype}},{key:"_isNumber",value:function(){return"number"===this._config.type||"number"===this._config.subtype}},{key:"_isArray",value:function(){return"array"===this._config.type||"array"===this._config.subtype}},{key:"_isBoolean",value:function(){return"boolean"===this._config.type||"boolean"===this._config.subtype}},{key:"_isDate",value:function(){return"date"===this._config.type||"date"===this._config.subtype}},{key:"_isTime",value:function(){return"time"===this._config.type||"time"===this._config.subtype}},{key:"_getType",value:function(){return this._isArray()?"array":this._isString()||this._isDate()||this._isTime()?"string":this._isObject()?"object":this._isNumber()?"number":this._isBoolean()?"boolean":"unknown"}},{key:"_isTypeValueAllow",value:function(e){var t=!0,r=typeof e;return(this._isString()||this._isTime()||this._isDate())&&"string"!==r&&(t=!1),this._isNumber()&&"number"!==r&&(t=!1),this._isObject()&&"object"!==r&&(t=!1),this._isBoolean()&&"boolean"!==r&&(t=!1),t}},{key:"_isAllowValue",value:function(e){if(void 0!==this._config.attributes){var t=this._config.attributes;if(void 0!==t.list)return void 0!==t.list.find(function(e){return e==this},e)}return!0}},{key:"build",value:function(){if(this._config.required&&(void 0===this._build||0===this._build.length))throw new Error("Parameter <'"+this._config.name+"'> is required and their value is not defined");var e={name:this._config.name,value:n({},this._getType(),this._build)};return void 0!==this._build&&0!==this._build.length||(e=void 0),e}},{key:"buildAndAppend",value:function(){var e=this.build();if(void 0!==e){var t=this._parent._build.parameters.findIndex(function(e){return e.name==this.name},e);-1===t?this._parent._build.parameters.push(e):this._parent._build.parameters[t]=e}return this._parent}}]),e}());r.default=u,t.exports=r.default},{moment:105}],213:[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=e("./BaseParameterBuilderWithParent"),o=(function(e){e&&e.__esModule}(i),function e(t,r,i){n(this,e)});r.default=o,t.exports=r.default},{"./BaseParameterBuilderWithParent":212}],214:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["MON","TUE","WED","THU","FRI","SAT","SUN"];r.DAYS_ENUM=n},{}],215:[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 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}}(),a=e("merge"),u=n(a),s=e("moment"),c=n(s),l=function(){function e(t,r,n,o,a){if(i(this,e),this._parent=t,this._skeleton={start:r,stop:o,name:n,description:a,repeating:{period:{each:void 0,unit:void 0}}},void 0!==o){var u=void 0;if("number"==typeof o){if(o<=0)throw new Error("Invalid stop value. Number of repetitions must be greater than 0.");u={executions:o}}else if(o.constructor===Date){var s=(0,c.default)(r),l=(0,c.default)(o);if(c.default.max(s,l)==s)throw new Error("Invalid stop date on executeEach method. Start date must be earlier than stop date.");u={date:o}}this._skeleton.stop=u}}return o(e,[{key:"minutes",value:function(e){if("number"!=typeof e)throw new Error("Parameter minutes must be typeof number");return this._addPeriod(e,"MINUTES")}},{key:"hours",value:function(e){if("number"!=typeof e)throw new Error("Parameter hours must be typeof number");return this._addPeriod(e,"HOURS")}},{key:"days",value:function(e){if("number"!=typeof e)throw new Error("Parameter days must be typeof number");return this._addPeriod(e,"DAYS")}},{key:"_addPeriod",value:function(e,t){var r=(0,u.default)(!0,this._skeleton);return r.repeating.period.each=e,r.repeating.period.unit=t,this._parent._build.task=r,this._parent}}]),e}();r.default=l,t.exports=r.default},{merge:104,moment:105}],216:[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 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}}(),a=e("./MONTHS_ENUM"),u=e("./pattern/ByWeek"),s=n(u),c=e("./pattern/ByYear"),l=n(c),f=e("./pattern/ByMonth"),d=n(f),h=e("./pattern/ByGeneric"),p=n(h),m=function(){function e(t,r,n,o,a){i(this,e),this.year=new l.default(t,r,n,o,a),this.week=new s.default(t,r,n,o,a),this._day=new p.default(t,r,n,o,a),this._date=r,this._end=o,this._parent=t,this._periodicityName=n,this._description=a}return o(e,[{key:"day",value:function(){return this._day._build()}},{key:"month",value:function(e){var t=this._parent._task;if(void 0===e||e.constructor!==Array){var r=!0;if(t){var n=t.schedule.repeating.pattern;if(n){var i=n.monthly;i&&(r=!1,e=i.months)}}if(r)throw new Error("Parameter months must be typeof Array")}if(0===e.length)throw new Error("Parameter months must have at least one month");for(var o=[],u=0;u<e.length;u++){var s=a.MONTHS_ENUM.find(function(e){return e==this},e[u]);void 0===s&&o.push(s)}if(0!==o.length)throw new Error("Any month into parameter months is not allowed. Parameter value <'"+JSON.stringify(o)+"'>, Months allowed <'"+JSON.stringify(a.MONTHS_ENUM)+"'>");return new d.default(this._parent,this._date,this._periodicityName,e,this._end,this._description)}}]),e}();r.default=m,t.exports=r.default},{"./MONTHS_ENUM":217,"./pattern/ByGeneric":219,"./pattern/ByMonth":220,"./pattern/ByWeek":221,"./pattern/ByYear":222}],217:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["JAN","FEB","MAR","APR","MAY","JUN","JUL","AUG","SEP","OCT","NOV","DEC"];r.MONTHS_ENUM=n},{}],218:[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 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}}(),a=e("merge"),u=n(a),s=e("moment"),c=n(s),l=e("../Operation"),f=n(l),d=e("./ExecuteEveryBuilder"),h=n(d),p=e("./ExecuteEachBuilder"),m=n(p),y=e("./pattern/ByGeneric"),v=n(y),g=e("./../../../util/DATE_FORMAT"),_=function(){function e(t,r,n){i(this,e),this._ogapi=t,this._task=n,this.task_id=r,this._resource="/tasks/"+this.task_id,this._build=(0,u.default)(!0,this._task.job.request)}return o(e,[{key:"executeEvery",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3));return e=this._getStart(e),this._byGeneric=new v.default(this,e,null,t)._build(),new h.default(this,e,null,n)}},{key:"executeEach",value:function(e,t){var r=Array.prototype.slice.call(arguments),n=this._getEnd(r.slice(1,3)),i=this._task.schedule;if(e=this._getStart(e),i&&i.repeating&&i.repeating.period){var o=i.repeating.period;return new m.default(this,e,null,n)._addPeriod(o.each,o.unit)}return new m.default(this,e,null,n)}},{key:"_getStart",value:function(e){var t=this._task.schedule;return!e&&t.start&&t.start.date&&(e=new Date(t.start.date)),e}},{key:"_getEnd",value:function(e){for(var t=0;t<e.length;t++)if("number"==typeof e[t]||e[t].constructor===Date)return e[t];var r=this._task.schedule;if(r.stop&&r.stop.date)return new Date(r.stop.date)}},{key:"build",value:function(){var e=(0,u.default)(!0,this._build),t=void 0,r=[];if(void 0!==this._build.task){var n=this._build.task,i=this._build.schedule.stop;if(void 0!==n.repeating.period){var o=void 0;switch(n.repeating.period.unit){case"DAYS":o=c.default.duration(n.repeating.period.each,"days").asMilliseconds();break;case"HOURS":o=c.default.duration(n.repeating.period.each,"hours").asMilliseconds();break;case"MINUTES":o=c.default.duration(n.repeating.period.each,"minutes").asMilliseconds()}void 0!==i&&"number"==typeof i.delayed&&i.delayed>=o&&r.push("You can not execute an operation with a job timeout greater than the repetition period.")}}if(r.length>0)throw this._build=e,r;void 0!==this._build.task&&(t=this._updateTask(this._build));var a=new f.default(this._ogapi,this._resource,t);return this._build=e,a}},{key:"_updateTask",value:function(e){var t=e.task,r=(0,c.default)(new Date),n=(0,c.default)(t.start),i={task:{schedule:{}}};try{t.start&&(i.task.schedule.start={date:n.format(g.DATE_FORMAT)}),t.stop&&(i.task.schedule.stop={date:(0,c.default)(t.stop).format(g.DATE_FORMAT)}),t.repeating&&(i.task.schedule.repeating=t.repeating)}catch(e){}if(delete i.task.schedule.name,void 0!==t.stop&&(void 0!==t.stop.date?i.task.schedule.stop={date:(0,c.default)(t.stop.date).format(g.DATE_FORMAT)}:i.task.schedule.stop=t.stop),c.default.max(r,n)==r){if(void 0!==t.stop&&void 0!==t.stop.date){var o=(0,c.default)(t.stop.date);if(c.default.max(r,o)==r)throw new Error("Can not create operation object because stop operation period is earlier than current date. It happened because you passed a lot of time between configuration of an operation and create the operation.")}delete i.task.schedule.start}return i}}]),e}();r.default=_,t.exports=r.default},{"../Operation":211,"./../../../util/DATE_FORMAT":323,"./ExecuteEachBuilder":215,"./ExecuteEveryBuilder":216,"./pattern/ByGeneric":219,merge:104,moment:105}],219:[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 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}}(),a=e("moment"),u=n(a),s=e("merge"),c=n(s),l=e("./../../../../util/DATE_FORMAT"),f=function(){function e(t,r,n,o,a){if(i(this,e),this._parent=t,this._skeleton={start:r,stop:o,name:n,description:a,repeating:{pattern:{time:(0,u.default)(r).format(l.TIME_FORMAT)}}},void 0!==o){var s=void 0;if("number"==typeof o)s={executions:o};else if(o.constructor===Date){var c=(0,u.default)(r),f=(0,u.default)(o);if(u.default.max(c,f)==c)throw new Error("Invalid stop date on executeEvery method. Start date must be earlier than stop date.");s={date:o}}this._skeleton.stop=s}}return o(e,[{key:"_create",value:function(){return(0,c.default)(!0,this._skeleton)}},{key:"_build",value:function(){return this._parent._build.task=this._create(),this._parent}}]),e}();r.default=f,t.exports=r.default},{"./../../../../util/DATE_FORMAT":323,merge:104,moment:105}],220:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,u,s),this._months=o;var c=e._task;if(c){var l=c.schedule.repeating.pattern;if(l){var f=l.monthly;f&&(this._day=f.day,a(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return i(t,e),o(t,[{key:"day",value:function(e){if("number"!=typeof e)throw new Error("Parameter day must be typeof number");if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,this._build()}},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.monthly={day:this._day,months:this._months},e}}]),t}(s.default)
29
- ;r.default=c,t.exports=r.default},{"./ByGeneric":219}],221:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=e("./../DAYS_ENUM"),l=function(e){function t(e,r,i,o,u){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u)}return i(t,e),o(t,[{key:"days",value:function(e){if(void 0===e||e.constructor!==Array)throw new Error("Parameter days must be typeof Array");if(0===e.length)throw new Error("Parameter days must have at least one day");for(var t=[],r=0;r<e.length;r++){var n=c.DAYS_ENUM.find(function(e){return e==this},e[r]);void 0===n&&t.push(n)}if(0!==t.length)throw new Error("Any day into parameter days is not allowed. Parameter value <'"+JSON.stringify(e)+"'>, Months allowed <'"+JSON.stringify(c.DAYS_ENUM)+"'>");return this._days=e,this._build()}},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.weekly={days:this._days},e}}]),t}(s.default);r.default=l,t.exports=r.default},{"./../DAYS_ENUM":214,"./ByGeneric":219}],222:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=e("./../MONTHS_ENUM"),l=function(e){function t(e,r,i,o,u){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u);var s=e._task;if(s){var c=s.schedule.repeating.pattern;if(c){var l=c.yearly;l&&(this._day=l.day,this._month=l.month,a(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return i(t,e),o(t,[{key:"day",value:function(e){if("number"!=typeof e){if(!this._day)throw new Error("Parameter day must be typeof number");month=this._day}if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,void 0===this._month?this:this._parent._task?(this._build(),this):this._build()}},{key:"month",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){if("string"!=typeof e){if(!this._month)throw new Error("OGAPI_PARAMETER_MONTH_MUST_BE_STRING");e=this._month}if(void 0===c.MONTHS_ENUM.find(function(e){return e==this},e))throw new Error("Any month into parameter months is not allowed. Parameter value <'"+e+"'>, Months allowed <'"+JSON.stringify(c.MONTHS_ENUM)+"'>");return this._month=e,void 0===this._day?this:this._parent._task?(this._build(),this):this._build()})},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.yearly={day:this._day,month:this._month},e}}]),t}(s.default);r.default=l,t.exports=r.default},{"./../MONTHS_ENUM":217,"./ByGeneric":219}],223:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","organization","Organization not found")}return o(t,e),a(t,[{key:"findByName",value:function(e){return this._id=e,this._execute()}},{key:"findByDomainAndWorkgroup",value:function(e,t){this._domain=e,this._workgroup=t;var r=f.default.defer(),n=r.promise,i=this._error_not_found;return this._executeWorkgroupRelation().then(function(e){if(204===e.statusCode)r.reject({data:i,statusCode:h.default.NOT_FOUND});else{var t=e.data,n={},o=[];for(var a in t.channels)n[t.channels[a].organization]||(n[t.channels[a].organization]=t.channels[a].organization,o.push({name:t.channels[a].organization}));o.length>0?r.resolve({data:o,statusCode:e.statusCode}):r.reject({data:i,statusCode:h.default.NOT_FOUND})}}).catch(function(e){r.reject(e)}),n}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=f.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){204===e.statusCode?t.reject({data:n,statusCode:h.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}}]),t}(c.default);r.default=p,t.exports=r.default},{"../ProvisionGenericFinder":138,"http-status-codes":68,q:109}],224:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../provision/BaseProvision"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"+(void 0===r?"":r)),this._name=void 0,this._description=void 0,this._countryCode=void 0,this._langCode=void 0,this._timeZone=void 0,this._zoom=void 0,this._location=void 0}return i(t,e),o(t,[{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._domain=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._countryCode=e.toUpperCase(),this}},{key:"withLangCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._langCode=e.toLowerCase(),this}},{key:"withTimeZone",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._timeZone=e,this}},{key:"withPlan",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._plan=e,this}},{key:"withOnlyAssignedDomainCertificates",value:function(e){if("boolean"!=typeof e||!0!==e&&!1!==e)throw new Error("Parameter OnlyAssignedDomainCertificates must be a boolean and cannot be empty");return this._onlyDomainCerts=e,this}},{key:"withZoom",value:function(e){if("number"!=typeof(e*=1)||e<0||e>19)throw new Error("Parameter zoom must be a number between 0 and 19");return this._zoom=e,this}},{key:"withLocation",value:function(e,t){if(e*=1,t*=1,"number"!=typeof e||"number"!=typeof t)throw new Error("Latitude and longitude parameters must be numbers");if(e<-90||e>90)throw new Error("Parameter latitude value must be between -90 and 90");if(t<-180||t>180)throw new Error("Parameter longitude value must be between -180 and 180");return this._location={latitude:e,longitude:t},this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._langCode||void 0===this._countryCode)throw new Error("Parameters name, country code and lang code must be defined");var e={};void 0!=this._zoom&&(e.zoom=this._zoom),void 0!=this._location&&(e.location=this._location);var t={organization:{name:this._name||void 0,description:this._description||void 0,plan:this._plan||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timeZone||void 0,onlyAssignedDomainCertificates:"boolean"!=typeof this._onlyDomainCerts?this._onlyDomainCerts:void 0}};return this._domain&&(t.organization.domain=this._domain),(e.zoom||e.location)&&(t.organization.mapDefault=e),t}},{key:"_composeUpdateElement",value:function(){if(this._domain)throw new Error("The domain parameter is not allowed in the update");var e=this._composeElement();return delete e.organization.name,e}},{key:"_buildURL",value:function(){if(void 0===this._name)throw new Error("Parameter name must be defined");return this._resource+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":225}],225:[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}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){var o=arguments.length<=3||void 0===arguments[3]?[]:arguments[3];if(n(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._composeElement)throw new Error("Must override method: composeElement");if("function"!=typeof this._buildURL)throw new Error("Must override method: _buildURL");i&&(this._timeout="number"!=typeof i?t.Napi._options.timeout:i),this._ogapi=t,this._resource="provision"+r,this._requiredParameters=o,this._headers=void 0,this._urlParameters=void 0}return i(e,[{key:"_checkRequiredParameters",value:function(){var e=[];if(this._requiredParameters&&this._requiredParameters.length>0){for(var t=0;t<this._requiredParameters.length;t++)void 0===this[this._requiredParameters[t]]&&void 0===this["_"+this._requiredParameters[t]]&&e.push(this._requiredParameters[t]);if(e.length>0)throw new Error("There are required parameters that have not been set. Missing parameters: "+JSON.stringify(e).replace(new RegExp('"',"g"),""))}}},{key:"create",value:function(){var e=this;this._checkRequiredParameters();var t=a.default.defer(),r=t.promise,n=this._composeElement();return this._ogapi.Napi.post(this._resource,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(r){201===r.statusCode?("function"==typeof e._onCreated&&e._onCreated(r.header.location),t.resolve({location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(e){t.reject(e)}),r}},{key:"delete",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).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}},{key:"update",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_doNorthPut",value:function(e,t){var r=a.default.defer(),n=r.promise;return this._ogapi.Napi.put(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){200===e.statusCode?r.resolve({statusCode:e.statusCode}):200===e.status?r.resolve({statusCode:e.status}):r.reject({errors:e.errors,statusCode:e.statusCode})}).catch(function(e){r.reject(e)}),n}},{key:"_doNorthPost",value:function(e,t){var r=this,n=a.default.defer(),i=n.promise;return this._ogapi.Napi.post(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){201===e.statusCode?("function"==typeof r._onCreated&&r._onCreated(e.header.location),n.resolve({location:e.header.location,statusCode:e.statusCode})):200===e.statusCode?n.resolve({statusCode:e.statusCode}):n.reject({errors:e.errors,statusCode:e.statusCode})}).catch(function(e){n.reject(e)}),i}},{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find(function(e){return e==this},e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}}]),e}();r.default=u,t.exports=r.default},{q:109}],226:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../BaseProvision"),c=n(s),l=e("q"),f=n(l),d={xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};r.TYPES=d;var h=function(e){function t(e,r,n,o){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,void 0,o,["organization","processorId"]),this._timeout=o,this._organization=r,this._processorId=n,this._resource="provisionProcessors/provision/organizations/"+r+"/"+n+"/"}return o(t,e),a(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource+this._type}},{key:"plan",value:function(e,t,r){if("string"!=typeof t)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._extension=d[t],this._setUrlParameters({numberOfEntriesToProcess:r||1}),this._type="plan",this._setExtraHeaders({accept:"application/json"}),this._executeOperation(e)}},{key:"bulk",value:function(e,t){if(this._extension=d[t],"string"!=typeof this._extension)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._type="bulk",this._setExtraHeaders({accept:this._extension}),this._executeOperation(e)}},{key:"_executeOperation",value:function(e){var t=void 0;if("string"!=typeof e){t=new FormData;var r=new Blob([e],{type:this._extension});t.append("file",r)}else t={},t.processorBulkFile=e;var n=f.default.defer(),i=this._buildURL();return this._ogapi.Napi.post_multipart(i,t,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){switch(e.statusCode){case 200:var t=""!=e.text?JSON.parse(e.text):{},r=e.status;n.resolve({data:t,statusCode:r});break;case 201:var r=e.status,i=e.location||e.headers.location||e.header.location;n.resolve({location:i,statusCode:r});break;case 204:n.resolve(e);break;default:n.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){n.reject(e)}),n.promise}}]),t}(c.default);r.default=h},{"../BaseProvision":225,q:109}],227:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.asset.identifier";r.AssetID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/entities",i,o,u,s),this._entity.resourceType={_value:{_current:{value:"entity.asset"}}}}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":235}],228:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../BaseProvision"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._timeout=o,this._resource=r,this._extension=n}return o(t,e),a(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource}},{key:"create",value:function(e,t){return this._executeOperation(e,"CREATE",t)}},{key:"delete",value:function(e,t){return this._executeOperation(e,"DELETE",t)}},{key:"deleteAll",value:function(e,t){return this._executeOperation(e,"DELETE&full=true",t)}},{key:"update",value:function(e,t){return this._executeOperation(e,"UPDATE",t)}},{key:"patch",value:function(e,t){return this._executeOperation(e,"PATCH",t)}},{key:"_executeOperation",value:function(e,t,r){var n=void 0;if("string"!=typeof e){if(n={},e){var i=new Blob([e]);n.bulkFile=i}}else n={},e&&(n.bulkFile=e);var o=f.default.defer();n.ext=this._extension;var a=this._buildURL();return r&&this._setExtraHeaders({accept:"text/plain"}),this._setUrlParameters({action:t}),this._ogapi.Napi.post_multipart(a,n,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){var t=e.statusCode;if(200===t||201===t)if(r&&!e.location){var n=e,i=e.statusCode;o.resolve({data:n,statusCode:i})}else o.resolve(e);else 204===t?o.resolve(e):o.reject({errors:e.data.errors,statusCode:e.statusCode})}).catch(function(e){o.reject(e)}),o.promise}}]),t}(c.default);r.default=d,t.exports=r.default},{"../BaseProvision":225,q:109}],229:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u,s)}return i(t,e),o(t,[{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach(function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];n.forEach?n.forEach(function(e){e._index.value&&e._value&&e._value._current&&t.withComplex(r,e._index.value._current.value,e._value._current.value)}):t.with(r,n._value._current.value)}})}},{key:"_initFormJson",value:function(e,t,r){var n=this;if(e){Object.keys(e).forEach(function(i){var o=e[i],a=o._current,u=t?t+"."+i:i;if(a){var s=a.value;r?n.withComplex(u,r,s):n.with(u,s)}else Array.isArray(o)?o.forEach(function(e){n._initFromJson(e,u+"[]",e.identifier._current.value)}):n._initFromJson(o,u,r)})}}},{key:"initFromJson",value:function(e){var t=this,r={};e&&(r=e.provision)&&t._initFromJson(r,"provision")}},{key:"withComplex",value:function(e,t,r){if(!t)return console.warn("Communication module identifier not defined. This value wil be ignored"),this;if(1!==this.getAllowedDatastreams().filter(function(t){return t.identifier===e}).length)return console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this;this._entity[e]||(this._entity[e]=[]);for(var n=!1,i=0;i<this._entity[e].length;i++){var o=this._entity[e][i];o._index&&o._index.value&&o._index.value===t&&(this._entity[e][i]={_index:{value:t},_value:{_current:{value:r}}},n=!0)}return n||this._entity[e].push({_index:{value:t},_value:{_current:{value:r}}}),this}}]),t}(s.default);r.default=c,t.exports=r.default},{"./SimpleBuilder":235}],230:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./BulkBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i,a,u){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(u?"async":i.toLowerCase()),"text/plain",a),u&&this._setUrlParameters({type:i.toUpperCase()})}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./BulkBuilder":228}],231:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}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)}function o(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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.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=e("./ComplexBuilder"),c=n(s),l=e("./SubscriberBuilder"),f=e("./SubscriptionBuilder"),d=e("http-status-codes"),h=n(d),p=e("q"),m=n(p),y=e("jsonpath"),v=n(y),g=function(){function e(t,r,n,i,a,u){o(this,e);var s=this,c={},d={};this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._timeout=u||null,this._deviceKeys=Object.keys(r).filter(function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")}),this._subscriberKeys=Object.keys(r).filter(function(e){return-1!==e.indexOf("subscriber")}),this._subscriptionKeys=Object.keys(r).filter(function(e){return-1!==e.indexOf("subscription")}),this._administrationKeys=Object.keys(r).filter(function(e){return-1!==e.indexOf("provision.administration")}),this._wrappers=[],this._urlParameters=a,this._subscriberKeys.forEach(function(e){s._obj[e].forEach(function(t){c[t._index.value]||(c[t._index.value]={}),c[t._index.value][e]={_value:t._value}})}),this._subscriptionKeys.forEach(function(e){s._obj[e].forEach(function(t){d[t._index.value]||(d[t._index.value]={}),d[t._index.value][e]={_value:t._value}})}),Object.keys(d).forEach(function(e){var t=d[e];s._administrationKeys.forEach(function(e){t[e]=s._obj[e]}),s._wrappers.push(new _(s._ogapi,t,s._url.replace("devices","subscriptions").replace("/"+s._key._value._current.value,""),t[f.SubscriptionID]._value._current.value))}),Object.keys(c).forEach(function(e){var t=c[e];s._administrationKeys.forEach(function(e){t[e]=s._obj[e]}),s._wrappers.push(new _(s._ogapi,t,s._url.replace("devices","subscribers").replace("/"+s._key._value._current.value,""),t[l.SubscriberID]._value._current.value))})}return u(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key._value._current.value}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"create",value:function(){var e=this,t=m.default.defer(),r={},n=this._obj,i=[],o=this;return Object.keys(n).filter(function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")}).forEach(function(e){r[e]=n[e]}),this._wrappers.forEach(function(e){i.push({wrapper:e,promise:e.execute(t,10)})}),m.default.allSettled(i.reduce(function(e,t){return e.push(t.promise),e},[])).then(function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:20}),t.notify({entity:o._key._value._current.value,message:"OGAPI_CREATING_DEVICE",type:"success",percentage:25}),o._ogapi.Napi.post(o._url,r,null,null,{flattened:!0}).then(function(r){if(o._wrappers.length>0)return t.notify({message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:55}),e._setUrlParameters({flattened:!0}),o._ogapi.Napi.put(o._urlWithKey(),n,e._timeout,null,e._getUrlParameters()).then(function(e){e.statusCode===h.default.OK?("function"==typeof o._onCreated&&o._onCreated(e.header.location),t.notify({entity:o._key._value._current.value,message:"OGAPI_DEVICE_CREATED ",type:"success",percentage:75}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})})
30
- ;r.statusCode===h.default.CREATED?("function"==typeof o._onCreated&&o._onCreated(r.header.location),t.notify({entity:o._key._value._current.value,message:"OGAPI_DEVICE_CREATED",type:"success",percentage:75}),t.resolve({location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(e){if(e.statusCode===h.default.BAD_REQUEST){v.default.query(e,"$..message")[0].includes("Entity duplicated"),t.reject({errors:e.data.errors,statusCode:e.statusCode})}else t.reject({errors:e.data,statusCode:e.statusCode})})}).catch(function(e){e.data.errors.forEach(function(e){var r=e.description;e.label&&(r+=":"+e.label),t.notify({message:"Error: "+r,type:"error",percentage:80})});var r=[o.delete(t,90)];i.forEach(function(e){r.push(e.wrapper.delete(t,90))}),m.default.allSettled(r).then(function(){t.reject(e)}).catch(function(){t.reject(e)})}),t.promise}},{key:"update",value:function(){var e=this,t=m.default.defer(),r=this._obj,n=[],i=this;return this._wrappers.forEach(function(e){n.push({wrapper:e,promise:e.execute(t,20)})}),m.default.allSettled(n.reduce(function(e,t){return e.push(t.promise),e},[])).then(function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.put(i._url,r,e._timeout,null,e._getUrlParameters()).then(function(e){e.statusCode===h.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})})}).catch(function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)}),t.promise}},{key:"patch",value:function(){var e=this,t=m.default.defer(),r=this._obj,n=[],i=this;return this._wrappers.forEach(function(e){n.push({wrapper:e,promise:e.execute(t,20)})}),m.default.allSettled(n.reduce(function(e,t){return e.push(t.promise),e},[])).then(function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.patch(i._url,r,e._timeout,null,e._getUrlParameters()).then(function(e){e.statusCode===h.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})})}).catch(function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)}),t.promise}},{key:"delete",value:function(e,t){var r=this;return this._ogapi.Napi.delete(this._urlWithKey()).then(function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})})}}]),e}(),_=function(){function e(t,r,n,i){o(this,e),this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._created=!1}return u(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key}},{key:"_checkExists",value:function(){return this._ogapi.Napi.get(this._urlWithKey()).then(function(e){return e.statusCode===h.default.OK}).catch(function(e){return console.warn(e),!1})}},{key:"execute",value:function(e,t){function r(e,t,r){i._ogapi.Napi.post(i._url,i._obj,null,null,{flattened:!0}).then(function(n){i._created=!0,e.notify({entity:i._key,message:"OGAPI_ENTITY_CREATED",type:"success",percentage:r}),t.resolve({message:"OGAPI_ENTITY_CREATED",entity:i._key})}).catch(function(n){console.error(n),e.notify({entity:i._key,message:"OGAPI_ENTITY_CREATED",type:"warning",percentage:r}),t.reject({entity:i._key,message:"OGAPI_SOMETHING_WRONG_CREATING"})})}var n=m.default.defer(),i=this;return this._checkExists().then(function(o){o?n.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:i._key}):r(e,n,t)}).catch(function(o){o?n.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:i._key}):r(e,n,t)}),n.promise}},{key:"delete",value:function(e,t){var r=this;return this._created?this._ogapi.Napi.delete(this._urlWithKey()).then(function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})}):Q.fcall(function(){})}}]),e}(),b=function(e){function t(e,r,n,i,u,s){o(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/devices",n,i,u,s),this._organization=r}return i(t,e),u(t,[{key:"create",value:function(){return this._checkRequiredParameters(),new g(this._ogapi,this._composeElement(),this._resource,this._getEntityKey(),this._getUrlParameters(),this._timeout).create()}},{key:"update",value:function(){return new g(this._ogapi,this._composeElement(),this._buildURL(),this._getEntityKey(),this._getUrlParameters(),this._timeout).update()}},{key:"_getEntityKey",value:function(){return this._entity["provision.device.identifier"]}}]),t}(c.default);r.default=b,t.exports=r.default},{"./ComplexBuilder":229,"./SubscriberBuilder":236,"./SubscriptionBuilder":237,"http-status-codes":68,jsonpath:95,q:109}],232:[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 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}}(),a=e("q"),u=n(a),s=e("jsonpath"),c=n(s),l=e("ajv"),f=n(l),d=e("./AssetBuilder"),h=n(d),p=e("./DeviceBuilder"),m=n(p),y=e("./TicketBuilder"),v=n(y),g=e("./SubscriberBuilder"),_=n(g),b=e("./SubscriptionBuilder"),E=n(b),w=e("./CsvBulkBuilder"),A=n(w),S=e("./JsonFlattenedBulkBuilder"),O=n(S),P=e("./JsonBulkBuilder"),D=n(P),C=new f.default,k=["entities","tickets"],T=function(){function e(t){i(this,e);this._ogapi=t}return o(e,[{key:"_loadAllowedDatastreams",value:function(e,t,r){var n=this,i=u.default.defer(),o=i.promise,a=n._ogapi.newFilterBuilder();return a.and({like:{"datamodels.categories.datastreams.identifier":"provision"}}).and({eq:{"datamodels.organizationName":t}}).and({eq:{"datamodels.allowedResourceTypes":r}}),this._ogapi.datamodelsSearchBuilder().filter(a).build().execute().then(function(e){return n.schema={},e}).then(function(t){200!==t.statusCode&&i.reject({data:"OGAPI_DATASTREAM_NOT_FOUND",statusCode:204}),n._getJsonPathElements().then(function(){t.data=n._setDevicesProperties(t.data,e),i.resolve(t)}).catch(function(e){i.reject(e)})}).catch(function(e){i.reject(e)}),o}},{key:"_getJsonPathElements",value:function(){var e=u.default.defer(),t=e.promise;return this._ogapi.basicTypesSearchBuilder().withPath("$").build().execute().then(function(t){C.getSchema("/og_basic_types.json")&&C.removeSchema("/og_basic_types.json"),C.addSchema(t.data,"/og_basic_types.json"),e.resolve()}).catch(function(t){e.reject(t)}),t}},{key:"_setDevicesProperties",value:function(e,t){var r=this,n=c.default.query(e,"$.datamodels[*].categories[*].datastreams[?(@.calculated === false)]"),i={allowedDatastreams:[],schemas:{}};return r.complexFunctions=[],r.simpleFunctions=[],n.forEach(function(e,n){var o=e.identifier;if(o.startsWith("provision.administration")||o.startsWith(t))if(i.allowedDatastreams.push(e),o.includes("communicationModules")){var a=t.includes("subscriber")||t.includes("subscription");r.schema[o]={value:e.schema,complex:!a,function:a?"with":"withComplex"}}else r.schema[o]={value:e.schema,complex:!1,function:"with"}}),i.schemas=r.schema,i}},{key:"devicesBuilder",value:function(e,t){return this._genericBuilder(e,"entity.device","provision",function(r,n){return new m.default(this._ogapi,e,r,n,C,t)})}},{key:"assetsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.asset","provision",function(r,n){return new h.default(this._ogapi,e,r,n,C,t)})}},{key:"ticketsBuilder",value:function(e,t){return this._genericBuilder(e,"ticket","provision",function(r,n){return new v.default(this._ogapi,e,r,n,C,t)})}},{key:"subscribersBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscriber","provision.device.communicationModules[].subscriber",function(r,n){return new _.default(this._ogapi,e,r,n,C,t)})}},{key:"subscriptionsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscription","provision",function(r,n){return new E.default(this._ogapi,e,r,n,C,t)})}},{key:"newCsvBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new A.default(this._ogapi,e,t,r,n)}},{key:"newJsonBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new D.default(this._ogapi,e,t,r,n)}},{key:"newJsonFlattenedBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new O.default(this._ogapi,e,t,r,n)}},{key:"_validateBulk",value:function(e,t){if(!e)throw new Error("Parameters organization must be defined");if(!t||-1===k.indexOf(t))throw new Error("The parameters resources must be defined and must be some of these values: entities or tickets")}},{key:"_genericBuilder",value:function(e,t,r,n){var i=this,o=u.default.defer();if(!e)throw new Error("Parameters organization must be defined");return this._loadAllowedDatastreams(r,e,t).then(function(e){200===e.statusCode?o.resolve(n.call(i,e.data.allowedDatastreams,e.data.schemas)):o.reject("OGAPI_DATASTREAM_NOT_FOUND")}).catch(function(e){o.reject(e)}),o.promise}}]),e}();r.default=T,t.exports=r.default},{"./AssetBuilder":227,"./CsvBulkBuilder":230,"./DeviceBuilder":231,"./JsonBulkBuilder":233,"./JsonFlattenedBulkBuilder":234,"./SubscriberBuilder":236,"./SubscriptionBuilder":237,"./TicketBuilder":238,ajv:2,jsonpath:95,q:109}],233:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./BulkBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i,a,u){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(u?"async":i.toLowerCase()),"application/json",a),u&&this._setUrlParameters({type:i.toUpperCase()})}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./BulkBuilder":228}],234:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./BulkBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i,a,u){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(u?"async":i.toLowerCase()),"application/json",a),this._setUrlParameters({flattened:!0}),u&&this._setUrlParameters({flattened:!0,type:i.toUpperCase()})}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./BulkBuilder":228}],235:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("http-status-codes"),c=n(s),l=e("../BaseProvision"),f=n(l),d=e("q"),h=n(d),p=function(e){function t(e,r,n,o,a,s){if(i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/"+r,s),"function"!=typeof this._getEntityKey)throw new Error("Must override method: _getEntityKey");this._setUrlParameters({flattened:!0}),this._entity={},this._allowedDatastreams=n,this._definedSchemas=o,this._jsonSchemaValidator=a}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._resource+"/"+this.getEntityKey()}},{key:"_validate",value:function(){var e=this,t=[];if(Object.keys(this._entity).forEach(function(r){"resourceType"!=r&&function(){if(!e._definedSchemas[r])throw new Error("Datastream is not allowed: "+r);var n=e._definedSchemas[r].value;if(e._entity[r].constructor===Array)e._entity[r].forEach(function(i){var o=i._value._current.value;e._jsonSchemaValidator.validate("/og_basic_types.json",o)||t.push(r+" ["+o+"] value is not allowed. The value should be formatted as follows: "+JSON.stringify(n))});else{var i=e._entity[r]._value._current.value;e._jsonSchemaValidator.validate("/og_basic_types.json",i)||t.push(r+" ["+i+"] value is not allowed. The value should be formatted as follows: "+JSON.stringify(n))}}()}),t.length>0)throw new Error(JSON.stringify(t).replace(new RegExp('"',"g"),""))}},{key:"_composeElement",value:function(){return this._validate(),this._entity}},{key:"getEntityKey",value:function(){return null!==this._getEntityKey()?this._getEntityKey()._value._current.value:null}},{key:"with",value:function(e,t){return void 0===t||0===t.length?(delete this._entity[e],this):1!==this.getAllowedDatastreams().filter(function(t){return t.identifier===e}).length?(console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this):(this._entity[e]={_value:{_current:{value:t}}},this)}},{key:"getAllowedDatastreams",value:function(){return this._allowedDatastreams}},{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach(function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];Array.isArray(n)&&(n=n[0]),t.with(r,n._value._current.value)}})}},{key:"_initFromJson",value:function(e,t){var r=this;if(e){Object.keys(e).forEach(function(n){var i=e[n],o=i._current,a=t?t+"."+n:n;o?r.with(a,o.value):Array.isArray(i)?r._initFromJson(i[0],a+"[]"):r._initFromJson(i,a)})}}},{key:"initFromJson",value:function(e){var t=this,r={};e&&(r=e.provision)&&t._initFromJson(r,"provision")}},{key:"deleteAll",value:function(){var e=h.default.defer(),t=e.promise;return this._setUrlParameters({full:!0}),this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){t.statusCode===c.default.OK?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"update",value:function(){var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"patch",value:function(){var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.patch(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(f.default);r.default=p,t.exports=r.default},{"../BaseProvision":225,"http-status-codes":68,q:109}],236:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.device.communicationModules[].subscriber.identifier";r.SubscriberID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscribers",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":235}],237:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.device.communicationModules[].subscription.identifier";r.SubscriptionID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscriptions",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":235}],238:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.ticket.identifier";r.TicketID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/tickets",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":235}],239:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/",void 0,["name","organization","configurationParams","scriptProcessor"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provisionProcessors/provision/organizations/"+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkString(e,"name"),this._name=e,this}},{key:"withConfigurationParams",value:function(e){return f.default._checkObject(e,"configurationParams"),this._configurationParams=e,this}},{key:"withScriptProcessor",value:function(e){return f.default._checkObject(e,"scriptProcessor"),this._scriptProcessor=e,this}},{key:"_composeElement",value:function(){return this._resource="provisionProcessors/provision/organizations/"+this._organization,{name:this._name,configurationParams:this._configurationParams,scriptProcessor:this._scriptProcessor}}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":225,"../util/formats/check_types":328}],240:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","provisionPrecessors")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndProvisionProcessorId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],241:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./_RuleCondition"),f=(n(l),e("./_RuleNotification")),d=(n(f),e("q")),h=n(d),p=function(e){function t(e,r,n,o,a){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),o&&this.withIdentifier(o),a&&(a.name&&this.withName(a.name),a.mode&&this.withMode(a.mode),a.type&&this.withType(a.type),a.description&&this.withDescription(a.description),null!==a.active&&void 0!==a.active&&this.withActive(a.active),null!==a.condition&&void 0!==a.condition&&this.withCondition(a.condition),a.actionsDelay&&this.withActionsDelay(a.actionsDelay),a.actions&&this.withActions(a.actions),a.parameters&&this.withParameters(a.parameters),a.javascript&&this.withJavascript(a.javascript))}return o(t,e),a(t,[{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withChannel",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter channel must be a string, cannot be empty and has a maximum length of 50");return this._channel=e,this}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter name must be a string and cannot be empty");return this._javascript=e,this}},{key:"withMode",value:function(e){return this._mode=e,this}},{key:"withType",value:function(e){return this._type=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be true or false");return this._active=e,this}},{key:"withActionsDelay",value:function(e){if("number"!=typeof e)throw new Error("Parameter actionsDelay must be a number");return this._actionsDelay=e,this}},{key:"withCondition",value:function(e){return this._condition=e||{},this}},{key:"withActions",value:function(e){return this._actions=e||{},this}},{key:"withParameters",value:function(e){return this._parameters=e||[],this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,active:this._active,mode:this._mode,type:this._type,severity:this._severity,description:this._description?this._description:void 0,parameters:this._parameters,condition:"EASY"===this._mode?this._condition:void 0,actionsDelay:this._actionsDelay,actions:"EASY"===this._mode?this._actions:void 0,javascript:"ADVANCED"===this._mode?this._javascript:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and name must be defined")}},{key:"_buildURL",value:function(){return"rules/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"updateParameters",value:function(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and identifier must be defined");return this._doNorthPut(this._buildURL()+this._identifier+"/parameters",e||this._parameters||[])}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":225,"./_RuleCondition":245,"./_RuleNotification":246,q:109}],
31
- 242:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/catalog","rulesTemplate","Rule templates not found")}return i(t,e),o(t,[{key:"getTemplates",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],243:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/provision/organizations","rules","Rule configurations not found")}return i(t,e),o(t,[{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],244:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return o(t,e),a(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="js/dummyFunctions",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/private/javascriptFunctions",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/javascriptFunctions",this._execute()}},{key:"_execute",value:function(){var e=f.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:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../GenericFinder":136,"http-status-codes":68,q:109}],245:[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}}(),o=e("./RuleConfigurations"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),t.constructor!==a.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._condition=r}return i(e,[{key:"setDelay",value:function(e){if("number"!=typeof e||typeof e<1)throw new Error("Parameter delay must be typeof number and higher than -1");return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=1e3*e,this}},{key:"deactivateDelay",value:function(){return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=-1,this}},{key:"setParameterValue",value:function(e,t){var r=this;if(this._condition.parameters&&this._condition.parameters.length>0){for(var n in this._condition.parameters){var i=this._condition.parameters[n];if(i.name===e){if(void 0===i.value)throw new Error("Value not allowed for parameter "+e+" in condition "+this._condition.name);return i.value=t||"",r}}throw new Error("Parameter "+e+" not exists for condition "+this._condition.name)}}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=u,t.exports=r.default},{"./RuleConfigurations":241}],246:[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}}(),o=e("./RuleConfigurations"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),t.constructor!==a.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._notification=r}return i(e,[{key:"setEnabled",value:function(e){if("boolean"!=typeof e)throw new Error("Bearer enabled must be true or false");return this._notification.enabled=e,this}},{key:"setBearerRecipients",value:function(e,t){var r=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var n in this._notification.bearers){var i=this._notification.bearers[n];if(i.name===e)return i.recipients=t,r}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return r}},{key:"enableBearer",value:function(e){var t=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.enabled=!0,t}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return t}},{key:"disableBearer",value:function(e){var t=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.enabled=!1,t}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return t}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=u,t.exports=r.default},{"./RuleConfigurations":241}],247:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var r=t.body,n=t.statusCode;200===n&&(r.assets=r.entities,delete r.entities),e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":252,q:109}],248:[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 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}}(),a=e("q"),u=n(a),s=e("merge"),c=(n(s),function(){function e(t,r,n){if(i(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._filter)throw new Error("Must override method: filter");this._timeout="number"!=typeof n?t.Napi._options.timeout:n,this._ogapi=t,this._resource=r,this._headers=void 0,this._urlParameters=void 0}return o(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=u.default.defer(),t=e.promise;return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){var r=t.body,n=t.statusCode;e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}},{key:"downloadCsv",value:function(){var e=u.default.defer(),t=e.promise,r=this._filter();return r&&r.limit&&delete r.limit,this._setExtraHeaders({Accept:"text/plain"}),this._ogapi.Napi.post(this._resource,r,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){var r=t,n=t.statusCode;e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}},{key:"_asyncPagingFilter",value:function(){var e=this._filter();return e.limit&&e.limit.size?e.limit.start=1:e.limit={size:1e3,start:1},e}},{key:"cancelAsyncPaging",value:function(e){"string"==typeof e&&e.length>0?this.cancel=e:this.cancel=!0}},{key:"_loadData",value:function(e){function t(){if(r.cancel||"string"==typeof r.cancel){var a="string"==typeof r.cancel?r.cancel:"Cancel process";n.reject({data:a,statusCode:403})}else r._ogapi.Napi.post(r._resource,i,r._timeout,r._getExtraHeaders(),r._getUrlParameters()).then(function(r){var a=r.statusCode,u=r.body;if(!u&&r.text)try{var s=JSON.parse(r.text);s&&(u=s)}catch(e){console.error("Impossible to parse text from response")}if(200===a||200===a){o=!0;var c=u.data?u.data[e]:u[e];n.notify(c),c.length===i.limit.size?(i.limit.start+=1,t()):n.resolve({data:"DONE",statusCode:200})}else o?n.resolve({data:"DONE",statusCode:200}):n.reject({data:u,statusCode:a})}).catch(function(e){n.reject(e)})}var r=this,n=u.default.defer(),i=r._asyncPagingFilter(),o=!1;return t(),n.promise}},{key:"executeWithAsyncPaging",value:function(e){var t=u.default.defer(),r=t.promise;return this._loadData(e).then(function(e){t.resolve(e)},null,function(e){t.notify(e)}).catch(function(e){t.reject(e)}),r}}]),e}());r.default=c,t.exports=r.default},{merge:104,q:109}],249:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities){if(n.devices=n.entities,n.devices.length>0){var o=!1,a=r&&r.flattened||!1;for(o=0;o<n.devices.length;o++)if(a){if(n.devices[o]["device.identifier"]){var u=n.devices[o]["device.identifier"];(!u._value||u._value&&!u._value._current)&&delete n.devices[o]["device.identifier"]}}else n.devices[o].device&&n.devices[o].device.identifier&&!n.devices[o].device.identifier._current&&delete n.devices[o].device.identifier}delete n.entities}e.resolve({data:n,statusCode:i})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":252,q:109}],250:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities&&n.entities.length>0){var o=!1,a=r&&r.flattened||!1;for(o=0;o<n.entities.length;o++)if(a){if(n.entities[o]["device.identifier"]){var u=n.entities[o]["device.identifier"];(!u._value||u._value&&!u._value._current)&&delete n.entities[o]["device.identifier"]}}else n.entities[o].device&&n.entities[o].device.identifier&&!n.entities[o].device.identifier._current&&delete n.entities[o].device.identifier}e.resolve({data:n,statusCode:i})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":252,q:109}],251:[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}}(),o=e("./../util/Expression"),a=(function(e){e&&e.__esModule}(o),function(){function e(){n(this,e),this._filterTemplate={filter:{}}}return i(e,[{key:"or",value:function(){void 0===this._filterTemplate.filter.or&&(this._filterTemplate.filter.or=[]),void 0!==this._filterTemplate.filter.and&&(console.warn('The filter not allow both elements [and,or], the item "and" are going to be removed.'),delete this._filterTemplate.filter.and);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.or.push(t[n]);return this}},{key:"and",value:function(){void 0===this._filterTemplate.filter.and&&(this._filterTemplate.filter.and=[]),void 0!==this._filterTemplate.filter.or&&(console.warn('The filter not allow both elements [and,or], the item "or" are going to be removed.'),delete this._filterTemplate.filter.or);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.and.push(t[n]);return this}}]),e}());r.default=a,t.exports=r.default},{"./../util/Expression":324}],252:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./BaseSearch"),c=n(s),l=e("merge"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,d){void 0===o&&(o={limit:{}}),i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"search"+r,l),this._setUrlParameters(d),this._postObj=(0,f.default)(n,o,s,c),"object"==typeof a&&(this._postObj=(0,f.default)(this._postObj,a))}return o(t,e),a(t,[{key:"_filter",value:function(){return this._postObj}}]),t}(c.default);r.default=d,t.exports=r.default},{"./BaseSearch":248,merge:104}],253:[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}}(),o=e("./../util/SelectElement"),a=(function(e){e&&e.__esModule}(o),function(){function e(){n(this,e),this._selectTemplate={select:[]}}return i(e,[{key:"add",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n],o=this._selectTemplate.select;if(0===o.length)this._selectTemplate.select.push(i);else{for(var a=!1,u=0;u<o.length;u++){var s=o[u];if(s.name===i.name){a=!0;for(var c=i.fields,l=0;l<c.length;l++){for(var f=c[n],d=!1,h=0;h<s.fields.length;h++)s.fields[h].field===f.field&&(d=!0,f.alias&&(s.fields[h].alias=f.alias));d||this._selectTemplate.select[u].fields.push(f)}}}a||this._selectTemplate.select.push(i)}}return this}}]),e}());r.default=a,t.exports=r.default},{"./../util/SelectElement":326}],254:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog"+r,n,null,null,o),this._contentType=a,this._customFilters=s}return o(t,e),a(t,[{key:"execute",value:function(){var e=this,t=[],r=f.default.defer(),n=r.promise,i=e._content(e._contentType),o=e._customFilters&&e._customFilters.entityType,a=Object.keys(e._customFilters).length,u=a>1||1===a&&!o,s={};switch(o?s[o]=i[o]:s=i,e._contentType){case"operationalStatus":for(var c in s)s[c].forEach(function(r){(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===r)&&t.push({entityType:c,id:r})});break;case"administrativeState":var l=function(e){var r=e;r.entityType=d,t.push(r)};for(var d in s){var h=s[d];for(var p in h)if(u){for(var m in e._customFilters)if(h[p][m]===e._customFilters[m]){l(h[p]);break}}else l(h[p])}break;case"fieldsDefinition":case"communicationsModuleType":var y=u&&e._customFilters.type;if(void 0===y){r.resolve({error:"Filters not allowed",statusCode:400});break}var v=y?s[y]:s;t=v;break;case"userProfile":for(var g in s)(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===g)&&s[g].length>0&&t.push({id:g,managed:s[g]});break;case"serviceGroups":o&&(t=s[o]);break;case"allowedResourceType":for(var _ in s)(!e._customFilters.type||e._customFilters.type&&s[_].types.indexOf(e._customFilters.type)>-1)&&t.push(s[_].resourceType);break;case"ticketSeverity":case"ticketPriority":case"ticketStatus":case"ruleConfigurationSeverity":case"ruleMode":case"ruleType":case"ioTDatastreamPeriod":case"ioTDatastreamAccess":case"resourceType":case"countryCodes":case"timezones":case"userLanguages":case"ioTDatastreamStoragePeriod":if(y){r.resolve({error:"Filters not supported",statuscode:400});break}t=t.concat(s);break;default:r.resolve({data:{},statusCode:400})}if(t&&Object.keys(t).length>0){var b={};b[e._contentType]=t,r.resolve({data:b,statusCode:200})}else r.resolve({data:{},statusCode:204});return n}},{key:"_content",value:function(e){return{ticketSeverity:["CRITICAL","URGENT","WARNING","NORMAL"],ticketPriority:["MAJOR","MINOR","CRITICAL","BLOCKER"],ticketStatus:["CREATED","ASSIGNED","ANSWERED","RESTORED","RESOLVED","CLOSED"],serviceGroups:{ASSET:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"],SUBSCRIBER:["emptyServiceGroup"],SUBSCRIPTION:["emptyServiceGroup"],GATEWAY:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"]},administrativeState:{ASSET:[{id:"BANNED",description:"Asset banned, It means that received information of this asset is not going to be collected"},{id:"DELETED",description:"Asset removed from available stock"},{id:"IN_MAINTENANCE",description:"Asset in maintenance"},{id:"IN_STOCK",description:"Asset in stock"},{id:"IN_TRANSIT",description:"Asset in transit"},{id:"IN_USE",description:"Asset in use"},{id:"MISSING",description:"Asset missing"},{id:"ORDERED",description:"Asset ordered"},{id:"READY",description:"Asset ready for installation"},{id:"RETIRED",description:"Field entity withdrawal"}],GATEWAY:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],COMMUNICATIONS_MODULE:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIBER:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIPTION:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],CERTIFICATE:[{id:"NOT_ACTIVE",description:"NOT_ACTIVE"},{id:"ACTIVE",description:"ACTIVE"},{id:"REVOKED",description:"REVOKED"},{id:"EXPIRED",description:"EXPIRED"}]},operationalStatus:{ASSET:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],GATEWAY:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],COMMUNICATIONS_MODULE:["UNKNOWN","STOPPED","STARTING","RUNNING","STOPPING","ERROR"]},communicationsModuleType:{ADSL:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","ADDRESS","HOME_OPERATOR","LOCATION"]}},CAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},ETH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","ADDRESS"]}},GENERIC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC","SERIAL_NUMBER"]}},GSM:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC"]}},HAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},I2C:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},LOWPAN:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],
32
- optional:["administrativeState"]}},LTE_M:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC"]}},MESH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]}},MOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC"]}},MULTIMOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC"]}},NARROWBAND:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","LOCATION"]},SUBSCRIBER:{mandatory:["generatedEntityKey"],optional:["administrativeState","ICC"]}},PLC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState"]}},RS232:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS422:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS485:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},SIGFOX:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:["PAC"]},SUBSCRIPTION:{mandatory:["generatedEntityKey","HOME_OPERATOR","administrativeState","SIGFOX_DEVICE_TYPE"]}},ZIGBEE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState"]}}},ruleMode:["EASY","ADVANCED"],ruleType:["DATASTREAM","OPERATION","EVENT"],ruleConfigurationSeverity:["INFORMATIVE","URGENT","CRITICAL"],userProfile:{root:["admin_domain","admin","advanced","viewer"],admin_domain:["admin_domain","admin","advanced","viewer"],admin:["admin","advanced","viewer"],advanced:[],viewer:[]},ioTDatastreamAccess:["READ","WRITE"],ioTDatastreamStoragePeriod:["SECONDS","MINUTES","HOURS","DAYS","MONTHS","YEARS","NEVER"],ioTDatastreamPeriod:["PULSE","CUMULATIVE","INSTANT"],resourceType:[{identifier:"entity.asset"},{identifier:"entity.device"},{identifier:"ticket"}],allowedResourceType:[{resourceType:"entity.asset",types:["entity","asset"]},{resourceType:"entity.device",types:["entity","device"]},{resourceType:"entity.subscriber",types:["entity","subscriber"]},{resourceType:"entity.subscription",types:["entity","subscription"]},{resourceType:"ticket",types:["ticket"]},{resourceType:"organization",types:["organization"]},{resourceType:"channel",types:["channel"]}],fieldsDefinition:{string:{description:"Text based value",subtype:["text","password"]},boolean:{description:"Boolean based value",subtype:[]},calendar:{description:"Format is described in the ISO 8601 or in http://www.w3.org/TR/NOTE-datetime",subtype:["datetime","date","time"]},address:{description:"Network address value",subtype:["ip","ipv4","ipv6","mac48"]},number:{description:"Numeric value",subtype:["integer","float","percentage"]},enumeration:{description:"Choice list values",subtype:["string","number"]},array:{description:"Array of values",subtype:["string","number"]},coordinates:{description:"Object indicating coordinates and timestamp in geotime subtype",subtype:["geo","geotime","geojson"]},topology:{description:"Object indicating relations",subtype:["path","tree (not supported yet)"]},object:{description:"Not yet supported. For future uses only",subtype:[]}},userLanguages:[{code:"es",language:"Español/Spanish"},{code:"en",language:"Inglés/English"}],countryCodes:[{code:"AD",country:"Andorra",zone:"Europe/Andorra"},{code:"AE",country:"United Arab Emirates",zone:"Asia/Dubai"},{code:"AF",country:"Afghanistan",zone:"Asia/Kabul"},{code:"AG",country:"Antigua and Barbuda",zone:"America/Antigua"},{code:"AI",country:"Anguilla",zone:"America/Anguilla"},{code:"AL",country:"Albania",zone:"Europe/Tirane"},{code:"AM",country:"Armenia",zone:"Asia/Yerevan"},{code:"AN",country:"Netherlands Antilles",zone:"Netherlands Antilles"},{code:"AO",country:"Angola",zone:"Africa/Luanda"},{code:"AQ",country:"Antarctica",zone:"Antarctica/McMurdo"},{code:"AR",country:"Argentina",zone:"America/Argentina/Buenos_Aires"},{code:"AS",country:"American Samoa",zone:"Pacific/Pago_Pago"},{code:"AT",country:"Austria",zone:"Europe/Vienna"},{code:"AU",country:"Australia",zone:"Australia/Lord_Howe"},{code:"AW",country:"Aruba",zone:"America/Aruba"},{code:"AX",country:"Aland Islands",zone:"Europe/Mariehamn"},{code:"AZ",country:"Azerbaijan",zone:"Asia/Baku"},{code:"BA",country:"Bosnia and Herzegovina",zone:"Europe/Sarajevo"},{code:"BB",country:"Barbados",zone:"America/Barbados"},{code:"BD",country:"Bangladesh",zone:"Asia/Dhaka"},{code:"BE",country:"Belgium",zone:"Europe/Brussels"},{code:"BF",country:"Burkina Faso",zone:"Africa/Ouagadougou"},{code:"BG",country:"Bulgaria",zone:"Europe/Sofia"},{code:"BH",country:"Bahrain",zone:"Asia/Bahrain"},{code:"BI",country:"Burundi",zone:"Africa/Bujumbura"},{code:"BJ",country:"Benin",zone:"Africa/Porto-Novo"},{code:"BL",country:"Saint Barthélemy",zone:"America/St_Barthelemy"},{code:"BM",country:"Bermuda",zone:"Atlantic/Bermuda"},{code:"BN",country:"Brunei",zone:"Asia/Brunei"},{code:"BO",country:"Bolivia",zone:"America/La_Paz"},{code:"BQ",country:"Bonaire, Saint Eustatius and Saba",zone:"America/Kralendijk"},{code:"BR",country:"Brazil",zone:"America/Noronha"},{code:"BS",country:"Bahamas",zone:"America/Nassau"},{code:"BT",country:"Bhutan",zone:"Asia/Thimphu"},{code:"BV",country:"Bouvet Island",zone:"Bouvet Island"},{code:"BW",country:"Botswana",zone:"Africa/Gaborone"},{code:"BY",country:"Belarus",zone:"Europe/Minsk"},{code:"BZ",country:"Belize",zone:"America/Belize"},{code:"CA",country:"Canada",zone:"America/St_Johns"},{code:"CC",country:"Cocos Islands",zone:"Indian/Cocos"},{code:"CD",country:"Democratic Republic of the Congo",zone:"Africa/Kinshasa"},{code:"CF",country:"Central African Republic",zone:"Africa/Bangui"},{code:"CG",country:"Republic of the Congo",zone:"Africa/Brazzaville"},{code:"CH",country:"Switzerland",zone:"Europe/Zurich"},{code:"CI",country:"Ivory Coast",zone:"Africa/Abidjan"},{code:"CK",country:"Cook Islands",zone:"Pacific/Rarotonga"},{code:"CL",country:"Chile",zone:"America/Santiago"},{code:"CM",country:"Cameroon",zone:"Africa/Douala"},{code:"CN",country:"China",zone:"Asia/Shanghai"},{code:"CO",country:"Colombia",zone:"America/Bogota"},{code:"CR",country:"Costa Rica",zone:"America/Costa_Rica"},{code:"CS",country:"Serbia and Montenegro",zone:"Serbia and Montenegro"},{code:"CU",country:"Cuba",zone:"America/Havana"},{code:"CV",country:"Cape Verde",zone:"Atlantic/Cape_Verde"},{code:"CW",country:"Curaçao",zone:"America/Curacao"},{code:"CX",country:"Christmas Island",zone:"Indian/Christmas"},{code:"CY",country:"Cyprus",zone:"Asia/Nicosia"},{code:"CZ",country:"Czech Republic",zone:"Europe/Prague"},{code:"DE",country:"Germany",zone:"Europe/Berlin"},{code:"DJ",country:"Djibouti",zone:"Africa/Djibouti"},{code:"DK",country:"Denmark",zone:"Europe/Copenhagen"},{code:"DM",country:"Dominica",zone:"America/Dominica"},{code:"DO",country:"Dominican Republic",zone:"America/Santo_Domingo"},{code:"DZ",country:"Algeria",zone:"Africa/Algiers"},{code:"EC",country:"Ecuador",zone:"America/Guayaquil"},{code:"EE",country:"Estonia",zone:"Europe/Tallinn"},{code:"EG",country:"Egypt",zone:"Africa/Cairo"},{code:"EH",country:"Western Sahara",zone:"Africa/El_Aaiun"},{code:"ER",country:"Eritrea",zone:"Africa/Asmara"},{code:"ES",country:"Spain",zone:"Europe/Madrid"},{code:"ET",country:"Ethiopia",zone:"Africa/Addis_Ababa"},{code:"FI",country:"Finland",zone:"Europe/Helsinki"},{code:"FJ",country:"Fiji",zone:"Pacific/Fiji"},{code:"FK",country:"Falkland Islands",zone:"Atlantic/Stanley"},{code:"FM",country:"Micronesia",zone:"Pacific/Chuuk"},{code:"FO",country:"Faroe Islands",zone:"Atlantic/Faroe"},{code:"FR",country:"France",zone:"Europe/Paris"},{code:"GA",country:"Gabon",zone:"Africa/Libreville"},{code:"GB",country:"United Kingdom",zone:"Europe/London"},{code:"GD",country:"Grenada",zone:"America/Grenada"},{code:"GE",country:"Georgia",zone:"Asia/Tbilisi"},{code:"GF",country:"French Guiana",zone:"America/Cayenne"},{code:"GG",country:"Guernsey",zone:"Europe/Guernsey"},{code:"GH",country:"Ghana",zone:"Africa/Accra"},{code:"GI",country:"Gibraltar",zone:"Europe/Gibraltar"},{code:"GL",country:"Greenland",zone:"America/Godthab"},{code:"GM",country:"Gambia",zone:"Africa/Banjul"},{code:"GN",country:"Guinea",zone:"Africa/Conakry"},{code:"GP",country:"Guadeloupe",zone:"America/Guadeloupe"},{code:"GQ",country:"Equatorial Guinea",zone:"Africa/Malabo"},{code:"GR",country:"Greece",zone:"Europe/Athens"},{code:"GS",country:"South Georgia and the South Sandwich Islands",zone:"Atlantic/South_Georgia"},{code:"GT",country:"Guatemala",zone:"America/Guatemala"},{code:"GU",country:"Guam",zone:"Pacific/Guam"},{code:"GW",country:"Guinea-Bissau",zone:"Africa/Bissau"},{code:"GY",country:"Guyana",zone:"America/Guyana"},{code:"HK",country:"Hong Kong",zone:"Asia/Hong_Kong"},{code:"HM",country:"Heard Island and McDonald Islands",zone:"Heard Island and McDonald Islands"},{code:"HN",country:"Honduras",zone:"America/Tegucigalpa"},{code:"HR",country:"Croatia",zone:"Europe/Zagreb"},{code:"HT",country:"Haiti",zone:"America/Port-au-Prince"},{code:"HU",country:"Hungary",zone:"Europe/Budapest"},{code:"ID",country:"Indonesia",zone:"Asia/Jakarta"},{code:"IE",country:"Ireland",zone:"Europe/Dublin"},{code:"IL",country:"Israel",zone:"Asia/Jerusalem"},{code:"IM",country:"Isle of Man",zone:"Europe/Isle_of_Man"},{code:"IN",country:"India",zone:"Asia/Kolkata"},{code:"IO",country:"British Indian Ocean Territory",zone:"Indian/Chagos"},{code:"IQ",country:"Iraq",zone:"Asia/Baghdad"},{code:"IR",country:"Iran",zone:"Asia/Tehran"},{code:"IS",country:"Iceland",zone:"Atlantic/Reykjavik"},{code:"IT",country:"Italy",zone:"Europe/Rome"},{code:"JE",country:"Jersey",zone:"Europe/Jersey"},{code:"JM",country:"Jamaica",zone:"America/Jamaica"},{code:"JO",country:"Jordan",zone:"Asia/Amman"},{code:"JP",country:"Japan",zone:"Asia/Tokyo"},{code:"KE",country:"Kenya",zone:"Africa/Nairobi"},{code:"KG",country:"Kyrgyzstan",zone:"Asia/Bishkek"},{code:"KH",country:"Cambodia",zone:"Asia/Phnom_Penh"},{code:"KI",country:"Kiribati",zone:"Pacific/Tarawa"},{code:"KM",country:"Comoros",zone:"Indian/Comoro"},{code:"KN",country:"Saint Kitts and Nevis",zone:"America/St_Kitts"},{code:"KP",country:"North Korea",zone:"Asia/Pyongyang"},{code:"KR",country:"South Korea",zone:"Asia/Seoul"},{code:"KW",country:"Kuwait",zone:"Asia/Kuwait"},{code:"KY",country:"Cayman Islands",zone:"America/Cayman"},{code:"KZ",country:"Kazakhstan",zone:"Asia/Almaty"},{code:"LA",country:"Laos",zone:"Asia/Vientiane"},{code:"LB",country:"Lebanon",zone:"Asia/Beirut"},{code:"LC",country:"Saint Lucia",zone:"America/St_Lucia"},{code:"LI",country:"Liechtenstein",zone:"Europe/Vaduz"},{code:"LK",country:"Sri Lanka",zone:"Asia/Colombo"},{code:"LR",country:"Liberia",zone:"Africa/Monrovia"},{code:"LS",country:"Lesotho",zone:"Africa/Maseru"},{code:"LT",country:"Lithuania",zone:"Europe/Vilnius"},{code:"LU",country:"Luxembourg",zone:"Europe/Luxembourg"},{code:"LV",country:"Latvia",zone:"Europe/Riga"},{code:"LY",country:"Libya",zone:"Africa/Tripoli"},{code:"MA",country:"Morocco",zone:"Africa/Casablanca"},{code:"MC",country:"Monaco",zone:"Europe/Monaco"},{code:"MD",country:"Moldova",zone:"Europe/Chisinau"},{code:"ME",country:"Montenegro",zone:"Europe/Podgorica"},{code:"MF",country:"Saint Martin",zone:"America/Marigot"},{code:"MG",country:"Madagascar",zone:"Indian/Antananarivo"},{code:"MH",country:"Marshall Islands",zone:"Pacific/Majuro"},{code:"MK",country:"Macedonia",zone:"Europe/Skopje"},{code:"ML",country:"Mali",zone:"Africa/Bamako"},{code:"MM",country:"Myanmar",zone:"Asia/Yangon"},{code:"MN",country:"Mongolia",zone:"Asia/Ulaanbaatar"},{code:"MO",country:"Macao",zone:"Asia/Macau"},{code:"MP",country:"Northern Mariana Islands",zone:"Pacific/Saipan"},{code:"MQ",country:"Martinique",zone:"America/Martinique"},{code:"MR",country:"Mauritania",zone:"Africa/Nouakchott"},{code:"MS",country:"Montserrat",zone:"America/Montserrat"},{code:"MT",country:"Malta",zone:"Europe/Malta"},{code:"MU",country:"Mauritius",zone:"Indian/Mauritius"},{code:"MV",country:"Maldives",zone:"Indian/Maldives"},{code:"MW",country:"Malawi",zone:"Africa/Blantyre"},{code:"MX",country:"Mexico",zone:"America/Mexico_City"},{code:"MY",country:"Malaysia",zone:"Asia/Kuala_Lumpur"},{code:"MZ",country:"Mozambique",zone:"Africa/Maputo"},{code:"NA",country:"Namibia",zone:"Africa/Windhoek"},{code:"NC",country:"New Caledonia",zone:"Pacific/Noumea"},{code:"NE",country:"Niger",zone:"Africa/Niamey"},{code:"NF",country:"Norfolk Island",zone:"Pacific/Norfolk"},{code:"NG",country:"Nigeria",zone:"Africa/Lagos"},{code:"NI",country:"Nicaragua",zone:"America/Managua"},{code:"NL",country:"Netherlands",zone:"Europe/Amsterdam"},{code:"NO",country:"Norway",zone:"Europe/Oslo"},{code:"NP",country:"Nepal",zone:"Asia/Kathmandu"},{code:"NR",country:"Nauru",zone:"Pacific/Nauru"},{code:"NU",country:"Niue",zone:"Pacific/Niue"},{code:"NZ",country:"New Zealand",zone:"Pacific/Auckland"},{code:"OM",country:"Oman",zone:"Asia/Muscat"},{code:"PA",country:"Panama",zone:"America/Panama"},{code:"PE",country:"Peru",zone:"America/Lima"},{code:"PF",country:"French Polynesia",zone:"Pacific/Tahiti"},{code:"PG",country:"Papua New Guinea",zone:"Pacific/Port_Moresby"},{code:"PH",country:"Philippines",zone:"Asia/Manila"},{code:"PK",country:"Pakistan",zone:"Asia/Karachi"},{code:"PL",country:"Poland",zone:"Europe/Warsaw"},{code:"PM",country:"Saint Pierre and Miquelon",zone:"America/Miquelon"},{code:"PN",country:"Pitcairn",zone:"Pacific/Pitcairn"},{code:"PR",country:"Puerto Rico",zone:"America/Puerto_Rico"},{code:"PS",country:"Palestinian Territory",zone:"Asia/Gaza"},{code:"PT",country:"Portugal",zone:"Europe/Lisbon"},{code:"PW",country:"Palau",zone:"Pacific/Palau"},{code:"PY",country:"Paraguay",zone:"America/Asuncion"},{code:"QA",country:"Qatar",zone:"Asia/Qatar"},{code:"RE",country:"Reunion",zone:"Indian/Reunion"},{code:"RO",country:"Romania",zone:"Europe/Bucharest"},{code:"RS",country:"Serbia",zone:"Europe/Belgrade"},{code:"RU",country:"Russia",zone:"Europe/Kaliningrad"},{code:"RW",country:"Rwanda",zone:"Africa/Kigali"},{code:"SA",country:"Saudi Arabia",zone:"Asia/Riyadh"},{code:"SB",country:"Solomon Islands",zone:"Pacific/Guadalcanal"},{code:"SC",country:"Seychelles",zone:"Indian/Mahe"},{code:"SD",country:"Sudan",zone:"Africa/Khartoum"},{code:"SE",country:"Sweden",zone:"Europe/Stockholm"},{code:"SG",country:"Singapore",zone:"Asia/Singapore"},{code:"SH",country:"Saint Helena",zone:"Atlantic/St_Helena"},{code:"SI",country:"Slovenia",zone:"Europe/Ljubljana"},{code:"SJ",country:"Svalbard and Jan Mayen",zone:"Arctic/Longyearbyen"},{code:"SK",country:"Slovakia",zone:"Europe/Bratislava"},{code:"SL",country:"Sierra Leone",zone:"Africa/Freetown"},{code:"SM",country:"San Marino",zone:"Europe/San_Marino"},{code:"SN",country:"Senegal",zone:"Africa/Dakar"},{code:"SO",country:"Somalia",zone:"Africa/Mogadishu"},{code:"SR",country:"Suriname",zone:"America/Paramaribo"},{code:"SS",country:"South Sudan",zone:"Africa/Juba"},{code:"ST",country:"Sao Tome and Principe",zone:"Africa/Sao_Tome"},{code:"SV",country:"El Salvador",zone:"America/El_Salvador"},{code:"SX",country:"Sint Maarten",zone:"America/Lower_Princes"},{code:"SY",country:"Syria",zone:"Asia/Damascus"},{code:"SZ",country:"Swaziland",zone:"Africa/Mbabane"},{code:"TC",country:"Turks and Caicos Islands",zone:"America/Grand_Turk"},{code:"TD",country:"Chad",zone:"Africa/Ndjamena"},{code:"TF",country:"French Southern Territories",zone:"Indian/Kerguelen"},{code:"TG",country:"Togo",zone:"Africa/Lome"},{code:"TH",country:"Thailand",zone:"Asia/Bangkok"},{code:"TJ",country:"Tajikistan",zone:"Asia/Dushanbe"},{code:"TK",country:"Tokelau",zone:"Pacific/Fakaofo"},{code:"TL",country:"East Timor",zone:"Asia/Dili"},{code:"TM",country:"Turkmenistan",zone:"Asia/Ashgabat"},{code:"TN",country:"Tunisia",zone:"Africa/Tunis"},{code:"TO",country:"Tonga",zone:"Pacific/Tongatapu"},{code:"TR",country:"Turkey",zone:"Europe/Istanbul"},{code:"TT",country:"Trinidad and Tobago",zone:"America/Port_of_Spain"},{code:"TV",country:"Tuvalu",zone:"Pacific/Funafuti"},{code:"TW",country:"Taiwan",zone:"Asia/Taipei"},{code:"TZ",country:"Tanzania",zone:"Africa/Dar_es_Salaam"},{code:"UA",country:"Ukraine",zone:"Europe/Kiev"},{code:"UG",country:"Uganda",zone:"Africa/Kampala"},{code:"UM",country:"United States Minor Outlying Islands",zone:"Pacific/Midway"},{code:"US",country:"United States",zone:"America/New_York"},{code:"UY",country:"Uruguay",zone:"America/Montevideo"},{code:"UZ",country:"Uzbekistan",zone:"Asia/Samarkand"},{code:"VA",country:"Vatican",zone:"Europe/Vatican"},{code:"VC",country:"Saint Vincent and the Grenadines",zone:"America/St_Vincent"},{code:"VE",country:"Venezuela",zone:"America/Caracas"},{code:"VG",country:"British Virgin Islands",zone:"America/Tortola"},{code:"VI",country:"U.S. Virgin Islands",zone:"America/St_Thomas"},{code:"VN",country:"Vietnam",zone:"Asia/Ho_Chi_Minh"},{code:"VU",country:"Vanuatu",zone:"Pacific/Efate"},{code:"WF",country:"Wallis and Futuna",zone:"Pacific/Wallis"},{code:"WS",country:"Samoa",zone:"Pacific/Apia"},{code:"XK",country:"Kosovo",zone:"Kosovo"},{code:"YE",country:"Yemen",zone:"Asia/Aden"},{code:"YT",country:"Mayotte",zone:"Indian/Mayotte"},{code:"ZA",country:"South Africa",zone:"Africa/Johannesburg"},{code:"ZM",country:"Zambia",zone:"Africa/Lusaka"},{code:"ZW",country:"Zimbabwe",zone:"Africa/Harare"}],timezones:["ACT","AET","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","AGT","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port_of_Spain","America/Port-au-Prince","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","ART","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","AST","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/North","Australia/NSW","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","BET","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","BST","Canada/Atlantic","Canada/Central","Canada/East-Saskatchewan","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","CAT","CET","Chile/Continental","Chile/EasterIsland","CNT","CST","CST6CDT","CTT","Cuba","EAT","ECT","EET","Egypt","Eire","EST","EST5EDT","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT0","Greenwich","Hongkong","HST","Iceland","IET","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","IST","Jamaica","Japan","JST","Kwajalein","Libya","MET","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","MIT","MST","MST7MDT","Navajo","NET","NST","NZ","NZ-CHAT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","PLT","PNT","Poland","Portugal","PRC","PRT","PST","PST8PDT","ROK","Singapore","SST","SystemV/AST4","SystemV/AST4ADT","SystemV/CST6","SystemV/CST6CDT","SystemV/EST5","SystemV/EST5EDT","SystemV/HST10","SystemV/MST7","SystemV/MST7MDT","SystemV/PST8","SystemV/PST8PDT","SystemV/YST9","SystemV/YST9YDT","Turkey","UCT","Universal","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","VST","W-SU","WET","Zulu"]}[e]}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":252,q:109}],255:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./BaseSearch"),c=n(s),l=e("merge"),f=n(l),d=e("q"),h=n(d),p=function(e){function t(e,r,n,o,a,s,c,l,d){void 0===o&&(o={limit:{}}),i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,l),this._setUrlParameters(d),this._postObj=(0,f.default)(n,o,s,c),"object"==typeof a&&(this._postObj=(0,f.default)(this._postObj,a))}return o(t,e),a(t,[{key:"_filter",value:function(){return this._postObj}},{key:"_loadData",value:function(e){function t(){if(r.cancel||"string"==typeof r.cancel){var e="string"==typeof r.cancel?r.cancel:"Cancel process";n.reject({data:e,statusCode:403})}else r._ogapi.Napi.post(r._resource,i,r._timeout,r._getExtraHeaders(),r._getUrlParameters()).then(function(e){var r=e.statusCode,a=e.body;if(!a&&e.text)try{var u=JSON.parse(e.text);u&&(a=u)}catch(e){console.error("Impossible to parse text from response")}200===r?(o=!0,n.notify(a),a.data.length===i.limit.size?(i.limit.start+=1,t()):n.resolve({data:"DONE",statusCode:200})):o?n.resolve({data:"DONE",statusCode:200}):n.reject({data:a,statusCode:r})}).catch(function(e){n.reject(e)})}var r=this,n=h.default.defer(),i=r._asyncPagingFilter(),o=!1;return t(),n.promise}}]),t}(c.default);r.default=p,t.exports=r.default},{"./BaseSearch":248,merge:104,q:109}],256:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get
33
- ;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/administrativeState",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"administrativeState",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],257:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="$_token";r.TOKEN_URL=d;var h=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/alarms"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscriptions:"/subscriptions"},r),this._url="/entities"+d+"/alarms"}.apply(this,arguments)}return o(t,e),a(t,[{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(d,this._routes[e]));return this._url=this._url.replace(d,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],258:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/allowedResourceType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"allowedResourceType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e.toLowerCase(),this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],259:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/areas",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],260:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../AssetSearch"),h=n(d),p="/entities",m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p)),this._url=p}return o(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.asset.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}},{key:"select",value:function(e){return this._builderParams.select=e||void 0,this}}]),t}(c.default);r.default=m,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"../AssetSearch":247,"./PreFilteredSearchBuilder":292}],261:[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 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}}(),a=e("q"),u=n(a),s=e("merge"),c=(n(s),e("jsonpath")),l=n(c),f=function(){function e(t,r){i(this,e),this._ogapi=t,this._resource="resources/schemaTypes/og_basic_types",this._headers=void 0,this._og_basic_types={},this.publicParameters=!1,this._urlParameters=void 0}return o(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=this,t=u.default.defer(),r=t.promise;return this._setExtraHeaders({Accept:"application/json"}),this._ogapi.Napi.get(this._resource,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(r){var n=r.body,i=r.statusCode;if(e._og_basic_types=n,l.default.apply(e._og_basic_types,"$..['$ref']",function(e,t){var r="$.."+e.replace("#/definitions/","");return l.default.query(n,r)[0]}).forEach(function(e){var t=l.default.stringify(e.path);l.default.value(n,t,e.value)}),e.path){var o=e.path.includes("$")?e.path:"$.."+e.path,a=l.default.query(n,o)[0]||{msg:"not Found"};t.resolve({data:a,statusCode:i})}else{if(e.publicParameters)for(var u in n.definitions)n.definitions[u].public&&!1!==n.definitions[u].public||delete n.definitions[u];t.resolve({data:n,statusCode:i})}}).catch(function(e){t.reject(e)}),r}},{key:"withPath",value:function(e){return this.path=e,this}},{key:"withPublicParameters",value:function(e){return this.publicParameters=e,this}},{key:"build",value:function(){return this}}]),e}();r.default=f,t.exports=r.default},{jsonpath:95,merge:104,q:109}],262:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="provisionProcessors/bulk/search",m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p)),this._url=p}return o(t,e),a(t,[{key:"build",value:function(){return new h.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,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"../WPSearch":255,"./SearchBuilder":296}],263:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/bulk/async",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],264:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/bundles",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],265:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/certificates",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._fetch=!1,this._assignable=!1}return o(t,e),a(t,[{key:"assignable",value:function(){return this._assignable=!0,this}},{key:"administrable",value:function(){return this._assignable=!1,this}},{key:"withFetch",value:function(e){if(!0!==e&&!1!==e)throw new Error("Flag fecth incorrect");return this._fetch=e,this}},{key:"_buildUrl",value:function(){var e=this._url;return!0===this._fetch&&(this._urlParams.fetch=1),!0===this._assignable&&(this._urlParams.visibility="assignable"),e}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],266:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/channels",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._summary=!1}return o(t,e),a(t,[{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],267:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/communicationsModuleType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"communicationsModuleType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],268:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/countryCodes",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"countryCodes",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],269:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/datamodels",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],270:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("merge"),f=n(l),d=e("moment"),h=n(d),p=e("../../util/searchingFields/FieldFinder"),m=n(p),y=e("../../util/DATE_FORMAT"),v="/datapoints",g=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new m.default(e,v)),this._url=v,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return o(t,e),a(t,[{key:"withDeviceId",value:function(e){if("string"!=typeof e)throw new Error("Parameter deviceId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.device",e)),this}},{key:"withDatastream",value:function(e){if("string"!=typeof e)throw new Error("Parameter datastreamId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.datastream",e)),this}},{key:"withFeed",value:function(e){if("string"!=typeof e)throw new Error("Parameter feedId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.feed",e)),this}},{key:"betweenDates",value:function(e,t){if("object"!=typeof e||e.constructor!==Date)throw new Error("Parameter fromDate must be a Date");if(this.fluentFilter.and(this._parent.EX.gt("datapoint.at",(0,h.default)(e).format(y.DATE_FORMAT))),void 0!==t){if(t.constructor!==Date)throw new Error("Parameter toDate must be a Date");this.fluentFilter.and(this._parent.EX.lt("datapoint.at",(0,h.default)(t).format(y.DATE_FORMAT)))}return this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,f.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [betweenDates, addTag, withDatastreamId, withDeviceId] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}},{key:"select",value:function(e){return this._builderParams.select=e,this}}]),t}(c.default);r.default=g,t.exports=r.default},{"../../util/DATE_FORMAT":323,"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296,merge:104,moment:105}],271:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../EntitySearch"),h=n(d),p="$_token";r.TOKEN_URL=p;var m=function(e){function t(e,r,n){var o=arguments.length<=3||void 0===arguments[3]?new f.default(e,"/entities"):arguments[3];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/"},o),this._url="/organizations/"+r+"/datasets/"+n+p}.apply(this,arguments)}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(p,this._routes[e]));return this._url=this._url.replace(p,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.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":329,"../EntitySearch":250,"./SearchWithSummaryBuilder":297}],272:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="datasets";r.BASE_URL=p;var m=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p,{organization:r,dataset:n})),this._url=p+"/provision/organizations/"+r+"/"+n+"/data"}return o(t,e),a(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 h.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":329,"../WPSearch":255,"./SearchBuilder":296}],273:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}
29
+ ;r.default=c,t.exports=r.default},{"./ByGeneric":219}],221:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=e("./../DAYS_ENUM"),l=function(e){function t(e,r,i,o,u){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u)}return i(t,e),o(t,[{key:"days",value:function(e){if(void 0===e||e.constructor!==Array)throw new Error("Parameter days must be typeof Array");if(0===e.length)throw new Error("Parameter days must have at least one day");for(var t=[],r=0;r<e.length;r++){var n=c.DAYS_ENUM.find(function(e){return e==this},e[r]);void 0===n&&t.push(n)}if(0!==t.length)throw new Error("Any day into parameter days is not allowed. Parameter value <'"+JSON.stringify(e)+"'>, Months allowed <'"+JSON.stringify(c.DAYS_ENUM)+"'>");return this._days=e,this._build()}},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.weekly={days:this._days},e}}]),t}(s.default);r.default=l,t.exports=r.default},{"./../DAYS_ENUM":214,"./ByGeneric":219}],222:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./ByGeneric"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=e("./../MONTHS_ENUM"),l=function(e){function t(e,r,i,o,u){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u);var s=e._task;if(s){var c=s.schedule.repeating.pattern;if(c){var l=c.yearly;l&&(this._day=l.day,this._month=l.month,a(Object.getPrototypeOf(t.prototype),"_build",this).call(this))}}}return i(t,e),o(t,[{key:"day",value:function(e){if("number"!=typeof e){if(!this._day)throw new Error("Parameter day must be typeof number");month=this._day}if(e>31||e<1)throw new Error("Parameter day must be greater than 1 and less than 31");return this._day=e,void 0===this._month?this:this._parent._task?(this._build(),this):this._build()}},{key:"month",value:function(e){function t(t){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(e){if("string"!=typeof e){if(!this._month)throw new Error("OGAPI_PARAMETER_MONTH_MUST_BE_STRING");e=this._month}if(void 0===c.MONTHS_ENUM.find(function(e){return e==this},e))throw new Error("Any month into parameter months is not allowed. Parameter value <'"+e+"'>, Months allowed <'"+JSON.stringify(c.MONTHS_ENUM)+"'>");return this._month=e,void 0===this._day?this:this._parent._task?(this._build(),this):this._build()})},{key:"_create",value:function(){var e=a(Object.getPrototypeOf(t.prototype),"_create",this).call(this);return e.repeating.pattern.yearly={day:this._day,month:this._month},e}}]),t}(s.default);r.default=l,t.exports=r.default},{"./../MONTHS_ENUM":217,"./ByGeneric":219}],223:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations","organization","Organization not found")}return o(t,e),a(t,[{key:"findByName",value:function(e){return this._id=e,this._execute()}},{key:"findByDomainAndWorkgroup",value:function(e,t){this._domain=e,this._workgroup=t;var r=f.default.defer(),n=r.promise,i=this._error_not_found;return this._executeWorkgroupRelation().then(function(e){if(204===e.statusCode)r.reject({data:i,statusCode:h.default.NOT_FOUND});else{var t=e.data,n={},o=[];for(var a in t.channels)n[t.channels[a].organization]||(n[t.channels[a].organization]=t.channels[a].organization,o.push({name:t.channels[a].organization}));o.length>0?r.resolve({data:o,statusCode:e.statusCode}):r.reject({data:i,statusCode:h.default.NOT_FOUND})}}).catch(function(e){r.reject(e)}),n}},{key:"_executeWorkgroupRelation",value:function(){var e="provision/domains/"+this._domain+"/workgroups/"+this._workgroup+"/relations",t=f.default.defer(),r=t.promise,n=this._error_not_found;return this._api.get(e,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){204===e.statusCode?t.reject({data:n,statusCode:h.default.NOT_FOUND}):t.resolve({data:e.body.workgroupRelation,statusCode:e.statusCode})}).catch(function(e){t.reject(e)}),r}}]),t}(c.default);r.default=p,t.exports=r.default},{"../ProvisionGenericFinder":138,"http-status-codes":68,q:109}],224:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../provision/BaseProvision"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"+(void 0===r?"":r)),this._name=void 0,this._description=void 0,this._countryCode=void 0,this._langCode=void 0,this._timeZone=void 0,this._zoom=void 0,this._location=void 0}return i(t,e),o(t,[{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._name=e,this}},{key:"withDomain",value:function(e){if("string"!=typeof e||e.length>50)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_50");return this._domain=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error("OGAPI_STRING_PARAMETER_MAX_LENGTH_250");return this._description=e,this}},{key:"withCountryCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._countryCode=e.toUpperCase(),this}},{key:"withLangCode",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._langCode=e.toLowerCase(),this}},{key:"withTimeZone",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._timeZone=e,this}},{key:"withPlan",value:function(e){if("string"!=typeof e||0===e.length)throw new Error("OGAPI_STRING_PARAMETER");return this._plan=e,this}},{key:"withOnlyAssignedDomainCertificates",value:function(e){if("boolean"!=typeof e||!0!==e&&!1!==e)throw new Error("Parameter OnlyAssignedDomainCertificates must be a boolean and cannot be empty");return this._onlyDomainCerts=e,this}},{key:"withZoom",value:function(e){if("number"!=typeof(e*=1)||e<0||e>19)throw new Error("Parameter zoom must be a number between 0 and 19");return this._zoom=e,this}},{key:"withLocation",value:function(e,t){if(e*=1,t*=1,"number"!=typeof e||"number"!=typeof t)throw new Error("Latitude and longitude parameters must be numbers");if(e<-90||e>90)throw new Error("Parameter latitude value must be between -90 and 90");if(t<-180||t>180)throw new Error("Parameter longitude value must be between -180 and 180");return this._location={latitude:e,longitude:t},this}},{key:"_composeElement",value:function(){if(void 0===this._name||void 0===this._langCode||void 0===this._countryCode)throw new Error("Parameters name, country code and lang code must be defined");var e={};void 0!=this._zoom&&(e.zoom=this._zoom),void 0!=this._location&&(e.location=this._location);var t={organization:{name:this._name||void 0,description:this._description||void 0,plan:this._plan||void 0,countryCode:this._countryCode||void 0,langCode:this._langCode||void 0,timezone:this._timeZone||void 0,onlyAssignedDomainCertificates:"boolean"!=typeof this._onlyDomainCerts?this._onlyDomainCerts:void 0}};return this._domain&&(t.organization.domain=this._domain),(e.zoom||e.location)&&(t.organization.mapDefault=e),t}},{key:"_composeUpdateElement",value:function(){if(this._domain)throw new Error("The domain parameter is not allowed in the update");var e=this._composeElement();return delete e.organization.name,e}},{key:"_buildURL",value:function(){if(void 0===this._name)throw new Error("Parameter name must be defined");return this._resource+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../provision/BaseProvision":225}],225:[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}}(),o=e("q"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){var o=arguments.length<=3||void 0===arguments[3]?[]:arguments[3];if(n(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._composeElement)throw new Error("Must override method: composeElement");if("function"!=typeof this._buildURL)throw new Error("Must override method: _buildURL");i&&(this._timeout="number"!=typeof i?t.Napi._options.timeout:i),this._ogapi=t,this._resource="provision"+r,this._requiredParameters=o,this._headers=void 0,this._urlParameters=void 0}return i(e,[{key:"_checkRequiredParameters",value:function(){var e=[];if(this._requiredParameters&&this._requiredParameters.length>0){for(var t=0;t<this._requiredParameters.length;t++)void 0===this[this._requiredParameters[t]]&&void 0===this["_"+this._requiredParameters[t]]&&e.push(this._requiredParameters[t]);if(e.length>0)throw new Error("There are required parameters that have not been set. Missing parameters: "+JSON.stringify(e).replace(new RegExp('"',"g"),""))}}},{key:"create",value:function(){var e=this;this._checkRequiredParameters();var t=a.default.defer(),r=t.promise,n=this._composeElement();return this._ogapi.Napi.post(this._resource,n,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(r){201===r.statusCode?("function"==typeof e._onCreated&&e._onCreated(r.header.location),t.resolve({location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(e){t.reject(e)}),r}},{key:"delete",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).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}},{key:"update",value:function(){var e=a.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"_composeUpdateElement",value:function(){return this._composeElement()}},{key:"_doNorthPut",value:function(e,t){var r=a.default.defer(),n=r.promise;return this._ogapi.Napi.put(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){200===e.statusCode?r.resolve({statusCode:e.statusCode}):200===e.status?r.resolve({statusCode:e.status}):r.reject({errors:e.errors,statusCode:e.statusCode})}).catch(function(e){r.reject(e)}),n}},{key:"_doNorthPost",value:function(e,t){var r=this,n=a.default.defer(),i=n.promise;return this._ogapi.Napi.post(e,t,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){201===e.statusCode?("function"==typeof r._onCreated&&r._onCreated(e.header.location),n.resolve({location:e.header.location,statusCode:e.statusCode})):200===e.statusCode?n.resolve({statusCode:e.statusCode}):n.reject({errors:e.errors,statusCode:e.statusCode})}).catch(function(e){n.reject(e)}),i}},{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"_checkValues",value:function(e,t){var r=[];return void 0===t.find(function(e){return e==this},e)&&r.push(e),0!==r.length&&console.warn("Parameter value not allowed <'"+JSON.stringify(r)+"'>, allowed <'"+JSON.stringify(t)+"'>"),e}}]),e}();r.default=u,t.exports=r.default},{q:109}],226:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../BaseProvision"),c=n(s),l=e("q"),f=n(l),d={xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};r.TYPES=d;var h=function(e){function t(e,r,n,o){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,void 0,o,["organization","processorId"]),this._timeout=o,this._organization=r,this._processorId=n,this._resource="provisionProcessors/provision/organizations/"+r+"/"+n+"/"}return o(t,e),a(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource+this._type}},{key:"plan",value:function(e,t,r){if("string"!=typeof t)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._extension=d[t],this._setUrlParameters({numberOfEntriesToProcess:r||1}),this._type="plan",this._setExtraHeaders({accept:"application/json"}),this._executeOperation(e)}},{key:"bulk",value:function(e,t){if(this._extension=d[t],"string"!=typeof this._extension)throw new Error("Parameter extension must be a string (xls or xlsx) and cannot be empty");return this._type="bulk",this._setExtraHeaders({accept:this._extension}),this._executeOperation(e)}},{key:"_executeOperation",value:function(e){var t=void 0;"string"!=typeof e?(t=new FormData,t.append("file",e)):(t={},t.processorBulkFile=e);var r=f.default.defer(),n=this._buildURL();return this._ogapi.Napi.post_multipart(n,t,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){switch(e.statusCode){case 200:var t=""!=e.text?JSON.parse(e.text):{},n=e.status;r.resolve({data:t,statusCode:n});break;case 201:var n=e.status,i=e.location||e.headers.location||e.header.location;r.resolve({location:i,statusCode:n});break;case 204:r.resolve(e);break;default:r.reject({errors:e.data.errors,statusCode:e.statusCode})}}).catch(function(e){r.reject(e)}),r.promise}}]),t}(c.default);r.default=h},{"../BaseProvision":225,q:109}],227:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.asset.identifier";r.AssetID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/entities",i,o,u,s),this._entity.resourceType={_value:{_current:{value:"entity.asset"}}}}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":235}],228:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../BaseProvision"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r),this._timeout=o,this._resource=r,this._extension=n}return o(t,e),a(t,[{key:"_composeElement",value:function(){return this}},{key:"_buildURL",value:function(){return this._resource}},{key:"create",value:function(e,t){return this._executeOperation(e,"CREATE",t)}},{key:"delete",value:function(e,t){return this._executeOperation(e,"DELETE",t)}},{key:"deleteAll",value:function(e,t){return this._executeOperation(e,"DELETE&full=true",t)}},{key:"update",value:function(e,t){return this._executeOperation(e,"UPDATE",t)}},{key:"patch",value:function(e,t){return this._executeOperation(e,"PATCH",t)}},{key:"_executeOperation",value:function(e,t,r){var n=void 0;if("string"!=typeof e){if(n={},e){var i=new Blob([e]);n.bulkFile=i}}else n={},e&&(n.bulkFile=e);var o=f.default.defer();n.ext=this._extension;var a=this._buildURL();return r&&this._setExtraHeaders({accept:"text/plain"}),this._setUrlParameters({action:t}),this._ogapi.Napi.post_multipart(a,n,{},this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){var t=e.statusCode;if(200===t||201===t)if(r&&!e.location){var n=e,i=e.statusCode;o.resolve({data:n,statusCode:i})}else o.resolve(e);else 204===t?o.resolve(e):o.reject({errors:e.data.errors,statusCode:e.statusCode})}).catch(function(e){o.reject(e)}),o.promise}}]),t}(c.default);r.default=d,t.exports=r.default},{"../BaseProvision":225,q:109}],229:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,i,o,u,s)}return i(t,e),o(t,[{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach(function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];n.forEach?n.forEach(function(e){e._index.value&&e._value&&e._value._current&&t.withComplex(r,e._index.value._current.value,e._value._current.value)}):t.with(r,n._value._current.value)}})}},{key:"_initFormJson",value:function(e,t,r){var n=this;if(e){Object.keys(e).forEach(function(i){var o=e[i],a=o._current,u=t?t+"."+i:i;if(a){var s=a.value;r?n.withComplex(u,r,s):n.with(u,s)}else Array.isArray(o)?o.forEach(function(e){n._initFromJson(e,u+"[]",e.identifier._current.value)}):n._initFromJson(o,u,r)})}}},{key:"initFromJson",value:function(e){var t=this,r={};e&&(r=e.provision)&&t._initFromJson(r,"provision")}},{key:"withComplex",value:function(e,t,r){if(!t)return console.warn("Communication module identifier not defined. This value wil be ignored"),this;if(1!==this.getAllowedDatastreams().filter(function(t){return t.identifier===e}).length)return console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this;this._entity[e]||(this._entity[e]=[]);for(var n=!1,i=0;i<this._entity[e].length;i++){var o=this._entity[e][i];o._index&&o._index.value&&o._index.value===t&&(this._entity[e][i]={_index:{value:t},_value:{_current:{value:r}}},n=!0)}return n||this._entity[e].push({_index:{value:t},_value:{_current:{value:r}}}),this}}]),t}(s.default);r.default=c,t.exports=r.default},{"./SimpleBuilder":235}],230:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./BulkBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i,a,u){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(u?"async":i.toLowerCase()),"text/plain",a),u&&this._setUrlParameters({type:i.toUpperCase()})}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./BulkBuilder":228}],231:[function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}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)}function o(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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.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=e("./ComplexBuilder"),c=n(s),l=e("./SubscriberBuilder"),f=e("./SubscriptionBuilder"),d=e("http-status-codes"),h=n(d),p=e("q"),m=n(p),y=e("jsonpath"),v=n(y),g=function(){function e(t,r,n,i,a,u){o(this,e);var s=this,c={},d={};this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._timeout=u||null,this._deviceKeys=Object.keys(r).filter(function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")}),this._subscriberKeys=Object.keys(r).filter(function(e){return-1!==e.indexOf("subscriber")}),this._subscriptionKeys=Object.keys(r).filter(function(e){return-1!==e.indexOf("subscription")}),this._administrationKeys=Object.keys(r).filter(function(e){return-1!==e.indexOf("provision.administration")}),this._wrappers=[],this._urlParameters=a,this._subscriberKeys.forEach(function(e){s._obj[e].forEach(function(t){c[t._index.value]||(c[t._index.value]={}),c[t._index.value][e]={_value:t._value}})}),this._subscriptionKeys.forEach(function(e){s._obj[e].forEach(function(t){d[t._index.value]||(d[t._index.value]={}),d[t._index.value][e]={_value:t._value}})}),Object.keys(d).forEach(function(e){var t=d[e];s._administrationKeys.forEach(function(e){t[e]=s._obj[e]}),s._wrappers.push(new _(s._ogapi,t,s._url.replace("devices","subscriptions").replace("/"+s._key._value._current.value,""),t[f.SubscriptionID]._value._current.value))}),Object.keys(c).forEach(function(e){var t=c[e];s._administrationKeys.forEach(function(e){t[e]=s._obj[e]}),s._wrappers.push(new _(s._ogapi,t,s._url.replace("devices","subscribers").replace("/"+s._key._value._current.value,""),t[l.SubscriberID]._value._current.value))})}return u(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key._value._current.value}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"create",value:function(){var e=this,t=m.default.defer(),r={},n=this._obj,i=[],o=this;return Object.keys(n).filter(function(e){return-1===e.indexOf("subscriber")&&-1===e.indexOf("subscription")}).forEach(function(e){r[e]=n[e]}),this._wrappers.forEach(function(e){i.push({wrapper:e,promise:e.execute(t,10)})}),m.default.allSettled(i.reduce(function(e,t){return e.push(t.promise),e},[])).then(function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:20}),t.notify({entity:o._key._value._current.value,message:"OGAPI_CREATING_DEVICE",type:"success",percentage:25}),o._ogapi.Napi.post(o._url,r,null,null,{flattened:!0}).then(function(r){if(o._wrappers.length>0)return t.notify({message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:55}),e._setUrlParameters({flattened:!0}),o._ogapi.Napi.put(o._urlWithKey(),n,e._timeout,null,e._getUrlParameters()).then(function(e){e.statusCode===h.default.OK?("function"==typeof o._onCreated&&o._onCreated(e.header.location),t.notify({entity:o._key._value._current.value,message:"OGAPI_DEVICE_CREATED ",type:"success",percentage:75}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})});r.statusCode===h.default.CREATED?("function"==typeof o._onCreated&&o._onCreated(r.header.location),t.notify({
30
+ entity:o._key._value._current.value,message:"OGAPI_DEVICE_CREATED",type:"success",percentage:75}),t.resolve({location:r.header.location,statusCode:r.statusCode})):t.reject({errors:r.errors,statusCode:r.statusCode})}).catch(function(e){if(e.statusCode===h.default.BAD_REQUEST){v.default.query(e,"$..message")[0].includes("Entity duplicated"),t.reject({errors:e.data.errors,statusCode:e.statusCode})}else t.reject({errors:e.data,statusCode:e.statusCode})})}).catch(function(e){e.data.errors.forEach(function(e){var r=e.description;e.label&&(r+=":"+e.label),t.notify({message:"Error: "+r,type:"error",percentage:80})});var r=[o.delete(t,90)];i.forEach(function(e){r.push(e.wrapper.delete(t,90))}),m.default.allSettled(r).then(function(){t.reject(e)}).catch(function(){t.reject(e)})}),t.promise}},{key:"update",value:function(){var e=this,t=m.default.defer(),r=this._obj,n=[],i=this;return this._wrappers.forEach(function(e){n.push({wrapper:e,promise:e.execute(t,20)})}),m.default.allSettled(n.reduce(function(e,t){return e.push(t.promise),e},[])).then(function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.put(i._url,r,e._timeout,null,e._getUrlParameters()).then(function(e){e.statusCode===h.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})})}).catch(function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)}),t.promise}},{key:"patch",value:function(){var e=this,t=m.default.defer(),r=this._obj,n=[],i=this;return this._wrappers.forEach(function(e){n.push({wrapper:e,promise:e.execute(t,20)})}),m.default.allSettled(n.reduce(function(e,t){return e.push(t.promise),e},[])).then(function(){return t.notify({message:"OGAPI_201_ENTITIES_CREATED",type:"success",percentage:40}),t.notify({entity:i._key._value._current.value,message:"OGAPI_ADDING_RELATED_ENTITIES",type:"success",percentage:45}),e._setUrlParameters({flattened:!0}),i._ogapi.Napi.patch(i._url,r,e._timeout,null,e._getUrlParameters()).then(function(e){e.statusCode===h.default.OK?("function"==typeof i._onCreated&&i._onCreated(e.header.location),t.notify({entity:i._key._value._current.value,message:"OGAPI_DEVICE_UPDATED",type:"success",percentage:90}),t.resolve({location:e.header.location,statusCode:e.statusCode})):t.reject({errors:e.errors,statusCode:e.statusCode})})}).catch(function(e){t.notify("OGAPI_SOMETHING_WRONG_UPDATING_DEVICE"),t.reject(e)}),t.promise}},{key:"delete",value:function(e,t){var r=this;return this._ogapi.Napi.delete(this._urlWithKey()).then(function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})})}}]),e}(),_=function(){function e(t,r,n,i){o(this,e),this._obj=r,this._url=n,this._ogapi=t,this._key=i,this._created=!1}return u(e,[{key:"_urlWithKey",value:function(){return this._url+"/"+this._key}},{key:"_checkExists",value:function(){return this._ogapi.Napi.get(this._urlWithKey()).then(function(e){return e.statusCode===h.default.OK}).catch(function(e){return console.warn(e),!1})}},{key:"execute",value:function(e,t){function r(e,t,r){i._ogapi.Napi.post(i._url,i._obj,null,null,{flattened:!0}).then(function(n){i._created=!0,e.notify({entity:i._key,message:"OGAPI_ENTITY_CREATED",type:"success",percentage:r}),t.resolve({message:"OGAPI_ENTITY_CREATED",entity:i._key})}).catch(function(n){console.error(n),e.notify({entity:i._key,message:"OGAPI_ENTITY_CREATED",type:"warning",percentage:r}),t.reject({entity:i._key,message:"OGAPI_SOMETHING_WRONG_CREATING"})})}var n=m.default.defer(),i=this;return this._checkExists().then(function(o){o?n.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:i._key}):r(e,n,t)}).catch(function(o){o?n.resolve({message:"OGAPI_ENTITY_ALREADY_CREATED",entity:i._key}):r(e,n,t)}),n.promise}},{key:"delete",value:function(e,t){var r=this;return this._created?this._ogapi.Napi.delete(this._urlWithKey()).then(function(n){e.notify({entity:r._key,message:"OGAPI_ENTITY_DELETED",type:"warning",percentage:t})}):Q.fcall(function(){})}}]),e}(),b=function(e){function t(e,r,n,i,u,s){o(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/devices",n,i,u,s),this._organization=r}return i(t,e),u(t,[{key:"create",value:function(){return this._checkRequiredParameters(),new g(this._ogapi,this._composeElement(),this._resource,this._getEntityKey(),this._getUrlParameters(),this._timeout).create()}},{key:"update",value:function(){return new g(this._ogapi,this._composeElement(),this._buildURL(),this._getEntityKey(),this._getUrlParameters(),this._timeout).update()}},{key:"_getEntityKey",value:function(){return this._entity["provision.device.identifier"]}}]),t}(c.default);r.default=b,t.exports=r.default},{"./ComplexBuilder":229,"./SubscriberBuilder":236,"./SubscriptionBuilder":237,"http-status-codes":68,jsonpath:95,q:109}],232:[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 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}}(),a=e("q"),u=n(a),s=e("jsonpath"),c=n(s),l=e("ajv"),f=n(l),d=e("./AssetBuilder"),h=n(d),p=e("./DeviceBuilder"),m=n(p),y=e("./TicketBuilder"),v=n(y),g=e("./SubscriberBuilder"),_=n(g),b=e("./SubscriptionBuilder"),E=n(b),w=e("./CsvBulkBuilder"),A=n(w),S=e("./JsonFlattenedBulkBuilder"),O=n(S),P=e("./JsonBulkBuilder"),D=n(P),C=new f.default,k=["entities","tickets"],T=function(){function e(t){i(this,e);this._ogapi=t}return o(e,[{key:"_loadAllowedDatastreams",value:function(e,t,r){var n=this,i=u.default.defer(),o=i.promise,a=n._ogapi.newFilterBuilder();return a.and({like:{"datamodels.categories.datastreams.identifier":"provision"}}).and({eq:{"datamodels.organizationName":t}}).and({eq:{"datamodels.allowedResourceTypes":r}}),this._ogapi.datamodelsSearchBuilder().filter(a).build().execute().then(function(e){return n.schema={},e}).then(function(t){200!==t.statusCode&&i.reject({data:"OGAPI_DATASTREAM_NOT_FOUND",statusCode:204}),n._getJsonPathElements().then(function(){t.data=n._setDevicesProperties(t.data,e),i.resolve(t)}).catch(function(e){i.reject(e)})}).catch(function(e){i.reject(e)}),o}},{key:"_getJsonPathElements",value:function(){var e=u.default.defer(),t=e.promise;return this._ogapi.basicTypesSearchBuilder().withPath("$").build().execute().then(function(t){C.getSchema("/og_basic_types.json")&&C.removeSchema("/og_basic_types.json"),C.addSchema(t.data,"/og_basic_types.json"),e.resolve()}).catch(function(t){e.reject(t)}),t}},{key:"_setDevicesProperties",value:function(e,t){var r=this,n=c.default.query(e,"$.datamodels[*].categories[*].datastreams[?(@.calculated === false)]"),i={allowedDatastreams:[],schemas:{}};return r.complexFunctions=[],r.simpleFunctions=[],n.forEach(function(e,n){var o=e.identifier;if(o.startsWith("provision.administration")||o.startsWith(t))if(i.allowedDatastreams.push(e),o.includes("communicationModules")){var a=t.includes("subscriber")||t.includes("subscription");r.schema[o]={value:e.schema,complex:!a,function:a?"with":"withComplex"}}else r.schema[o]={value:e.schema,complex:!1,function:"with"}}),i.schemas=r.schema,i}},{key:"devicesBuilder",value:function(e,t){return this._genericBuilder(e,"entity.device","provision",function(r,n){return new m.default(this._ogapi,e,r,n,C,t)})}},{key:"assetsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.asset","provision",function(r,n){return new h.default(this._ogapi,e,r,n,C,t)})}},{key:"ticketsBuilder",value:function(e,t){return this._genericBuilder(e,"ticket","provision",function(r,n){return new v.default(this._ogapi,e,r,n,C,t)})}},{key:"subscribersBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscriber","provision.device.communicationModules[].subscriber",function(r,n){return new _.default(this._ogapi,e,r,n,C,t)})}},{key:"subscriptionsBuilder",value:function(e,t){return this._genericBuilder(e,"entity.subscription","provision",function(r,n){return new E.default(this._ogapi,e,r,n,C,t)})}},{key:"newCsvBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new A.default(this._ogapi,e,t,r,n)}},{key:"newJsonBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new D.default(this._ogapi,e,t,r,n)}},{key:"newJsonFlattenedBulkBuilder",value:function(e,t,r,n){return this._validateBulk(e,t),new O.default(this._ogapi,e,t,r,n)}},{key:"_validateBulk",value:function(e,t){if(!e)throw new Error("Parameters organization must be defined");if(!t||-1===k.indexOf(t))throw new Error("The parameters resources must be defined and must be some of these values: entities or tickets")}},{key:"_genericBuilder",value:function(e,t,r,n){var i=this,o=u.default.defer();if(!e)throw new Error("Parameters organization must be defined");return this._loadAllowedDatastreams(r,e,t).then(function(e){200===e.statusCode?o.resolve(n.call(i,e.data.allowedDatastreams,e.data.schemas)):o.reject("OGAPI_DATASTREAM_NOT_FOUND")}).catch(function(e){o.reject(e)}),o.promise}}]),e}();r.default=T,t.exports=r.default},{"./AssetBuilder":227,"./CsvBulkBuilder":230,"./DeviceBuilder":231,"./JsonBulkBuilder":233,"./JsonFlattenedBulkBuilder":234,"./SubscriberBuilder":236,"./SubscriptionBuilder":237,"./TicketBuilder":238,ajv:2,jsonpath:95,q:109}],233:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./BulkBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i,a,u){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(u?"async":i.toLowerCase()),"application/json",a),u&&this._setUrlParameters({type:i.toUpperCase()})}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./BulkBuilder":228}],234:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("./BulkBuilder"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i,a,u){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provision/organizations/"+r+"/bulk/"+(u?"async":i.toLowerCase()),"application/json",a),this._setUrlParameters({flattened:!0}),u&&this._setUrlParameters({flattened:!0,type:i.toUpperCase()})}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"./BulkBuilder":228}],235:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("http-status-codes"),c=n(s),l=e("../BaseProvision"),f=n(l),d=e("q"),h=n(d),p=function(e){function t(e,r,n,o,a,s){if(i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/"+r,s),"function"!=typeof this._getEntityKey)throw new Error("Must override method: _getEntityKey");this._setUrlParameters({flattened:!0}),this._entity={},this._allowedDatastreams=n,this._definedSchemas=o,this._jsonSchemaValidator=a}return o(t,e),a(t,[{key:"_buildURL",value:function(){return this._resource+"/"+this.getEntityKey()}},{key:"_validate",value:function(){var e=this,t=[];if(Object.keys(this._entity).forEach(function(r){"resourceType"!=r&&function(){if(!e._definedSchemas[r])throw new Error("Datastream is not allowed: "+r);var n=e._definedSchemas[r].value;if(e._entity[r].constructor===Array)e._entity[r].forEach(function(i){var o=i._value._current.value;e._jsonSchemaValidator.validate("/og_basic_types.json",o)||t.push(r+" ["+o+"] value is not allowed. The value should be formatted as follows: "+JSON.stringify(n))});else{var i=e._entity[r]._value._current.value;e._jsonSchemaValidator.validate("/og_basic_types.json",i)||t.push(r+" ["+i+"] value is not allowed. The value should be formatted as follows: "+JSON.stringify(n))}}()}),t.length>0)throw new Error(JSON.stringify(t).replace(new RegExp('"',"g"),""))}},{key:"_composeElement",value:function(){return this._validate(),this._entity}},{key:"getEntityKey",value:function(){return null!==this._getEntityKey()?this._getEntityKey()._value._current.value:null}},{key:"with",value:function(e,t){return void 0===t||0===t.length?(delete this._entity[e],this):1!==this.getAllowedDatastreams().filter(function(t){return t.identifier===e}).length?(console.warn("Datastream not found or operations can not be performed on it. This value will be ignored. Datastream Name: "+e),this):(this._entity[e]={_value:{_current:{value:t}}},this)}},{key:"getAllowedDatastreams",value:function(){return this._allowedDatastreams}},{key:"initFromFlattened",value:function(e){var t=this;e&&Object.keys(e).length>0&&Object.keys(e).forEach(function(r){if(r.toLowerCase().startsWith("provision")){var n=e[r];Array.isArray(n)&&(n=n[0]),t.with(r,n._value._current.value)}})}},{key:"_initFromJson",value:function(e,t){var r=this;if(e){Object.keys(e).forEach(function(n){var i=e[n],o=i._current,a=t?t+"."+n:n;o?r.with(a,o.value):Array.isArray(i)?r._initFromJson(i[0],a+"[]"):r._initFromJson(i,a)})}}},{key:"initFromJson",value:function(e){var t=this,r={};e&&(r=e.provision)&&t._initFromJson(r,"provision")}},{key:"deleteAll",value:function(){var e=h.default.defer(),t=e.promise;return this._setUrlParameters({full:!0}),this._ogapi.Napi.delete(this._buildURL(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){t.statusCode===c.default.OK?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"update",value:function(){var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.put(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}},{key:"patch",value:function(){var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.patch(this._buildURL(),this._composeUpdateElement(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):200===t.status?e.resolve({statusCode:t.status}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(f.default);r.default=p,t.exports=r.default},{"../BaseProvision":225,"http-status-codes":68,q:109}],236:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.device.communicationModules[].subscriber.identifier";r.SubscriberID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscribers",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":235}],237:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.device.communicationModules[].subscription.identifier";r.SubscriptionID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/subscriptions",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":235}],238:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SimpleBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c="provision.ticket.identifier";r.TicketID=c;var l=function(e){function t(e,r,i,o,u,s){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r+"/tickets",i,o,u,s)}return i(t,e),o(t,[{key:"_getEntityKey",value:function(){return this._entity[c]}}]),t}(s.default);r.default=l},{"./SimpleBuilder":235}],239:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"organizations/",void 0,["name","organization","configurationParams","scriptProcessor"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return"provisionProcessors/provision/organizations/"+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkString(e,"name"),this._name=e,this}},{key:"withConfigurationParams",value:function(e){return f.default._checkObject(e,"configurationParams"),this._configurationParams=e,this}},{key:"withScriptProcessor",value:function(e){return f.default._checkObject(e,"scriptProcessor"),this._scriptProcessor=e,this}},{key:"_composeElement",value:function(){return this._resource="provisionProcessors/provision/organizations/"+this._organization,{name:this._name,configurationParams:this._configurationParams,scriptProcessor:this._scriptProcessor}}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":225,"../util/formats/check_types":328}],240:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"provisionProcessors/provision/organizations","provisionPrecessors")}return i(t,e),o(t,[{key:"findByOrganization",value:function(e){return this._withId(e),this._execute()}},{key:"findByOrganizationAndProvisionProcessorId",value:function(e,t){return this._withId(e+"/"+t),this._execute()}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],241:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./_RuleCondition"),f=(n(l),e("./_RuleNotification")),d=(n(f),e("q")),h=n(d),p=function(e){function t(e,r,n,o,a){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations"),this.withOrganization(r),this.withChannel(n),o&&this.withIdentifier(o),a&&(a.name&&this.withName(a.name),a.mode&&this.withMode(a.mode),a.type&&this.withType(a.type),a.description&&this.withDescription(a.description),null!==a.active&&void 0!==a.active&&this.withActive(a.active),null!==a.condition&&void 0!==a.condition&&this.withCondition(a.condition),a.actionsDelay&&this.withActionsDelay(a.actionsDelay),a.actions&&this.withActions(a.actions),a.parameters&&this.withParameters(a.parameters),a.javascript&&this.withJavascript(a.javascript))}return o(t,e),a(t,[{key:"withOrganization",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter organization must be a string, cannot be empty and has a maximum length of 50");return this._organization=e,this}},{key:"withChannel",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter channel must be a string, cannot be empty and has a maximum length of 50");return this._channel=e,this}},{key:"withIdentifier",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter identifier must be a string, cannot be empty and has a maximum length of 50");return this._identifier=e,this}},{key:"withName",value:function(e){if("string"!=typeof e||0===e.length||e.length>50)throw new Error("Parameter name must be a string, cannot be empty and has a maximum length of 50");return this._name=e,this}},{key:"withDescription",value:function(e){if("string"!=typeof e||e.length>250)throw new Error({message:"OGAPI_STRING_PARAMETER_MAX_LENGTH_250",parameter:"description"});return this._description=e,this}},{key:"withJavascript",value:function(e){if("string"!=typeof e)throw new Error("Parameter name must be a string and cannot be empty");return this._javascript=e,this}},{key:"withMode",value:function(e){return this._mode=e,this}},{key:"withType",value:function(e){return this._type=e,this}},{key:"withActive",value:function(e){if("boolean"!=typeof e)throw new Error("Parameter active must be true or false");return this._active=e,this}},{key:"withActionsDelay",value:function(e){if("number"!=typeof e)throw new Error("Parameter actionsDelay must be a number");return this._actionsDelay=e,this}},{key:"withCondition",value:function(e){return this._condition=e||{},this}},{key:"withActions",value:function(e){return this._actions=e||{},this}},{key:"withParameters",value:function(e){return this._parameters=e||[],this}},{key:"_composeElement",value:function(){return{identifier:this._identifier,name:this._name,active:this._active,mode:this._mode,type:this._type,severity:this._severity,description:this._description?this._description:void 0,parameters:this._parameters,condition:"EASY"===this._mode?this._condition:void 0,actionsDelay:this._actionsDelay,actions:"EASY"===this._mode?this._actions:void 0,javascript:"ADVANCED"===this._mode?this._javascript:void 0}}},{key:"_checkRequiredParameters",value:function(e){if(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and identifier must be defined")}else if(void 0===this._name||void 0===this._organization||void 0===this._channel||void 0===this._active||void 0===this._mode)throw new Error("Parameters organization, channel, active, mode and name must be defined")}},{key:"_buildURL",value:function(){return"rules/"+this._resource+"/"+this._organization+"/channels/"+this._channel+"/"}},{key:"create",value:function(){return this._checkRequiredParameters(),this._doNorthPost(this._buildURL(),this._composeElement())}},{key:"update",value:function(){return this._checkRequiredParameters(!0),this._doNorthPut(this._buildURL()+this._identifier,this._composeElement())}},{key:"updateParameters",value:function(e){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and identifier must be defined");return this._doNorthPut(this._buildURL()+this._identifier+"/parameters",e||this._parameters||[])}},{key:"delete",value:function(){if(void 0===this._identifier||void 0===this._organization||void 0===this._channel)throw new Error("Parameters organization, channel and name must be defined");var e=h.default.defer(),t=e.promise;return this._ogapi.Napi.delete(this._buildURL()+this._identifier).then(function(t){200===t.statusCode?e.resolve({statusCode:t.statusCode}):e.reject({errors:t.errors,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../provision/BaseProvision":225,"./_RuleCondition":245,"./_RuleNotification":246,q:109}],242:[function(e,t,r){"use strict";function n(e,t){
31
+ 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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/catalog","rulesTemplate","Rule templates not found")}return i(t,e),o(t,[{key:"getTemplates",value:function(){return this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],243:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules/provision/organizations","rules","Rule configurations not found")}return i(t,e),o(t,[{key:"findByOrganizationAndChannelAndName",value:function(e,t,r){var n=this;return n._organization=e,n._channel=t,n._name=r,this._execute()}},{key:"_composeUrl",value:function(){return this._baseUrl+"/"+this._organization+"/channels/"+this._channel+"/"+this._name}}]),t}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],244:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../GenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"rules"),this._jsHeaders={accept:"application/javascript"},this._mdHeaders={accept:"text/markdown"}}return o(t,e),a(t,[{key:"getdDummyFunctions",value:function(){return this._setExtraHeaders(this._jsHeaders),this._id="js/dummyFunctions",this._execute()}},{key:"getDocPrivateJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/private/javascriptFunctions",this._execute()}},{key:"getDocJavascriptFunctions",value:function(){return this._setExtraHeaders(this._mdHeaders),this._id="doc/javascriptFunctions",this._execute()}},{key:"_execute",value:function(){var e=f.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:h.default.NOT_FOUND}):e.resolve({data:t,statusCode:t.statusCode})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=p,t.exports=r.default},{"../GenericFinder":136,"http-status-codes":68,q:109}],245:[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}}(),o=e("./RuleConfigurations"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),t.constructor!==a.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._condition=r}return i(e,[{key:"setDelay",value:function(e){if("number"!=typeof e||typeof e<1)throw new Error("Parameter delay must be typeof number and higher than -1");return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=1e3*e,this}},{key:"deactivateDelay",value:function(){return void 0===this._condition.delay?console.warn("Parameter delay cannot be setted for this condition"):this._condition.delay=-1,this}},{key:"setParameterValue",value:function(e,t){var r=this;if(this._condition.parameters&&this._condition.parameters.length>0){for(var n in this._condition.parameters){var i=this._condition.parameters[n];if(i.name===e){if(void 0===i.value)throw new Error("Value not allowed for parameter "+e+" in condition "+this._condition.name);return i.value=t||"",r}}throw new Error("Parameter "+e+" not exists for condition "+this._condition.name)}}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=u,t.exports=r.default},{"./RuleConfigurations":241}],246:[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}}(),o=e("./RuleConfigurations"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r){if(n(this,e),t.constructor!==a.default)throw new Error("Parent must be a RuleConfigurations");this._ruleConfiguration=t,this._notification=r}return i(e,[{key:"setEnabled",value:function(e){if("boolean"!=typeof e)throw new Error("Bearer enabled must be true or false");return this._notification.enabled=e,this}},{key:"setBearerRecipients",value:function(e,t){var r=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var n in this._notification.bearers){var i=this._notification.bearers[n];if(i.name===e)return i.recipients=t,r}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return r}},{key:"enableBearer",value:function(e){var t=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.enabled=!0,t}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return t}},{key:"disableBearer",value:function(e){var t=this;if(this._notification.bearers&&this._notification.bearers.length>0){for(var r in this._notification.bearers){var n=this._notification.bearers[r];if(n.name===e)return n.enabled=!1,t}console.warn("Bearer "+e+" not exists for notification "+this._notification.name)}else console.warn("There is no bearers for notification "+this._notification.name);return t}},{key:"parent",value:function(){return this._ruleConfiguration}}]),e}();r.default=u,t.exports=r.default},{"./RuleConfigurations":241}],247:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var r=t.body,n=t.statusCode;200===n&&(r.assets=r.entities,delete r.entities),e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":252,q:109}],248:[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 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}}(),a=e("q"),u=n(a),s=e("merge"),c=(n(s),function(){function e(t,r,n){if(i(this,e),this.constructor===e)throw new Error("Cannot construct Abstract instances directly");if("function"!=typeof this._filter)throw new Error("Must override method: filter");this._timeout="number"!=typeof n?t.Napi._options.timeout:n,this._ogapi=t,this._resource=r,this._headers=void 0,this._urlParameters=void 0}return o(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this._urlParameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=u.default.defer(),t=e.promise;return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){var r=t.body,n=t.statusCode;e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}},{key:"downloadCsv",value:function(){var e=u.default.defer(),t=e.promise,r=this._filter();return r&&r.limit&&delete r.limit,this._setExtraHeaders({Accept:"text/plain"}),this._ogapi.Napi.post(this._resource,r,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(t){var r=t,n=t.statusCode;e.resolve({data:r,statusCode:n})}).catch(function(t){e.reject(t)}),t}},{key:"_asyncPagingFilter",value:function(){var e=this._filter();return e.limit&&e.limit.size?e.limit.start=1:e.limit={size:1e3,start:1},e}},{key:"cancelAsyncPaging",value:function(e){"string"==typeof e&&e.length>0?this.cancel=e:this.cancel=!0}},{key:"_loadData",value:function(e){function t(){if(r.cancel||"string"==typeof r.cancel){var a="string"==typeof r.cancel?r.cancel:"Cancel process";n.reject({data:a,statusCode:403})}else r._ogapi.Napi.post(r._resource,i,r._timeout,r._getExtraHeaders(),r._getUrlParameters()).then(function(r){var a=r.statusCode,u=r.body;if(!u&&r.text)try{var s=JSON.parse(r.text);s&&(u=s)}catch(e){console.error("Impossible to parse text from response")}if(200===a||200===a){o=!0;var c=u.data?u.data[e]:u[e];n.notify(c),c.length===i.limit.size?(i.limit.start+=1,t()):n.resolve({data:"DONE",statusCode:200})}else o?n.resolve({data:"DONE",statusCode:200}):n.reject({data:u,statusCode:a})}).catch(function(e){n.reject(e)})}var r=this,n=u.default.defer(),i=r._asyncPagingFilter(),o=!1;return t(),n.promise}},{key:"executeWithAsyncPaging",value:function(e){var t=u.default.defer(),r=t.promise;return this._loadData(e).then(function(e){t.resolve(e)},null,function(e){t.notify(e)}).catch(function(e){t.reject(e)}),r}}]),e}());r.default=c,t.exports=r.default},{merge:104,q:109}],249:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities){if(n.devices=n.entities,n.devices.length>0){var o=!1,a=r&&r.flattened||!1;for(o=0;o<n.devices.length;o++)if(a){if(n.devices[o]["device.identifier"]){var u=n.devices[o]["device.identifier"];(!u._value||u._value&&!u._value._current)&&delete n.devices[o]["device.identifier"]}}else n.devices[o].device&&n.devices[o].device.identifier&&!n.devices[o].device.identifier._current&&delete n.devices[o].device.identifier}delete n.entities}e.resolve({data:n,statusCode:i})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":252,q:109}],250:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,f){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n,o,a,s,c,l,f)}return o(t,e),a(t,[{key:"execute",value:function(){var e=f.default.defer(),t=e.promise,r=this._getUrlParameters();return this._ogapi.Napi.post(this._resource,this._filter(),this._timeout,this._getExtraHeaders(),r).then(function(t){var n=t.body,i=t.statusCode;if(200===i&&n.entities&&n.entities.length>0){var o=!1,a=r&&r.flattened||!1;for(o=0;o<n.entities.length;o++)if(a){if(n.entities[o]["device.identifier"]){var u=n.entities[o]["device.identifier"];(!u._value||u._value&&!u._value._current)&&delete n.entities[o]["device.identifier"]}}else n.entities[o].device&&n.entities[o].device.identifier&&!n.entities[o].device.identifier._current&&delete n.entities[o].device.identifier}e.resolve({data:n,statusCode:i})}).catch(function(t){e.reject(t)}),t}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":252,q:109}],251:[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}}(),o=e("./../util/Expression"),a=(function(e){e&&e.__esModule}(o),function(){function e(){n(this,e),this._filterTemplate={filter:{}}}return i(e,[{key:"or",value:function(){void 0===this._filterTemplate.filter.or&&(this._filterTemplate.filter.or=[]),void 0!==this._filterTemplate.filter.and&&(console.warn('The filter not allow both elements [and,or], the item "and" are going to be removed.'),delete this._filterTemplate.filter.and);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.or.push(t[n]);return this}},{key:"and",value:function(){void 0===this._filterTemplate.filter.and&&(this._filterTemplate.filter.and=[]),void 0!==this._filterTemplate.filter.or&&(console.warn('The filter not allow both elements [and,or], the item "or" are going to be removed.'),delete this._filterTemplate.filter.or);for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++)this._filterTemplate.filter.and.push(t[n]);return this}}]),e}());r.default=a,t.exports=r.default},{"./../util/Expression":324}],252:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./BaseSearch"),c=n(s),l=e("merge"),f=n(l),d=function(e){function t(e,r,n,o,a,s,c,l,d){void 0===o&&(o={limit:{}}),i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"search"+r,l),this._setUrlParameters(d),this._postObj=(0,f.default)(n,o,s,c),"object"==typeof a&&(this._postObj=(0,f.default)(this._postObj,a))}return o(t,e),a(t,[{key:"_filter",value:function(){return this._postObj}}]),t}(c.default);r.default=d,t.exports=r.default},{"./BaseSearch":248,merge:104}],253:[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}}(),o=e("./../util/SelectElement"),a=(function(e){e&&e.__esModule}(o),function(){function e(){n(this,e),this._selectTemplate={select:[]}}return i(e,[{key:"add",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n],o=this._selectTemplate.select;if(0===o.length)this._selectTemplate.select.push(i);else{for(var a=!1,u=0;u<o.length;u++){var s=o[u];if(s.name===i.name){a=!0;for(var c=i.fields,l=0;l<c.length;l++){for(var f=c[n],d=!1,h=0;h<s.fields.length;h++)s.fields[h].field===f.field&&(d=!0,f.alias&&(s.fields[h].alias=f.alias));d||this._selectTemplate.select[u].fields.push(f)}}}a||this._selectTemplate.select.push(i)}}return this}}]),e}());r.default=a,t.exports=r.default},{"./../util/SelectElement":326}],254:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./Search"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e,r,n,o,a,s){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/catalog"+r,n,null,null,o),this._contentType=a,this._customFilters=s}return o(t,e),a(t,[{key:"execute",value:function(){var e=this,t=[],r=f.default.defer(),n=r.promise,i=e._content(e._contentType),o=e._customFilters&&e._customFilters.entityType,a=Object.keys(e._customFilters).length,u=a>1||1===a&&!o,s={};switch(o?s[o]=i[o]:s=i,e._contentType){case"operationalStatus":for(var c in s)s[c].forEach(function(r){(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===r)&&t.push({entityType:c,id:r})});break;case"administrativeState":var l=function(e){var r=e;r.entityType=d,t.push(r)};for(var d in s){var h=s[d];for(var p in h)if(u){for(var m in e._customFilters)if(h[p][m]===e._customFilters[m]){l(h[p]);break}}else l(h[p])}break;case"fieldsDefinition":case"communicationsModuleType":var y=u&&e._customFilters.type;if(void 0===y){r.resolve({error:"Filters not allowed",statusCode:400});break}var v=y?s[y]:s;t=v;break;case"userProfile":for(var g in s)(!e._customFilters.id||e._customFilters.id&&e._customFilters.id===g)&&s[g].length>0&&t.push({id:g,managed:s[g]});break;case"serviceGroups":o&&(t=s[o]);break;case"allowedResourceType":for(var _ in s)(!e._customFilters.type||e._customFilters.type&&s[_].types.indexOf(e._customFilters.type)>-1)&&t.push(s[_].resourceType);break;case"ticketSeverity":case"ticketPriority":case"ticketStatus":case"ruleConfigurationSeverity":case"ruleMode":case"ruleType":case"ioTDatastreamPeriod":case"ioTDatastreamAccess":case"resourceType":case"countryCodes":case"timezones":case"userLanguages":case"ioTDatastreamStoragePeriod":if(y){r.resolve({error:"Filters not supported",statuscode:400});break}t=t.concat(s);break;default:r.resolve({data:{},statusCode:400})}if(t&&Object.keys(t).length>0){var b={};b[e._contentType]=t,r.resolve({data:b,statusCode:200})}else r.resolve({data:{},statusCode:204});return n}},{key:"_content",value:function(e){return{ticketSeverity:["CRITICAL","URGENT","WARNING","NORMAL"],ticketPriority:["MAJOR","MINOR","CRITICAL","BLOCKER"],ticketStatus:["CREATED","ASSIGNED","ANSWERED","RESTORED","RESOLVED","CLOSED"],serviceGroups:{ASSET:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"],SUBSCRIBER:["emptyServiceGroup"],SUBSCRIPTION:["emptyServiceGroup"],GATEWAY:["noUpdate","emptyServiceGroup","emptyServiceGroup_onSession","emptyServiceGroup_onDemand","level1SecurityServiceGroup","level2SecurityServiceGroup","level3SecurityServiceGroup","trustedNoneSecurityServiceGroup","trustedNoneSecurityServiceGroup_onDemand","trustedLevel1SecurityServiceGroup","trustedLevel2SecurityServiceGroup","trustedLevel3SecurityServiceGroup"]},administrativeState:{ASSET:[{id:"BANNED",description:"Asset banned, It means that received information of this asset is not going to be collected"},{id:"DELETED",description:"Asset removed from available stock"},{id:"IN_MAINTENANCE",description:"Asset in maintenance"},{id:"IN_STOCK",description:"Asset in stock"},{id:"IN_TRANSIT",description:"Asset in transit"},{id:"IN_USE",description:"Asset in use"},{id:"MISSING",description:"Asset missing"},{id:"ORDERED",description:"Asset ordered"},{id:"READY",description:"Asset ready for installation"},{id:"RETIRED",description:"Field entity withdrawal"}],GATEWAY:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],COMMUNICATIONS_MODULE:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIBER:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],SUBSCRIPTION:[{id:"REQUESTED",description:"Entity requested to the supplier"},{id:"READY",description:"Entity ready for installation"},{id:"REPAIR",description:"Entity under repair"},{id:"TESTING",description:"Entity in tests"},{id:"ACTIVE",description:"Field deployed entity"},{id:"SUSPENDED",description:"Suspended its operation"},{id:"DELETED",description:"Entity removed from available stock"},{id:"RETIRED",description:"Field entity withdrawal"},{id:"BANNED",description:"Entity banned, It means that received information of this entity is not going to be collected"}],CERTIFICATE:[{id:"NOT_ACTIVE",description:"NOT_ACTIVE"},{id:"ACTIVE",description:"ACTIVE"},{id:"REVOKED",description:"REVOKED"},{id:"EXPIRED",description:"EXPIRED"}]},operationalStatus:{ASSET:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],GATEWAY:["UNKNOWN","NORMAL","ALARM","DOWN","SAFE_MODE","TAMPER","TEST"],COMMUNICATIONS_MODULE:["UNKNOWN","STOPPED","STARTING","RUNNING","STOPPING","ERROR"]},communicationsModuleType:{ADSL:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","ADDRESS","HOME_OPERATOR","LOCATION"]}},CAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},ETH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","ADDRESS"]}},GENERIC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC","SERIAL_NUMBER"]}},GSM:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC"]}},HAN:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},I2C:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},LOWPAN:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState"]}},LTE_M:{
32
+ COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC"]}},MESH:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]}},MOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC"]}},MULTIMOBILE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:[],optional:["generatedEntityKey","administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","MSISDN","LOCATION","RADIUS_USERNAME","RADIUS_PASSWORD","RADIUS_FRAMED_IP_NETMASK","MSISDN_VOICE","SUBSCRIPTION_ICC"]},SUBSCRIBER:{mandatory:[],optional:["generatedEntityKey","administrativeState","ICC"]}},NARROWBAND:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["IMEI","HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState","IMSI","ADDRESS","HOME_OPERATOR","REGISTER_OPERATOR","LOCATION"]},SUBSCRIBER:{mandatory:["generatedEntityKey"],optional:["administrativeState","ICC"]}},PLC:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState"]}},RS232:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS422:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},RS485:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:[]}},SIGFOX:{COMMUNICATIONS_MODULE:{mandatory:["entityKey"],optional:["PAC"]},SUBSCRIPTION:{mandatory:["generatedEntityKey","HOME_OPERATOR","administrativeState","SIGFOX_DEVICE_TYPE"]}},ZIGBEE:{COMMUNICATIONS_MODULE:{mandatory:["generatedEntityKey"],optional:["HARDWARE","SOFTWARE"]},SUBSCRIPTION:{mandatory:["generatedEntityKey"],optional:["administrativeState"]}}},ruleMode:["EASY","ADVANCED"],ruleType:["DATASTREAM","OPERATION","EVENT"],ruleConfigurationSeverity:["INFORMATIVE","URGENT","CRITICAL"],userProfile:{root:["admin_domain","admin","advanced","viewer"],admin_domain:["admin_domain","admin","advanced","viewer"],admin:["admin","advanced","viewer"],advanced:[],viewer:[]},ioTDatastreamAccess:["READ","WRITE"],ioTDatastreamStoragePeriod:["SECONDS","MINUTES","HOURS","DAYS","MONTHS","YEARS","NEVER"],ioTDatastreamPeriod:["PULSE","CUMULATIVE","INSTANT"],resourceType:[{identifier:"entity.asset"},{identifier:"entity.device"},{identifier:"ticket"}],allowedResourceType:[{resourceType:"entity.asset",types:["entity","asset"]},{resourceType:"entity.device",types:["entity","device"]},{resourceType:"entity.subscriber",types:["entity","subscriber"]},{resourceType:"entity.subscription",types:["entity","subscription"]},{resourceType:"ticket",types:["ticket"]},{resourceType:"organization",types:["organization"]},{resourceType:"channel",types:["channel"]}],fieldsDefinition:{string:{description:"Text based value",subtype:["text","password"]},boolean:{description:"Boolean based value",subtype:[]},calendar:{description:"Format is described in the ISO 8601 or in http://www.w3.org/TR/NOTE-datetime",subtype:["datetime","date","time"]},address:{description:"Network address value",subtype:["ip","ipv4","ipv6","mac48"]},number:{description:"Numeric value",subtype:["integer","float","percentage"]},enumeration:{description:"Choice list values",subtype:["string","number"]},array:{description:"Array of values",subtype:["string","number"]},coordinates:{description:"Object indicating coordinates and timestamp in geotime subtype",subtype:["geo","geotime","geojson"]},topology:{description:"Object indicating relations",subtype:["path","tree (not supported yet)"]},object:{description:"Not yet supported. For future uses only",subtype:[]}},userLanguages:[{code:"es",language:"Español/Spanish"},{code:"en",language:"Inglés/English"}],countryCodes:[{code:"AD",country:"Andorra",zone:"Europe/Andorra"},{code:"AE",country:"United Arab Emirates",zone:"Asia/Dubai"},{code:"AF",country:"Afghanistan",zone:"Asia/Kabul"},{code:"AG",country:"Antigua and Barbuda",zone:"America/Antigua"},{code:"AI",country:"Anguilla",zone:"America/Anguilla"},{code:"AL",country:"Albania",zone:"Europe/Tirane"},{code:"AM",country:"Armenia",zone:"Asia/Yerevan"},{code:"AN",country:"Netherlands Antilles",zone:"Netherlands Antilles"},{code:"AO",country:"Angola",zone:"Africa/Luanda"},{code:"AQ",country:"Antarctica",zone:"Antarctica/McMurdo"},{code:"AR",country:"Argentina",zone:"America/Argentina/Buenos_Aires"},{code:"AS",country:"American Samoa",zone:"Pacific/Pago_Pago"},{code:"AT",country:"Austria",zone:"Europe/Vienna"},{code:"AU",country:"Australia",zone:"Australia/Lord_Howe"},{code:"AW",country:"Aruba",zone:"America/Aruba"},{code:"AX",country:"Aland Islands",zone:"Europe/Mariehamn"},{code:"AZ",country:"Azerbaijan",zone:"Asia/Baku"},{code:"BA",country:"Bosnia and Herzegovina",zone:"Europe/Sarajevo"},{code:"BB",country:"Barbados",zone:"America/Barbados"},{code:"BD",country:"Bangladesh",zone:"Asia/Dhaka"},{code:"BE",country:"Belgium",zone:"Europe/Brussels"},{code:"BF",country:"Burkina Faso",zone:"Africa/Ouagadougou"},{code:"BG",country:"Bulgaria",zone:"Europe/Sofia"},{code:"BH",country:"Bahrain",zone:"Asia/Bahrain"},{code:"BI",country:"Burundi",zone:"Africa/Bujumbura"},{code:"BJ",country:"Benin",zone:"Africa/Porto-Novo"},{code:"BL",country:"Saint Barthélemy",zone:"America/St_Barthelemy"},{code:"BM",country:"Bermuda",zone:"Atlantic/Bermuda"},{code:"BN",country:"Brunei",zone:"Asia/Brunei"},{code:"BO",country:"Bolivia",zone:"America/La_Paz"},{code:"BQ",country:"Bonaire, Saint Eustatius and Saba",zone:"America/Kralendijk"},{code:"BR",country:"Brazil",zone:"America/Noronha"},{code:"BS",country:"Bahamas",zone:"America/Nassau"},{code:"BT",country:"Bhutan",zone:"Asia/Thimphu"},{code:"BV",country:"Bouvet Island",zone:"Bouvet Island"},{code:"BW",country:"Botswana",zone:"Africa/Gaborone"},{code:"BY",country:"Belarus",zone:"Europe/Minsk"},{code:"BZ",country:"Belize",zone:"America/Belize"},{code:"CA",country:"Canada",zone:"America/St_Johns"},{code:"CC",country:"Cocos Islands",zone:"Indian/Cocos"},{code:"CD",country:"Democratic Republic of the Congo",zone:"Africa/Kinshasa"},{code:"CF",country:"Central African Republic",zone:"Africa/Bangui"},{code:"CG",country:"Republic of the Congo",zone:"Africa/Brazzaville"},{code:"CH",country:"Switzerland",zone:"Europe/Zurich"},{code:"CI",country:"Ivory Coast",zone:"Africa/Abidjan"},{code:"CK",country:"Cook Islands",zone:"Pacific/Rarotonga"},{code:"CL",country:"Chile",zone:"America/Santiago"},{code:"CM",country:"Cameroon",zone:"Africa/Douala"},{code:"CN",country:"China",zone:"Asia/Shanghai"},{code:"CO",country:"Colombia",zone:"America/Bogota"},{code:"CR",country:"Costa Rica",zone:"America/Costa_Rica"},{code:"CS",country:"Serbia and Montenegro",zone:"Serbia and Montenegro"},{code:"CU",country:"Cuba",zone:"America/Havana"},{code:"CV",country:"Cape Verde",zone:"Atlantic/Cape_Verde"},{code:"CW",country:"Curaçao",zone:"America/Curacao"},{code:"CX",country:"Christmas Island",zone:"Indian/Christmas"},{code:"CY",country:"Cyprus",zone:"Asia/Nicosia"},{code:"CZ",country:"Czech Republic",zone:"Europe/Prague"},{code:"DE",country:"Germany",zone:"Europe/Berlin"},{code:"DJ",country:"Djibouti",zone:"Africa/Djibouti"},{code:"DK",country:"Denmark",zone:"Europe/Copenhagen"},{code:"DM",country:"Dominica",zone:"America/Dominica"},{code:"DO",country:"Dominican Republic",zone:"America/Santo_Domingo"},{code:"DZ",country:"Algeria",zone:"Africa/Algiers"},{code:"EC",country:"Ecuador",zone:"America/Guayaquil"},{code:"EE",country:"Estonia",zone:"Europe/Tallinn"},{code:"EG",country:"Egypt",zone:"Africa/Cairo"},{code:"EH",country:"Western Sahara",zone:"Africa/El_Aaiun"},{code:"ER",country:"Eritrea",zone:"Africa/Asmara"},{code:"ES",country:"Spain",zone:"Europe/Madrid"},{code:"ET",country:"Ethiopia",zone:"Africa/Addis_Ababa"},{code:"FI",country:"Finland",zone:"Europe/Helsinki"},{code:"FJ",country:"Fiji",zone:"Pacific/Fiji"},{code:"FK",country:"Falkland Islands",zone:"Atlantic/Stanley"},{code:"FM",country:"Micronesia",zone:"Pacific/Chuuk"},{code:"FO",country:"Faroe Islands",zone:"Atlantic/Faroe"},{code:"FR",country:"France",zone:"Europe/Paris"},{code:"GA",country:"Gabon",zone:"Africa/Libreville"},{code:"GB",country:"United Kingdom",zone:"Europe/London"},{code:"GD",country:"Grenada",zone:"America/Grenada"},{code:"GE",country:"Georgia",zone:"Asia/Tbilisi"},{code:"GF",country:"French Guiana",zone:"America/Cayenne"},{code:"GG",country:"Guernsey",zone:"Europe/Guernsey"},{code:"GH",country:"Ghana",zone:"Africa/Accra"},{code:"GI",country:"Gibraltar",zone:"Europe/Gibraltar"},{code:"GL",country:"Greenland",zone:"America/Godthab"},{code:"GM",country:"Gambia",zone:"Africa/Banjul"},{code:"GN",country:"Guinea",zone:"Africa/Conakry"},{code:"GP",country:"Guadeloupe",zone:"America/Guadeloupe"},{code:"GQ",country:"Equatorial Guinea",zone:"Africa/Malabo"},{code:"GR",country:"Greece",zone:"Europe/Athens"},{code:"GS",country:"South Georgia and the South Sandwich Islands",zone:"Atlantic/South_Georgia"},{code:"GT",country:"Guatemala",zone:"America/Guatemala"},{code:"GU",country:"Guam",zone:"Pacific/Guam"},{code:"GW",country:"Guinea-Bissau",zone:"Africa/Bissau"},{code:"GY",country:"Guyana",zone:"America/Guyana"},{code:"HK",country:"Hong Kong",zone:"Asia/Hong_Kong"},{code:"HM",country:"Heard Island and McDonald Islands",zone:"Heard Island and McDonald Islands"},{code:"HN",country:"Honduras",zone:"America/Tegucigalpa"},{code:"HR",country:"Croatia",zone:"Europe/Zagreb"},{code:"HT",country:"Haiti",zone:"America/Port-au-Prince"},{code:"HU",country:"Hungary",zone:"Europe/Budapest"},{code:"ID",country:"Indonesia",zone:"Asia/Jakarta"},{code:"IE",country:"Ireland",zone:"Europe/Dublin"},{code:"IL",country:"Israel",zone:"Asia/Jerusalem"},{code:"IM",country:"Isle of Man",zone:"Europe/Isle_of_Man"},{code:"IN",country:"India",zone:"Asia/Kolkata"},{code:"IO",country:"British Indian Ocean Territory",zone:"Indian/Chagos"},{code:"IQ",country:"Iraq",zone:"Asia/Baghdad"},{code:"IR",country:"Iran",zone:"Asia/Tehran"},{code:"IS",country:"Iceland",zone:"Atlantic/Reykjavik"},{code:"IT",country:"Italy",zone:"Europe/Rome"},{code:"JE",country:"Jersey",zone:"Europe/Jersey"},{code:"JM",country:"Jamaica",zone:"America/Jamaica"},{code:"JO",country:"Jordan",zone:"Asia/Amman"},{code:"JP",country:"Japan",zone:"Asia/Tokyo"},{code:"KE",country:"Kenya",zone:"Africa/Nairobi"},{code:"KG",country:"Kyrgyzstan",zone:"Asia/Bishkek"},{code:"KH",country:"Cambodia",zone:"Asia/Phnom_Penh"},{code:"KI",country:"Kiribati",zone:"Pacific/Tarawa"},{code:"KM",country:"Comoros",zone:"Indian/Comoro"},{code:"KN",country:"Saint Kitts and Nevis",zone:"America/St_Kitts"},{code:"KP",country:"North Korea",zone:"Asia/Pyongyang"},{code:"KR",country:"South Korea",zone:"Asia/Seoul"},{code:"KW",country:"Kuwait",zone:"Asia/Kuwait"},{code:"KY",country:"Cayman Islands",zone:"America/Cayman"},{code:"KZ",country:"Kazakhstan",zone:"Asia/Almaty"},{code:"LA",country:"Laos",zone:"Asia/Vientiane"},{code:"LB",country:"Lebanon",zone:"Asia/Beirut"},{code:"LC",country:"Saint Lucia",zone:"America/St_Lucia"},{code:"LI",country:"Liechtenstein",zone:"Europe/Vaduz"},{code:"LK",country:"Sri Lanka",zone:"Asia/Colombo"},{code:"LR",country:"Liberia",zone:"Africa/Monrovia"},{code:"LS",country:"Lesotho",zone:"Africa/Maseru"},{code:"LT",country:"Lithuania",zone:"Europe/Vilnius"},{code:"LU",country:"Luxembourg",zone:"Europe/Luxembourg"},{code:"LV",country:"Latvia",zone:"Europe/Riga"},{code:"LY",country:"Libya",zone:"Africa/Tripoli"},{code:"MA",country:"Morocco",zone:"Africa/Casablanca"},{code:"MC",country:"Monaco",zone:"Europe/Monaco"},{code:"MD",country:"Moldova",zone:"Europe/Chisinau"},{code:"ME",country:"Montenegro",zone:"Europe/Podgorica"},{code:"MF",country:"Saint Martin",zone:"America/Marigot"},{code:"MG",country:"Madagascar",zone:"Indian/Antananarivo"},{code:"MH",country:"Marshall Islands",zone:"Pacific/Majuro"},{code:"MK",country:"Macedonia",zone:"Europe/Skopje"},{code:"ML",country:"Mali",zone:"Africa/Bamako"},{code:"MM",country:"Myanmar",zone:"Asia/Yangon"},{code:"MN",country:"Mongolia",zone:"Asia/Ulaanbaatar"},{code:"MO",country:"Macao",zone:"Asia/Macau"},{code:"MP",country:"Northern Mariana Islands",zone:"Pacific/Saipan"},{code:"MQ",country:"Martinique",zone:"America/Martinique"},{code:"MR",country:"Mauritania",zone:"Africa/Nouakchott"},{code:"MS",country:"Montserrat",zone:"America/Montserrat"},{code:"MT",country:"Malta",zone:"Europe/Malta"},{code:"MU",country:"Mauritius",zone:"Indian/Mauritius"},{code:"MV",country:"Maldives",zone:"Indian/Maldives"},{code:"MW",country:"Malawi",zone:"Africa/Blantyre"},{code:"MX",country:"Mexico",zone:"America/Mexico_City"},{code:"MY",country:"Malaysia",zone:"Asia/Kuala_Lumpur"},{code:"MZ",country:"Mozambique",zone:"Africa/Maputo"},{code:"NA",country:"Namibia",zone:"Africa/Windhoek"},{code:"NC",country:"New Caledonia",zone:"Pacific/Noumea"},{code:"NE",country:"Niger",zone:"Africa/Niamey"},{code:"NF",country:"Norfolk Island",zone:"Pacific/Norfolk"},{code:"NG",country:"Nigeria",zone:"Africa/Lagos"},{code:"NI",country:"Nicaragua",zone:"America/Managua"},{code:"NL",country:"Netherlands",zone:"Europe/Amsterdam"},{code:"NO",country:"Norway",zone:"Europe/Oslo"},{code:"NP",country:"Nepal",zone:"Asia/Kathmandu"},{code:"NR",country:"Nauru",zone:"Pacific/Nauru"},{code:"NU",country:"Niue",zone:"Pacific/Niue"},{code:"NZ",country:"New Zealand",zone:"Pacific/Auckland"},{code:"OM",country:"Oman",zone:"Asia/Muscat"},{code:"PA",country:"Panama",zone:"America/Panama"},{code:"PE",country:"Peru",zone:"America/Lima"},{code:"PF",country:"French Polynesia",zone:"Pacific/Tahiti"},{code:"PG",country:"Papua New Guinea",zone:"Pacific/Port_Moresby"},{code:"PH",country:"Philippines",zone:"Asia/Manila"},{code:"PK",country:"Pakistan",zone:"Asia/Karachi"},{code:"PL",country:"Poland",zone:"Europe/Warsaw"},{code:"PM",country:"Saint Pierre and Miquelon",zone:"America/Miquelon"},{code:"PN",country:"Pitcairn",zone:"Pacific/Pitcairn"},{code:"PR",country:"Puerto Rico",zone:"America/Puerto_Rico"},{code:"PS",country:"Palestinian Territory",zone:"Asia/Gaza"},{code:"PT",country:"Portugal",zone:"Europe/Lisbon"},{code:"PW",country:"Palau",zone:"Pacific/Palau"},{code:"PY",country:"Paraguay",zone:"America/Asuncion"},{code:"QA",country:"Qatar",zone:"Asia/Qatar"},{code:"RE",country:"Reunion",zone:"Indian/Reunion"},{code:"RO",country:"Romania",zone:"Europe/Bucharest"},{code:"RS",country:"Serbia",zone:"Europe/Belgrade"},{code:"RU",country:"Russia",zone:"Europe/Kaliningrad"},{code:"RW",country:"Rwanda",zone:"Africa/Kigali"},{code:"SA",country:"Saudi Arabia",zone:"Asia/Riyadh"},{code:"SB",country:"Solomon Islands",zone:"Pacific/Guadalcanal"},{code:"SC",country:"Seychelles",zone:"Indian/Mahe"},{code:"SD",country:"Sudan",zone:"Africa/Khartoum"},{code:"SE",country:"Sweden",zone:"Europe/Stockholm"},{code:"SG",country:"Singapore",zone:"Asia/Singapore"},{code:"SH",country:"Saint Helena",zone:"Atlantic/St_Helena"},{code:"SI",country:"Slovenia",zone:"Europe/Ljubljana"},{code:"SJ",country:"Svalbard and Jan Mayen",zone:"Arctic/Longyearbyen"},{code:"SK",country:"Slovakia",zone:"Europe/Bratislava"},{code:"SL",country:"Sierra Leone",zone:"Africa/Freetown"},{code:"SM",country:"San Marino",zone:"Europe/San_Marino"},{code:"SN",country:"Senegal",zone:"Africa/Dakar"},{code:"SO",country:"Somalia",zone:"Africa/Mogadishu"},{code:"SR",country:"Suriname",zone:"America/Paramaribo"},{code:"SS",country:"South Sudan",zone:"Africa/Juba"},{code:"ST",country:"Sao Tome and Principe",zone:"Africa/Sao_Tome"},{code:"SV",country:"El Salvador",zone:"America/El_Salvador"},{code:"SX",country:"Sint Maarten",zone:"America/Lower_Princes"},{code:"SY",country:"Syria",zone:"Asia/Damascus"},{code:"SZ",country:"Swaziland",zone:"Africa/Mbabane"},{code:"TC",country:"Turks and Caicos Islands",zone:"America/Grand_Turk"},{code:"TD",country:"Chad",zone:"Africa/Ndjamena"},{code:"TF",country:"French Southern Territories",zone:"Indian/Kerguelen"},{code:"TG",country:"Togo",zone:"Africa/Lome"},{code:"TH",country:"Thailand",zone:"Asia/Bangkok"},{code:"TJ",country:"Tajikistan",zone:"Asia/Dushanbe"},{code:"TK",country:"Tokelau",zone:"Pacific/Fakaofo"},{code:"TL",country:"East Timor",zone:"Asia/Dili"},{code:"TM",country:"Turkmenistan",zone:"Asia/Ashgabat"},{code:"TN",country:"Tunisia",zone:"Africa/Tunis"},{code:"TO",country:"Tonga",zone:"Pacific/Tongatapu"},{code:"TR",country:"Turkey",zone:"Europe/Istanbul"},{code:"TT",country:"Trinidad and Tobago",zone:"America/Port_of_Spain"},{code:"TV",country:"Tuvalu",zone:"Pacific/Funafuti"},{code:"TW",country:"Taiwan",zone:"Asia/Taipei"},{code:"TZ",country:"Tanzania",zone:"Africa/Dar_es_Salaam"},{code:"UA",country:"Ukraine",zone:"Europe/Kiev"},{code:"UG",country:"Uganda",zone:"Africa/Kampala"},{code:"UM",country:"United States Minor Outlying Islands",zone:"Pacific/Midway"},{code:"US",country:"United States",zone:"America/New_York"},{code:"UY",country:"Uruguay",zone:"America/Montevideo"},{code:"UZ",country:"Uzbekistan",zone:"Asia/Samarkand"},{code:"VA",country:"Vatican",zone:"Europe/Vatican"},{code:"VC",country:"Saint Vincent and the Grenadines",zone:"America/St_Vincent"},{code:"VE",country:"Venezuela",zone:"America/Caracas"},{code:"VG",country:"British Virgin Islands",zone:"America/Tortola"},{code:"VI",country:"U.S. Virgin Islands",zone:"America/St_Thomas"},{code:"VN",country:"Vietnam",zone:"Asia/Ho_Chi_Minh"},{code:"VU",country:"Vanuatu",zone:"Pacific/Efate"},{code:"WF",country:"Wallis and Futuna",zone:"Pacific/Wallis"},{code:"WS",country:"Samoa",zone:"Pacific/Apia"},{code:"XK",country:"Kosovo",zone:"Kosovo"},{code:"YE",country:"Yemen",zone:"Asia/Aden"},{code:"YT",country:"Mayotte",zone:"Indian/Mayotte"},{code:"ZA",country:"South Africa",zone:"Africa/Johannesburg"},{code:"ZM",country:"Zambia",zone:"Africa/Lusaka"},{code:"ZW",country:"Zimbabwe",zone:"Africa/Harare"}],timezones:["ACT","AET","Africa/Abidjan","Africa/Accra","Africa/Addis_Ababa","Africa/Algiers","Africa/Asmara","Africa/Asmera","Africa/Bamako","Africa/Bangui","Africa/Banjul","Africa/Bissau","Africa/Blantyre","Africa/Brazzaville","Africa/Bujumbura","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/Conakry","Africa/Dakar","Africa/Dar_es_Salaam","Africa/Djibouti","Africa/Douala","Africa/El_Aaiun","Africa/Freetown","Africa/Gaborone","Africa/Harare","Africa/Johannesburg","Africa/Juba","Africa/Kampala","Africa/Khartoum","Africa/Kigali","Africa/Kinshasa","Africa/Lagos","Africa/Libreville","Africa/Lome","Africa/Luanda","Africa/Lubumbashi","Africa/Lusaka","Africa/Malabo","Africa/Maputo","Africa/Maseru","Africa/Mbabane","Africa/Mogadishu","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Niamey","Africa/Nouakchott","Africa/Ouagadougou","Africa/Porto-Novo","Africa/Sao_Tome","Africa/Timbuktu","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","AGT","America/Adak","America/Anchorage","America/Anguilla","America/Antigua","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/ComodRivadavia","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Aruba","America/Asuncion","America/Atikokan","America/Atka","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Buenos_Aires","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Catamarca","America/Cayenne","America/Cayman","America/Chicago","America/Chihuahua","America/Coral_Harbour","America/Cordoba","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Dominica","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Ensenada","America/Fort_Nelson","America/Fort_Wayne","America/Fortaleza","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Grenada","America/Guadeloupe","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Indianapolis","America/Inuvik","America/Iqaluit","America/Jamaica","America/Jujuy","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/Knox_IN","America/Kralendijk","America/La_Paz","America/Lima","America/Los_Angeles","America/Louisville","America/Lower_Princes","America/Maceio","America/Managua","America/Manaus","America/Marigot","America/Martinique","America/Matamoros","America/Mazatlan","America/Mendoza","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Montreal","America/Montserrat","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port_of_Spain","America/Port-au-Prince","America/Porto_Acre","America/Porto_Velho","America/Puerto_Rico","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Rosario","America/Santa_Isabel","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Shiprock","America/Sitka","America/St_Barthelemy","America/St_Johns","America/St_Kitts","America/St_Lucia","America/St_Thomas","America/St_Vincent","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Tortola","America/Vancouver","America/Virgin","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/McMurdo","Antarctica/Palmer","Antarctica/Rothera","Antarctica/South_Pole","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Arctic/Longyearbyen","ART","Asia/Aden","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Ashkhabad","Asia/Baghdad","Asia/Bahrain","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Calcutta","Asia/Chita","Asia/Choibalsan","Asia/Chongqing","Asia/Chungking","Asia/Colombo","Asia/Dacca","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Gaza","Asia/Harbin","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Istanbul","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kashgar","Asia/Kathmandu","Asia/Katmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Kuwait","Asia/Macao","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Muscat","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Phnom_Penh","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qyzylorda","Asia/Rangoon","Asia/Riyadh","Asia/Saigon","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Tel_Aviv","Asia/Thimbu","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ujung_Pandang","Asia/Ulaanbaatar","Asia/Ulan_Bator","Asia/Urumqi","Asia/Ust-Nera","Asia/Vientiane","Asia/Vladivostok","Asia/Yakutsk","Asia/Yekaterinburg","Asia/Yerevan","AST","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faeroe","Atlantic/Faroe","Atlantic/Jan_Mayen","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/St_Helena","Atlantic/Stanley","Australia/ACT","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Canberra","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/LHI","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/North","Australia/NSW","Australia/Perth","Australia/Queensland","Australia/South","Australia/Sydney","Australia/Tasmania","Australia/Victoria","Australia/West","Australia/Yancowinna","BET","Brazil/Acre","Brazil/DeNoronha","Brazil/East","Brazil/West","BST","Canada/Atlantic","Canada/Central","Canada/East-Saskatchewan","Canada/Eastern","Canada/Mountain","Canada/Newfoundland","Canada/Pacific","Canada/Saskatchewan","Canada/Yukon","CAT","CET","Chile/Continental","Chile/EasterIsland","CNT","CST","CST6CDT","CTT","Cuba","EAT","ECT","EET","Egypt","Eire","EST","EST5EDT","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belfast","Europe/Belgrade","Europe/Berlin","Europe/Bratislava","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Busingen","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Guernsey","Europe/Helsinki","Europe/Isle_of_Man","Europe/Istanbul","Europe/Jersey","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/Ljubljana","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Mariehamn","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Nicosia","Europe/Oslo","Europe/Paris","Europe/Podgorica","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/San_Marino","Europe/Sarajevo","Europe/Simferopol","Europe/Skopje","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Tiraspol","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vaduz","Europe/Vatican","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zagreb","Europe/Zaporozhye","Europe/Zurich","GB","GB-Eire","GMT","GMT0","Greenwich","Hongkong","HST","Iceland","IET","Indian/Antananarivo","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Comoro","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Mayotte","Indian/Reunion","Iran","Israel","IST","Jamaica","Japan","JST","Kwajalein","Libya","MET","Mexico/BajaNorte","Mexico/BajaSur","Mexico/General","MIT","MST","MST7MDT","Navajo","NET","NST","NZ","NZ-CHAT","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Johnston","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Midway","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Ponape","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Saipan","Pacific/Samoa","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Truk","Pacific/Wake","Pacific/Wallis","Pacific/Yap","PLT","PNT","Poland","Portugal","PRC","PRT","PST","PST8PDT","ROK","Singapore","SST","SystemV/AST4","SystemV/AST4ADT","SystemV/CST6","SystemV/CST6CDT","SystemV/EST5","SystemV/EST5EDT","SystemV/HST10","SystemV/MST7","SystemV/MST7MDT","SystemV/PST8","SystemV/PST8PDT","SystemV/YST9","SystemV/YST9YDT","Turkey","UCT","Universal","US/Alaska","US/Aleutian","US/Arizona","US/Central","US/East-Indiana","US/Eastern","US/Hawaii","US/Indiana-Starke","US/Michigan","US/Mountain","US/Pacific","US/Pacific-New","US/Samoa","UTC","VST","W-SU","WET","Zulu"]}[e]}}]),t}(c.default);r.default=d,t.exports=r.default},{"./Search":252,q:109}],255:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./BaseSearch"),c=n(s),l=e("merge"),f=n(l),d=e("q"),h=n(d),p=function(e){function t(e,r,n,o,a,s,c,l,d){void 0===o&&(o={limit:{}}),i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,l),this._setUrlParameters(d),this._postObj=(0,f.default)(n,o,s,c),"object"==typeof a&&(this._postObj=(0,f.default)(this._postObj,a))}return o(t,e),a(t,[{key:"_filter",value:function(){return this._postObj}},{key:"_loadData",value:function(e){function t(){if(r.cancel||"string"==typeof r.cancel){var e="string"==typeof r.cancel?r.cancel:"Cancel process";n.reject({data:e,statusCode:403})}else r._ogapi.Napi.post(r._resource,i,r._timeout,r._getExtraHeaders(),r._getUrlParameters()).then(function(e){var r=e.statusCode,a=e.body;if(!a&&e.text)try{var u=JSON.parse(e.text);u&&(a=u)}catch(e){console.error("Impossible to parse text from response")}200===r?(o=!0,n.notify(a),a.data.length===i.limit.size?(i.limit.start+=1,t()):n.resolve({data:"DONE",statusCode:200})):o?n.resolve({data:"DONE",statusCode:200}):n.reject({data:a,statusCode:r})}).catch(function(e){n.reject(e)})}var r=this,n=h.default.defer(),i=r._asyncPagingFilter(),o=!1;return t(),n.promise}}]),t}(c.default);r.default=p,t.exports=r.default},{"./BaseSearch":248,merge:104,q:109}],256:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}
33
+ var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/administrativeState",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"administrativeState",this.customFilters)}},{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter id must be a string");return this.customFilters.id=e,this}},{key:"withEntityType",value:function(e){if("string"!=typeof e)throw new Error("Parameter entityType must be a string");return this.customFilters.entityType=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],257:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="$_token";r.TOKEN_URL=d;var h=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/alarms"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscriptions:"/subscriptions"},r),this._url="/entities"+d+"/alarms"}.apply(this,arguments)}return o(t,e),a(t,[{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(d,this._routes[e]));return this._url=this._url.replace(d,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],258:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/allowedResourceType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"allowedResourceType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e.toLowerCase(),this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],259:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/areas",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],260:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../AssetSearch"),h=n(d),p="/entities",m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p)),this._url=p}return o(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.asset.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"build",value:function(){return new h.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}},{key:"select",value:function(e){return this._builderParams.select=e||void 0,this}}]),t}(c.default);r.default=m,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"../AssetSearch":247,"./PreFilteredSearchBuilder":292}],261:[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 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}}(),a=e("q"),u=n(a),s=e("merge"),c=(n(s),e("jsonpath")),l=n(c),f=function(){function e(t,r){i(this,e),this._ogapi=t,this._resource="resources/schemaTypes/og_basic_types",this._headers=void 0,this._og_basic_types={},this.publicParameters=!1,this._urlParameters=void 0}return o(e,[{key:"_getExtraHeaders",value:function(){return this._headers}},{key:"_setExtraHeaders",value:function(e){if(this._headers)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._headers[n]=e[n]}else this._headers=e}},{key:"_getUrlParameters",value:function(){return this._urlParameters}},{key:"_setUrlParameters",value:function(e){if(this.parameters)for(var t=Object.keys(e),r=0;r<t.length;r++){var n=t[r];this._urlParameters[n]=e[n]}else this._urlParameters=e}},{key:"execute",value:function(){var e=this,t=u.default.defer(),r=t.promise;return this._setExtraHeaders({Accept:"application/json"}),this._ogapi.Napi.get(this._resource,this._timeout,this._getExtraHeaders(),this._getUrlParameters()).then(function(r){var n=r.body,i=r.statusCode;if(e._og_basic_types=n,l.default.apply(e._og_basic_types,"$..['$ref']",function(e,t){var r="$.."+e.replace("#/definitions/","");return l.default.query(n,r)[0]}).forEach(function(e){var t=l.default.stringify(e.path);l.default.value(n,t,e.value)}),e.path){var o=e.path.includes("$")?e.path:"$.."+e.path,a=l.default.query(n,o)[0]||{msg:"not Found"};t.resolve({data:a,statusCode:i})}else{if(e.publicParameters)for(var u in n.definitions)n.definitions[u].public&&!1!==n.definitions[u].public||delete n.definitions[u];t.resolve({data:n,statusCode:i})}}).catch(function(e){t.reject(e)}),r}},{key:"withPath",value:function(e){return this.path=e,this}},{key:"withPublicParameters",value:function(e){return this.publicParameters=e,this}},{key:"build",value:function(){return this}}]),e}();r.default=f,t.exports=r.default},{jsonpath:95,merge:104,q:109}],262:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="provisionProcessors/bulk/search",m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p)),this._url=p}return o(t,e),a(t,[{key:"build",value:function(){return new h.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,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"../WPSearch":255,"./SearchBuilder":296}],263:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/bulk/async",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],264:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/bundles",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],265:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/certificates",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._fetch=!1,this._assignable=!1}return o(t,e),a(t,[{key:"assignable",value:function(){return this._assignable=!0,this}},{key:"administrable",value:function(){return this._assignable=!1,this}},{key:"withFetch",value:function(e){if(!0!==e&&!1!==e)throw new Error("Flag fecth incorrect");return this._fetch=e,this}},{key:"_buildUrl",value:function(){var e=this._url;return!0===this._fetch&&(this._urlParams.fetch=1),!0===this._assignable&&(this._urlParams.visibility="assignable"),e}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],266:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/channels",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._summary=!1}return o(t,e),a(t,[{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],267:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/communicationsModuleType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"communicationsModuleType",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],268:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/countryCodes",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"countryCodes",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],269:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/datamodels",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],270:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("merge"),f=n(l),d=e("moment"),h=n(d),p=e("../../util/searchingFields/FieldFinder"),m=n(p),y=e("../../util/DATE_FORMAT"),v="/datapoints",g=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new m.default(e,v)),this._url=v,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return o(t,e),a(t,[{key:"withDeviceId",value:function(e){if("string"!=typeof e)throw new Error("Parameter deviceId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.device",e)),this}},{key:"withDatastream",value:function(e){if("string"!=typeof e)throw new Error("Parameter datastreamId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.datastream",e)),this}},{key:"withFeed",value:function(e){if("string"!=typeof e)throw new Error("Parameter feedId must be a string");return this.fluentFilter.and(this._parent.EX.eq("datapoint.feed",e)),this}},{key:"betweenDates",value:function(e,t){if("object"!=typeof e||e.constructor!==Date)throw new Error("Parameter fromDate must be a Date");if(this.fluentFilter.and(this._parent.EX.gt("datapoint.at",(0,h.default)(e).format(y.DATE_FORMAT))),void 0!==t){if(t.constructor!==Date)throw new Error("Parameter toDate must be a Date");this.fluentFilter.and(this._parent.EX.lt("datapoint.at",(0,h.default)(t).format(y.DATE_FORMAT)))}return this}},{key:"_buildFilter",value:function(){var e={filter:{}},t=(0,f.default)(!0,this.fluentFilter),r=this._builderParams.filter;if(t=t._filterTemplate.filter,"object"==typeof r._filterTemplate&&(r=r._filterTemplate.filter),void 0!==r&&Object.keys(r).length>0&&void 0!==t&&Object.keys(t).length>0)throw new Error("Incompatible filters. You only can create a filter using fluent mode [betweenDates, addTag, withDatastreamId, withDeviceId] methods or custom filter [filter] method");return void 0!==r&&Object.keys(r).length>0?e.filter=r:void 0!==t&&Object.keys(t).length>0&&(e.filter=t),e}},{key:"select",value:function(e){return this._builderParams.select=e,this}}]),t}(c.default);r.default=g,t.exports=r.default},{"../../util/DATE_FORMAT":323,"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296,merge:104,moment:105}],271:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../EntitySearch"),h=n(d),p="$_token";r.TOKEN_URL=p;var m=function(e){function t(e,r,n){var o=arguments.length<=3||void 0===arguments[3]?new f.default(e,"/entities"):arguments[3];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/"},o),this._url="/organizations/"+r+"/datasets/"+n+p}.apply(this,arguments)}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(p,this._routes[e]));return this._url=this._url.replace(p,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.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":329,"../EntitySearch":250,"./SearchWithSummaryBuilder":297}],272:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="datasets";r.BASE_URL=p;var m=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p,{organization:r,dataset:n})),this._url=p+"/provision/organizations/"+r+"/"+n+"/data"}return o(t,e),a(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 h.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":329,"../WPSearch":255,"./SearchBuilder":296}],273:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}
34
34
  },u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/catalog/datasets",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],274:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../Search"),l=(n(c),e("../../util/searchingFields/FieldFinder")),f=n(l),d="/datastreams",h=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),t}(s.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"../Search":252,"./SearchBuilder":296}],275:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/entities",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}},{key:"_buildFilter",value:function(){var e={and:[{exists:{"provision.device.identifier":!0}}]};if(this._builderParams.filter&&Object.keys(this._builderParams.filter).length>0){var t=this._builderParams.filter;void 0!==t._filterTemplate?e.and.push(t._filterTemplate.filter):e.and.push(t)}return{filter:e}}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./PreFilteredSearchBuilder":292}],276:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/domains",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d,this._summary=!1}return o(t,e),a(t,[{key:"summary",value:function(){return this._summary=!0,this}},{key:"_buildUrl",value:function(){return this._summary&&(this._url=this._url+"/summary"),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],277:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../EntitySearch"),h=n(d),p="$_token";r.TOKEN_URL=p;var m=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/entities"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices"},r),this._url="/entities"+p}.apply(this,arguments)}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"disableDefaultSorted",value:function(){return this._urlParams.defaultSorted=!1,this}},{key:"disableCaseSensitive",value:function(e){return this._urlParams.caseSensitive=e||!1,this}},{key:"removeCaseSensitive",value:function(){return this._urlParams&&delete this._urlParams.caseSensitive,this}},{key:"_buildUrl",value:function(){for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(p,this._routes[e]));return this._url=this._url.replace(p,""),u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"group",value:function(e){return this._builderParams.group=e||{},this}},{key:"select",value:function(e){return this._builderParams.select=e||[],this}},{key:"build",value:function(){return new h.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":329,"../EntitySearch":250,"./SearchWithSummaryBuilder":297}],278:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new l.default(e,"/operations"):arguments[1];return function(){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},r),this._url="/entities/operations/history"}.apply(this,arguments)}return o(t,e),t}(s.default);r.default=f,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],279:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="$_token";r.TOKEN_URL=d;var h=function(e){function t(e){var r=arguments.length<=1||void 0===arguments[1]?new f.default(e,"/operations"):arguments[1];return function(){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{onDevices:"/devices",onSubscribers:"/subscribers",onSubscriptions:"/subscriptions",onCommunicationsModules:"/communicationsModules"},r),this._url="/entities"+d+"/operations"}.apply(this,arguments)}return o(t,e),a(t,[{key:"_buildUrl",value:function(){this._checkConstraintRoutes();for(var e in this._routes)this._builderParams[e]&&(this._url=this._url.replace(d,this._routes[e]));return u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],280:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/feeds",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],281:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/fieldsDefinition",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"fieldsDefinition",this.customFilters)}},{key:"withType",value:function(e){if("string"!=typeof e)throw new Error("Parameter type must be a string");return this.customFilters.type=e,this}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],282:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../DeviceSearch"),f=n(l),d=function(e){function t(e,r,n){if(i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r,n),this.constructor===t)throw new Error("Cannot construct Abstract instances directly")}return o(t,e),a(t,[{key:"flattened",value:function(){return this._urlParams.flattened=!0,this}},{key:"_buildUrl",value:function(){return u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}},{key:"build",value:function(){return new f.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=d,t.exports=r.default},{"../DeviceSearch":249,"./SearchBuilder":296}],283:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("merge"),f=n(l),d=e("../../util/searchingFields/FieldFinder"),h=n(d),p="/catalog/hardwares",m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new h.default(e,p)),this._url=p,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return o(t,e),a(t,[{key:"withId",value:function(e){if("string"!=typeof e)throw new Error("Parameter hardwareId must be a string");return this.fluentFilter.and(this._parent.EX.eq("manufacturerIdentifier",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,f.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, 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=m,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297,merge:104}],284:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamAccess",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamAccess",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],285:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamPeriod",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamPeriod",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],286:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ioTDatastreamStoragePeriod",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ioTDatastreamStoragePeriod",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],287:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/catalog/operators",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],288:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/operationTypes",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],289:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/operationalStatus",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.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=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],290:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/jobs",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],291:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/catalog/plans/organization?",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(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=d+this._domainName,u(Object.getPrototypeOf(t.prototype),"_buildUrl",this).call(this)}}]),t}(c.default);r.default=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],292:[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)}
35
35
  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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./FlattenedSearchBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i){if(n(this,t),a(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),o(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}(s.default);r.default=c,t.exports=r.default},{"./FlattenedSearchBuilder":282}],293:[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}}(),o=(e("./SearchBuilder"),e("../Search")),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=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 a.default(this._api,this._url,this._filter,this._limit,{})}}]),e}();r.default=u,t.exports=r.default},{"../Search":252,"./SearchBuilder":296}],294:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/resourceType",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"resourceType",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],295:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/rules",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],296:[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}}(),o=e("../Search"),a=function(e){return e&&e.__esModule?e:{default:e}}(o),u=function(){function e(t,r,i){var o=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 a in this._routes)!function(e){o._routesName.push(e),o._builderParams[e]=!1,o[e]=function(){var t=arguments.length<=0||void 0===arguments[0]?e:arguments[0];return o._builderParams[t]=!0,o}}(a);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 a.default(this._parent,this._buildUrl(),this._buildFilter(),this._buildLimit(),this._buildSort(),this._buildGroup(),this._buildSelect(),this._builderParams.timeout,this._urlParams)}catch(e){console.log("!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=u,t.exports=r.default},{"../Search":252}],297:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchBuilder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r,i){if(n(this,t),a(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),o(t,[{key:"summary",value:function(){return this._url=this._url+"/summary",this}}]),t}(s.default);r.default=c,t.exports=r.default},{"./SearchBuilder":296}],298:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d="serviceGroups",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/"+d,this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,d,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=h,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],299:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchWithSummaryBuilder"),c=n(s),l=e("merge"),f=n(l),d=e("../../util/searchingFields/FieldFinder"),h=n(d),p=["SOFTWARE","FIRMWARE"];r.SOFTWARE_TYPES_ENUM=p;var m="/catalog/softwares",y=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new h.default(e,m)),this._url=m,this.fluentFilter=e.newFilterBuilder(),this.tagsFilter=[]}return o(t,e),a(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===p.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(p)+"'");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,f.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=y},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297,merge:104}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/entities",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,"/subscribers")),this._url=d}return o(t,e),a(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=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./PreFilteredSearchBuilder":292}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./PreFilteredSearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/entities",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,"/subscriptions")),this._url=d}return o(t,e),a(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=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./PreFilteredSearchBuilder":292}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/tasks",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketPriority",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketPriority",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketSeverity",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketSeverity",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/ticketStatus",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),null,this._builderParams.timeout,"ticketStatus",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d="/tickets",h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,d)),this._url=d}return o(t,e),a(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=h,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchBuilder":296}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../../util/searchingFields/FieldFinder"),f=n(l),d=e("../WPSearch"),h=n(d),p="timeseries";r.BASE_URL=p;var m=function(e){function t(e,r,n){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new f.default(e,p,{organization:r,timeserie:n})),this._url=p+"/provision/organizations/"+r+"/"+n+"/data"}return o(t,e),a(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 h.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":329,"../WPSearch":255,"./SearchBuilder":296}],308:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return
36
36
  ;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/timezones",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"timezones",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],309:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userLanguages",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.default(this._parent,this._buildUrl(),this._buildFilter(),this._builderParams.timeout,"userLanguages",this.customFilters)}}]),t}(c.default);r.default=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("./SearchBuilder"),c=n(s),l=e("../StaticSearch"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{}),this._url="/userProfile",this.customFilters={}}return o(t,e),a(t,[{key:"build",value:function(){return new f.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=d,t.exports=r.default},{"../StaticSearch":254,"./SearchBuilder":296}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/users",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],312:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./SearchWithSummaryBuilder"),s=n(u),c=e("../../util/searchingFields/FieldFinder"),l=n(c),f="/workgroups",d=function(e){function t(e){i(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,{},new l.default(e,f)),this._url=f}return o(t,e),t}(s.default);r.default=d,t.exports=r.default},{"../../util/searchingFields/FieldFinder":329,"./SearchWithSummaryBuilder":297}],313:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=["NOT_ACTIVE","ACTIVE","REVOKED","EXPIRED"];r.ADMINISTRATIVE_STATE_ENUM=n},{}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../ProvisionGenericFinder"),c=n(s),l=e("q"),f=n(l),d=e("http-status-codes"),h=n(d),p=e("./MIME_TYPES_ENUM"),m=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"security/certificates","certificate","Certificate not found")}return o(t,e),a(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===p.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(p.MIME_TYPES_ENUM)+"'>");return this._id=e,this._type=t,this._download()}},{key:"_download",value:function(){var e=f.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:h.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":138,"./MIME_TYPES_ENUM":316,"http-status-codes":68,q:109}],315:[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,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=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 o=_q2.default.defer(),a=o.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),o.resolve({location:e.header.location,statusCode:r})):o.reject({errors:e.errors,statusCode:r})}).catch(function(e){o.reject(e)}),a}},{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":313,"./Security":317,"./USAGES_ENUM":318,q:109}],316:[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},{}],317:[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 o=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},a=e("../provision/BaseProvision"),u=function(e){return e&&e.__esModule?e:{default:e}}(a),s=function(e){function t(e,r,i){n(this,t),o(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/security"+(void 0===r?"":r),i)}return i(t,e),t}(u.default);r.default=s,t.exports=r.default},{"../provision/BaseProvision":225}],318:[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},{}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("../util/formats/check_types"),f=n(l),d="timeseries/provision/organizations/";r.URL=d;var h=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/organizations/",void 0,["name","organization","timeBucket","columns","identifierColumn"])}return o(t,e),a(t,[{key:"_buildURL",value:function(){return d+this._organization+"/"+this._identifier}},{key:"withOrganization",value:function(e){return f.default._checkStringAndLength(e,50,"organization"),this._organization=e,this}},{key:"withIdentifier",value:function(e){return f.default._checkString(e,"identifier"),this._identifier=e,this}},{key:"withName",value:function(e){return f.default._checkStringAndPattern(e,"^[a-zA-Z0-9_@.-]*$","name"),this._name=e,this}},{key:"withIdentifierColumn",value:function(e){return f.default._checkString(e,"identifierColumn"),this._identifierColumn=e,this}},{key:"withTimeBucket",value:function(e){return f.default._checkNumber(e,"timeBucket"),this._timeBucket=e,this}},{key:"withDescription",value:function(e){return e&&f.default._checkString(e,"description"),this._description=e,this}},{key:"withColumns",value:function(e){return f.default._checkArray(e,"columns"),this._columns=e,this}},{key:"withBucketColumn",value:function(e){return f.default._checkStringAndPattern(e,"^[a-zA-Z0-9 _-]*$","bucketColumn"),this._bucketColumn=e,this}},{key:"withRetention",value:function(e){return f.default._checkNumber(e,"retention"),this._retention=e,this}},{key:"withOrigin",value:function(e){return f.default._checkISODateTime(e,"origin"),this._origin=e,this}},{key:"withContext",value:function(e){return f.default._checkArray(e,"context"),this._context=e,this}},{key:"_composeElement",value:function(){return this._resource=d+this._organization,this._timeBucket>0&&f.default._checkStringAndPattern(this._bucketColumn,"^[a-zA-Z0-9 _-]*$","bucketColumn"),{name:this._name,description:this._description,timeBucket:this._timeBucket,bucketColumn:this._bucketColumn,retention:this._retention,origin:this._origin,context:this._context,identifierColumn:this._identifierColumn,columns:this._columns}}},{key:"update",value:function(){throw new Error("OGAPI_TIMESERIES_NOT_UPDATED")}}]),t}(c.default);r.default=h},{"../provision/BaseProvision":225,"../util/formats/check_types":328}],320:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../GenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"timeseries/provision/organizations","timeseries")}return i(t,e),o(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}(s.default);r.default=c,t.exports=r.default},{"../GenericFinder":136}],321:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"users","user","User not found")}return i(t,e),o(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}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":138}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("q"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/users",void 0,["email","workgroup","domain","profile","countryCode","langCode"])}return o(t,e),a(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:"_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}}}},{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}}}},{key:"updatePassword",value:function(e){if(this._newPassword=e,void 0===this._email||void 0===this._password||void 0===this._newPassword)throw new Error("OGAPI_USER_UPDATE_PASSWORD_PARAMETER_MUST_BE_DEFINED");var t={user:{password:this._newPassword}},r=f.default.defer(),n=r.promise;return this._setExtraHeaders({"X-ApiPass":this._password}),this._ogapi.Napi.put(this._buildURL(),t,void 0,this._getExtraHeaders(),this._getUrlParameters()).then(function(e){200===e.statusCode?r.resolve({statusCode:e.statusCode}):200===e.status?r.resolve({statusCode:e.status}):r.reject({errors:e.errors,statusCode:e.statusCode})}).catch(function(e){r.reject(e)}),n}}]),t}(c.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":225,q:109}],323:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});r.DATE_FORMAT="";r.TIME_FORMAT="HH:mm:ssZ"},{}],324:[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 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}}(),a=function(){function e(){i(this,e)}return o(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=a,t.exports=r.default},{}],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")}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}}(),a=e("merge"),u=n(a),s=e("urlencode"),c=n(s),l=e("superagent"),f=n(l),d=e("q"),h=n(d),p=e("lodash"),m=n(p),y=e("superagent-mocker"),v=n(y),g=(0,v.default)(f.default),_=function(){function e(t,r){i(this,e),this._options=u.default.recursive(!0,this.default(),t),this._headers=r,m.default.isEmpty(t.mocks)||this._applyMocks(t.mocks)}
37
37
  return o(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];g[r](t._options.url+n,function(t){if("function"==typeof i)return console.log("Function returned"),i(t);var o=e[r][n];return console.log("Data returned:",o),o.headers||(o.headers={}),o})})})}},{key:"default",value:function(){return{timeout:5e3}}},{key:"_url",value:function(e){return e.url}},{key:"get",value:function(e,t,r,n,i){var o=this._createUrl(e,n);console.info("GET",o);var a=f.default.get(o);return this._createPromiseRequest(a,null,t,r,i)}},{key:"patch",value:function(e,t,r,n,i){var o=this._createUrl(e,i);console.info("PATCH",o);var a=f.default.patch(o).send(t);return this._createPromiseRequest(a,null,r,n)}},{key:"post",value:function(e,t,r,n,i){var o=this._createUrl(e,i);console.info("POST",o);var a=f.default.post(o).send(t);return this._createPromiseRequest(a,null,r,n)}},{key:"post_multipart",value:function(e,t,r,n,i,o){var a=this._createUrl(e,o);console.info("POST_MULTIPART",a);var u=f.default.post(a),s=!0;return Object.keys(t).forEach(function(e){switch(e){case"meta":case"json":case"file":u.field(e,t[e]),delete t[e];break;case"certificate":case"processorBulkFile":u.attach("file",t.processorBulkFile),s=!1;break;case"bulkFile":u.set("Content-Type",t.ext),t=t.bulkFile}}),s&&u.send(t),this._createPromiseRequest(u,r,n,i)}},{key:"put",value:function(e,t,r,n,i){var o=this._createUrl(e,i);console.info("PUT",o);var a=f.default.put(o).send(t);return n?n["Content-Type"]="application/json":n={"Content-Type":"application/json"},this._createPromiseRequest(a,null,r,n)}},{key:"delete",value:function(e,t,r,n,i){var o=this._createUrl(e,n);console.info("DELETE",o);var a;return a=i?f.default.del(o).send(i):f.default.del(o),this._createPromiseRequest(a,null,t,r)}},{key:"_createUrl",value:function(e,t){var r=[];if(t){for(var n=Object.keys(t),i=0;i<n.length;i++){var o=n[i],a=o+"="+t[o];e=0===i?e+"?"+a:e+"&"+a}console.log(JSON.stringify(t))}console.log(e);var u=e.split("/"),s=u.length;return u.forEach(function(e,t){if(t===s-1&&e.indexOf("?")>0){var n=e.substring(e.indexOf("?"),e.length),i=e.substring(0,e.indexOf("?"));r.push((0,c.default)(i)+n)}else r.push((0,c.default)(e))}),this._url(this._options)+"/"+r.join("/")}},{key:"_createPromiseRequest",value:function(e,t,r,n,i){var o=r;void 0!==o&&null!==o||(o=this._options.timeout);var a=h.default.defer(),u=a.promise,s=this._options.apiKey,c=-1===o?e:e.timeout(o);if(s&&(c=c.set("X-ApiKey",this._options.apiKey)),n)for(var l=Object.keys(n),f=0;f<l.length;f++){var d=l[f];void 0!==n[d]&&(c=c.set(d,n[d]))}if(t)for(var p in t)c=c.on(p,t[p]);return i&&e.responseType("blob"),c=c.end(function(e,t){if(null!==e){console.error(e);var r=void 0,n=e.status?e.status:void 0,i={errors:[{code:n,message:"OGAPI: Something is broken. Please contact with your administrator."}]};void 0!==e.response?(r=e.response.body?e.response.body:i,n=e.status):n?(r=e.message,n=408):(r=i,n=500),a.reject({statusCode:n,data:r})}else a.resolve(t)}),u}}]),e}();r.default=_,t.exports=r.default},{lodash:103,merge:104,q:109,superagent:129,"superagent-mocker":127,urlencode:135}],326:[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}}(),o=function(){function e(){n(this,e)}return i(e,null,[{key:"element",value:function(e,t){return{name:e,fields:t}}}]),e}();r.default=o,t.exports=r.default},{}],327:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("./NorthAmpliaREST"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e,r){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,r)}return i(t,e),o(t,[{key:"_url",value:function(e){return e.south.url}}]),t}(s.default);r.default=c,t.exports=r.default},{"./NorthAmpliaREST":325}],328:[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}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d+(Z|[+-]\\d{2}:\\d{2})").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})}}},{}],329:[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 o(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 a,u=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.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=e("q"),c=n(s),l=e("lodash"),f=n(l),d=e("./source-precompiled/Fields"),h=e("./IotFields"),p=d.GENERATED_FIELDS;for(var m in h.IOT_FIELDS)if(p[m])for(var y in h.IOT_FIELDS[m])p[m][y]=h.IOT_FIELDS[m][y];else p[m]=h.IOT_FIELDS[m];var v=new RegExp("^(.+)._current\\.?(.+)?$"),g=new RegExp("\\[[0-9]+\\]"),_=(new RegExp("value\\.?"),{"/jobs":"JOB","/tasks":"TASKS","/alarms":"ENTITY_ALARM","/operations":"ENTITY_OPERATION","/certificates":"CERTIFICATE","/bundles":"UPDATE_BUNDLE_VERSION","/datapoints":"DATAPOINTS","/datastreams":"DATASTREAMS","/datamodels":"DATAMODELS","/dmmQRating":"DMMQRATING","/iotQRating":"IOTQRATING","/catalog/softwares":"SOFTWARE_VERSION","/catalog/hardwares":"MODEL","/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"}),b={ENTITY_ALARM:"alarm",UPDATE_BUNDLE_VERSION:"bundle",DATAPOINTS:"datapoints",ENTITY_OPERATION:["operation","job"]},E={get:function(e){switch(e){case"entity-asset":return["entity.asset"];case"/tickets":return["ticket"];case"/channels":return["channel"];default:return}}},w={subscriber:"DEVICE_PART_SUBSCRIBER",subscription:"DEVICE_PART_SUBSCRIPTION",communicationsModule:"DEVICE_PART_COMMSMODULE",device:"DEVICE_PART_DEVICE"},A={DEVICE_PART_SUBSCRIBER:"subscriber",DEVICE_PART_SUBSCRIPTION:"subscription",DEVICE_PART_COMMSMODULE:"communicationsModule",DEVICE_PART_DEVICE:"device"},S=["relColl","relProv"],O=["DEVICE_PART_SUBSCRIBER","DEVICE_PART_SUBSCRIPTION","DEVICE_PART_COMMSMODULE","DEVICE_PART_DEVICE"],P=["subscriber","subscription","communicationsModule","device"],D="search",C={get:function(e){if(O.indexOf(_[e])>=0)return"complex";switch(_[e]){case"SearchOnDatamodel":return D;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,o=t.selectAll,a=t.extraData&&t.extraData.organization,u=e._ogapi.datamodelsSearchBuilder(),s={and:[]};return e._resourceTypes&&s.and.push({in:{"datamodels.allowedResourceTypes":e._resourceTypes}}),a&&s.and.push({eq:{"datamodels.organizationName":a}}),i&&s.and.push({eq:{"datamodels.categories.datastreams.identifier":i}}),s.and.length>0&&u.filter(s),u.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||o?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},T=function(e,t,r,n){var i=r.selectedField,o=[],a=r.extraData.organization,u=r.extraData[t.entity];e._ogapi[t.api]()[t.method](a,u).then(function(t){if(200===t.statusCode){t.data.identifierColumn&&o.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&&o.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"}});var a=f.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){a=a.filter(function(e){return i===(e.name||e.alias)});var u=a[0],s=u.path.match(v),c=s[1].replace(g,"[]");r.selectedField=c}k(e,r).then(function(e){a.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,o.push(t)}),n.resolve(o)}).catch(function(e){console.log(e),n.reject(e)})}).catch(function(e){console.log(e),n.reject(e)})}}).catch(function(e){console.log(e),n.reject(e)})},F=(a={},o(a,D,function(e,t){k(this,e).then(function(e){t.resolve(e)}).catch(function(e){t.reject(e)})}),o(a,"simple",function(e,t){var r=e.context,n=e.primaryType,i=e.selectedField,o=[];if(r[n]instanceof Array)i?function(){var e=0,t=null;for(e=0;null===t&&e<r[n].length;e++)!function(){var o=r[n][e];o.toLowerCase()===i.toLowerCase()||o.toLowerCase()===i.toLowerCase()+"name"?t=o:b[n]&&(b[n]instanceof Array?b[n].forEach(function(e){o.toLowerCase()!==e+i.toLowerCase()&&o.toLowerCase()!==e+"."+i.toLowerCase()&&o.toLowerCase()!==e+i.toLowerCase()+"name"&&o.toLowerCase()!==e+"."+i.toLowerCase()+"name"||t||(t=o)}):o.toLowerCase()!==b[n]+i.toLowerCase()&&o.toLowerCase()!==b[n]+"."+i.toLowerCase()&&o.toLowerCase()!==b[n]+i.toLowerCase()+"name"&&o.toLowerCase()!==b[n]+"."+i.toLowerCase()+"name"||(t=o))}();t&&o.push(t)}():o=r[n].slice();else if(i)if(r[n][i])o.push(r[n][i]);else for(var a=Object.keys(r[n]),u=0;u<a.length;u++)r[n][a[u]].toLowerCase().indexOf(i.toLowerCase())>-1&&o.push(r[n][a[u]]);else for(var a=Object.keys(r[n]),u=0;u<a.length;u++)o.push(r[n][a[u]]);t.resolve(o.slice())}),o(a,"complex",function(e,t){function r(e,t){var n=void 0;if(!(r=w[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 o=e.states,a=e.context,u=e.primaryType,s={1:function(e,t){return t[u].concat(P.filter(n,A[u]))},2:function(e,t){try{return i(e,r(e[0],t).concat(S))}catch(e){return[]}},3:function(e,t){var n=e[1];if(-1===S.indexOf(n))return[];try{return i(e,r(e[0],t))}catch(e){return[]}}},c=o.length,l=s[c];return void 0===l?t.resolve([]):t.resolve(l(o,a))}),o(a,"dataset",function(e,t){T(this,{api:"newDatasetFinder",method:"findByOrganizationAndDatasetId",entity:"dataset"},e,t)}),o(a,"timeserie",function(e,t){T(this,{api:"newTimeserieFinder",method:"findByOrganizationAndTimeserieId",entity:"timeserie"},e,t)}),a),j=function(){function e(t,r,n){i(this,e),this._ogapi=t,this._url=r,this._type=C.get(r),this._extraData=n,this._type===D&&(this._resourceTypes=E.get(r))}return u(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:p[_[this._url]],primaryType:_[this._url],extraData:this._extraData};return F[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:p[_[this._url]],primaryType:_[this._url],selectAll:!0,extraData:this._extraData};return F[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:p[_[this._url]],primaryType:_[this._url],selectedField:e,extraData:this._extraData};return F[this._type].call(this,r,t),t.promise}}]),e}();r.default=j,t.exports=r.default},{"./IotFields":330,"./source-precompiled/Fields":331,lodash:103,q:109}],330:[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:{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"]}};r.IOT_FIELDS=n},{}],331:[function(e,t,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={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},{}],332:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup not found")}return i(t,e),o(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}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":138}],333:[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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("../provision/BaseProvision"),c=n(s),l=e("./Workgroups"),f=n(l),d=e("../channels/Channels"),h=n(d),p=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["workgroup","channels"]),this._ogapi=e,this._action="CREATE"}return o(t,e),a(t,[{key:"withWorkgroup",value:function(e){if(e.constructor.prototype!=f.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!=h.default.prototype)throw new Error("Parameter channel must be a channel")
38
38
  ;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=p,t.exports=r.default},{"../channels/Channels":159,"../provision/BaseProvision":225,"./Workgroups":335}],334:[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 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}}(),a=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},u=e("../ProvisionGenericFinder"),s=function(e){return e&&e.__esModule?e:{default:e}}(u),c=function(e){function t(e){n(this,t),a(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"domains","workgroup","Workgroup relation not found")}return i(t,e),o(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}(s.default);r.default=c,t.exports=r.default},{"../ProvisionGenericFinder":138}],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 o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=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}}(),u=function(e,t,r){for(var n=!0;n;){var i=e,o=t,a=r;n=!1,null===i&&(i=Function.prototype);var u=Object.getOwnPropertyDescriptor(i,o);if(void 0!==u){if("value"in u)return u.value;var s=u.get;if(void 0===s)return;return s.call(a)}var c=Object.getPrototypeOf(i);if(null===c)return;e=c,t=o,r=a,n=!0,u=c=void 0}},s=e("q"),c=n(s),l=e("../provision/BaseProvision"),f=n(l),d=function(e){function t(e){i(this,t),u(Object.getPrototypeOf(t.prototype),"constructor",this).call(this,e,"/domains",void 0,["name","domainName"]),this._ogapi=e}return o(t,e),a(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}(f.default);r.default=d,t.exports=r.default},{"../provision/BaseProvision":225,q:109}]},{},[1]);
39
- //# sourceMappingURL=opengate-api-bower-11.16.1.min.js.map
39
+ //# sourceMappingURL=opengate-api-bower-11.16.2.min.js.map