# clang

> Node.js api wrapper for Clang's SOAP api

Latest version **1.0.9** (published 2018-01-15) · 0 weekly downloads

## Install

```sh
npm install clang
pnpm add clang
yarn add clang
bun add clang
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.9 |
| Published | 2018-01-15 |
| First published | 2015-10-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.5 |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+4 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Christiaan Westerbeek |
| Maintainers | devotis |
| Keywords | clang, soap, api |

## Links

- npm: https://www.npmjs.com/package/clang
- Repository: https://github.com/devotis/clang
- Issues: https://github.com/devotis/clang/issues
- npm.io page: https://npm.io/package/clang

## Dependencies (4)

- [soap](https://npm.io/package/soap.md) 0.19.2
- [async](https://npm.io/package/async.md) 2.4.1
- [moment](https://npm.io/package/moment.md) 2.18.1
- [prompt](https://npm.io/package/prompt.md) 1.0.0

## Recent versions

- 1.0.9 (latest) — 2018-01-15
- 1.0.8 — 2017-12-22
- 1.0.7 — 2017-12-18
- 1.0.6 — 2017-10-23
- 1.0.5 — 2017-10-23
- 1.0.4 — 2017-10-23
- 1.0.3 — 2017-10-09
- 1.0.2 — 2017-10-09
- 1.0.1 — 2017-10-06
- 0.2.10 — 2017-06-26
- 0.2.9 — 2017-06-26
- 0.2.8 — 2017-06-26
- 0.2.7 — 2017-06-26
- 0.2.6 — 2016-11-10
- 0.2.5 — 2016-11-09
- … 19 more at https://npm.io/package/clang/versions

## README

[![Build Status](https://travis-ci.org/devotis/node-clang.svg)](https://travis-ci.org/devotis/node-clang)
[![npm version](https://badge.fury.io/js/clang.svg)](https://www.npmjs.org/package/clang)

node-clang
==========

Using <a href="http://www.createaclang.com/">Clang</a>'s SOAP api? Here's a module that will make your life easier. A Node.js api that wraps Clang's SOAP api. You don't need to bother with the extra resource callbacks that some methods like customer_getByObject require. Internally these resources are polled and the final dataset is returned in the callback.

I had a ton of fun building this. Node.js rocks!

## Install

```javascript
npm install clang
```

## 1.0 breaking changes
- instantiation without new keyword is not possible anymore.
- config.normalizeOptionFields does not default to true anymore. It doesn't default at all.
- config.logRequests is renamed to config.logPayload and also logs raw xml output
- customer_getById and similar methods that would normally output an object have always been wrapped in an array by this module. From 1.0 on when single objects are expected they are no longer wrapped in an array. methods that would normally output an array like customer_getAll, but output just one because of the available data (and/or filter set) continue to be wrapped in an array.

## 1.0 new features
- You can supply `_allPages=true` in the clang.request params. Internally all pages will be fetched, normalized and concatenated into one array containing the results of all pages.
- The default platform is `secure`, but you can now configure it to be `login`.
```javascript
const clang = new Clang({
  uuid: '12345678-1234-1234-1234-123456781234',
  platform: 'login'
})
```

## Example
```javascript
const Clang = require('clang')
const clang = new Clang({
  uuid: '12345678-1234-1234-1234-123456781234'
})

clang.request('group_getMembers', {
  groupId: 2
}, (err, result) => {
  console.log(err, result)
})

// Paging using the special parameters _size and _offset. Defaults are 50 and 0
clang.request('customer_getAll', {
  _size: 10
}, (err, result) => {
  console.log(err, result)
})

// Let the clang request do the paging for you and get all results back
clang.request('customer_getAll', {
  _allPages: true
}, (err, result) => {
  console.log(err, result)
})


```

## WSDL
This is the underlying WSDL document.

https://secure.myclang.com/app/api/soap/public/index.php?wsdl

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