amido-profile-service
Advanced tools
Comparing version 1.0.0 to 1.0.2
70
index.js
@@ -10,2 +10,10 @@ var EventEmitter = require('events').EventEmitter, | ||
/** | ||
* Instantiate an instance of the profile service SDK | ||
* @param config | ||
* @property {string} subscriptionKey | ||
* @return {AmidoProfileService} | ||
* @constructor | ||
*/ | ||
function AmidoProfileService(config) { | ||
@@ -24,15 +32,4 @@ if (!(this instanceof AmidoProfileService)) { | ||
if (typeof config.zumoApplication !== 'string') { | ||
throw new Error('The `zumoApplication` attribute must be supplied'); | ||
} | ||
if (typeof config.realm !== 'string') { | ||
throw new Error('The `realm` attribute must be supplied'); | ||
} | ||
this.zumoApplication = config.zumoApplication; | ||
this.subscriptionKey = config.subscriptionKey; | ||
this.urls = new Urls(config.subscriptionKey); | ||
this.realm = config.realm; | ||
@@ -54,3 +51,11 @@ this.api = new Api(config.subscriptionKey); | ||
AmidoProfileService.prototype.createProfile = function (user_id, realm, delegateToken, profile) { | ||
/** | ||
* Create a profile for an existing user within the specified realm | ||
* @param userId - the user's ID | ||
* @param realm - the realm to create the profile | ||
* @param delegateToken - the user's access token to authorize with the API | ||
* @param profile - the JSON profile to save | ||
* @return {Promise} - resolved with the profile if successful. | ||
*/ | ||
AmidoProfileService.prototype.createProfile = function (userId, realm, delegateToken, profile) { | ||
var deferred = Q.defer(); | ||
@@ -69,3 +74,11 @@ | ||
AmidoProfileService.prototype.updateProfile = function (user_id, realm, delegateToken, profile) { | ||
/** | ||
* Update the profile of an existing user within the specified realm | ||
* @param userId - the user's ID | ||
* @param realm - the realm to create the profile | ||
* @param delegateToken - the user's access token to authorize with the API | ||
* @param profile - the JSON profile to save | ||
* @return {Promise} - resolved with the profile if successful. | ||
*/ | ||
AmidoProfileService.prototype.updateProfile = function (userId, realm, delegateToken, profile) { | ||
var deferred = Q.defer(); | ||
@@ -89,3 +102,3 @@ | ||
* @param {string} screenName - name of fieldset to load | ||
* @returns {Promise} - | ||
* @returns {Promise} - Resolved with the fieldset | ||
* @public | ||
@@ -108,2 +121,9 @@ */ | ||
/** | ||
* Get a user's profile for a specific schema | ||
* @param userId - the user's ID | ||
* @param realm - the realm to create the profile | ||
* @param delegateToken - the user's access token to authorize with the API | ||
* @return {Promise} - resolved with the user's profile | ||
*/ | ||
AmidoProfileService.prototype.getProfile = function (userId, realm, delegateToken) { | ||
@@ -124,2 +144,9 @@ var deferred = Q.defer(); | ||
/** | ||
* Return a user's nested profile. If a user's profile has a parent profile, will also be returned. | ||
* @param userId - the user's ID | ||
* @param realm - the realm to create the profile | ||
* @param delegateToken - the user's access token to authorize with the API | ||
* @return {Promise} - resolved with the user's nested profile | ||
*/ | ||
AmidoProfileService.prototype.getNestedProfile = function (userId, realm, delegateToken) { | ||
@@ -140,2 +167,8 @@ var deferred = Q.defer(); | ||
/** | ||
* Update a user's profile for their identity provider, defined by the identityProvider set in the constructor (if provided) | ||
* @param userId - the user's ID | ||
* @param profile - the profile to update | ||
* @return {Promise} - resolved with the profile if successful | ||
*/ | ||
AmidoProfileService.prototype.updateIdentityUser = function(userId, profile) { | ||
@@ -145,8 +178,9 @@ return this.identityProvider.updateUser(userId, profile); | ||
/** | ||
* Create a new user profile with their identity provider, defined by the identityProvider set in the constructor (if provided) | ||
* @param profile - the profile to save | ||
* @return {Promise} - resolved with the profile if successful | ||
*/ | ||
AmidoProfileService.prototype.createIdentityUser = function(profile) { | ||
return this.identityProvider.createUser(profile); | ||
}; | ||
AmidoProfileService.prototype.getSignupUrl = function () { | ||
return this.urls.getSignupUrl(); | ||
}; |
{ | ||
"name": "amido-profile-service", | ||
"version": "1.0.0", | ||
"version": "1.0.2", | ||
"description": "Amido Profile Service JavaScript SDK", | ||
@@ -25,3 +25,4 @@ "main": "./index.js", | ||
"jquery": "~2.1.1", | ||
"through": "~2.3.4" | ||
"through": "~2.3.4", | ||
"q": "~1.0.1" | ||
}, | ||
@@ -62,5 +63,5 @@ "devDependencies": { | ||
"browserify-shim": { | ||
"jquery": "global:jQuery", | ||
"auth0-lock": "global:Auth0Lock" | ||
"jquery": "global:jQuery", | ||
"auth0-lock": "global:Auth0Lock" | ||
} | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
147409
33
1674
1
18
5
1
1