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

box-sdk

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

box-sdk - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

23

doc/README.md

@@ -49,3 +49,3 @@ ## Node Box SDK

### Running with Passport authentication under Express
**Note:** For a complete express example, look under `test/helpers/express`.
**Note:** There is a complete express example in [this gist](https://gist.github.com/adityamukho/13c7c462e216fa02d0a9).
```

@@ -84,2 +84,23 @@ var express = require('express'),

});
app.get('/', function (req, res) {
var opts = {
user: req.user
};
if (req.user) {
var connection = box.getConnection(req.user.login);
connection.ready(function () {
connection.getFolderItems(0, null, function (err, result) {
if (err) {
opts.body = err;
} else {
opts.body = result;
}
res.render('index', opts);
});
});
} else {
res.render('index', opts);
}
});
```

@@ -86,0 +107,0 @@

@@ -90,2 +90,3 @@ 'use strict';

* @param {optionalErrorCallback} done - Called after finishing one round of long polling.
* @fires Connection#"polling.ready"
*/

@@ -110,2 +111,7 @@ _longPoll: function (done) {

self.nsp = body.next_stream_position;
/**
* Fires when a stream position has been fixed. All events from here onwards will be captured.
* @event Connection#"polling.ready"
*/
self.emit('polling.ready');
}

@@ -112,0 +118,0 @@ self._request('https://api.box.com/2.0/events', 'OPTIONS', next);

5

lib/api/content/files.js

@@ -130,5 +130,6 @@ 'use strict';

* @param {requestCallback} done - The callback to invoke (with possible errors) when the request returns.
* @param {?RequestHeaders} [headers] - Additional headers.
* @param {?RequestConfig} [config] - Configure the request behaviour.
*/
uploadFile: function (name, parent_id, opts, done, config) {
uploadFile: function (name, parent_id, opts, done, headers, config) {
if (!_.isString(name) || !_.isNumber(parseInt(parent_id, 10))) {

@@ -142,3 +143,3 @@ return done(new Error('Invalid params. Required - name: string, parent_id: number'));

var data = fs.createReadStream(name);
this._request(['files', 'content'], 'POST', done, null, opts, data, null, null, config);
this._request(['files', 'content'], 'POST', done, null, opts, data, headers, null, config);
},

@@ -145,0 +146,0 @@

{
"name": "box-sdk",
"description": "Node.js client for Box Content API",
"version": "0.0.2",
"version": "0.0.3",
"homepage": "https://github.com/adityamukho/node-box-sdk",

@@ -6,0 +6,0 @@ "author": {

@@ -50,3 +50,3 @@ # Node Box SDK [![Build Status](https://travis-ci.org/adityamukho/node-box-sdk.svg?branch=master)](https://travis-ci.org/adityamukho/node-box-sdk)

### Running with Passport authentication under Express
**Note:** For a complete express example, look under `test/helpers/express`.
**Note:** There is a complete express example in [this gist](https://gist.github.com/adityamukho/13c7c462e216fa02d0a9).
```javascript

@@ -85,2 +85,23 @@ var express = require('express'),

});
app.get('/', function (req, res) {
var opts = {
user: req.user
};
if (req.user) {
var connection = box.getConnection(req.user.login);
connection.ready(function () {
connection.getFolderItems(0, null, function (err, result) {
if (err) {
opts.body = err;
} else {
opts.body = result;
}
res.render('index', opts);
});
});
} else {
res.render('index', opts);
}
});
```

@@ -87,0 +108,0 @@

'use strict';
var assert = require("assert"),
_ = require('lodash'),
cp = require('child_process'),

@@ -6,0 +5,0 @@ crypto = require('crypto'),

Sorry, the diff of this file is not supported yet

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