btrz-api-client
Advanced tools
Comparing version 1.41.0 to 1.42.0
@@ -98,2 +98,29 @@ "use strict"; | ||
function addUser(_ref8) { | ||
var token = _ref8.token, | ||
jwtToken = _ref8.jwtToken, | ||
manifestId = _ref8.manifestId, | ||
data = _ref8.data; | ||
return client({ | ||
url: "/manifests/" + manifestId + "/users", | ||
method: "post", | ||
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }), | ||
data: data | ||
}); | ||
} | ||
function removeUser(_ref9) { | ||
var token = _ref9.token, | ||
jwtToken = _ref9.jwtToken, | ||
manifestId = _ref9.manifestId, | ||
userId = _ref9.userId; | ||
return client({ | ||
url: "/manifests/" + manifestId + "/users/" + userId, | ||
method: "delete", | ||
headers: authorizationHeaders({ token: token, jwtToken: jwtToken, internalAuthTokenProvider: internalAuthTokenProvider }) | ||
}); | ||
} | ||
return { | ||
@@ -105,3 +132,5 @@ get: get, | ||
patch: patch, | ||
save: save | ||
save: save, | ||
addUser: addUser, | ||
removeUser: removeUser | ||
}; | ||
@@ -108,0 +137,0 @@ } |
{ | ||
"name": "btrz-api-client", | ||
"version": "1.41.0", | ||
"version": "1.42.0", | ||
"description": "Api client for Betterez endpoints", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -62,2 +62,19 @@ const { authorizationHeaders } = require("./../endpoints_helpers"); | ||
function addUser({ token, jwtToken, manifestId, data }) { | ||
return client({ | ||
url: `/manifests/${manifestId}/users`, | ||
method: "post", | ||
headers: authorizationHeaders({ token, jwtToken, internalAuthTokenProvider }), | ||
data | ||
}); | ||
} | ||
function removeUser({ token, jwtToken, manifestId, userId }) { | ||
return client({ | ||
url: `/manifests/${manifestId}/users/${userId}`, | ||
method: "delete", | ||
headers: authorizationHeaders({ token, jwtToken, internalAuthTokenProvider }) | ||
}); | ||
} | ||
return { | ||
@@ -69,3 +86,5 @@ get, | ||
patch, | ||
save | ||
save, | ||
addUser, | ||
removeUser | ||
}; | ||
@@ -72,0 +91,0 @@ } |
@@ -66,2 +66,21 @@ const { axiosMock, expectRequest } = require("./../../test-helpers"), | ||
}); | ||
it("should add user to the manifest", () => { | ||
const manifestId = "theId"; | ||
const data = { | ||
user: { | ||
userId: "theUserId" | ||
} | ||
}; | ||
axiosMock.onPost(`/manifests/${manifestId}/users`).reply(expectRequest({ statusCode: 201, token, jwtToken })); | ||
return api.operations.manifest.addUser({ token, jwtToken, manifestId, data }); | ||
}); | ||
it("should remove a user from manifest", () => { | ||
const manifestId = "theId"; | ||
const userId = "theUserId"; | ||
axiosMock.onDelete(`/manifests/${manifestId}/users/${userId}`).reply(expectRequest({ statusCode: 201, token, jwtToken })); | ||
return api.operations.manifest.removeUser({ token, jwtToken, manifestId, userId }); | ||
}); | ||
}); |
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
412605
11312
10