Socket
Socket
Sign inDemoInstall

@passioncloud/navclient

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@passioncloud/navclient - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

2

package.json
{
"name": "@passioncloud/navclient",
"version": "1.0.6",
"version": "1.0.7",
"main": "src/index.js",

@@ -5,0 +5,0 @@ "scripts": {

@@ -35,6 +35,33 @@ const NavClient = require('./nav-client.js');

const result = await this.axios(config);
// const result = await this.axios.post('http://www.google.com'); //(config);
return result.data;
let { data } = result;
// handle paged data
let odataNextLink = data['odata.nextLink']
while(odataNextLink && data.value?.length) {
odataNextLink += '&$format=json'
const nextConfig = { ...config, url: odataNextLink }
const nextResult = await this.axios(nextConfig)
const nextData = nextResult.data
const newOdataNextLink = nextData['odata.nextLink'] + '&$format=json'
console.log({
odataNextLink, newOdataNextLink, same: odataNextLink === newOdataNextLink
})
const odataNextLinkSearchParams = new URLSearchParams(odataNextLink)
const newOdataNextLinkSearchParams = new URLSearchParams(newOdataNextLink)
const currentSkipToken = odataNextLinkSearchParams.get('$skiptoken')
const newSkipToken = newOdataNextLinkSearchParams.get('$skiptoken')
// console.log({ odataNextLinkSearchParams, newOdataNextLinkSearchParams, currentSkipToken, newSkipToken })
if(currentSkipToken === newSkipToken) {
// if its the same link as the old one, break, do not go repeat the loop
// console.log('same')
break;
}
odataNextLink = nextData['odata.nextLink']
data["odata.nextLink"] = odataNextLink
data.value.push(...nextData.value)
// console.log({ data })
}
return data;
}
catch (error) {
console.log({ e: error })
const odataError = error.response?.data && JSON.stringify(error.response.data)

@@ -49,2 +76,3 @@ let specificOdataError = error.response?.data;

}
console.log({ msg })
throw new Error(msg);

@@ -51,0 +79,0 @@ }

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