hull-client
Advanced tools
Comparing version 1.2.2 to 1.2.3
20
API.md
@@ -161,3 +161,3 @@ <!-- Generated by documentation.js. Update this documentation by updating the source code. --> | ||
Issues an `alias` event on user? | ||
Issues an `alias` event on user? or account? | ||
@@ -170,2 +170,12 @@ **Parameters** | ||
### unalias | ||
Issues an `unalias` event on user? or account? | ||
**Parameters** | ||
- `body` **[Object][1]** | ||
Returns **[Promise][13]** | ||
### account | ||
@@ -211,5 +221,5 @@ | ||
### put | ||
### del | ||
Performs a PUT HTTP request on selected url of Hull REST API (prefixed with `prefix` param of the constructor) | ||
Performs a DELETE HTTP request on selected url of Hull REST API (prefixed with `prefix` param of the constructor) | ||
@@ -224,5 +234,5 @@ **Parameters** | ||
### del | ||
### put | ||
Performs a DELETE HTTP request on selected url of Hull REST API (prefixed with `prefix` param of the constructor) | ||
Performs a PUT HTTP request on selected url of Hull REST API (prefixed with `prefix` param of the constructor) | ||
@@ -229,0 +239,0 @@ **Parameters** |
@@ -0,1 +1,4 @@ | ||
# 1.2.3 | ||
* Add support for unalias method | ||
# 1.2.2 | ||
@@ -2,0 +5,0 @@ * Allow anonymous_id in Account claims |
@@ -296,20 +296,32 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; | ||
// Allow alias only for users | ||
if (config.userClaim || config.accessToken) { | ||
/** | ||
* Issues an `alias` event on user? | ||
* @todo | ||
* @memberof ScopedHullClient | ||
* @public | ||
* @param {Object} body | ||
* @return {Promise} | ||
*/ | ||
this.alias = body => { | ||
return batch({ | ||
type: "alias", | ||
body | ||
}); | ||
}; | ||
} | ||
/** | ||
* Issues an `alias` event on user? or account? | ||
* @todo | ||
* @memberof ScopedHullClient | ||
* @public | ||
* @param {Object} body | ||
* @return {Promise} | ||
*/ | ||
this.alias = body => { | ||
return batch({ | ||
type: "alias", | ||
body | ||
}); | ||
}; | ||
/** | ||
* Issues an `unalias` event on user? or account? | ||
* @todo | ||
* @memberof ScopedHullClient | ||
* @public | ||
* @param {Object} body | ||
* @return {Promise} | ||
*/ | ||
this.unalias = body => { | ||
return batch({ | ||
type: "unalias", | ||
body | ||
}); | ||
}; | ||
if (config.userClaim) { | ||
@@ -316,0 +328,0 @@ /** |
{ | ||
"name": "hull-client", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "A barebones Node.js API client for hull.io", | ||
@@ -5,0 +5,0 @@ "main": "lib", |
@@ -14,16 +14,12 @@ /* global describe, it */ | ||
const scopedAccount = hull.asAccount({ domain: "hull.io" }); | ||
expect(scopedAccount).to.has.property("traits").that.is.an("function"); | ||
expect(scopedAccount).to.has.property("track").that.is.an("function"); | ||
expect(scopedAccount).to.have.property("alias").that.is.an("function"); | ||
expect(scopedAccount).to.have.property("unalias").that.is.an("function"); | ||
const scopedUser = hull.asUser("1234"); | ||
expect(scopedAccount).to.has.property("traits") | ||
.that.is.an("function"); | ||
expect(scopedAccount).to.has.property("track") | ||
.that.is.an("function"); | ||
expect(scopedAccount).not.to.have.property("alias"); | ||
expect(scopedUser).to.has.property("traits") | ||
.that.is.an("function"); | ||
expect(scopedUser).to.has.property("track") | ||
.that.is.an("function"); | ||
expect(scopedUser).to.has.property("alias") | ||
.that.is.an("function"); | ||
expect(scopedUser).to.has.property("traits").that.is.an("function"); | ||
expect(scopedUser).to.has.property("track").that.is.an("function"); | ||
expect(scopedUser).to.has.property("alias").that.is.an("function"); | ||
expect(scopedUser).to.has.property("unalias").that.is.an("function"); | ||
}); | ||
@@ -157,3 +153,3 @@ | ||
it("should filter all non standard claims", () => { | ||
it("should filter all non standard claims", () => { | ||
const hull = new Hull({ id: "562123b470df84b740000042", secret: "1234", organization: "test" }); | ||
@@ -160,0 +156,0 @@ |
Sorry, the diff of this file is not supported yet
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
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
315952
1565
0