UNPKG

ebay-api

Version:

eBay API for Node and Browser

85 lines (84 loc) 3.24 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const index_js_1 = __importDefault(require("../../index.js")); /** * The Feed API provides the ability to download TSV_GZIP feed files containing eBay items and an hourly snapshot file * of the items that have changed within an hour for a specific category, date and marketplace. */ class Feed extends index_js_1.default { get basePath() { return '/buy/feed/v1_beta'; } /** * This method lets you download a TSV_GZIP (tab separated value gzip) Item feed file. * * @param {BuyFeedParams} params * @param range his header specifies the range in bytes of the chunks of the gzip file being returned. * Format: bytes=startpos-endpos For example, the following retrieves the first 10 MBs of the feed file. */ getItemFeed(params, range) { return this.get(`/item`, { params, headers: { 'Range': range } }); } /** * This method lets you download a TSV_GZIP (tab separated value gzip) Item Group feed file. * @param {BuyFeedParams} params * @param range his header specifies the range in bytes of the chunks of the gzip file being returned. * Format: bytes=startpos-endpos For example, the following retrieves the first 10 MBs of the feed file. */ getItemGroupFeed(params, range) { return this.get(`/item_group`, { params, headers: { 'Range': range } }); } /** * The Hourly Snapshot feed file is generated each hour every day for all categories. * * @param {BuyFeedParams} params * @param {String} snapshotDate * @param range his header specifies the range in bytes of the chunks of the gzip file being returned. * Format: bytes=startpos-endpos For example, the following retrieves the first 10 MBs of the feed file. */ getItemSnapshotFeed(params, snapshotDate, range) { return this.get(`/item_snapshot`, { params: { ...params, snapshot_date: snapshotDate }, headers: { 'Range': range } }); } /** * The Hourly Snapshot feed file is generated each hour every day for all categories. * * @param {BuyFeedParams} params * @param {String} snapshotDate * @param range his header specifies the range in bytes of the chunks of the gzip file being returned. * Format: bytes=startpos-endpos For example, the following retrieves the first 10 MBs of the feed file. */ getProductFeed(params, snapshotDate, range) { return this.get(`/product`, { params: { ...params, snapshot_date: snapshotDate }, headers: { 'Range': range } }); } } exports.default = Feed; Feed.id = 'Feed';