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

pastebin-js

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pastebin-js - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

35

bin/pastebin.js

@@ -29,6 +29,7 @@ 'use strict';

* Get a paste
* @param {String} id Id of the paste
* @return {Object} Promise
* @param {String} id Id of the paste
* @param {Boolean} isPrivate Is this a private paste? Optional
* @return {Object} Promise
*/
Pastebin.prototype.getPaste = function (id) {
Pastebin.prototype.getPaste = function (id, isPrivate) {
if (!id) {

@@ -39,3 +40,29 @@ var deferred = Q.defer();

}
return this._getApi(conf.net.protocol + conf.net.base + conf.net.endpoint.raw + id, null);
if (isPrivate) {
var p = {
api_option : 'show_paste',
api_dev_key : this.config.api_dev_key,
api_paste_key : id,
};
var deferred = Q.defer();
if (this.config.api_user_key) {
p.api_user_key = this.config.api_user_key;
} else if (this.config.api_user_name !== null && this.config.api_user_password !== null) {
this
.createAPIuserKey()
.then(function () {
this.getPaste(id, isPrivate)
.then(deferred.resolve)
.catch(deferred.reject);
return deferred.promise;
}.bind(this))
.catch(deferred.reject);
return deferred.promise;
} else {
deferred.reject(new Error('Error! For private pastes you need to be logged in! Provide username and password!'));
return deferred.promise;
}
return this._postApi(conf.net.protocol + conf.net.base + conf.net.endpoint.apiraw, p);
}
return this._getApi(conf.net.protocol + conf.net.base + conf.net.endpoint.api + id, null);
};

@@ -42,0 +69,0 @@

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

'post' : 'api/api_post.php',
'apiraw' : 'api/api_raw.php',
'login' : 'api/api_login.php',

@@ -23,0 +24,0 @@ 'raw' : 'raw.php?i='

2

package.json
{
"name": "pastebin-js",
"version": "1.0.3",
"version": "1.0.4",
"description": "NodeJS module for Pastebin API",

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

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