1.0.0 • Published 6 years ago

node-sdf v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

node-sdf

Build Status npm Code Style semantic-release

This is a node wrapper for Netsuite Suitescript Development Framework CLI. It provides the necessary dependencies to run the sdfcli in an encapsulated manner (NO global JAVA installation required!). Additionally a wrapper that can be used to create project structures and call sdf commands in a node script is provided through methods in index.js.

:rotating_light: The commands and cli work only for the 2018.1 NS release and are only tested on MacOS X and Linux

Installation

npm install # downloads and installs the sdfcli dependencies

Usage

Methods node wrapper

Following methods can be called and used for use of the sdfcli in a node script.

sdf

Please refer to the official NetSuite documentation for information about the commands and their required params The sdf method can be used to directly call sdfcli commands:

sdf('cmd', 'password', { path: 'path' }) // timeout in ms can be specified as last param (stalls hanging processes after 10s by default)
    .then(res => console.log(res))
    .catch(err => console.error(err));

sdfCreateAccountCustomizationProject

The sdfCreateAccountCustomizationProject creates the sdf boilerplate for an ACCOUNTCUSTOMIZATION in the specified directory:

const res = sdfCreateAccountCustomizationProject('NAME', 'PATH');
/**
  *  {
  *      type: 'ACCOUNTCUSTOMIZATION',
  *      dir: '/absolutepath/PATH/NAME',
  *      filebase: '/absolutepath/PATH/NAME/FileCabinet/SuiteScripts'
  *      name: 'NAME',
  *      values: { name: 'NAME' }
  *  }
  */

sdfCreateSuiteAppProject

The sdfCreateSuiteAppProject creates the sdf boilerplate for a SUITEAPP in the specified directory:

const res = sdfCreateSuiteAppProject('NAME', 'ID', 'VERSION', 'PUBLISHERID', 'PATH');
/**
  *  {
  *      type: 'SUITEAPP',
  *      dir: '/absolutepath/PATH/PUBLISHERID.ID',
  *      filebase: '/absolutepath/PATH/NAME/FileCabinet/SuiteApps'
  *      name: 'PUBLISHERID.ID',
  *      values: {
  *         publisherId: 'PUBLISHERID',
  *         id: 'ID',
  *         name: 'NAME',
  *         version: 'VERSION'
  *     }
  *  }
  */

General use CLI

The idea is to use the NetSuite sdfcli in a node environment and provide a way to generate boilerplate code for SDF projects

Install and use commands globally

npm install -g
sdfcli [options]
sdfcli-createproject [options]

Use commands locally

./sdfcli [options]
./sdfcli-createproject [options]

Commands

As the commands are routed through to the original NetSuite sdfcli - the following commands are implemented.

Please refer to the official NetSuite documentation for information about the commands and their required params

CommandDescription
adddependenciesAdds missing dependencies to the manifet file.
deployDeploys the folder or zip file that contains the SuiteCloud project.
importbundleImports a customization bundle from your NetSuite account and converts it to an ACCOUNTCUSTOMIZATION.
importfilesImports files from your NetSuite account to the ACCOUNTCUSTOMIZATION.
importobjectsImports custom objects from your NetSuite account to the SuiteCloud project.
listbundlesLists the customization bundles that were created in your NetSuite account.
listfilesLists the files in the File Cabinet of your NetSuite account.
listmissingdependenciesLists the missing dependencies in the SuiteCloud project.
listobjectsLists the custom objects in your NetSuite account.
previewPreviews the deployment steps of a folder or zip file that contains the SuiteCloud project.
projectSets the default project folder or zip file for CLI.
updateUpdates existing custom objects in the SuiteCloud project folder with the custom objects in your NetSuite account.
updatecustomrecordwithinstancesUpdates the custom record object and its instances in the SuiteCloud project.
validateValidates the folder or zip file that contains the SuiteCloud project.

Requirements

  • NetSuite account settings have to be updated for SDF
  • This project needs node > 8.

License

MIT © mycs 2017

Maintainer

jroehl

Whenever editing the repository

Should you update the readme, use npm script semantic-release to check if a new version has to be set and to publish it to npm.