Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

btrz-api-client

Package Overview
Dependencies
Maintainers
1
Versions
268
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

btrz-api-client - npm Package Compare versions

Comparing version 1.41.0 to 1.42.0

31

lib/endpoints/operations/manifest.js

@@ -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 @@ }

2

package.json
{
"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 });
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc