Socket
Socket
Sign inDemoInstall

caymland-js

Package Overview
Dependencies
3
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.6 to 1.0.7

11

bin/playground.js
const Caymland = require('./../src/index')
const client = new Caymland({
baseUrl: 'https://local.caymland.app',
auth: {
username: 'nsaloski',
password: 'nerminsa'
}
auth: 'bnNhbG9za2k6bmVybWluc2E='
})

@@ -19,6 +16,8 @@

console.log('## list contacts')
const listContactsResponse = await client.contacts.list(encodeURI('limit=10&start=0&where[0][col]=date_identified&where[0][expr]=isNotNull&where[1][col]=owner_id&where[1][expr]=eq&where[1][val]=1'))
print(listContactsResponse);
const listContactsResponse = await client.contacts.list(encodeURI('search=Nermin'))
const listContactsResponse2 = await client.contacts.list({ search: 'Nermin' })
print(listContactsResponse.data.total)
print(listContactsResponse2.data.total)
}
run()
{
"name": "caymland-js",
"version": "1.0.6",
"version": "1.0.7",
"description": "Javascript library to the Caymland REST API - https://api.m-4.ch/#rest-api",

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

@@ -25,6 +25,6 @@ const axios = require('axios')

}) {
this.auth = auth
this.baseUrl = baseUrl
this.headers = {
'X-Requested-With': 'XMLHttpRequest',
'Authorization': 'Basic ' + auth
}

@@ -42,10 +42,17 @@ this.contacts = new Contact(this)

headers: this.headers,
auth: this.auth
}).then(responseWith).catch(responseErrWith)
}
list (resourceUri, params = '') {
return axios.get(`${this.baseUrl}/api/${resourceUri}?${params}`, {
list (resourceUri, params = {}) {
let stringParams = ''
let objectParams = {}
if (typeof (params) === 'object') {
objectParams = params
} else {
stringParams = '?' + params
}
return axios.get(`${this.baseUrl}/api/${resourceUri}${stringParams}`, {
params: objectParams,
headers: this.headers,
auth: this.auth
}).then(responseWith).catch(responseErrWith)

@@ -57,3 +64,2 @@ }

headers: this.headers,
auth: this.auth
}).then(responseWith).catch(responseErrWith)

@@ -65,3 +71,2 @@ }

headers: this.headers,
auth: this.auth
}).then(responseWith).catch(responseErrWith)

@@ -73,3 +78,2 @@ }

headers: this.headers,
auth: this.auth
}).then(responseWith).catch(responseErrWith)

@@ -81,3 +85,2 @@ }

headers: this.headers,
auth: this.auth
}).then(responseWith).catch(responseErrWith)

@@ -84,0 +87,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc