# node-suitetalk

> NodeJs Suitetalk wrapper.

Latest version **0.0.8** (published 2023-05-16) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install node-suitetalk
pnpm add node-suitetalk
yarn add node-suitetalk
bun add node-suitetalk
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.8 |
| Published | 2023-05-16 |
| First published | 2018-08-25 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=13.3.0 |
| Dependencies | 4 |
| Unpacked size | 141.8 KB |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Felipe Chang |
| Maintainers | mr-pepian |
| Keywords | netsuite, suitescript, suitetalk |

## Links

- npm: https://www.npmjs.com/package/node-suitetalk
- Repository: https://github.com/felipechang/node-suitetalk
- Homepage: https://github.com/felipechang/node-suitetalk#readme
- Issues: https://github.com/felipechang/node-suitetalk/issues
- npm.io page: https://npm.io/package/node-suitetalk

## Dependencies (4)

- [soap](https://npm.io/package/soap.md) ^1.0.0
- [mkdirp](https://npm.io/package/mkdirp.md) ^3.0.1
- [adm-zip](https://npm.io/package/adm-zip.md) ^0.5.10
- [superagent](https://npm.io/package/superagent.md) ^8.0.9

## Recent versions

- 0.0.8 (latest) — 2023-05-16
- 0.0.5 — 2020-12-14
- 0.0.4 — 2020-10-28
- 0.0.3 — 2020-09-19
- 0.0.2 — 2018-08-25

## README

# node-suitetalk
NodeJS Suitetalk wrapper

## Install

```bash
$ npm install --save node-suitetalk
```

## Usage

Get a customer:

```javascript
const NetSuite = require("node-suitetalk");
const Configuration = NetSuite.Configuration;
const Service = NetSuite.Service;
const Record = NetSuite.Record;

const config = new Configuration({
    account: "123456_SB1",
    apiVersion: "2019_2",
    accountSpecificUrl: true, // Enable for new format
    credentials: {
        email: "email@netsuite.com",
        password: "netsuitepassword",
        role: "3",
        applicationId:"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
    },
    wsdlPath: "./wsdl/WSDL_v2019_2_0/netsuite.wsdl",
});

const service = new Service(config);

service
    .init()
    .then((/*client*/) => { 

       const recordRef = new Record.Types.RecordRef();
       recordRef.internalId = 1234567;
       recordRef.type = "customer";
       
       return service.get(recordRef);
    }).then((result) => {
        console.log("result");
        console.log(JSON.stringify(result));
    
}).catch(function (err) {
    console.log("error");
    console.log(service.config.client.lastRequest);
    console.log("message");
    console.log(JSON.stringify(err));
});

```

## Discovery

Get role and account id using NetSuite credentials.

```javascript
const NetSuite = require("node-suitetalk");
const Util = NetSuite.Util;
const util = new Util();

util.getLoginOptions({
    email: "email@netsuite.com",
    password: "netsuitepassword",
}, (err, data) => {
    // Outputs login options for this account
    // will will use roles and
});
```

Import WSDL from NetSuite website, we pre-load the files to speed up requests.

```javascript
const NetSuite = require("node-suitetalk");
const Util = NetSuite.Util;
const util = new Util();

util.downloadWsdlToFolder({
    apiVersion: "2019_2",
    wsdlFolderPath: "./wsdl/NetSuite/", // Defaults to ./wsdl

}, (wsdlPath) => {

    // Callbacks the path to netsuite.wsdl

});
```

## Configuration

Either "credentials" or "token" are required to login, by default the credentials will be used.

* Options
  * `account` **Required**. NetSuite account ID.
  * `apiVersion` **Required**. API version. Example 2018_1.
  * `wsdlPath` **Required**. Path to wsdl folder or netsuite.wsdl file. A remote URI can also be used, but is much slower.
  * `credentials` Use NL_AUTH credentials.  
    * `email` **Required**. NetSuite user email.
    * `password` **Required**. NetSuite user password.
    * `role` NetSuite role ID. Example: '3' for administrator.
    * `applicationId` Application ID. "Manage Integrations" page in NetSuite.
  * `token` Use OAuth1.0 token.
    * `consumer_key` **Required**. Consumer Key. "Manage Integrations" page in NetSuite.
    * `consumer_secret` **Required**. Consumer Secret. "Manage Integrations" page in NetSuite.
    * `token_key` **Required**. Token Key."Manage Access Tokens" page in NetSuite.
    * `token_secret` **Required**. Token Secret. "Manage Access Tokens" page in NetSuite.

# Notes

Created as a module for another project. Some features still unavailable.

# License
GNU GPL see LICENSE.

**Use at your own discretion**

# Authors
**Add yourself here if you've contributed**

* Felipe Chang <felipechang@hardcake.org>
* Ricky Claven <rclaven@transalis.com>
* jonahthermomix <https://github.com/jonahthermomix>
* Wiput Pootong <contact@wiput.me>
* Cameron Ackerman <https://github.com/camja014>

---
_Source: https://npm.io/package/node-suitetalk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
