Skip to content

Commit

Permalink
Updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
IonicaBizau committed Mar 4, 2021
1 parent 40e45f6 commit 5807de5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ Thanks! :sweat_smile:



[1]: https://github.com/IonicaBizau/brokerbin/issues
[1]: https://github.com/Bloggify/brokerbin/issues

[2]: https://github.com/IonicaBizau/code-style
7 changes: 4 additions & 3 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

You can see below the API reference of this module.

### `brokerbin(auth, {})`
### `brokerbin(auth)`
BrokerBin API wrapper for Node.js

#### Params

- **Object** `auth`: An object containing the following data:
- `username` (String): The BrokerBin username.
- `password` (String): The BrokerBin password.
- `soapkey` (String): The BrokerBin soap key.
- **** `{}`: Param descrpition.
- `soap_key` (String): The BrokerBin soap key.
- `soap_uri` (String): The BrokerBin soap uri.
- `public_key` (String): The BrokerBin public key.

#### Return
- **Number** Return description.
Expand Down
39 changes: 33 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,18 +72,44 @@ yarn add brokerbin


```js
const BrokerBin = require("brokerbin")
const BrokerBin = require("brokerbin");

(async () => {
const bbClient = new BrokerBin()

// Initialize the BrokerBin
const bbClient = new BrokerBin({
username: process.env.BROKERBIN_USERNAME
, password: process.env.BROKERBIN_PASSWORD
, soap_key: process.env.BROKERBIN_SOAP_KEY
, soap_uri: process.env.BROKERBIN_SOAP_URI
, public_key: process.env.BROKERBIN_PUBLIC_KEY
})

// Authenticate
await bbClient.authenticate()
const results = await bbClient.search("...", {

// Run a search
const results = await bbClient.search("F238F", {
max_resultset: 50
, search_type: "partkey"
, sort_order: "ASC"
, sort_by: "price"
})

// Output the result
console.log(results)
// =>
// [ { company: '...',
// country: 'GBR',
// part: 'F238FNS',
// mfg: 'DELL',
// cond: 'REF',
// price: '...',
// qty: '4',
// age: '0',
// description: 'Dell 3.5" SAS Tray Caddy R710 R610 R410 T610 - No Screws',
// clei: '',
// status: '2' }, ... ]
})()
```

Expand Down Expand Up @@ -113,16 +139,17 @@ There are few ways to get help:
## :memo: Documentation


### `brokerbin(auth, {})`
### `brokerbin(auth)`
BrokerBin API wrapper for Node.js

#### Params

- **Object** `auth`: An object containing the following data:
- `username` (String): The BrokerBin username.
- `password` (String): The BrokerBin password.
- `soapkey` (String): The BrokerBin soap key.
- **** `{}`: Param descrpition.
- `soap_key` (String): The BrokerBin soap key.
- `soap_uri` (String): The BrokerBin soap uri.
- `public_key` (String): The BrokerBin public key.

#### Return
- **Number** Return description.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@
"phpunserialize": "^1.0.1",
"soap": "^0.36.0"
}
}
}

0 comments on commit 5807de5

Please sign in to comment.