Constructor
new Client(optionsopt)
Create an instance of the Bricklin Node Client.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
Options that are used to create a new client.
Properties
|
Classes
Members
_oauth :object
Type:
- object
consumer_key :string
Type:
- string
consumer_secret :string
Type:
- string
endpoint :string
Type:
- string
requestQueue :Array.<function()>
Type:
- Array.<function()>
token :string
Type:
- string
token_secret :string
Type:
- string
Methods
dispatch(req) → {Promise}
Performs a bricklink request and the callback upon success.
Parameters:
Name | Type | Description |
---|---|---|
req |
BricklinkRequest | The request to perform. |
Returns:
The data that has been return from the API request and any callbacks.
- Type
- Promise
getCatalogItem(itemType, itemNumber) → {Promise.<CatalogItem>}
Get a catalog item by type and identification number.
Parameters:
Name | Type | Description |
---|---|---|
itemType |
string | An item type as can be foud at ItemType. |
itemNumber |
string | An item identification number. |
Returns:
A promise that resolves to a catalog item.
- Type
- Promise.<CatalogItem>
getItemImage(itemType, itemNumber, colorId) → {Promise.<ItemImage>}
Can get an image for a specific image color of a known catalog item.
Parameters:
Name | Type | Description |
---|---|---|
itemType |
string | An item type as can be foud at ItemType. |
itemNumber |
string | An item identification number. |
colorId |
number | The color id of the item. |
Returns:
A promise that resolves to an Item Image.
- Type
- Promise.<ItemImage>
getItemSubset(itemType, itemNumber, paramsopt) → {Promise.<Array>}
Gets a subset of a catalog item.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
itemType |
string | An item type as can be foud at ItemType. | |
itemNumber |
string | An item identification number. | |
params |
object |
<optional> |
Options for the price guide as outlined in SubsetOptions. |
Returns:
A promise that resolves to a list of Subset.
- Type
- Promise.<Array>
getItemSuperset(itemType, itemNumber, paramsopt) → {Promise.<Array>}
Gets a superset of a catalog item.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
itemType |
string | An item type as can be foud at ItemType. | |
itemNumber |
string | An item identification number. | |
params |
object |
<optional> |
Options for the price guide as outlined in SupersetOptions. |
Returns:
A promise that resolves to a list of Superset.
- Type
- Promise.<Array>
getKnownColors(itemType, itemNumber) → {Promise.<Array>}
Get known colors for a catalog item.
Parameters:
Name | Type | Description |
---|---|---|
itemType |
string | An item type as can be foud at ItemType. |
itemNumber |
string | An item identification number. |
Returns:
A promise that resolves to a list of KnownColor.
- Type
- Promise.<Array>
getPriceGuide(itemType, itemNumber, params) → {Promise.<PriceGuide>}
Get the price guide for a given catalog item.
Parameters:
Name | Type | Description |
---|---|---|
itemType |
string | An item type as can be foud at ItemType. |
itemNumber |
string | An item identification number. |
params |
object | Options for the price guide as outlined in PriceGuideOptions. |
Returns:
A promise that resolves to a price guide.
- Type
- Promise.<PriceGuide>
send(req) → {Promise}
Performs a concurrent-safe bricklink request and the callback upon success.
Parameters:
Name | Type | Description |
---|---|---|
req |
BricklinkRequest | The request to perform. |
Returns:
The data that has been return from the API request and any callbacks.
- Type
- Promise