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

rubik-pact

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rubik-pact - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

17

classes/Pact.js
const { Kubik } = require('rubik-main');
const FormData = require('form-data');
const fetch = require('node-fetch');

@@ -6,3 +7,2 @@ const set = require('lodash/set');

const get = require('lodash/get');
const querystring = require('querystring');

@@ -69,3 +69,2 @@ const methods = require('./Pact/methods');

const url = this.getUrl({ path, params, host });
let method = 'GET';

@@ -75,10 +74,14 @@ if (!token) token = this.token;

if (isObject(body)) {
body = querystring.stringify(body);
headers['content-type'] = 'application/x-www-form-urlencoded'
let method = 'POST'
if (body instanceof FormData) {
Object.assign(headers, body.getHeaders());
} else if (isObject(body)) {
body = JSON.stringify(body);
headers['Content-Type'] = 'application/json';
} else {
method = 'GET';
}
if (body) method = 'POST';
const request = await fetch(url, { method, body, headers });
// console.log(await request.text());
const result = await request.json();

@@ -85,0 +88,0 @@

module.exports = [
{ kubikName: 'companies.channels.conversations', apiName: 'companies/{{companyId}}/channels/{{channelId}}/conversations' },
{ kubikName: 'companies.conversations.messages', apiName: 'companies/{{companyId}}/conversations/{{conversationId}}/messages' },
{ kubikName: 'companies.conversations.messages.attachments', apiName: 'companies/{{companyId}}/conversations/{{conversationId}}/messages/attachments' },
{ kubikName: 'companies.conversationsGet', apiName: 'companies/{{companyId}}/conversations/{{conversationId}}' }
];
{
"name": "rubik-pact",
"version": "1.0.2",
"version": "1.0.3",
"description": "Pact Bot Api kubik for the Rubik application system",

@@ -21,2 +21,3 @@ "main": "classes/Pact.js",

"dependencies": {
"form-data": "^4.0.0",
"lodash": "^4.17.15",

@@ -23,0 +24,0 @@ "node-fetch": "^2.6.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