This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| { | |
| "time": 1662715800000, | |
| "low": 315.01, | |
| "high": 316.2, | |
| "open": 316.2, | |
| "close": 315.87 | |
| }, | |
| { | |
| "time": 1662715860000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const request = { | |
| request: [ | |
| { | |
| $: { | |
| 'xmlns:i': 'http://www.w3.org/2001/XMLSchema-instance', | |
| }, | |
| ReportPath: { | |
| _: params.report_path | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const getJobSchema = () => ({ | |
| description: 'The type of job you wish to start.', | |
| type: 'object', | |
| required: true, | |
| oneOf: [ | |
| { | |
| title: 'Blast Query', | |
| type: 'object', | |
| properties: { | |
| blast_query: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Parses a buffer response from API. | |
| exports.parseBuffer = input => { | |
| let json = (new Buffer(input)).toString("utf8"); | |
| // Regex here converts numbers larger than 9 digits to strings. | |
| json = json.replace(/([\[:])?(\d{9,})([,\}\]])/g, "$1\"$2\"$3"); | |
| json = JSON.parse(json); | |
| return { | |
| result: json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const RETURNABLE_IMAGE_FIELDS = [ | |
| 'summary_set', | |
| 'display_set', | |
| 'detail_set', | |
| 'allowed_use', | |
| 'alternative_ids', | |
| 'artist', | |
| 'artist_title', | |
| 'asset_family', | |
| 'call_for_image', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Request: | |
| { | |
| url: 'https://sandbox.walmartapis.com/v3/token', | |
| data: { grant_type: 'client_credentials' }, | |
| options: { | |
| headers: { | |
| Authorization: 'Basic <base64String>=', | |
| Accept: 'application/json', | |
| 'Content-Type': 'application/x-www-form-urlencoded', | |
| 'WM_SVC.NAME': 'Walmart Marketplace', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const stocks = [ | |
| ['Apple (APPL)', 159, '2.0%', '26/04/20', 'First'], | |
| ['Amazon (AMZN)', 237, '9.0%', '25/04/20', 'Second'], | |
| ['Netflix (NFLX)', 262, '16.0%', '23/04/20', 'First'], | |
| ['Alphabet (GOOGL)', 305, '3.7%', '21/04/20', 'Second'], | |
| ['Microsoft (MSFT)', 356, '16.0%', '13/04/20', 'Fourth'] | |
| ] | |
| const createData = (name, price, change, date, watchlist) => { | |
| return { name, price, change, date, watchlist } |