// Lowercase all const lca = list => _(list).map(item => _.lowerCase(item)).value()
this._request(url, function (error, json) { if (error) return callback(error, json); let data = _.lowerCase(json.rsp.result) === 'true' ? true : false; return callback(error, data); });
var getCourseAttributeValue = function (name, value) { switch (_.get(COURSE_ATTRIBUTES, name)) { case "boolean": return _.lowerCase(value) === 'true' ? true : false; case "number": return _.toNumber(value); case "integer": return _.toInteger(value); // Value is a string by default. default: return value; } }
// // ---- ACL // _trimActions(actions) { return _.chain(actions) .map(_.lowerCase) .map(act => ACTION_ALIASES[act] || act) .filter(act => _.includes(ALLOWED_ACTIONS, act)) .uniq() .value(); }
this._request(url, { secretKey: this.managementKey }, function (error, json) { if (error) return callback(error, json); var data = { "appId": json.rsp.appInfo.application.appId, "name": json.rsp.appInfo.application.name, "allowDeleteAPI": _.lowerCase(json.rsp.appInfo.application.allowDeleteAPI) === 'true' ? true : false, "allowUpdateAPI": _.lowerCase(json.rsp.appInfo.application.allowUpdateAPI) === 'true' ? true : false, "createDate": json.rsp.appInfo.application.createDate, "secretKeys": [] } let secretKeys = toArray(json.rsp.appInfo.application.secretKeys.secretKey); secretKeys.forEach(function (secretKey) { data.secretKeys.push({ "id": secretKey.id, "key": secretKey.key, "pensKey": secretKey.pensKey, "description": secretKey.description, "active": _.lowerCase(secretKey.active) === 'true' ? true : false, "createDate": secretKey.createDate }); }); return callback(error, data); });
this._request(url, function (error, json) { if (error) return callback(error, json); let data = []; let invitationList = toArray(json.rsp.invitationlist.invitationInfo); invitationList.forEach(function (invitation) { data.push({ "id": invitation.id, "body": invitation.body, "courseId": invitation.courseId, "subject": invitation.subject, "url": invitation.url, "allowLaunch": _.lowerCase(invitation.allowLaunch) === 'true' ? true : false, "allowNewRegistrations": _.lowerCase(invitation.allowNewRegistrations) === 'true' ? true : false, "public": _.lowerCase(invitation.public) === 'true' ? true : false, "created": _.lowerCase(invitation.created) === 'true' ? true : false, "createdDate": invitation.createdDate }); }); return callback(error, data); });
this._request(url, function (error, json) { if (error) return callback(error, json); let data = { "id": json.rsp.launch.id, "completion": json.rsp.launch.completion, "satisfaction": json.rsp.launch.satisfaction, "measure_status": json.rsp.launch.measure_status, "normalized_measure": json.rsp.launch.normalized_measure, "experienced_duration_tracked": json.rsp.launch.experienced_duration_tracked, "launch_time": json.rsp.launch.launch_time, "exit_time": json.rsp.launch.exit_time, "update_dt": json.rsp.launch.update_dt, "log": { "browser": json.rsp.launch.log.RuntimeLog.browser, "trackingEnabled": _.lowerCase(json.rsp.launch.log.RuntimeLog.trackingEnabled) === 'true' ? true : false, "version": json.rsp.launch.log.RuntimeLog.version, "events": json.rsp.launch.log.RuntimeLog.RuntimeEvent } }; return callback(error, data); });
this._request(url, function (error, json) { if (error) return callback(error, json); let data = { "email": json.rsp.account.email, "firstname": json.rsp.account.firstname, "lastname": json.rsp.account.lastname, "company": json.rsp.account.company, "accounttype": json.rsp.account.accounttype, "reglimit": _.toInteger(json.rsp.account.reglimit), "strictlimit": _.lowerCase(json.rsp.account.strictlimit) === 'true' ? true : false, "createdate": json.rsp.account.createdate, "usage": { "monthstart": json.rsp.account.usage.monthstart, "regcount": _.toInteger(json.rsp.account.usage.regcount), "totalregistrations": _.toInteger(json.rsp.account.usage.totalregistrations), "totalcourses": _.toInteger(json.rsp.account.usage.totalcourses) } } return callback(error, data); });
// Lowercase all const lca = list => _(list).map(item => _.lowerCase(item)).value()
this._request(url, function (error, json) { if (error) return callback(error, json); let data = _.lowerCase(json.rsp.result) === 'true' ? true : false; return callback(error, data); });
this._request(url, { secretKey: this.managementKey }, function (error, json) { if (error) return callback(error, json); var data = { "appId": json.rsp.appInfo.application.appId, "name": json.rsp.appInfo.application.name, "allowDeleteAPI": _.lowerCase(json.rsp.appInfo.application.allowDeleteAPI) === 'true' ? true : false, "allowUpdateAPI": _.lowerCase(json.rsp.appInfo.application.allowUpdateAPI) === 'true' ? true : false, "createDate": json.rsp.appInfo.application.createDate, "secretKeys": [] } let secretKeys = toArray(json.rsp.appInfo.application.secretKeys.secretKey); secretKeys.forEach(function (secretKey) { data.secretKeys.push({ "id": secretKey.id, "key": secretKey.key, "pensKey": secretKey.pensKey, "description": secretKey.description, "active": _.lowerCase(secretKey.active) === 'true' ? true : false, "createDate": secretKey.createDate }); }); return callback(error, data); });
this._request(url, { secretKey: this.managementKey }, function (error, json) { if (error) return callback(error, json); var data = { "appId": json.rsp.appInfo.application.appId, "name": json.rsp.appInfo.application.name, "allowDeleteAPI": _.lowerCase(json.rsp.appInfo.application.allowDeleteAPI) === 'true' ? true : false, "allowUpdateAPI": _.lowerCase(json.rsp.appInfo.application.allowUpdateAPI) === 'true' ? true : false, "createDate": json.rsp.appInfo.application.createDate, "secretKeys": [] } let secretKeys = toArray(json.rsp.appInfo.application.secretKeys.secretKey); secretKeys.forEach(function (secretKey) { data.secretKeys.push({ "id": secretKey.id, "key": secretKey.key, "pensKey": secretKey.pensKey, "description": secretKey.description, "active": _.lowerCase(secretKey.active) === 'true' ? true : false, "createDate": secretKey.createDate }); }); return callback(error, data); });
this._request(url, { secretKey: this.managementKey }, function (error, json) { if (error) return callback(error, json); var data = { "appId": json.rsp.appInfo.application.appId, "name": json.rsp.appInfo.application.name, "allowDeleteAPI": _.lowerCase(json.rsp.appInfo.application.allowDeleteAPI) === 'true' ? true : false, "allowUpdateAPI": _.lowerCase(json.rsp.appInfo.application.allowUpdateAPI) === 'true' ? true : false, "createDate": json.rsp.appInfo.application.createDate, "secretKeys": [] } let secretKeys = toArray(json.rsp.appInfo.application.secretKeys.secretKey); secretKeys.forEach(function (secretKey) { data.secretKeys.push({ "id": secretKey.id, "key": secretKey.key, "pensKey": secretKey.pensKey, "description": secretKey.description, "active": _.lowerCase(secretKey.active) === 'true' ? true : false, "createDate": secretKey.createDate }); }); return callback(error, data); });
this._request(url, { secretKey: this.managementKey }, function (error, json) { if (error) return callback(error, json); var data = { "appId": json.rsp.appInfo.application.appId, "name": json.rsp.appInfo.application.name, "allowDeleteAPI": _.lowerCase(json.rsp.appInfo.application.allowDeleteAPI) === 'true' ? true : false, "allowUpdateAPI": _.lowerCase(json.rsp.appInfo.application.allowUpdateAPI) === 'true' ? true : false, "createDate": json.rsp.appInfo.application.createDate, "secretKeys": [] } let secretKeys = toArray(json.rsp.appInfo.application.secretKeys.secretKey); secretKeys.forEach(function (secretKey) { data.secretKeys.push({ "id": secretKey.id, "key": secretKey.key, "pensKey": secretKey.pensKey, "description": secretKey.description, "active": _.lowerCase(secretKey.active) === 'true' ? true : false, "createDate": secretKey.createDate }); }); return callback(error, data); });