opengate-js 14.3.0 → 14.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/bower.json +1 -1
  2. package/dist/{opengate-api-bower-14.3.0.js → opengate-api-bower-14.4.0.js} +22 -6
  3. package/dist/opengate-api-bower-14.4.0.js.map +1 -0
  4. package/dist/{opengate-api-bower-14.3.0.min.js → opengate-api-bower-14.4.0.min.js} +2 -2
  5. package/dist/opengate-api-bower-14.4.0.min.js.map +1 -0
  6. package/dist/src/users/Users.js +18 -2
  7. package/dist/src/users/Users.js.map +1 -1
  8. package/docs/ast/source/users/Users.js.json +8540 -6112
  9. package/docs/class/src/users/Users.js~User.html +106 -6
  10. package/docs/coverage.json +6 -6
  11. package/docs/dump.json +506 -450
  12. package/docs/file/src/users/Users.js.html +16 -2
  13. package/docs/package.json +1 -1
  14. package/docs/script/search_index.js +6 -0
  15. package/docs/source.html +238 -238
  16. package/features/features/provision/operations/actions_execution.feature +2 -1
  17. package/features/features/provision/operations/execute_operations.feature +2 -1
  18. package/features/features/provision/operations/execute_periodic_operations.feature +2 -1
  19. package/features/features/provision/operations/find_execution.feature +2 -1
  20. package/features/features/provision/operations/find_executions.feature +2 -1
  21. package/features/features/provision/operations/find_periodic_execution.feature +5 -4
  22. package/features/features/provision/operations/setting_up_period-each_operation.feature +2 -1
  23. package/features/features/provision/operations/update_periodic_operation.feature +2 -1
  24. package/features/features/provision/users/create_delete_user.feature +3 -1
  25. package/features/features/provision/users/find_user.feature +2 -1
  26. package/features/features/provision/users/reset_password.feature +2 -1
  27. package/features/features/provision/users/reset_password_mock.feature +2 -1
  28. package/features/features/provision/users/update_password.feature +4 -4
  29. package/features/features/provision/users/update_user.feature +5 -4
  30. package/features/features/searching/operations/searching_executions.feature +2 -1
  31. package/features/features/searching/operations/searching_periodic_operations.feature +2 -1
  32. package/features/support/create_provision_model.js +1 -0
  33. package/package.json +1 -1
  34. package/src/users/Users.js +16 -2
  35. package/yarn-error.log +1 -1
  36. package/dist/opengate-api-bower-14.3.0.js.map +0 -1
  37. package/dist/opengate-api-bower-14.3.0.min.js.map +0 -1
package/docs/dump.json CHANGED
@@ -72591,7 +72591,7 @@
72591
72591
  "__docId__": 2745,
72592
72592
  "kind": "file",
72593
72593
  "name": "src/users/Users.js",
72594
- "content": "'use strict';\r\n\r\nimport BaseProvision from '../provision/BaseProvision';\r\nimport _ from 'lodash';\r\nimport { version as uuidVersion } from 'uuid';\r\nimport { validate as uuidValidate } from 'uuid';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nconst _length_name = 100;\r\nconst _length_surname = 100;\r\nconst _length_email = 100;\r\nconst _length_twoFaType = 100;\r\nconst _length_password = 50;\r\n/**\r\n * This class allow make get request to user resource into Opengate North API.\r\n */\r\nexport default class User extends BaseProvision {\r\n\r\n\r\n /** \r\n * @param {InternalOpenGateAPI} Reference to the API object.\r\n */\r\n constructor(ogapi) {\r\n super(ogapi, \"/users\", undefined, [\"email\", \"workgroup\", \"domain\", \"profile\", \"countryCode\", \"langCode\"]);\r\n }\r\n\r\n\r\n\r\n /**\r\n * Set the name attribute\r\n * @param {string} name - required field\r\n * @return {User}\r\n */\r\n withName(name) {\r\n if (typeof name !== 'string' || name.length > _length_name)\r\n throw new Error('Parameter name must be a string and has a maximum length of ' + _length_name);\r\n this._name = name;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the surname attribute\r\n * @param {string} surname - required field\r\n * @return {User}\r\n */\r\n withSurname(surname) {\r\n if (typeof surname !== 'string' || surname.length > _length_surname)\r\n throw new Error('Parameter surname must be a string and has a maximum length of ' + _length_surname);\r\n this._surname = surname;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the email attribute\r\n * @param {string} email - required field\r\n * @return {User}\r\n */\r\n withEmail(email) {\r\n if (typeof email !== 'string' || email.length > _length_email)\r\n throw new Error('Parameter email must be a string and has a maximum length of ' + _length_email);\r\n this._email = email;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the password attribute\r\n * @param {string} password - required field\r\n * @return {User}\r\n */\r\n withPassword(password) {\r\n if (typeof password !== 'string' || password.length > _length_password)\r\n throw new Error('Parameter password must be a string and has a maximum length of ' + _length_password);\r\n this._password = password;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the apiKey attribute. Only on update user\r\n * @param {string} apiKey - required field\r\n * @return {User}\r\n */\r\n withApiKey(apiKey) {\r\n if(!this._validateUUID(apiKey)){\r\n throw new Error({ message: \"OGAPI_USER_UPDATE_APIKEY_PARAMETER_INVALID\", parameter: 'apiKey' });\r\n }\r\n this._apiKey = apiKey;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the workgroup attribute\r\n * @param {string} workgroup - required field\r\n * @return {User}\r\n */\r\n withWorkgroup(workgroup) {\r\n if (typeof workgroup !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_WORKGROUP');\r\n this._workgroup = workgroup;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the domain attribute\r\n * @param {string} domain - required field\r\n * @return {User}\r\n */\r\n withDomain(domain) {\r\n if (typeof domain !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_DOMAIN');\r\n this._domain = domain;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the profile attribute\r\n * @param {string} profile - required field\r\n * @return {User}\r\n */\r\n withProfile(profile) {\r\n if (typeof profile !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_PROFILE');\r\n this._profile = profile;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the countryCode attribute\r\n * @param {string} countryCode - required field\r\n * @return {User}\r\n */\r\n withCountryCode(countryCode) {\r\n if (typeof countryCode !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_COUNTRY_CODE');\r\n this._countryCode = countryCode;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the langCode attribute\r\n * @param {string} langCode - required field\r\n * @return {User}\r\n */\r\n withLangCode(langCode) {\r\n if (typeof langCode !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_LANGUAGE');\r\n this._langCode = langCode;\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Set the description attribute\r\n * @param {string} description - required field\r\n * @return {User}\r\n */\r\n withDescription(description) {\r\n if (typeof description !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_DESCRIPTION');\r\n this._description = description;\r\n return this;\r\n\r\n }\r\n\r\n /**\r\n * Set the timezone attribute\r\n * @param {string} timezone - required field\r\n * @return {User}\r\n */\r\n withTimezone(timezone) {\r\n if (typeof timezone !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_TIMEZONE');\r\n this._timezone = timezone;\r\n return this;\r\n\r\n }\r\n\r\n /**\r\n * Set the 2FaType attribute\r\n * @param {string} twoFaType - required field\r\n * @return {User}\r\n */\r\n with2FaType(twoFaType) {\r\n if (typeof twoFaType !== 'string' || twoFaType.length > _length_twoFaType)\r\n throw new Error('Parameter twoFaType must be a string and has a maximum length of ' + _length_twoFaType);\r\n this._twoFaType = twoFaType;\r\n return this;\r\n }\r\n\r\n /**\r\n * Compose url to delete an user\r\n * @return {String} This returns a string with the URL of the request.\r\n * @private\r\n */\r\n _buildURL() {\r\n if (this._email === undefined)\r\n throw new Error('OGAPI_EMAIL_MUST_BE_DEFINED');\r\n var url = this._resource + \"/\" + this._email;\r\n\r\n return url;\r\n\r\n }\r\n\r\n /**\r\n * Compose json message to create a user\r\n * @return {String} This returns a message with user's parameters\r\n * @private\r\n */\r\n _composeElement() {\r\n\r\n var data = {\r\n user: {\r\n name: this._name || undefined,\r\n surname: this._surname || undefined,\r\n password: this._password || undefined,\r\n description: this._description || undefined,\r\n email: this._email || undefined,\r\n workgroup: this._workgroup || undefined,\r\n domain: this._domain || undefined,\r\n profile: this._profile || undefined,\r\n countryCode: this._countryCode || undefined,\r\n langCode: this._langCode || undefined,\r\n timezone: this._timezone || undefined,\r\n \"2FaType\": this._twoFaType || undefined\r\n }\r\n };\r\n\r\n return data;\r\n\r\n }\r\n\r\n /**\r\n * Compose json message to update a user\r\n * @return {String} This returns a message with user's parameters\r\n * @private\r\n */\r\n _composeUpdateElement() {\r\n if (this._email === undefined)\r\n throw new Error('OGAPI_USER_UPDATE_PARAMETER_MUST_BE_DEFINED');\r\n\r\n var data = {\r\n user: {\r\n name: this._name || undefined,\r\n surname: this._surname || undefined,\r\n description: this._description || undefined,\r\n email: this._email || undefined,\r\n workgroup: this._workgroup || undefined,\r\n domain: this._domain || undefined,\r\n profile: this._profile || undefined,\r\n countryCode: this._countryCode || undefined,\r\n langCode: this._langCode || undefined,\r\n timezone: this._timezone || undefined,\r\n apiKey: this._apiKey || undefined,\r\n password: this._password || undefined,\r\n \"2FaType\": this._twoFaType || undefined\r\n }\r\n };\r\n return data;\r\n }\r\n\r\n \r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function updates a password of a user\r\n * @return {Promise}\r\n * @param {String} newPassword - required field\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changePassword(newPassword);\r\n */\r\n changePassword(newPassword) {\r\n this._newPassword = newPassword;\r\n if (_.isEmpty(this._email) || _.isEmpty(this._password) || _.isEmpty(this._newPassword)) {\r\n throw new Error('OGAPI_USER_UPDATE_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n\r\n var data = {\r\n user: {\r\n password: this._newPassword\r\n }\r\n };\r\n\r\n this._setExtraHeaders({\r\n 'X-ApiPass': this._password\r\n });\r\n\r\n return this._doNorthPut(this._buildURL(), data);\r\n }\r\n\r\n _validateUUID(UUID){\r\n return uuidValidate(UUID) && uuidVersion(UUID) === 4\r\n }\r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function updates a apiKey of a user\r\n * @return {Promise}\r\n * @param {String} apiKey - required field\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changeApiKey(newPassword);\r\n */\r\n changeApiKey(apiKey) {\r\n this._apiKey = apiKey;\r\n if (_.isEmpty(this._email) || _.isEmpty(this._password) || _.isEmpty(this._apiKey)) {\r\n throw new Error('OGAPI_USER_UPDATE_APIKEY_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n\r\n if(!this._validateUUID(apiKey)){\r\n throw new Error({ message: \"OGAPI_USER_UPDATE_APIKEY_PARAMETER_INVALID\", parameter: 'apiKey' });\r\n }\r\n\r\n var data = {\r\n user: {\r\n apiKey: this._apiKey\r\n }\r\n };\r\n\r\n this._setExtraHeaders({\r\n 'X-ApiPass': this._password\r\n });\r\n\r\n return this._doNorthPut(this._buildURL(), data);\r\n }\r\n\r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function request for new password when the user forgets it. \r\n * Sends a password recovery email\r\n * @return {Promise}\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().withEmail(example@example.es).requestResetPassword()\r\n */\r\n requestResetPassword() {\r\n if (_.isEmpty(this._email)) {\r\n throw new Error('OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n var url = this._buildURL() + '/reset'\r\n return this._doNorthPost(url);\r\n }\r\n\r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function updates a password of a user with a tokenId\r\n * @param {String} newPassword - required field\r\n * @param {String} tokenId - required field\r\n * @return {Promise}\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().withEmail(example@example.es).updatePassword(newPassword, tokenid);\r\n */\r\n updatePassword(newPassword, tokenId) {\r\n this._newPassword = newPassword;\r\n this._tokenId = tokenId;\r\n if (_.isEmpty(this._email)){\r\n throw new Error('OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n if(_.isEmpty(this._newPassword)){\r\n throw new Error('OGAPI_USER_PASSWORD_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n\r\n if(_.isEmpty(tokenId)){\r\n throw new Error('OGAPI_USER_TOKENID_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n\r\n var data = {\r\n password: this._newPassword\r\n };\r\n\r\n\r\n var url = this._buildURL() + '/reset/' + tokenId\r\n \r\n return this._doNorthPost(url, data);\r\n }\r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function get a JWT for user with Two Factor Authorithation (optional)\r\n * @param {String} email - required field\r\n * @param {String} password - required field\r\n * @param {String} twoFaCode - optional field\r\n * @return {Promise}\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().login(email, password);\r\n * ogapi.usersBuilder().login(email, password, twoFaCode);\r\n */\r\n login(email, password, twoFaCode) {\r\n this._email = email;\r\n this._password = password;\r\n this._twoFaCode = twoFaCode;\r\n if (_.isEmpty(this._email) || _.isEmpty(this._password)) {\r\n throw new Error('OGAPI_USER_LOGIN_EMAIL_AND_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n const data = {\r\n email: this._email,\r\n password: this._password,\r\n \"2FaCode\": this._twoFaCode || undefined\r\n }\r\n \r\n const url = this._resource + '/login';\r\n\r\n return this._doNorthPost(url, data, true)\r\n }\r\n\r\n generateApiKey(){\r\n return uuidv4()\r\n }\r\n}",
72594
+ "content": "'use strict';\r\n\r\nimport BaseProvision from '../provision/BaseProvision';\r\nimport _ from 'lodash';\r\nimport { version as uuidVersion } from 'uuid';\r\nimport { validate as uuidValidate } from 'uuid';\r\nimport { v4 as uuidv4 } from 'uuid';\r\n\r\nconst _length_name = 100;\r\nconst _length_surname = 100;\r\nconst _length_email = 100;\r\nconst _length_twoFaType = 100;\r\nconst _length_password = 50;\r\n/**\r\n * This class allow make get request to user resource into Opengate North API.\r\n */\r\nexport default class User extends BaseProvision {\r\n\r\n\r\n /** \r\n * @param {InternalOpenGateAPI} Reference to the API object.\r\n */\r\n constructor(ogapi) {\r\n super(ogapi, \"/users\", undefined, [\"email\", \"workgroup\", \"domain\", \"profile\", \"countryCode\", \"langCode\"]);\r\n }\r\n\r\n\r\n\r\n /**\r\n * Set the name attribute\r\n * @param {string} name - required field\r\n * @return {User}\r\n */\r\n withName(name) {\r\n if (typeof name !== 'string' || name.length > _length_name)\r\n throw new Error('Parameter name must be a string and has a maximum length of ' + _length_name);\r\n this._name = name;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the surname attribute\r\n * @param {string} surname - required field\r\n * @return {User}\r\n */\r\n withSurname(surname) {\r\n if (typeof surname !== 'string' || surname.length > _length_surname)\r\n throw new Error('Parameter surname must be a string and has a maximum length of ' + _length_surname);\r\n this._surname = surname;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the email attribute\r\n * @param {string} email - required field\r\n * @return {User}\r\n */\r\n withEmail(email) {\r\n if (typeof email !== 'string' || email.length > _length_email)\r\n throw new Error('Parameter email must be a string and has a maximum length of ' + _length_email);\r\n this._email = email;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the password attribute\r\n * @param {string} password - required field\r\n * @return {User}\r\n */\r\n withPassword(password) {\r\n if (typeof password !== 'string' || password.length > _length_password)\r\n throw new Error('Parameter password must be a string and has a maximum length of ' + _length_password);\r\n this._password = password;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the apiKey attribute. Only on update user\r\n * @param {string} apiKey - required field\r\n * @return {User}\r\n */\r\n withApiKey(apiKey) {\r\n if(!this._validateUUID(apiKey)){\r\n throw new Error({ message: \"OGAPI_USER_UPDATE_APIKEY_PARAMETER_INVALID\", parameter: 'apiKey' });\r\n }\r\n this._apiKey = apiKey;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the workgroup attribute\r\n * @param {string} workgroup - required field\r\n * @return {User}\r\n */\r\n withWorkgroup(workgroup) {\r\n if (typeof workgroup !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_WORKGROUP');\r\n this._workgroup = workgroup;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the domain attribute\r\n * @param {string} domain - required field\r\n * @return {User}\r\n */\r\n withDomain(domain) {\r\n if (typeof domain !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_DOMAIN');\r\n this._domain = domain;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the profile attribute\r\n * @param {string} profile - required field\r\n * @return {User}\r\n */\r\n withProfile(profile) {\r\n if (typeof profile !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_PROFILE');\r\n this._profile = profile;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the countryCode attribute\r\n * @param {string} countryCode - required field\r\n * @return {User}\r\n */\r\n withCountryCode(countryCode) {\r\n if (typeof countryCode !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_COUNTRY_CODE');\r\n this._countryCode = countryCode;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the langCode attribute\r\n * @param {string} langCode - required field\r\n * @return {User}\r\n */\r\n withLangCode(langCode) {\r\n if (typeof langCode !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_LANGUAGE');\r\n this._langCode = langCode;\r\n return this;\r\n }\r\n\r\n\r\n /**\r\n * Set the description attribute\r\n * @param {string} description - required field\r\n * @return {User}\r\n */\r\n withDescription(description) {\r\n if (typeof description !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_DESCRIPTION');\r\n this._description = description;\r\n return this;\r\n\r\n }\r\n\r\n /**\r\n * Set the timezone attribute\r\n * @param {string} timezone - required field\r\n * @return {User}\r\n */\r\n withTimezone(timezone) {\r\n if (typeof timezone !== 'string')\r\n throw new Error('OGAPI_STRING_PARAMETER_TIMEZONE');\r\n this._timezone = timezone;\r\n return this;\r\n\r\n }\r\n\r\n /**\r\n * Set the 2FaType attribute\r\n * @param {string} twoFaType - required field\r\n * @return {User}\r\n */\r\n with2FaType(twoFaType) {\r\n if (typeof twoFaType !== 'string' || twoFaType.length > _length_twoFaType)\r\n throw new Error('Parameter twoFaType must be a string and has a maximum length of ' + _length_twoFaType);\r\n this._twoFaType = twoFaType;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the forcePasswordChange: if true Forces you to reset your password on your next login attempt.\r\n * @param {boolean} forcePasswordChange\r\n * @return {User}\r\n * \r\n */\r\n withForcePasswordChange(forcePasswordChange) {\r\n if (typeof forcePasswordChange !== 'boolean')\r\n throw new Error('Parameter forcePasswordChange must be a boolean');\r\n this._forcePasswordChange = forcePasswordChange;\r\n return this;\r\n }\r\n /**\r\n * Compose url to delete an user\r\n * @return {String} This returns a string with the URL of the request.\r\n * @private\r\n */\r\n _buildURL() {\r\n if (this._email === undefined)\r\n throw new Error('OGAPI_EMAIL_MUST_BE_DEFINED');\r\n var url = this._resource + \"/\" + this._email;\r\n\r\n return url;\r\n\r\n }\r\n\r\n /**\r\n * Compose json message to create a user\r\n * @return {String} This returns a message with user's parameters\r\n * @private\r\n */\r\n _composeElement() {\r\n\r\n var data = {\r\n user: {\r\n name: this._name || undefined,\r\n surname: this._surname || undefined,\r\n password: this._password || undefined,\r\n description: this._description || undefined,\r\n email: this._email || undefined,\r\n workgroup: this._workgroup || undefined,\r\n domain: this._domain || undefined,\r\n profile: this._profile || undefined,\r\n countryCode: this._countryCode || undefined,\r\n langCode: this._langCode || undefined,\r\n timezone: this._timezone || undefined,\r\n \"2FaType\": this._twoFaType || undefined,\r\n forcePasswordChange: typeof this._forcePasswordChange === 'boolean' ? this._forcePasswordChange : undefined\r\n }\r\n };\r\n\r\n return data;\r\n\r\n }\r\n\r\n /**\r\n * Compose json message to update a user\r\n * @return {String} This returns a message with user's parameters\r\n * @private\r\n */\r\n _composeUpdateElement() {\r\n if (this._email === undefined)\r\n throw new Error('OGAPI_USER_UPDATE_PARAMETER_MUST_BE_DEFINED');\r\n\r\n var data = {\r\n user: {\r\n name: this._name || undefined,\r\n surname: this._surname || undefined,\r\n description: this._description || undefined,\r\n email: this._email || undefined,\r\n workgroup: this._workgroup || undefined,\r\n domain: this._domain || undefined,\r\n profile: this._profile || undefined,\r\n countryCode: this._countryCode || undefined,\r\n langCode: this._langCode || undefined,\r\n timezone: this._timezone || undefined,\r\n apiKey: this._apiKey || undefined,\r\n password: this._password || undefined,\r\n \"2FaType\": this._twoFaType || undefined,\r\n forcePasswordChange: typeof this._forcePasswordChange === 'boolean' ? this._forcePasswordChange : undefined\r\n }\r\n };\r\n return data;\r\n }\r\n\r\n \r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function updates a password of a user\r\n * @return {Promise}\r\n * @param {String} newPassword - required field\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changePassword(newPassword);\r\n */\r\n changePassword(newPassword) {\r\n this._newPassword = newPassword;\r\n if (_.isEmpty(this._email) || _.isEmpty(this._password) || _.isEmpty(this._newPassword)) {\r\n throw new Error('OGAPI_USER_UPDATE_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n\r\n var data = {\r\n user: {\r\n password: this._newPassword\r\n }\r\n };\r\n\r\n this._setExtraHeaders({\r\n 'X-ApiPass': this._password\r\n });\r\n\r\n return this._doNorthPut(this._buildURL(), data);\r\n }\r\n\r\n _validateUUID(UUID){\r\n return uuidValidate(UUID) && uuidVersion(UUID) === 4\r\n }\r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function updates a apiKey of a user\r\n * @return {Promise}\r\n * @param {String} apiKey - required field\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changeApiKey(newPassword);\r\n */\r\n changeApiKey(apiKey) {\r\n this._apiKey = apiKey;\r\n if (_.isEmpty(this._email) || _.isEmpty(this._password) || _.isEmpty(this._apiKey)) {\r\n throw new Error('OGAPI_USER_UPDATE_APIKEY_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n\r\n if(!this._validateUUID(apiKey)){\r\n throw new Error({ message: \"OGAPI_USER_UPDATE_APIKEY_PARAMETER_INVALID\", parameter: 'apiKey' });\r\n }\r\n\r\n var data = {\r\n user: {\r\n apiKey: this._apiKey\r\n }\r\n };\r\n\r\n this._setExtraHeaders({\r\n 'X-ApiPass': this._password\r\n });\r\n\r\n return this._doNorthPut(this._buildURL(), data);\r\n }\r\n\r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function request for new password when the user forgets it. \r\n * Sends a password recovery email\r\n * @return {Promise}\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().withEmail(example@example.es).requestResetPassword()\r\n */\r\n requestResetPassword() {\r\n if (_.isEmpty(this._email)) {\r\n throw new Error('OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n var url = this._buildURL() + '/reset'\r\n return this._doNorthPost(url);\r\n }\r\n\r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function updates a password of a user with a tokenId\r\n * @param {String} newPassword - required field\r\n * @param {String} tokenId - required field\r\n * @return {Promise}\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().withEmail(example@example.es).updatePassword(newPassword, tokenid);\r\n */\r\n updatePassword(newPassword, tokenId) {\r\n this._newPassword = newPassword;\r\n this._tokenId = tokenId;\r\n if (_.isEmpty(this._email)){\r\n throw new Error('OGAPI_USER_MAIL_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n if(_.isEmpty(this._newPassword)){\r\n throw new Error('OGAPI_USER_PASSWORD_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n\r\n if(_.isEmpty(tokenId)){\r\n throw new Error('OGAPI_USER_TOKENID_RESET_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n\r\n var data = {\r\n password: this._newPassword\r\n };\r\n\r\n\r\n var url = this._buildURL() + '/reset/' + tokenId\r\n \r\n return this._doNorthPost(url, data);\r\n }\r\n /**\r\n * This invoke a request to OpenGate North API and the callback is managed by promises\r\n * This function get a JWT for user with Two Factor Authorithation (optional)\r\n * @param {String} email - required field\r\n * @param {String} password - required field\r\n * @param {String} twoFaCode - optional field\r\n * @return {Promise}\r\n * @property {function (result:object, statusCode:number)} then - When request it is OK\r\n * @property {function (error:string)} catch - When request it is NOK\r\n * @example\r\n * ogapi.usersBuilder().login(email, password);\r\n * ogapi.usersBuilder().login(email, password, twoFaCode);\r\n */\r\n login(email, password, twoFaCode) {\r\n this._email = email;\r\n this._password = password;\r\n this._twoFaCode = twoFaCode;\r\n if (_.isEmpty(this._email) || _.isEmpty(this._password)) {\r\n throw new Error('OGAPI_USER_LOGIN_EMAIL_AND_PASSWORD_PARAMETER_MUST_BE_DEFINED');\r\n }\r\n const data = {\r\n email: this._email,\r\n password: this._password,\r\n \"2FaCode\": this._twoFaCode || undefined\r\n }\r\n \r\n const url = this._resource + '/login';\r\n\r\n return this._doNorthPost(url, data, true)\r\n }\r\n\r\n generateApiKey(){\r\n return uuidv4()\r\n }\r\n}",
72595
72595
  "static": true,
72596
72596
  "longname": "src/users/Users.js",
72597
72597
  "access": null,
@@ -73502,6 +73502,62 @@
73502
73502
  {
73503
73503
  "__docId__": 2779,
73504
73504
  "kind": "method",
73505
+ "name": "withForcePasswordChange",
73506
+ "memberof": "src/users/Users.js~User",
73507
+ "generator": false,
73508
+ "async": false,
73509
+ "static": false,
73510
+ "longname": "src/users/Users.js~User#withForcePasswordChange",
73511
+ "access": null,
73512
+ "description": "Set the forcePasswordChange: if true Forces you to reset your password on your next login attempt.",
73513
+ "lineNumber": 195,
73514
+ "params": [
73515
+ {
73516
+ "nullable": null,
73517
+ "types": [
73518
+ "boolean"
73519
+ ],
73520
+ "spread": false,
73521
+ "optional": false,
73522
+ "name": "forcePasswordChange",
73523
+ "description": ""
73524
+ }
73525
+ ],
73526
+ "return": {
73527
+ "nullable": null,
73528
+ "types": [
73529
+ "User"
73530
+ ],
73531
+ "spread": false,
73532
+ "description": ""
73533
+ }
73534
+ },
73535
+ {
73536
+ "__docId__": 2780,
73537
+ "kind": "member",
73538
+ "name": "_forcePasswordChange",
73539
+ "memberof": "src/users/Users.js~User",
73540
+ "static": false,
73541
+ "longname": "src/users/Users.js~User#_forcePasswordChange",
73542
+ "access": null,
73543
+ "description": null,
73544
+ "lineNumber": 198,
73545
+ "undocument": true,
73546
+ "unknown": [
73547
+ {
73548
+ "tagName": "@_undocument",
73549
+ "tagValue": ""
73550
+ }
73551
+ ],
73552
+ "type": {
73553
+ "types": [
73554
+ "*"
73555
+ ]
73556
+ }
73557
+ },
73558
+ {
73559
+ "__docId__": 2781,
73560
+ "kind": "method",
73505
73561
  "name": "_buildURL",
73506
73562
  "memberof": "src/users/Users.js~User",
73507
73563
  "generator": false,
@@ -73510,7 +73566,7 @@
73510
73566
  "longname": "src/users/Users.js~User#_buildURL",
73511
73567
  "access": "private",
73512
73568
  "description": "Compose url to delete an user",
73513
- "lineNumber": 194,
73569
+ "lineNumber": 206,
73514
73570
  "params": [],
73515
73571
  "return": {
73516
73572
  "nullable": null,
@@ -73522,7 +73578,7 @@
73522
73578
  }
73523
73579
  },
73524
73580
  {
73525
- "__docId__": 2780,
73581
+ "__docId__": 2782,
73526
73582
  "kind": "method",
73527
73583
  "name": "_composeElement",
73528
73584
  "memberof": "src/users/Users.js~User",
@@ -73532,7 +73588,7 @@
73532
73588
  "longname": "src/users/Users.js~User#_composeElement",
73533
73589
  "access": "private",
73534
73590
  "description": "Compose json message to create a user",
73535
- "lineNumber": 208,
73591
+ "lineNumber": 220,
73536
73592
  "params": [],
73537
73593
  "return": {
73538
73594
  "nullable": null,
@@ -73544,7 +73600,7 @@
73544
73600
  }
73545
73601
  },
73546
73602
  {
73547
- "__docId__": 2781,
73603
+ "__docId__": 2783,
73548
73604
  "kind": "method",
73549
73605
  "name": "_composeUpdateElement",
73550
73606
  "memberof": "src/users/Users.js~User",
@@ -73554,7 +73610,7 @@
73554
73610
  "longname": "src/users/Users.js~User#_composeUpdateElement",
73555
73611
  "access": "private",
73556
73612
  "description": "Compose json message to update a user",
73557
- "lineNumber": 236,
73613
+ "lineNumber": 249,
73558
73614
  "params": [],
73559
73615
  "return": {
73560
73616
  "nullable": null,
@@ -73566,7 +73622,7 @@
73566
73622
  }
73567
73623
  },
73568
73624
  {
73569
- "__docId__": 2782,
73625
+ "__docId__": 2784,
73570
73626
  "kind": "method",
73571
73627
  "name": "changePassword",
73572
73628
  "memberof": "src/users/Users.js~User",
@@ -73579,7 +73635,7 @@
73579
73635
  "examples": [
73580
73636
  " ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changePassword(newPassword);"
73581
73637
  ],
73582
- "lineNumber": 271,
73638
+ "lineNumber": 285,
73583
73639
  "params": [
73584
73640
  {
73585
73641
  "nullable": null,
@@ -73624,7 +73680,7 @@
73624
73680
  }
73625
73681
  },
73626
73682
  {
73627
- "__docId__": 2783,
73683
+ "__docId__": 2785,
73628
73684
  "kind": "member",
73629
73685
  "name": "_newPassword",
73630
73686
  "memberof": "src/users/Users.js~User",
@@ -73632,7 +73688,7 @@
73632
73688
  "longname": "src/users/Users.js~User#_newPassword",
73633
73689
  "access": null,
73634
73690
  "description": null,
73635
- "lineNumber": 272,
73691
+ "lineNumber": 286,
73636
73692
  "undocument": true,
73637
73693
  "unknown": [
73638
73694
  {
@@ -73647,7 +73703,7 @@
73647
73703
  }
73648
73704
  },
73649
73705
  {
73650
- "__docId__": 2784,
73706
+ "__docId__": 2786,
73651
73707
  "kind": "method",
73652
73708
  "name": "_validateUUID",
73653
73709
  "memberof": "src/users/Users.js~User",
@@ -73657,7 +73713,7 @@
73657
73713
  "longname": "src/users/Users.js~User#_validateUUID",
73658
73714
  "access": null,
73659
73715
  "description": null,
73660
- "lineNumber": 290,
73716
+ "lineNumber": 304,
73661
73717
  "undocument": true,
73662
73718
  "unknown": [
73663
73719
  {
@@ -73680,7 +73736,7 @@
73680
73736
  }
73681
73737
  },
73682
73738
  {
73683
- "__docId__": 2785,
73739
+ "__docId__": 2787,
73684
73740
  "kind": "method",
73685
73741
  "name": "changeApiKey",
73686
73742
  "memberof": "src/users/Users.js~User",
@@ -73693,7 +73749,7 @@
73693
73749
  "examples": [
73694
73750
  " ogapi.usersBuilder().withEmail(example@example.es).withPassword(oldPassword).changeApiKey(newPassword);"
73695
73751
  ],
73696
- "lineNumber": 303,
73752
+ "lineNumber": 317,
73697
73753
  "params": [
73698
73754
  {
73699
73755
  "nullable": null,
@@ -73738,7 +73794,7 @@
73738
73794
  }
73739
73795
  },
73740
73796
  {
73741
- "__docId__": 2786,
73797
+ "__docId__": 2788,
73742
73798
  "kind": "member",
73743
73799
  "name": "_apiKey",
73744
73800
  "memberof": "src/users/Users.js~User",
@@ -73746,7 +73802,7 @@
73746
73802
  "longname": "src/users/Users.js~User#_apiKey",
73747
73803
  "access": null,
73748
73804
  "description": null,
73749
- "lineNumber": 304,
73805
+ "lineNumber": 318,
73750
73806
  "undocument": true,
73751
73807
  "unknown": [
73752
73808
  {
@@ -73761,7 +73817,7 @@
73761
73817
  }
73762
73818
  },
73763
73819
  {
73764
- "__docId__": 2787,
73820
+ "__docId__": 2789,
73765
73821
  "kind": "method",
73766
73822
  "name": "requestResetPassword",
73767
73823
  "memberof": "src/users/Users.js~User",
@@ -73774,7 +73830,7 @@
73774
73830
  "examples": [
73775
73831
  " ogapi.usersBuilder().withEmail(example@example.es).requestResetPassword()"
73776
73832
  ],
73777
- "lineNumber": 336,
73833
+ "lineNumber": 350,
73778
73834
  "params": [],
73779
73835
  "properties": [
73780
73836
  {
@@ -73808,7 +73864,7 @@
73808
73864
  }
73809
73865
  },
73810
73866
  {
73811
- "__docId__": 2788,
73867
+ "__docId__": 2790,
73812
73868
  "kind": "method",
73813
73869
  "name": "updatePassword",
73814
73870
  "memberof": "src/users/Users.js~User",
@@ -73821,7 +73877,7 @@
73821
73877
  "examples": [
73822
73878
  " ogapi.usersBuilder().withEmail(example@example.es).updatePassword(newPassword, tokenid);"
73823
73879
  ],
73824
- "lineNumber": 355,
73880
+ "lineNumber": 369,
73825
73881
  "params": [
73826
73882
  {
73827
73883
  "nullable": null,
@@ -73876,7 +73932,7 @@
73876
73932
  }
73877
73933
  },
73878
73934
  {
73879
- "__docId__": 2789,
73935
+ "__docId__": 2791,
73880
73936
  "kind": "member",
73881
73937
  "name": "_newPassword",
73882
73938
  "memberof": "src/users/Users.js~User",
@@ -73884,7 +73940,7 @@
73884
73940
  "longname": "src/users/Users.js~User#_newPassword",
73885
73941
  "access": null,
73886
73942
  "description": null,
73887
- "lineNumber": 356,
73943
+ "lineNumber": 370,
73888
73944
  "undocument": true,
73889
73945
  "unknown": [
73890
73946
  {
@@ -73899,7 +73955,7 @@
73899
73955
  }
73900
73956
  },
73901
73957
  {
73902
- "__docId__": 2790,
73958
+ "__docId__": 2792,
73903
73959
  "kind": "member",
73904
73960
  "name": "_tokenId",
73905
73961
  "memberof": "src/users/Users.js~User",
@@ -73907,7 +73963,7 @@
73907
73963
  "longname": "src/users/Users.js~User#_tokenId",
73908
73964
  "access": null,
73909
73965
  "description": null,
73910
- "lineNumber": 357,
73966
+ "lineNumber": 371,
73911
73967
  "undocument": true,
73912
73968
  "unknown": [
73913
73969
  {
@@ -73922,7 +73978,7 @@
73922
73978
  }
73923
73979
  },
73924
73980
  {
73925
- "__docId__": 2791,
73981
+ "__docId__": 2793,
73926
73982
  "kind": "method",
73927
73983
  "name": "login",
73928
73984
  "memberof": "src/users/Users.js~User",
@@ -73935,7 +73991,7 @@
73935
73991
  "examples": [
73936
73992
  " ogapi.usersBuilder().login(email, password);\n ogapi.usersBuilder().login(email, password, twoFaCode);"
73937
73993
  ],
73938
- "lineNumber": 391,
73994
+ "lineNumber": 405,
73939
73995
  "params": [
73940
73996
  {
73941
73997
  "nullable": null,
@@ -74000,7 +74056,7 @@
74000
74056
  }
74001
74057
  },
74002
74058
  {
74003
- "__docId__": 2792,
74059
+ "__docId__": 2794,
74004
74060
  "kind": "member",
74005
74061
  "name": "_email",
74006
74062
  "memberof": "src/users/Users.js~User",
@@ -74008,7 +74064,7 @@
74008
74064
  "longname": "src/users/Users.js~User#_email",
74009
74065
  "access": null,
74010
74066
  "description": null,
74011
- "lineNumber": 392,
74067
+ "lineNumber": 406,
74012
74068
  "undocument": true,
74013
74069
  "unknown": [
74014
74070
  {
@@ -74023,7 +74079,7 @@
74023
74079
  }
74024
74080
  },
74025
74081
  {
74026
- "__docId__": 2793,
74082
+ "__docId__": 2795,
74027
74083
  "kind": "member",
74028
74084
  "name": "_password",
74029
74085
  "memberof": "src/users/Users.js~User",
@@ -74031,7 +74087,7 @@
74031
74087
  "longname": "src/users/Users.js~User#_password",
74032
74088
  "access": null,
74033
74089
  "description": null,
74034
- "lineNumber": 393,
74090
+ "lineNumber": 407,
74035
74091
  "undocument": true,
74036
74092
  "unknown": [
74037
74093
  {
@@ -74046,7 +74102,7 @@
74046
74102
  }
74047
74103
  },
74048
74104
  {
74049
- "__docId__": 2794,
74105
+ "__docId__": 2796,
74050
74106
  "kind": "member",
74051
74107
  "name": "_twoFaCode",
74052
74108
  "memberof": "src/users/Users.js~User",
@@ -74054,7 +74110,7 @@
74054
74110
  "longname": "src/users/Users.js~User#_twoFaCode",
74055
74111
  "access": null,
74056
74112
  "description": null,
74057
- "lineNumber": 394,
74113
+ "lineNumber": 408,
74058
74114
  "undocument": true,
74059
74115
  "unknown": [
74060
74116
  {
@@ -74069,7 +74125,7 @@
74069
74125
  }
74070
74126
  },
74071
74127
  {
74072
- "__docId__": 2795,
74128
+ "__docId__": 2797,
74073
74129
  "kind": "method",
74074
74130
  "name": "generateApiKey",
74075
74131
  "memberof": "src/users/Users.js~User",
@@ -74079,7 +74135,7 @@
74079
74135
  "longname": "src/users/Users.js~User#generateApiKey",
74080
74136
  "access": null,
74081
74137
  "description": null,
74082
- "lineNumber": 409,
74138
+ "lineNumber": 423,
74083
74139
  "undocument": true,
74084
74140
  "unknown": [
74085
74141
  {
@@ -74095,7 +74151,7 @@
74095
74151
  }
74096
74152
  },
74097
74153
  {
74098
- "__docId__": 2796,
74154
+ "__docId__": 2798,
74099
74155
  "kind": "file",
74100
74156
  "name": "src/util/DATE_FORMAT.js",
74101
74157
  "content": "'use strict';\r\n\r\n/**\r\n * Global date format.\r\n */\r\nexport const DATE_FORMAT = \"\";\r\n/**\r\n * Global time format.\r\n */\r\nexport const TIME_FORMAT = \"HH:mm:ssZ\";",
@@ -74106,7 +74162,7 @@
74106
74162
  "lineNumber": 1
74107
74163
  },
74108
74164
  {
74109
- "__docId__": 2797,
74165
+ "__docId__": 2799,
74110
74166
  "kind": "variable",
74111
74167
  "name": "DATE_FORMAT",
74112
74168
  "memberof": "src/util/DATE_FORMAT.js",
@@ -74125,7 +74181,7 @@
74125
74181
  }
74126
74182
  },
74127
74183
  {
74128
- "__docId__": 2798,
74184
+ "__docId__": 2800,
74129
74185
  "kind": "variable",
74130
74186
  "name": "TIME_FORMAT",
74131
74187
  "memberof": "src/util/DATE_FORMAT.js",
@@ -74144,7 +74200,7 @@
74144
74200
  }
74145
74201
  },
74146
74202
  {
74147
- "__docId__": 2799,
74203
+ "__docId__": 2801,
74148
74204
  "kind": "file",
74149
74205
  "name": "src/util/Expression.js",
74150
74206
  "content": "'use strict';\r\n\r\nexport default class Expression{\r\n\r\n/**\r\n * @example\r\n * Ex.eq(\"entityId\", \"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\")\r\n *\r\n *\r\n *returns:\r\n *\r\n *\t{\r\n *\t eq : {\r\n *\t \"entityId\": \"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\"\r\n *\t }\r\n *\t}\r\n * @return {object} This returns a json with the query of the operator \"eq\" built.\r\n * @param {String} key - This is the name of the field\r\n * @param {String} value - This is the value of the field\r\n */\r\n\tstatic eq(key, value){\r\n\t\treturn { eq: { [key]: value } };\r\n\t}\r\n\r\n/**\r\n * @example\r\n * Ex.neq(\"entityId\", \"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\")\r\n *\r\n *\r\n *returns:\r\n *\r\n *\t{\r\n *\t neq : {\r\n *\t \"entityId\": \"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\"\r\n *\t }\r\n *\t}\r\n * @return {object} This returns a json with the query of the operator \"neq\" built.\r\n * @param {String} key - This is the name of the field\r\n * @param {String} value - This is the value of the field\r\n*/\r\n\tstatic neq(key, value){\r\n\t\treturn { neq: { [key]: value } };\r\n\t}\r\n\r\n/**\r\n * @example\r\n * Ex.like(\"collected.serialNumber\", \"SN\")\r\n *\r\n *\r\n *returns:\r\n *\r\n *\t{\r\n *\t like : {\r\n *\t \"collected.serialNumber\": \"SN\"\r\n *\t }\r\n *\t}\r\n * @return {object} This returns a json with the query of the operator \"like\" built.\r\n * @param {String} key - This is the name of the field\r\n * @param {String} value - This is the value of the field\r\n */\r\n\tstatic like(key, value){\r\n\t\treturn { like: { [key]: value } };\r\n\t}\r\n\t\r\n/**\r\n * @example\r\n * Ex.gt(\"collected.imei\", \"123456786543210\")\r\n *\r\n *\r\n *returns:\r\n *\r\n *\t{\r\n *\t gt : {\r\n *\t \"collected.imei\": \"123456786543210\"\r\n *\t }\r\n *\t}\r\n * @return {object} This returns a json with the query of the operator \"gt\" built.\r\n * @param {String} key - This is the name of the field\r\n * @param {String} value - This is the value of the field\r\n */\r\n\tstatic gt(key, value){\r\n\t\treturn { gt: { [key]: value } };\r\n\t}\r\n\r\n/**\r\n * @example\r\n * Ex.lt(\"collected.imei\", \"123456786543210\")\r\n *\r\n *\r\n *returns:\r\n *\r\n *\t{\r\n *\t lt : {\r\n *\t \"collected.imei\": \"123456786543210\"\r\n *\t }\r\n *\t}\r\n * @return {object} This returns a json with the query of the operator \"lt\" built.\r\n * @param {String} key - This is the name of the field\r\n * @param {String} value - This is the value of the field\r\n */\t\r\n\tstatic lt(key, value){\r\n\t\treturn { lt: { [key]: value } };\r\n\t}\r\n\r\n/**\r\n * @example\r\n * Ex.gte(\"collected.imei\", \"123456786543210\")\r\n *\r\n *\r\n *\t{\r\n *\t gte : {\r\n *\t \"collected.imei\": \"123456786543210\"\r\n *\t }\r\n *\t}\r\n * @return {object} This returns a json with the query of the operator \"gte\" built.\r\n * @param {String} key - This is the name of the field\r\n * @param {String} value - This is the value of the field\r\n */\t\r\n\tstatic gte(key, value){\r\n\t\treturn { gte: { [key]: value } };\r\n\t}\r\n\r\n/**\r\n * @example\r\n * Ex.lte(\"collected.imei\", \"123456786543210\")\r\n *\r\n *\r\n *\t{\r\n *\t lte : {\r\n *\t \"collected.imei\": \"123456786543210\"\r\n *\t }\r\n *\t}\r\n * @return {object} This returns a json with the query of the operator \"lte\" built.\r\n * @param {String} key - This is the name of the field\r\n * @param {String} value - This is the value of the field\r\n */\t\r\n\tstatic lte(key, value){\r\n\t\treturn { lte: { [key]: value } };\r\n\t}\r\n\r\n/**\r\n * @example\r\n * Ex.in(\"entityId\", [\"e64ccd08-e302-4b65-b19d-e38eeb7b2d24\",\"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\"])\r\n *\r\n *\r\n *\t{\r\n *\t in : {\r\n *\t \"entityId\": [\"e64ccd08-e302-4b65-b19d-e38eeb7b2d24\",\"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\"]\r\n *\t }\r\n *\t}\r\n * @return {object} This returns a json with the query of the operator \"in\" built.\r\n * @param {String} key - This is the name of the field\r\n * @param {String} value - This is the value of the field\r\n */\t\r\n\tstatic in(key, value){\r\n\t\treturn { in: { [key]: value } };\r\n\t}\r\n\r\n/**\r\n * @example\r\n * Ex.or(Ex.like(\"collected.serialNumber\", \"SN\"), Ex.eq(\"entityId\", \"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\"))\r\n *\r\n * \r\n *returns:\r\n *\r\n *\t{\r\n *\t or : [\r\n *\t {\r\n *\t like: {\r\n *\t \"collected.serialNumber\": \"SN\"\r\n *\t }\r\n *\t }, \r\n *\t {\r\n *\t eq: {\r\n *\t \"entityId\": \"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\"\r\n *\t }\r\n *\t }\r\n *\t ]\r\n *\t}\r\n * @return {object} This returns a json with the query of the logical operator \"or\" built.\r\n */\r\n\tstatic or(...args){\r\n\t\tvar filter = { or: [] };\r\n\t\tfor (var i = 0; i < args.length; i++)\r\n\t\t\tfilter.or.push(args[i]);\r\n\t\treturn filter;\r\n\t}\r\n\r\n/**\r\n * @example\r\n * Ex.and(Ex.like(\"collected.serialNumber\", \"SN\"), Ex.eq(\"entityId\", \"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\"))\r\n *\r\n *\r\n *returns:\r\n *\r\n *\t{\r\n *\t and : [\r\n *\t {\r\n *\t like: {\r\n *\t \"collected.serialNumber\": \"SN\"\r\n *\t }\r\n *\t }, \r\n *\t {\r\n *\t eq: {\r\n *\t \"entityId\": \"e64ccd08-e302-4b65-b19d-e38eeb7b2d25\"\r\n *\t }\r\n *\t }\r\n *\t ]\r\n *\t}\r\n * @return {object} This returns a json with the query of the logical operator \"and\" built.\r\n */\r\n\tstatic and(...args){\r\n\t\tvar filter = { and: [] };\r\n\t\tfor (var i = 0; i < args.length; i++)\r\n\t\t\tfilter.and.push(args[i]);\r\n\t\treturn filter;\r\n\t}\r\n\r\n}",
@@ -74155,7 +74211,7 @@
74155
74211
  "lineNumber": 1
74156
74212
  },
74157
74213
  {
74158
- "__docId__": 2800,
74214
+ "__docId__": 2802,
74159
74215
  "kind": "class",
74160
74216
  "name": "Expression",
74161
74217
  "memberof": "src/util/Expression.js",
@@ -74177,7 +74233,7 @@
74177
74233
  "interface": false
74178
74234
  },
74179
74235
  {
74180
- "__docId__": 2801,
74236
+ "__docId__": 2803,
74181
74237
  "kind": "method",
74182
74238
  "name": "eq",
74183
74239
  "memberof": "src/util/Expression.js~Expression",
@@ -74223,7 +74279,7 @@
74223
74279
  }
74224
74280
  },
74225
74281
  {
74226
- "__docId__": 2802,
74282
+ "__docId__": 2804,
74227
74283
  "kind": "method",
74228
74284
  "name": "neq",
74229
74285
  "memberof": "src/util/Expression.js~Expression",
@@ -74269,7 +74325,7 @@
74269
74325
  }
74270
74326
  },
74271
74327
  {
74272
- "__docId__": 2803,
74328
+ "__docId__": 2805,
74273
74329
  "kind": "method",
74274
74330
  "name": "like",
74275
74331
  "memberof": "src/util/Expression.js~Expression",
@@ -74315,7 +74371,7 @@
74315
74371
  }
74316
74372
  },
74317
74373
  {
74318
- "__docId__": 2804,
74374
+ "__docId__": 2806,
74319
74375
  "kind": "method",
74320
74376
  "name": "gt",
74321
74377
  "memberof": "src/util/Expression.js~Expression",
@@ -74361,7 +74417,7 @@
74361
74417
  }
74362
74418
  },
74363
74419
  {
74364
- "__docId__": 2805,
74420
+ "__docId__": 2807,
74365
74421
  "kind": "method",
74366
74422
  "name": "lt",
74367
74423
  "memberof": "src/util/Expression.js~Expression",
@@ -74407,7 +74463,7 @@
74407
74463
  }
74408
74464
  },
74409
74465
  {
74410
- "__docId__": 2806,
74466
+ "__docId__": 2808,
74411
74467
  "kind": "method",
74412
74468
  "name": "gte",
74413
74469
  "memberof": "src/util/Expression.js~Expression",
@@ -74453,7 +74509,7 @@
74453
74509
  }
74454
74510
  },
74455
74511
  {
74456
- "__docId__": 2807,
74512
+ "__docId__": 2809,
74457
74513
  "kind": "method",
74458
74514
  "name": "lte",
74459
74515
  "memberof": "src/util/Expression.js~Expression",
@@ -74499,7 +74555,7 @@
74499
74555
  }
74500
74556
  },
74501
74557
  {
74502
- "__docId__": 2808,
74558
+ "__docId__": 2810,
74503
74559
  "kind": "method",
74504
74560
  "name": "in",
74505
74561
  "memberof": "src/util/Expression.js~Expression",
@@ -74545,7 +74601,7 @@
74545
74601
  }
74546
74602
  },
74547
74603
  {
74548
- "__docId__": 2809,
74604
+ "__docId__": 2811,
74549
74605
  "kind": "method",
74550
74606
  "name": "or",
74551
74607
  "memberof": "src/util/Expression.js~Expression",
@@ -74578,7 +74634,7 @@
74578
74634
  }
74579
74635
  },
74580
74636
  {
74581
- "__docId__": 2810,
74637
+ "__docId__": 2812,
74582
74638
  "kind": "method",
74583
74639
  "name": "and",
74584
74640
  "memberof": "src/util/Expression.js~Expression",
@@ -74611,7 +74667,7 @@
74611
74667
  }
74612
74668
  },
74613
74669
  {
74614
- "__docId__": 2811,
74670
+ "__docId__": 2813,
74615
74671
  "kind": "file",
74616
74672
  "name": "src/util/NorthAmpliaREST.js",
74617
74673
  "content": "'use strict';\r\n\r\nimport merge from 'merge';\r\nimport urlencode from 'urlencode';\r\nimport request, { mkcol } from 'superagent';\r\nimport q from 'q';\r\nimport _ from 'lodash'\r\nimport mime from 'mime-types'\r\n\r\n// MOCK user searching\r\nimport _mock from 'superagent-mocker';\r\nconst mock = _mock(request);\r\n//\r\n\r\n/**\r\n * This is a wrapper of a Rest api javascript\r\n */\r\nexport default class NorthAmpliaREST {\r\n /**\r\n * @param {{ url: string,port: string,version: string,apiKey: string,JTW: string}} _options - this is configuration about Opengate North API.\r\n * @param {function} backend - this is a backend selected to manage a request to Opengate North API.\r\n */\r\n constructor(_options, headers) {\r\n this._options = merge.recursive(true, this.default(), _options);\r\n this._headers = headers;\r\n if (!_.isEmpty(_options.mocks)) {\r\n this._applyMocks(_options.mocks)\r\n }\r\n // ---------------------------------- EXAMPLE\r\n /*\r\n mock.post(_options.url + '/search/channels', function(req) {\r\n return {\r\n body: {\r\n \"channels\": [{\r\n \"name\": \"default_channel\",\r\n \"description\": \"Automatic channel\",\r\n \"organization\": \"organization_GetSetParam\",\r\n \"certificates\": []\r\n }]\r\n },\r\n statusCode: 200\r\n };\r\n }); \r\n */\r\n }\r\n\r\n _applyMocks (mocks) {\r\n const methods = Object.keys(mocks).filter((method) => !_.isEmpty(mocks[method]))\r\n methods.forEach(method => {\r\n console.log(`Mocking ${method.toLocaleUpperCase()} requests`);\r\n Object.keys(mocks[method]).forEach(url => {\r\n console.log('Mocking url:', url);\r\n const methodByUrl = mocks[method][url]\r\n mock[method](this._options.url + url, (req) => {\r\n if(typeof methodByUrl === 'function'){\r\n console.log('Function returned')\r\n return methodByUrl(req)\r\n } else{\r\n const data = mocks[method][url]\r\n console.log('Data returned:', data)\r\n if (!data.headers) data.headers = {}\r\n return data\r\n }\r\n });\r\n })\r\n })\r\n }\r\n\r\n /**\r\n * This return a default configuration object\r\n * @return {object}\r\n */\r\n default () {\r\n return {\r\n timeout: 5000\r\n };\r\n }\r\n\r\n _url(options) {\r\n return options.url;\r\n }\r\n\r\n /**\r\n * Invoke GET action to url specified\r\n * @param {!string} url - url to execute GET\r\n * @param {number} timeout - timeout in milliseconds \r\n * @param {object} headers - headers of request\r\n * @param {object} parameters - parameters of request\r\n * @param {boolean} asBlob - response body as Blob\r\n * @param {string} serviceBaseURL - base of the uri petition\r\n * @return {Promise} \r\n */\r\n get(url, timeout, headers, parameters, asBlob, serviceBaseURL) {\r\n const _url = this._createUrl(url, parameters, serviceBaseURL)\r\n console.info('GET', _url)\r\n var req = request.get(_url);\r\n return this._createPromiseRequest(req, null, timeout, headers, asBlob);\r\n }\r\n\r\n /**\r\n * Invoke PATCH action to url and data specified\r\n * @param {!string} url - url to execute PATCH\r\n * @param {object} data - attach data to request PATCH\r\n * @param {number} timeout - timeout in milliseconds\r\n * @param {object} headers - headers of request\r\n * @param {object} parameters - parameters of request\r\n * @param {string} serviceBaseURL - base of the uri petition\r\n * @return {Promise} \r\n */\r\n patch(url, data, timeout, headers, parameters, serviceBaseURL) {\r\n const _url = this._createUrl(url, parameters, serviceBaseURL)\r\n console.info('PATCH', _url)\r\n var req = request.patch(_url)\r\n .send(data);\r\n\r\n return this._createPromiseRequest(req, null, timeout, headers);\r\n }\r\n\r\n /**\r\n * Invoke POST action to url and data specified\r\n * @param {!string} url - url to execute POST\r\n * @param {object} data - attach data to request POST\r\n * @param {number} timeout - timeout in milliseconds\r\n * @param {object} headers - headers of request\r\n * @param {object} parameters - parameters of request\r\n * @param {string} serviceBaseURL - base of the uri petition\r\n * @return {Promise} \r\n */\r\n post(url, data, timeout, headers, parameters, serviceBaseURL) {\r\n const _url = this._createUrl(url, parameters, serviceBaseURL)\r\n console.info('POST', _url)\r\n var req = request.post(_url)\r\n .send(data);\r\n\r\n return this._createPromiseRequest(req, null, timeout, headers);\r\n }\r\n\r\n\r\n /**\r\n * Invoke POST multipart action to url and data specified\r\n * @param {!string} url - url to execute POST\r\n * @param {FormData} formData - attach data to request POST\r\n * @param {object} events - events allowed, xhr.process \r\n * @param {number} timeout - timeout in milliseconds \r\n * @param {object} headers - headers of request\r\n * @param {object} parameters - parameters of request\r\n * @param {string} serviceBaseURL - base of the uri petition\r\n * @return {Promise} \r\n */\r\n post_multipart(url, formData, events, timeout, headers, parameters, serviceBaseURL) {\r\n const _url = this._createUrl(url, parameters, serviceBaseURL)\r\n console.info('POST_MULTIPART', _url)\r\n let req = request.post(_url);\r\n\r\n this._prepareMultipartForm(formData, req);\r\n\r\n return this._createPromiseRequest(req, events, timeout, headers); \r\n }\r\n\r\n /**\r\n * Invoke PUT action to url and data specified\r\n * @param {!string} url - url to execute PUT\r\n * @param {object} data - attach data to request PUT\r\n * @param {number} timeout - timeout in milliseconds \r\n * @param {object} headers - headers of request\r\n * @param {object} parameters - parameters of request\r\n * @param {string} serviceBaseURL - base of the uri petition\r\n * @return {Promise} \r\n */\r\n put(url, data, timeout, headers, parameters, serviceBaseURL) {\r\n const _url = this._createUrl(url, parameters, serviceBaseURL)\r\n console.info('PUT', _url)\r\n var req = request.put(_url).send(data);\r\n\r\n if (headers) {\r\n headers['Content-Type'] = 'application/json';\r\n } else {\r\n headers = {\r\n 'Content-Type': 'application/json'\r\n };\r\n }\r\n\r\n return this._createPromiseRequest(req, null, timeout, headers);\r\n }\r\n\r\n /**\r\n * Invoke put multipart action to url and data specified\r\n * @param {!string} url - url to execute POST\r\n * @param {FormData} formData - attach data to request POST\r\n * @param {object} events - events allowed, xhr.process \r\n * @param {number} timeout - timeout in milliseconds \r\n * @param {object} headers - headers of request\r\n * @param {object} parameters - parameters of request\r\n * @param {string} serviceBaseURL - base of the uri petition\r\n * @return {Promise} \r\n */\r\n put_multipart(url, formData, events, timeout, headers, parameters, serviceBaseURL) {\r\n const _url = this._createUrl(url, parameters, serviceBaseURL)\r\n console.info('PUT_MULTIPART', _url)\r\n let req = request.put(_url);\r\n\r\n this._prepareMultipartForm(formData, req);\r\n\r\n return this._createPromiseRequest(req, events, timeout, headers);\r\n }\r\n\r\n _prepareMultipartForm(formData, req) {\r\n let sendFormData = true\r\n \r\n const formDataKeys = Object.keys(formData)\r\n formDataKeys.forEach(key => {\r\n switch (key) {\r\n case 'meta':\r\n case 'json':\r\n case 'file':\r\n req.field(key, formData[key]); \r\n delete formData[key]\r\n break\r\n case 'metadata': \r\n req.attach(key, formData[key]);\r\n sendFormData = false\r\n break\r\n case 'hardwareMedia': \r\n case 'certificate': \r\n case 'processorBulkFile':\r\n req.attach('file', formData[key]);\r\n sendFormData = false\r\n break\r\n case 'files':\r\n formData[key].forEach((item, index) => {\r\n // Esto controla si viene de node (con path) o de web (sin path)\r\n if (item.path) {\r\n var fileName = item.path.replace(/^.*[\\\\\\/]/, '')\r\n\r\n var contentType = mime.lookup(fileName);\r\n if (contentType) {\r\n req.attach(key, item, {filename: fileName, contentType: contentType}); \r\n } else if (fileName.endsWith('.py')) {\r\n req.attach(key, item, {filename: fileName, contentType: 'text/x-python'}); \r\n } else {\r\n req.attach(key, item, {filename: fileName}); \r\n } \r\n } else {\r\n req.attach(key, item);\r\n }\r\n })\r\n \r\n delete formData[key]\r\n sendFormData = false\r\n break\r\n case 'script':\r\n case 'modelFile':\r\n req.field(key, formData[key]);\r\n delete formData[key]\r\n sendFormData = false\r\n break\r\n case 'bulkFile':\r\n req.set('Content-Type', formData.ext);\r\n formData = formData.bulkFile;\r\n break\r\n default:\r\n break;\r\n }\r\n })\r\n\r\n if(sendFormData)\r\n req.send(formData);\r\n }\r\n\r\n /**\r\n * Invoke DELETE action to url specified\r\n * @param {!string} url - url to execute DELETE\r\n * @param {number} timeout - timeout in milliseconds \r\n * @param {object} headers - headers of request\r\n * @param {object} parameters - parameters of request\r\n * @param {object} body - body of request\r\n * @param {string} serviceBaseURL - base of the uri petition\r\n * @return {Promise} \r\n */\r\n delete(url, timeout, headers, parameters, body, serviceBaseURL) {\r\n const _url = this._createUrl(url, parameters, serviceBaseURL)\r\n console.info('DELETE', _url)\r\n var req\r\n if(body){\r\n req = request.del(_url).send(body);\r\n //req = request('DELETE', url)\r\n }else{\r\n req = request.del(_url);\r\n }\r\n return this._createPromiseRequest(req, null, timeout, headers);\r\n }\r\n\r\n _createUrl(relativeUrl, parameters, serviceBaseURL) {\r\n var encode = [];\r\n if (parameters) {\r\n var keys = Object.keys(parameters);\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n var queryParameter = key + '=' + parameters[key];\r\n if (i === 0) {\r\n relativeUrl = relativeUrl + '?' + queryParameter;\r\n } else {\r\n relativeUrl = relativeUrl + '&' + queryParameter;\r\n }\r\n\r\n }\r\n // console.log(JSON.stringify(parameters));\r\n }\r\n\r\n // console.log(relativeUrl);\r\n\r\n var relativeUrlSplit = relativeUrl.split(\"/\");\r\n var length = relativeUrlSplit.length;\r\n\r\n relativeUrlSplit.forEach(function(item, index) {\r\n if (index === (length - 1) && item.indexOf(\"?\") > 0) {\r\n var parameters = item.substring(item.indexOf(\"?\"), item.length);\r\n var _item = item.substring(0, item.indexOf(\"?\"));\r\n encode.push(urlencode(_item) + parameters);\r\n } else {\r\n encode.push(urlencode(item));\r\n }\r\n });\r\n\r\n return this._url(this._options) + \"/\" + this._getDefaultBaseURL(serviceBaseURL) + '/' + encode.join(\"/\");\r\n }\r\n\r\n _getDefaultBaseURL(serviceBaseURL) {\r\n if (!serviceBaseURL) {\r\n if (this._isSouth) {\r\n return 'v80'\r\n } else {\r\n return 'north/v80'\r\n }\r\n } \r\n\r\n return serviceBaseURL\r\n }\r\n\r\n _createPromiseRequest(req, events, timeout, headers, asBlob) {\r\n let _timeout = timeout;\r\n if (typeof _timeout === \"undefined\" || _timeout === null) {\r\n _timeout = this._options.timeout;\r\n }\r\n let defered = q.defer();\r\n let promise = defered.promise;\r\n let apiKey = this._options.apiKey;\r\n let JWT = this._options.jwt;\r\n let _req = _timeout === -1 ? req : req.timeout(_timeout);\r\n \r\n if(JWT && !this._isSouth) {\r\n _req = _req.set('Authorization', 'Bearer ' + JWT);\r\n }\r\n else if(apiKey) {\r\n _req = _req.set('X-ApiKey', this._options.apiKey);\r\n }\r\n\r\n if (headers) {\r\n var keys = Object.keys(headers);\r\n for (var i = 0; i < keys.length; i++) {\r\n var key = keys[i];\r\n if (headers[key] !== undefined)\r\n _req = _req.set(key, headers[key]);\r\n }\r\n }\r\n\r\n if (events) {\r\n for (let event in events) {\r\n _req = _req.on(event, events[event]);\r\n }\r\n }\r\n if(asBlob){\r\n req.responseType('blob')\r\n }\r\n _req = _req.end(function(err, res) {\r\n if (err !== null) {\r\n console.error(\"OGAPI ERROR: \")\r\n try{\r\n console.log(JSON.stringify(err))\r\n }catch(err){\r\n console.log(err)\r\n }\r\n let data;\r\n let headers;\r\n let status = err.status ? err.status : undefined;\r\n let errorMessage = {\r\n errors: [{\r\n code: status,\r\n message: 'OGAPI: Something is broken. Please contact with your administrator.'\r\n }]\r\n };\r\n \r\n if (typeof err.response !== \"undefined\") {\r\n data = err.response.body ? err.response.body : errorMessage;\r\n headers = err.response.headers\r\n status = err.status;\r\n } else {\r\n if (!status) {\r\n data = errorMessage;\r\n status = 500;\r\n } else {\r\n data = err.message;\r\n status = 408;\r\n }\r\n }\r\n defered.reject({\r\n statusCode: status,\r\n 'data': data,\r\n headers: headers\r\n });\r\n } else {\r\n \r\n defered.resolve(res);\r\n }\r\n });\r\n\r\n return promise;\r\n }\r\n}",
@@ -74622,7 +74678,7 @@
74622
74678
  "lineNumber": 1
74623
74679
  },
74624
74680
  {
74625
- "__docId__": 2812,
74681
+ "__docId__": 2814,
74626
74682
  "kind": "variable",
74627
74683
  "name": "mock",
74628
74684
  "memberof": "src/util/NorthAmpliaREST.js",
@@ -74648,7 +74704,7 @@
74648
74704
  }
74649
74705
  },
74650
74706
  {
74651
- "__docId__": 2813,
74707
+ "__docId__": 2815,
74652
74708
  "kind": "class",
74653
74709
  "name": "NorthAmpliaREST",
74654
74710
  "memberof": "src/util/NorthAmpliaREST.js",
@@ -74663,7 +74719,7 @@
74663
74719
  "interface": false
74664
74720
  },
74665
74721
  {
74666
- "__docId__": 2814,
74722
+ "__docId__": 2816,
74667
74723
  "kind": "constructor",
74668
74724
  "name": "constructor",
74669
74725
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -74698,7 +74754,7 @@
74698
74754
  ]
74699
74755
  },
74700
74756
  {
74701
- "__docId__": 2815,
74757
+ "__docId__": 2817,
74702
74758
  "kind": "member",
74703
74759
  "name": "_options",
74704
74760
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -74721,7 +74777,7 @@
74721
74777
  }
74722
74778
  },
74723
74779
  {
74724
- "__docId__": 2816,
74780
+ "__docId__": 2818,
74725
74781
  "kind": "member",
74726
74782
  "name": "_headers",
74727
74783
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -74744,7 +74800,7 @@
74744
74800
  }
74745
74801
  },
74746
74802
  {
74747
- "__docId__": 2817,
74803
+ "__docId__": 2819,
74748
74804
  "kind": "method",
74749
74805
  "name": "_applyMocks",
74750
74806
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -74772,7 +74828,7 @@
74772
74828
  ]
74773
74829
  },
74774
74830
  {
74775
- "__docId__": 2818,
74831
+ "__docId__": 2820,
74776
74832
  "kind": "method",
74777
74833
  "name": "default",
74778
74834
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -74794,7 +74850,7 @@
74794
74850
  }
74795
74851
  },
74796
74852
  {
74797
- "__docId__": 2819,
74853
+ "__docId__": 2821,
74798
74854
  "kind": "method",
74799
74855
  "name": "_url",
74800
74856
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -74827,7 +74883,7 @@
74827
74883
  }
74828
74884
  },
74829
74885
  {
74830
- "__docId__": 2820,
74886
+ "__docId__": 2822,
74831
74887
  "kind": "method",
74832
74888
  "name": "get",
74833
74889
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -74910,7 +74966,7 @@
74910
74966
  }
74911
74967
  },
74912
74968
  {
74913
- "__docId__": 2821,
74969
+ "__docId__": 2823,
74914
74970
  "kind": "method",
74915
74971
  "name": "patch",
74916
74972
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -74993,7 +75049,7 @@
74993
75049
  }
74994
75050
  },
74995
75051
  {
74996
- "__docId__": 2822,
75052
+ "__docId__": 2824,
74997
75053
  "kind": "method",
74998
75054
  "name": "post",
74999
75055
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -75076,7 +75132,7 @@
75076
75132
  }
75077
75133
  },
75078
75134
  {
75079
- "__docId__": 2823,
75135
+ "__docId__": 2825,
75080
75136
  "kind": "method",
75081
75137
  "name": "post_multipart",
75082
75138
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -75169,7 +75225,7 @@
75169
75225
  }
75170
75226
  },
75171
75227
  {
75172
- "__docId__": 2824,
75228
+ "__docId__": 2826,
75173
75229
  "kind": "method",
75174
75230
  "name": "put",
75175
75231
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -75252,7 +75308,7 @@
75252
75308
  }
75253
75309
  },
75254
75310
  {
75255
- "__docId__": 2825,
75311
+ "__docId__": 2827,
75256
75312
  "kind": "method",
75257
75313
  "name": "put_multipart",
75258
75314
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -75345,7 +75401,7 @@
75345
75401
  }
75346
75402
  },
75347
75403
  {
75348
- "__docId__": 2826,
75404
+ "__docId__": 2828,
75349
75405
  "kind": "method",
75350
75406
  "name": "_prepareMultipartForm",
75351
75407
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -75379,7 +75435,7 @@
75379
75435
  ]
75380
75436
  },
75381
75437
  {
75382
- "__docId__": 2827,
75438
+ "__docId__": 2829,
75383
75439
  "kind": "method",
75384
75440
  "name": "delete",
75385
75441
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -75462,7 +75518,7 @@
75462
75518
  }
75463
75519
  },
75464
75520
  {
75465
- "__docId__": 2828,
75521
+ "__docId__": 2830,
75466
75522
  "kind": "method",
75467
75523
  "name": "_createUrl",
75468
75524
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -75507,7 +75563,7 @@
75507
75563
  }
75508
75564
  },
75509
75565
  {
75510
- "__docId__": 2829,
75566
+ "__docId__": 2831,
75511
75567
  "kind": "method",
75512
75568
  "name": "_getDefaultBaseURL",
75513
75569
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -75540,7 +75596,7 @@
75540
75596
  }
75541
75597
  },
75542
75598
  {
75543
- "__docId__": 2830,
75599
+ "__docId__": 2832,
75544
75600
  "kind": "method",
75545
75601
  "name": "_createPromiseRequest",
75546
75602
  "memberof": "src/util/NorthAmpliaREST.js~NorthAmpliaREST",
@@ -75597,7 +75653,7 @@
75597
75653
  }
75598
75654
  },
75599
75655
  {
75600
- "__docId__": 2831,
75656
+ "__docId__": 2833,
75601
75657
  "kind": "file",
75602
75658
  "name": "src/util/SelectElement.js",
75603
75659
  "content": "'use strict';\r\n\r\nexport default class SelectElement {\r\n\r\n /**\r\n * @example\r\n * SE.element('provision.device.identifier', ['value'], 'identifier')\r\n * returns:\r\n * {\r\n * name : 'provision.device.identifier',\r\n * fields: ['value'],\r\n * alias: 'identifier\r\n * }\r\n *\r\n * SE.element('provision.device.identifier', ['value'])\r\n * returns:\r\n * {\r\n * name : 'provision.device.identifier',\r\n * fields: ['value']\r\n * }\r\n * @return {Object} This returns a json with the object element built.\r\n * @param {String} name - Indicates the datastream to show\r\n * @param {[{field: field, alias:alias}]} fields - The fields that you want to show from that datastream\r\n */\r\n static element(name, fields) {\r\n return { name: name, fields: fields };\r\n }\r\n\r\n}",
@@ -75608,7 +75664,7 @@
75608
75664
  "lineNumber": 1
75609
75665
  },
75610
75666
  {
75611
- "__docId__": 2832,
75667
+ "__docId__": 2834,
75612
75668
  "kind": "class",
75613
75669
  "name": "SelectElement",
75614
75670
  "memberof": "src/util/SelectElement.js",
@@ -75630,7 +75686,7 @@
75630
75686
  "interface": false
75631
75687
  },
75632
75688
  {
75633
- "__docId__": 2833,
75689
+ "__docId__": 2835,
75634
75690
  "kind": "method",
75635
75691
  "name": "element",
75636
75692
  "memberof": "src/util/SelectElement.js~SelectElement",
@@ -75676,7 +75732,7 @@
75676
75732
  }
75677
75733
  },
75678
75734
  {
75679
- "__docId__": 2834,
75735
+ "__docId__": 2836,
75680
75736
  "kind": "file",
75681
75737
  "name": "src/util/SouthAmpliaREST.js",
75682
75738
  "content": "import NorthAmpliaREST from './NorthAmpliaREST';\r\n\r\nexport default class SouthAmpliaREST extends NorthAmpliaREST {\r\n\r\n constructor(_options, headers) {\r\n super(_options, headers);\r\n this._isSouth = true\r\n }\r\n\r\n _url(options) {\r\n return options.south.url;\r\n }\r\n}",
@@ -75687,7 +75743,7 @@
75687
75743
  "lineNumber": 1
75688
75744
  },
75689
75745
  {
75690
- "__docId__": 2835,
75746
+ "__docId__": 2837,
75691
75747
  "kind": "class",
75692
75748
  "name": "SouthAmpliaREST",
75693
75749
  "memberof": "src/util/SouthAmpliaREST.js",
@@ -75712,7 +75768,7 @@
75712
75768
  ]
75713
75769
  },
75714
75770
  {
75715
- "__docId__": 2836,
75771
+ "__docId__": 2838,
75716
75772
  "kind": "constructor",
75717
75773
  "name": "constructor",
75718
75774
  "memberof": "src/util/SouthAmpliaREST.js~SouthAmpliaREST",
@@ -75746,7 +75802,7 @@
75746
75802
  ]
75747
75803
  },
75748
75804
  {
75749
- "__docId__": 2837,
75805
+ "__docId__": 2839,
75750
75806
  "kind": "member",
75751
75807
  "name": "_isSouth",
75752
75808
  "memberof": "src/util/SouthAmpliaREST.js~SouthAmpliaREST",
@@ -75769,7 +75825,7 @@
75769
75825
  }
75770
75826
  },
75771
75827
  {
75772
- "__docId__": 2838,
75828
+ "__docId__": 2840,
75773
75829
  "kind": "method",
75774
75830
  "name": "_url",
75775
75831
  "memberof": "src/util/SouthAmpliaREST.js~SouthAmpliaREST",
@@ -75802,7 +75858,7 @@
75802
75858
  }
75803
75859
  },
75804
75860
  {
75805
- "__docId__": 2839,
75861
+ "__docId__": 2841,
75806
75862
  "kind": "file",
75807
75863
  "name": "src/util/formats/check_types.js",
75808
75864
  "content": "module.exports = {\r\n /* fields validations */\r\n _checkType: function(type, TYPE_ENUM) {\r\n let not_found = [];\r\n let found = TYPE_ENUM.find(function(type) {\r\n return type == this;\r\n }, type);\r\n\r\n if (typeof found === 'undefined') {\r\n not_found.push(type);\r\n }\r\n if (not_found.length !== 0) {\r\n throw new Error({ message: 'OGAPI_NOT_ALLOWED_PARAMETER', parameter: JSON.stringify(not_found), allowed: JSON.stringify(TYPE_ENUM) });\r\n }\r\n return type;\r\n },\r\n _checkISODateTime: function(parameter, name){\r\n if (typeof parameter !== 'string' || new RegExp(\"(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d\\.\\d+([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))|(\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z))\").test(parameter) ) {\r\n throw new Error([{ message: 'OGAPI_ISO_DATE_TIME_PARAMETER', parameter: name }, { message: 'OGAPI_STRING_PATTERN', parameter: name }]);\r\n }\r\n try {\r\n new Date(parameter)\r\n } catch(err){\r\n throw new Error([{ message: 'OGAPI_ISO_DATE_TIME_PARAMETER', parameter: name }, { message: 'OGAPI_STRING_PATTERN', parameter: name }]);\r\n }\r\n },\r\n _checkStringAndPattern: function(parameter, pattern, name) {\r\n if (typeof parameter !== 'string' || !new RegExp(pattern).test(parameter) ) {\r\n throw new Error([{ message: 'OGAPI_STRING_PARAMETER', parameter: name }, { message: 'OGAPI_STRING_PATTERN', parameter: name, pattern: pattern }]);\r\n }\r\n },\r\n _checkStringAndLength: function(parameter, length, name) {\r\n if (typeof parameter !== 'string' || parameter.length > length) {\r\n throw new Error([{ message: 'OGAPI_STRING_PARAMETER', parameter: name }, { message: 'OGAPI_MAX_LENGTH', parameter: length }]);\r\n }\r\n },\r\n _checkString: function(parameter, name) {\r\n if (typeof parameter !== 'string') {\r\n throw new Error([{ message: 'OGAPI_STRING_PARAMETER', parameter: name }]);\r\n }\r\n },\r\n _checkNumber: function(parameter, name) {\r\n if (typeof parameter !== 'number') {\r\n throw new Error([{ message: 'OGAPI_NUMBER_PARAMETER', parameter: name }]);\r\n }\r\n },\r\n _checkArray: function(parameter, name) {\r\n if (!Array.isArray(parameter) || parameter.length === 0) {\r\n throw new Error({ message: 'OGAPI_ARRAY_PARAMETER', parameter: name });\r\n }\r\n },\r\n _checkObject: function(parameter, name) {\r\n if (typeof parameter !== 'object') {\r\n throw new Error({ message: 'OGAPI_OBJECT_PARAMETER', parameter: name });\r\n }\r\n }\r\n\r\n}",
@@ -75813,7 +75869,7 @@
75813
75869
  "lineNumber": 1
75814
75870
  },
75815
75871
  {
75816
- "__docId__": 2840,
75872
+ "__docId__": 2842,
75817
75873
  "kind": "file",
75818
75874
  "name": "src/util/searchingFields/FieldFinder.js",
75819
75875
  "content": "//https://github.com/kriskowal/q\nimport q from 'q';\nimport _ from 'lodash'\nimport {\n GENERATED_FIELDS\n} from './source-precompiled/Fields';\nimport {\n IOT_FIELDS\n} from './IotFields';\n\nvar FIELDS = GENERATED_FIELDS;\nfor (var field in IOT_FIELDS) {\n if (FIELDS[field]) {\n for (var subfield in IOT_FIELDS[field]) {\n FIELDS[field][subfield] = IOT_FIELDS[field][subfield];\n }\n } else {\n FIELDS[field] = IOT_FIELDS[field];\n }\n}\n\nconst REGEX_PATH_CURRENT = new RegExp(\"^(.+)._current\\\\.?(.+)?$\")\nconst REGEX_PATH_ARRAY = new RegExp(\"\\\\[[0-9]+\\\\]\")\nconst REGEX_DATASTREAM_VALUE = new RegExp('value\\\\.?')\n\n\nconst match_url = {\n '/jobs': 'JOB',\n '/tasks': 'TASKS',\n '/alarms': 'ENTITY_ALARM',\n '/operations': 'ENTITY_OPERATION',\n '/operations/history': 'ENTITY_OPERATION_HISTORY',\n '/certificates': 'CERTIFICATE',\n '/bundles': 'UPDATE_BUNDLE_VERSION',\n '/datapoints': 'DATAPOINTS',\n '/datastreams': 'DATASTREAMS',\n '/datamodels': 'DATAMODELS',\n '/dmmQRating': 'DMMQRATING',\n '/iotQRating': 'IOTQRATING',\n '/catalog/softwares': 'SOFTWARE_VERSION',\n // '/catalog/hardwares': 'MANUFACTURER',\n '/catalog/operators': 'OPERATORS',\n '/domains': 'DOMAIN',\n '/users': 'USER',\n '/areas': 'AREAS',\n '/bulk/async': 'LEGACY_BULK',\n 'provisionProcessors/bulk/search': 'BULK',\n '/devices': 'SearchOnDatamodel',\n '/subscriptions': 'SearchOnDatamodel',\n '/subscribers': 'SearchOnDatamodel',\n '/entities': 'SearchOnDatamodel',\n 'entity-asset': 'SearchOnDatamodel',\n '/tickets': 'SearchOnDatamodel',\n '/channels': 'SearchOnDatamodel',\n 'datasets': 'SearchOnDataset',\n 'timeseries': 'SearchOnTimeseries',\n '/catalog/plans/organization' : 'PLANS',\n '/catalog/plans/device' : 'PLANS'\n};\n\nconst match_context = {\n 'ENTITY_ALARM': 'alarm',\n 'UPDATE_BUNDLE_VERSION': 'bundle',\n 'DATAPOINTS': 'datapoints',\n 'ENTITY_OPERATION': ['operation', 'job']\n};\n\nconst match_url_resourceType = {\n get: function(url) {\n switch (url) {\n case 'entity-asset':\n return ['entity.asset'];\n case '/tickets':\n return ['ticket'];\n case '/channels':\n return ['channel'];\n default:\n return undefined;\n }\n }\n};\n\nconst match_type = {\n 'subscriber': 'DEVICE_PART_SUBSCRIBER',\n 'subscription': 'DEVICE_PART_SUBSCRIPTION',\n 'communicationsModule': 'DEVICE_PART_COMMSMODULE',\n 'device': 'DEVICE_PART_DEVICE'\n};\n\nconst match_type_inverse = {\n 'DEVICE_PART_SUBSCRIBER': 'subscriber',\n 'DEVICE_PART_SUBSCRIPTION': 'subscription',\n 'DEVICE_PART_COMMSMODULE': 'communicationsModule',\n 'DEVICE_PART_DEVICE': 'device'\n};\n\nconst fields_related = ['relColl', 'relProv'];\n\nconst complexPrimaryType = ['DEVICE_PART_SUBSCRIBER', 'DEVICE_PART_SUBSCRIPTION', 'DEVICE_PART_COMMSMODULE', 'DEVICE_PART_DEVICE'];\nconst complexFields = ['subscriber', 'subscription', 'communicationsModule', 'device'];\nconst SIMPLE_FIELDS = 'simple';\nconst COMPLEX_FIELDS = 'complex';\nconst SEARCH_FIELDS = 'search';\nconst SEARCH_COLUMNS = 'dataset';\nconst SEARCH_COLUMNS_CONTEXT = 'timeserie';\n\nconst TYPE_FIELD = {\n get: function(url) {\n if (complexPrimaryType.indexOf(match_url[url]) >= 0) {\n return COMPLEX_FIELDS;\n }\n switch (match_url[url]) {\n case 'SearchOnDatamodel': \n return SEARCH_FIELDS;\n case 'SearchOnDataset':\n return SEARCH_COLUMNS;\n case 'SearchOnTimeseries':\n return SEARCH_COLUMNS_CONTEXT;\n default:\n return SIMPLE_FIELDS;\n }\n }\n};\nconst _getCustomSchema = function(_ds, schema) {\n let result\n const ds = _ds[0]\n if(!ds || !schema.properties || !schema.properties[ds]){\n result = schema\n } else{\n result = _getCustomSchema(_ds.slice(1), schema.properties[ds])\n }\n return result\n}\n\nconst _getDatamodelFields = function(parent, objSearcher){\n let defered = q.defer();\n const selectedField = objSearcher.selectedField\n const selectAll = objSearcher.selectAll\n const organization = objSearcher.extraData && objSearcher.extraData.organization\n let datamodelSearchBuilder = parent._ogapi.datamodelsSearchBuilder();\n\n let rtFilter = {\n 'and': []\n };\n\n if (parent._resourceTypes) {\n rtFilter.and.push({\n 'in': {\n 'datamodels.allowedResourceTypes': parent._resourceTypes\n }\n });\n }\n if(organization){\n rtFilter.and.push({\n 'eq': {\n 'datamodels.organizationName': organization\n }\n });\n }\n if (selectedField) {\n rtFilter.and.push({\n 'eq': {\n 'datamodels.categories.datastreams.identifier': selectedField\n }\n });\n }\n if (rtFilter.and.length > 0) {\n datamodelSearchBuilder.filter(rtFilter);\n }\n\n datamodelSearchBuilder.build().execute().then(function(response) {\n var datastreams = [];\n if (response.statusCode === 200) {\n datastreams = response.data.datamodels.map(function(datamodel) {\n var categories = datamodel.categories || [];\n return categories.map(function(category) {\n var datastreams = category.datastreams || [];\n return datastreams.map(function(ds) {\n if (selectedField || selectAll) {\n return ds;\n }\n return ds.identifier;\n }); \n });\n });\n datastreams = reduce(datastreams);\n }\n if (selectedField) {\n defered.resolve(datastreams.find(function(dsIdTmp) {\n return selectedField === dsIdTmp.identifier;\n }));\n } else {\n defered.resolve(datastreams);\n }\n }).catch(function(error) {\n defered.reject(error);\n });\n\n function reduce(array) {\n if (array.length > 0 && array[0].constructor === Array) {\n array = array.reduce(function(preVal, elem) {\n return preVal.concat(elem);\n });\n return reduce(array);\n }\n return array;\n }\n return defered.promise\n}\n\nconst _searchColumns = function(_this, finder, objSearcher, defered){\n https://github.com/kriskowal/q#using-deferreds\n const selectedField = objSearcher.selectedField\n //GET dataset by organization and datasetId\n var columnDatastreams = []\n var organization = objSearcher.extraData.organization\n var id = objSearcher.extraData[finder.entity]\n _this._ogapi[finder.api]()[finder.method](organization, id)\n .then(function (response) {\n if (response.statusCode === 200) { \n if (response.data.identifierColumn) {\n columnDatastreams.push({\n identifier: response.data.identifierColumn,\n name: response.data.identifierColumn,\n path: 'provision.administration.identifier._current.value',\n indexed: true,\n sort: true,\n notFilterable: false,\n filter: 'YES',\n type: \"string\",\n schema: {type: 'string'}\n })\n }\n\n if (response.data.bucketColumn) {\n columnDatastreams.push({\n identifier: response.data.bucketColumn,\n name: response.data.bucketColumn,\n path: 'provision.administration.identifier._current.at',\n indexed: true,\n sort: true,\n notFilterable: false,\n filter: 'YES',\n type: \"date-time\",\n schema: {\n type: 'string',\n format: 'datetime'\n }\n })\n }\n\n if (response.data.bucketInitColumn) {\n columnDatastreams.push({\n identifier: response.data.bucketInitColumn,\n name: response.data.bucketInitColumn,\n path: 'provision.administration.identifier._current.at',\n indexed: true,\n sort: true,\n notFilterable: false,\n filter: 'YES',\n type: \"date-time\",\n schema: {\n type: 'string',\n format: 'datetime'\n }\n })\n }\n\n var columns = _.concat(response.data.columns || [], response.data.context || [])\n\n //search de la definición de schemas de opengate\n _this._ogapi.basicTypesSearchBuilder().withPath('$').build().execute().then(function (basicTypes) {\n const definitions = basicTypes.data.definitions\n objSearcher.selectAll = true\n if (selectedField) {\n columns = columns.filter(function (column) { return selectedField === (column.name || column.alias) })\n const column = columns[0]\n const datastreamMatch = column.path.match(REGEX_PATH_CURRENT);\n const datastream = datastreamMatch[1].replace(REGEX_PATH_ARRAY, \"[]\")\n objSearcher.selectedField = datastream\n }\n //recuperamos la defnición de todas las columnas y todos los datastreams\n _getDatamodelFields(_this, objSearcher).then(function (datamodelFields) {\n columns.forEach(function (column) {\n // console.log('--------------------------------' + column)\n\n // Se calcula el schema dependiendo del tipo de dato\n if (column.type !== 'date-time') {\n column.schema = {\n type: column.type\n }\n } else {\n column.schema = {\n type: 'string',\n format: 'datetime'\n }\n }\n\n if (column.path.endsWith('._current.value')) {\n //console.log('---------------------------------------------')\n const datastreamMatch = column.path.substring(0, column.path.indexOf('._current.value'));\n\n //Buscamos la definición del datastream en el datamodel\n const datamodelField = Array.isArray(datamodelFields) ? datamodelFields.find(function (df) {\n return datastreamMatch === df.identifier\n }) : datamodelFields\n }\n\n // //Expresión regular para recuperar el path del datastream (1) y, si se tratase de un datastream complejo, también el path hasta el dato simple (2).\n // //Datastream simple: provision.device.identifier._current.value, device.communicationModules[0].subscriber.mobile.icc._current.at\n // //Datastream complejo: device.model._current.value.manufacturer, device.location._current.value.position.type\n // const datastreamMatch = column.path.match(REGEX_PATH_CURRENT);\n // //Eliminamos el indice para los modulos de comunicaciones y los arrays para el resto de datastreams\n // const datastream = datastreamMatch[1].replace(REGEX_PATH_ARRAY, \"[]\")\n // const subdatastream = datastreamMatch[2].replace(REGEX_DATASTREAM_VALUE, '').replace(REGEX_PATH_ARRAY, '');\n // //Buscamos la definición del datastream en el datamodel\n // const datamodelField = Array.isArray(datamodelFields) ? datamodelFields.find(function (df) {\n // return datastream === df.identifier\n // }) : datamodelFields\n // const schema = datamodelField.schema\n // // si es un datastream simple, la asignación es directa\n // if (!subdatastream) {\n // column.schema = schema\n // } else {\n // //si es un datastream complejo hay que navegar por el schema hasta encontrar su tipo\n // const sds = subdatastream.split('.')\n // let _schema = (schema.$ref && definitions[schema.$ref.replace(new RegExp('.*#/definitions/'), '')]) || schema\n // sds.forEach(function (sd) {\n // // caso: device.model._current.at - no hay schema\n // _schema = _schema && _schema.properties && _schema.properties[sd]\n // })\n // column.schema = _schema\n // }\n //simular los campos de un datastream\n column.identifier = (column.name || column.alias)\n column.indexed = column.filter !== 'NO' // column.filter === 'YES' || column.filter === 'ALWAYS'\n column.notFilterable = column.filter === 'NO'\n\n // console.log('=============================' + column)\n columnDatastreams.push(column)\n })\n defered.resolve(columnDatastreams);\n }).catch(function (error) {\n console.error(error)\n defered.reject(error);\n });\n\n }).catch(function (error) {\n console.error(error)\n defered.reject(error);\n });\n }\n }).catch(function (error) {\n console.error(error)\n defered.reject(error);\n });\n}\n\n\nconst FIELD_SEARCHER = {\n \n [SEARCH_FIELDS]: function(objSearcher, defered) {\n https://github.com/kriskowal/q#using-deferreds\n _getDatamodelFields(this, objSearcher).then(function(response){\n defered.resolve(response)\n }).catch(function(err){\n defered.reject(err)\n })\n },\n [SIMPLE_FIELDS]: function(objSearcher, defered) {\n const context = objSearcher.context\n const primaryType = objSearcher.primaryType\n const field = objSearcher.selectedField\n var paths = [];\n if (context[primaryType] instanceof Array) {\n if (field) {\n let fieldIdx = 0;\n let fieldMatch = null;\n for (fieldIdx = 0; fieldMatch === null && fieldIdx < context[primaryType].length; fieldIdx++) {\n let fieldTmp = context[primaryType][fieldIdx];\n if (fieldTmp.toLowerCase() === field.toLowerCase() ||\n fieldTmp.toLowerCase() === (field.toLowerCase() + 'name')) {\n fieldMatch = fieldTmp;\n } else if (match_context[primaryType]) {\n if (match_context[primaryType] instanceof Array) {\n match_context[primaryType].forEach(function(ctxMatch) {\n if (fieldTmp.toLowerCase() === (ctxMatch + field.toLowerCase()) ||\n fieldTmp.toLowerCase() === (ctxMatch + '.' + field.toLowerCase()) ||\n fieldTmp.toLowerCase() === (ctxMatch + field.toLowerCase() + 'name') ||\n fieldTmp.toLowerCase() === (ctxMatch + '.' + field.toLowerCase() + 'name')) {\n if (!fieldMatch) fieldMatch = fieldTmp;\n }\n });\n } else {\n if (fieldTmp.toLowerCase() === (match_context[primaryType] + field.toLowerCase()) ||\n fieldTmp.toLowerCase() === (match_context[primaryType] + '.' + field.toLowerCase()) ||\n fieldTmp.toLowerCase() === (match_context[primaryType] + field.toLowerCase() + 'name') ||\n fieldTmp.toLowerCase() === (match_context[primaryType] + '.' + field.toLowerCase() + 'name')) {\n fieldMatch = fieldTmp;\n }\n }\n }\n }\n\n if (fieldMatch)\n paths.push(fieldMatch);\n } else {\n paths = context[primaryType].slice();\n }\n } else {\n if (field) {\n if (context[primaryType][field]) {\n paths.push(context[primaryType][field]);\n } else {\n var fieldsCfg = Object.keys(context[primaryType]);\n\n for (var f = 0; f < fieldsCfg.length; f++) {\n if (context[primaryType][fieldsCfg[f]].toLowerCase().indexOf(field.toLowerCase()) > -1) {\n paths.push(context[primaryType][fieldsCfg[f]]);\n }\n }\n }\n } else {\n var fieldsCfg = Object.keys(context[primaryType]);\n\n for (var f = 0; f < fieldsCfg.length; f++) {\n paths.push(context[primaryType][fieldsCfg[f]]);\n }\n }\n }\n\n defered.resolve(paths.slice());\n },\n [COMPLEX_FIELDS]: function(objSearcher, defered) {\n const states = objSearcher.states\n const context = objSearcher.context\n const primaryType = objSearcher.primaryType\n\n const finiteStateMachine = {\n 1: function(states, context) {\n // Fields del primaryType + los fields de los relacionados = complexFields\n return context[primaryType].concat(\n complexFields.filter(\n filterRelatedEntities,\n match_type_inverse[primaryType]\n )\n );\n },\n 2: function(states, context) {\n try {\n // Fields del relacionado + fields_related\n return appendPreviousStates(\n states,\n fieldsNestedState(states[0], context).concat(fields_related)\n );\n } catch (err) {\n return [];\n }\n },\n 3: function(states, context) {\n let secondState = states[1];\n if (fields_related.indexOf(secondState) === -1) return [];\n try {\n // Fields del relacionado \n return appendPreviousStates(\n states,\n fieldsNestedState(states[0], context)\n );\n } catch (err) {\n return [];\n }\n }\n };\n\n let statesSize = states.length;\n let currentState = finiteStateMachine[statesSize];\n if (typeof currentState === \"undefined\") return defered.resolve([]);\n return defered.resolve(currentState(states, context));\n\n function fieldsNestedState(state, context) {\n let fieldsRelated;\n if (!(fieldsNestedState = match_type[state]) || !(fieldsRelated = context[fieldsNestedState]))\n throw new Error('Invalid primaryType: ' + state);\n return fieldsRelated.slice();\n }\n\n function filterRelatedEntities(relatedEntity) {\n return relatedEntity != this;\n }\n\n function appendPreviousStates(states, fields) {\n let out = [];\n fields.forEach(function(field) {\n let arrayField = states.slice(0, -1);\n arrayField.push(field);\n out.push(arrayField.join(\".\"));\n });\n return out;\n }\n },\n [SEARCH_COLUMNS]: function(objSearcher, defered) {\n _searchColumns(this, {api: 'newDatasetFinder', method: 'findByOrganizationAndDatasetId', entity: 'dataset'}, objSearcher, defered)\n },\n [SEARCH_COLUMNS_CONTEXT]: function(objSearcher, defered){\n _searchColumns(this, {api: 'newTimeserieFinder', method: 'findByOrganizationAndTimeserieId', entity: 'timeserie'}, objSearcher, defered)\n }\n}\n\nexport default class FieldFinder {\n constructor(ogapi, url, extraData) {\n this._ogapi = ogapi;\n this._url = url;\n this._type = TYPE_FIELD.get(url);\n this._extraData = extraData\n\n if (this._type === SEARCH_FIELDS) {\n this._resourceTypes = match_url_resourceType.get(url);\n }\n }\n find(input = \"\") {\n let defered = q.defer();\n let objSearcher = {\n states : input.split('.'),\n context:FIELDS[match_url[this._url]],\n primaryType: match_url[this._url],\n extraData: this._extraData\n }\n FIELD_SEARCHER[this._type].call(this, objSearcher, defered);\n return defered.promise;\n }\n findAll(input = \"\") {\n let defered = q.defer();\n let objSearcher = {\n states : input.split('.'),\n context:FIELDS[match_url[this._url]],\n primaryType: match_url[this._url], \n selectAll: true,\n extraData: this._extraData\n }\n FIELD_SEARCHER[this._type].call(this, objSearcher, defered);\n return defered.promise;\n }\n\n findFieldPath(field = \"\") {\n let defered = q.defer();\n let objSearcher = {\n states : field,\n context:FIELDS[match_url[this._url]],\n primaryType: match_url[this._url],\n selectedField: field,\n extraData: this._extraData\n }\n FIELD_SEARCHER[this._type].call(this, objSearcher, defered);\n return defered.promise;\n }\n}",
@@ -75824,7 +75880,7 @@
75824
75880
  "lineNumber": 1
75825
75881
  },
75826
75882
  {
75827
- "__docId__": 2841,
75883
+ "__docId__": 2843,
75828
75884
  "kind": "variable",
75829
75885
  "name": "FIELDS",
75830
75886
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -75850,7 +75906,7 @@
75850
75906
  }
75851
75907
  },
75852
75908
  {
75853
- "__docId__": 2842,
75909
+ "__docId__": 2844,
75854
75910
  "kind": "variable",
75855
75911
  "name": "REGEX_PATH_CURRENT",
75856
75912
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -75876,7 +75932,7 @@
75876
75932
  }
75877
75933
  },
75878
75934
  {
75879
- "__docId__": 2843,
75935
+ "__docId__": 2845,
75880
75936
  "kind": "variable",
75881
75937
  "name": "REGEX_PATH_ARRAY",
75882
75938
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -75902,7 +75958,7 @@
75902
75958
  }
75903
75959
  },
75904
75960
  {
75905
- "__docId__": 2844,
75961
+ "__docId__": 2846,
75906
75962
  "kind": "variable",
75907
75963
  "name": "REGEX_DATASTREAM_VALUE",
75908
75964
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -75928,7 +75984,7 @@
75928
75984
  }
75929
75985
  },
75930
75986
  {
75931
- "__docId__": 2845,
75987
+ "__docId__": 2847,
75932
75988
  "kind": "variable",
75933
75989
  "name": "match_url",
75934
75990
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -75954,7 +76010,7 @@
75954
76010
  }
75955
76011
  },
75956
76012
  {
75957
- "__docId__": 2846,
76013
+ "__docId__": 2848,
75958
76014
  "kind": "variable",
75959
76015
  "name": "match_context",
75960
76016
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -75980,7 +76036,7 @@
75980
76036
  }
75981
76037
  },
75982
76038
  {
75983
- "__docId__": 2847,
76039
+ "__docId__": 2849,
75984
76040
  "kind": "variable",
75985
76041
  "name": "match_url_resourceType",
75986
76042
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76006,7 +76062,7 @@
76006
76062
  }
76007
76063
  },
76008
76064
  {
76009
- "__docId__": 2848,
76065
+ "__docId__": 2850,
76010
76066
  "kind": "variable",
76011
76067
  "name": "match_type",
76012
76068
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76032,7 +76088,7 @@
76032
76088
  }
76033
76089
  },
76034
76090
  {
76035
- "__docId__": 2849,
76091
+ "__docId__": 2851,
76036
76092
  "kind": "variable",
76037
76093
  "name": "match_type_inverse",
76038
76094
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76058,7 +76114,7 @@
76058
76114
  }
76059
76115
  },
76060
76116
  {
76061
- "__docId__": 2850,
76117
+ "__docId__": 2852,
76062
76118
  "kind": "variable",
76063
76119
  "name": "fields_related",
76064
76120
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76084,7 +76140,7 @@
76084
76140
  }
76085
76141
  },
76086
76142
  {
76087
- "__docId__": 2851,
76143
+ "__docId__": 2853,
76088
76144
  "kind": "variable",
76089
76145
  "name": "complexPrimaryType",
76090
76146
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76110,7 +76166,7 @@
76110
76166
  }
76111
76167
  },
76112
76168
  {
76113
- "__docId__": 2852,
76169
+ "__docId__": 2854,
76114
76170
  "kind": "variable",
76115
76171
  "name": "complexFields",
76116
76172
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76136,7 +76192,7 @@
76136
76192
  }
76137
76193
  },
76138
76194
  {
76139
- "__docId__": 2853,
76195
+ "__docId__": 2855,
76140
76196
  "kind": "variable",
76141
76197
  "name": "SIMPLE_FIELDS",
76142
76198
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76162,7 +76218,7 @@
76162
76218
  }
76163
76219
  },
76164
76220
  {
76165
- "__docId__": 2854,
76221
+ "__docId__": 2856,
76166
76222
  "kind": "variable",
76167
76223
  "name": "COMPLEX_FIELDS",
76168
76224
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76188,7 +76244,7 @@
76188
76244
  }
76189
76245
  },
76190
76246
  {
76191
- "__docId__": 2855,
76247
+ "__docId__": 2857,
76192
76248
  "kind": "variable",
76193
76249
  "name": "SEARCH_FIELDS",
76194
76250
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76214,7 +76270,7 @@
76214
76270
  }
76215
76271
  },
76216
76272
  {
76217
- "__docId__": 2856,
76273
+ "__docId__": 2858,
76218
76274
  "kind": "variable",
76219
76275
  "name": "SEARCH_COLUMNS",
76220
76276
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76240,7 +76296,7 @@
76240
76296
  }
76241
76297
  },
76242
76298
  {
76243
- "__docId__": 2857,
76299
+ "__docId__": 2859,
76244
76300
  "kind": "variable",
76245
76301
  "name": "SEARCH_COLUMNS_CONTEXT",
76246
76302
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76266,7 +76322,7 @@
76266
76322
  }
76267
76323
  },
76268
76324
  {
76269
- "__docId__": 2858,
76325
+ "__docId__": 2860,
76270
76326
  "kind": "variable",
76271
76327
  "name": "TYPE_FIELD",
76272
76328
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76292,7 +76348,7 @@
76292
76348
  }
76293
76349
  },
76294
76350
  {
76295
- "__docId__": 2859,
76351
+ "__docId__": 2861,
76296
76352
  "kind": "function",
76297
76353
  "name": "_getCustomSchema",
76298
76354
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76334,7 +76390,7 @@
76334
76390
  }
76335
76391
  },
76336
76392
  {
76337
- "__docId__": 2860,
76393
+ "__docId__": 2862,
76338
76394
  "kind": "function",
76339
76395
  "name": "_getDatamodelFields",
76340
76396
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76376,7 +76432,7 @@
76376
76432
  }
76377
76433
  },
76378
76434
  {
76379
- "__docId__": 2861,
76435
+ "__docId__": 2863,
76380
76436
  "kind": "function",
76381
76437
  "name": "_searchColumns",
76382
76438
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76425,7 +76481,7 @@
76425
76481
  ]
76426
76482
  },
76427
76483
  {
76428
- "__docId__": 2862,
76484
+ "__docId__": 2864,
76429
76485
  "kind": "variable",
76430
76486
  "name": "FIELD_SEARCHER",
76431
76487
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76451,7 +76507,7 @@
76451
76507
  }
76452
76508
  },
76453
76509
  {
76454
- "__docId__": 2863,
76510
+ "__docId__": 2865,
76455
76511
  "kind": "class",
76456
76512
  "name": "FieldFinder",
76457
76513
  "memberof": "src/util/searchingFields/FieldFinder.js",
@@ -76473,7 +76529,7 @@
76473
76529
  "interface": false
76474
76530
  },
76475
76531
  {
76476
- "__docId__": 2864,
76532
+ "__docId__": 2866,
76477
76533
  "kind": "constructor",
76478
76534
  "name": "constructor",
76479
76535
  "memberof": "src/util/searchingFields/FieldFinder.js~FieldFinder",
@@ -76513,7 +76569,7 @@
76513
76569
  ]
76514
76570
  },
76515
76571
  {
76516
- "__docId__": 2865,
76572
+ "__docId__": 2867,
76517
76573
  "kind": "member",
76518
76574
  "name": "_ogapi",
76519
76575
  "memberof": "src/util/searchingFields/FieldFinder.js~FieldFinder",
@@ -76536,7 +76592,7 @@
76536
76592
  }
76537
76593
  },
76538
76594
  {
76539
- "__docId__": 2866,
76595
+ "__docId__": 2868,
76540
76596
  "kind": "member",
76541
76597
  "name": "_url",
76542
76598
  "memberof": "src/util/searchingFields/FieldFinder.js~FieldFinder",
@@ -76559,7 +76615,7 @@
76559
76615
  }
76560
76616
  },
76561
76617
  {
76562
- "__docId__": 2867,
76618
+ "__docId__": 2869,
76563
76619
  "kind": "member",
76564
76620
  "name": "_type",
76565
76621
  "memberof": "src/util/searchingFields/FieldFinder.js~FieldFinder",
@@ -76582,7 +76638,7 @@
76582
76638
  }
76583
76639
  },
76584
76640
  {
76585
- "__docId__": 2868,
76641
+ "__docId__": 2870,
76586
76642
  "kind": "member",
76587
76643
  "name": "_extraData",
76588
76644
  "memberof": "src/util/searchingFields/FieldFinder.js~FieldFinder",
@@ -76605,7 +76661,7 @@
76605
76661
  }
76606
76662
  },
76607
76663
  {
76608
- "__docId__": 2869,
76664
+ "__docId__": 2871,
76609
76665
  "kind": "member",
76610
76666
  "name": "_resourceTypes",
76611
76667
  "memberof": "src/util/searchingFields/FieldFinder.js~FieldFinder",
@@ -76628,7 +76684,7 @@
76628
76684
  }
76629
76685
  },
76630
76686
  {
76631
- "__docId__": 2870,
76687
+ "__docId__": 2872,
76632
76688
  "kind": "method",
76633
76689
  "name": "find",
76634
76690
  "memberof": "src/util/searchingFields/FieldFinder.js~FieldFinder",
@@ -76664,7 +76720,7 @@
76664
76720
  }
76665
76721
  },
76666
76722
  {
76667
- "__docId__": 2871,
76723
+ "__docId__": 2873,
76668
76724
  "kind": "method",
76669
76725
  "name": "findAll",
76670
76726
  "memberof": "src/util/searchingFields/FieldFinder.js~FieldFinder",
@@ -76700,7 +76756,7 @@
76700
76756
  }
76701
76757
  },
76702
76758
  {
76703
- "__docId__": 2872,
76759
+ "__docId__": 2874,
76704
76760
  "kind": "method",
76705
76761
  "name": "findFieldPath",
76706
76762
  "memberof": "src/util/searchingFields/FieldFinder.js~FieldFinder",
@@ -76736,7 +76792,7 @@
76736
76792
  }
76737
76793
  },
76738
76794
  {
76739
- "__docId__": 2873,
76795
+ "__docId__": 2875,
76740
76796
  "kind": "file",
76741
76797
  "name": "src/util/searchingFields/IotFields.js",
76742
76798
  "content": "// Fields generated at: Thu Feb 09 2017 11:06:37 GMT+0100 (CET)\n// DB: 172.19.18.242:1521/QA\nexport const IOT_FIELDS = {\n \"DATAPOINTS\": {\n \"DATAPOINTS\": [\n \"datapoints.organization\",\n \"datapoints.channel\",\n \"datapoints.datastreamId\",\n \"datapoints.entityIdentifier\",\n \"datapoints.subEntityIdentifier\",\n \"datapoints.entityRelated\",\n \"datapoints._current.feedId\",\n \"datapoints._current.date\",\n \"datapoints._current.at\",\n \"datapoints._current.value\",\n \"datapoints._current.tags\",\n \"datapoints._current.scoring.performance\",\n \"datapoints._current.scoring.qrating.min_required.value\",\n \"datapoints._current.scoring.qrating.min_required.label\",\n \"datapoints._current.scoring.qrating.min_desired.value\",\n \"datapoints._current.scoring.qrating.min_desired.label\",\n \"datapoints._current.scoring.qrating.ideal.value\",\n \"datapoints._current.scoring.qrating.ideal.label\",\n \"datapoints._current.scoring.qrating.max_desired.value\",\n \"datapoints._current.scoring.qrating.max_desired.label\",\n \"datapoints._current.scoring.qrating.max_allowed.value\",\n \"datapoints._current.scoring.qrating.max_allowed.label\",\n \"datapoints._current.scoring.qrating.max_score\",\n \"datapoints._current.scoring.qrating.cumulative_period_divisor\",\n \"datapoints._current.scoring.qrating.conversion_matrix\",\n \"datapoints._current.scoring.qrating.version\"\n ]\n },\n \"DATAMODELS\": {\n \"DATAMODELS\": [\n \"datamodels.organizationName\",\n \"datamodels.identifier\",\n \"datamodels.name\",\n \"datamodels.description\",\n \"datamodels.version\",\n \"datamodels.categories.name\",\n \"datamodels.categories.identifier\",\n \"datamodels.categories.datastreams.identifier\",\n \"datamodels.categories.datastreams.name\",\n \"datamodels.categories.datastreams.description\",\n \"datamodels.categories.datastreams.hardwareIds\",\n \"datamodels.categories.datastreams.unit\",\n \"datamodels.categories.datastreams.unit.type\",\n \"datamodels.categories.datastreams.unit.label\",\n \"datamodels.categories.datastreams.unit.symbol\",\n \"datamodels.categories.datastreams.period\",\n \"datamodels.categories.datastreams.access\",\n \"datamodels.categories.datastreams.schema\",\n \"datamodels.categories.datastreams.storage\",\n \"datamodels.categories.datastreams.storage.period\",\n \"datamodels.categories.datastreams.storage.total\",\n \"datamodels.categories.datastreams.tags\",\n \"datamodels.categories.datastreams.views\",\n \"datamodels.categories.datastreams.icon\",\n \"datamodels.categories.datastreams.modifiable\",\n \"datamodels.categories.datastreams.required\",\n \"datamodels.categories.datastreams.qrating.min_required.value\",\n \"datamodels.categories.datastreams.qrating.min_required.label\",\n \"datamodels.categories.datastreams.qrating.min_desired.value\",\n \"datamodels.categories.datastreams.qrating.min_desired.label\",\n \"datamodels.categories.datastreams.qrating.ideal.value\",\n \"datamodels.categories.datastreams.qrating.ideal.label\",\n \"datamodels.categories.datastreams.qrating.max_desired.value\",\n \"datamodels.categories.datastreams.qrating.max_desired.label\",\n \"datamodels.categories.datastreams.qrating.max_allowed.value\",\n \"datamodels.categories.datastreams.qrating.max_allowed.label\",\n \"datamodels.categories.datastreams.qrating.max_score\",\n \"datamodels.categories.datastreams.qrating.cumulative_period_divisor\",\n \"datamodels.categories.datastreams.qrating.conversion_matrix\",\n \"datamodels.categories.datastreams.qrating.version\"\n ]\n },\n \"DATASTREAMS\": {\n \"DATASTREAMS\": [\n \"datastreams.datastreamId\",\n \"datastreams.name\",\n \"datastreams.description\",\n \"datastreams.unit.type\",\n \"datastreams.unit.label\",\n \"datastreams.unit.symbol\",\n \"datastreams.period\",\n \"datastreams._current.tags\",\n \"datastreams._current.date\",\n \"datastreams._current.value\",\n \"datastreams.categoryId\",\n \"datastreams.datamodelId\",\n \"datastreams.access\",\n \"datastreams.channel\",\n \"datastreams.organization\",\n \"datastreams.entityIdentifier\",\n \"feeds.entityIdentifier\",\n \"datastreams._id.subEntityIdentifier\",\n \"datastreams._current.scoring.qrating.min_required.value\",\n \"datastreams._current.scoring.qrating.min_required.label\",\n \"datastreams._current.scoring.qrating.min_desired.value\",\n \"datastreams._current.scoring.qrating.min_desired.label\",\n \"datastreams._current.scoring.qrating.ideal.value\",\n \"datastreams._current.scoring.qrating.ideal.label\",\n \"datastreams._current.scoring.qrating.max_desired.value\",\n \"datastreams._current.scoring.qrating.max_desired.label\",\n \"datastreams._current.scoring.qrating.max_allowed.value\",\n \"datastreams._current.scoring.qrating.max_allowed.label\",\n \"datastreams._current.scoring.qrating.max_score\",\n \"datastreams._current.scoring.qrating.cumulative_period_divisor\",\n \"datastreams._current.scoring.qrating.max_score\",\n \"datastreams._current.scoring.qrating.conversion_matrix\",\n \"datastreams.version\",\n \"feeds.identifier\",\n \"datastreams._current.scoring.qrating.version\",\n \"datastreams._current.scoring.scoringPerformance\"\n\n ]\n },\n \"DEVICE_PART_DEVICE\": {\n \"IOT\": [\n \"datastream.id\",\n \"datastream.name\",\n \"datastream.feed\",\n \"datastream.device\",\n \"datastream.description\",\n \"datastream.unit.type\",\n \"datastream.unit.label\",\n \"datastream.unit.symbol\",\n \"datastream.period\",\n \"datastream.tags\",\n \"datastream.updated\",\n \"datastream.minValue\",\n \"datastream.maxValue\",\n \"datastream.currentValue\",\n \"datastream.categoryName\",\n \"datastream.profileId\",\n \"datastream.profileName\",\n \"datastream.profileDescription\",\n \"datastream.profileVersion\",\n \"datastream.qratingScoringQValue\",\n \"datastream.qratingScoringQScore\",\n \"datastream.qratingScoringQuality\",\n \"datastream.qratingScoringPerformance\",\n \"datastream.qratingMinRequiredValue\",\n \"datastream.qratingMinRequiredLabel\",\n \"datastream.qratingMinDesiredValue\",\n \"datastream.qratingMinDesiredLabel\",\n \"datastream.qratingIdealValue\",\n \"datastream.qratingIdealLabel\",\n \"datastream.qratingMaxDesiredValue\",\n \"datastream.qratingMaxDesiredLabel\",\n \"datastream.qratingMaxAllowedValue\",\n \"datastream.qratingMaxAllowedLabel\",\n \"datastream.qratingMaxScore\",\n \"deviceId\",\n \"feedId\",\n \"deviceOrganization\",\n \"profile.Name\",\n \"profile.Description\",\n \"profile.Version\",\n \"profile.Score\",\n \"profile.MaxScore\",\n \"profile.Performance\",\n \"profile.AvgPerformance\",\n \"profile.Quality\",\n \"category.Name\",\n \"category.Score\",\n \"category.MaxScore\",\n \"category.Performance\",\n \"category.AvgPerformance\",\n \"category.Quality\",\n \"device.Score\",\n \"device.MaxScore\",\n \"device.Performance\",\n \"device.AvgPerformance\",\n \"device.Quality\",\n \"device.Channel\",\n \"device.EntityType\"\n ]\n },\n \"USER\": {\n \"USER\": {\n \"email\": \"user.email\",\n \"description\": \"user.description\",\n \"workgroup\": \"workgroup.name\",\n \"domain\": \"domain.name\",\n \"profile\": \"profile.name\",\n \"name\": \"user.name\",\n \"surname\": \"user.surname\",\n \"countryCode\": \"country.code\",\n \"langCode\": \"language.code\",\n \"timezone\": \"user.timezone\"\n }\n },\n \"DOMAIN\": {\n \"DOMAIN\": [\n \"domain.name\",\n \"domain.description\"\n ]\n },\n \"AREAS\": {\n \"AREAS\": {\n \"identifier\": \"areas.identifier\",\n \"name\": \"areas.name\",\n \"description\": \"areas.description\",\n \"entities\": \"areas.entities\",\n \"geometry\": \"areas.geometry\",\n \"color\": \"areas.color\",\n \"organization\": \"areas.organization\"\n }\n },\n \"TASKS\": {\n \"TASKS\": [\n \"tasks.id\",\n \"tasks.name\",\n \"tasks.description\",\n \"tasks.state\",\n \"tasks.domain\",\n \"tasks.workgroup\",\n \"tasks.job.request.user\"\n ]\n },\n \"LEGACY_BULK\": {\n \"LEGACY_BULK\": {\n \"identifier\": \"bulks.identifier\",\n \"organization\": \"bulks.organization\",\n \"fileName\": \"bulks.request.fileName\",\n \"userEmail\": \"bulks.request.userEmail\",\n \"headerAccept\": \"bulks.request.header.accept\",\n \"contentType\": \"bulks.request.header.contentType\",\n \"headerCsvFormat\": \"bulks.request.header.csvFormat\",\n \"paramsFlattened\": \"bulks.request.params.flattened\",\n \"paramsAction\": \"bulks.request.params.action\",\n \"paramsFull\": \"bulks.request.params.full\",\n \"paramsType\": \"bulks.request.params.type\",\n \"status\": \"bulks.status\",\n \"startedDate\": \"bulks.startedDate\",\n \"finishedDate\": \"bulks.finishedDate\",\n \"processed\": \"bulks.summary.processed\",\n \"successful\": \"bulks.summary.successful\",\n \"error\": \"bulks.summary.error\"\n }\n },\n \"BULK\": {\n \"BULK\": {\n \"identifier\": \"bulks.identifier\",\n \"provisionProcessorId\": \"bulks.provisionProcessorId\",\n \"organization\": \"bulks.organization\",\n \"userEmail\": \"bulks.request.userEmail\",\n \"fileName\": \"bulks.request.fileName\",\n \"headerAccept\": \"bulks.request.header.accept\",\n \"contentType\": \"bulks.request.header.contentType\",\n \"status\": \"bulks.status\",\n \"startedDate\": \"bulks.startedDate\",\n \"finishedDate\": \"bulks.finishedDate\",\n \"processed\": \"bulks.summary.processed\",\n \"successful\": \"bulks.summary.successful\",\n \"error\": \"bulks.summary.error\"\n }\n },\n \"RULE\": {\n \"RULE\": {\n \"organizationId\": \"rule.organizationId\",\n \"channelId\": \"rule.channelId\",\n \"name\": \"rule.name\",\n \"active\": \"rule.active\"\n }\n },\n \"ENTITY_ALARM\": {\n \"ENTITY_ALARM\": {\n \"alarmId\": \"alarm.identifier\",\n \"alarmSubEntityIdentifier\": \"alarm.subEntityIdentifier\",\n \"entityId\": \"alarm.entityIdentifier\",\n \"entityType\": \"alarm.resourceType\",\n \"organizationName\": \"alarm.organization\",\n \"channelName\": \"alarm.channel\",\n \"alarmRuleName\": \"alarm.rule\",\n \"alarmName\": \"alarm.name\",\n \"alarmSeverity\": \"alarm.severity\",\n \"alarmPriority\": \"alarm.priority\",\n \"alarmDescription\": \"alarm.description\",\n \"alarmStatus\": \"alarm.status\",\n \"alarmOpenDate\": \"alarm.openingDate\",\n \"alarmAttentionDate\": \"alarm.attentionDate\",\n \"alarmAttentionUser\": \"alarm.attentionUser\",\n \"alarmAttentionNote\": \"alarm.attentionNote\",\n \"alarmClosureDate\": \"alarm.closureDate\",\n \"alarmClosureUser\": \"alarm.closureUser\",\n \"alarmClosureNote\": \"alarm.closureNote\",\n \"alarmExtraInfo\": \"alarm.extra_info\"\n }\n },\n \"GENERAL\": {\n \"GENERAL\": []\n },\n \"EMPTY\": {\n \"EMPTY\": []\n },\n \"OPERATORS\": {\n \"OPERATORS\": [\n \"operator.name\"\n ]\n },\n \"PLANS\": {\n \"PLANS\": [\n \"plan.identifier\",\n \"plan.name\",\n \"plan.flowRate.value\",\n \"plan.flowRate.unit\",\n \"plan.maxDeviceAmount\",\n \"plan.maxStorageLifeTime.period\",\n \"plan.maxStorageLifeTime.total\",\n \"plan.defaultAssigned\",\n \"plan.defaultProvision\"\n ]\n }\n};",
@@ -76747,7 +76803,7 @@
76747
76803
  "lineNumber": 1
76748
76804
  },
76749
76805
  {
76750
- "__docId__": 2874,
76806
+ "__docId__": 2876,
76751
76807
  "kind": "variable",
76752
76808
  "name": "IOT_FIELDS",
76753
76809
  "memberof": "src/util/searchingFields/IotFields.js",
@@ -76773,7 +76829,7 @@
76773
76829
  }
76774
76830
  },
76775
76831
  {
76776
- "__docId__": 2875,
76832
+ "__docId__": 2877,
76777
76833
  "kind": "file",
76778
76834
  "name": "src/util/searchingFields/source-precompiled/Fields.js",
76779
76835
  "content": "// Fields generated at: Fri May 07 2021 12:57:57 GMT+0200 (Central European Summer Time)\n// DB: 172.19.18.242:1521/QA\nexport const GENERATED_FIELDS = {\n \"ENTITY_OPERATION_HISTORY\": {\n \"ENTITY_OPERATION_HISTORY\":[\n \"applicationEmail\",\n \"entityId\",\n \"resourceType\",\n \"jobActivatedDate\",\n \"jobId\",\n \"jobUserNotes\",\n \"operationAttemptCurrent\",\n \"operationAttemptMax\",\n \"operationDate\",\n \"operationDetails\",\n \"operationEndDate\",\n \"operationId\",\n \"operationInitDate\",\n \"operationName\",\n \"operationNotify\",\n \"operationParameters\",\n \"operationResult\",\n \"operationStatus\",\n \"operationSteps\"\n ]\n },\n \"ENTITY_OPERATION\": {\n \"ENTITY_OPERATION\": [\n \"applicationEmail\",\n \"channelKey\",\n \"channelName\",\n \"domainKey\",\n \"entityId\",\n \"resourceType\",\n \"entityUk\",\n \"jobActivatedDate\",\n \"jobEntityTotal\",\n \"jobErrorCode\",\n \"jobErrorDescription\",\n \"jobFinishedCancelledByEngine\",\n \"jobFinishedCancelledByExternal\",\n \"jobFinishedCancelledByExternalTimeout\",\n \"jobFinishedCancelledByTimeout\",\n \"jobFinishedCancelledByUser\",\n \"jobFinishedCancelledTotal\",\n \"jobFinishedDate\",\n \"jobFinishedError\",\n \"jobFinishedOotError\",\n \"jobFinishedOotSuccessful\",\n \"jobFinishedOotTotal\",\n \"jobFinishedSuccessful\",\n \"jobFinishedTotal\",\n \"jobId\",\n \"jobInProgressPendingExecution\",\n \"jobInProgressScheduled\",\n \"jobInProgressStarted\",\n \"jobInProgressTotal\",\n \"jobInProgressWaitingForConnection\",\n \"jobJson\",\n \"jobStartedDate\",\n \"jobState\",\n \"jobStatus\",\n \"jobTotal\",\n \"jobUser\",\n \"jobUserNotes\",\n \"notDeletable\",\n \"operationAttemptCurrent\",\n \"operationAttemptMax\",\n \"operationDate\",\n \"operationDetails\",\n \"operationEndDate\",\n \"operationId\",\n \"operationInitDate\",\n \"operationJson\",\n \"operationName\",\n \"operationNotify\",\n \"operationResult\",\n \"operationScheduleTimestamp\",\n \"operationStatus\",\n \"operationStatusKey\",\n \"operationStepDescription\",\n \"operationStepName\",\n \"operationStepResponse\",\n \"operationStepResult\",\n \"operationStepTimestamp\",\n \"operationTimeoutTimestamp\",\n \"operationUserNotes\",\n \"organizationKey\",\n \"organizationName\",\n \"profileKey\",\n \"provAdministrativeState\",\n \"provAdministrativeStateKey\",\n \"provDefaultFeed\",\n \"serviceGroupName\",\n \"tag\",\n \"taskEmpty_null\",\n \"taskId\",\n \"taskKey\",\n \"taskName\",\n \"taskState\",\n \"taskStatus\",\n \"workgroupKey\",\n \"workgroupName\"\n ]\n },\n // \"MANUFACTURER\": {\n // \"MANUFACTURER\": [\n // \"manufacturerAddress\",\n // \"manufacturerDescription\",\n // \"manufacturerEmail\",\n // \"manufacturerFax\",\n // \"manufacturerIdentifier\",\n // \"manufacturerMediaFileName\",\n // \"manufacturerMediaHeight\",\n // \"manufacturerMediaIdentifier\",\n // \"manufacturerMediaName\",\n // \"manufacturerMediaSize\",\n // \"manufacturerMediaTypeName\",\n // \"manufacturerMediaWidth\",\n // \"manufacturerName\",\n // \"manufacturerNotes\",\n // \"manufacturerTelephone\",\n // \"manufacturerUrl\",\n // \"modelDescription\",\n // \"modelIdentifier\",\n // \"modelMediaFileName\",\n // \"modelMediaHeight\",\n // \"modelMediaIdentifier\",\n // \"modelMediaName\",\n // \"modelMediaSize\",\n // \"modelMediaTypeName\",\n // \"modelMediaWidth\",\n // \"modelName\",\n // \"modelNotes\",\n // \"modelUrl\",\n // \"modelVersion\"\n // ]\n // },\n \"MODEL\": {\n \"MODEL\": [\n \"modelDescription\",\n \"modelIdentifier\",\n \"modelName\",\n \"modelNotes\",\n \"modelUrl\",\n \"modelVersion\"\n ]\n },\n \"JOB\": {\n \"JOB\": [\n \"jobActivatedDate\",\n \"jobActivatedTime\",\n \"jobCallback\",\n \"jobEntityTotal\",\n \"jobErrorCode\",\n \"jobErrorDescription\",\n \"jobFinishedCancelledByEngine\",\n \"jobFinishedCancelledByExternal\",\n \"jobFinishedCancelledByExternalTimeout\",\n \"jobFinishedCancelledByTimeout\",\n \"jobFinishedCancelledByUser\",\n \"jobFinishedCancelledTotal\",\n \"jobFinishedDate\",\n \"jobFinishedError\",\n \"jobFinishedOotError\",\n \"jobFinishedOotSuccessful\",\n \"jobFinishedOotTotal\",\n \"jobFinishedSuccessful\",\n \"jobFinishedTime\",\n \"jobFinishedTotal\",\n \"jobId\",\n \"jobInProgressPendingExecution\",\n \"jobInProgressScheduled\",\n \"jobInProgressStarted\",\n \"jobInProgressTotal\",\n \"jobInProgressWaitingForConnection\",\n \"jobJson\",\n \"jobOperationName\",\n \"jobScheduledTime\",\n \"jobStartedDate\",\n \"jobState\",\n \"jobStatus\",\n \"jobTotal\",\n \"jobTrap\",\n \"jobUser\",\n \"jobUserNotes\",\n \"jobVisible\",\n \"operationId\",\n \"operationName\",\n \"operationResult\",\n \"operationStatusKey\",\n \"taskCoremessage\",\n \"taskId\",\n \"taskKey\",\n \"taskName\",\n \"taskNextExecution\",\n \"taskState\",\n \"taskStatus\"\n ]\n },\n \"SOFTWARE_VERSION\": {\n \"SOFTWARE_VERSION\": [\n \"manufacturerAddress\",\n \"manufacturerDescription\",\n \"manufacturerEmail\",\n \"manufacturerFax\",\n \"manufacturerIdentifier\",\n \"manufacturerName\",\n \"manufacturerNotes\",\n \"manufacturerTelephone\",\n \"manufacturerUrl\",\n \"modelDescription\",\n \"modelIdentifier\",\n \"modelName\",\n \"modelNotes\",\n \"modelUrl\",\n \"modelVersion\",\n \"softwareId\",\n \"softwareName\",\n \"softwareType\",\n \"softwareVersion\"\n ]\n },\n \"UPDATE_BUNDLE_VERSION\": {\n \"UPDATE_BUNDLE_VERSION\": [\n \"bundleActionDef\",\n \"bundleActionOrder\",\n \"bundleActionType\",\n \"bundleActive\",\n \"bundleConstrained\",\n \"bundleCreationDate\",\n \"bundleDeploymentElementDownloadUrl\",\n \"bundleDeploymentElementId\",\n \"bundleDeploymentElementName\",\n \"bundleDeploymentElementOperation\",\n \"bundleDeploymentElementOption\",\n \"bundleDeploymentElementOrder\",\n \"bundleDeploymentElementPath\",\n \"bundleDeploymentElementSize\",\n \"bundleDeploymentElementType\",\n \"bundleDeploymentElementValidators\",\n \"bundleDeploymentElementVersion\",\n \"bundleDescription\",\n \"bundleHardware\",\n \"bundleId\",\n \"bundleName\",\n \"bundleUserNotes\",\n \"bundleVersion\",\n \"bundleWorkgroup\",\n \"updateBundleDate\",\n \"updateBundleManufacturer\",\n \"updateBundleModel\",\n \"updateBundleName\",\n \"updateBundleVersion\",\n \"updateBundleVersionUuid\",\n \"updateDescription\"\n ]\n },\n \"CERTIFICATE\": {\n \"CERTIFICATE\": [\n \"certificateAdministrativeState\",\n \"certificateDescription\",\n \"certificateDomain\",\n \"certificateId\",\n \"certificateIssuer\",\n \"certificateManufacturer\",\n \"certificateModel\",\n \"certificateModelIdentifier\",\n \"certificateModelVersion\",\n \"certificateName\",\n \"certificatePublicKeyAlgorithm\",\n \"certificatePublicKeyFormat\",\n \"certificatePublicKeySize\",\n \"certificateSerialNumber\",\n \"certificateSubject\",\n \"certificateTag\",\n \"certificateTrustChain\",\n \"certificateUsage\",\n \"certificateValidFrom\",\n \"certificateValidUntil\",\n \"certificateVersion\"\n ]\n }\n}",
@@ -76784,7 +76840,7 @@
76784
76840
  "lineNumber": 1
76785
76841
  },
76786
76842
  {
76787
- "__docId__": 2876,
76843
+ "__docId__": 2878,
76788
76844
  "kind": "variable",
76789
76845
  "name": "GENERATED_FIELDS",
76790
76846
  "memberof": "src/util/searchingFields/source-precompiled/Fields.js",
@@ -76810,7 +76866,7 @@
76810
76866
  }
76811
76867
  },
76812
76868
  {
76813
- "__docId__": 2877,
76869
+ "__docId__": 2879,
76814
76870
  "kind": "file",
76815
76871
  "name": "src/workgroups/WorkgroupFinder.js",
76816
76872
  "content": "'use strict';\r\n\r\nimport ProvisionGenericFinder from '../ProvisionGenericFinder';\r\n\r\n/**\r\n * This class allow make get request to workgroup resource into Opengate North API.\r\n */\r\nexport default class WorkgroupFinder extends ProvisionGenericFinder {\r\n\r\n /** \r\n * @param {InternalOpenGateAPI} Reference to the API object.\r\n */\r\n constructor(ogapi) {\r\n super(ogapi, 'domains', 'workgroup', 'Workgroup not found');\r\n }\r\n\r\n /**\r\n * @return {String} This returns a string with the URL of the request.\r\n * @private\r\n */\r\n _composeUrl() {\r\n return this._baseUrl + \"/\" + this._domain + \"/workgroups/\" + this._name;\r\n }\r\n\r\n /**\r\n * @param {string} domain - domain name \r\n * @param {string} name - workgroup name \r\n * @return {Promise} \r\n */\r\n findByDomainAndName(domain, name) {\r\n this._domain = domain;\r\n this._name = name;\r\n return this._execute();\r\n }\r\n}",
@@ -76821,7 +76877,7 @@
76821
76877
  "lineNumber": 1
76822
76878
  },
76823
76879
  {
76824
- "__docId__": 2878,
76880
+ "__docId__": 2880,
76825
76881
  "kind": "class",
76826
76882
  "name": "WorkgroupFinder",
76827
76883
  "memberof": "src/workgroups/WorkgroupFinder.js",
@@ -76839,7 +76895,7 @@
76839
76895
  ]
76840
76896
  },
76841
76897
  {
76842
- "__docId__": 2879,
76898
+ "__docId__": 2881,
76843
76899
  "kind": "constructor",
76844
76900
  "name": "constructor",
76845
76901
  "memberof": "src/workgroups/WorkgroupFinder.js~WorkgroupFinder",
@@ -76864,7 +76920,7 @@
76864
76920
  ]
76865
76921
  },
76866
76922
  {
76867
- "__docId__": 2880,
76923
+ "__docId__": 2882,
76868
76924
  "kind": "method",
76869
76925
  "name": "_composeUrl",
76870
76926
  "memberof": "src/workgroups/WorkgroupFinder.js~WorkgroupFinder",
@@ -76886,7 +76942,7 @@
76886
76942
  }
76887
76943
  },
76888
76944
  {
76889
- "__docId__": 2881,
76945
+ "__docId__": 2883,
76890
76946
  "kind": "method",
76891
76947
  "name": "findByDomainAndName",
76892
76948
  "memberof": "src/workgroups/WorkgroupFinder.js~WorkgroupFinder",
@@ -76929,7 +76985,7 @@
76929
76985
  }
76930
76986
  },
76931
76987
  {
76932
- "__docId__": 2882,
76988
+ "__docId__": 2884,
76933
76989
  "kind": "member",
76934
76990
  "name": "_domain",
76935
76991
  "memberof": "src/workgroups/WorkgroupFinder.js~WorkgroupFinder",
@@ -76952,7 +77008,7 @@
76952
77008
  }
76953
77009
  },
76954
77010
  {
76955
- "__docId__": 2883,
77011
+ "__docId__": 2885,
76956
77012
  "kind": "member",
76957
77013
  "name": "_name",
76958
77014
  "memberof": "src/workgroups/WorkgroupFinder.js~WorkgroupFinder",
@@ -76975,7 +77031,7 @@
76975
77031
  }
76976
77032
  },
76977
77033
  {
76978
- "__docId__": 2884,
77034
+ "__docId__": 2886,
76979
77035
  "kind": "file",
76980
77036
  "name": "src/workgroups/WorkgroupRelations.js",
76981
77037
  "content": "'use strict';\r\n\r\nimport BaseProvision from '../provision/BaseProvision';\r\nimport Workgroups from './Workgroups';\r\nimport Channels from '../channels/Channels';\r\n\r\n/**\r\n * This is a base object that contains all you can do about workgroups.\r\n */\r\nexport default class WorkgroupRelations extends BaseProvision {\r\n\r\n /** \r\n * @param {InternalOpenGateAPI} Reference to the API object.\r\n */\r\n constructor(ogapi) {\r\n super(ogapi, \"/domains\", undefined, [\"workgroup\", \"channels\"]);\r\n this._ogapi = ogapi;\r\n this._action = \"CREATE\";\r\n }\r\n\r\n /**\r\n * Set the workgroup attribute\r\n * @param {string} workgroup - required field\r\n * @return {WorkgroupRelations}\r\n */\r\n withWorkgroup(workgroup) {\r\n if (workgroup.constructor.prototype != Workgroups.prototype)\r\n throw new Error('Parameter workgroup must be a workgroup');\r\n\r\n this._workgroup = workgroup;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the channel attribute\r\n * @param {string} channel - required field for creation or update\r\n * @return {WorkgroupRelations}\r\n */\r\n withChannel(channel) {\r\n if (channel.constructor.prototype != Channels.prototype)\r\n throw new Error('Parameter channel must be a channel');\r\n\r\n if (!this._channels)\r\n this._channels = [];\r\n\r\n this._channels.push({\r\n 'organization': channel._organization,\r\n 'channel': channel._name\r\n });\r\n\r\n return this;\r\n }\r\n\r\n _composeElement() {\r\n this._checkRequiredParameters();\r\n\r\n this._resource = 'provision/domains/' + this._workgroup._domainName + '/workgroups/' + this._workgroup._name + '/relations';\r\n\r\n var workgroup = {\r\n \"workgroupRelation\": {\r\n \"channels\": this._channels ? this._channels : undefined\r\n }\r\n };\r\n\r\n return workgroup;\r\n }\r\n\r\n _buildURL() {\r\n var url = 'provision/domains/' + this._workgroup._domainName + '/workgroups/' + this._workgroup._name + '/relations';\r\n return url;\r\n }\r\n\r\n create() {\r\n var relations = this._composeElement();\r\n\r\n var petitionUrl = this._resource;\r\n this._setUrlParameters({\r\n action: 'CREATE'\r\n });\r\n return this._doNorthPost(petitionUrl, relations);\r\n }\r\n\r\n delete() {\r\n this._setUrlParameters({\r\n action: 'DELETE'\r\n });\r\n var petitionUrl = this._buildURL();\r\n\r\n if (this._channels) {\r\n var relations = this._composeElement();\r\n return this._doNorthPost(petitionUrl, relations);\r\n } else {\r\n return this._doNorthPost(petitionUrl, {\r\n \"workgroupRelation\": {\r\n \"channels\": []\r\n }\r\n });\r\n }\r\n }\r\n\r\n /** \r\n * Update not allowed\r\n * @throws {Error} \r\n */\r\n update() {\r\n throw new Error(\"Workgroup relation update not allowed\");\r\n }\r\n\r\n}",
@@ -76986,7 +77042,7 @@
76986
77042
  "lineNumber": 1
76987
77043
  },
76988
77044
  {
76989
- "__docId__": 2885,
77045
+ "__docId__": 2887,
76990
77046
  "kind": "class",
76991
77047
  "name": "WorkgroupRelations",
76992
77048
  "memberof": "src/workgroups/WorkgroupRelations.js",
@@ -77004,7 +77060,7 @@
77004
77060
  ]
77005
77061
  },
77006
77062
  {
77007
- "__docId__": 2886,
77063
+ "__docId__": 2888,
77008
77064
  "kind": "constructor",
77009
77065
  "name": "constructor",
77010
77066
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77029,7 +77085,7 @@
77029
77085
  ]
77030
77086
  },
77031
77087
  {
77032
- "__docId__": 2887,
77088
+ "__docId__": 2889,
77033
77089
  "kind": "member",
77034
77090
  "name": "_ogapi",
77035
77091
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77052,7 +77108,7 @@
77052
77108
  }
77053
77109
  },
77054
77110
  {
77055
- "__docId__": 2888,
77111
+ "__docId__": 2890,
77056
77112
  "kind": "member",
77057
77113
  "name": "_action",
77058
77114
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77075,7 +77131,7 @@
77075
77131
  }
77076
77132
  },
77077
77133
  {
77078
- "__docId__": 2889,
77134
+ "__docId__": 2891,
77079
77135
  "kind": "method",
77080
77136
  "name": "withWorkgroup",
77081
77137
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77108,7 +77164,7 @@
77108
77164
  }
77109
77165
  },
77110
77166
  {
77111
- "__docId__": 2890,
77167
+ "__docId__": 2892,
77112
77168
  "kind": "member",
77113
77169
  "name": "_workgroup",
77114
77170
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77131,7 +77187,7 @@
77131
77187
  }
77132
77188
  },
77133
77189
  {
77134
- "__docId__": 2891,
77190
+ "__docId__": 2893,
77135
77191
  "kind": "method",
77136
77192
  "name": "withChannel",
77137
77193
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77164,7 +77220,7 @@
77164
77220
  }
77165
77221
  },
77166
77222
  {
77167
- "__docId__": 2892,
77223
+ "__docId__": 2894,
77168
77224
  "kind": "member",
77169
77225
  "name": "_channels",
77170
77226
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77187,7 +77243,7 @@
77187
77243
  }
77188
77244
  },
77189
77245
  {
77190
- "__docId__": 2893,
77246
+ "__docId__": 2895,
77191
77247
  "kind": "method",
77192
77248
  "name": "_composeElement",
77193
77249
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77213,7 +77269,7 @@
77213
77269
  }
77214
77270
  },
77215
77271
  {
77216
- "__docId__": 2894,
77272
+ "__docId__": 2896,
77217
77273
  "kind": "member",
77218
77274
  "name": "_resource",
77219
77275
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77236,7 +77292,7 @@
77236
77292
  }
77237
77293
  },
77238
77294
  {
77239
- "__docId__": 2895,
77295
+ "__docId__": 2897,
77240
77296
  "kind": "method",
77241
77297
  "name": "_buildURL",
77242
77298
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77262,7 +77318,7 @@
77262
77318
  }
77263
77319
  },
77264
77320
  {
77265
- "__docId__": 2896,
77321
+ "__docId__": 2898,
77266
77322
  "kind": "method",
77267
77323
  "name": "create",
77268
77324
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77288,7 +77344,7 @@
77288
77344
  }
77289
77345
  },
77290
77346
  {
77291
- "__docId__": 2897,
77347
+ "__docId__": 2899,
77292
77348
  "kind": "method",
77293
77349
  "name": "delete",
77294
77350
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77314,7 +77370,7 @@
77314
77370
  }
77315
77371
  },
77316
77372
  {
77317
- "__docId__": 2898,
77373
+ "__docId__": 2900,
77318
77374
  "kind": "method",
77319
77375
  "name": "update",
77320
77376
  "memberof": "src/workgroups/WorkgroupRelations.js~WorkgroupRelations",
@@ -77336,7 +77392,7 @@
77336
77392
  ]
77337
77393
  },
77338
77394
  {
77339
- "__docId__": 2899,
77395
+ "__docId__": 2901,
77340
77396
  "kind": "file",
77341
77397
  "name": "src/workgroups/WorkgroupRelationsFinder.js",
77342
77398
  "content": "'use strict';\r\n\r\nimport ProvisionGenericFinder from '../ProvisionGenericFinder';\r\n\r\n/**\r\n * This class allow make get request to workgroup relation resource into Opengate North API.\r\n */\r\nexport default class WorkgroupRelationsFinder extends ProvisionGenericFinder {\r\n\r\n /** \r\n * @param {InternalOpenGateAPI} Reference to the API object.\r\n */\r\n constructor(ogapi) {\r\n super(ogapi, 'domains', 'workgroup', 'Workgroup relation not found');\r\n }\r\n\r\n /**\r\n * @return {String} This returns a string with the URL of the request.\r\n * @private\r\n */\r\n _composeUrl() {\r\n return this._baseUrl + \"/\" + this._domain + \"/workgroups/\" + this._name + \"/relations\";\r\n }\r\n\r\n /**\r\n * @param {string} domain - domain name \r\n * @param {string} name - workgroup name\r\n * @return {Promise} \r\n */\r\n findByDomainAndName(domain, name) {\r\n this._domain = domain;\r\n this._name = name;\r\n return this._execute();\r\n }\r\n}",
@@ -77347,7 +77403,7 @@
77347
77403
  "lineNumber": 1
77348
77404
  },
77349
77405
  {
77350
- "__docId__": 2900,
77406
+ "__docId__": 2902,
77351
77407
  "kind": "class",
77352
77408
  "name": "WorkgroupRelationsFinder",
77353
77409
  "memberof": "src/workgroups/WorkgroupRelationsFinder.js",
@@ -77365,7 +77421,7 @@
77365
77421
  ]
77366
77422
  },
77367
77423
  {
77368
- "__docId__": 2901,
77424
+ "__docId__": 2903,
77369
77425
  "kind": "constructor",
77370
77426
  "name": "constructor",
77371
77427
  "memberof": "src/workgroups/WorkgroupRelationsFinder.js~WorkgroupRelationsFinder",
@@ -77390,7 +77446,7 @@
77390
77446
  ]
77391
77447
  },
77392
77448
  {
77393
- "__docId__": 2902,
77449
+ "__docId__": 2904,
77394
77450
  "kind": "method",
77395
77451
  "name": "_composeUrl",
77396
77452
  "memberof": "src/workgroups/WorkgroupRelationsFinder.js~WorkgroupRelationsFinder",
@@ -77412,7 +77468,7 @@
77412
77468
  }
77413
77469
  },
77414
77470
  {
77415
- "__docId__": 2903,
77471
+ "__docId__": 2905,
77416
77472
  "kind": "method",
77417
77473
  "name": "findByDomainAndName",
77418
77474
  "memberof": "src/workgroups/WorkgroupRelationsFinder.js~WorkgroupRelationsFinder",
@@ -77455,7 +77511,7 @@
77455
77511
  }
77456
77512
  },
77457
77513
  {
77458
- "__docId__": 2904,
77514
+ "__docId__": 2906,
77459
77515
  "kind": "member",
77460
77516
  "name": "_domain",
77461
77517
  "memberof": "src/workgroups/WorkgroupRelationsFinder.js~WorkgroupRelationsFinder",
@@ -77478,7 +77534,7 @@
77478
77534
  }
77479
77535
  },
77480
77536
  {
77481
- "__docId__": 2905,
77537
+ "__docId__": 2907,
77482
77538
  "kind": "member",
77483
77539
  "name": "_name",
77484
77540
  "memberof": "src/workgroups/WorkgroupRelationsFinder.js~WorkgroupRelationsFinder",
@@ -77501,7 +77557,7 @@
77501
77557
  }
77502
77558
  },
77503
77559
  {
77504
- "__docId__": 2906,
77560
+ "__docId__": 2908,
77505
77561
  "kind": "file",
77506
77562
  "name": "src/workgroups/Workgroups.js",
77507
77563
  "content": "'use strict';\r\n\r\nimport q from 'q';\r\nimport BaseProvision from '../provision/BaseProvision';\r\n\r\n/**\r\n * This is a base object that contains all you can do about workgroups.\r\n */\r\nexport default class Workgroups extends BaseProvision {\r\n\r\n /** \r\n * @param {InternalOpenGateAPI} Reference to the API object.\r\n */\r\n constructor(ogapi) {\r\n super(ogapi, \"/domains\", undefined, [\"name\", \"domainName\"]);\r\n this._ogapi = ogapi;\r\n }\r\n\r\n /**\r\n * Set the name attribute\r\n * @param {string} name - required field\r\n * @return {Workgroups}\r\n */\r\n withName(name) {\r\n if (typeof name !== 'string' || name.length > 50)\r\n throw new Error({\r\n message: \"OGAPI_STRING_PARAMETER_MAX_LENGTH_50\",\r\n parameter: 'name'\r\n });\r\n this._name = name;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the description attribute\r\n * @param {string} description - required field\r\n * @return {Workgroups}\r\n */\r\n withDescription(description) {\r\n if (typeof description !== 'string' || description.length > 250)\r\n throw new Error({\r\n message: \"OGAPI_STRING_PARAMETER_MAX_LENGTH_250\",\r\n parameter: 'description'\r\n });\r\n this._description = description;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the administrative attribute\r\n * @param {boolean} administrative \r\n * @return {Workgroups}\r\n */\r\n withAdministrative(administrative) {\r\n /*if (typeof administrative !== 'boolean')\r\n throw new Error('Parameter administrative must be a boolean');*/\r\n this._administrative = administrative;\r\n return this;\r\n }\r\n\r\n /**\r\n * Set the domain attribute\r\n * @param {string} domainName - required field\r\n * @return {Workgroups}\r\n */\r\n withDomainName(domainName) {\r\n if (typeof domainName !== 'string' || domainName.length > 50)\r\n throw new Error({\r\n message: \"OGAPI_STRING_PARAMETER_MAX_LENGTH_50\",\r\n parameter: 'domainName'\r\n });\r\n this._domainName = domainName;\r\n return this;\r\n }\r\n\r\n _composeElement() {\r\n this._checkRequiredParameters();\r\n this._resource = 'provision/domains/' + this._domainName + '/workgroups';\r\n\r\n var workgroup = {\r\n \"workgroup\": {\r\n name: this._name || undefined,\r\n description: this._description || undefined,\r\n administrative: this._administrative || false\r\n }\r\n };\r\n\r\n return workgroup;\r\n }\r\n\r\n _composeElementUpdate() {\r\n this._checkRequiredParameters();\r\n this._resource = 'provision/domains/' + this._domainName + '/workgroups';\r\n\r\n var workgroup = {\r\n \"workgroup\": {\r\n description: this._description || undefined\r\n }\r\n };\r\n\r\n return workgroup;\r\n }\r\n\r\n _buildURL() {\r\n var url = 'provision/domains/' + this._domainName + '/workgroups/' + this._name;\r\n return url;\r\n }\r\n\r\n update() {\r\n var defered = q.defer();\r\n var promise = defered.promise;\r\n this._ogapi.Napi.put(this._buildURL(), this._composeElementUpdate(), undefined, this._getExtraHeaders(), this._getUrlParameters())\r\n .then((res) => {\r\n if (res.statusCode === 200) {\r\n defered.resolve({\r\n statusCode: res.statusCode\r\n });\r\n } else if (res.status === 200) {\r\n defered.resolve({\r\n statusCode: res.status\r\n });\r\n } else {\r\n defered.reject({\r\n errors: res.errors,\r\n statusCode: res.statusCode\r\n });\r\n }\r\n })\r\n .catch((error) => {\r\n defered.reject(error);\r\n });\r\n return promise;\r\n }\r\n\r\n}",
@@ -77512,7 +77568,7 @@
77512
77568
  "lineNumber": 1
77513
77569
  },
77514
77570
  {
77515
- "__docId__": 2907,
77571
+ "__docId__": 2909,
77516
77572
  "kind": "class",
77517
77573
  "name": "Workgroups",
77518
77574
  "memberof": "src/workgroups/Workgroups.js",
@@ -77530,7 +77586,7 @@
77530
77586
  ]
77531
77587
  },
77532
77588
  {
77533
- "__docId__": 2908,
77589
+ "__docId__": 2910,
77534
77590
  "kind": "constructor",
77535
77591
  "name": "constructor",
77536
77592
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77555,7 +77611,7 @@
77555
77611
  ]
77556
77612
  },
77557
77613
  {
77558
- "__docId__": 2909,
77614
+ "__docId__": 2911,
77559
77615
  "kind": "member",
77560
77616
  "name": "_ogapi",
77561
77617
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77578,7 +77634,7 @@
77578
77634
  }
77579
77635
  },
77580
77636
  {
77581
- "__docId__": 2910,
77637
+ "__docId__": 2912,
77582
77638
  "kind": "method",
77583
77639
  "name": "withName",
77584
77640
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77611,7 +77667,7 @@
77611
77667
  }
77612
77668
  },
77613
77669
  {
77614
- "__docId__": 2911,
77670
+ "__docId__": 2913,
77615
77671
  "kind": "member",
77616
77672
  "name": "_name",
77617
77673
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77634,7 +77690,7 @@
77634
77690
  }
77635
77691
  },
77636
77692
  {
77637
- "__docId__": 2912,
77693
+ "__docId__": 2914,
77638
77694
  "kind": "method",
77639
77695
  "name": "withDescription",
77640
77696
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77667,7 +77723,7 @@
77667
77723
  }
77668
77724
  },
77669
77725
  {
77670
- "__docId__": 2913,
77726
+ "__docId__": 2915,
77671
77727
  "kind": "member",
77672
77728
  "name": "_description",
77673
77729
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77690,7 +77746,7 @@
77690
77746
  }
77691
77747
  },
77692
77748
  {
77693
- "__docId__": 2914,
77749
+ "__docId__": 2916,
77694
77750
  "kind": "method",
77695
77751
  "name": "withAdministrative",
77696
77752
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77723,7 +77779,7 @@
77723
77779
  }
77724
77780
  },
77725
77781
  {
77726
- "__docId__": 2915,
77782
+ "__docId__": 2917,
77727
77783
  "kind": "member",
77728
77784
  "name": "_administrative",
77729
77785
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77746,7 +77802,7 @@
77746
77802
  }
77747
77803
  },
77748
77804
  {
77749
- "__docId__": 2916,
77805
+ "__docId__": 2918,
77750
77806
  "kind": "method",
77751
77807
  "name": "withDomainName",
77752
77808
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77779,7 +77835,7 @@
77779
77835
  }
77780
77836
  },
77781
77837
  {
77782
- "__docId__": 2917,
77838
+ "__docId__": 2919,
77783
77839
  "kind": "member",
77784
77840
  "name": "_domainName",
77785
77841
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77802,7 +77858,7 @@
77802
77858
  }
77803
77859
  },
77804
77860
  {
77805
- "__docId__": 2918,
77861
+ "__docId__": 2920,
77806
77862
  "kind": "method",
77807
77863
  "name": "_composeElement",
77808
77864
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77828,7 +77884,7 @@
77828
77884
  }
77829
77885
  },
77830
77886
  {
77831
- "__docId__": 2919,
77887
+ "__docId__": 2921,
77832
77888
  "kind": "member",
77833
77889
  "name": "_resource",
77834
77890
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77851,7 +77907,7 @@
77851
77907
  }
77852
77908
  },
77853
77909
  {
77854
- "__docId__": 2920,
77910
+ "__docId__": 2922,
77855
77911
  "kind": "method",
77856
77912
  "name": "_composeElementUpdate",
77857
77913
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77877,7 +77933,7 @@
77877
77933
  }
77878
77934
  },
77879
77935
  {
77880
- "__docId__": 2921,
77936
+ "__docId__": 2923,
77881
77937
  "kind": "member",
77882
77938
  "name": "_resource",
77883
77939
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77900,7 +77956,7 @@
77900
77956
  }
77901
77957
  },
77902
77958
  {
77903
- "__docId__": 2922,
77959
+ "__docId__": 2924,
77904
77960
  "kind": "method",
77905
77961
  "name": "_buildURL",
77906
77962
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77926,7 +77982,7 @@
77926
77982
  }
77927
77983
  },
77928
77984
  {
77929
- "__docId__": 2923,
77985
+ "__docId__": 2925,
77930
77986
  "kind": "method",
77931
77987
  "name": "update",
77932
77988
  "memberof": "src/workgroups/Workgroups.js~Workgroups",
@@ -77952,7 +78008,7 @@
77952
78008
  }
77953
78009
  },
77954
78010
  {
77955
- "__docId__": 2925,
78011
+ "__docId__": 2927,
77956
78012
  "kind": "external",
77957
78013
  "name": "Infinity",
77958
78014
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity",
@@ -77964,7 +78020,7 @@
77964
78020
  "builtinExternal": true
77965
78021
  },
77966
78022
  {
77967
- "__docId__": 2926,
78023
+ "__docId__": 2928,
77968
78024
  "kind": "external",
77969
78025
  "name": "NaN",
77970
78026
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN",
@@ -77976,7 +78032,7 @@
77976
78032
  "builtinExternal": true
77977
78033
  },
77978
78034
  {
77979
- "__docId__": 2927,
78035
+ "__docId__": 2929,
77980
78036
  "kind": "external",
77981
78037
  "name": "undefined",
77982
78038
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined",
@@ -77988,7 +78044,7 @@
77988
78044
  "builtinExternal": true
77989
78045
  },
77990
78046
  {
77991
- "__docId__": 2928,
78047
+ "__docId__": 2930,
77992
78048
  "kind": "external",
77993
78049
  "name": "null",
77994
78050
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null",
@@ -78000,7 +78056,7 @@
78000
78056
  "builtinExternal": true
78001
78057
  },
78002
78058
  {
78003
- "__docId__": 2929,
78059
+ "__docId__": 2931,
78004
78060
  "kind": "external",
78005
78061
  "name": "Object",
78006
78062
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
@@ -78012,7 +78068,7 @@
78012
78068
  "builtinExternal": true
78013
78069
  },
78014
78070
  {
78015
- "__docId__": 2930,
78071
+ "__docId__": 2932,
78016
78072
  "kind": "external",
78017
78073
  "name": "object",
78018
78074
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object",
@@ -78024,7 +78080,7 @@
78024
78080
  "builtinExternal": true
78025
78081
  },
78026
78082
  {
78027
- "__docId__": 2931,
78083
+ "__docId__": 2933,
78028
78084
  "kind": "external",
78029
78085
  "name": "Function",
78030
78086
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
@@ -78036,7 +78092,7 @@
78036
78092
  "builtinExternal": true
78037
78093
  },
78038
78094
  {
78039
- "__docId__": 2932,
78095
+ "__docId__": 2934,
78040
78096
  "kind": "external",
78041
78097
  "name": "function",
78042
78098
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function",
@@ -78048,7 +78104,7 @@
78048
78104
  "builtinExternal": true
78049
78105
  },
78050
78106
  {
78051
- "__docId__": 2933,
78107
+ "__docId__": 2935,
78052
78108
  "kind": "external",
78053
78109
  "name": "Boolean",
78054
78110
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
@@ -78060,7 +78116,7 @@
78060
78116
  "builtinExternal": true
78061
78117
  },
78062
78118
  {
78063
- "__docId__": 2934,
78119
+ "__docId__": 2936,
78064
78120
  "kind": "external",
78065
78121
  "name": "boolean",
78066
78122
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean",
@@ -78072,7 +78128,7 @@
78072
78128
  "builtinExternal": true
78073
78129
  },
78074
78130
  {
78075
- "__docId__": 2935,
78131
+ "__docId__": 2937,
78076
78132
  "kind": "external",
78077
78133
  "name": "Symbol",
78078
78134
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol",
@@ -78084,7 +78140,7 @@
78084
78140
  "builtinExternal": true
78085
78141
  },
78086
78142
  {
78087
- "__docId__": 2936,
78143
+ "__docId__": 2938,
78088
78144
  "kind": "external",
78089
78145
  "name": "Error",
78090
78146
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error",
@@ -78096,7 +78152,7 @@
78096
78152
  "builtinExternal": true
78097
78153
  },
78098
78154
  {
78099
- "__docId__": 2937,
78155
+ "__docId__": 2939,
78100
78156
  "kind": "external",
78101
78157
  "name": "EvalError",
78102
78158
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError",
@@ -78108,7 +78164,7 @@
78108
78164
  "builtinExternal": true
78109
78165
  },
78110
78166
  {
78111
- "__docId__": 2938,
78167
+ "__docId__": 2940,
78112
78168
  "kind": "external",
78113
78169
  "name": "InternalError",
78114
78170
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError",
@@ -78120,7 +78176,7 @@
78120
78176
  "builtinExternal": true
78121
78177
  },
78122
78178
  {
78123
- "__docId__": 2939,
78179
+ "__docId__": 2941,
78124
78180
  "kind": "external",
78125
78181
  "name": "RangeError",
78126
78182
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError",
@@ -78132,7 +78188,7 @@
78132
78188
  "builtinExternal": true
78133
78189
  },
78134
78190
  {
78135
- "__docId__": 2940,
78191
+ "__docId__": 2942,
78136
78192
  "kind": "external",
78137
78193
  "name": "ReferenceError",
78138
78194
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError",
@@ -78144,7 +78200,7 @@
78144
78200
  "builtinExternal": true
78145
78201
  },
78146
78202
  {
78147
- "__docId__": 2941,
78203
+ "__docId__": 2943,
78148
78204
  "kind": "external",
78149
78205
  "name": "SyntaxError",
78150
78206
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError",
@@ -78156,7 +78212,7 @@
78156
78212
  "builtinExternal": true
78157
78213
  },
78158
78214
  {
78159
- "__docId__": 2942,
78215
+ "__docId__": 2944,
78160
78216
  "kind": "external",
78161
78217
  "name": "TypeError",
78162
78218
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError",
@@ -78168,7 +78224,7 @@
78168
78224
  "builtinExternal": true
78169
78225
  },
78170
78226
  {
78171
- "__docId__": 2943,
78227
+ "__docId__": 2945,
78172
78228
  "kind": "external",
78173
78229
  "name": "URIError",
78174
78230
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError",
@@ -78180,7 +78236,7 @@
78180
78236
  "builtinExternal": true
78181
78237
  },
78182
78238
  {
78183
- "__docId__": 2944,
78239
+ "__docId__": 2946,
78184
78240
  "kind": "external",
78185
78241
  "name": "Number",
78186
78242
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
@@ -78192,7 +78248,7 @@
78192
78248
  "builtinExternal": true
78193
78249
  },
78194
78250
  {
78195
- "__docId__": 2945,
78251
+ "__docId__": 2947,
78196
78252
  "kind": "external",
78197
78253
  "name": "number",
78198
78254
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number",
@@ -78204,7 +78260,7 @@
78204
78260
  "builtinExternal": true
78205
78261
  },
78206
78262
  {
78207
- "__docId__": 2946,
78263
+ "__docId__": 2948,
78208
78264
  "kind": "external",
78209
78265
  "name": "Date",
78210
78266
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date",
@@ -78216,7 +78272,7 @@
78216
78272
  "builtinExternal": true
78217
78273
  },
78218
78274
  {
78219
- "__docId__": 2947,
78275
+ "__docId__": 2949,
78220
78276
  "kind": "external",
78221
78277
  "name": "String",
78222
78278
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
@@ -78228,7 +78284,7 @@
78228
78284
  "builtinExternal": true
78229
78285
  },
78230
78286
  {
78231
- "__docId__": 2948,
78287
+ "__docId__": 2950,
78232
78288
  "kind": "external",
78233
78289
  "name": "string",
78234
78290
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String",
@@ -78240,7 +78296,7 @@
78240
78296
  "builtinExternal": true
78241
78297
  },
78242
78298
  {
78243
- "__docId__": 2949,
78299
+ "__docId__": 2951,
78244
78300
  "kind": "external",
78245
78301
  "name": "RegExp",
78246
78302
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp",
@@ -78252,7 +78308,7 @@
78252
78308
  "builtinExternal": true
78253
78309
  },
78254
78310
  {
78255
- "__docId__": 2950,
78311
+ "__docId__": 2952,
78256
78312
  "kind": "external",
78257
78313
  "name": "Array",
78258
78314
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array",
@@ -78264,7 +78320,7 @@
78264
78320
  "builtinExternal": true
78265
78321
  },
78266
78322
  {
78267
- "__docId__": 2951,
78323
+ "__docId__": 2953,
78268
78324
  "kind": "external",
78269
78325
  "name": "Int8Array",
78270
78326
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array",
@@ -78276,7 +78332,7 @@
78276
78332
  "builtinExternal": true
78277
78333
  },
78278
78334
  {
78279
- "__docId__": 2952,
78335
+ "__docId__": 2954,
78280
78336
  "kind": "external",
78281
78337
  "name": "Uint8Array",
78282
78338
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array",
@@ -78288,7 +78344,7 @@
78288
78344
  "builtinExternal": true
78289
78345
  },
78290
78346
  {
78291
- "__docId__": 2953,
78347
+ "__docId__": 2955,
78292
78348
  "kind": "external",
78293
78349
  "name": "Uint8ClampedArray",
78294
78350
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray",
@@ -78300,7 +78356,7 @@
78300
78356
  "builtinExternal": true
78301
78357
  },
78302
78358
  {
78303
- "__docId__": 2954,
78359
+ "__docId__": 2956,
78304
78360
  "kind": "external",
78305
78361
  "name": "Int16Array",
78306
78362
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array",
@@ -78312,7 +78368,7 @@
78312
78368
  "builtinExternal": true
78313
78369
  },
78314
78370
  {
78315
- "__docId__": 2955,
78371
+ "__docId__": 2957,
78316
78372
  "kind": "external",
78317
78373
  "name": "Uint16Array",
78318
78374
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array",
@@ -78324,7 +78380,7 @@
78324
78380
  "builtinExternal": true
78325
78381
  },
78326
78382
  {
78327
- "__docId__": 2956,
78383
+ "__docId__": 2958,
78328
78384
  "kind": "external",
78329
78385
  "name": "Int32Array",
78330
78386
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array",
@@ -78336,7 +78392,7 @@
78336
78392
  "builtinExternal": true
78337
78393
  },
78338
78394
  {
78339
- "__docId__": 2957,
78395
+ "__docId__": 2959,
78340
78396
  "kind": "external",
78341
78397
  "name": "Uint32Array",
78342
78398
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array",
@@ -78348,7 +78404,7 @@
78348
78404
  "builtinExternal": true
78349
78405
  },
78350
78406
  {
78351
- "__docId__": 2958,
78407
+ "__docId__": 2960,
78352
78408
  "kind": "external",
78353
78409
  "name": "Float32Array",
78354
78410
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array",
@@ -78360,7 +78416,7 @@
78360
78416
  "builtinExternal": true
78361
78417
  },
78362
78418
  {
78363
- "__docId__": 2959,
78419
+ "__docId__": 2961,
78364
78420
  "kind": "external",
78365
78421
  "name": "Float64Array",
78366
78422
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array",
@@ -78372,7 +78428,7 @@
78372
78428
  "builtinExternal": true
78373
78429
  },
78374
78430
  {
78375
- "__docId__": 2960,
78431
+ "__docId__": 2962,
78376
78432
  "kind": "external",
78377
78433
  "name": "Map",
78378
78434
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map",
@@ -78384,7 +78440,7 @@
78384
78440
  "builtinExternal": true
78385
78441
  },
78386
78442
  {
78387
- "__docId__": 2961,
78443
+ "__docId__": 2963,
78388
78444
  "kind": "external",
78389
78445
  "name": "Set",
78390
78446
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set",
@@ -78396,7 +78452,7 @@
78396
78452
  "builtinExternal": true
78397
78453
  },
78398
78454
  {
78399
- "__docId__": 2962,
78455
+ "__docId__": 2964,
78400
78456
  "kind": "external",
78401
78457
  "name": "WeakMap",
78402
78458
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap",
@@ -78408,7 +78464,7 @@
78408
78464
  "builtinExternal": true
78409
78465
  },
78410
78466
  {
78411
- "__docId__": 2963,
78467
+ "__docId__": 2965,
78412
78468
  "kind": "external",
78413
78469
  "name": "WeakSet",
78414
78470
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet",
@@ -78420,7 +78476,7 @@
78420
78476
  "builtinExternal": true
78421
78477
  },
78422
78478
  {
78423
- "__docId__": 2964,
78479
+ "__docId__": 2966,
78424
78480
  "kind": "external",
78425
78481
  "name": "ArrayBuffer",
78426
78482
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer",
@@ -78432,7 +78488,7 @@
78432
78488
  "builtinExternal": true
78433
78489
  },
78434
78490
  {
78435
- "__docId__": 2965,
78491
+ "__docId__": 2967,
78436
78492
  "kind": "external",
78437
78493
  "name": "DataView",
78438
78494
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView",
@@ -78444,7 +78500,7 @@
78444
78500
  "builtinExternal": true
78445
78501
  },
78446
78502
  {
78447
- "__docId__": 2966,
78503
+ "__docId__": 2968,
78448
78504
  "kind": "external",
78449
78505
  "name": "JSON",
78450
78506
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON",
@@ -78456,7 +78512,7 @@
78456
78512
  "builtinExternal": true
78457
78513
  },
78458
78514
  {
78459
- "__docId__": 2967,
78515
+ "__docId__": 2969,
78460
78516
  "kind": "external",
78461
78517
  "name": "Promise",
78462
78518
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise",
@@ -78468,7 +78524,7 @@
78468
78524
  "builtinExternal": true
78469
78525
  },
78470
78526
  {
78471
- "__docId__": 2968,
78527
+ "__docId__": 2970,
78472
78528
  "kind": "external",
78473
78529
  "name": "Generator",
78474
78530
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator",
@@ -78480,7 +78536,7 @@
78480
78536
  "builtinExternal": true
78481
78537
  },
78482
78538
  {
78483
- "__docId__": 2969,
78539
+ "__docId__": 2971,
78484
78540
  "kind": "external",
78485
78541
  "name": "GeneratorFunction",
78486
78542
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction",
@@ -78492,7 +78548,7 @@
78492
78548
  "builtinExternal": true
78493
78549
  },
78494
78550
  {
78495
- "__docId__": 2970,
78551
+ "__docId__": 2972,
78496
78552
  "kind": "external",
78497
78553
  "name": "Reflect",
78498
78554
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect",
@@ -78504,7 +78560,7 @@
78504
78560
  "builtinExternal": true
78505
78561
  },
78506
78562
  {
78507
- "__docId__": 2971,
78563
+ "__docId__": 2973,
78508
78564
  "kind": "external",
78509
78565
  "name": "Proxy",
78510
78566
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy",
@@ -78517,7 +78573,7 @@
78517
78573
  "builtinExternal": true
78518
78574
  },
78519
78575
  {
78520
- "__docId__": 2973,
78576
+ "__docId__": 2975,
78521
78577
  "kind": "external",
78522
78578
  "name": "CanvasRenderingContext2D",
78523
78579
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D",
@@ -78529,7 +78585,7 @@
78529
78585
  "builtinExternal": true
78530
78586
  },
78531
78587
  {
78532
- "__docId__": 2974,
78588
+ "__docId__": 2976,
78533
78589
  "kind": "external",
78534
78590
  "name": "DocumentFragment",
78535
78591
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment",
@@ -78541,7 +78597,7 @@
78541
78597
  "builtinExternal": true
78542
78598
  },
78543
78599
  {
78544
- "__docId__": 2975,
78600
+ "__docId__": 2977,
78545
78601
  "kind": "external",
78546
78602
  "name": "Element",
78547
78603
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Element",
@@ -78553,7 +78609,7 @@
78553
78609
  "builtinExternal": true
78554
78610
  },
78555
78611
  {
78556
- "__docId__": 2976,
78612
+ "__docId__": 2978,
78557
78613
  "kind": "external",
78558
78614
  "name": "Event",
78559
78615
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Event",
@@ -78565,7 +78621,7 @@
78565
78621
  "builtinExternal": true
78566
78622
  },
78567
78623
  {
78568
- "__docId__": 2977,
78624
+ "__docId__": 2979,
78569
78625
  "kind": "external",
78570
78626
  "name": "Node",
78571
78627
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Node",
@@ -78577,7 +78633,7 @@
78577
78633
  "builtinExternal": true
78578
78634
  },
78579
78635
  {
78580
- "__docId__": 2978,
78636
+ "__docId__": 2980,
78581
78637
  "kind": "external",
78582
78638
  "name": "NodeList",
78583
78639
  "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/NodeList",
@@ -78589,7 +78645,7 @@
78589
78645
  "builtinExternal": true
78590
78646
  },
78591
78647
  {
78592
- "__docId__": 2979,
78648
+ "__docId__": 2981,
78593
78649
  "kind": "external",
78594
78650
  "name": "XMLHttpRequest",
78595
78651
  "externalLink": "https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest",
@@ -78601,7 +78657,7 @@
78601
78657
  "builtinExternal": true
78602
78658
  },
78603
78659
  {
78604
- "__docId__": 2980,
78660
+ "__docId__": 2982,
78605
78661
  "kind": "external",
78606
78662
  "name": "AudioContext",
78607
78663
  "externalLink": "https://developer.mozilla.org/en/docs/Web/API/AudioContext",
@@ -78614,7 +78670,7 @@
78614
78670
  "builtinExternal": true
78615
78671
  },
78616
78672
  {
78617
- "__docId__": 2981,
78673
+ "__docId__": 2983,
78618
78674
  "kind": "testFile",
78619
78675
  "name": "client/autogeneratedFields/fields.spec.js",
78620
78676
  "content": "define(function () {\r\n mocha.setup('bdd');\r\n\r\n describe('Testing fields finder api', function () {\r\n \r\n it('search a fields devicesSearchBuilder', function () {\r\n return ogapi.devicesSearchBuilder().findFields(\"sub\").then(function (fields) {\r\n assert.notEqual(fields.length, 0);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n });\r\n\r\n it('search a fields devicesSearchBuilder with first level nested', function () {\r\n return ogapi.devicesSearchBuilder().findFields(\"subscription.asd\").then(function (fields) {\r\n assert.notEqual(fields.length, 0);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n\r\n });\r\n\r\n it('search a fields devicesSearchBuilder with different level', function () {\r\n var fieldsSearching1, fieldsSearching2;\r\n ogapi.devicesSearchBuilder().findFields(\"subs\").then(function (fields) {\r\n fieldsSearching1 = fields;\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n\r\n ogapi.devicesSearchBuilder().findFields(\"subscription.\").then(function (fields) {\r\n fieldsSearching2 = fields;\r\n assert.notEqual(fieldsSearching1.length, fieldsSearching2.length);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n });\r\n\r\n it('search a fields devicesSearchBuilder that does not exist', function () {\r\n\r\n ogapi.devicesSearchBuilder().findFields(\"subscription.relColl.prov\").then(function (fields) {\r\n assert.equal(fields.length, 0);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n });\r\n\r\n\r\n it('search a fields devicesSearchBuilder with second level nested', function () {\r\n return ogapi.devicesSearchBuilder().findFields(\"subscription.relColl.a\").then(function (fields) {\r\n assert.notEqual(fields.length, 0);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n });\r\n\r\n it('search a fields operationsSearchBuilder', function () {\r\n return ogapi.operationsSearchBuilder().findFields(\"sub\").then(function (fields) {\r\n assert.notEqual(fields.length, 0);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n });\r\n\r\n it('search a fields executionsSearchBuilder', function () {\r\n return ogapi.executionsSearchBuilder().findFields(\"sub\").then(function (fields) {\r\n assert.notEqual(fields.length, 0);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n });\r\n it('search a fields alarmsSearchBuilder', function () {\r\n return ogapi.alarmsSearchBuilder().findFields(\"sub\").then(function (fields) {\r\n assert.notEqual(fields.length, 0);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n });\r\n it('search a fields certificatesSearchBuilder', function () {\r\n return ogapi.certificatesSearchBuilder().findFields(\"\").then(function (fields) {\r\n assert.notEqual(fields.length, 0);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n });\r\n\r\n it('search a fields bundlesSearchBuilder', function () {\r\n return ogapi.bundlesSearchBuilder().findFields(\"sub\").then(function (fields) {\r\n assert.notEqual(fields.length, 0);\r\n }).catch(function (err) {\r\n assert.strictEqual(true, false);\r\n });\r\n });\r\n });\r\n});",
@@ -78625,7 +78681,7 @@
78625
78681
  "lineNumber": 1
78626
78682
  },
78627
78683
  {
78628
- "__docId__": 2982,
78684
+ "__docId__": 2984,
78629
78685
  "kind": "testDescribe",
78630
78686
  "name": "describe0",
78631
78687
  "testId": 0,
@@ -78638,7 +78694,7 @@
78638
78694
  "lineNumber": 4
78639
78695
  },
78640
78696
  {
78641
- "__docId__": 2983,
78697
+ "__docId__": 2985,
78642
78698
  "kind": "testIt",
78643
78699
  "name": "it1",
78644
78700
  "testId": 1,
@@ -78651,7 +78707,7 @@
78651
78707
  "lineNumber": 6
78652
78708
  },
78653
78709
  {
78654
- "__docId__": 2984,
78710
+ "__docId__": 2986,
78655
78711
  "kind": "testIt",
78656
78712
  "name": "it2",
78657
78713
  "testId": 2,
@@ -78664,7 +78720,7 @@
78664
78720
  "lineNumber": 14
78665
78721
  },
78666
78722
  {
78667
- "__docId__": 2985,
78723
+ "__docId__": 2987,
78668
78724
  "kind": "testIt",
78669
78725
  "name": "it3",
78670
78726
  "testId": 3,
@@ -78677,7 +78733,7 @@
78677
78733
  "lineNumber": 23
78678
78734
  },
78679
78735
  {
78680
- "__docId__": 2986,
78736
+ "__docId__": 2988,
78681
78737
  "kind": "testIt",
78682
78738
  "name": "it4",
78683
78739
  "testId": 4,
@@ -78690,7 +78746,7 @@
78690
78746
  "lineNumber": 39
78691
78747
  },
78692
78748
  {
78693
- "__docId__": 2987,
78749
+ "__docId__": 2989,
78694
78750
  "kind": "testIt",
78695
78751
  "name": "it5",
78696
78752
  "testId": 5,
@@ -78703,7 +78759,7 @@
78703
78759
  "lineNumber": 49
78704
78760
  },
78705
78761
  {
78706
- "__docId__": 2988,
78762
+ "__docId__": 2990,
78707
78763
  "kind": "testIt",
78708
78764
  "name": "it6",
78709
78765
  "testId": 6,
@@ -78716,7 +78772,7 @@
78716
78772
  "lineNumber": 57
78717
78773
  },
78718
78774
  {
78719
- "__docId__": 2989,
78775
+ "__docId__": 2991,
78720
78776
  "kind": "testIt",
78721
78777
  "name": "it7",
78722
78778
  "testId": 7,
@@ -78729,7 +78785,7 @@
78729
78785
  "lineNumber": 65
78730
78786
  },
78731
78787
  {
78732
- "__docId__": 2990,
78788
+ "__docId__": 2992,
78733
78789
  "kind": "testIt",
78734
78790
  "name": "it8",
78735
78791
  "testId": 8,
@@ -78742,7 +78798,7 @@
78742
78798
  "lineNumber": 72
78743
78799
  },
78744
78800
  {
78745
- "__docId__": 2991,
78801
+ "__docId__": 2993,
78746
78802
  "kind": "testIt",
78747
78803
  "name": "it9",
78748
78804
  "testId": 9,
@@ -78755,7 +78811,7 @@
78755
78811
  "lineNumber": 79
78756
78812
  },
78757
78813
  {
78758
- "__docId__": 2992,
78814
+ "__docId__": 2994,
78759
78815
  "kind": "testIt",
78760
78816
  "name": "it10",
78761
78817
  "testId": 10,
@@ -78768,7 +78824,7 @@
78768
78824
  "lineNumber": 87
78769
78825
  },
78770
78826
  {
78771
- "__docId__": 2993,
78827
+ "__docId__": 2995,
78772
78828
  "kind": "testFile",
78773
78829
  "name": "client/bundles/bundles.spec.js",
78774
78830
  "content": "define(function() {\r\n mocha.setup('bdd');\r\n /** @test {InternalOpenGateAPI#bundlesBuilder()} */\r\n describe('Check funcionality bundles module:', function() {\r\n var bundle;\r\n before(function() {\r\n bundle = ogapi.bundlesBuilder();\r\n });\r\n /** @test {InternalOpenGateAPI#bundlesBuilder} */\r\n /*describe('Check basic parameters:', function() {\r\n\r\n it('Name is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withName(11);\r\n }, \"Parameter name must be a string and has a maximum length of 255\");\r\n\r\n });\r\n\r\n it('version is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withVersion(1);\r\n }, \"Parameter version must be a string and has a maximum length of 50\");\r\n\r\n });\r\n\r\n it('Hardware is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withHardware(1);\r\n }, \"Parameter hardware must be a string\");\r\n\r\n });\r\n\r\n it('workgroup is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withWorkgroup(1);\r\n }, \"Parameter workgroup must be a string\");\r\n\r\n });\r\n\r\n it('description is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withDescription(1);\r\n }, \"Parameter description must be a string and has a maximum length of 250\");\r\n\r\n });\r\n\r\n it('UserNotes is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withUserNotes(1);\r\n }, \"Parameter notes must be a string and has a maximum length of 250\");\r\n\r\n });\r\n\r\n it('POSTACTION is not an Array', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withPreaction(\"\");\r\n }, \"Parameter preaction must be typeof Array\");\r\n\r\n });\r\n\r\n it('POSTACTION does not have at least one element', function() {\r\n assert.doesNotThrow(function() {\r\n ogapi.bundlesBuilder().withPreaction([]);\r\n });\r\n\r\n });\r\n\r\n it('POSTACTION does not have correct Elements', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withPreaction([\"dd\"]);\r\n }, 'Any action into parameter preaction is not allowed. Parameter value <\\'[\"dd\"]\\'>, preaction allowed <\\'[\"HARDWARE_RESET\",\"SOFTWARE_RESET\",\"COMMS_DOWN\",\"COMMS_UP\",\"COMMS_RESET\"]\\'>');\r\n\r\n });\r\n\r\n it('POSTACTION have correct Elements', function() {\r\n assert.doesNotThrow(function() {\r\n ogapi.bundlesBuilder().withPreaction([\"HARDWARE_RESET\", \"SOFTWARE_RESET\", \"COMMS_DOWN\", \"COMMS_UP\", \"COMMS_RESET\"]);\r\n });\r\n });\r\n\r\n\r\n it('Required parameters', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().create();\r\n }, \"Parameters name, version, hardware, workgroup must be defined\");\r\n });\r\n\r\n it('Check parameters type', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withName(222);\r\n }, \"Parameter name must be a string\");\r\n });\r\n });\r\n describe('Create a Bundle:', function() {\r\n\r\n before(function() {\r\n bundle.withName('bundle_testing').withVersion('V1').withWorkgroup('baseWorkGroup');\r\n });\r\n\r\n it('Check basic parameters', function() {\r\n assert.throws(function() {\r\n bundle.create();\r\n }, \"Parameters name, version, hardware, workgroup must be defined\");\r\n });\r\n\r\n it('Create a bundle without Hardware', function() {\r\n assert.throws(function() {\r\n bundle.create();\r\n }, \"Parameters name, version, hardware, workgroup must be defined\");\r\n });\r\n\r\n it('Create a bundle', function() {\r\n assert.doesNotThrow(function() {\r\n bundle.withHardware(\"OWA21\").create();\r\n });\r\n });\r\n it('Activate a bundle', function() {\r\n assert.doesNotThrow(function() {\r\n bundle.activate();\r\n });\r\n });\r\n /*\r\n it('Delete a bundle', function() {\r\n assert.doesNotThrow(function() {\r\n bundle.delete();\r\n });\r\n \r\n });*/\r\n });\r\n\r\n /* describe('Check Deployment Element:', function() {\r\n\r\n it('Check constructor Deployment Element', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().addDeploymentElement();\r\n }, \"Parameters name, version must be defined\");\r\n });\r\n\r\n it('Deploy element', function() {\r\n assert.doesNotThrow(function() {\r\n ogapi.bundlesBuilder().withName('bundle_testing').withVersion('V1').addDeploymentElement();\r\n });\r\n });\r\n describe('Check Deployment Element basic elements:', function() {\r\n var deploymentElement;\r\n before(function() {\r\n deploymentElement = ogapi.bundlesBuilder().withName('bundle_testing').withVersion('V1').addDeploymentElement();\r\n });\r\n\r\n it('Check parameter name', function() {\r\n assert.throws(function() {\r\n deploymentElement.withName(111);\r\n }, \"Parameter name must be a string and has a maximum length of 50\");\r\n });\r\n it('Check parameter version', function() {\r\n assert.throws(function() {\r\n deploymentElement.withVersion(111);\r\n }, \"Parameter version must be a string and has a maximum length of 50\");\r\n });\r\n it('Check parameter Type', function() {\r\n assert.throws(function() {\r\n deploymentElement.withType(111);\r\n }, \"Parameter type must be typeof string\");\r\n });\r\n it('Check parameter Type', function() {\r\n assert.throws(function() {\r\n deploymentElement.withType(\"Type\");\r\n }, 'Parameter type is not allowed. Parameter value <\\'\"Type\"\\'>, type allowed <\\'[\"SOFTWARE\",\"FIRMWARE\",\"CONFIGURATION\",\"PARAMETERS\"]\\'>');\r\n });\r\n it('Check parameter Path', function() {\r\n assert.throws(function() {\r\n deploymentElement.withPath(111);\r\n }, \"Parameter path must be a string\");\r\n });\r\n it('Check parameter Order', function() {\r\n assert.doesNotThrow(function() {\r\n deploymentElement.withOrder(111);\r\n });\r\n });\r\n it('Check parameter Operation', function() {\r\n assert.throws(function() {\r\n deploymentElement.withOperation(111);\r\n }, \"Parameter operation must be typeof string\");\r\n });\r\n it('Check parameter Operation', function() {\r\n assert.throws(function() {\r\n deploymentElement.withOperation(\"OPERATION\");\r\n }, 'Parameter operation is not allowed. Parameter value <\\'\"OPERATION\"\\'>, operation allowed <\\'[\"INSTALL\",\"UNINSTALL\",\"UPGRADE\"]\\'>');\r\n });\r\n it('Check parameter Option', function() {\r\n assert.throws(function() {\r\n deploymentElement.withOption(111);\r\n }, \"Parameter option must be typeof string\");\r\n });\r\n it('Check parameter Option', function() {\r\n assert.throws(function() {\r\n deploymentElement.withOption(\"option\");\r\n }, 'Parameter option is not allowed. Parameter value <\\'\"option\"\\'>, option allowed <\\'[\"MANDATORY\",\"OPTIONAL\"]\\'>');\r\n });\r\n it('Check parameter Validator is an Array', function() {\r\n assert.throws(function() {\r\n deploymentElement.withValidators(\"\");\r\n }, 'Parameter validators must be typeof Array');\r\n });\r\n it('Check parameter Validator have at least one element', function() {\r\n assert.doesNotThrow(function() {\r\n deploymentElement.withValidators([]);\r\n });\r\n });\r\n\r\n it('Check parameter type in validator is a string', function() {\r\n var validators = [{\r\n type: 1,\r\n value: \"\",\r\n mode: \"\"\r\n }];\r\n\r\n assert.throws(function() {\r\n deploymentElement.withValidators(validators);\r\n }, 'Parameter type must be typeof string');\r\n });\r\n it('Check parameter type in validator have a correct value', function() {\r\n\r\n var validators = [{\r\n type: \"SHA-1\"\r\n }];\r\n\r\n assert.doesNotThrow(function() {\r\n deploymentElement.withValidators(validators);\r\n });\r\n });\r\n it('Check parameter type in validator is typeof string', function() {\r\n\r\n var validators = [{\r\n type: \"SHA-1\",\r\n value: 1\r\n }];\r\n\r\n assert.throws(function() {\r\n deploymentElement.withValidators(validators);\r\n }, 'Parameter value must be a string');\r\n });\r\n it('Check parameter mode in validator is typeof string', function() {\r\n\r\n var validators = [{\r\n type: \"SHA-1\",\r\n value: \"\",\r\n mode: 1\r\n }];\r\n\r\n assert.throws(function() {\r\n deploymentElement.withValidators(validators);\r\n }, 'Parameter mode must be a string');\r\n });\r\n\r\n it('Check parameter mode in validator is typeof string', function() {\r\n\r\n var validators = [{\r\n type: \"SHA-1\",\r\n value: \"\",\r\n mode: \"\"\r\n }, {\r\n type: \"MD5\",\r\n value: \"\",\r\n mode: 1\r\n }];\r\n\r\n assert.throws(function() {\r\n deploymentElement.withValidators(validators);\r\n }, 'Parameter mode must be a string');\r\n });\r\n\r\n it('Check parameter DownloadUrl', function() {\r\n assert.throws(function() {\r\n deploymentElement.withDownloadUrl(111);\r\n }, \"Parameter downloadUrl must be a string\");\r\n });\r\n it('Check parameter FileName', function() {\r\n assert.throws(function() {\r\n deploymentElement.withFileName(111);\r\n }, \"Parameter fileName must be a string\");\r\n });\r\n });\r\n describe('Check DeploymentElement basic elements:', function() {\r\n var deploymentElement;\r\n before(function() {\r\n bundle = ogapi.bundlesBuilder();\r\n bundle.withName('bundle_testing_2').withVersion('V1').withWorkgroup('baseWorkGroup').withHardware(\"OWA21\");\r\n try {\r\n bundle.delete();\r\n } catch (error) {\r\n\r\n };\r\n bundle.create();\r\n deploymentElement = bundle.addDeploymentElement();\r\n });\r\n\r\n it('Define a deployment element', function() {\r\n assert.throws(function() {\r\n deploymentElement.withName(1);\r\n }, \"Parameter name must be a string\");\r\n });\r\n it('Create a deployment element', function() {\r\n assert.throws(function() {\r\n deploymentElement.withVersion(\"bundles-file-example\").create();\r\n }, \"Method not allowed - You must define the basic element [name, version, type, path, order and operation]\");\r\n });\r\n it('Check urls:', function() {\r\n assert.strictEqual(deploymentElement._url, 'provision/bundles/bundle_testing_2/versions/V1/deploymentElements');\r\n });\r\n\r\n it('Create a deployment element', function() {\r\n var file = new Blob([\"bundle ejemplo\"], {\r\n type: 'text/plain'\r\n });\r\n assert.doesNotThrow(function() {\r\n deploymentElement.withName(\"file_1\").withVersion(\"1\").withType(\"SOFTWARE\")\r\n .withPath(\"/\").withOrder(\"1\").withOperation(\"INSTALL\").withDownloadUrl(\"/\")\r\n .withValidators([{ \"type\": \"SHA-1\", \"value\": \"123\" }]).withOption(\"OPTIONAL\").create(file);\r\n });\r\n bundle.activate();\r\n\r\n });\r\n });\r\n\r\n });\r\n\r\n\r\n });*/\r\n});",
@@ -78779,7 +78835,7 @@
78779
78835
  "lineNumber": 1
78780
78836
  },
78781
78837
  {
78782
- "__docId__": 2994,
78838
+ "__docId__": 2996,
78783
78839
  "kind": "testDescribe",
78784
78840
  "name": "describe11",
78785
78841
  "testId": 11,
@@ -78801,7 +78857,7 @@
78801
78857
  ]
78802
78858
  },
78803
78859
  {
78804
- "__docId__": 2995,
78860
+ "__docId__": 2997,
78805
78861
  "kind": "testFile",
78806
78862
  "name": "client/collection/iot.spec.js",
78807
78863
  "content": "define(function() {\r\n mocha.setup('bdd');\r\n /** @test {InternalOpenGateAPI#bundlesBuilder()} */\r\n describe('Check funcionality bundles module:', function() {\r\n var bundle;\r\n before(function() {\r\n bundle = ogapi.bundlesBuilder();\r\n });\r\n /** @test {InternalOpenGateAPI#bundlesBuilder} */\r\n describe('Check basic parameters:', function() {\r\n\r\n it('Name is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withName(11);\r\n }, \"Parameter name must be a string and has a maximum length of 255\");\r\n\r\n });\r\n\r\n \r\n });\r\n \r\n\r\n\r\n });\r\n});\r\n",
@@ -78812,7 +78868,7 @@
78812
78868
  "lineNumber": 1
78813
78869
  },
78814
78870
  {
78815
- "__docId__": 2996,
78871
+ "__docId__": 2998,
78816
78872
  "kind": "testDescribe",
78817
78873
  "name": "describe12",
78818
78874
  "testId": 12,
@@ -78834,7 +78890,7 @@
78834
78890
  ]
78835
78891
  },
78836
78892
  {
78837
- "__docId__": 2997,
78893
+ "__docId__": 2999,
78838
78894
  "kind": "testDescribe",
78839
78895
  "name": "describe13",
78840
78896
  "testId": 13,
@@ -78856,7 +78912,7 @@
78856
78912
  ]
78857
78913
  },
78858
78914
  {
78859
- "__docId__": 2998,
78915
+ "__docId__": 3000,
78860
78916
  "kind": "testIt",
78861
78917
  "name": "it14",
78862
78918
  "testId": 14,
@@ -78869,7 +78925,7 @@
78869
78925
  "lineNumber": 12
78870
78926
  },
78871
78927
  {
78872
- "__docId__": 2999,
78928
+ "__docId__": 3001,
78873
78929
  "kind": "testFile",
78874
78930
  "name": "client/device/device.spec.js",
78875
78931
  "content": "define(function() {\r\n mocha.setup('bdd');\r\n /** @test {InternalOpenGateAPI#bundlesBuilder()} */\r\n describe('Check funcionality bundles module:', function() {\r\n var bundle;\r\n before(function() {\r\n bundle = ogapi.bundlesBuilder();\r\n });\r\n /** @test {InternalOpenGateAPI#bundlesBuilder} */\r\n describe('Check basic parameters:', function() {\r\n\r\n it('Name is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withName(11);\r\n }, \"Parameter name must be a string and has a maximum length of 255\");\r\n\r\n });\r\n\r\n it('version is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withVersion(1);\r\n }, \"Parameter version must be a string and has a maximum length of 50\");\r\n\r\n });\r\n\r\n it('Hardware is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withHardware(1);\r\n }, \"Parameter hardware must be a string\");\r\n\r\n });\r\n\r\n it('workgroup is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withWorkgroup(1);\r\n }, \"Parameter workgroup must be a string\");\r\n\r\n });\r\n\r\n it('description is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withDescription(1);\r\n }, \"Parameter description must be a string and has a maximum length of 250\");\r\n\r\n });\r\n\r\n it('UserNotes is not a String', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withUserNotes(1);\r\n }, \"Parameter notes must be a string and has a maximum length of 250\");\r\n\r\n });\r\n\r\n it('POSTACTION is not an Array', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withPreaction(\"\");\r\n }, \"Parameter preaction must be typeof Array\");\r\n\r\n });\r\n\r\n it('POSTACTION does not have at least one element', function() {\r\n assert.doesNotThrow(function() {\r\n ogapi.bundlesBuilder().withPreaction([]);\r\n });\r\n\r\n });\r\n\r\n it('POSTACTION does not have correct Elements', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withPreaction([\"dd\"]);\r\n }, 'Any action into parameter preaction is not allowed. Parameter value <\\'[\"dd\"]\\'>, preaction allowed <\\'[\"HARDWARE_RESET\",\"SOFTWARE_RESET\",\"COMMS_DOWN\",\"COMMS_UP\",\"COMMS_RESET\"]\\'>');\r\n\r\n });\r\n\r\n it('POSTACTION have correct Elements', function() {\r\n assert.doesNotThrow(function() {\r\n ogapi.bundlesBuilder().withPreaction([\"HARDWARE_RESET\", \"SOFTWARE_RESET\", \"COMMS_DOWN\", \"COMMS_UP\", \"COMMS_RESET\"]);\r\n });\r\n });\r\n\r\n\r\n it('Required parameters', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().create();\r\n }, \"Parameters name, version, hardware, workgroup must be defined\");\r\n });\r\n\r\n it('Check parameters type', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().withName(222);\r\n }, \"Parameter name must be a string\");\r\n });\r\n });\r\n describe('Create a Bundle:', function() {\r\n\r\n before(function() {\r\n bundle.withName('bundle_testing').withVersion('V1').withWorkgroup('baseWorkGroup');\r\n });\r\n\r\n it('Check basic parameters', function() {\r\n assert.throws(function() {\r\n bundle.create();\r\n }, \"Parameters name, version, hardware, workgroup must be defined\");\r\n });\r\n\r\n it('Create a bundle without Hardware', function() {\r\n assert.throws(function() {\r\n bundle.create();\r\n }, \"Parameters name, version, hardware, workgroup must be defined\");\r\n });\r\n\r\n it('Create a bundle', function() {\r\n assert.doesNotThrow(function() {\r\n bundle.withHardware(\"OWA21\").create();\r\n });\r\n });\r\n it('Activate a bundle', function() {\r\n assert.doesNotThrow(function() {\r\n bundle.activate();\r\n });\r\n });\r\n /*\r\n it('Delete a bundle', function() {\r\n assert.doesNotThrow(function() {\r\n bundle.delete();\r\n });\r\n \r\n });*/\r\n });\r\n\r\n describe('Check Deployment Element:', function() {\r\n\r\n it('Check constructor Deployment Element', function() {\r\n assert.throws(function() {\r\n ogapi.bundlesBuilder().addDeploymentElement();\r\n }, \"Parameters name, version must be defined\");\r\n });\r\n\r\n it('Deploy element', function() {\r\n assert.doesNotThrow(function() {\r\n ogapi.bundlesBuilder().withName('bundle_testing').withVersion('V1').addDeploymentElement();\r\n });\r\n });\r\n describe('Check Deployment Element basic elements:', function() {\r\n var deploymentElement;\r\n before(function() {\r\n deploymentElement = ogapi.bundlesBuilder().withName('bundle_testing').withVersion('V1').addDeploymentElement();\r\n });\r\n\r\n it('Check parameter name', function() {\r\n assert.throws(function() {\r\n deploymentElement.withName(111);\r\n }, \"Parameter name must be a string and has a maximum length of 50\");\r\n });\r\n it('Check parameter version', function() {\r\n assert.throws(function() {\r\n deploymentElement.withVersion(111);\r\n }, \"Parameter version must be a string and has a maximum length of 50\");\r\n });\r\n it('Check parameter Type', function() {\r\n assert.throws(function() {\r\n deploymentElement.withType(111);\r\n }, \"Parameter type must be typeof string\");\r\n });\r\n it('Check parameter Type', function() {\r\n assert.throws(function() {\r\n deploymentElement.withType(\"Type\");\r\n }, 'Parameter type is not allowed. Parameter value <\\'\"Type\"\\'>, type allowed <\\'[\"SOFTWARE\",\"FIRMWARE\",\"CONFIGURATION\",\"PARAMETERS\"]\\'>');\r\n });\r\n it('Check parameter Path', function() {\r\n assert.throws(function() {\r\n deploymentElement.withPath(111);\r\n }, \"Parameter path must be a string\");\r\n });\r\n it('Check parameter Order', function() {\r\n assert.doesNotThrow(function() {\r\n deploymentElement.withOrder(111);\r\n });\r\n });\r\n it('Check parameter Operation', function() {\r\n assert.throws(function() {\r\n deploymentElement.withOperation(111);\r\n }, \"Parameter operation must be typeof string\");\r\n });\r\n it('Check parameter Operation', function() {\r\n assert.throws(function() {\r\n deploymentElement.withOperation(\"OPERATION\");\r\n }, 'Parameter operation is not allowed. Parameter value <\\'\"OPERATION\"\\'>, operation allowed <\\'[\"INSTALL\",\"UNINSTALL\",\"UPGRADE\"]\\'>');\r\n });\r\n it('Check parameter Option', function() {\r\n assert.throws(function() {\r\n deploymentElement.withOption(111);\r\n }, \"Parameter option must be typeof string\");\r\n });\r\n it('Check parameter Option', function() {\r\n assert.throws(function() {\r\n deploymentElement.withOption(\"option\");\r\n }, 'Parameter option is not allowed. Parameter value <\\'\"option\"\\'>, option allowed <\\'[\"MANDATORY\",\"OPTIONAL\"]\\'>');\r\n });\r\n it('Check parameter Validator is an Array', function() {\r\n assert.throws(function() {\r\n deploymentElement.withValidators(\"\");\r\n }, 'Parameter validators must be typeof Array');\r\n });\r\n it('Check parameter Validator have at least one element', function() {\r\n assert.doesNotThrow(function() {\r\n deploymentElement.withValidators([]);\r\n });\r\n });\r\n\r\n it('Check parameter type in validator is a string', function() {\r\n var validators = [{\r\n type: 1,\r\n value: \"\",\r\n mode: \"\"\r\n }];\r\n\r\n assert.throws(function() {\r\n deploymentElement.withValidators(validators);\r\n }, 'Parameter type must be typeof string');\r\n });\r\n it('Check parameter type in validator have a correct value', function() {\r\n\r\n var validators = [{\r\n type: \"SHA-1\"\r\n }];\r\n\r\n assert.doesNotThrow(function() {\r\n deploymentElement.withValidators(validators);\r\n });\r\n });\r\n it('Check parameter type in validator is typeof string', function() {\r\n\r\n var validators = [{\r\n type: \"SHA-1\",\r\n value: 1\r\n }];\r\n\r\n assert.throws(function() {\r\n deploymentElement.withValidators(validators);\r\n }, 'Parameter value must be a string');\r\n });\r\n it('Check parameter mode in validator is typeof string', function() {\r\n\r\n var validators = [{\r\n type: \"SHA-1\",\r\n value: \"\",\r\n mode: 1\r\n }];\r\n\r\n assert.throws(function() {\r\n deploymentElement.withValidators(validators);\r\n }, 'Parameter mode must be a string');\r\n });\r\n\r\n it('Check parameter mode in validator is typeof string', function() {\r\n\r\n var validators = [{\r\n type: \"SHA-1\",\r\n value: \"\",\r\n mode: \"\"\r\n }, {\r\n type: \"MD5\",\r\n value: \"\",\r\n mode: 1\r\n }];\r\n\r\n assert.throws(function() {\r\n deploymentElement.withValidators(validators);\r\n }, 'Parameter mode must be a string');\r\n });\r\n\r\n it('Check parameter DownloadUrl', function() {\r\n assert.throws(function() {\r\n deploymentElement.withDownloadUrl(111);\r\n }, \"Parameter downloadUrl must be a string\");\r\n });\r\n it('Check parameter FileName', function() {\r\n assert.throws(function() {\r\n deploymentElement.withFileName(111);\r\n }, \"Parameter fileName must be a string\");\r\n });\r\n });\r\n describe('Check DeploymentElement basic elements:', function() {\r\n var deploymentElement;\r\n before(function() {\r\n bundle = ogapi.bundlesBuilder();\r\n bundle.withName('bundle_testing_2').withVersion('V1').withWorkgroup('baseWorkGroup').withHardware(\"OWA21\");\r\n try {\r\n bundle.delete();\r\n } catch (error) {\r\n\r\n }\r\n bundle.create();\r\n deploymentElement = bundle.addDeploymentElement();\r\n });\r\n\r\n it('Define a deployment element', function() {\r\n assert.throws(function() {\r\n deploymentElement.withName(1);\r\n }, \"Parameter name must be a string\");\r\n });\r\n it('Create a deployment element', function() {\r\n assert.throws(function() {\r\n deploymentElement.withVersion(\"bundles-file-example\").create();\r\n }, \"Method not allowed - You must define the basic element [name, version, type, path, order and operation]\");\r\n });\r\n it('Check urls:', function() {\r\n assert.strictEqual(deploymentElement._url, 'provision/bundles/bundle_testing_2/versions/V1/deploymentElements');\r\n });\r\n\r\n it('Create a deployment element', function() {\r\n var file = new Blob([\"bundle ejemplo\"], {\r\n type: 'text/plain'\r\n });\r\n assert.doesNotThrow(function() {\r\n deploymentElement.withName(\"file_1\").withVersion(\"1\").withType(\"SOFTWARE\")\r\n .withPath(\"/\").withOrder(\"1\").withOperation(\"INSTALL\").withDownloadUrl(\"/\")\r\n .withValidators([{ \"type\": \"SHA-1\", \"value\": \"123\" }]).withOption(\"OPTIONAL\").create(file);\r\n });\r\n bundle.activate();\r\n\r\n });\r\n });\r\n\r\n });\r\n\r\n\r\n });\r\n});\r\n",
@@ -78880,7 +78936,7 @@
78880
78936
  "lineNumber": 1
78881
78937
  },
78882
78938
  {
78883
- "__docId__": 3000,
78939
+ "__docId__": 3002,
78884
78940
  "kind": "testDescribe",
78885
78941
  "name": "describe15",
78886
78942
  "testId": 15,
@@ -78902,7 +78958,7 @@
78902
78958
  ]
78903
78959
  },
78904
78960
  {
78905
- "__docId__": 3001,
78961
+ "__docId__": 3003,
78906
78962
  "kind": "testDescribe",
78907
78963
  "name": "describe16",
78908
78964
  "testId": 16,
@@ -78924,7 +78980,7 @@
78924
78980
  ]
78925
78981
  },
78926
78982
  {
78927
- "__docId__": 3002,
78983
+ "__docId__": 3004,
78928
78984
  "kind": "testIt",
78929
78985
  "name": "it17",
78930
78986
  "testId": 17,
@@ -78937,7 +78993,7 @@
78937
78993
  "lineNumber": 12
78938
78994
  },
78939
78995
  {
78940
- "__docId__": 3003,
78996
+ "__docId__": 3005,
78941
78997
  "kind": "testIt",
78942
78998
  "name": "it18",
78943
78999
  "testId": 18,
@@ -78950,7 +79006,7 @@
78950
79006
  "lineNumber": 19
78951
79007
  },
78952
79008
  {
78953
- "__docId__": 3004,
79009
+ "__docId__": 3006,
78954
79010
  "kind": "testIt",
78955
79011
  "name": "it19",
78956
79012
  "testId": 19,
@@ -78963,7 +79019,7 @@
78963
79019
  "lineNumber": 26
78964
79020
  },
78965
79021
  {
78966
- "__docId__": 3005,
79022
+ "__docId__": 3007,
78967
79023
  "kind": "testIt",
78968
79024
  "name": "it20",
78969
79025
  "testId": 20,
@@ -78976,7 +79032,7 @@
78976
79032
  "lineNumber": 33
78977
79033
  },
78978
79034
  {
78979
- "__docId__": 3006,
79035
+ "__docId__": 3008,
78980
79036
  "kind": "testIt",
78981
79037
  "name": "it21",
78982
79038
  "testId": 21,
@@ -78989,7 +79045,7 @@
78989
79045
  "lineNumber": 40
78990
79046
  },
78991
79047
  {
78992
- "__docId__": 3007,
79048
+ "__docId__": 3009,
78993
79049
  "kind": "testIt",
78994
79050
  "name": "it22",
78995
79051
  "testId": 22,
@@ -79002,7 +79058,7 @@
79002
79058
  "lineNumber": 47
79003
79059
  },
79004
79060
  {
79005
- "__docId__": 3008,
79061
+ "__docId__": 3010,
79006
79062
  "kind": "testIt",
79007
79063
  "name": "it23",
79008
79064
  "testId": 23,
@@ -79015,7 +79071,7 @@
79015
79071
  "lineNumber": 54
79016
79072
  },
79017
79073
  {
79018
- "__docId__": 3009,
79074
+ "__docId__": 3011,
79019
79075
  "kind": "testIt",
79020
79076
  "name": "it24",
79021
79077
  "testId": 24,
@@ -79028,7 +79084,7 @@
79028
79084
  "lineNumber": 61
79029
79085
  },
79030
79086
  {
79031
- "__docId__": 3010,
79087
+ "__docId__": 3012,
79032
79088
  "kind": "testIt",
79033
79089
  "name": "it25",
79034
79090
  "testId": 25,
@@ -79041,7 +79097,7 @@
79041
79097
  "lineNumber": 68
79042
79098
  },
79043
79099
  {
79044
- "__docId__": 3011,
79100
+ "__docId__": 3013,
79045
79101
  "kind": "testIt",
79046
79102
  "name": "it26",
79047
79103
  "testId": 26,
@@ -79054,7 +79110,7 @@
79054
79110
  "lineNumber": 75
79055
79111
  },
79056
79112
  {
79057
- "__docId__": 3012,
79113
+ "__docId__": 3014,
79058
79114
  "kind": "testIt",
79059
79115
  "name": "it27",
79060
79116
  "testId": 27,
@@ -79067,7 +79123,7 @@
79067
79123
  "lineNumber": 82
79068
79124
  },
79069
79125
  {
79070
- "__docId__": 3013,
79126
+ "__docId__": 3015,
79071
79127
  "kind": "testIt",
79072
79128
  "name": "it28",
79073
79129
  "testId": 28,
@@ -79080,7 +79136,7 @@
79080
79136
  "lineNumber": 88
79081
79137
  },
79082
79138
  {
79083
- "__docId__": 3014,
79139
+ "__docId__": 3016,
79084
79140
  "kind": "testDescribe",
79085
79141
  "name": "describe29",
79086
79142
  "testId": 29,
@@ -79093,7 +79149,7 @@
79093
79149
  "lineNumber": 94
79094
79150
  },
79095
79151
  {
79096
- "__docId__": 3015,
79152
+ "__docId__": 3017,
79097
79153
  "kind": "testIt",
79098
79154
  "name": "it30",
79099
79155
  "testId": 30,
@@ -79106,7 +79162,7 @@
79106
79162
  "lineNumber": 100
79107
79163
  },
79108
79164
  {
79109
- "__docId__": 3016,
79165
+ "__docId__": 3018,
79110
79166
  "kind": "testIt",
79111
79167
  "name": "it31",
79112
79168
  "testId": 31,
@@ -79119,7 +79175,7 @@
79119
79175
  "lineNumber": 106
79120
79176
  },
79121
79177
  {
79122
- "__docId__": 3017,
79178
+ "__docId__": 3019,
79123
79179
  "kind": "testIt",
79124
79180
  "name": "it32",
79125
79181
  "testId": 32,
@@ -79132,7 +79188,7 @@
79132
79188
  "lineNumber": 112
79133
79189
  },
79134
79190
  {
79135
- "__docId__": 3018,
79191
+ "__docId__": 3020,
79136
79192
  "kind": "testIt",
79137
79193
  "name": "it33",
79138
79194
  "testId": 33,
@@ -79145,7 +79201,7 @@
79145
79201
  "lineNumber": 117
79146
79202
  },
79147
79203
  {
79148
- "__docId__": 3019,
79204
+ "__docId__": 3021,
79149
79205
  "kind": "testDescribe",
79150
79206
  "name": "describe34",
79151
79207
  "testId": 34,
@@ -79158,7 +79214,7 @@
79158
79214
  "lineNumber": 131
79159
79215
  },
79160
79216
  {
79161
- "__docId__": 3020,
79217
+ "__docId__": 3022,
79162
79218
  "kind": "testIt",
79163
79219
  "name": "it35",
79164
79220
  "testId": 35,
@@ -79171,7 +79227,7 @@
79171
79227
  "lineNumber": 133
79172
79228
  },
79173
79229
  {
79174
- "__docId__": 3021,
79230
+ "__docId__": 3023,
79175
79231
  "kind": "testIt",
79176
79232
  "name": "it36",
79177
79233
  "testId": 36,
@@ -79184,7 +79240,7 @@
79184
79240
  "lineNumber": 139
79185
79241
  },
79186
79242
  {
79187
- "__docId__": 3022,
79243
+ "__docId__": 3024,
79188
79244
  "kind": "testDescribe",
79189
79245
  "name": "describe37",
79190
79246
  "testId": 37,
@@ -79197,7 +79253,7 @@
79197
79253
  "lineNumber": 144
79198
79254
  },
79199
79255
  {
79200
- "__docId__": 3023,
79256
+ "__docId__": 3025,
79201
79257
  "kind": "testIt",
79202
79258
  "name": "it38",
79203
79259
  "testId": 38,
@@ -79210,7 +79266,7 @@
79210
79266
  "lineNumber": 150
79211
79267
  },
79212
79268
  {
79213
- "__docId__": 3024,
79269
+ "__docId__": 3026,
79214
79270
  "kind": "testIt",
79215
79271
  "name": "it39",
79216
79272
  "testId": 39,
@@ -79223,7 +79279,7 @@
79223
79279
  "lineNumber": 155
79224
79280
  },
79225
79281
  {
79226
- "__docId__": 3025,
79282
+ "__docId__": 3027,
79227
79283
  "kind": "testIt",
79228
79284
  "name": "it40",
79229
79285
  "testId": 40,
@@ -79236,7 +79292,7 @@
79236
79292
  "lineNumber": 160
79237
79293
  },
79238
79294
  {
79239
- "__docId__": 3026,
79295
+ "__docId__": 3028,
79240
79296
  "kind": "testIt",
79241
79297
  "name": "it41",
79242
79298
  "testId": 41,
@@ -79249,7 +79305,7 @@
79249
79305
  "lineNumber": 165
79250
79306
  },
79251
79307
  {
79252
- "__docId__": 3027,
79308
+ "__docId__": 3029,
79253
79309
  "kind": "testIt",
79254
79310
  "name": "it42",
79255
79311
  "testId": 42,
@@ -79262,7 +79318,7 @@
79262
79318
  "lineNumber": 170
79263
79319
  },
79264
79320
  {
79265
- "__docId__": 3028,
79321
+ "__docId__": 3030,
79266
79322
  "kind": "testIt",
79267
79323
  "name": "it43",
79268
79324
  "testId": 43,
@@ -79275,7 +79331,7 @@
79275
79331
  "lineNumber": 175
79276
79332
  },
79277
79333
  {
79278
- "__docId__": 3029,
79334
+ "__docId__": 3031,
79279
79335
  "kind": "testIt",
79280
79336
  "name": "it44",
79281
79337
  "testId": 44,
@@ -79288,7 +79344,7 @@
79288
79344
  "lineNumber": 180
79289
79345
  },
79290
79346
  {
79291
- "__docId__": 3030,
79347
+ "__docId__": 3032,
79292
79348
  "kind": "testIt",
79293
79349
  "name": "it45",
79294
79350
  "testId": 45,
@@ -79301,7 +79357,7 @@
79301
79357
  "lineNumber": 185
79302
79358
  },
79303
79359
  {
79304
- "__docId__": 3031,
79360
+ "__docId__": 3033,
79305
79361
  "kind": "testIt",
79306
79362
  "name": "it46",
79307
79363
  "testId": 46,
@@ -79314,7 +79370,7 @@
79314
79370
  "lineNumber": 190
79315
79371
  },
79316
79372
  {
79317
- "__docId__": 3032,
79373
+ "__docId__": 3034,
79318
79374
  "kind": "testIt",
79319
79375
  "name": "it47",
79320
79376
  "testId": 47,
@@ -79327,7 +79383,7 @@
79327
79383
  "lineNumber": 195
79328
79384
  },
79329
79385
  {
79330
- "__docId__": 3033,
79386
+ "__docId__": 3035,
79331
79387
  "kind": "testIt",
79332
79388
  "name": "it48",
79333
79389
  "testId": 48,
@@ -79340,7 +79396,7 @@
79340
79396
  "lineNumber": 200
79341
79397
  },
79342
79398
  {
79343
- "__docId__": 3034,
79399
+ "__docId__": 3036,
79344
79400
  "kind": "testIt",
79345
79401
  "name": "it49",
79346
79402
  "testId": 49,
@@ -79353,7 +79409,7 @@
79353
79409
  "lineNumber": 205
79354
79410
  },
79355
79411
  {
79356
- "__docId__": 3035,
79412
+ "__docId__": 3037,
79357
79413
  "kind": "testIt",
79358
79414
  "name": "it50",
79359
79415
  "testId": 50,
@@ -79366,7 +79422,7 @@
79366
79422
  "lineNumber": 211
79367
79423
  },
79368
79424
  {
79369
- "__docId__": 3036,
79425
+ "__docId__": 3038,
79370
79426
  "kind": "testIt",
79371
79427
  "name": "it51",
79372
79428
  "testId": 51,
@@ -79379,7 +79435,7 @@
79379
79435
  "lineNumber": 222
79380
79436
  },
79381
79437
  {
79382
- "__docId__": 3037,
79438
+ "__docId__": 3039,
79383
79439
  "kind": "testIt",
79384
79440
  "name": "it52",
79385
79441
  "testId": 52,
@@ -79392,7 +79448,7 @@
79392
79448
  "lineNumber": 232
79393
79449
  },
79394
79450
  {
79395
- "__docId__": 3038,
79451
+ "__docId__": 3040,
79396
79452
  "kind": "testIt",
79397
79453
  "name": "it53",
79398
79454
  "testId": 53,
@@ -79405,7 +79461,7 @@
79405
79461
  "lineNumber": 243
79406
79462
  },
79407
79463
  {
79408
- "__docId__": 3039,
79464
+ "__docId__": 3041,
79409
79465
  "kind": "testIt",
79410
79466
  "name": "it54",
79411
79467
  "testId": 54,
@@ -79418,7 +79474,7 @@
79418
79474
  "lineNumber": 256
79419
79475
  },
79420
79476
  {
79421
- "__docId__": 3040,
79477
+ "__docId__": 3042,
79422
79478
  "kind": "testIt",
79423
79479
  "name": "it55",
79424
79480
  "testId": 55,
@@ -79431,7 +79487,7 @@
79431
79487
  "lineNumber": 273
79432
79488
  },
79433
79489
  {
79434
- "__docId__": 3041,
79490
+ "__docId__": 3043,
79435
79491
  "kind": "testIt",
79436
79492
  "name": "it56",
79437
79493
  "testId": 56,
@@ -79444,7 +79500,7 @@
79444
79500
  "lineNumber": 278
79445
79501
  },
79446
79502
  {
79447
- "__docId__": 3042,
79503
+ "__docId__": 3044,
79448
79504
  "kind": "testDescribe",
79449
79505
  "name": "describe57",
79450
79506
  "testId": 57,
@@ -79457,7 +79513,7 @@
79457
79513
  "lineNumber": 284
79458
79514
  },
79459
79515
  {
79460
- "__docId__": 3043,
79516
+ "__docId__": 3045,
79461
79517
  "kind": "testIt",
79462
79518
  "name": "it58",
79463
79519
  "testId": 58,
@@ -79470,7 +79526,7 @@
79470
79526
  "lineNumber": 298
79471
79527
  },
79472
79528
  {
79473
- "__docId__": 3044,
79529
+ "__docId__": 3046,
79474
79530
  "kind": "testIt",
79475
79531
  "name": "it59",
79476
79532
  "testId": 59,
@@ -79483,7 +79539,7 @@
79483
79539
  "lineNumber": 303
79484
79540
  },
79485
79541
  {
79486
- "__docId__": 3045,
79542
+ "__docId__": 3047,
79487
79543
  "kind": "testIt",
79488
79544
  "name": "it60",
79489
79545
  "testId": 60,
@@ -79496,7 +79552,7 @@
79496
79552
  "lineNumber": 308
79497
79553
  },
79498
79554
  {
79499
- "__docId__": 3046,
79555
+ "__docId__": 3048,
79500
79556
  "kind": "testIt",
79501
79557
  "name": "it61",
79502
79558
  "testId": 61,
@@ -79509,7 +79565,7 @@
79509
79565
  "lineNumber": 312
79510
79566
  },
79511
79567
  {
79512
- "__docId__": 3047,
79568
+ "__docId__": 3049,
79513
79569
  "kind": "testFile",
79514
79570
  "name": "client/provision/devices.provision.spec.js",
79515
79571
  "content": "define(function() {\r\n mocha.setup('bdd');\r\n /** @test {InternalOpenGateAPI#datapointsSearchBuilder} */\r\n describe('Check funcionality devicesBuilder module:', function() {\r\n it('Create new devicesBuilder object', function() {\r\n var entity = null;\r\n ogapi.entityBuilder.devicesBuilder(\"base_organization\")\r\n .then(function(res) {\r\n console.log(res);\r\n entity = res;\r\n entity.with(\"provision.administration.channel\", \"default_channel\");\r\n entity.with(\"provision.administration.organization\", \"base_organization\");\r\n entity.with(\"provision.administration.serviceGroup\", \"emptyServiceGroup\");\r\n entity.with(\"provision.device.identifier\", \"device_oux\");\r\n })\r\n .catch(function(err) {\r\n console.log(err);\r\n });\r\n\r\n //assert.isDefined(ogapi.entityBuilder.devicesBuilder(\"organization_Dani\"));\r\n\r\n });\r\n });\r\n\r\n /**\r\n * \r\n * var user = ogapi.usersBuilder();\r\nuser.withEmail(\"katherin.moscoso@amplia.es\").withPassword(\"amplia\")\r\n.updatePassword(\"amplia123\")\r\n.then(function(res){console.log(res)})\r\n.catch(function(err){console.log(err)})\r\n */\r\n /*\r\n\r\n \r\n describe('Check funcionality devicesBuilder module:', function() {\r\n it('Create new subscribersBuilder object', function() {\r\n var entity = null;\r\n ogapi.entityBuilder.subscribersBuilder(\"organization_UX\")\r\n .then(function(res) {\r\n console.log(res);\r\n entity = res;\r\n entity.with(\"provision.administration.channel\", \"channel_1\");\r\n entity.with(\"provision.administration.organization\", \"organization_UX\");\r\n entity.with(\"provision.administration.serviceGroup\", \"emptyServiceGroup\");\r\n entity.with(\"provision.device.communicationModules[].subscriber.identifier\", \"s_1\");\r\n })\r\n .catch(function(err) {\r\n console.log(err);\r\n });\r\n\r\n //device.with(\"\", \"\");\r\n assert.isDefined(ogapi.entityBuilder.devicesBuilder(\"organization_Dani\"));\r\n\r\n });\r\n });\r\n\r\n\r\n describe('Check funcionality devicesBuilder module:', function() {\r\n it('Create new subscribersBuilder object', function() {\r\n var entity = null;\r\n ogapi.entityBuilder.subscriptionsBuilder(\"organization_Dani\")\r\n .then(function(res) {\r\n console.log(res);\r\n entity = res;\r\n entity.with(\"provision.administration.channel\", \"channel_1\");\r\n entity.with(\"provision.administration.organization\", \"organization_UX\");\r\n entity.with(\"provision.administration.serviceGroup\", \"emptyServiceGroup\");\r\n entity.with(\"provision.device.communicationModules[].subscriber.identifier\", \"s_1\");\r\n })\r\n .catch(function(err) {\r\n console.log(err);\r\n });\r\n\r\n //device.with(\"\", \"\");\r\n assert.isDefined(ogapi.entityBuilder.devicesBuilder(\"organization_Dani\"));\r\n\r\n });\r\n });\r\n\r\n */\r\n\r\n /* describe('Check funcionality devicesBuilder module:', function() {\r\n it('Create new datamodel object', function() {\r\n var datamodel = ogapi.datamodelsBuilder(\"organization_UX\");\r\n datamodel.withName(\"name1\").withIdentifier(\"id_2\").withVersion(\"1.0.0\")\r\n\r\n\r\n });\r\n });*/\r\n});",
@@ -79520,7 +79576,7 @@
79520
79576
  "lineNumber": 1
79521
79577
  },
79522
79578
  {
79523
- "__docId__": 3048,
79579
+ "__docId__": 3050,
79524
79580
  "kind": "testDescribe",
79525
79581
  "name": "describe62",
79526
79582
  "testId": 62,
@@ -79542,7 +79598,7 @@
79542
79598
  ]
79543
79599
  },
79544
79600
  {
79545
- "__docId__": 3049,
79601
+ "__docId__": 3051,
79546
79602
  "kind": "testIt",
79547
79603
  "name": "it63",
79548
79604
  "testId": 63,
@@ -79555,7 +79611,7 @@
79555
79611
  "lineNumber": 5
79556
79612
  },
79557
79613
  {
79558
- "__docId__": 3050,
79614
+ "__docId__": 3052,
79559
79615
  "kind": "testFile",
79560
79616
  "name": "client/searching/FilterBuilder.spec.js",
79561
79617
  "content": "\r\ndefine(function () {\r\n\tmocha.setup('bdd'); \r\n\t/** @test {InternalOpenGateAPI#newFilterBuilder} */\r\n\tdescribe('Check funcionality FilterBuilder module:', function(){\t\t\t\t\t\t\r\n\t\tit('Create new FilterBuilder object', function(){\t\t\t\r\n\t\t\tassert.isDefined(ogapi.newFilterBuilder);\r\n\t\t});\r\n\t\t/** @test {FilterBuilder#or} */\r\n\t\tit('Creating a logical operator \\\"or\\\"', function(){\t\t\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.newFilterBuilder().or()._filterTemplate), \"{\\\"filter\\\":{\\\"or\\\":[]}}\")\r\n\t\t});\r\n\t\t/** @test {FilterBuilder#and} */\r\n\t\tit('Creating a logical operator \\\"and\\\"', function(){\t\t\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.newFilterBuilder().and()._filterTemplate), \"{\\\"filter\\\":{\\\"and\\\":[]}}\")\r\n\t\t});\r\n\t\t/** @test {FilterBuilder#and} */\r\n\t\tit('Creating like inside the and', function(){\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.newFilterBuilder().and(ogapi.EX.like(\"hello\", \"world\"))._filterTemplate), \"{\\\"filter\\\":{\\\"and\\\":[{\\\"like\\\":{\\\"hello\\\":\\\"world\\\"}}]}}\")\r\n\t\t});\r\n\t\t/** @test {FilterBuilder#and} */\r\n\t\tit('Creating two operators inside the and', function(){\r\n\t\t\tvar resul = \"{\\\"filter\\\":{\\\"and\\\":[{\\\"like\\\":{\\\"hello\\\":\\\"world\\\"}},{\\\"neq\\\":{\\\"hello\\\":\\\"world\\\"}}]}}\"\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.newFilterBuilder().and(ogapi.EX.like(\"hello\", \"world\"), ogapi.EX.neq(\"hello\", \"world\"))._filterTemplate), resul)\r\n\t\t});\r\n\t});\r\n});",
@@ -79566,7 +79622,7 @@
79566
79622
  "lineNumber": 1
79567
79623
  },
79568
79624
  {
79569
- "__docId__": 3051,
79625
+ "__docId__": 3053,
79570
79626
  "kind": "testDescribe",
79571
79627
  "name": "describe64",
79572
79628
  "testId": 64,
@@ -79588,7 +79644,7 @@
79588
79644
  ]
79589
79645
  },
79590
79646
  {
79591
- "__docId__": 3052,
79647
+ "__docId__": 3054,
79592
79648
  "kind": "testIt",
79593
79649
  "name": "it65",
79594
79650
  "testId": 65,
@@ -79601,7 +79657,7 @@
79601
79657
  "lineNumber": 6
79602
79658
  },
79603
79659
  {
79604
- "__docId__": 3053,
79660
+ "__docId__": 3055,
79605
79661
  "kind": "testIt",
79606
79662
  "name": "it66",
79607
79663
  "testId": 66,
@@ -79623,7 +79679,7 @@
79623
79679
  ]
79624
79680
  },
79625
79681
  {
79626
- "__docId__": 3054,
79682
+ "__docId__": 3056,
79627
79683
  "kind": "testIt",
79628
79684
  "name": "it67",
79629
79685
  "testId": 67,
@@ -79645,7 +79701,7 @@
79645
79701
  ]
79646
79702
  },
79647
79703
  {
79648
- "__docId__": 3055,
79704
+ "__docId__": 3057,
79649
79705
  "kind": "testIt",
79650
79706
  "name": "it68",
79651
79707
  "testId": 68,
@@ -79667,7 +79723,7 @@
79667
79723
  ]
79668
79724
  },
79669
79725
  {
79670
- "__docId__": 3056,
79726
+ "__docId__": 3058,
79671
79727
  "kind": "testIt",
79672
79728
  "name": "it69",
79673
79729
  "testId": 69,
@@ -79689,7 +79745,7 @@
79689
79745
  ]
79690
79746
  },
79691
79747
  {
79692
- "__docId__": 3057,
79748
+ "__docId__": 3059,
79693
79749
  "kind": "testFile",
79694
79750
  "name": "client/searching/datapoints.search.spec.js",
79695
79751
  "content": "define(function () {\r\n\tmocha.setup('bdd');\r\n\t/** @test {InternalOpenGateAPI#datapointsSearchBuilder} */\r\n\tdescribe('Check funcionality datapointsSearchBuilder module:', function () {\r\n\t\tit('Create new datapointsSearchBuilder object', function () {\r\n\t\t\tassert.isDefined(ogapi.datapointsSearchBuilder());\r\n\t\t});\r\n\t});\r\n\r\n\tdescribe('Setting a filter:', function () {\r\n\t\tit('withDeviceId', function () {\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.datapointsSearchBuilder()\r\n\t\t\t\t.withDeviceId('myDevice')\r\n\t\t\t\t.build()._postObj.filter), '{\"and\":[{\"eq\":{\"datapoint.device\":\"myDevice\"}}]}');\r\n\t\t});\r\n\t\tit('withDatastream', function () {\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.datapointsSearchBuilder()\r\n\t\t\t\t.withDatastream('myDatastream')\r\n\t\t\t\t.build()._postObj.filter), '{\"and\":[{\"eq\":{\"datapoint.datastream\":\"myDatastream\"}}]}');\r\n\t\t});\r\n\t\tit('withFeed', function () {\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.datapointsSearchBuilder()\r\n\t\t\t\t.withFeed('myDatastream')\r\n\t\t\t\t.build()._postObj.filter), '{\"and\":[{\"eq\":{\"datapoint.feed\":\"myDatastream\"}}]}');\r\n\t\t});\r\n\t\tit('CustomFilter', function () {\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.datapointsSearchBuilder()\r\n\t\t\t\t.filter({ filter: { and: [] } })\r\n\t\t\t\t.build()._postObj.filter), '{\"filter\":{\"and\":[]}}');\r\n\t\t});\r\n\t\tit('time window', function () {\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.datapointsSearchBuilder()\r\n\t\t\t\t.betweenDates(new Date('2015-10-16T10:39:05Z'), new Date('2015-10-16T10:39:06Z'))\r\n\t\t\t\t.build()._postObj.filter), '{\"and\":[{\"gt\":{\"datapoint.at\":\"2015-10-16T10:39:05.000Z\"}},{\"lt\":{\"datapoint.at\":\"2015-10-16T10:39:06.000Z\"}}]}');\r\n\t\t});\r\n\t\tit('withDatastream and withDeviceId', function () {\r\n\t\t\tassert.strictEqual(JSON.stringify(ogapi.datapointsSearchBuilder()\r\n\t\t\t\t.withDeviceId('myDevice')\r\n\t\t\t\t.withDatastream('myDatastream')\r\n\t\t\t\t.build()._postObj.filter), '{\"and\":[{\"eq\":{\"datapoint.device\":\"myDevice\"}},{\"eq\":{\"datapoint.datastream\":\"myDatastream\"}}]}');\r\n\t\t});\r\n\t\tit('Throw error if set a custom filter and create fluent filter', function () {\r\n\t\t\tassert.throws(function () {\r\n\t\t\t\togapi.datapointsSearchBuilder()\r\n\t\t\t\t\t.withDeviceId('myDevice')\r\n\t\t\t\t\t.filter({ and: [] })\r\n\t\t\t\t\t.build();\r\n\t\t\t}, 'Incompatible filters. You only can create a filter using fluent mode [betweenDates, addTag, withDatastreamId, withDeviceId] methods or custom filter [filter] method');\r\n\t\t});\r\n\t});\r\n\r\n\tdescribe('Setting bad parameters creating fluent filter', function () {\r\n\t\tit('not deviceId string parameter', function () {\r\n\t\t\tassert.throws(function () {\r\n\t\t\t\togapi.datapointsSearchBuilder()\r\n\t\t\t\t\t.withDeviceId(123)\r\n\t\t\t\t\t.build();\r\n\t\t\t}, 'Parameter deviceId must be a string');\r\n\t\t});\r\n\t\tit('not datastreamId string parameter', function () {\r\n\t\t\tassert.throws(function () {\r\n\t\t\t\togapi.datapointsSearchBuilder()\r\n\t\t\t\t\t.withDatastream(123)\r\n\t\t\t\t\t.build();\r\n\t\t\t}, 'Parameter datastreamId must be a string');\r\n\r\n\t\t});\r\n\t\tit('not feedId string parameter', function () {\r\n\t\t\tassert.throws(function () {\r\n\t\t\t\togapi.datapointsSearchBuilder()\r\n\t\t\t\t\t.withFeed(123)\r\n\t\t\t\t\t.build();\r\n\t\t\t}, 'Parameter feedId must be a string');\r\n\t\t});\r\n\t\tit('not fromDate date parameter', function () {\r\n\t\t\tassert.throws(function () {\r\n\t\t\t\togapi.datapointsSearchBuilder()\r\n\t\t\t\t\t.betweenDates(123)\r\n\t\t\t\t\t.build();\r\n\t\t\t}, 'Parameter fromDate must be a Date');\r\n\t\t});\r\n\t\tit('not toDate date parameter', function () {\r\n\t\t\tassert.throws(function () {\r\n\t\t\t\togapi.datapointsSearchBuilder()\r\n\t\t\t\t\t.betweenDates(new Date(), 123)\r\n\t\t\t\t\t.build();\r\n\t\t\t}, 'Parameter toDate must be a Date');\r\n\t\t});\r\n\t});\r\n\r\n\tit('Check urls:', function () {\r\n\t\tassert.strictEqual(ogapi.datapointsSearchBuilder()\r\n\t\t\t.withDeviceId('myDevice')\r\n\t\t\t.build()._resource, 'search/iot/datapoints');\r\n\t});\r\n});",
@@ -79700,7 +79756,7 @@
79700
79756
  "lineNumber": 1
79701
79757
  },
79702
79758
  {
79703
- "__docId__": 3058,
79759
+ "__docId__": 3060,
79704
79760
  "kind": "testDescribe",
79705
79761
  "name": "describe70",
79706
79762
  "testId": 70,
@@ -79722,7 +79778,7 @@
79722
79778
  ]
79723
79779
  },
79724
79780
  {
79725
- "__docId__": 3059,
79781
+ "__docId__": 3061,
79726
79782
  "kind": "testIt",
79727
79783
  "name": "it71",
79728
79784
  "testId": 71,
@@ -79735,7 +79791,7 @@
79735
79791
  "lineNumber": 5
79736
79792
  },
79737
79793
  {
79738
- "__docId__": 3060,
79794
+ "__docId__": 3062,
79739
79795
  "kind": "testDescribe",
79740
79796
  "name": "describe72",
79741
79797
  "testId": 72,
@@ -79748,7 +79804,7 @@
79748
79804
  "lineNumber": 10
79749
79805
  },
79750
79806
  {
79751
- "__docId__": 3061,
79807
+ "__docId__": 3063,
79752
79808
  "kind": "testIt",
79753
79809
  "name": "it73",
79754
79810
  "testId": 73,
@@ -79761,7 +79817,7 @@
79761
79817
  "lineNumber": 11
79762
79818
  },
79763
79819
  {
79764
- "__docId__": 3062,
79820
+ "__docId__": 3064,
79765
79821
  "kind": "testIt",
79766
79822
  "name": "it74",
79767
79823
  "testId": 74,
@@ -79774,7 +79830,7 @@
79774
79830
  "lineNumber": 16
79775
79831
  },
79776
79832
  {
79777
- "__docId__": 3063,
79833
+ "__docId__": 3065,
79778
79834
  "kind": "testIt",
79779
79835
  "name": "it75",
79780
79836
  "testId": 75,
@@ -79787,7 +79843,7 @@
79787
79843
  "lineNumber": 21
79788
79844
  },
79789
79845
  {
79790
- "__docId__": 3064,
79846
+ "__docId__": 3066,
79791
79847
  "kind": "testIt",
79792
79848
  "name": "it76",
79793
79849
  "testId": 76,
@@ -79800,7 +79856,7 @@
79800
79856
  "lineNumber": 26
79801
79857
  },
79802
79858
  {
79803
- "__docId__": 3065,
79859
+ "__docId__": 3067,
79804
79860
  "kind": "testIt",
79805
79861
  "name": "it77",
79806
79862
  "testId": 77,
@@ -79813,7 +79869,7 @@
79813
79869
  "lineNumber": 31
79814
79870
  },
79815
79871
  {
79816
- "__docId__": 3066,
79872
+ "__docId__": 3068,
79817
79873
  "kind": "testIt",
79818
79874
  "name": "it78",
79819
79875
  "testId": 78,
@@ -79826,7 +79882,7 @@
79826
79882
  "lineNumber": 36
79827
79883
  },
79828
79884
  {
79829
- "__docId__": 3067,
79885
+ "__docId__": 3069,
79830
79886
  "kind": "testIt",
79831
79887
  "name": "it79",
79832
79888
  "testId": 79,
@@ -79839,7 +79895,7 @@
79839
79895
  "lineNumber": 42
79840
79896
  },
79841
79897
  {
79842
- "__docId__": 3068,
79898
+ "__docId__": 3070,
79843
79899
  "kind": "testDescribe",
79844
79900
  "name": "describe80",
79845
79901
  "testId": 80,
@@ -79852,7 +79908,7 @@
79852
79908
  "lineNumber": 52
79853
79909
  },
79854
79910
  {
79855
- "__docId__": 3069,
79911
+ "__docId__": 3071,
79856
79912
  "kind": "testIt",
79857
79913
  "name": "it81",
79858
79914
  "testId": 81,
@@ -79865,7 +79921,7 @@
79865
79921
  "lineNumber": 53
79866
79922
  },
79867
79923
  {
79868
- "__docId__": 3070,
79924
+ "__docId__": 3072,
79869
79925
  "kind": "testIt",
79870
79926
  "name": "it82",
79871
79927
  "testId": 82,
@@ -79878,7 +79934,7 @@
79878
79934
  "lineNumber": 60
79879
79935
  },
79880
79936
  {
79881
- "__docId__": 3071,
79937
+ "__docId__": 3073,
79882
79938
  "kind": "testIt",
79883
79939
  "name": "it83",
79884
79940
  "testId": 83,
@@ -79891,7 +79947,7 @@
79891
79947
  "lineNumber": 68
79892
79948
  },
79893
79949
  {
79894
- "__docId__": 3072,
79950
+ "__docId__": 3074,
79895
79951
  "kind": "testIt",
79896
79952
  "name": "it84",
79897
79953
  "testId": 84,
@@ -79904,7 +79960,7 @@
79904
79960
  "lineNumber": 75
79905
79961
  },
79906
79962
  {
79907
- "__docId__": 3073,
79963
+ "__docId__": 3075,
79908
79964
  "kind": "testIt",
79909
79965
  "name": "it85",
79910
79966
  "testId": 85,
@@ -79917,7 +79973,7 @@
79917
79973
  "lineNumber": 82
79918
79974
  },
79919
79975
  {
79920
- "__docId__": 3074,
79976
+ "__docId__": 3076,
79921
79977
  "kind": "testIt",
79922
79978
  "name": "it86",
79923
79979
  "testId": 86,
@@ -79930,7 +79986,7 @@
79930
79986
  "lineNumber": 91
79931
79987
  },
79932
79988
  {
79933
- "__docId__": 3075,
79989
+ "__docId__": 3077,
79934
79990
  "kind": "testFile",
79935
79991
  "name": "client/searching/module.searching.spec.js",
79936
79992
  "content": "define(function () {\r\n\tmocha.setup('bdd');\r\n\t/** @test {InternalOpenGateAPI} */\r\n\tdescribe('Check if all searching modules exists:', function () {\r\n\t\t/** @test {InternalOpenGateAPI#rawSearchBuilder} */\r\n\t\tit('Exist rawSearchBuilder function', function () {\r\n\t\t\tassert.isFunction(ogapi.rawSearchBuilder, 'Module rawSearchBuilder is not loaded');\r\n\t\t});\r\n\t\t/** @test {InternalOpenGateAPI#devicesSearchBuilder} */\r\n\t\tit('Exist Builder devicesSearchBuilder function', function () {\r\n\t\t\tassert.isFunction(ogapi.devicesSearchBuilder, 'Builder devicesSearchBuilder is not loaded');\r\n\t\t});\r\n\t\t/** @test {InternalOpenGateAPI#subscriptionsSearchBuilder} */\r\n\t\tit('Exist Builder subscriptionsSearchBuilder function', function () {\r\n\t\t\tassert.isFunction(ogapi.subscriptionsSearchBuilder, 'Builder subscriptionsSearchBuilder is not loaded');\r\n\t\t});\r\n\t\t/** @test {InternalOpenGateAPI#subscribersSearchBuilder} */\r\n\t\tit('Exist Builder subscribersSearchBuilder function', function () {\r\n\t\t\tassert.isFunction(ogapi.subscribersSearchBuilder, 'Builder subscribersSearchBuilder is not loaded');\r\n\t\t});\r\n\t\t/** @test {InternalOpenGateAPI#operationsSearchBuilder} */\r\n\t\tit('Exist Builder operationsSearchBuilder function', function () {\r\n\t\t\tassert.isFunction(ogapi.operationsSearchBuilder, 'Builder operationsSearchBuilder is not loaded');\r\n\t\t});\r\n\t\t/** @test {InternalOpenGateAPI#executionsSearchBuilder} */\r\n\t\tit('Exist Builder executionsSearchBuilder function', function () {\r\n\t\t\tassert.isFunction(ogapi.executionsSearchBuilder, 'Builder executionsSearchBuilder is not loaded');\r\n\t\t});\r\n\t\t/** @test {InternalOpenGateAPI#alarmsSearchBuilder} */\r\n\t\tit('Exist Builder alarmsSearchBuilder function', function () {\r\n\t\t\tassert.isFunction(ogapi.alarmsSearchBuilder, 'Builder alarmsSearchBuilder is not loaded');\r\n\t\t});\r\n\t\t/** @test {InternalOpenGateAPI#bundlesSearchBuilder} */\r\n\t\tit('Exist Builder bundlesSearchBuilder function', function () {\r\n\t\t\tassert.isFunction(ogapi.bundlesSearchBuilder, 'Builder bundlesSearchBuilder is not loaded');\r\n\t\t});\r\n\t});\r\n});\r\n\r\n\r\n",
@@ -79941,7 +79997,7 @@
79941
79997
  "lineNumber": 1
79942
79998
  },
79943
79999
  {
79944
- "__docId__": 3076,
80000
+ "__docId__": 3078,
79945
80001
  "kind": "testDescribe",
79946
80002
  "name": "describe87",
79947
80003
  "testId": 87,
@@ -79963,7 +80019,7 @@
79963
80019
  ]
79964
80020
  },
79965
80021
  {
79966
- "__docId__": 3077,
80022
+ "__docId__": 3079,
79967
80023
  "kind": "testIt",
79968
80024
  "name": "it88",
79969
80025
  "testId": 88,
@@ -79985,7 +80041,7 @@
79985
80041
  ]
79986
80042
  },
79987
80043
  {
79988
- "__docId__": 3078,
80044
+ "__docId__": 3080,
79989
80045
  "kind": "testIt",
79990
80046
  "name": "it89",
79991
80047
  "testId": 89,
@@ -80007,7 +80063,7 @@
80007
80063
  ]
80008
80064
  },
80009
80065
  {
80010
- "__docId__": 3079,
80066
+ "__docId__": 3081,
80011
80067
  "kind": "testIt",
80012
80068
  "name": "it90",
80013
80069
  "testId": 90,
@@ -80029,7 +80085,7 @@
80029
80085
  ]
80030
80086
  },
80031
80087
  {
80032
- "__docId__": 3080,
80088
+ "__docId__": 3082,
80033
80089
  "kind": "testIt",
80034
80090
  "name": "it91",
80035
80091
  "testId": 91,
@@ -80051,7 +80107,7 @@
80051
80107
  ]
80052
80108
  },
80053
80109
  {
80054
- "__docId__": 3081,
80110
+ "__docId__": 3083,
80055
80111
  "kind": "testIt",
80056
80112
  "name": "it92",
80057
80113
  "testId": 92,
@@ -80073,7 +80129,7 @@
80073
80129
  ]
80074
80130
  },
80075
80131
  {
80076
- "__docId__": 3082,
80132
+ "__docId__": 3084,
80077
80133
  "kind": "testIt",
80078
80134
  "name": "it93",
80079
80135
  "testId": 93,
@@ -80095,7 +80151,7 @@
80095
80151
  ]
80096
80152
  },
80097
80153
  {
80098
- "__docId__": 3083,
80154
+ "__docId__": 3085,
80099
80155
  "kind": "testIt",
80100
80156
  "name": "it94",
80101
80157
  "testId": 94,
@@ -80117,7 +80173,7 @@
80117
80173
  ]
80118
80174
  },
80119
80175
  {
80120
- "__docId__": 3084,
80176
+ "__docId__": 3086,
80121
80177
  "kind": "testIt",
80122
80178
  "name": "it95",
80123
80179
  "testId": 95,
@@ -80139,7 +80195,7 @@
80139
80195
  ]
80140
80196
  },
80141
80197
  {
80142
- "__docId__": 3085,
80198
+ "__docId__": 3087,
80143
80199
  "kind": "testFile",
80144
80200
  "name": "client/searching/rawsearch.spec.js",
80145
80201
  "content": "define(function () {\r\n\tmocha.setup('bdd'); \r\n\t/** @test {InternalOpenGateAPI#rawSearchBuilder} */\r\n\tdescribe('Check funcionality newRawSearch module:', function(){\r\n\t\tit('Create new RawSearch object', function(){\r\n\t\t\tassert.isDefined(ogapi.rawSearchBuilder());\r\n\t\t});\r\n\t\t\r\n\t\t/** @test {InternalOpenGateAPI#rawSearchBuilder} */\r\n\t\tit('Set string parameter and get filter', function(){\r\n\t\t\tvar filter = { \"filter\": { \"and\": [{ \"like\": { \"entityId\": \"0000000000000001\" } }] } };\r\n\t\t\tassert.isDefined(ogapi.rawSearchBuilder().filter(filter).from(\"\").build()._filter());\r\n\t\t});\r\n\r\n\t\t/** @test {InternalOpenGateAPI#rawSearchBuilder} */\r\n\t\tit('Set string parameter and check filter', function(){\r\n\t\t\tvar filter = {\"filter\":{\"and\": [{\"like\": {\"entityId\": \"0000000000000001\"}}]}};\r\n\t\t\tvar rawSearch = ogapi.rawSearchBuilder().from(\"\").filter(filter).build();\r\n\t\t\tvar filterContainer = rawSearch._filter();\r\n\t\t\tassert.strictEqual(filterContainer.filter, filter);\r\n\t\t});\r\n\r\n\t\t/** @test {InternalOpenGateAPI#rawSearchBuilder} */\r\n\t\tit('Set custom url and check', function(){\r\n\t\t\tvar rawSearch = ogapi.rawSearchBuilder().from(\"/test/resource\").build();\r\n\t\t\tvar resource = rawSearch._resource;\r\n\t\t\tassert.strictEqual(resource, \"search/test/resource\");\r\n\t\t});\r\n\r\n\t\t/** @test {InternalOpenGateAPI#rawSearchBuilder} */\r\n\t\tit('Url is mandatory field', function(){\r\n\t\t\tassert.throws(function(){ogapi.rawSearchBuilder().from();},\"Url parameter is mandatory and must be a string\");\r\n\t\t\t\r\n\t\t});\r\n\r\n\t\t/** @test {InternalOpenGateAPI#rawSearchBuilder} */\r\n\t\tit('Url is mandatory field on build', function(){\r\n\t\t\tassert.throws(function(){ogapi.rawSearchBuilder().build();},\"Url parameter is mandatory and must be a string\");\r\n\t\t\t\r\n\t\t});\r\n /** @test {InternalOpenGateAPI#rawSearchBuilder} */\r\n it('Set string parameter, check filter and limit', function(){\r\n var filter = {};\r\n var limit = {\"start\":1, \"size\":1000};\r\n var rawSearch = ogapi.rawSearchBuilder().from(\"/catalog/hardwares\").filter(filter).limit(limit).build();\r\n var filterContainer = rawSearch._filter();\r\n\t\t\tassert.strictEqual(filterContainer.filter, filter);\r\n\t\t\tassert.strictEqual(filterContainer.limit, limit);\r\n });\r\n\r\n\t});\r\n});",
@@ -80150,7 +80206,7 @@
80150
80206
  "lineNumber": 1
80151
80207
  },
80152
80208
  {
80153
- "__docId__": 3086,
80209
+ "__docId__": 3088,
80154
80210
  "kind": "testDescribe",
80155
80211
  "name": "describe96",
80156
80212
  "testId": 96,
@@ -80172,7 +80228,7 @@
80172
80228
  ]
80173
80229
  },
80174
80230
  {
80175
- "__docId__": 3087,
80231
+ "__docId__": 3089,
80176
80232
  "kind": "testIt",
80177
80233
  "name": "it97",
80178
80234
  "testId": 97,
@@ -80185,7 +80241,7 @@
80185
80241
  "lineNumber": 5
80186
80242
  },
80187
80243
  {
80188
- "__docId__": 3088,
80244
+ "__docId__": 3090,
80189
80245
  "kind": "testIt",
80190
80246
  "name": "it98",
80191
80247
  "testId": 98,
@@ -80207,7 +80263,7 @@
80207
80263
  ]
80208
80264
  },
80209
80265
  {
80210
- "__docId__": 3089,
80266
+ "__docId__": 3091,
80211
80267
  "kind": "testIt",
80212
80268
  "name": "it99",
80213
80269
  "testId": 99,
@@ -80229,7 +80285,7 @@
80229
80285
  ]
80230
80286
  },
80231
80287
  {
80232
- "__docId__": 3090,
80288
+ "__docId__": 3092,
80233
80289
  "kind": "testIt",
80234
80290
  "name": "it100",
80235
80291
  "testId": 100,
@@ -80251,7 +80307,7 @@
80251
80307
  ]
80252
80308
  },
80253
80309
  {
80254
- "__docId__": 3091,
80310
+ "__docId__": 3093,
80255
80311
  "kind": "testIt",
80256
80312
  "name": "it101",
80257
80313
  "testId": 101,
@@ -80273,7 +80329,7 @@
80273
80329
  ]
80274
80330
  },
80275
80331
  {
80276
- "__docId__": 3092,
80332
+ "__docId__": 3094,
80277
80333
  "kind": "testIt",
80278
80334
  "name": "it102",
80279
80335
  "testId": 102,
@@ -80295,7 +80351,7 @@
80295
80351
  ]
80296
80352
  },
80297
80353
  {
80298
- "__docId__": 3093,
80354
+ "__docId__": 3095,
80299
80355
  "kind": "testIt",
80300
80356
  "name": "it103",
80301
80357
  "testId": 103,
@@ -80317,7 +80373,7 @@
80317
80373
  ]
80318
80374
  },
80319
80375
  {
80320
- "__docId__": 3094,
80376
+ "__docId__": 3096,
80321
80377
  "kind": "testFile",
80322
80378
  "name": "client/searching/search.spec.js",
80323
80379
  "content": "define(function () {\r\n\tmocha.setup('bdd');\r\n\t/** \r\n\t\t@test {InternalOpenGateAPI#devicesSearchBuilder} \r\n\t\t@test {InternalOpenGateAPI#subscribersSearchBuilder} \t\t\r\n\t\t@test {InternalOpenGateAPI#subscriptionsSearchBuilder} \r\n\t\t@test {InternalOpenGateAPI#executionsSearchBuilder} \r\n\t\t@test {InternalOpenGateAPI#operationsSearchBuilder} \r\n\t\t@test {InternalOpenGateAPI#alarmsSearchBuilder} \r\n\t\t@test {InternalOpenGateAPI#bundlesSearchBuilder} \r\n\t*/\r\n\tdescribe('Check funcionality newSearchBuilder module:', function () {\r\n\r\n\t\t/** @test {SearchBuilder} */\r\n\t\tdescribe('Check setting timeout', function (done) {\r\n\t\t\t/** @test {SearchBuilder#withTimeout} */\r\n\t\t\tit('Throw error on exceeded timeout', function () {\r\n\t\t\t\togapi.devicesSearchBuilder().onProvisioned().addSortBy('prov.customId', 'ASCENDING').summary().withTimeout(10).build().execute().catch(function (err) {\r\n\t\t\t\t\tassert.equal(err.message, \"Timeout exceeded\");\r\n\t\t\t\t\tdone();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t/** @test {SearchBuilder#withTimeout} */\r\n\t\t\tit('It is all ok when not exceeded timeout', function () {\r\n\t\t\t\togapi.devicesSearchBuilder().onProvisioned().addSortBy('prov.customId', 'ASCENDING').summary().withTimeout(10000).build().execute().then(function (response, statusCode) {\r\n\t\t\t\t\tassert.equal(statusCode, 200);\r\n\t\t\t\t\tdone();\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t/** @test {SearchBuilder#withTimeout} */\r\n\t\t\tit('Check default timeout value when it is no setted', function () {\r\n\t\t\t\tassert.strictEqual(ogapi.devicesSearchBuilder().onProvisioned().build()._timeout, 5000);\r\n\t\t\t});\r\n\t\t\t/** @test {SearchBuilder#withTimeout} */\r\n\t\t\tit('withTimeout parameter must be a number', function () {\r\n\t\t\t\tassert.throws(function () { ogapi.devicesSearchBuilder().withTimeout(\"a\"); }, \"Parameter ms must be a number\");\r\n\t\t\t});\r\n\t\t});\r\n\t\t/** @test {SearchBuilder}*/\r\n\t\tdescribe('Check on entity searching:', function () {\r\n\t\t\t/** @test {SearchBuilder#filter}*/\r\n\t\t\tdescribe('with empty filter:', function () {\r\n\r\n\t\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t\t@test {SearchBuilder#filter}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t\t@test {InternalOpenGateAPI#devicesSearchBuilder}\r\n\t\t\t\t*/\r\n\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\tassert.doesNotThrow(function () { ogapi.devicesSearchBuilder().filter().onProvisioned().build(); });\r\n\t\t\t\t});\r\n\r\n\t\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t\t@test {SearchBuilder#filter}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t\t@test {InternalOpenGateAPI#subscriptionsSearchBuilder}\r\n\t\t\t\t*/\r\n\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\tassert.doesNotThrow(function () { ogapi.subscriptionsSearchBuilder().filter().onProvisioned().build(); });\r\n\t\t\t\t});\r\n\r\n\t\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t\t@test {SearchBuilder#filter}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t\t@test {InternalOpenGateAPI#subscribersSearchBuilder}\r\n\t\t\t\t*/\r\n\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\tassert.doesNotThrow(function () { ogapi.subscribersSearchBuilder().filter().onProvisioned().build(); });\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\tdescribe('On sort:', function () {\r\n\t\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t\t@test {SearchBuilder#addSortAscendingBy}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t\t@test {InternalOpenGateAPI#devicesSearchBuilder}\r\n\t\t\t\t*/\r\n\t\t\t\tit('Ascending sort', function () {\r\n\t\t\t\t\tassert.deepEqual(ogapi.devicesSearchBuilder().onProvisioned().addSortAscendingBy('param').build()._postObj.sort, { parameters: [{ name: 'param', type: 'ASCENDING' }] });\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t\t@test {SearchBuilder#addSortDescendingBy}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t\t@test {InternalOpenGateAPI#devicesSearchBuilder}\r\n\t\t\t\t*/\r\n\t\t\t\tit('Ascending sort', function () {\r\n\t\t\t\t\tassert.deepEqual(ogapi.devicesSearchBuilder().onProvisioned().addSortDescendingBy('param').build()._postObj.sort, { parameters: [{ name: 'param', type: 'DESCENDING' }] });\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t\t@test {SearchBuilder#addSortBy}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t\t@test {InternalOpenGateAPI#devicesSearchBuilder}\r\n\t\t\t\t*/\r\n\t\t\t\tit('Generic sort', function () {\r\n\t\t\t\t\tassert.deepEqual(ogapi.devicesSearchBuilder().onProvisioned().addSortBy('param', 'sorting').build()._postObj.sort, { parameters: [{ name: 'param', type: 'sorting' }] });\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\tdescribe('with empty filter:', function () {\r\n\t\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t\t@test {SearchBuilder#filter}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t\t@test {InternalOpenGateAPI#devicesSearchBuilder}\r\n\t\t\t\t*/\r\n\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\tassert.doesNotThrow(function () { ogapi.devicesSearchBuilder().filter().onProvisioned().build(); });\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t\t@test {SearchBuilder#filter}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t\t@test {InternalOpenGateAPI#subscriptionsSearchBuilder}\r\n\t\t\t\t*/\r\n\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\tassert.doesNotThrow(function () { ogapi.subscriptionsSearchBuilder().filter().onProvisioned().build(); });\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t\t@test {SearchBuilder#filter}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t\t@test {InternalOpenGateAPI#subscribersSearchBuilder}\r\n\t\t\t\t*/\r\n\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\tassert.doesNotThrow(function () { ogapi.subscribersSearchBuilder().filter().onProvisioned().build(); });\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t/** @test {SearchBuilder#build} \r\n\t\t\t\t@test {SearchBuilder#filter}\r\n\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t@test {InternalOpenGateAPI#devicesSearchBuilder}\r\n\t\t\t*/\r\n\t\t\tdescribe('using filterBuilder:', function () {\r\n\t\t\t\tit('simple filter', function () {\r\n\t\t\t\t\tvar filterExpected = JSON.parse(\"{\\\"and\\\":[{\\\"like\\\":{\\\"hello\\\":\\\"world\\\"}}]}\");\r\n\t\t\t\t\tassert.deepEqual(ogapi.devicesSearchBuilder().\r\n\t\t\t\t\t\tonProvisioned().\r\n\t\t\t\t\t\tfilter(\r\n\t\t\t\t\t\t\togapi.newFilterBuilder().\r\n\t\t\t\t\t\t\t\tand(ogapi.EX.like(\"hello\", \"world\")))\r\n\t\t\t\t\t\t.build()._postObj.filter, filterExpected);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t/** @test {SearchBuilder#limit}*/\r\n\t\t\tdescribe('On limit:', function () {\r\n\t\t\t\tit('undefined size parameter', function () {\r\n\t\t\t\t\tassert.throws(function () { ogapi.devicesSearchBuilder().limit(); }, 'size parameter must be a number');\r\n\t\t\t\t});\r\n\t\t\t\tit('size parameter not a number', function () {\r\n\t\t\t\t\tassert.throws(function () { ogapi.devicesSearchBuilder().limit('5'); }, 'size parameter must be a number');\r\n\t\t\t\t});\r\n\t\t\t\tit('well build with only size', function () {\r\n\t\t\t\t\tassert.deepEqual(ogapi.devicesSearchBuilder().limit(5).onProvisioned().build()._postObj.limit, { size: 5, start: 1 });\r\n\t\t\t\t});\r\n\t\t\t\tit('well build with size and offset', function () {\r\n\t\t\t\t\tassert.deepEqual(ogapi.devicesSearchBuilder().limit(5, 15).onProvisioned().build()._postObj.limit, { size: 5, start: 15 });\r\n\t\t\t\t});\r\n\t\t\t});\r\n\r\n\t\t\t/** @test {EntitySearchBuilder#onProvisioned}*/\r\n\t\t\tdescribe('On provisioned data:', function () {\r\n\t\t\t\t/** @test {DevicesSearchBuilder#onProvisioned}*/\r\n\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.devicesSearchBuilder().onProvisioned().build()._resource, 'search/entities/devices/provision');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SubscriptionsSearchBuilder#onProvisioned}*/\r\n\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.subscriptionsSearchBuilder().onProvisioned().build()._resource, 'search/entities/subscriptions/provision');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SubscribersSearchBuilder#onProvisioned}*/\r\n\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.subscribersSearchBuilder().onProvisioned().build()._resource, 'search/entities/subscribers/provision');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t/** @test {EntitySearchBuilder#onCollected}*/\r\n\t\t\tdescribe('On collected data:', function () {\r\n\t\t\t\t/** @test {DevicesSearchBuilder#onCollected}*/\r\n\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.devicesSearchBuilder().onCollected().build()._resource, 'search/entities/devices/collection');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SubscriptionsSearchBuilder#onCollected}*/\r\n\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.subscriptionsSearchBuilder().onCollected().build()._resource, 'search/entities/subscriptions/collection');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SubscribersSearchBuilder#onCollected}*/\r\n\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.subscribersSearchBuilder().onCollected().build()._resource, 'search/entities/subscribers/collection');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t/** @test {SearchBuilder#build}*/\r\n\t\t\tdescribe('On collected and provisioned data:', function () {\r\n\t\t\t\t/** @test {DevicesSearchBuilder#build}*/\r\n\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.devicesSearchBuilder().onCollected().onProvisioned().build()._resource, 'search/entities/devices');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SubscriptionsSearchBuilder#build}*/\r\n\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.subscriptionsSearchBuilder().onCollected().onProvisioned().build()._resource, 'search/entities/subscriptions');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {SubscribersSearchBuilder#build}*/\r\n\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.subscribersSearchBuilder().onCollected().onProvisioned().build()._resource, 'search/entities/subscribers');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t\t/** @test {SearchBuilder#summary}*/\r\n\t\t\tdescribe('Summary data:', function () {\r\n\t\t\t\tdescribe('without source data:', function () {\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {DevicesSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {DevicesSearchBuilder#build}\t\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.throws(function () { ogapi.devicesSearchBuilder().summary().build(); }, 'Must select one at least: [\"onProvisioned\",\"onCollected\"]');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {SubscriptionsSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {SubscriptionsSearchBuilder#build}\t\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.throws(function () { ogapi.subscriptionsSearchBuilder().summary().build(); }, 'Must select one at least: [\"onProvisioned\",\"onCollected\"]');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {SubscribersSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {SubscribersSearchBuilder#build}\t\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.throws(function () { ogapi.subscribersSearchBuilder().summary().build(); }, 'Must select one at least: [\"onProvisioned\",\"onCollected\"]');\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\t/** \r\n\t\t\t\t\t@test {SearchBuilder#summary}\r\n\t\t\t\t\t@test {EntitySearchBuilder#onProvisioned}\r\n\t\t\t\t*/\r\n\t\t\t\tdescribe('On provisioned data:', function () {\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {DevicesSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {DevicesSearchBuilder#onProvisioned}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.devicesSearchBuilder().onProvisioned().summary().build()._resource, 'search/entities/devices/provision/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {SubscriptionsSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {SubscriptionsSearchBuilder#onProvisioned}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.subscriptionsSearchBuilder().onProvisioned().summary().build()._resource, 'search/entities/subscriptions/provision/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {SubscribersSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {SubscribersSearchBuilder#onProvisioned}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.subscribersSearchBuilder().onProvisioned().summary().build()._resource, 'search/entities/subscribers/provision/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\tdescribe('On collected data:', function () {\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {DevicesSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {DevicesSearchBuilder#onProvisioned}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.devicesSearchBuilder().onCollected().summary().build()._resource, 'search/entities/devices/collection/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {SubscriptionsSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {SubscriptionsSearchBuilder#onProvisioned}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.subscriptionsSearchBuilder().onCollected().summary().build()._resource, 'search/entities/subscriptions/collection/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {SubscribersSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {SubscribersSearchBuilder#onProvisioned}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.subscribersSearchBuilder().onCollected().summary().build()._resource, 'search/entities/subscribers/collection/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t\tdescribe('On collected and provisioned data', function () {\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {DevicesSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {DevicesSearchBuilder#build}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.devicesSearchBuilder().onCollected().onProvisioned().summary().build()._resource, 'search/entities/devices/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {SubscriptionsSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {SubscriptionsSearchBuilder#build}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.subscriptionsSearchBuilder().onCollected().onProvisioned().summary().build()._resource, 'search/entities/subscriptions/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** \r\n\t\t\t\t\t\t@test {SubscribersSearchBuilder#summary}\r\n\t\t\t\t\t\t@test {SubscribersSearchBuilder#build}\r\n\t\t\t\t\t*/\r\n\t\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.subscribersSearchBuilder().onCollected().onProvisioned().summary().build()._resource, 'search/entities/subscribers/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\r\n\t\t\t});\r\n\t\t\tdescribe('On without source data:', function () {\r\n\t\t\t\t/** \r\n\t\t\t\t\t@test {DevicesSearchBuilder#summary}\r\n\t\t\t\t\t@test {DevicesSearchBuilder#build}\r\n\t\t\t\t*/\r\n\t\t\t\tit('devicesSearchBuilder', function () {\r\n\t\t\t\t\tassert.throws(function () { ogapi.devicesSearchBuilder().build(); }, 'Must select one at least: [\"onProvisioned\",\"onCollected\"]');\r\n\t\t\t\t});\r\n\t\t\t\t/** \r\n\t\t\t\t\t@test {SubscriptionsSearchBuilder#summary}\r\n\t\t\t\t\t@test {SubscriptionsSearchBuilder#build}\r\n\t\t\t\t*/\r\n\t\t\t\tit('subscriptionsSearchBuilder', function () {\r\n\t\t\t\t\tassert.throws(function () { ogapi.subscriptionsSearchBuilder().build(); }, 'Must select one at least: [\"onProvisioned\",\"onCollected\"]');\r\n\t\t\t\t});\r\n\t\t\t\t/** \r\n\t\t\t\t\t@test {SubscribersSearchBuilder#summary}\r\n\t\t\t\t\t@test {SubscribersSearchBuilder#build}\r\n\t\t\t\t*/\r\n\t\t\t\tit('subscribersSearchBuilder', function () {\r\n\t\t\t\t\tassert.throws(function () { ogapi.subscribersSearchBuilder().build(); }, 'Must select one at least: [\"onProvisioned\",\"onCollected\"]');\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\r\n\t\tdescribe('Check on operation searching:', function () {\r\n\t\t\t/** \t\t\t\t\r\n\t\t\t\t@test {ExecutionsSearchBuilder#build}\r\n\t\t\t*/\r\n\t\t\tit('without source data', function () {\r\n\t\t\t\tassert.throws(function () { ogapi.executionsSearchBuilder().build(); }, 'Must select one at least: [\"onDevices\",\"onSubscribers\",\"onSubscriptions\",\"onCommunicationsModules\"]');\r\n\t\t\t});\r\n\t\t\t/** \t\t\t\t\r\n\t\t\t\t@test {ExecutionsSearchBuilder#build}\r\n\t\t\t*/\r\n\t\t\tit('single source data', function () {\r\n\t\t\t\tassert.doesNotThrow(function () { ogapi.executionsSearchBuilder().onDevices().build(); });\r\n\t\t\t});\r\n\t\t\t/** \t\t\t\t\r\n\t\t\t\t@test {ExecutionsSearchBuilder#build}\r\n\t\t\t*/\r\n\t\t\tit('multiple source data', function () {\r\n\t\t\t\tassert.throws(function () { ogapi.executionsSearchBuilder().onDevices().onSubscriptions().build(); }, 'Must select only one of this:[\"onDevices\",\"onSubscribers\",\"onSubscriptions\",\"onCommunicationsModules\"]');\r\n\t\t\t});\r\n\r\n\t\t\tdescribe('all kind source data:', function () {\r\n\t\t\t\t/** @test {ExecutionsSearchBuilder#onDevices}*/\r\n\t\t\t\tit('from devices', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.executionsSearchBuilder().onDevices().build()._resource, 'search/entities/devices/operations');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {ExecutionsSearchBuilder#onSubscriptions}*/\r\n\t\t\t\tit('from subscriptions', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.executionsSearchBuilder().onSubscriptions().build()._resource, 'search/entities/subscriptions/operations');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {ExecutionsSearchBuilder#onSubscribers}*/\r\n\t\t\t\tit('from subscribers', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.executionsSearchBuilder().onSubscribers().build()._resource, 'search/entities/subscribers/operations');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {ExecutionsSearchBuilder#onCommunicationsModules}*/\r\n\t\t\t\tit('from communicationsModules', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.executionsSearchBuilder().onCommunicationsModules().build()._resource, 'search/entities/communicationsModules/operations');\r\n\t\t\t\t});\r\n\t\t\t\tdescribe('summary:', function () {\r\n\t\t\t\t\t/** @test {ExecutionsSearchBuilder#summary}*/\r\n\t\t\t\t\tit('from devices', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.executionsSearchBuilder().onDevices().summary().build()._resource, 'search/entities/devices/operations/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** @test {ExecutionsSearchBuilder#summary}*/\r\n\t\t\t\t\tit('from subscriptions', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.executionsSearchBuilder().onSubscriptions().summary().build()._resource, 'search/entities/subscriptions/operations/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** @test {ExecutionsSearchBuilder#summary}*/\r\n\t\t\t\t\tit('from subscribers', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.executionsSearchBuilder().onSubscribers().summary().build()._resource, 'search/entities/subscribers/operations/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** @test {ExecutionsSearchBuilder#summary}*/\r\n\t\t\t\t\tit('from communicationsModules', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.executionsSearchBuilder().onCommunicationsModules().summary().build()._resource, 'search/entities/communicationsModules/operations/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t\tdescribe('Check on alarm searching:', function () {\r\n\t\t\t/** @test {AlarmsSearchBuilder#build}*/\r\n\t\t\tit('without source data', function () {\r\n\t\t\t\tassert.throws(function () { ogapi.alarmsSearchBuilder().build(); }, 'Must select one at least: [\"onDevices\",\"onSubscribers\",\"onSubscriptions\",\"onCommunicationsModules\"]');\r\n\t\t\t});\r\n\t\t\t/** @test {AlarmsSearchBuilder#build}*/\r\n\t\t\tit('single source data', function () {\r\n\t\t\t\tassert.doesNotThrow(function () { ogapi.alarmsSearchBuilder().onDevices().build(); });\r\n\t\t\t});\r\n\t\t\t/** @test {AlarmsSearchBuilder#build}*/\r\n\t\t\tit('multiple source data', function () {\r\n\t\t\t\tassert.throws(function () { ogapi.alarmsSearchBuilder().onDevices().onSubscriptions().build(); }, 'Must select only one of this:[\"onDevices\",\"onSubscribers\",\"onSubscriptions\",\"onCommunicationsModules\"]');\r\n\t\t\t});\r\n\r\n\t\t\tdescribe('all kind source data:', function () {\r\n\t\t\t\t/** @test {AlarmsSearchBuilder#onDevices}*/\r\n\t\t\t\tit('from devices', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.alarmsSearchBuilder().onDevices().build()._resource, 'search/entities/devices/alarms');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {AlarmsSearchBuilder#onSubscriptions}*/\r\n\t\t\t\tit('from subscriptions', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.alarmsSearchBuilder().onSubscriptions().build()._resource, 'search/entities/subscriptions/alarms');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {AlarmsSearchBuilder#onSubscribers}*/\r\n\t\t\t\tit('from subscribers', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.alarmsSearchBuilder().onSubscribers().build()._resource, 'search/entities/subscribers/alarms');\r\n\t\t\t\t});\r\n\t\t\t\t/** @test {AlarmsSearchBuilder#onCommunicationsModules}*/\r\n\t\t\t\tit('from communicationsModules', function () {\r\n\t\t\t\t\tassert.strictEqual(ogapi.alarmsSearchBuilder().onCommunicationsModules().build()._resource, 'search/entities/communicationsModules/alarms');\r\n\t\t\t\t});\r\n\t\t\t\tdescribe('summary:', function () {\r\n\t\t\t\t\t/** @test {AlarmsSearchBuilder#summary}*/\r\n\t\t\t\t\tit('from devices', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.alarmsSearchBuilder().onDevices().summary().build()._resource, 'search/entities/devices/alarms/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** @test {AlarmsSearchBuilder#summary}*/\r\n\t\t\t\t\tit('from subscriptions', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.alarmsSearchBuilder().onSubscriptions().summary().build()._resource, 'search/entities/subscriptions/alarms/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** @test {AlarmsSearchBuilder#summary}*/\r\n\t\t\t\t\tit('from subscribers', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.alarmsSearchBuilder().onSubscribers().summary().build()._resource, 'search/entities/subscribers/alarms/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t\t/** @test {AlarmsSearchBuilder#summary}*/\r\n\t\t\t\t\tit('from communicationsModules', function () {\r\n\t\t\t\t\t\tassert.strictEqual(ogapi.alarmsSearchBuilder().onCommunicationsModules().summary().build()._resource, 'search/entities/communicationsModules/alarms/summary');\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t\tdescribe('Check on bundles searching:', function () {\r\n\t\t\t/** @test {BundlesSearchBuilder#build}*/\r\n\t\t\tit('bundlesSearchBuilder', function () {\r\n\t\t\t\tassert.strictEqual(ogapi.bundlesSearchBuilder().build()._resource, 'search/bundles');\r\n\t\t\t});\r\n\t\t\tdescribe('On Limit:', function () {\r\n\t\t\t\t/** @test {bundlesSearchBuilder#build} \r\n\t\t\t\t*/\r\n\t\t\t\tit('limit', function () {\r\n\t\t\t\t\tassert.deepEqual(ogapi.bundlesSearchBuilder().limit(5, 1).build()._postObj.limit, { size: 5, start: 1 });\r\n\t\t\t\t});\r\n\t\t\t\tit('simple filter', function () {\r\n\t\t\t\t\tvar filterExpected = JSON.parse(\"{\\\"and\\\":[{\\\"like\\\":{\\\"bundle.Name\\\":\\\"bundle_carlos\\\"}}]}\");\r\n\t\t\t\t\tassert.deepEqual(ogapi.bundlesSearchBuilder().filter(ogapi.newFilterBuilder().\r\n\t\t\t\t\t\tand(ogapi.EX.like(\"bundle.Name\", \"bundle_carlos\")))\r\n\t\t\t\t\t\t.build()._postObj.filter, filterExpected);\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n\t});\r\n});",
@@ -80328,7 +80384,7 @@
80328
80384
  "lineNumber": 1
80329
80385
  },
80330
80386
  {
80331
- "__docId__": 3095,
80387
+ "__docId__": 3097,
80332
80388
  "kind": "testDescribe",
80333
80389
  "name": "describe104",
80334
80390
  "testId": 104,
@@ -80380,7 +80436,7 @@
80380
80436
  ]
80381
80437
  },
80382
80438
  {
80383
- "__docId__": 3096,
80439
+ "__docId__": 3098,
80384
80440
  "kind": "testDescribe",
80385
80441
  "name": "describe105",
80386
80442
  "testId": 105,
@@ -80402,7 +80458,7 @@
80402
80458
  ]
80403
80459
  },
80404
80460
  {
80405
- "__docId__": 3097,
80461
+ "__docId__": 3099,
80406
80462
  "kind": "testIt",
80407
80463
  "name": "it106",
80408
80464
  "testId": 106,
@@ -80424,7 +80480,7 @@
80424
80480
  ]
80425
80481
  },
80426
80482
  {
80427
- "__docId__": 3098,
80483
+ "__docId__": 3100,
80428
80484
  "kind": "testIt",
80429
80485
  "name": "it107",
80430
80486
  "testId": 107,
@@ -80446,7 +80502,7 @@
80446
80502
  ]
80447
80503
  },
80448
80504
  {
80449
- "__docId__": 3099,
80505
+ "__docId__": 3101,
80450
80506
  "kind": "testIt",
80451
80507
  "name": "it108",
80452
80508
  "testId": 108,
@@ -80468,7 +80524,7 @@
80468
80524
  ]
80469
80525
  },
80470
80526
  {
80471
- "__docId__": 3100,
80527
+ "__docId__": 3102,
80472
80528
  "kind": "testIt",
80473
80529
  "name": "it109",
80474
80530
  "testId": 109,
@@ -80490,7 +80546,7 @@
80490
80546
  ]
80491
80547
  },
80492
80548
  {
80493
- "__docId__": 3101,
80549
+ "__docId__": 3103,
80494
80550
  "kind": "testDescribe",
80495
80551
  "name": "describe110",
80496
80552
  "testId": 110,
@@ -80512,7 +80568,7 @@
80512
80568
  ]
80513
80569
  },
80514
80570
  {
80515
- "__docId__": 3102,
80571
+ "__docId__": 3104,
80516
80572
  "kind": "testDescribe",
80517
80573
  "name": "describe111",
80518
80574
  "testId": 111,
@@ -80534,7 +80590,7 @@
80534
80590
  ]
80535
80591
  },
80536
80592
  {
80537
- "__docId__": 3103,
80593
+ "__docId__": 3105,
80538
80594
  "kind": "testIt",
80539
80595
  "name": "it112",
80540
80596
  "testId": 112,
@@ -80571,7 +80627,7 @@
80571
80627
  ]
80572
80628
  },
80573
80629
  {
80574
- "__docId__": 3104,
80630
+ "__docId__": 3106,
80575
80631
  "kind": "testIt",
80576
80632
  "name": "it113",
80577
80633
  "testId": 113,
@@ -80608,7 +80664,7 @@
80608
80664
  ]
80609
80665
  },
80610
80666
  {
80611
- "__docId__": 3105,
80667
+ "__docId__": 3107,
80612
80668
  "kind": "testIt",
80613
80669
  "name": "it114",
80614
80670
  "testId": 114,
@@ -80645,7 +80701,7 @@
80645
80701
  ]
80646
80702
  },
80647
80703
  {
80648
- "__docId__": 3106,
80704
+ "__docId__": 3108,
80649
80705
  "kind": "testDescribe",
80650
80706
  "name": "describe115",
80651
80707
  "testId": 115,
@@ -80658,7 +80714,7 @@
80658
80714
  "lineNumber": 71
80659
80715
  },
80660
80716
  {
80661
- "__docId__": 3107,
80717
+ "__docId__": 3109,
80662
80718
  "kind": "testIt",
80663
80719
  "name": "it116",
80664
80720
  "testId": 116,
@@ -80695,7 +80751,7 @@
80695
80751
  ]
80696
80752
  },
80697
80753
  {
80698
- "__docId__": 3108,
80754
+ "__docId__": 3110,
80699
80755
  "kind": "testIt",
80700
80756
  "name": "it117",
80701
80757
  "testId": 117,
@@ -80732,7 +80788,7 @@
80732
80788
  ]
80733
80789
  },
80734
80790
  {
80735
- "__docId__": 3109,
80791
+ "__docId__": 3111,
80736
80792
  "kind": "testIt",
80737
80793
  "name": "it118",
80738
80794
  "testId": 118,
@@ -80769,7 +80825,7 @@
80769
80825
  ]
80770
80826
  },
80771
80827
  {
80772
- "__docId__": 3110,
80828
+ "__docId__": 3112,
80773
80829
  "kind": "testDescribe",
80774
80830
  "name": "describe119",
80775
80831
  "testId": 119,
@@ -80782,7 +80838,7 @@
80782
80838
  "lineNumber": 97
80783
80839
  },
80784
80840
  {
80785
- "__docId__": 3111,
80841
+ "__docId__": 3113,
80786
80842
  "kind": "testIt",
80787
80843
  "name": "it120",
80788
80844
  "testId": 120,
@@ -80819,7 +80875,7 @@
80819
80875
  ]
80820
80876
  },
80821
80877
  {
80822
- "__docId__": 3112,
80878
+ "__docId__": 3114,
80823
80879
  "kind": "testIt",
80824
80880
  "name": "it121",
80825
80881
  "testId": 121,
@@ -80856,7 +80912,7 @@
80856
80912
  ]
80857
80913
  },
80858
80914
  {
80859
- "__docId__": 3113,
80915
+ "__docId__": 3115,
80860
80916
  "kind": "testIt",
80861
80917
  "name": "it122",
80862
80918
  "testId": 122,
@@ -80893,7 +80949,7 @@
80893
80949
  ]
80894
80950
  },
80895
80951
  {
80896
- "__docId__": 3114,
80952
+ "__docId__": 3116,
80897
80953
  "kind": "testDescribe",
80898
80954
  "name": "describe123",
80899
80955
  "testId": 123,
@@ -80930,7 +80986,7 @@
80930
80986
  ]
80931
80987
  },
80932
80988
  {
80933
- "__docId__": 3115,
80989
+ "__docId__": 3117,
80934
80990
  "kind": "testIt",
80935
80991
  "name": "it124",
80936
80992
  "testId": 124,
@@ -80943,7 +80999,7 @@
80943
80999
  "lineNumber": 129
80944
81000
  },
80945
81001
  {
80946
- "__docId__": 3116,
81002
+ "__docId__": 3118,
80947
81003
  "kind": "testDescribe",
80948
81004
  "name": "describe125",
80949
81005
  "testId": 125,
@@ -80965,7 +81021,7 @@
80965
81021
  ]
80966
81022
  },
80967
81023
  {
80968
- "__docId__": 3117,
81024
+ "__docId__": 3119,
80969
81025
  "kind": "testIt",
80970
81026
  "name": "it126",
80971
81027
  "testId": 126,
@@ -80978,7 +81034,7 @@
80978
81034
  "lineNumber": 141
80979
81035
  },
80980
81036
  {
80981
- "__docId__": 3118,
81037
+ "__docId__": 3120,
80982
81038
  "kind": "testIt",
80983
81039
  "name": "it127",
80984
81040
  "testId": 127,
@@ -80991,7 +81047,7 @@
80991
81047
  "lineNumber": 144
80992
81048
  },
80993
81049
  {
80994
- "__docId__": 3119,
81050
+ "__docId__": 3121,
80995
81051
  "kind": "testIt",
80996
81052
  "name": "it128",
80997
81053
  "testId": 128,
@@ -81004,7 +81060,7 @@
81004
81060
  "lineNumber": 147
81005
81061
  },
81006
81062
  {
81007
- "__docId__": 3120,
81063
+ "__docId__": 3122,
81008
81064
  "kind": "testIt",
81009
81065
  "name": "it129",
81010
81066
  "testId": 129,
@@ -81017,7 +81073,7 @@
81017
81073
  "lineNumber": 150
81018
81074
  },
81019
81075
  {
81020
- "__docId__": 3121,
81076
+ "__docId__": 3123,
81021
81077
  "kind": "testDescribe",
81022
81078
  "name": "describe130",
81023
81079
  "testId": 130,
@@ -81039,7 +81095,7 @@
81039
81095
  ]
81040
81096
  },
81041
81097
  {
81042
- "__docId__": 3122,
81098
+ "__docId__": 3124,
81043
81099
  "kind": "testIt",
81044
81100
  "name": "it131",
81045
81101
  "testId": 131,
@@ -81061,7 +81117,7 @@
81061
81117
  ]
81062
81118
  },
81063
81119
  {
81064
- "__docId__": 3123,
81120
+ "__docId__": 3125,
81065
81121
  "kind": "testIt",
81066
81122
  "name": "it132",
81067
81123
  "testId": 132,
@@ -81083,7 +81139,7 @@
81083
81139
  ]
81084
81140
  },
81085
81141
  {
81086
- "__docId__": 3124,
81142
+ "__docId__": 3126,
81087
81143
  "kind": "testIt",
81088
81144
  "name": "it133",
81089
81145
  "testId": 133,
@@ -81105,7 +81161,7 @@
81105
81161
  ]
81106
81162
  },
81107
81163
  {
81108
- "__docId__": 3125,
81164
+ "__docId__": 3127,
81109
81165
  "kind": "testDescribe",
81110
81166
  "name": "describe134",
81111
81167
  "testId": 134,
@@ -81127,7 +81183,7 @@
81127
81183
  ]
81128
81184
  },
81129
81185
  {
81130
- "__docId__": 3126,
81186
+ "__docId__": 3128,
81131
81187
  "kind": "testIt",
81132
81188
  "name": "it135",
81133
81189
  "testId": 135,
@@ -81149,7 +81205,7 @@
81149
81205
  ]
81150
81206
  },
81151
81207
  {
81152
- "__docId__": 3127,
81208
+ "__docId__": 3129,
81153
81209
  "kind": "testIt",
81154
81210
  "name": "it136",
81155
81211
  "testId": 136,
@@ -81171,7 +81227,7 @@
81171
81227
  ]
81172
81228
  },
81173
81229
  {
81174
- "__docId__": 3128,
81230
+ "__docId__": 3130,
81175
81231
  "kind": "testIt",
81176
81232
  "name": "it137",
81177
81233
  "testId": 137,
@@ -81193,7 +81249,7 @@
81193
81249
  ]
81194
81250
  },
81195
81251
  {
81196
- "__docId__": 3129,
81252
+ "__docId__": 3131,
81197
81253
  "kind": "testDescribe",
81198
81254
  "name": "describe138",
81199
81255
  "testId": 138,
@@ -81215,7 +81271,7 @@
81215
81271
  ]
81216
81272
  },
81217
81273
  {
81218
- "__docId__": 3130,
81274
+ "__docId__": 3132,
81219
81275
  "kind": "testIt",
81220
81276
  "name": "it139",
81221
81277
  "testId": 139,
@@ -81237,7 +81293,7 @@
81237
81293
  ]
81238
81294
  },
81239
81295
  {
81240
- "__docId__": 3131,
81296
+ "__docId__": 3133,
81241
81297
  "kind": "testIt",
81242
81298
  "name": "it140",
81243
81299
  "testId": 140,
@@ -81259,7 +81315,7 @@
81259
81315
  ]
81260
81316
  },
81261
81317
  {
81262
- "__docId__": 3132,
81318
+ "__docId__": 3134,
81263
81319
  "kind": "testIt",
81264
81320
  "name": "it141",
81265
81321
  "testId": 141,
@@ -81281,7 +81337,7 @@
81281
81337
  ]
81282
81338
  },
81283
81339
  {
81284
- "__docId__": 3133,
81340
+ "__docId__": 3135,
81285
81341
  "kind": "testDescribe",
81286
81342
  "name": "describe142",
81287
81343
  "testId": 142,
@@ -81303,7 +81359,7 @@
81303
81359
  ]
81304
81360
  },
81305
81361
  {
81306
- "__docId__": 3134,
81362
+ "__docId__": 3136,
81307
81363
  "kind": "testDescribe",
81308
81364
  "name": "describe143",
81309
81365
  "testId": 143,
@@ -81316,7 +81372,7 @@
81316
81372
  "lineNumber": 202
81317
81373
  },
81318
81374
  {
81319
- "__docId__": 3135,
81375
+ "__docId__": 3137,
81320
81376
  "kind": "testIt",
81321
81377
  "name": "it144",
81322
81378
  "testId": 144,
@@ -81343,7 +81399,7 @@
81343
81399
  ]
81344
81400
  },
81345
81401
  {
81346
- "__docId__": 3136,
81402
+ "__docId__": 3138,
81347
81403
  "kind": "testIt",
81348
81404
  "name": "it145",
81349
81405
  "testId": 145,
@@ -81370,7 +81426,7 @@
81370
81426
  ]
81371
81427
  },
81372
81428
  {
81373
- "__docId__": 3137,
81429
+ "__docId__": 3139,
81374
81430
  "kind": "testIt",
81375
81431
  "name": "it146",
81376
81432
  "testId": 146,
@@ -81397,7 +81453,7 @@
81397
81453
  ]
81398
81454
  },
81399
81455
  {
81400
- "__docId__": 3138,
81456
+ "__docId__": 3140,
81401
81457
  "kind": "testDescribe",
81402
81458
  "name": "describe147",
81403
81459
  "testId": 147,
@@ -81424,7 +81480,7 @@
81424
81480
  ]
81425
81481
  },
81426
81482
  {
81427
- "__docId__": 3139,
81483
+ "__docId__": 3141,
81428
81484
  "kind": "testIt",
81429
81485
  "name": "it148",
81430
81486
  "testId": 148,
@@ -81451,7 +81507,7 @@
81451
81507
  ]
81452
81508
  },
81453
81509
  {
81454
- "__docId__": 3140,
81510
+ "__docId__": 3142,
81455
81511
  "kind": "testIt",
81456
81512
  "name": "it149",
81457
81513
  "testId": 149,
@@ -81478,7 +81534,7 @@
81478
81534
  ]
81479
81535
  },
81480
81536
  {
81481
- "__docId__": 3141,
81537
+ "__docId__": 3143,
81482
81538
  "kind": "testIt",
81483
81539
  "name": "it150",
81484
81540
  "testId": 150,
@@ -81505,7 +81561,7 @@
81505
81561
  ]
81506
81562
  },
81507
81563
  {
81508
- "__docId__": 3142,
81564
+ "__docId__": 3144,
81509
81565
  "kind": "testDescribe",
81510
81566
  "name": "describe151",
81511
81567
  "testId": 151,
@@ -81518,7 +81574,7 @@
81518
81574
  "lineNumber": 252
81519
81575
  },
81520
81576
  {
81521
- "__docId__": 3143,
81577
+ "__docId__": 3145,
81522
81578
  "kind": "testIt",
81523
81579
  "name": "it152",
81524
81580
  "testId": 152,
@@ -81545,7 +81601,7 @@
81545
81601
  ]
81546
81602
  },
81547
81603
  {
81548
- "__docId__": 3144,
81604
+ "__docId__": 3146,
81549
81605
  "kind": "testIt",
81550
81606
  "name": "it153",
81551
81607
  "testId": 153,
@@ -81572,7 +81628,7 @@
81572
81628
  ]
81573
81629
  },
81574
81630
  {
81575
- "__docId__": 3145,
81631
+ "__docId__": 3147,
81576
81632
  "kind": "testIt",
81577
81633
  "name": "it154",
81578
81634
  "testId": 154,
@@ -81599,7 +81655,7 @@
81599
81655
  ]
81600
81656
  },
81601
81657
  {
81602
- "__docId__": 3146,
81658
+ "__docId__": 3148,
81603
81659
  "kind": "testDescribe",
81604
81660
  "name": "describe155",
81605
81661
  "testId": 155,
@@ -81612,7 +81668,7 @@
81612
81668
  "lineNumber": 275
81613
81669
  },
81614
81670
  {
81615
- "__docId__": 3147,
81671
+ "__docId__": 3149,
81616
81672
  "kind": "testIt",
81617
81673
  "name": "it156",
81618
81674
  "testId": 156,
@@ -81639,7 +81695,7 @@
81639
81695
  ]
81640
81696
  },
81641
81697
  {
81642
- "__docId__": 3148,
81698
+ "__docId__": 3150,
81643
81699
  "kind": "testIt",
81644
81700
  "name": "it157",
81645
81701
  "testId": 157,
@@ -81666,7 +81722,7 @@
81666
81722
  ]
81667
81723
  },
81668
81724
  {
81669
- "__docId__": 3149,
81725
+ "__docId__": 3151,
81670
81726
  "kind": "testIt",
81671
81727
  "name": "it158",
81672
81728
  "testId": 158,
@@ -81693,7 +81749,7 @@
81693
81749
  ]
81694
81750
  },
81695
81751
  {
81696
- "__docId__": 3150,
81752
+ "__docId__": 3152,
81697
81753
  "kind": "testDescribe",
81698
81754
  "name": "describe159",
81699
81755
  "testId": 159,
@@ -81706,7 +81762,7 @@
81706
81762
  "lineNumber": 300
81707
81763
  },
81708
81764
  {
81709
- "__docId__": 3151,
81765
+ "__docId__": 3153,
81710
81766
  "kind": "testIt",
81711
81767
  "name": "it160",
81712
81768
  "testId": 160,
@@ -81733,7 +81789,7 @@
81733
81789
  ]
81734
81790
  },
81735
81791
  {
81736
- "__docId__": 3152,
81792
+ "__docId__": 3154,
81737
81793
  "kind": "testIt",
81738
81794
  "name": "it161",
81739
81795
  "testId": 161,
@@ -81760,7 +81816,7 @@
81760
81816
  ]
81761
81817
  },
81762
81818
  {
81763
- "__docId__": 3153,
81819
+ "__docId__": 3155,
81764
81820
  "kind": "testIt",
81765
81821
  "name": "it162",
81766
81822
  "testId": 162,
@@ -81787,7 +81843,7 @@
81787
81843
  ]
81788
81844
  },
81789
81845
  {
81790
- "__docId__": 3154,
81846
+ "__docId__": 3156,
81791
81847
  "kind": "testDescribe",
81792
81848
  "name": "describe163",
81793
81849
  "testId": 163,
@@ -81800,7 +81856,7 @@
81800
81856
  "lineNumber": 325
81801
81857
  },
81802
81858
  {
81803
- "__docId__": 3155,
81859
+ "__docId__": 3157,
81804
81860
  "kind": "testIt",
81805
81861
  "name": "it164",
81806
81862
  "testId": 164,
@@ -81822,7 +81878,7 @@
81822
81878
  ]
81823
81879
  },
81824
81880
  {
81825
- "__docId__": 3156,
81881
+ "__docId__": 3158,
81826
81882
  "kind": "testIt",
81827
81883
  "name": "it165",
81828
81884
  "testId": 165,
@@ -81844,7 +81900,7 @@
81844
81900
  ]
81845
81901
  },
81846
81902
  {
81847
- "__docId__": 3157,
81903
+ "__docId__": 3159,
81848
81904
  "kind": "testIt",
81849
81905
  "name": "it166",
81850
81906
  "testId": 166,
@@ -81866,7 +81922,7 @@
81866
81922
  ]
81867
81923
  },
81868
81924
  {
81869
- "__docId__": 3158,
81925
+ "__docId__": 3160,
81870
81926
  "kind": "testDescribe",
81871
81927
  "name": "describe167",
81872
81928
  "testId": 167,
@@ -81879,7 +81935,7 @@
81879
81935
  "lineNumber": 345
81880
81936
  },
81881
81937
  {
81882
- "__docId__": 3159,
81938
+ "__docId__": 3161,
81883
81939
  "kind": "testIt",
81884
81940
  "name": "it168",
81885
81941
  "testId": 168,
@@ -81901,7 +81957,7 @@
81901
81957
  ]
81902
81958
  },
81903
81959
  {
81904
- "__docId__": 3160,
81960
+ "__docId__": 3162,
81905
81961
  "kind": "testIt",
81906
81962
  "name": "it169",
81907
81963
  "testId": 169,
@@ -81923,7 +81979,7 @@
81923
81979
  ]
81924
81980
  },
81925
81981
  {
81926
- "__docId__": 3161,
81982
+ "__docId__": 3163,
81927
81983
  "kind": "testIt",
81928
81984
  "name": "it170",
81929
81985
  "testId": 170,
@@ -81945,7 +82001,7 @@
81945
82001
  ]
81946
82002
  },
81947
82003
  {
81948
- "__docId__": 3162,
82004
+ "__docId__": 3164,
81949
82005
  "kind": "testIt",
81950
82006
  "name": "it171",
81951
82007
  "testId": 171,
@@ -81967,7 +82023,7 @@
81967
82023
  ]
81968
82024
  },
81969
82025
  {
81970
- "__docId__": 3163,
82026
+ "__docId__": 3165,
81971
82027
  "kind": "testDescribe",
81972
82028
  "name": "describe172",
81973
82029
  "testId": 172,
@@ -81980,7 +82036,7 @@
81980
82036
  "lineNumber": 362
81981
82037
  },
81982
82038
  {
81983
- "__docId__": 3164,
82039
+ "__docId__": 3166,
81984
82040
  "kind": "testIt",
81985
82041
  "name": "it173",
81986
82042
  "testId": 173,
@@ -82002,7 +82058,7 @@
82002
82058
  ]
82003
82059
  },
82004
82060
  {
82005
- "__docId__": 3165,
82061
+ "__docId__": 3167,
82006
82062
  "kind": "testIt",
82007
82063
  "name": "it174",
82008
82064
  "testId": 174,
@@ -82024,7 +82080,7 @@
82024
82080
  ]
82025
82081
  },
82026
82082
  {
82027
- "__docId__": 3166,
82083
+ "__docId__": 3168,
82028
82084
  "kind": "testIt",
82029
82085
  "name": "it175",
82030
82086
  "testId": 175,
@@ -82046,7 +82102,7 @@
82046
82102
  ]
82047
82103
  },
82048
82104
  {
82049
- "__docId__": 3167,
82105
+ "__docId__": 3169,
82050
82106
  "kind": "testIt",
82051
82107
  "name": "it176",
82052
82108
  "testId": 176,
@@ -82068,7 +82124,7 @@
82068
82124
  ]
82069
82125
  },
82070
82126
  {
82071
- "__docId__": 3168,
82127
+ "__docId__": 3170,
82072
82128
  "kind": "testDescribe",
82073
82129
  "name": "describe177",
82074
82130
  "testId": 177,
@@ -82081,7 +82137,7 @@
82081
82137
  "lineNumber": 382
82082
82138
  },
82083
82139
  {
82084
- "__docId__": 3169,
82140
+ "__docId__": 3171,
82085
82141
  "kind": "testIt",
82086
82142
  "name": "it178",
82087
82143
  "testId": 178,
@@ -82103,7 +82159,7 @@
82103
82159
  ]
82104
82160
  },
82105
82161
  {
82106
- "__docId__": 3170,
82162
+ "__docId__": 3172,
82107
82163
  "kind": "testIt",
82108
82164
  "name": "it179",
82109
82165
  "testId": 179,
@@ -82125,7 +82181,7 @@
82125
82181
  ]
82126
82182
  },
82127
82183
  {
82128
- "__docId__": 3171,
82184
+ "__docId__": 3173,
82129
82185
  "kind": "testIt",
82130
82186
  "name": "it180",
82131
82187
  "testId": 180,
@@ -82147,7 +82203,7 @@
82147
82203
  ]
82148
82204
  },
82149
82205
  {
82150
- "__docId__": 3172,
82206
+ "__docId__": 3174,
82151
82207
  "kind": "testDescribe",
82152
82208
  "name": "describe181",
82153
82209
  "testId": 181,
@@ -82160,7 +82216,7 @@
82160
82216
  "lineNumber": 396
82161
82217
  },
82162
82218
  {
82163
- "__docId__": 3173,
82219
+ "__docId__": 3175,
82164
82220
  "kind": "testIt",
82165
82221
  "name": "it182",
82166
82222
  "testId": 182,
@@ -82182,7 +82238,7 @@
82182
82238
  ]
82183
82239
  },
82184
82240
  {
82185
- "__docId__": 3174,
82241
+ "__docId__": 3176,
82186
82242
  "kind": "testIt",
82187
82243
  "name": "it183",
82188
82244
  "testId": 183,
@@ -82204,7 +82260,7 @@
82204
82260
  ]
82205
82261
  },
82206
82262
  {
82207
- "__docId__": 3175,
82263
+ "__docId__": 3177,
82208
82264
  "kind": "testIt",
82209
82265
  "name": "it184",
82210
82266
  "testId": 184,
@@ -82226,7 +82282,7 @@
82226
82282
  ]
82227
82283
  },
82228
82284
  {
82229
- "__docId__": 3176,
82285
+ "__docId__": 3178,
82230
82286
  "kind": "testIt",
82231
82287
  "name": "it185",
82232
82288
  "testId": 185,
@@ -82248,7 +82304,7 @@
82248
82304
  ]
82249
82305
  },
82250
82306
  {
82251
- "__docId__": 3177,
82307
+ "__docId__": 3179,
82252
82308
  "kind": "testDescribe",
82253
82309
  "name": "describe186",
82254
82310
  "testId": 186,
@@ -82261,7 +82317,7 @@
82261
82317
  "lineNumber": 413
82262
82318
  },
82263
82319
  {
82264
- "__docId__": 3178,
82320
+ "__docId__": 3180,
82265
82321
  "kind": "testIt",
82266
82322
  "name": "it187",
82267
82323
  "testId": 187,
@@ -82283,7 +82339,7 @@
82283
82339
  ]
82284
82340
  },
82285
82341
  {
82286
- "__docId__": 3179,
82342
+ "__docId__": 3181,
82287
82343
  "kind": "testIt",
82288
82344
  "name": "it188",
82289
82345
  "testId": 188,
@@ -82305,7 +82361,7 @@
82305
82361
  ]
82306
82362
  },
82307
82363
  {
82308
- "__docId__": 3180,
82364
+ "__docId__": 3182,
82309
82365
  "kind": "testIt",
82310
82366
  "name": "it189",
82311
82367
  "testId": 189,
@@ -82327,7 +82383,7 @@
82327
82383
  ]
82328
82384
  },
82329
82385
  {
82330
- "__docId__": 3181,
82386
+ "__docId__": 3183,
82331
82387
  "kind": "testIt",
82332
82388
  "name": "it190",
82333
82389
  "testId": 190,
@@ -82349,7 +82405,7 @@
82349
82405
  ]
82350
82406
  },
82351
82407
  {
82352
- "__docId__": 3182,
82408
+ "__docId__": 3184,
82353
82409
  "kind": "testDescribe",
82354
82410
  "name": "describe191",
82355
82411
  "testId": 191,
@@ -82362,7 +82418,7 @@
82362
82418
  "lineNumber": 433
82363
82419
  },
82364
82420
  {
82365
- "__docId__": 3183,
82421
+ "__docId__": 3185,
82366
82422
  "kind": "testIt",
82367
82423
  "name": "it192",
82368
82424
  "testId": 192,
@@ -82384,7 +82440,7 @@
82384
82440
  ]
82385
82441
  },
82386
82442
  {
82387
- "__docId__": 3184,
82443
+ "__docId__": 3186,
82388
82444
  "kind": "testDescribe",
82389
82445
  "name": "describe193",
82390
82446
  "testId": 193,
@@ -82397,7 +82453,7 @@
82397
82453
  "lineNumber": 438
82398
82454
  },
82399
82455
  {
82400
- "__docId__": 3185,
82456
+ "__docId__": 3187,
82401
82457
  "kind": "testIt",
82402
82458
  "name": "it194",
82403
82459
  "testId": 194,
@@ -82419,7 +82475,7 @@
82419
82475
  ]
82420
82476
  },
82421
82477
  {
82422
- "__docId__": 3186,
82478
+ "__docId__": 3188,
82423
82479
  "kind": "testIt",
82424
82480
  "name": "it195",
82425
82481
  "testId": 195,
@@ -82432,7 +82488,7 @@
82432
82488
  "lineNumber": 444
82433
82489
  },
82434
82490
  {
82435
- "__docId__": 3187,
82491
+ "__docId__": 3189,
82436
82492
  "kind": "testFile",
82437
82493
  "name": "client/security/certificates.spec.js",
82438
82494
  "content": "define(function() {\r\n mocha.setup('bdd');\r\n /** @test {InternalOpenGateAPI#certificatesBuilder()} */\r\n describe('Check funcionality certificates:', function() {\r\n var certificates;\r\n before(function() {\r\n certificates = ogapi.certificatesBuilder();\r\n });\r\n /** @test {InternalOpenGateAPI#bundlesBuilder} */\r\n describe('Check basic parameters:', function() {\r\n\r\n it('Name is not a String', function() {\r\n assert.throws(function() {\r\n certificates.withName(11);\r\n }, \"Parameter name must be a string, cannot be empty and has a maximum length of 50\");\r\n });\r\n it('Name max length', function() {\r\n assert.throws(function() {\r\n certificates.withName(11);\r\n }, \"Parameter name must be a string, cannot be empty and has a maximum length of 50\");\r\n });\r\n\r\n it('administrativeState is not a String', function() {\r\n assert.throws(function() {\r\n certificates.withAdministrativeState(1);\r\n }, \"Parameter administrativeState must be typeof string and cannot be empty\");\r\n\r\n });\r\n\r\n it('administrativeState is not a String', function() {\r\n assert.throws(function() {\r\n certificates.withAdministrativeState(\"NOT_ACTIVE\");\r\n }, \"Parameter administrativeState must be typeof string and cannot be empty\");\r\n\r\n });\r\n\r\n it('hardwares is not a String', function() {\r\n assert.throws(function() {\r\n certificates.withHardwares([{}]);\r\n }, \"Parameter administrativeState must be typeof string and cannot be empty\");\r\n\r\n });\r\n\r\n });\r\n\r\n describe('Create:', function() {\r\n\r\n var certificates;\r\n before(function() {\r\n certificates = ogapi.certificatesBuilder();\r\n });\r\n\r\n it('Create a certificate', function() {\r\n var file = \"-----BEGIN CERTIFICATE-----\\n\" +\r\n \"MIIFXDCCA0SgAwIBAgIEV+4AwzANBgkqhkiG9w0BAQsFADBwMQswCQYDVQQGEwJF\" +\r\n \"UzEPMA0GA1UECAwGTWFkcmlkMQ8wDQYDVQQHDAZNYWRyaWQxEjAQBgNVBAoMCUFt\" +\r\n \"cGxpYSkpKTESMBAGA1UECwwJQW1wbGlhKSkpMRcwFQYDVQQDDA5wcm92LnRlc3Qu\" +\r\n \"cm9vdDAeFw0xNjA5MzAwNjA2NDFaFw0xNzA5MzAwNjA2NDFaMHAxCzAJBgNVBAYT\" +\r\n \"AkVTMQ8wDQYDVQQIDAZNYWRyaWQxDzANBgNVBAcMBk1hZHJpZDESMBAGA1UECgwJ\" +\r\n \"QW1wbGlhKSkpMRIwEAYDVQQLDAlBbXBsaWEpKSkxFzAVBgNVBAMMDnByb3YudGVz\" +\r\n \"dC5yb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqBhgGrHTLmk0\" +\r\n \"F1Rq6qFkBHGF5ZNQ9Ira4v1jTJfMr5ppB/HplXqrjiamstJ1K4pcLoeLQOcMMWmk\" +\r\n \"GKF8EV1UTD+pqSXo6j0f8I6UGqGwNiHAYlL3CwWsQ0rZSSNQfW03myfpVo3yDLlR\" +\r\n \"BiFH+fVwjHnaNrRHlQ8vzHfYUqXpU04DinONhM2avaDQjfbS/2Pu4Qb9sMPF1SYb\" +\r\n \"eTx8fAmBg8u7jlbcZsQaPdvUPURhXK5q/5kN/8wxM8suKSc6iOQzzbrbVI8lr+ZT\" +\r\n \"Bcw2D2uRbQ9nCQAiQTJ7OENq5JLYM58sop7ZSRfRLKkb6GnLHTG9cio1Yro2cAGI\" +\r\n \"G8p+6paNRajmV9KOkGG0xTEBkYs7lhnxQp692QnMq/bNOjX9QW/xb+T+IrG0t9bK\" +\r\n \"h08Ll9A+HvWvePcOdZfiJbEdr+mWNUEArxcxnKgS9QruWtLpGh5UjYQcnf/XjnSR\" +\r\n \"EucDIB0mDPyJerVat1p7Mvu2tdnvxLCQmBIeyO0FpSaeOLENIZ68jEzZNGEFdPim\" +\r\n \"Sqb4vjRoV+5QQmHNIIb8rZswsFbBCK/yVnnJ4j3Kd0mmsQGDYeHAYOvjw7mT9AU4\" +\r\n \"qgB49q34FsLo3vale9ayPnHHWZ7OUIjlHgVSmAzjohI+0b6IgWF3bLgTCeVu1LKe\" +\r\n \"g0aCTiQeWEhdk/kJ7EVV8pbNVHGnbgsCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEA\" +\r\n \"OCg0ek9bSeWg9zCpxIDGD+TI2VtnfeHkVgUMg13a8old9gsAIpb4X75m8jfBcF1P\" +\r\n \"LOmjCXVzr8Eun4LNpJs+pwnVTQPYbx1RPzKLXJzBCBAtX4FgQmRdYBp2J/THR/6N\" +\r\n \"mWh6ZCxhL9MZpwG1RIsxot65RacImLkqsVre37Ry4AHrLkkXfd1csaNEvAK+Dd2u\" +\r\n \"o+3mMYR3U62bn2nAAPHFbQ9yOIIjiJMmqcBei1dxfBdUcus2l+HacWqjeRu3PZoz\" +\r\n \"gNXWE7k7x+nUn/OqmR717F8BQqgQrtzV6R6juQmYfmghUJA1RUFBvVpm9ytRZry4\" +\r\n \"S/3iHdgm+k3N7oAYtEJANaokZk+CrDUUB7mjleHsmApNw6ZC0Zh1T7MrK73g37Ke\" +\r\n \"t7FsD1w06w//D5p/gD5dFJP6Zhcqb9EJSGFn6wfwagbNor0eA0QCpx8ZgUDb3n06\" +\r\n \"0zGBlyTFxG9QVmhoVQt6GQrUSypaYfuC+nVjQV4eAVZQVN9HgyTj77uj/wRBzY5S\" +\r\n \"EqX0xyjAj/cRDwKGgblr1XIlZD24MkxPX6uuOJENwrFEBg1I9jLeZgEjJy0ITzqa\" +\r\n \"hWrN+Q95QjBR6FAUH7bl2x6UJef4uZQZaT0NNclV65mAdOptLoNyd9BN25pqz7Rb\" +\r\n \"NIDI0Q9rTAjHLOtxHnVb746T27kER0MiiUiMGf6C1Q8=\\n\" +\r\n \"-----END CERTIFICATE-----\";\r\n\r\n certificates.withName(\"Karma_Testing_Name\");\r\n certificates.withDescription(\"Karma_Testing_Name description\");\r\n certificates.withAdministrativeState(\"ACTIVE\");\r\n certificates.withUsages([\"CERT_SIGN\"]);\r\n certificates.withTags([\"tag1\", \"tag2\"]);\r\n certificates.withHardware([{\r\n \"hardwareId\": \"OpenGateSecure\"\r\n }]);\r\n assert.doesNotThrow(function() {\r\n certificates.create(file);\r\n });\r\n\r\n });\r\n });\r\n\r\n describe('Delete:', function() {\r\n\r\n var certificates;\r\n var id = \"n0t-3x15t5\";\r\n before(function() {\r\n certificates = ogapi.certificatesBuilder();\r\n });\r\n\r\n it('Delete a not exists certificate', function() {\r\n return certificates.withId(id).delete().then(function(){\r\n assert.isTrue(false, \"\");\r\n return;\r\n }).catch(function(err) {\r\n console.log(JSON.stringify(err));\r\n assert.isTrue(true, \"\");\r\n return;\r\n });\r\n });\r\n\r\n it('Create a certificate', function() {\r\n var file = \"-----BEGIN CERTIFICATE-----\\n\" +\r\n \"MIIFXDCCA0SgAwIBAgIEV+4AwzANBgkqhkiG9w0BAQsFADBwMQswCQYDVQQGEwJF\" +\r\n \"UzEPMA0GA1UECAwGTWFkcmlkMQ8wDQYDVQQHDAZNYWRyaWQxEjAQBgNVBAoMCUFt\" +\r\n \"cGxpYSkpKTESMBAGA1UECwwJQW1wbGlhKSkpMRcwFQYDVQQDDA5wcm92LnRlc3Qu\" +\r\n \"cm9vdDAeFw0xNjA5MzAwNjA2NDFaFw0xNzA5MzAwNjA2NDFaMHAxCzAJBgNVBAYT\" +\r\n \"AkVTMQ8wDQYDVQQIDAZNYWRyaWQxDzANBgNVBAcMBk1hZHJpZDESMBAGA1UECgwJ\" +\r\n \"QW1wbGlhKSkpMRIwEAYDVQQLDAlBbXBsaWEpKSkxFzAVBgNVBAMMDnByb3YudGVz\" +\r\n \"dC5yb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqBhgGrHTLmk0\" +\r\n \"F1Rq6qFkBHGF5ZNQ9Ira4v1jTJfMr5ppB/HplXqrjiamstJ1K4pcLoeLQOcMMWmk\" +\r\n \"GKF8EV1UTD+pqSXo6j0f8I6UGqGwNiHAYlL3CwWsQ0rZSSNQfW03myfpVo3yDLlR\" +\r\n \"BiFH+fVwjHnaNrRHlQ8vzHfYUqXpU04DinONhM2avaDQjfbS/2Pu4Qb9sMPF1SYb\" +\r\n \"eTx8fAmBg8u7jlbcZsQaPdvUPURhXK5q/5kN/8wxM8suKSc6iOQzzbrbVI8lr+ZT\" +\r\n \"Bcw2D2uRbQ9nCQAiQTJ7OENq5JLYM58sop7ZSRfRLKkb6GnLHTG9cio1Yro2cAGI\" +\r\n \"G8p+6paNRajmV9KOkGG0xTEBkYs7lhnxQp692QnMq/bNOjX9QW/xb+T+IrG0t9bK\" +\r\n \"h08Ll9A+HvWvePcOdZfiJbEdr+mWNUEArxcxnKgS9QruWtLpGh5UjYQcnf/XjnSR\" +\r\n \"EucDIB0mDPyJerVat1p7Mvu2tdnvxLCQmBIeyO0FpSaeOLENIZ68jEzZNGEFdPim\" +\r\n \"Sqb4vjRoV+5QQmHNIIb8rZswsFbBCK/yVnnJ4j3Kd0mmsQGDYeHAYOvjw7mT9AU4\" +\r\n \"qgB49q34FsLo3vale9ayPnHHWZ7OUIjlHgVSmAzjohI+0b6IgWF3bLgTCeVu1LKe\" +\r\n \"g0aCTiQeWEhdk/kJ7EVV8pbNVHGnbgsCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEA\" +\r\n \"OCg0ek9bSeWg9zCpxIDGD+TI2VtnfeHkVgUMg13a8old9gsAIpb4X75m8jfBcF1P\" +\r\n \"LOmjCXVzr8Eun4LNpJs+pwnVTQPYbx1RPzKLXJzBCBAtX4FgQmRdYBp2J/THR/6N\" +\r\n \"mWh6ZCxhL9MZpwG1RIsxot65RacImLkqsVre37Ry4AHrLkkXfd1csaNEvAK+Dd2u\" +\r\n \"o+3mMYR3U62bn2nAAPHFbQ9yOIIjiJMmqcBei1dxfBdUcus2l+HacWqjeRu3PZoz\" +\r\n \"gNXWE7k7x+nUn/OqmR717F8BQqgQrtzV6R6juQmYfmghUJA1RUFBvVpm9ytRZry4\" +\r\n \"S/3iHdgm+k3N7oAYtEJANaokZk+CrDUUB7mjleHsmApNw6ZC0Zh1T7MrK73g37Ke\" +\r\n \"t7FsD1w06w//D5p/gD5dFJP6Zhcqb9EJSGFn6wfwagbNor0eA0QCpx8ZgUDb3n06\" +\r\n \"0zGBlyTFxG9QVmhoVQt6GQrUSypaYfuC+nVjQV4eAVZQVN9HgyTj77uj/wRBzY5S\" +\r\n \"EqX0xyjAj/cRDwKGgblr1XIlZD24MkxPX6uuOJENwrFEBg1I9jLeZgEjJy0ITzqa\" +\r\n \"hWrN+Q95QjBR6FAUH7bl2x6UJef4uZQZaT0NNclV65mAdOptLoNyd9BN25pqz7Rb\" +\r\n \"NIDI0Q9rTAjHLOtxHnVb746T27kER0MiiUiMGf6C1Q8=\\n\" +\r\n \"-----END CERTIFICATE-----\";\r\n\r\n certificates.withName(\"Karma_Testing_Name\");\r\n certificates.withDescription(\"Karma_Testing_Name description\");\r\n certificates.withAdministrativeState(\"ACTIVE\");\r\n certificates.withUsages([\"CERT_SIGN\"]);\r\n return certificates.create(file).then(function(response){\r\n console.log(JSON.stringify(response));\r\n assert.equal(response.statusCode, 201);\r\n var data = response.location;\r\n id = data.substring(data.lastIndexOf(\"/\") + 1);\r\n return;\r\n });\r\n });\r\n\r\n it('Delete a certificate', function() {\r\n return certificates.withId(id).delete().then(function(response){\r\n console.log(JSON.stringify(response));\r\n assert.equal(response.statusCode, 200);\r\n return;\r\n }\r\n );\r\n });\r\n });\r\n\r\n describe('Update:', function() {\r\n\r\n var certificates;\r\n before(function() {\r\n certificates = ogapi.certificatesBuilder();\r\n });\r\n\r\n it('Update a certificate', function() {\r\n certificates.withId(\"f0564b4f-4044-4028-a062-0b502a410108\");\r\n certificates.withName(\"Root_Name\");\r\n certificates.withDescription(\"updating_root_from_Karma_prueba\");\r\n certificates.withAdministrativeState(\"ACTIVE\");\r\n certificates.withUsages([\"CERT_SIGN\"]);\r\n certificates.withTags([\"tag1\", \"tag2\"]);\r\n certificates.withHardware([{\r\n \"hardwareId\": \"OpenGateSecure\"\r\n }]);\r\n assert.doesNotThrow(function() {\r\n certificates.update();\r\n });\r\n });\r\n });\r\n\r\n describe('Finder:', function() {\r\n var certificates;\r\n var certificate;\r\n var id = \"n0t-3x15t5\";\r\n before(function() {\r\n certificate = ogapi.newCertificateFinder();\r\n certificates = ogapi.certificatesBuilder();\r\n });\r\n var file = \"-----BEGIN CERTIFICATE-----\\n\" +\r\n \"MIIFXDCCA0SgAwIBAgIEV+4AwzANBgkqhkiG9w0BAQsFADBwMQswCQYDVQQGEwJF\" +\r\n \"UzEPMA0GA1UECAwGTWFkcmlkMQ8wDQYDVQQHDAZNYWRyaWQxEjAQBgNVBAoMCUFt\" +\r\n \"cGxpYSkpKTESMBAGA1UECwwJQW1wbGlhKSkpMRcwFQYDVQQDDA5wcm92LnRlc3Qu\" +\r\n \"cm9vdDAeFw0xNjA5MzAwNjA2NDFaFw0xNzA5MzAwNjA2NDFaMHAxCzAJBgNVBAYT\" +\r\n \"AkVTMQ8wDQYDVQQIDAZNYWRyaWQxDzANBgNVBAcMBk1hZHJpZDESMBAGA1UECgwJ\" +\r\n \"QW1wbGlhKSkpMRIwEAYDVQQLDAlBbXBsaWEpKSkxFzAVBgNVBAMMDnByb3YudGVz\" +\r\n \"dC5yb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqBhgGrHTLmk0\" +\r\n \"F1Rq6qFkBHGF5ZNQ9Ira4v1jTJfMr5ppB/HplXqrjiamstJ1K4pcLoeLQOcMMWmk\" +\r\n \"GKF8EV1UTD+pqSXo6j0f8I6UGqGwNiHAYlL3CwWsQ0rZSSNQfW03myfpVo3yDLlR\" +\r\n \"BiFH+fVwjHnaNrRHlQ8vzHfYUqXpU04DinONhM2avaDQjfbS/2Pu4Qb9sMPF1SYb\" +\r\n \"eTx8fAmBg8u7jlbcZsQaPdvUPURhXK5q/5kN/8wxM8suKSc6iOQzzbrbVI8lr+ZT\" +\r\n \"Bcw2D2uRbQ9nCQAiQTJ7OENq5JLYM58sop7ZSRfRLKkb6GnLHTG9cio1Yro2cAGI\" +\r\n \"G8p+6paNRajmV9KOkGG0xTEBkYs7lhnxQp692QnMq/bNOjX9QW/xb+T+IrG0t9bK\" +\r\n \"h08Ll9A+HvWvePcOdZfiJbEdr+mWNUEArxcxnKgS9QruWtLpGh5UjYQcnf/XjnSR\" +\r\n \"EucDIB0mDPyJerVat1p7Mvu2tdnvxLCQmBIeyO0FpSaeOLENIZ68jEzZNGEFdPim\" +\r\n \"Sqb4vjRoV+5QQmHNIIb8rZswsFbBCK/yVnnJ4j3Kd0mmsQGDYeHAYOvjw7mT9AU4\" +\r\n \"qgB49q34FsLo3vale9ayPnHHWZ7OUIjlHgVSmAzjohI+0b6IgWF3bLgTCeVu1LKe\" +\r\n \"g0aCTiQeWEhdk/kJ7EVV8pbNVHGnbgsCAwEAATANBgkqhkiG9w0BAQsFAAOCAgEA\" +\r\n \"OCg0ek9bSeWg9zCpxIDGD+TI2VtnfeHkVgUMg13a8old9gsAIpb4X75m8jfBcF1P\" +\r\n \"LOmjCXVzr8Eun4LNpJs+pwnVTQPYbx1RPzKLXJzBCBAtX4FgQmRdYBp2J/THR/6N\" +\r\n \"mWh6ZCxhL9MZpwG1RIsxot65RacImLkqsVre37Ry4AHrLkkXfd1csaNEvAK+Dd2u\" +\r\n \"o+3mMYR3U62bn2nAAPHFbQ9yOIIjiJMmqcBei1dxfBdUcus2l+HacWqjeRu3PZoz\" +\r\n \"gNXWE7k7x+nUn/OqmR717F8BQqgQrtzV6R6juQmYfmghUJA1RUFBvVpm9ytRZry4\" +\r\n \"S/3iHdgm+k3N7oAYtEJANaokZk+CrDUUB7mjleHsmApNw6ZC0Zh1T7MrK73g37Ke\" +\r\n \"t7FsD1w06w//D5p/gD5dFJP6Zhcqb9EJSGFn6wfwagbNor0eA0QCpx8ZgUDb3n06\" +\r\n \"0zGBlyTFxG9QVmhoVQt6GQrUSypaYfuC+nVjQV4eAVZQVN9HgyTj77uj/wRBzY5S\" +\r\n \"EqX0xyjAj/cRDwKGgblr1XIlZD24MkxPX6uuOJENwrFEBg1I9jLeZgEjJy0ITzqa\" +\r\n \"hWrN+Q95QjBR6FAUH7bl2x6UJef4uZQZaT0NNclV65mAdOptLoNyd9BN25pqz7Rb\" +\r\n \"NIDI0Q9rTAjHLOtxHnVb746T27kER0MiiUiMGf6C1Q8=\\n\" +\r\n \"-----END CERTIFICATE-----\";\r\n\r\n it('Create a certificate', function() {\r\n certificates.withName(\"Karma_Testing_Name\");\r\n certificates.withDescription(\"Karma_Testing_Name description\");\r\n certificates.withAdministrativeState(\"ACTIVE\");\r\n certificates.withUsages([\"CERT_SIGN\"]);\r\n return certificates.create(file).then(function(response){\r\n console.log(JSON.stringify(response));\r\n assert.equal(response.statusCode, 201);\r\n var data = response.location;\r\n id = data.substring(data.lastIndexOf(\"/\") + 1);\r\n return;\r\n });\r\n });\r\n\r\n it('Download a certificate', function() {\r\n return certificate.findByIdAndFormat(id, 'x-pem-file').then(function(response){\r\n console.log(response);\r\n var headers = response.data.headers;\r\n var blob = new Blob([response.data.text],{type:headers['content-type']});\r\n var link = document.createElement('a');\r\n link.href = window.URL.createObjectURL(blob);\r\n link.download = \"Filename\";\r\n link.click();\r\n\r\n return;\r\n });\r\n });\r\n });\r\n });\r\n});",
@@ -82443,7 +82499,7 @@
82443
82499
  "lineNumber": 1
82444
82500
  },
82445
82501
  {
82446
- "__docId__": 3188,
82502
+ "__docId__": 3190,
82447
82503
  "kind": "testDescribe",
82448
82504
  "name": "describe196",
82449
82505
  "testId": 196,
@@ -82465,7 +82521,7 @@
82465
82521
  ]
82466
82522
  },
82467
82523
  {
82468
- "__docId__": 3189,
82524
+ "__docId__": 3191,
82469
82525
  "kind": "testDescribe",
82470
82526
  "name": "describe197",
82471
82527
  "testId": 197,
@@ -82487,7 +82543,7 @@
82487
82543
  ]
82488
82544
  },
82489
82545
  {
82490
- "__docId__": 3190,
82546
+ "__docId__": 3192,
82491
82547
  "kind": "testIt",
82492
82548
  "name": "it198",
82493
82549
  "testId": 198,
@@ -82500,7 +82556,7 @@
82500
82556
  "lineNumber": 12
82501
82557
  },
82502
82558
  {
82503
- "__docId__": 3191,
82559
+ "__docId__": 3193,
82504
82560
  "kind": "testIt",
82505
82561
  "name": "it199",
82506
82562
  "testId": 199,
@@ -82513,7 +82569,7 @@
82513
82569
  "lineNumber": 17
82514
82570
  },
82515
82571
  {
82516
- "__docId__": 3192,
82572
+ "__docId__": 3194,
82517
82573
  "kind": "testIt",
82518
82574
  "name": "it200",
82519
82575
  "testId": 200,
@@ -82526,7 +82582,7 @@
82526
82582
  "lineNumber": 23
82527
82583
  },
82528
82584
  {
82529
- "__docId__": 3193,
82585
+ "__docId__": 3195,
82530
82586
  "kind": "testIt",
82531
82587
  "name": "it201",
82532
82588
  "testId": 201,
@@ -82539,7 +82595,7 @@
82539
82595
  "lineNumber": 30
82540
82596
  },
82541
82597
  {
82542
- "__docId__": 3194,
82598
+ "__docId__": 3196,
82543
82599
  "kind": "testIt",
82544
82600
  "name": "it202",
82545
82601
  "testId": 202,
@@ -82552,7 +82608,7 @@
82552
82608
  "lineNumber": 37
82553
82609
  },
82554
82610
  {
82555
- "__docId__": 3195,
82611
+ "__docId__": 3197,
82556
82612
  "kind": "testDescribe",
82557
82613
  "name": "describe203",
82558
82614
  "testId": 203,
@@ -82565,7 +82621,7 @@
82565
82621
  "lineNumber": 46
82566
82622
  },
82567
82623
  {
82568
- "__docId__": 3196,
82624
+ "__docId__": 3198,
82569
82625
  "kind": "testIt",
82570
82626
  "name": "it204",
82571
82627
  "testId": 204,
@@ -82578,7 +82634,7 @@
82578
82634
  "lineNumber": 53
82579
82635
  },
82580
82636
  {
82581
- "__docId__": 3197,
82637
+ "__docId__": 3199,
82582
82638
  "kind": "testDescribe",
82583
82639
  "name": "describe205",
82584
82640
  "testId": 205,
@@ -82591,7 +82647,7 @@
82591
82647
  "lineNumber": 101
82592
82648
  },
82593
82649
  {
82594
- "__docId__": 3198,
82650
+ "__docId__": 3200,
82595
82651
  "kind": "testIt",
82596
82652
  "name": "it206",
82597
82653
  "testId": 206,
@@ -82604,7 +82660,7 @@
82604
82660
  "lineNumber": 109
82605
82661
  },
82606
82662
  {
82607
- "__docId__": 3199,
82663
+ "__docId__": 3201,
82608
82664
  "kind": "testIt",
82609
82665
  "name": "it207",
82610
82666
  "testId": 207,
@@ -82617,7 +82673,7 @@
82617
82673
  "lineNumber": 120
82618
82674
  },
82619
82675
  {
82620
- "__docId__": 3200,
82676
+ "__docId__": 3202,
82621
82677
  "kind": "testIt",
82622
82678
  "name": "it208",
82623
82679
  "testId": 208,
@@ -82630,7 +82686,7 @@
82630
82686
  "lineNumber": 166
82631
82687
  },
82632
82688
  {
82633
- "__docId__": 3201,
82689
+ "__docId__": 3203,
82634
82690
  "kind": "testDescribe",
82635
82691
  "name": "describe209",
82636
82692
  "testId": 209,
@@ -82643,7 +82699,7 @@
82643
82699
  "lineNumber": 176
82644
82700
  },
82645
82701
  {
82646
- "__docId__": 3202,
82702
+ "__docId__": 3204,
82647
82703
  "kind": "testIt",
82648
82704
  "name": "it210",
82649
82705
  "testId": 210,
@@ -82656,7 +82712,7 @@
82656
82712
  "lineNumber": 183
82657
82713
  },
82658
82714
  {
82659
- "__docId__": 3203,
82715
+ "__docId__": 3205,
82660
82716
  "kind": "testDescribe",
82661
82717
  "name": "describe211",
82662
82718
  "testId": 211,
@@ -82669,7 +82725,7 @@
82669
82725
  "lineNumber": 199
82670
82726
  },
82671
82727
  {
82672
- "__docId__": 3204,
82728
+ "__docId__": 3206,
82673
82729
  "kind": "testIt",
82674
82730
  "name": "it212",
82675
82731
  "testId": 212,
@@ -82682,7 +82738,7 @@
82682
82738
  "lineNumber": 239
82683
82739
  },
82684
82740
  {
82685
- "__docId__": 3205,
82741
+ "__docId__": 3207,
82686
82742
  "kind": "testIt",
82687
82743
  "name": "it213",
82688
82744
  "testId": 213,
@@ -82695,7 +82751,7 @@
82695
82751
  "lineNumber": 253
82696
82752
  },
82697
82753
  {
82698
- "__docId__": 3206,
82754
+ "__docId__": 3208,
82699
82755
  "kind": "testFile",
82700
82756
  "name": "client/users/find.spec.js",
82701
82757
  "content": "/*define(function () {\r\n\tmocha.setup('bdd');\t\t\r\n describe('Testing user api 2', function() {\r\n \tit('search a user that exists', function() {\t \t\r\n\t\t return ogapi.users.addEmail('root@amplia.es').execute().then(function(user) {\r\n\t\t assert.strictEqual(user.email,'root@amplia.es');\r\n\t\t });\r\n\t\t}); \r\n });\r\n})\r\n*/",
@@ -82706,7 +82762,7 @@
82706
82762
  "lineNumber": 1
82707
82763
  },
82708
82764
  {
82709
- "__docId__": 3207,
82765
+ "__docId__": 3209,
82710
82766
  "kind": "testFile",
82711
82767
  "name": "client/users/user.spec.js",
82712
82768
  "content": "define(function () {\r\n mocha.setup('bdd');\r\n describe('Testing user api', function () {\r\n it('search a user that exists', function () {\r\n assert.strictEqual('root@amplia.es', 'root@amplia.es');\r\n });\r\n });\r\n\r\n describe('Create User:', function () {\r\n \r\n it('Create a user', function () {\r\n var user = ogapi.newUser();\r\n user.withName(\"Katherin\").withEmail(\"katherin.moscoso@amplia.es\")\r\n .withPassword(\"amplia123\").withWorkgroup(\"amplia_rd\").withDomain(\"amplia_rd\").withProfile(\"advanced\")\r\n .withCountryCode(\"ES\").withLangCode(\"en\").withDescription(\"user description\").withSurname(\"Moscoso\");\r\n assert.doesNotThrow(function () {\r\n user.create();\r\n });\r\n\r\n });\r\n\r\n });\r\n describe('Delete User:', function () {\r\n \r\n it('Delete a user', function () {\r\n var user = ogapi.newUser();\r\n user.withEmail(\"katherin.moscoso@amplia.es\");\r\n assert.doesNotThrow(function () {\r\n user.delete();\r\n });\r\n\r\n });\r\n\r\n });\r\n});",
@@ -82717,7 +82773,7 @@
82717
82773
  "lineNumber": 1
82718
82774
  },
82719
82775
  {
82720
- "__docId__": 3208,
82776
+ "__docId__": 3210,
82721
82777
  "kind": "testDescribe",
82722
82778
  "name": "describe214",
82723
82779
  "testId": 214,
@@ -82730,7 +82786,7 @@
82730
82786
  "lineNumber": 3
82731
82787
  },
82732
82788
  {
82733
- "__docId__": 3209,
82789
+ "__docId__": 3211,
82734
82790
  "kind": "testIt",
82735
82791
  "name": "it215",
82736
82792
  "testId": 215,
@@ -82743,7 +82799,7 @@
82743
82799
  "lineNumber": 4
82744
82800
  },
82745
82801
  {
82746
- "__docId__": 3210,
82802
+ "__docId__": 3212,
82747
82803
  "kind": "testDescribe",
82748
82804
  "name": "describe216",
82749
82805
  "testId": 216,
@@ -82756,7 +82812,7 @@
82756
82812
  "lineNumber": 9
82757
82813
  },
82758
82814
  {
82759
- "__docId__": 3211,
82815
+ "__docId__": 3213,
82760
82816
  "kind": "testIt",
82761
82817
  "name": "it217",
82762
82818
  "testId": 217,
@@ -82769,7 +82825,7 @@
82769
82825
  "lineNumber": 11
82770
82826
  },
82771
82827
  {
82772
- "__docId__": 3212,
82828
+ "__docId__": 3214,
82773
82829
  "kind": "testDescribe",
82774
82830
  "name": "describe218",
82775
82831
  "testId": 218,
@@ -82782,7 +82838,7 @@
82782
82838
  "lineNumber": 23
82783
82839
  },
82784
82840
  {
82785
- "__docId__": 3213,
82841
+ "__docId__": 3215,
82786
82842
  "kind": "testIt",
82787
82843
  "name": "it219",
82788
82844
  "testId": 219,