Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// This file is part of ThingEngine
//
// Copyright 2015 Giovanni Campagna
//
// See COPYING for details
const Tp = require('thingpedia');
module.exports = new Tp.ChannelClass({
Name: 'LoggingChannel',
Extends: Tp.SimpleAction,
_doInvoke: function(message) {
console.log("LoggingChannel: ", message);
}
});
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// This file is part of ThingPedia
//
// Copyright 2016 Elena Kane Frey
// Meredith Grace Marks ,
//
// See LICENSE for details
const Tp = require('thingpedia');
module.exports = new Tp.ChannelClass({
Name: "FacebookPostsSinkAction",
Extends: Tp.SimpleAction,
_doInvoke: function(text) {
}
});
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// This file is part of ThingEngine
//
// Copyright 2015 Giovanni Campagna
//
// See COPYING for details
const Tp = require('thingpedia');
module.exports = new Tp.ChannelClass({
Name: 'SabrinaSayChannel',
Extends: Tp.SimpleAction,
_init: function(engine, device) {
this.parent();
this.engine = engine;
},
_doInvoke: function(message) {
this.engine.assistant.sendReply(message);
},
});
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// Copyright 2016 {jasonf2, kkiningh}@stanford.edu
//
// See LICENSE for details
"use strict";
const Tp = require('thingpedia');
module.exports = new Tp.ChannelClass({
Name: 'OneDriveCreateFileAction',
Extends: Tp.SimpleAction,
_init: function(engine, device) {
this.parent(engine, device);
this._baseurl = 'https://api.onedrive.com/v1.0/drive/root/children/';
},
_doInvoke: function(fileName, body) {
var url = this._baseurl + fileName + "/content";
return Tp.Helpers.Http.request(url, 'PUT', body, {
dataContentType: "text/plain",
useOAuth2: this.device
});
}
});
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// Copyright 2016 {jasonf2, kkiningh}@stanford.edu
// Giovanni Campagna
//
// See LICENSE for details
"use strict";
const Tp = require('thingpedia');
const path = require('path');
module.exports = new Tp.ChannelClass({
Name: 'OneDriveCreateFileAction',
Extends: Tp.SimpleAction,
_init: function(engine, device) {
this.parent(engine, device);
this._baseurl = 'https://api.onedrive.com/v1.0/drive/items/';
},
_doInvoke: function(fileName, url) {
var dirname = path.dirname(fileName);
if (!dirname || dirname === '.')
dirname = 'root';
var basename = path.basename(fileName);
url = this._baseurl + dirname + "/children";
return Tp.Helpers.Http.request(url, 'POST', JSON.stringify({
'@content.sourceUrl': url,
name: basename,
file: {}
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// Copyright 2016 {jasonf2, kkiningh}@stanford.edu
//
// See LICENSE for details
"use strict";
const Tp = require('thingpedia');
module.exports = new Tp.ChannelClass({
Name: 'OneDriveCreateFileAction',
Extends: Tp.SimpleAction,
_init: function(engine, device) {
this.parent(engine, device);
this._baseurl = 'https://api.onedrive.com/v1.0/drive/root/children/';
},
_doInvoke: function(fileName) {
var url = this._baseurl + fileName;
return Tp.Helpers.Http.request(url, 'DELETE', '', {
dataContentType: "text/plain",
useOAuth2: this.device
});
}
});
// -*- mode: js; indent-tabs-mode: nil; js-basic-offset: 4 -*-
//
// Copyright 2016 {jasonf2, kkiningh}@stanford.edu
//
// See LICENSE for details
"use strict";
const Tp = require('thingpedia');
module.exports = new Tp.ChannelClass({
Name: 'OneDriveCreateFileAction',
Extends: Tp.SimpleAction,
_init: function(engine, device) {
this.parent(engine, device);
this._baseurl = 'https://api.onedrive.com/v1.0/drive/root/children/';
},
_doInvoke: function(fileName, newFilename) {
var body = JSON.stringify({ name: newFilename });
var url = this._baseurl + fileName;
return Tp.Helpers.Http.request(url, 'PATCH', body, {
dataContentType: "text/plain",
useOAuth2: this.device
});
}
});