Skip to content

Latest commit

 

History

History

netsuite-adapter

NetSuite adapter

NetSuite adapter for salto.io

Prerequisites

Install Java 17 (OpenJDK / JDK)

OpenJDK
    (using macOS)
    brew install openjdk@17
    sudo ln -sfn /usr/local/opt/openjdk\@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
    export JAVA_HOME=`/usr/libexec/java_home -v 17`
JDK - https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html

Build instructions

yarn
yarn build

Configure your NetSuite account to work with Salto

  • Enable SDF in Your NetSuite Account (Admin Only) - follow the instructions under https://<ACCOUNT_ID>.app.netsuite.com/app/help/helpcenter.nl?fid=section_4724921034.html
  • Setup Your Role (prefer Administrator) for SDF Development - follow the instructions under https://<ACCOUNT_ID>.app.netsuite.com/app/help/helpcenter.nl?fid=subsect_1539287603.html

Authenticate using OAuth 2.0

  1. Create certificate using the following command:
openssl req -new -x509 -newkey rsa:4096 -keyout private.pem -sigopt rsa_padding_mode:pss -sha256 -sigopt rsa_pss_saltlen:64 -out public.pem -nodes -days 730
  1. Navigate in NetSuite UI to Setup > Integration > OAuth 2.0 Client Credentials (M2M) Setup
  2. Click "Create New"
  3. Select the Entity (employee) and Role (must be Administrator)
  4. Select "SuiteCloud Development Integration" in the Application
  5. Upload the public certificate you generated and click "Save"
  6. Copy the created Certificate ID and use it to connect your NetSuite to Salto, along with the content of the generated private.pem file.

Limitations

Deleting record of CustomTypes & FileCabinet is not supported.

E2E tests

E2E tests need real NetSuite credentials to run.

Run CONSOLE=1 yarn e2e-test to print log messages to stdout.

Using a specific set of credentials

Add the following environment variables to bash_profile:

export NS_ACCOUNT_ID='XXXX'
export NS_TOKEN_ID='XXXX'
export NS_TOKEN_SECRET='XXXX'

Using the shared credentials pool

The credentials pool can be used to run the E2E tests concurrently on multiple NetSuite accounts.

The pool is used if the NS_ environment variables are not defined. You can also force its use by defining the environment variable USE_CRED_POOL=1.

AWS credentials for the pool

The pool uses Amazon DynamoDB, and needs read/write/list permissions for the e2e_permissions table.

Make sure your AWS credentials are set, e.g, as environment variables:

export AWS_ACCESS_KEY_ID='XXXX'
export AWS_SECRET_ACCESS_KEY='XXXX'

Managing the pool using CLI

To add your credentials to the pool, use the cred-store CLI located at the e2e_test directory of the project:

./e2e_test/cred_store register netsuite 'my-credentials-id' --accountId='tstdrv1234567' --tokenId='MYTOKENID' --tokenSecret='MYTOKENSECRET'

Enter --help to see other uses for the cred-store utility - listing, removing and managing sets of credentials.