New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cbs-proxy-client

Package Overview
Dependencies
Maintainers
5
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cbs-proxy-client - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

36

lib/index.js

@@ -12,2 +12,3 @@ const fetch = require('node-fetch')

}
const getAuthUri = baseUrl => baseUrl + '/cbs/getAuth'

@@ -21,2 +22,3 @@ const getAuthOptions = (username, password) => ({

})
const getPrimaryAccountIdUri = baseUrl => baseUrl + '/cbs/getPrimaryAccountId'

@@ -29,2 +31,11 @@ const getPrimaryAccountIdOption = sessionToken => ({

})
const getUserIdUri = baseUrl => baseUrl + '/cbs/getUserId'
const getUserIdOption = sessionToken => ({
...fetchOptionsTemplate,
body: JSON.stringify({
sessionToken
})
})
const transfersUri = baseUrl => baseUrl + '/cbs/transfers'

@@ -39,2 +50,3 @@ const transfersOption = (sessionToken, accountId, queryParameters) => ({

})
const makeTransferToPrimaryAccountUri = baseUrl => baseUrl + '/cbs/transferToAdminPrimaryAccount'

@@ -46,2 +58,3 @@ const makeTransferFromPrimaryAccountUri = baseUrl => baseUrl + '/cbs/transferFromAdminPrimaryAccount'

})
const getAccountDetailsUri = baseUrl => baseUrl + '/cbs/accountSummary'

@@ -54,3 +67,3 @@ const getAccountDetailsOption = (queryParameters) => ({

// NOTE: I chose to use a functor like constructor with closures rather than classes because I don't like needing to call `new`
const createTokenProxy = async (username, password, url) => {
const createCbsProxy = async (username, password, url) => {
const sessionToken = (

@@ -70,2 +83,9 @@ await fetchJson(

const userId = (
await fetchJson(
getUserIdUri(url),
getUserIdOption(sessionToken)
)
).userId
const getTransfersToPrimaryAccount = async (fromTime) => {

@@ -80,2 +100,3 @@ const transfers = (

}
const getTransfersFromPrimaryAccount = async (fromTime) => {

@@ -90,2 +111,3 @@ const transfers = (

}
const makeTransferToAdminPrimaryAccount = async (amount, message) => {

@@ -100,2 +122,3 @@ const transferResult = (

}
const makeTransferFromAdminPrimaryAccount = async (amount, message, accountId) => {

@@ -110,2 +133,3 @@ const transferResult = (

}
// TODO:: could add time based filtering in the future

@@ -122,2 +146,6 @@ const getAccountDetails = async () => {

const getPrimaryAccountId = () => primaryAccountId
const getUserId = () => userId
return {

@@ -128,6 +156,8 @@ getTransfersToPrimaryAccount,

makeTransferFromAdminPrimaryAccount,
getAccountDetails
getAccountDetails,
getPrimaryAccountId,
getUserId
}
}
module.exports = createTokenProxy
module.exports = createCbsProxy

2

package.json
{
"name": "cbs-proxy-client",
"version": "0.0.5",
"version": "0.0.6",
"description": "Client that creates functions for the cbs-proxy.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -63,3 +63,2 @@ const {

})
})

@@ -112,2 +111,12 @@

})
it("should return the same `primaryAccountId` as the `getPrimaryAccountId` function", async () => {
userAccountSummary = await user1ProxyClient.getAccountDetails()
const primaryAccountId = user1ProxyClient.getPrimaryAccountId()
expect(
userAccountSummary.id
).to.be.equal(
primaryAccountId
)
})
})

@@ -114,0 +123,0 @@ describe('makeTransferFromAdminPrimaryAccount', () => {

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