@@ -72,44 +72,7 @@ yarn add brokerbin
72
72
73
73
74
74
``` js
75
- const BrokerBinSOAP = require (" brokerbin/lib/" ).SOAP ;
76
- const BrokerBinREST = require (" brokerbin" ).REST ; // or simply require("../lib")
77
-
78
- // SOAP Example
79
- (async () => {
80
-
81
- // Initialize the BrokerBin
82
- const bbClient = new BrokerBinSOAP ({
83
- username: process .env .BROKERBIN_USERNAME || " your username" ,
84
- password: process .env .BROKERBIN_PASSWORD || " your password" ,
85
- soap_key: process .env .BROKERBIN_SOAP_KEY || " your soap key" ,
86
- soap_uri: process .env .BROKERBIN_SOAP_URI || " your soap uri" ,
87
- public_key: process .env .BROKERBIN_PUBLIC_KEY || " public key"
88
- })
89
-
90
- // Run a search
91
- const results = await bbClient .search (" F238F" , {
92
- max_resultset: 50
93
- , search_type: " partkey"
94
- , sort_order: " ASC"
95
- , sort_by: " price"
96
- })
97
-
98
- // Output the result
99
- console .log (results)
100
- // =>
101
- // [ { company: '...',
102
- // country: 'GBR',
103
- // part: 'F238FNS',
104
- // mfg: 'DELL',
105
- // cond: 'REF',
106
- // price: '...',
107
- // qty: '4',
108
- // age: '0',
109
- // description: 'Dell 3.5" SAS Tray Caddy R710 R610 R410 T610 - No Screws',
110
- // clei: '',
111
- // status: '2' }, ... ]
112
- })();
75
+ const BrokerBinREST = require (" brokerbin" );
113
76
114
77
// REST Example
115
78
(async () => {
@@ -123,9 +86,7 @@ const BrokerBinREST = require("brokerbin").REST; // or simply require("../lib")
123
86
});
124
87
125
88
console .log (result)
126
- })().catch (err => {
127
- debugger
128
- })
89
+ })().catch (console .error )
129
90
```
130
91
131
92
@@ -915,35 +876,6 @@ Find users and company who searched for an exact part number.
915
876
916
877
----
917
878
918
- ### ` BrokerBinSOAP(auth) `
919
- BrokerBin API wrapper for Node.js
920
-
921
- #### Params
922
-
923
- - ** Object** ` auth ` : An object containing the following data:
924
- - ` username ` (String): The BrokerBin username (or ENV variable: ` BROKERBIN_USERNAME ` )
925
- - ` password ` (String): The BrokerBin password (or ENV variable: ` BROKERBIN_PASSWORD ` )
926
- - ` soap_key ` (String): The BrokerBin soap key (or ENV variable: ` BROKERBIN_SOAP_KEY ` )
927
- - ` soap_uri ` (String): The BrokerBin soap uri (or ENV variable: ` BROKERBIN_SOAP_URI ` )
928
- - ` public_key ` (String): The BrokerBin public key (or ENV variable: ` BROKERBIN_PUBLIC_KEY ` )
929
-
930
- #### Return
931
- - ** BrokerBinSOAP** The ` BrokerBinSOAP ` instance.
932
-
933
- ### authenticate
934
-
935
- Setup the API authentication.
936
-
937
- #### Return
938
- - ** Promise** Resolves with the UID.
939
-
940
- ### search
941
-
942
- Runs a search request in BrokerBin.
943
-
944
- #### Return
945
- - ** Promise** Resolves with the results.
946
-
947
879
948
880
949
881
0 commit comments