
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
netsuite-cabinet
Advanced tools
Upload/download files to a netsuite account, using the included restlet.
Forked from https://github.com/suiteplus/nscabinet
PS: This is actually also a gulp plugin.
npm install netsuite-cabinet
Install the nscabinet restlet bundle in your netsuite account (or manually create the script using the file in the repo) *
Create a nsconfig.json
file in the root of you project with at least email , password, account, script number and deployment number.
Use it with gulp or with the CLI (see CLI section below)
var nscabinet = require('nscabinet');
gulp.src('myProject/dist/**/*.js').pipe(nscabinet({ rootPath : '/Templates' }));
(*) if installing from the bundle, the minor version must match your current version of nscabinet
The parameters may be stored in config files, in environment variables, or passed directly as object.
For environment variables, prefix the options with "NSCONF_" and write in uppercase.
The following priority is taken for each parameter (using _.extend
)
Options argument nscabinet(options)
./nsconfig.json
, then ../nsconfig.json
, up to 5 levels.
~/.ns/nsconfig.json
Environment variables
For instance, let's say you call nscabinet({ account : '1234' })
. Even if no e-mail is supplied, we also look up in the sources listed above for it. You may set a nsconfig.json
for the project without the password, setting the latter machine-wise using an environment variable.
The following parameters are common through most of the methods:
Connection
realm
defaults to netsuite.com
. (No longer used, now using account specific domain based on account #)
role
defaults to the account's default role.
account
email
password
script
deployment
defaults to 1.
conffile
overrides default nsconfig.json
file name, allowing multiple project setting.
Path
rootPath
sets the root path on the server. Defaults to /SuiteScripts
. Must begin with /
.Example: Upload file with path img/image.jpg
to rootPath /Templates
will "upsert" the file
onto '/Templates/img/image.jpg'.
Token Based Authentication
consumerKey
consumerSecret
token
tokenSecret
Setup:
The email and password are ignored when token based authentication is used. (They are still required but can just have placeholder values)
var nscabinet = require('nscabinet') ,
gulp = require('gulp') //or just vinyl-fs
gulp.src('foo.js')
.pipe(nscabinet({
email : 'foo@bar.baz.com' ,
password : '123456' ,
account : '123456' ,
realm : 'sandbox.netsuite.com' ,
role : 3 ,
rootPath : '/SuiteScripts/MyProject'
script : 95 ,
deployment : 1
}))
isonline
(boolean) lets you set the uploaded files to be avaliable
without login.
flatten
all files are uploaded to the root path, regardless of their source path.
nscabinet.download(['MyProject/*.js','/Web Site Hosting Files/My Site/*.html'])
.pipe(vinylfs.dest('local'))
files
file selector (one or many).
*
is accepted on the file part. The restlet then runs a file search by name
in which *
is replaced with %
.
Paths are also relative to opts.rootPath
. If a file selector begins with /
, files will be queried
by absolute path in netsuite, but saved locally inside the cabinet_root
folder.
If a path has /**/
, a recursive search will be done. This can be used to search
just by file name, regardless of path.
(PS: While the syntax is similar, don't expect full glob funcionality. It's not a glob!)
opts
Common options.
Get the url (internal or external) of a cabinet file. Returns a promise. Useful for email campaign stuff.
Options: receives the ones which make sense here (ex: rootPath, realm, etc...) in the same fashion.
nscabinet.url('emails/img/header.jpg').then( url => {
cheerio_img.attr(src,url);
return cheerio_doc.html();
});
npm install -g nscabinet
$ nscabinet u "file.txt" --rootpath "/SuiteScripts/MyProject"
$ nscabinet u "file.txt" -p "/SuiteScripts/MyProject"
$ nscabinet u "file.txt"
$ nscabinet d "remote.txt" --rootPath "/Downloads"
$ nscabinet d "remote.txt" -p "/Downloads"
$ nscabinet d "remote.txt"
Takes in the same arguments (always lowercased).
Encase path parameters in string quotes (avoids bash expansion).
As usual, the arguments are defaulted from nsconfig.json
.
Sent file paths are taken relative to the config file path. Ex:
$ nscabinet u file.txt
Uploading file.txt to /SuiteScripts
$ cd Views
$ Views nscabinet u view.html
Uploading Views/view.html to /SuiteScripts
At the time tests are run locally. To set up the tests:
Install the restlet in an available account;
Set up nsconfig.json, pointing to that account; Don't forget to set a rootPath to where the tests will play around and create its lots of files;
Run 'gulp'
FAQs
Upload and download files from netsuite.
The npm package netsuite-cabinet receives a total of 1 weekly downloads. As such, netsuite-cabinet popularity was classified as not popular.
We found that netsuite-cabinet demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.