ebay-api 1.13.7 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -19
- package/README.md +512 -118
- package/lib/api/apiFactory.d.ts +27 -0
- package/lib/api/apiFactory.js +100 -0
- package/lib/api/apiFactory.js.map +1 -0
- package/lib/api/base.d.ts +13 -0
- package/lib/api/base.js +25 -0
- package/lib/api/base.js.map +1 -0
- package/lib/api/index.d.ts +11 -0
- package/lib/api/index.js +18 -0
- package/lib/api/index.js.map +1 -0
- package/lib/api/restful/buy/browse/index.d.ts +84 -0
- package/lib/api/restful/buy/browse/index.js +142 -0
- package/lib/api/restful/buy/browse/index.js.map +1 -0
- package/lib/api/restful/buy/deal/index.d.ts +55 -0
- package/lib/api/restful/buy/deal/index.js +80 -0
- package/lib/api/restful/buy/deal/index.js.map +1 -0
- package/lib/api/restful/buy/feed/index.d.ts +43 -0
- package/lib/api/restful/buy/feed/index.js +85 -0
- package/lib/api/restful/buy/feed/index.js.map +1 -0
- package/lib/api/restful/buy/index.d.ts +17 -0
- package/lib/api/restful/buy/index.js +21 -0
- package/lib/api/restful/buy/index.js.map +1 -0
- package/lib/api/restful/buy/marketing/index.d.ts +27 -0
- package/lib/api/restful/buy/marketing/index.js +51 -0
- package/lib/api/restful/buy/marketing/index.js.map +1 -0
- package/lib/api/restful/buy/marketplaceInsights/index.d.ts +28 -0
- package/lib/api/restful/buy/marketplaceInsights/index.js +51 -0
- package/lib/api/restful/buy/marketplaceInsights/index.js.map +1 -0
- package/lib/api/restful/buy/offer/index.d.ts +23 -0
- package/lib/api/restful/buy/offer/index.js +37 -0
- package/lib/api/restful/buy/offer/index.js.map +1 -0
- package/lib/api/restful/buy/order/index.d.ts +264 -0
- package/lib/api/restful/buy/order/index.js +369 -0
- package/lib/api/restful/buy/order/index.js.map +1 -0
- package/lib/api/restful/commerce/catalog/index.d.ts +73 -0
- package/lib/api/restful/commerce/catalog/index.js +108 -0
- package/lib/api/restful/commerce/catalog/index.js.map +1 -0
- package/lib/api/restful/commerce/charity/index.d.ts +34 -0
- package/lib/api/restful/commerce/charity/index.js +56 -0
- package/lib/api/restful/commerce/charity/index.js.map +1 -0
- package/lib/api/restful/commerce/identity/index.d.ts +14 -0
- package/lib/api/restful/commerce/identity/index.js +27 -0
- package/lib/api/restful/commerce/identity/index.js.map +1 -0
- package/lib/api/restful/commerce/index.d.ts +15 -0
- package/lib/api/restful/commerce/index.js +19 -0
- package/lib/api/restful/commerce/index.js.map +1 -0
- package/lib/api/restful/commerce/notification/index.d.ts +117 -0
- package/lib/api/restful/commerce/notification/index.js +187 -0
- package/lib/api/restful/commerce/notification/index.js.map +1 -0
- package/lib/api/restful/commerce/taxonomy/index.d.ts +78 -0
- package/lib/api/restful/commerce/taxonomy/index.js +135 -0
- package/lib/api/restful/commerce/taxonomy/index.js.map +1 -0
- package/lib/api/restful/commerce/translation/index.d.ts +15 -0
- package/lib/api/restful/commerce/translation/index.js +25 -0
- package/lib/api/restful/commerce/translation/index.js.map +1 -0
- package/lib/api/restful/developer/analytics/index.d.ts +22 -0
- package/lib/api/restful/developer/analytics/index.js +45 -0
- package/lib/api/restful/developer/analytics/index.js.map +1 -0
- package/lib/api/restful/developer/index.d.ts +5 -0
- package/lib/api/restful/developer/index.js +9 -0
- package/lib/api/restful/developer/index.js.map +1 -0
- package/lib/api/restful/index.d.ts +63 -0
- package/lib/api/restful/index.js +165 -0
- package/lib/api/restful/index.js.map +1 -0
- package/lib/api/restful/postOrder/cancellation/index.d.ts +57 -0
- package/lib/api/restful/postOrder/cancellation/index.js +95 -0
- package/lib/api/restful/postOrder/cancellation/index.js.map +1 -0
- package/lib/api/restful/postOrder/case/index.d.ts +63 -0
- package/lib/api/restful/postOrder/case/index.js +97 -0
- package/lib/api/restful/postOrder/case/index.js.map +1 -0
- package/lib/api/restful/postOrder/index.d.ts +11 -0
- package/lib/api/restful/postOrder/index.js +15 -0
- package/lib/api/restful/postOrder/index.js.map +1 -0
- package/lib/api/restful/postOrder/inquiry/index.d.ts +82 -0
- package/lib/api/restful/postOrder/inquiry/index.js +131 -0
- package/lib/api/restful/postOrder/inquiry/index.js.map +1 -0
- package/lib/api/restful/postOrder/return/index.d.ts +231 -0
- package/lib/api/restful/postOrder/return/index.js +361 -0
- package/lib/api/restful/postOrder/return/index.js.map +1 -0
- package/lib/api/restful/sell/account/index.d.ts +217 -0
- package/lib/api/restful/sell/account/index.js +337 -0
- package/lib/api/restful/sell/account/index.js.map +1 -0
- package/lib/api/restful/sell/analytics/index.d.ts +41 -0
- package/lib/api/restful/sell/analytics/index.js +61 -0
- package/lib/api/restful/sell/analytics/index.js.map +1 -0
- package/lib/api/restful/sell/compliance/index.d.ts +37 -0
- package/lib/api/restful/sell/compliance/index.js +57 -0
- package/lib/api/restful/sell/compliance/index.js.map +1 -0
- package/lib/api/restful/sell/feed/index.d.ts +151 -0
- package/lib/api/restful/sell/feed/index.js +255 -0
- package/lib/api/restful/sell/feed/index.js.map +1 -0
- package/lib/api/restful/sell/finances/index.d.ts +74 -0
- package/lib/api/restful/sell/finances/index.js +105 -0
- package/lib/api/restful/sell/finances/index.js.map +1 -0
- package/lib/api/restful/sell/fulfillment/index.d.ts +137 -0
- package/lib/api/restful/sell/fulfillment/index.js +199 -0
- package/lib/api/restful/sell/fulfillment/index.js.map +1 -0
- package/lib/api/restful/sell/index.d.ts +29 -0
- package/lib/api/restful/sell/index.js +33 -0
- package/lib/api/restful/sell/index.js.map +1 -0
- package/lib/api/restful/sell/inventory/index.d.ts +248 -0
- package/lib/api/restful/sell/inventory/index.js +346 -0
- package/lib/api/restful/sell/inventory/index.js.map +1 -0
- package/lib/api/restful/sell/listing/index.d.ts +14 -0
- package/lib/api/restful/sell/listing/index.js +25 -0
- package/lib/api/restful/sell/listing/index.js.map +1 -0
- package/lib/api/restful/sell/logistics/index.d.ts +44 -0
- package/lib/api/restful/sell/logistics/index.js +66 -0
- package/lib/api/restful/sell/logistics/index.js.map +1 -0
- package/lib/api/restful/sell/marketing/index.d.ts +443 -0
- package/lib/api/restful/sell/marketing/index.js +609 -0
- package/lib/api/restful/sell/marketing/index.js.map +1 -0
- package/lib/api/restful/sell/metadata/index.d.ts +77 -0
- package/lib/api/restful/sell/metadata/index.js +131 -0
- package/lib/api/restful/sell/metadata/index.js.map +1 -0
- package/lib/api/restful/sell/negotiation/index.d.ts +24 -0
- package/lib/api/restful/sell/negotiation/index.js +39 -0
- package/lib/api/restful/sell/negotiation/index.js.map +1 -0
- package/lib/api/restful/sell/recommendation/index.d.ts +26 -0
- package/lib/api/restful/sell/recommendation/index.js +39 -0
- package/lib/api/restful/sell/recommendation/index.js.map +1 -0
- package/lib/api/traditional/XMLRequest.d.ts +98 -0
- package/lib/api/traditional/XMLRequest.js +191 -0
- package/lib/api/traditional/XMLRequest.js.map +1 -0
- package/lib/api/traditional/clientAlerts/index.d.ts +9 -0
- package/lib/api/traditional/clientAlerts/index.js +15 -0
- package/lib/api/traditional/clientAlerts/index.js.map +1 -0
- package/lib/api/traditional/clientAlerts/types.d.ts +31 -0
- package/lib/api/traditional/clientAlerts/types.js +36 -0
- package/lib/api/traditional/clientAlerts/types.js.map +1 -0
- package/lib/api/traditional/fields.d.ts +1948 -0
- package/lib/api/traditional/fields.js +1949 -0
- package/lib/api/traditional/fields.js.map +1 -0
- package/lib/api/traditional/finding/index.d.ts +12 -0
- package/lib/api/traditional/finding/index.js +16 -0
- package/lib/api/traditional/finding/index.js.map +1 -0
- package/lib/api/traditional/index.d.ts +17 -0
- package/lib/api/traditional/index.js +207 -0
- package/lib/api/traditional/index.js.map +1 -0
- package/lib/api/traditional/merchandising/index.d.ts +7 -0
- package/lib/api/traditional/merchandising/index.js +11 -0
- package/lib/api/traditional/merchandising/index.js.map +1 -0
- package/lib/api/traditional/shopping/index.d.ts +11 -0
- package/lib/api/traditional/shopping/index.js +16 -0
- package/lib/api/traditional/shopping/index.js.map +1 -0
- package/lib/api/traditional/trading/index.d.ts +142 -0
- package/lib/api/traditional/trading/index.js +146 -0
- package/lib/api/traditional/trading/index.js.map +1 -0
- package/lib/auth/authNAuth.d.ts +49 -0
- package/lib/auth/authNAuth.js +122 -0
- package/lib/auth/authNAuth.js.map +1 -0
- package/lib/auth/index.d.ts +17 -0
- package/lib/auth/index.js +32 -0
- package/lib/auth/index.js.map +1 -0
- package/lib/auth/oAuth2.d.ts +90 -0
- package/lib/auth/oAuth2.js +258 -0
- package/lib/auth/oAuth2.js.map +1 -0
- package/lib/ebay-api.min.js +2 -0
- package/lib/ebay-api.min.js.map +1 -0
- package/lib/enums/apiEnums.d.ts +49 -0
- package/lib/enums/apiEnums.js +55 -0
- package/lib/enums/apiEnums.js.map +1 -0
- package/lib/enums/index.d.ts +2 -0
- package/lib/enums/index.js +15 -0
- package/lib/enums/index.js.map +1 -0
- package/lib/enums/restfulEnums.d.ts +966 -0
- package/lib/enums/restfulEnums.js +1012 -0
- package/lib/enums/restfulEnums.js.map +1 -0
- package/lib/errors/index.d.ts +66 -0
- package/lib/errors/index.js +208 -0
- package/lib/errors/index.js.map +1 -0
- package/lib/index.d.ts +56 -0
- package/lib/index.js +99 -0
- package/lib/index.js.map +1 -0
- package/lib/request.d.ts +26 -0
- package/lib/request.js +51 -0
- package/lib/request.js.map +1 -0
- package/lib/types/apiTypes.d.ts +28 -0
- package/lib/types/apiTypes.js +3 -0
- package/lib/types/apiTypes.js.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.js +16 -0
- package/lib/types/index.js.map +1 -0
- package/lib/types/restfulTypes.d.ts +1082 -0
- package/lib/types/restfulTypes.js +3 -0
- package/lib/types/restfulTypes.js.map +1 -0
- package/lib/types/traditonalTypes.d.ts +34 -0
- package/lib/types/traditonalTypes.js +3 -0
- package/lib/types/traditonalTypes.js.map +1 -0
- package/package.json +115 -21
- package/.npmignore +0 -17
- package/.travis.yml +0 -7
- package/examples/Finding-FindItemsByKeywords.js +0 -46
- package/examples/Merchandising-GetMostWatchedItemsRequest.js +0 -16
- package/examples/Shopping-GetSingleItem.js +0 -18
- package/examples/Trading-GetOrders.js +0 -26
- package/index.js +0 -10
- package/lib/deep-to-array.js +0 -42
- package/lib/defaults.js +0 -69
- package/lib/errors.js +0 -44
- package/lib/json-parser.js +0 -336
- package/lib/key-lists.js +0 -64
- package/lib/urls.js +0 -64
- package/lib/versions.js +0 -35
- package/lib/xml-converter.js +0 -21
- package/lib/xml-request.js +0 -207
- package/scripts/parse-input-xml.js +0 -41
- package/test/deep-to-array.test.js +0 -100
- package/test/errors.test.js +0 -75
- package/test/helpers.js +0 -22
- package/test/mocha.opts +0 -1
- package/test/mocks/GetMultipleItems.xml +0 -115
- package/test/mocks/GetOrders-empty.xml +0 -17
- package/test/mocks/GetOrders.xml +0 -463
- package/test/pagination.test.js +0 -5
- package/test/parsing.test.js +0 -248
- package/test/xml-request.test.js +0 -447
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ClientAlerts, Finding, Shopping, Trading, Merchandising } from '../types';
|
|
2
|
+
import Api from './';
|
|
3
|
+
import { Buy } from './restful/buy';
|
|
4
|
+
import { Commerce } from './restful/commerce';
|
|
5
|
+
import { Developer } from './restful/developer';
|
|
6
|
+
import { PostOrder } from './restful/postOrder';
|
|
7
|
+
import { Sell } from './restful/sell';
|
|
8
|
+
import Traditional from './traditional';
|
|
9
|
+
/**
|
|
10
|
+
* Factory class to create RESTFul API or Traditional API.
|
|
11
|
+
*/
|
|
12
|
+
export default class ApiFactory extends Api {
|
|
13
|
+
private _traditional?;
|
|
14
|
+
private _restful;
|
|
15
|
+
createBuyApi(): Buy;
|
|
16
|
+
createCommerceApi(): Commerce;
|
|
17
|
+
createDeveloperApi(): Developer;
|
|
18
|
+
createPostOrderApi(): PostOrder;
|
|
19
|
+
createSellApi(): Sell;
|
|
20
|
+
get traditional(): Traditional;
|
|
21
|
+
createTradingApi(): Trading;
|
|
22
|
+
createShoppingApi(): Shopping;
|
|
23
|
+
createFindingApi(): Finding;
|
|
24
|
+
createClientAlertsApi(): ClientAlerts;
|
|
25
|
+
createMerchandisingApi(): Merchandising;
|
|
26
|
+
private createRestfulApi;
|
|
27
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const _1 = __importDefault(require("./"));
|
|
7
|
+
const buy_1 = require("./restful/buy");
|
|
8
|
+
const commerce_1 = require("./restful/commerce");
|
|
9
|
+
const developer_1 = require("./restful/developer");
|
|
10
|
+
const postOrder_1 = require("./restful/postOrder");
|
|
11
|
+
const sell_1 = require("./restful/sell");
|
|
12
|
+
const traditional_1 = __importDefault(require("./traditional"));
|
|
13
|
+
/**
|
|
14
|
+
* Factory class to create RESTFul API or Traditional API.
|
|
15
|
+
*/
|
|
16
|
+
class ApiFactory extends _1.default {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this._restful = {};
|
|
20
|
+
}
|
|
21
|
+
createBuyApi() {
|
|
22
|
+
return {
|
|
23
|
+
browse: this.createRestfulApi(buy_1.Browse),
|
|
24
|
+
feed: this.createRestfulApi(buy_1.Feed),
|
|
25
|
+
marketing: this.createRestfulApi(buy_1.Marketing),
|
|
26
|
+
offer: this.createRestfulApi(buy_1.Offer),
|
|
27
|
+
order: this.createRestfulApi(buy_1.Order),
|
|
28
|
+
deal: this.createRestfulApi(buy_1.Deal),
|
|
29
|
+
marketplaceInsights: this.createRestfulApi(buy_1.MarketplaceInsights),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
createCommerceApi() {
|
|
33
|
+
return {
|
|
34
|
+
catalog: this.createRestfulApi(commerce_1.Catalog),
|
|
35
|
+
identity: this.createRestfulApi(commerce_1.Identity),
|
|
36
|
+
taxonomy: this.createRestfulApi(commerce_1.Taxonomy),
|
|
37
|
+
translation: this.createRestfulApi(commerce_1.Translation),
|
|
38
|
+
charity: this.createRestfulApi(commerce_1.Charity),
|
|
39
|
+
notification: this.createRestfulApi(commerce_1.Notification),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
createDeveloperApi() {
|
|
43
|
+
return {
|
|
44
|
+
analytics: this.createRestfulApi(developer_1.Analytics),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
createPostOrderApi() {
|
|
48
|
+
return {
|
|
49
|
+
cancellation: this.createRestfulApi(postOrder_1.Cancellation),
|
|
50
|
+
case: this.createRestfulApi(postOrder_1.Case),
|
|
51
|
+
inquiry: this.createRestfulApi(postOrder_1.Inquiry),
|
|
52
|
+
return: this.createRestfulApi(postOrder_1.Return),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
createSellApi() {
|
|
56
|
+
return {
|
|
57
|
+
account: this.createRestfulApi(sell_1.Account),
|
|
58
|
+
analytics: this.createRestfulApi(sell_1.Analytics),
|
|
59
|
+
compliance: this.createRestfulApi(sell_1.Compliance),
|
|
60
|
+
fulfillment: this.createRestfulApi(sell_1.Fulfillment),
|
|
61
|
+
inventory: this.createRestfulApi(sell_1.Inventory),
|
|
62
|
+
marketing: this.createRestfulApi(sell_1.Marketing),
|
|
63
|
+
metadata: this.createRestfulApi(sell_1.Metadata),
|
|
64
|
+
recommendation: this.createRestfulApi(sell_1.Recommendation),
|
|
65
|
+
finances: this.createRestfulApi(sell_1.Finances),
|
|
66
|
+
feed: this.createRestfulApi(sell_1.Feed),
|
|
67
|
+
logistics: this.createRestfulApi(sell_1.Logistics),
|
|
68
|
+
negotiation: this.createRestfulApi(sell_1.Negotiation),
|
|
69
|
+
listing: this.createRestfulApi(sell_1.Listing),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
get traditional() {
|
|
73
|
+
if (this._traditional) {
|
|
74
|
+
return this._traditional;
|
|
75
|
+
}
|
|
76
|
+
return (this._traditional = new traditional_1.default(this.config, this.req, this.auth));
|
|
77
|
+
}
|
|
78
|
+
createTradingApi() {
|
|
79
|
+
return this.traditional.createTradingApi();
|
|
80
|
+
}
|
|
81
|
+
createShoppingApi() {
|
|
82
|
+
return this.traditional.createShoppingApi();
|
|
83
|
+
}
|
|
84
|
+
createFindingApi() {
|
|
85
|
+
return this.traditional.createFindingApi();
|
|
86
|
+
}
|
|
87
|
+
createClientAlertsApi() {
|
|
88
|
+
return this.traditional.createClientAlertsApi();
|
|
89
|
+
}
|
|
90
|
+
createMerchandisingApi() {
|
|
91
|
+
return this.traditional.createMerchandisingApi();
|
|
92
|
+
}
|
|
93
|
+
// tslint:disable-next-line:variable-name
|
|
94
|
+
createRestfulApi(RestfulApiClass) {
|
|
95
|
+
const id = RestfulApiClass.id;
|
|
96
|
+
return (this._restful[id] || (this._restful[id] = new RestfulApiClass(this.config, this.req, this.auth)));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.default = ApiFactory;
|
|
100
|
+
//# sourceMappingURL=apiFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apiFactory.js","sourceRoot":"","sources":["../../src/api/apiFactory.ts"],"names":[],"mappings":";;;;;AACA,0CAAqB;AAErB,uCAAoH;AACpH,iDAA6G;AAC7G,mDAAgF;AAChF,mDAAoF;AACpF,yCAewB;AACxB,gEAAwC;AAExC;;GAEG;AACH,MAAqB,UAAW,SAAQ,UAAG;IAA3C;;QAEU,aAAQ,GAAQ,EAAE,CAAC;IA6F7B,CAAC;IA3FQ,YAAY;QACjB,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,YAAM,CAAC;YACrC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,UAAI,CAAC;YACjC,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,eAAY,CAAC;YAC9C,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,WAAK,CAAC;YACnC,KAAK,EAAE,IAAI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gBAAgB,CAAuB,eAAyB;QACtE,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,CAAC;QAC9B,OAAO,CACL,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,IAAI,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CACjG,CAAC;IACJ,CAAC;CACF;AA/FD,6BA+FC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IEBayApiRequest } from '../request';
|
|
2
|
+
import { AppConfig } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
* Abstract superclass.
|
|
5
|
+
*/
|
|
6
|
+
export default abstract class Base {
|
|
7
|
+
readonly config: AppConfig;
|
|
8
|
+
readonly req: IEBayApiRequest;
|
|
9
|
+
private readonly emitter;
|
|
10
|
+
constructor(config: AppConfig, req?: IEBayApiRequest);
|
|
11
|
+
on(name: string, callBack: (arg: any) => any): () => void;
|
|
12
|
+
protected emit(name: string, value: any): void;
|
|
13
|
+
}
|
package/lib/api/base.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const nanoevents_1 = __importDefault(require("nanoevents"));
|
|
7
|
+
const request_1 = require("../request");
|
|
8
|
+
/**
|
|
9
|
+
* Abstract superclass.
|
|
10
|
+
*/
|
|
11
|
+
class Base {
|
|
12
|
+
constructor(config, req = new request_1.AxiosRequest(config.axiosConfig)) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
this.req = req;
|
|
15
|
+
this.emitter = new nanoevents_1.default();
|
|
16
|
+
}
|
|
17
|
+
on(name, callBack) {
|
|
18
|
+
return this.emitter.on(name, callBack);
|
|
19
|
+
}
|
|
20
|
+
emit(name, value) {
|
|
21
|
+
return this.emitter.emit(name, value);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = Base;
|
|
25
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/api/base.ts"],"names":[],"mappings":";;;;;AAAA,4DAAoC;AACpC,wCAAyD;AAGzD;;GAEG;AACH,MAA8B,IAAI;IAMhC,YACE,MAAiB,EACjB,MAAuB,IAAI,sBAAY,CAAC,MAAM,CAAC,WAAW,CAAC;QAE3D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,IAAI,oBAAU,EAAE,CAAC;IAClC,CAAC;IAEM,EAAE,CAAC,IAAY,EAAE,QAA2B;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACzC,CAAC;IAES,IAAI,CAAC,IAAY,EAAE,KAAU;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACxC,CAAC;CACF;AAtBD,uBAsBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Auth from '../auth';
|
|
2
|
+
import { IEBayApiRequest } from '../request';
|
|
3
|
+
import { AppConfig } from '../types';
|
|
4
|
+
import Base from './base';
|
|
5
|
+
/**
|
|
6
|
+
* Superclass with Auth container.
|
|
7
|
+
*/
|
|
8
|
+
export default abstract class Api extends Base {
|
|
9
|
+
readonly auth: Auth;
|
|
10
|
+
constructor(config: AppConfig, req?: IEBayApiRequest, auth?: Auth);
|
|
11
|
+
}
|
package/lib/api/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const auth_1 = __importDefault(require("../auth"));
|
|
7
|
+
const base_1 = __importDefault(require("./base"));
|
|
8
|
+
/**
|
|
9
|
+
* Superclass with Auth container.
|
|
10
|
+
*/
|
|
11
|
+
class Api extends base_1.default {
|
|
12
|
+
constructor(config, req, auth) {
|
|
13
|
+
super(config, req);
|
|
14
|
+
this.auth = auth || new auth_1.default(this.config, this.req);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = Api;
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;;;AAAA,mDAA2B;AAG3B,kDAA0B;AAE1B;;GAEG;AACH,MAA8B,GAAI,SAAQ,cAAI;IAG5C,YACE,MAAiB,EACjB,GAAqB,EACrB,IAAW;QAEX,KAAK,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,IAAI,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACtD,CAAC;CAEF;AAZD,sBAYC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import Restful from '../../';
|
|
2
|
+
import { AddCartItemInput, BrowseSearchParams, CompatibilityPayload, ItemsParams, LegacyItemParams, RemoveCartItemInput, SearchByImageParams, UpdateCartItemInput } from '../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* The Browse API has the following resources: item_summary: Lets shoppers search for specific items by keyword, GTIN,
|
|
5
|
+
* category, charity, product, or item aspects and refine the results by using filters, such as aspects, compatibility,
|
|
6
|
+
* and fields values.
|
|
7
|
+
*/
|
|
8
|
+
export default class Browse extends Restful {
|
|
9
|
+
static id: string;
|
|
10
|
+
get basePath(): string;
|
|
11
|
+
/**
|
|
12
|
+
* This method searches for eBay items by various query parameters and retrieves summaries of the items.
|
|
13
|
+
*
|
|
14
|
+
* @param {BrowseSearchParams} params
|
|
15
|
+
*/
|
|
16
|
+
search(params: BrowseSearchParams): Promise<any>;
|
|
17
|
+
/**
|
|
18
|
+
* This is an Experimental method. This method searches for eBay items based on a image and retrieves summaries of
|
|
19
|
+
* the items.
|
|
20
|
+
*
|
|
21
|
+
* @param {BrowseSearchParams} params
|
|
22
|
+
* @param {Object} body The container for the image information fields.
|
|
23
|
+
*/
|
|
24
|
+
searchByImage(params: SearchByImageParams, body?: {}): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* This method retrieves the details of specific items that the buyer needs to make a purchasing decision.
|
|
27
|
+
*
|
|
28
|
+
* @param itemIds A list of item IDs. Item IDs are the eBay RESTful identifier of items.
|
|
29
|
+
* @param itemGroupIds A list of item group IDs.
|
|
30
|
+
*/
|
|
31
|
+
getItems({ itemIds: item_ids, itemGroupIds: item_group_ids }: ItemsParams): Promise<any>;
|
|
32
|
+
/**
|
|
33
|
+
* This method retrieves the details of a specific item, such as description, price, category, all item aspects,
|
|
34
|
+
* condition, return policies, seller feedback and score, shipping options, shipping costs, estimated delivery,
|
|
35
|
+
* and other information the buyer needs to make a purchasing decision.
|
|
36
|
+
*
|
|
37
|
+
* @param {String} itemId The eBay RESTful identifier of an item.
|
|
38
|
+
* @param {String} fieldgroups
|
|
39
|
+
*/
|
|
40
|
+
getItem(itemId: string, fieldgroups?: string): Promise<any>;
|
|
41
|
+
/**
|
|
42
|
+
* This method is a bridge between the eBay legacy APIs, such as Shopping, and Finding and the eBay Api APIs.
|
|
43
|
+
*
|
|
44
|
+
* @param {LegacyItemParams} params
|
|
45
|
+
*/
|
|
46
|
+
getItemByLegacyId(params: LegacyItemParams): Promise<any>;
|
|
47
|
+
/**
|
|
48
|
+
* This method retrieves the details of the individual items in an item group.
|
|
49
|
+
*
|
|
50
|
+
* @param itemGroupId
|
|
51
|
+
*/
|
|
52
|
+
getItemsByItemGroup(itemGroupId: string): Promise<any>;
|
|
53
|
+
/**
|
|
54
|
+
* This method checks if a product is compatible with the specified item.
|
|
55
|
+
* @param {String} itemId The eBay RESTful identifier of an item (such as a part you want to check).
|
|
56
|
+
* @param {Object} body CompatibilityPayload
|
|
57
|
+
*/
|
|
58
|
+
checkCompatibility(itemId: string, body?: CompatibilityPayload): Promise<any>;
|
|
59
|
+
/**
|
|
60
|
+
* This is an Experimental method. This method creates an eBay cart for the eBay member, if one does not exist, and
|
|
61
|
+
* adds items to that cart.
|
|
62
|
+
*
|
|
63
|
+
* @param {Object} item AddCartItemInput
|
|
64
|
+
*/
|
|
65
|
+
addItem(item: AddCartItemInput): Promise<any>;
|
|
66
|
+
/**
|
|
67
|
+
* This is an experimental method. This method retrieves all the items in the eBay member's cart;
|
|
68
|
+
* items added to the cart while on ebay.com as well as items added to the cart using the Browse API.
|
|
69
|
+
*/
|
|
70
|
+
getShoppingCart(): Promise<any>;
|
|
71
|
+
/**
|
|
72
|
+
* This is an experimental method. This method removes a specific item from the eBay member's cart.
|
|
73
|
+
*
|
|
74
|
+
* @param {Object} item RemoveCartItemInput
|
|
75
|
+
*/
|
|
76
|
+
removeItem(item: RemoveCartItemInput): Promise<any>;
|
|
77
|
+
/**
|
|
78
|
+
* This is an experimental method. This method updates the quantity value of a specific item in the eBay member's
|
|
79
|
+
* cart.
|
|
80
|
+
*
|
|
81
|
+
* @param {UpdateCartItemInput} item UpdateCartItemInput
|
|
82
|
+
*/
|
|
83
|
+
updateQuantity(item: UpdateCartItemInput): Promise<any>;
|
|
84
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const __1 = __importDefault(require("../../"));
|
|
7
|
+
/**
|
|
8
|
+
* The Browse API has the following resources: item_summary: Lets shoppers search for specific items by keyword, GTIN,
|
|
9
|
+
* category, charity, product, or item aspects and refine the results by using filters, such as aspects, compatibility,
|
|
10
|
+
* and fields values.
|
|
11
|
+
*/
|
|
12
|
+
class Browse extends __1.default {
|
|
13
|
+
get basePath() {
|
|
14
|
+
return '/buy/browse/v1';
|
|
15
|
+
}
|
|
16
|
+
//
|
|
17
|
+
// Item
|
|
18
|
+
// Client Credentials: https://api.ebay.com/oauth/api_scope
|
|
19
|
+
//
|
|
20
|
+
/**
|
|
21
|
+
* This method searches for eBay items by various query parameters and retrieves summaries of the items.
|
|
22
|
+
*
|
|
23
|
+
* @param {BrowseSearchParams} params
|
|
24
|
+
*/
|
|
25
|
+
search(params) {
|
|
26
|
+
return this.get(`/item_summary/search`, {
|
|
27
|
+
params
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* This is an Experimental method. This method searches for eBay items based on a image and retrieves summaries of
|
|
32
|
+
* the items.
|
|
33
|
+
*
|
|
34
|
+
* @param {BrowseSearchParams} params
|
|
35
|
+
* @param {Object} body The container for the image information fields.
|
|
36
|
+
*/
|
|
37
|
+
searchByImage(params, body = {}) {
|
|
38
|
+
return this.post(`/item_summary/search_by_image`, body, {
|
|
39
|
+
params
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* This method retrieves the details of specific items that the buyer needs to make a purchasing decision.
|
|
44
|
+
*
|
|
45
|
+
* @param itemIds A list of item IDs. Item IDs are the eBay RESTful identifier of items.
|
|
46
|
+
* @param itemGroupIds A list of item group IDs.
|
|
47
|
+
*/
|
|
48
|
+
getItems({ itemIds: item_ids, itemGroupIds: item_group_ids }) {
|
|
49
|
+
return this.get(`/item/`, {
|
|
50
|
+
params: {
|
|
51
|
+
item_ids,
|
|
52
|
+
item_group_ids
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* This method retrieves the details of a specific item, such as description, price, category, all item aspects,
|
|
58
|
+
* condition, return policies, seller feedback and score, shipping options, shipping costs, estimated delivery,
|
|
59
|
+
* and other information the buyer needs to make a purchasing decision.
|
|
60
|
+
*
|
|
61
|
+
* @param {String} itemId The eBay RESTful identifier of an item.
|
|
62
|
+
* @param {String} fieldgroups
|
|
63
|
+
*/
|
|
64
|
+
getItem(itemId, fieldgroups) {
|
|
65
|
+
const id = encodeURIComponent(itemId);
|
|
66
|
+
return this.get(`/item/${id}`, {
|
|
67
|
+
params: {
|
|
68
|
+
fieldgroups
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* This method is a bridge between the eBay legacy APIs, such as Shopping, and Finding and the eBay Api APIs.
|
|
74
|
+
*
|
|
75
|
+
* @param {LegacyItemParams} params
|
|
76
|
+
*/
|
|
77
|
+
getItemByLegacyId(params) {
|
|
78
|
+
return this.get(`/item/get_item_by_legacy_id`, {
|
|
79
|
+
params
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* This method retrieves the details of the individual items in an item group.
|
|
84
|
+
*
|
|
85
|
+
* @param itemGroupId
|
|
86
|
+
*/
|
|
87
|
+
getItemsByItemGroup(itemGroupId) {
|
|
88
|
+
return this.get(`/item/get_items_by_item_group`, {
|
|
89
|
+
params: {
|
|
90
|
+
item_group_id: itemGroupId
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* This method checks if a product is compatible with the specified item.
|
|
96
|
+
* @param {String} itemId The eBay RESTful identifier of an item (such as a part you want to check).
|
|
97
|
+
* @param {Object} body CompatibilityPayload
|
|
98
|
+
*/
|
|
99
|
+
checkCompatibility(itemId, body) {
|
|
100
|
+
const id = encodeURIComponent(itemId);
|
|
101
|
+
return this.post(`/item/${id}/check_compatibility`, body);
|
|
102
|
+
}
|
|
103
|
+
//
|
|
104
|
+
// Shopping Cart
|
|
105
|
+
//
|
|
106
|
+
/**
|
|
107
|
+
* This is an Experimental method. This method creates an eBay cart for the eBay member, if one does not exist, and
|
|
108
|
+
* adds items to that cart.
|
|
109
|
+
*
|
|
110
|
+
* @param {Object} item AddCartItemInput
|
|
111
|
+
*/
|
|
112
|
+
addItem(item) {
|
|
113
|
+
return this.post(`/shopping_cart/add_item`, item);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* This is an experimental method. This method retrieves all the items in the eBay member's cart;
|
|
117
|
+
* items added to the cart while on ebay.com as well as items added to the cart using the Browse API.
|
|
118
|
+
*/
|
|
119
|
+
getShoppingCart() {
|
|
120
|
+
return this.get(`/shopping_cart/`);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* This is an experimental method. This method removes a specific item from the eBay member's cart.
|
|
124
|
+
*
|
|
125
|
+
* @param {Object} item RemoveCartItemInput
|
|
126
|
+
*/
|
|
127
|
+
removeItem(item) {
|
|
128
|
+
return this.post(`/shopping_cart/remove_item`, item);
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* This is an experimental method. This method updates the quantity value of a specific item in the eBay member's
|
|
132
|
+
* cart.
|
|
133
|
+
*
|
|
134
|
+
* @param {UpdateCartItemInput} item UpdateCartItemInput
|
|
135
|
+
*/
|
|
136
|
+
updateQuantity(item) {
|
|
137
|
+
return this.post(`/shopping_cart/update_quantity`, item);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
exports.default = Browse;
|
|
141
|
+
Browse.id = 'Browse';
|
|
142
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/restful/buy/browse/index.ts"],"names":[],"mappings":";;;;;AAAA,+CAA6B;AAW7B;;;;GAIG;AACH,MAAqB,MAAO,SAAQ,WAAO;IAIzC,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AAkB,CAAC,MAAM,CAAC,CAAC;QACtC,OAAO,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,sBAAsB,EAAE,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,EAAE;IACF,gBAAgB;IAChB,EAAE;IAEF;;;;;OAKG;IACI,OAAO,CAAC,IAAsB;QACnC,OAAO,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAED;;;OAGG;IACI,eAAe;QACpB,OAAO,IAAI,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACI,UAAU,CAAC,IAAyB;QACzC,OAAO,IAAI,CAAC,IAAI,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;IACvD,CAAC;IAED;;;;;OAKG;IACI,cAAc,CAAC,IAAyB;QAC7C,OAAO,IAAI,CAAC,IAAI,CAAC,gCAAgC,EAAE,IAAI,CAAC,CAAC;IAC3D,CAAC;;AA9IH,yBA+IC;AA7IQ,SAAE,GAAG,QAAQ,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import Restful from '../../';
|
|
2
|
+
/**
|
|
3
|
+
* This API allows third-party developers to search for and retrieve details about eBay deals and events, as well as the items associated with those deals and events.
|
|
4
|
+
*/
|
|
5
|
+
export default class Deal extends Restful {
|
|
6
|
+
static id: string;
|
|
7
|
+
get basePath(): string;
|
|
8
|
+
/**
|
|
9
|
+
* This method retrieves a paginated set of deal items.
|
|
10
|
+
*
|
|
11
|
+
* @param categoryIds The unique identifier of the eBay category for the search.
|
|
12
|
+
* @param commissionable A filter for commissionable deals. Restriction: This filter is currently only supported for the US marketplace.
|
|
13
|
+
* @param deliveryCountry A filter for items that can be shipped to the specified country.
|
|
14
|
+
* @param limit The maximum number of items, from the current result set, returned on a single page.
|
|
15
|
+
* @param offset The number of items that will be skipped in the result set.
|
|
16
|
+
*/
|
|
17
|
+
getDealItems({ categoryIds, commissionable, deliveryCountry, limit, offset }: {
|
|
18
|
+
categoryIds?: string;
|
|
19
|
+
commissionable?: string;
|
|
20
|
+
deliveryCountry?: string;
|
|
21
|
+
limit?: string;
|
|
22
|
+
offset?: string;
|
|
23
|
+
}): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* This method retrieves the details for an eBay event.
|
|
26
|
+
*
|
|
27
|
+
* @param eventId The unique identifier for the eBay event.
|
|
28
|
+
*/
|
|
29
|
+
getEvent(eventId: string): Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* This method returns paginated results containing all eBay events for the specified marketplace.
|
|
32
|
+
*
|
|
33
|
+
* @param limit The maximum number of items, from the current result set, returned on a single page. Default: 20 Maximum Value: 100
|
|
34
|
+
* @param offset The number of items that will be skipped in the result set.
|
|
35
|
+
*/
|
|
36
|
+
getEvents({ limit, offset }: {
|
|
37
|
+
limit?: string;
|
|
38
|
+
offset?: string;
|
|
39
|
+
}): Promise<any>;
|
|
40
|
+
/**
|
|
41
|
+
* This method returns paginated results containing all eBay events for the specified marketplace.
|
|
42
|
+
*
|
|
43
|
+
* @param eventIds The unique identifiers for the eBay events. Maximum Value: 1
|
|
44
|
+
* @param categoryIds The unique identifier of the eBay category for the search. Maximum Value: 1
|
|
45
|
+
* @param deliveryCountry A filter for items that can be shipped to the specified country.
|
|
46
|
+
* @param limit The maximum number of items, from the current result set, returned on a single page. Default: 20 Maximum Value: 100
|
|
47
|
+
* @param offset The number of items that will be skipped in the result set.
|
|
48
|
+
*/
|
|
49
|
+
getEventItems(eventIds: string, { categoryIds, deliveryCountry, limit, offset }?: {
|
|
50
|
+
categoryIds?: string;
|
|
51
|
+
deliveryCountry?: string;
|
|
52
|
+
limit?: string;
|
|
53
|
+
offset?: string;
|
|
54
|
+
}): Promise<any>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const __1 = __importDefault(require("../../"));
|
|
7
|
+
/**
|
|
8
|
+
* This API allows third-party developers to search for and retrieve details about eBay deals and events, as well as the items associated with those deals and events.
|
|
9
|
+
*/
|
|
10
|
+
class Deal extends __1.default {
|
|
11
|
+
get basePath() {
|
|
12
|
+
return '/buy/deal/v1';
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* This method retrieves a paginated set of deal items.
|
|
16
|
+
*
|
|
17
|
+
* @param categoryIds The unique identifier of the eBay category for the search.
|
|
18
|
+
* @param commissionable A filter for commissionable deals. Restriction: This filter is currently only supported for the US marketplace.
|
|
19
|
+
* @param deliveryCountry A filter for items that can be shipped to the specified country.
|
|
20
|
+
* @param limit The maximum number of items, from the current result set, returned on a single page.
|
|
21
|
+
* @param offset The number of items that will be skipped in the result set.
|
|
22
|
+
*/
|
|
23
|
+
getDealItems({ categoryIds, commissionable, deliveryCountry, limit, offset }) {
|
|
24
|
+
return this.get(`/deal_item`, {
|
|
25
|
+
params: {
|
|
26
|
+
category_ids: categoryIds,
|
|
27
|
+
commissionable,
|
|
28
|
+
delivery_country: deliveryCountry,
|
|
29
|
+
limit,
|
|
30
|
+
offset
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* This method retrieves the details for an eBay event.
|
|
36
|
+
*
|
|
37
|
+
* @param eventId The unique identifier for the eBay event.
|
|
38
|
+
*/
|
|
39
|
+
getEvent(eventId) {
|
|
40
|
+
eventId = encodeURIComponent(eventId);
|
|
41
|
+
return this.get(`/event/${eventId}`);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* This method returns paginated results containing all eBay events for the specified marketplace.
|
|
45
|
+
*
|
|
46
|
+
* @param limit The maximum number of items, from the current result set, returned on a single page. Default: 20 Maximum Value: 100
|
|
47
|
+
* @param offset The number of items that will be skipped in the result set.
|
|
48
|
+
*/
|
|
49
|
+
getEvents({ limit, offset }) {
|
|
50
|
+
return this.get(`/event`, {
|
|
51
|
+
params: {
|
|
52
|
+
limit,
|
|
53
|
+
offset
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* This method returns paginated results containing all eBay events for the specified marketplace.
|
|
59
|
+
*
|
|
60
|
+
* @param eventIds The unique identifiers for the eBay events. Maximum Value: 1
|
|
61
|
+
* @param categoryIds The unique identifier of the eBay category for the search. Maximum Value: 1
|
|
62
|
+
* @param deliveryCountry A filter for items that can be shipped to the specified country.
|
|
63
|
+
* @param limit The maximum number of items, from the current result set, returned on a single page. Default: 20 Maximum Value: 100
|
|
64
|
+
* @param offset The number of items that will be skipped in the result set.
|
|
65
|
+
*/
|
|
66
|
+
getEventItems(eventIds, { categoryIds, deliveryCountry, limit, offset } = {}) {
|
|
67
|
+
return this.get(`/event_item`, {
|
|
68
|
+
params: {
|
|
69
|
+
event_ids: eventIds,
|
|
70
|
+
limit,
|
|
71
|
+
offset,
|
|
72
|
+
category_ids: categoryIds,
|
|
73
|
+
delivery_country: deliveryCountry
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports.default = Deal;
|
|
79
|
+
Deal.id = 'Deal';
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/api/restful/buy/deal/index.ts"],"names":[],"mappings":";;;;;AAAA,+CAA6B;AAE7B;;GAEG;AACH,MAAqB,IAAK,SAAQ,WAAO;IAIvC,IAAI,QAAQ;QACV,OAAO,cAAc,CAAC;IACxB,CAAC;IAED;;;;;;;;OAQG;IACI,YAAY,CAAC,EAClB,WAAW,EACX,cAAc,EACd,eAAe,EACf,KAAK,EACL,MAAM,EACuG;QAC7G,OAAO,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE;YAC5B,MAAM,EAAE;gBACN,YAAY,EAAE,WAAW;gBACzB,cAAc;gBACd,gBAAgB,EAAE,eAAe;gBACjC,KAAK;gBACL,MAAM;aACP;SACF,CAAC,CAAC;IACL,CAAC;IAED;;;;OAIG;IACI,QAAQ,CAAC,OAAe;QAC7B,OAAO,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAA;QACrC,OAAO,IAAI,CAAC,GAAG,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;IACvC,CAAC;IAED;;;;;OAKG;IACI,SAAS,CAAC,EAAC,KAAK,EAAE,MAAM,EAAuC;QACpE,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE;YACxB,MAAM,EAAE;gBACN,KAAK;gBACL,MAAM;aACP;SACF,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;OAQG;IACI,aAAa,CAAC,QAAgB,EAAE,EACrC,WAAW,EACX,eAAe,EACf,KAAK,EACL,MAAM,KACkF,EAAE;QAC1F,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE;YAC7B,MAAM,EAAE;gBACN,SAAS,EAAE,QAAQ;gBACnB,KAAK;gBACL,MAAM;gBACN,YAAY,EAAE,WAAW;gBACzB,gBAAgB,EAAE,eAAe;aAClC;SACF,CAAC,CAAC;IACL,CAAC;;AApFH,uBAqFC;AAnFQ,OAAE,GAAG,MAAM,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import Restful from '../../';
|
|
2
|
+
import { BuyFeedParams } from '../../../../types';
|
|
3
|
+
/**
|
|
4
|
+
* The Feed API provides the ability to download TSV_GZIP feed files containing eBay items and an hourly snapshot file
|
|
5
|
+
* of the items that have changed within an hour for a specific category, date and marketplace.
|
|
6
|
+
*/
|
|
7
|
+
export default class Feed extends Restful {
|
|
8
|
+
static id: string;
|
|
9
|
+
get basePath(): string;
|
|
10
|
+
/**
|
|
11
|
+
* This method lets you download a TSV_GZIP (tab separated value gzip) Item feed file.
|
|
12
|
+
*
|
|
13
|
+
* @param {BuyFeedParams} params
|
|
14
|
+
* @param range his header specifies the range in bytes of the chunks of the gzip file being returned.
|
|
15
|
+
* Format: bytes=startpos-endpos For example, the following retrieves the first 10 MBs of the feed file.
|
|
16
|
+
*/
|
|
17
|
+
getItemFeed(params: BuyFeedParams, range: string): Promise<any>;
|
|
18
|
+
/**
|
|
19
|
+
* This method lets you download a TSV_GZIP (tab separated value gzip) Item Group feed file.
|
|
20
|
+
* @param {BuyFeedParams} params
|
|
21
|
+
* @param range his header specifies the range in bytes of the chunks of the gzip file being returned.
|
|
22
|
+
* Format: bytes=startpos-endpos For example, the following retrieves the first 10 MBs of the feed file.
|
|
23
|
+
*/
|
|
24
|
+
getItemGroupFeed(params: BuyFeedParams, range: string): Promise<any>;
|
|
25
|
+
/**
|
|
26
|
+
* The Hourly Snapshot feed file is generated each hour every day for all categories.
|
|
27
|
+
*
|
|
28
|
+
* @param {BuyFeedParams} params
|
|
29
|
+
* @param {String} snapshotDate
|
|
30
|
+
* @param range his header specifies the range in bytes of the chunks of the gzip file being returned.
|
|
31
|
+
* Format: bytes=startpos-endpos For example, the following retrieves the first 10 MBs of the feed file.
|
|
32
|
+
*/
|
|
33
|
+
getItemSnapshotFeed(params: BuyFeedParams, snapshotDate: string, range: string): Promise<any>;
|
|
34
|
+
/**
|
|
35
|
+
* The Hourly Snapshot feed file is generated each hour every day for all categories.
|
|
36
|
+
*
|
|
37
|
+
* @param {BuyFeedParams} params
|
|
38
|
+
* @param {String} snapshotDate
|
|
39
|
+
* @param range his header specifies the range in bytes of the chunks of the gzip file being returned.
|
|
40
|
+
* Format: bytes=startpos-endpos For example, the following retrieves the first 10 MBs of the feed file.
|
|
41
|
+
*/
|
|
42
|
+
getProductFeed(params: BuyFeedParams, snapshotDate: string, range: string): Promise<any>;
|
|
43
|
+
}
|