{"_id":"@555platform/author-js-sdk","_rev":"3-936df631c400e76896ba8a435c86f772","name":"@555platform/author-js-sdk","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.3":{"name":"@555platform/author-js-sdk","version":"1.0.3","keywords":["555","authentication","oauth"],"author":{"name":"NijagunaMurthy"},"license":"MIT","_id":"@555platform/author-js-sdk@1.0.3","maintainers":[{"name":"dipenvshah","email":"dipenvshah@gmail.com"},{"name":"nija","email":"nijagunared@gmail.com"}],"homepage":"https://github.comcast.com/555-platform/author-js-sdk","dist":{"shasum":"4b2a84e4aff87806a623434019e4bd233e8da8b2","tarball":"https://registry.npmjs.org/@555platform/author-js-sdk/-/author-js-sdk-1.0.3.tgz","fileCount":13,"integrity":"sha512-RXQJSrGZ7zd3QLhIUijoVJhjCdI3UvFlWe/NEm5KaqqcDrZ8jS7r0YR5bSP5I61ckUzlZ4xxt0MKPoxaYLedrA==","signatures":[{"sig":"MEUCIQCNyADhLWALYeP0c5QS18Kc/cTKbnqaGtRL6Un5wDorugIgZyZy87o77fF9kU9N47MTl3L2Y3gocKF7n+iT9V6NZ48=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1603097,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEQYNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqT4A/+Jjf7u6PhLyvB4STrCoQqh2LLtR9P5QiZY1TTe0Jhjc5D8Q0y\r\npcXHN+QaK+Xp5KCsod3DyVPcLv7siZmBYdsl6IwF0azVP4IZ6aJ37cTuaamG\r\nKTZeIhF1gO7l5EHumZjkzkYD3/bE3AjImvJV4cv9lZl+zLNkhJ+xspsF5zrp\r\necnol9H2w2JE0ML98fLMCntxJAkU6YmDxQwFOE1e5geZiH8YLcgmVhRe5TF4\r\nQvXZTw7hw/zznTWqL3cSnTQapCaNQmZn7mP5+g5gfiM2cGUSyXZghckBHL/a\r\n8ijWFPN3/1/D5wG+GhYMXKBNFQ45IJI+9niaHag/vv03DWKSzs86FgJxVRpb\r\nUqvHFCiJHeVBzTOK1wnYQIiakwhvXEJF8uEsF8EK8ACeYT+9NTnydG9bccAH\r\n4PlS1vPiY67jmFJRaNDv0rcIvT2O70hgxse/D9IqbswcrPDSkQLA7wjqePWE\r\nVEbzYjGTo5C/WcQuBUhhyHWaoPduZMNua24AKufnsSpwVRd3RBc8dFsh4i4r\r\nbMVN4ZAjZL+ZyPS7jPBLVR+0ei731lWVmbK3xrvnGAcPC41UzSPj714JvTlJ\r\nUxHruMYh6NneL6lDuoytKxJe7WPSKSgPcr66qFWrodrh5Lo2QM2mUOTRfY1S\r\nHfL6TNY8JQlo5xo1RA8SSMKgY3pGWx4toXk=\r\n=Rt4i\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","babel":{"presets":["@babel/preset-env"]},"gitHead":"a99aab5ac41217d2855a5e51e5548c9b9132acee","scripts":{"test":"mocha --timeout 4000 --require @babel/register src/index.test.js","build":"npm-run-all --parallel build:*","prebuild":"rimraf dist","build:umd":"webpack --output-filename aum.555.js","build:main":"babel --copy-files --out-dir dist src","build:umd.min":"webpack --output-filename aum.555.min.js"},"_npmUser":{"name":"nija","email":"nijagunared@gmail.com"},"repository":{"url":"git@github.comcast.com:555-platform/author-js-sdk.git","type":"git"},"_npmVersion":"6.14.12","description":"JS SDK for 555 Auth Manager","directories":{},"_nodeVersion":"14.16.1","dependencies":{"jws":"^4.0.0","uuid":"^3.1.0","buffer":"^6.0.3","isomorphic-fetch":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.6","path":"^0.12.7","mocha":"^10.0.0","rimraf":"2.5.3","webpack":"^5.74.0","@babel/cli":"^7.18.10","@babel/core":"^7.18.13","json-loader":"0.5.4","npm-run-all":"2.3.0","webpack-cli":"^4.10.0","babel-loader":"^8.2.5","@babel/register":"^7.18.9","@babel/preset-env":"^7.18.10","mocha-junit-reporter":"^1.11.1","@babel/preset-stage-2":"^7.8.3"},"_npmOperationalInternal":{"tmp":"tmp/author-js-sdk_1.0.3_1662060044862_0.8894846295591956","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@555platform/author-js-sdk","version":"1.0.4","keywords":["555","authentication","oauth"],"author":{"name":"NijagunaMurthy"},"license":"MIT","_id":"@555platform/author-js-sdk@1.0.4","maintainers":[{"name":"dipenvshah","email":"dipenvshah@gmail.com"},{"name":"nija","email":"nijagunared@gmail.com"}],"homepage":"https://github.comcast.com/555-platform/author-js-sdk","dist":{"shasum":"2a0561699d12707deeccf0c4d626e1ba9b9f5e4a","tarball":"https://registry.npmjs.org/@555platform/author-js-sdk/-/author-js-sdk-1.0.4.tgz","fileCount":13,"integrity":"sha512-FcAugzJjsflUmJbXJj1xzyAZvaChhgvDGhA5vjTsS72JCK5B43mwjTcw3Ci1RLEyJRAeCI6kYI7wC2RQwICoxg==","signatures":[{"sig":"MEUCIFV5uRQoYmjV/ofCshTvIs0NitSwEACgP6IJIA9KGoThAiEAovHv+WW96xWUYIObdQEILRibQ3HHNJFadmoIBfPfAk0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1604821,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjK1ZOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqvThAAknolIDV0qaron1Bz4Xn/Xpuk+g3ABWE9dgTWYhqi9jJW4dVM\r\n+XfkVkPbUdD+yb0qsp5Z5sXHb6jHS74Y2CR12eX4b936b6q9IEwqwdJVMlTI\r\nvqkP0nLjNtcbNY/qZq9Ege+S64ElZTc6S4eeu38vuPWMsDiInhFy2fBWcymv\r\ni7DJnHpnE5EyFF7m0+fycjIRKJ3p+KWWrnaDwVnmCtNcCHVq2Vhq6xlIKMcu\r\nbgh5GdSNthoKYCSBRSg9QUMv3RBnIXVXCx+mqGAK4TAVH0aX9xrH4puW4f39\r\n91BBnd+MZLq66nH/k5k4llmILy62YjWsNQ6MbM/jsgDPLDOuJCN+h9/fAeZc\r\nYk9GGs2Tntqx5xBdui+o+TAOhj3gp4n1ZmaPtd5zEousFOKZQAUnc1gizWib\r\nKWbN0g62S1t9rlexq9mmPNa5DSZm/8PvIawakL9E7NJBDgdPwTGExpy+YiOc\r\ngfalbTmlxwArOqWVU+Nqxfmxk1caPFOO0wOSIfi4dmi4gJDUhOQ59bCwyLAH\r\nFj2wnGJyO+aVEW0CdY8B1fQnc68jbyPTU7yzMe0xN7SzGs1tV2vEK/MjIT06\r\nawBugytcCeSFnCeQab+3aR/xlefWyd6oLO3G/NHgTYaQgyKcXshzvEKU+6MD\r\nvzRnd45Yhug/+8jcfdUWXYoEoqhkGKYheio=\r\n=F9Ku\r\n-----END PGP SIGNATURE-----\r\n"},"main":"dist/index.js","babel":{"presets":["@babel/preset-env"]},"gitHead":"8bafb902e16c21e3b3022a58dba7dc7e07623fda","scripts":{"test":"mocha --timeout 4000 --require @babel/register src/index.test.js","build":"npm-run-all --parallel build:*","prebuild":"rimraf dist","build:umd":"webpack --output-filename aum.555.js","build:main":"babel --copy-files --out-dir dist src","build:umd.min":"webpack --output-filename aum.555.min.js"},"_npmUser":{"name":"nija","email":"nijagunared@gmail.com"},"repository":{"url":"git@github.comcast.com:555-platform/author-js-sdk.git","type":"git"},"_npmVersion":"6.14.12","description":"JS SDK for 555 Auth Manager","directories":{},"_nodeVersion":"14.16.1","dependencies":{"jws":"^4.0.0","buffer":"^6.0.3","isomorphic-fetch":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"chai":"^4.3.6","path":"^0.12.7","uuid":"^9.0.0","mocha":"^10.0.0","rimraf":"2.5.3","webpack":"^5.74.0","@babel/cli":"^7.18.10","@babel/core":"^7.18.13","json-loader":"0.5.4","npm-run-all":"2.3.0","webpack-cli":"^4.10.0","babel-loader":"^8.2.5","@babel/register":"^7.18.9","@babel/preset-env":"^7.18.10","mocha-junit-reporter":"^1.11.1","@babel/preset-stage-2":"^7.8.3"},"_npmOperationalInternal":{"tmp":"tmp/author-js-sdk_1.0.4_1663784525928_0.43763784393188687","host":"s3://npm-registry-packages"}}},"time":{"created":"2022-09-01T19:20:44.807Z","modified":"2024-09-16T22:07:55.854Z","1.0.3":"2022-09-01T19:20:45.212Z","1.0.4":"2022-09-21T18:22:06.096Z"},"author":{"name":"NijagunaMurthy"},"license":"MIT","homepage":"https://github.comcast.com/555-platform/author-js-sdk","keywords":["555","authentication","oauth"],"repository":{"url":"git@github.comcast.com:555-platform/author-js-sdk.git","type":"git"},"description":"JS SDK for 555 Auth Manager","maintainers":[{"email":"nijagunamurthy_chandrashekarappa@comcast.com","name":"nijacomcast"},{"email":"nijagunared@gmail.com","name":"nija"}],"readme":"# Author JS SDK\n\n## Introduction\nThis section describes JavaScript SDK for 555 Auth Manager.  Package can be installed with\n\n```\nnpm i @555platform/author-js-sdk\n```\n\n## Registration – Social Media, Cima, SSO, or PingID\nThis API requires valid Facebook, Google, Cima, PingID access token.  The API will exchange the given access token for 555 JWT token.  The registration API validates provided token and uses the user information to create 555 user and returns JWT token that then can be used to access all other 555 platform APIs.\n\n```\nmediaRegister(type, mediaToken, successCallback, errorCallback)\n\n\ntype – LOGIN_TYPE_FACEBOOK, LOGIN_TYPE_GOOGLEPLUS, LOGIN_TYPE_PINGID, LOGIN_TYPE_SSO, LOGIN_TYPE_CIMA\nmediaToken – token\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nmediaRegisterAsync(type, mediaToken)\n\n\ntype – LOGIN_TYPE_FACEBOOK, LOGIN_TYPE_GOOGLEPLUS, LOGIN_TYPE_PINGID, LOGIN_TYPE_SSO, LOGIN_TYPE_CIMA\nmediaToken – token\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\nTo get constants import them like this:\n```\nimport {\n  LOGIN_TYPE_FACEBOOK,\n  LOGIN_TYPE_GOOGLEPLUS,\n  LOGIN_TYPE_PINGID,\n  LOGIN_TYPE_SSO,\n  LOGIN_TYPE_CIMA\n} from 'author-js-sdk';\n```\n\n## Registration – Email\nRegister using email.\n\n```\nemailRegister(username, email, password, successCallback, errorCallback)\n\nusername – user name like first name and last name with optional middle name\nemail – user’s email\npassword – user’s password\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nemailRegisterAsync(username, email, password)\n\nusername – user name like first name and last name with optional middle name\nemail – user’s email\npassword – user’s password\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\n## Registration – Device\nRegister using device unique id.\n\n```\nemailRegister(typeId, successCallback, errorCallback)\n\ntypeId - device uunique id\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nemailRegisterAsync(typeId)\n\ntypeId - device uunique id\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\n## Get User Information\nThis API allows to get user information associated with JWT token.  This API\ncan be used with any 555 token accept the ones obtained with anonymous login.\n\n```\nuserInformation(token, successCallback, errorCallback)\n\ntoken – 555 JWT access token\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nuserInformationAsync(token)\n\ntoken – 555 JWT access token\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\n## Validate Access Token\nThis API will validate if the token is valid.  This API\ncan be used with any 555 token accept the ones obtained with anonymous login.\n\n```\nvalidateUserAccessToken(token, successCallback, errorCallback)\n\ntoken – 555 JWT access token\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nvalidateUserAccessTokenAsync(token)\n\ntoken – 555 JWT access token\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\nReturns if the token is valid or not.\n\n## Login - Social Media, SSO, Cima or PingID\nLogin using social media, SSO, Cima or PingID.\n\n```\nmediaLogin(type, mediaToken, successToken, errorCallback)\n\ntype – LOGIN_TYPE_FACEBOOK, LOGIN_TYPE_GOOGLEPLUS, LOGIN_TYPE_PINGID, LOGIN_TYPE_SSO, LOGIN_TYPE_CIMA\nmediaToken – token\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nmediaLoginAsync(type, mediaToken)\n\ntype – LOGIN_TYPE_FACEBOOK, LOGIN_TYPE_GOOGLEPLUS, LOGIN_TYPE_PINGID, LOGIN_TYPE_SSO, LOGIN_TYPE_CIMA\nmediaToken – token\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\nReturns 555 JWT access token.\n\n## Email Login\nLogin using email.\n\n```\nemailLogin(email, password, successCallback, errorCallback)\n\nemail – user’s email\npassword – user’s password\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nemailLoginAsync(email, password)\n\nemail – user’s email\npassword – user’s password\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\nReturns 555 JWT access token.\n\n## Email Account Password Change\nChange password for email based user account.\n\n```\nemailAccountPasswordChange(token, email, currentPassword, newPassword, successCallback, errorCallback)\n\ntoken – bearer token, it can be client or server\nemail – user’s email\ncurrentPassword – user’s current password\nnewPassword – user’s new password\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nemailAccountPasswordChangeAsync(token, email, currentPassword, newPassword)\n\ntoken – bearer token, it can be client or server\nemail – user’s email\ncurrentPassword – user’s current password\nnewPassword – user’s new password\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\n## Device Login\nLogin using device unique id.\n\n```\ndeviceLogin(typeId, successCallback, errorCallback)\n\ntypeId - device uunique id\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\ndeviceLoginAsync(typeId, successCallback, errorCallback)\n\ntypeId - device uunique id\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\nReturns 555 JWT access token.\n\n## Server Login\nGet server to server JWT\n\n```\nserverLogin(successCallback, errorCallback)\n\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\ndeviceLoginAsync(successCallback, errorCallback)\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\nReturns 555 server to server JWT access token.\n\n## Anonymous Login\nThis API allows anonymous login.  This is useful if applications that do not require concept of user.\n\n```\nanonymousLogin(userID, successCallback, errorCallback)\n\nuserID – optional string with user name or id.  It can be empty.\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nanonymousLoginAsync(userID)\n\nuserID – optional string with user name or id.  It can be empty.\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\n\nReturns 555 JWT access token.\n\n## Logout\nLogout API takes valid 555 JWT and adds it to blacklist so it cannot be used further to access 555 platform.\n\n```\nlogout(token, successCallback, errorCallback)\n\ntoken – 555 JWT token\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n```\nlogoutAsync(token)\n\ntoken – 555 JWT token\n\nReturns promise that returns JSON payload on success and error on failure.\n```\n\n## Decode 555 JWT\nThis API will return object with decoded JWT’s header, claims and signature.\n\n```\ndecodeToken(token)\n\ntoken – valid 555 JWT token\n```\n\n## Following APIs are only available in v1.1\n### Refresh Token\nAPIs to retrieve new token with refresh token.\n\n```\nrefreshTokenAsync(refreshToken)\n\nrefreshToken - refresh token\n```\n\n```\nrefreshToken(refreshToken, successCallback, errorCallback)\n\nrefreshToken - refresh token\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n### Revoke Refresh Token\nRevoke specified refresh token\n\n```\nrevokeRefreshTokenAsync(refreshToken)\n\nrefreshToken - refresh token\n```\n\n```\nrevokeRefreshToken(refreshToken, successCallback, errorCallback)\n\nrefreshToken - refresh token\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n### Update User Profile\nThis API allows for attaching profile to specified user.  Profile can be arbitrary\nJSON object.\n\n```\nupdateUserProfileAsync(token, userID, profileObject)\n\ntoken - server to server token\nuserID - user id\nprofileObject - JSON object with profile data\n```\n\n```\nupdateUserProfile(token, userID, profileObject, successCallback, errorCallback)\n\ntoken - server to server token\nuserID - user id\nprofileObject - JSON object with profile data\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n### Query users based on their profile data\nFind users based on query of profile data.  For example,\n\n```\nconst queryObject = {\n  'user_name': newUserName,\n}\n```\nwill search for user whose profile contains user_name equal to newUserName\n\n```\nqueryUserProfileAsync(token, queryObject, isMatch, start, limit)\n\ntoken - server to server token\nqueryObject - JSON object with query\nisMatch - true to match field with value exactly, false will search for value contained in the field\nstart - pagination start index\nlimit - pagination count of entries returned\n```\n\n```\nqueryUserProfile(token, queryObject, isMatch, start, limit, successCallback, errorCallback)\n\ntoken - server to server token\nqueryObject - JSON object with query\nisMatch - true to match field with value exactly, false will search for value contained in the field\nstart - pagination start index\nlimit - pagination count of entries returned\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n### Delete User\nDelete user with given user_id\n\n```\ndeleteUserAsync(token, userID)\n\ntoken - server to server token\nuserID - user id\n```\n\n```\ndeleteUser(token, userID, successCallback, errorCallback)\n\ntoken - server to server token\nuserID - user id\nsuccessCallback – when API succeeds this callback will receive JSON response.\nfailureCallback – in case of failure error information will be passed into this callback.\n```\n\n# Example\nAfter you npm i @555platform/author-js-sdk you can test it out with the following code:\n\n```\nlet Auth = require(\"@555platform/author-js-sdk\")\nlet authMgr = Auth.AuthManagerFactory({\"authMgrApiUrl\": \"<555 auth manager url>\", \"apiVersion\": \"v1.1\", \"appkey\": \"<your app key>\", \"appsecret\": \"<your app secret\"})\nauthMgr.anonymousLogin(\"Some Name\")\n.then(data => console.log(data))\n.catch(error => console.log(error))\n```\n\n\n# THIS REPO IS IMPORTTED FROM https://github.com/555platform/iris-aum-js-sdk\n\n## https://www.npmjs.com/package/@iris-platform/iris-aum-js-sdk USED in IRIS-DOCUMENT-STORE as npm package.\n","readmeFilename":"README.md"}