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.6 to 0.0.7

__mocks__/.eslintrc.yml

4

__mocks__/request.js

@@ -5,3 +5,3 @@ "use strict";

post: function (options, callback) {
post: jest.fn((options, callback) => {
const body = options;

@@ -14,4 +14,4 @@ const response = {

callback(null, response, body);
}
})
};
"use strict";
jest.mock('request', () => {
return {
post: jest.fn((params, callback) => callback(null, { statusCode: 200 }, { form: params.form }))
};
});
jest.mock('request');

@@ -298,1 +294,35 @@ const errorMessages = require('../error-messages');

});
describe("legacy API methods", () => {
it("works to call say from the api root", () => {
expect.hasAssertions();
return api.say({ message: "yo" }).then(() => {
expect(request.post.mock.calls[0][0].url).toEqual(actionsApi.urlFor("say"));
});
});
it("works to call run from the api root", () => {
expect.hasAssertions();
return api.run({ trigger: "yo" }).then(() => {
expect(request.post.mock.calls[0][0].url).toEqual(actionsApi.urlFor("run_action"));
});
});
it("works to call schedule from the api root", () => {
expect.hasAssertions();
return api.schedule({ trigger: "yo", recurrence: "every day at noon" }).then(() => {
expect(request.post.mock.calls[0][0].url).toEqual(actionsApi.urlFor("schedule_action"));
});
});
it("works to call unschedule from the api root", () => {
expect.hasAssertions();
return api.unschedule({ trigger: "yo" }).then(() => {
expect(request.post.mock.calls[0][0].url).toEqual(actionsApi.urlFor("unschedule_action"));
});
});
});

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

class Api extends AbstractApi {
constructor(ellipsis) {
super(ellipsis);
this.actions = new ActionsApi(ellipsis);
this.storage = new StorageApi(ellipsis);
}
}
class ActionsApi extends AbstractApi {

@@ -233,2 +223,16 @@

class Api extends AbstractApi {
constructor(ellipsis) {
super(ellipsis);
this.actions = new ActionsApi(ellipsis);
this.storage = new StorageApi(ellipsis);
this.say = this.actions.say.bind(this.actions);
this.run = this.actions.run.bind(this.actions);
this.schedule = this.actions.schedule.bind(this.actions);
this.unschedule = this.actions.unschedule.bind(this.actions);
}
}
module.exports = Api;
{
"name": "ellipsis-api",
"version": "0.0.6",
"version": "0.0.7",
"description": "Interact with Ellipsis skills & actions",
"main": "index.js",
"scripts": {
"test": "./node_modules/.bin/jest"
"test": "jest",
"lint": "eslint .",
"prepublishOnly": "npm run lint && npm test"
},

@@ -15,4 +17,5 @@ "author": "Ellipsis Co. <a@ellipsis.ai> (http://ellipsis.ai)",

"devDependencies": {
"eslint": "^4.3.0",
"jest-cli": "^20.0.3"
}
}
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