File tree 4 files changed +48
-254
lines changed
4 files changed +48
-254
lines changed Original file line number Diff line number Diff line change 1
- "use strict" ;
2
-
3
- const BrokerBinSOAP = require ( "../lib/" ) . SOAP ;
4
- const BrokerBinREST = require ( "../lib" ) . REST ; // or simply require("../lib")
5
-
6
- // SOAP Example
7
- ( async ( ) => {
8
-
9
- // Initialize the BrokerBin
10
- const bbClient = new BrokerBinSOAP ( {
11
- username : process . env . BROKERBIN_USERNAME || "your username" ,
12
- password : process . env . BROKERBIN_PASSWORD || "your password" ,
13
- soap_key : process . env . BROKERBIN_SOAP_KEY || "your soap key" ,
14
- soap_uri : process . env . BROKERBIN_SOAP_URI || "your soap uri" ,
15
- public_key : process . env . BROKERBIN_PUBLIC_KEY || "public key"
16
- } )
17
-
18
- // Run a search
19
- const results = await bbClient . search ( "F238F" , {
20
- max_resultset : 50
21
- , search_type : "partkey"
22
- , sort_order : "ASC"
23
- , sort_by : "price"
24
- } )
25
-
26
- // Output the result
27
- console . log ( results )
28
- // =>
29
- // [ { company: '...',
30
- // country: 'GBR',
31
- // part: 'F238FNS',
32
- // mfg: 'DELL',
33
- // cond: 'REF',
34
- // price: '...',
35
- // qty: '4',
36
- // age: '0',
37
- // description: 'Dell 3.5" SAS Tray Caddy R710 R610 R410 T610 - No Screws',
38
- // clei: '',
39
- // status: '2' }, ... ]
40
- } ) ( ) ;
1
+ const BrokerBinREST = require ( "../lib" ) ;
41
2
42
3
// REST Example
43
4
( async ( ) => {
@@ -51,6 +12,4 @@ const BrokerBinREST = require("../lib").REST; // or simply require("../lib")
51
12
} ) ;
52
13
53
14
console . log ( result )
54
- } ) ( ) . catch ( err => {
55
- debugger
56
- } )
15
+ } ) ( ) . catch ( console . error )
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments