Skip to content
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.
/ node-sdf Public archive

A node wrapper for Netsuite Suitescript Development Framework CLI

License

Notifications You must be signed in to change notification settings

mycsHQ/node-sdf

Repository files navigation

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.

🚨 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

Command Description
adddependencies Adds missing dependencies to the manifet file.
deploy Deploys the folder or zip file that contains the SuiteCloud project.
importbundle Imports a customization bundle from your NetSuite account and converts it to an ACCOUNTCUSTOMIZATION.
importfiles Imports files from your NetSuite account to the ACCOUNTCUSTOMIZATION.
importobjects Imports custom objects from your NetSuite account to the SuiteCloud project.
listbundles Lists the customization bundles that were created in your NetSuite account.
listfiles Lists the files in the File Cabinet of your NetSuite account.
listmissingdependencies Lists the missing dependencies in the SuiteCloud project.
listobjects Lists the custom objects in your NetSuite account.
preview Previews the deployment steps of a folder or zip file that contains the SuiteCloud project.
project Sets the default project folder or zip file for CLI.
update Updates existing custom objects in the SuiteCloud project folder with the custom objects in your NetSuite account.
updatecustomrecordwithinstances Updates the custom record object and its instances in the SuiteCloud project.
validate Validates 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.

About

A node wrapper for Netsuite Suitescript Development Framework CLI

Resources

License

Stars

Watchers

Forks

Packages

No packages published