Skip to content

Commit 5807de5

Browse files
committed
Updated docs
1 parent 40e45f6 commit 5807de5

File tree

4 files changed

+39
-11
lines changed

4 files changed

+39
-11
lines changed

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@ Thanks! :sweat_smile:
6161

6262

6363

64-
[1]: https://github.com/IonicaBizau/brokerbin/issues
64+
[1]: https://github.com/Bloggify/brokerbin/issues
6565

6666
[2]: https://github.com/IonicaBizau/code-style

DOCUMENTATION.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22

33
You can see below the API reference of this module.
44

5-
### `brokerbin(auth, {})`
5+
### `brokerbin(auth)`
66
BrokerBin API wrapper for Node.js
77

88
#### Params
99

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

1617
#### Return
1718
- **Number** Return description.

README.md

+33-6
Original file line numberDiff line numberDiff line change
@@ -72,18 +72,44 @@ yarn add brokerbin
7272

7373

7474
```js
75-
const BrokerBin = require("brokerbin")
75+
const BrokerBin = require("brokerbin");
7676

7777
(async () => {
78-
const bbClient = new BrokerBin()
78+
79+
// Initialize the BrokerBin
80+
const bbClient = new BrokerBin({
81+
username: process.env.BROKERBIN_USERNAME
82+
, password: process.env.BROKERBIN_PASSWORD
83+
, soap_key: process.env.BROKERBIN_SOAP_KEY
84+
, soap_uri: process.env.BROKERBIN_SOAP_URI
85+
, public_key: process.env.BROKERBIN_PUBLIC_KEY
86+
})
87+
88+
// Authenticate
7989
await bbClient.authenticate()
80-
const results = await bbClient.search("...", {
90+
91+
// Run a search
92+
const results = await bbClient.search("F238F", {
8193
max_resultset: 50
8294
, search_type: "partkey"
8395
, sort_order: "ASC"
8496
, sort_by: "price"
8597
})
98+
99+
// Output the result
86100
console.log(results)
101+
// =>
102+
// [ { company: '...',
103+
// country: 'GBR',
104+
// part: 'F238FNS',
105+
// mfg: 'DELL',
106+
// cond: 'REF',
107+
// price: '...',
108+
// qty: '4',
109+
// age: '0',
110+
// description: 'Dell 3.5" SAS Tray Caddy R710 R610 R410 T610 - No Screws',
111+
// clei: '',
112+
// status: '2' }, ... ]
87113
})()
88114
```
89115

@@ -113,16 +139,17 @@ There are few ways to get help:
113139
## :memo: Documentation
114140

115141

116-
### `brokerbin(auth, {})`
142+
### `brokerbin(auth)`
117143
BrokerBin API wrapper for Node.js
118144

119145
#### Params
120146

121147
- **Object** `auth`: An object containing the following data:
122148
- `username` (String): The BrokerBin username.
123149
- `password` (String): The BrokerBin password.
124-
- `soapkey` (String): The BrokerBin soap key.
125-
- **** `{}`: Param descrpition.
150+
- `soap_key` (String): The BrokerBin soap key.
151+
- `soap_uri` (String): The BrokerBin soap uri.
152+
- `public_key` (String): The BrokerBin public key.
126153

127154
#### Return
128155
- **Number** Return description.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,4 @@
4444
"phpunserialize": "^1.0.1",
4545
"soap": "^0.36.0"
4646
}
47-
}
47+
}

0 commit comments

Comments
 (0)