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

ellipsis-api

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ellipsis-api - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

38

__tests__/test.js

@@ -245,2 +245,40 @@ "use strict";

it("handles variables passed in a JS object", () => {
expect.hasAssertions();
const query = "{ foo { bar } }";
const variables = { key1: "something", key2: { key3: "something else" } };
return storageApi.query({ query: query, variables: variables }).then(data => {
const form = data.body.form;
const expectedForm = {
query: query,
operationName: undefined,
variables: JSON.stringify(variables),
token: ellipsis.token
};
expect(form).toEqual(expectedForm);
expect(data.url).toEqual(storageApi.url())
});
});
it("handles variables passed in a string", () => {
expect.hasAssertions();
const query = "{ foo { bar } }";
const variables = '{ "key1": "something", "key2": { "key3": "something else" } }';
return storageApi.query({ query: query, variables: variables }).then(data => {
const form = data.body.form;
const expectedForm = {
query: query,
operationName: undefined,
variables: variables,
token: ellipsis.token
};
expect(form).toEqual(expectedForm);
expect(data.url).toEqual(storageApi.url())
});
});
it("complains if no query", () => {

@@ -247,0 +285,0 @@

12

index.js

@@ -195,2 +195,12 @@ const request = require('request');

variablesStringFor(v) {
if (typeof v === 'object') {
return JSON.stringify(v);
} else if (v && typeof v.toString === 'function') {
return v.toString();
} else {
return v;
}
}
query(options) {

@@ -202,3 +212,3 @@ return new Promise((resolve, reject) => {

operationName: options.operationName,
variables: options.variables,
variables: this.variablesStringFor(options.variables),
token: this.token()

@@ -205,0 +215,0 @@ };

2

package.json
{
"name": "ellipsis-api",
"version": "0.0.3",
"version": "0.0.4",
"description": "Interact with Ellipsis skills & actions",

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

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