Type Definitions
Configurations
Configurations Schema
Type:
- Object
Properties:
Name | Type | Default | Description |
---|---|---|---|
BITSKY_BASE_URL |
string | http://localhost:9099 | The BitSky Application URL |
GLOBAL_ID |
string | The global id of your Retailer Service. Please Get a Retailer Service Global ID |
|
PORT |
number | 8081 | Express server port number |
SERVICE_NAME |
string | @bitskyai/retailer-sdk | Service name, this name will be used for log |
RETAILER_HOME |
string | Home folder of this retailer. Default is |
|
LOG_LEVEL |
string | info | Loging level you want to log. Please find available loging levels from Winston Logging Levels |
ERROR_LOG_FILE_NAME |
string | error.log | Error log file name |
COMBINED_LOG_FILE_NAME |
string | combined.log | Combined log file name |
DATA_FILE_NAME |
string | data.json | Collect data file name. Default is |
CONNECTOR_TYPE |
string | json | Connector is used to define the way how to store your data, default is |
MONGODB_URL |
string | mongodb://localhost:27017/retailer | MongoDB url. **Important: ** if you configured |
MONGODB_HOST |
string | MongoDB host url, like |
|
MONGODB_PORT |
string | MongoDB port number, like |
|
MONGODB_NAME |
string | MongoDB name, like |
|
MONGODB_USERNAME |
string | MongoDB user name, like |
|
MONGODB_PASSWORD |
string | MongoDB password, like |
IndexOptions
Type:
- object
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
title |
string |
<optional> |
Retailer Service | Title of this retailer service |
description |
string |
<optional> |
A retailer server to crawl data from website | Description of this retailer service |
githubURL |
string |
<optional> |
https://github.com/bitskyai | Your github repo URL |
homeURL |
string |
<optional> |
https://bitsky.ai | Your github repo URL |
docURL |
string |
<optional> |
https://docs.bitsky.ai | Your document URL |
copyright |
string |
<optional> |
© 2020 BitSky.ai | copyright |
items |
Array.<Item> |
<optional> |
Additional links you want to render |
Item
Type:
- object
Properties:
Name | Type | Description |
---|---|---|
title |
string | Item title |
url |
string | Item url |
description |
string | Item description |
ParseFunReturn
Type:
- object
Properties:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tasks |
array |
<optional> |
Send an array of Task to BitSky application |
|||||||||||||||
data |
integer | string | Object | Array |
<optional> |
Data you want to save. If |
|||||||||||||||
response |
object |
<optional> |
Properties
|
Task
Type:
- object
Properties:
Name | Type | Attributes | Default | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string | web page url that need to be processed |
||||||||||
retailer |
object |
Properties
|
||||||||||
priority |
integer |
<optional> |
100 | Priority of this task. Only compare priority for same Retailer Service, doesn't compare cross Retailer Service. Bigger value low priority. Priority value 1 is higher than priority value 2. |
||||||||
suitableProducers |
array |
<optional> |
["HEADLESSBROWSER"] | What kind of producers can execute this task |
||||||||
metadata |
object |
<optional> |
Additional metadata for this task Properties
|
TriggerFunReturn
Type:
- object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
tasks |
array |
<optional> |
Send an array of Task to BitSky application |