ebay-api 9.1.1 → 9.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.
Files changed (38) hide show
  1. package/README.md +3 -3
  2. package/dist/api/apiFactory.js +3 -2
  3. package/dist/api/restful/developer/analytics/index.d.ts +1 -1
  4. package/dist/api/restful/sell/account/{index.d.ts → v1.d.ts} +1 -1
  5. package/dist/api/restful/sell/account/{index.js → v1.js} +3 -3
  6. package/dist/api/restful/sell/account/v2.d.ts +11 -0
  7. package/dist/api/restful/sell/account/v2.js +22 -0
  8. package/dist/api/restful/sell/feed/index.js +8 -2
  9. package/dist/api/restful/sell/fulfillment/index.d.ts +1 -1
  10. package/dist/api/restful/sell/index.d.ts +5 -3
  11. package/dist/api/restful/sell/index.js +3 -2
  12. package/dist/api/restful/sell/inventory/index.d.ts +4 -1
  13. package/dist/api/restful/sell/inventory/index.js +17 -2
  14. package/dist/ebay-api.min.mjs +1 -1
  15. package/dist/errors/index.js +8 -0
  16. package/dist/types/restful/specs/sell_account_v2_oas3.d.ts +154 -0
  17. package/dist/types/restful/specs/sell_account_v2_oas3.js +1 -0
  18. package/dist/types/restful/specs/sell_inventory_v1_oas3.d.ts +133 -4
  19. package/dist/types/restfulTypes.d.ts +12 -8
  20. package/lib/api/apiFactory.js +2 -1
  21. package/lib/api/restful/developer/analytics/index.d.ts +1 -1
  22. package/lib/api/restful/sell/account/{index.d.ts → v1.d.ts} +1 -1
  23. package/lib/api/restful/sell/account/{index.js → v1.js} +3 -3
  24. package/lib/api/restful/sell/account/v2.d.ts +11 -0
  25. package/lib/api/restful/sell/account/v2.js +27 -0
  26. package/lib/api/restful/sell/feed/index.js +8 -2
  27. package/lib/api/restful/sell/fulfillment/index.d.ts +1 -1
  28. package/lib/api/restful/sell/index.d.ts +5 -3
  29. package/lib/api/restful/sell/index.js +29 -27
  30. package/lib/api/restful/sell/inventory/index.d.ts +4 -1
  31. package/lib/api/restful/sell/inventory/index.js +17 -2
  32. package/lib/ebay-api.min.js +1 -1
  33. package/lib/errors/index.js +8 -0
  34. package/lib/types/restful/specs/sell_account_v2_oas3.d.ts +154 -0
  35. package/lib/types/restful/specs/sell_account_v2_oas3.js +2 -0
  36. package/lib/types/restful/specs/sell_inventory_v1_oas3.d.ts +133 -4
  37. package/lib/types/restfulTypes.d.ts +12 -8
  38. package/package.json +1 -1
package/README.md CHANGED
@@ -22,7 +22,7 @@ It supports `client credentials grant` and `authorization code grant` \(Auth'N'A
22
22
 
23
23
  ## Changelog
24
24
 
25
- * `v9.1.1` is the latest release.
25
+ * `v9.2.0-RC.0` is the latest release.
26
26
  * See [here](https://github.com/hendt/ebay-api/blob/master/CHANGELOG.md) for the full changelog.
27
27
 
28
28
  ## Implementation status
@@ -35,7 +35,7 @@ It supports `client credentials grant` and `authorization code grant` \(Auth'N'A
35
35
  | **Commerce API** | ✔ Catalog API `v1_beta.3.1`<br>✔ Charity API `v1.2.0`<br>✔ Identity API `v1.0.0`<br>✔ Notification API `v1.2.0`<br>✔ Taxonomy API `v1.0.0`<br>✔ Translation API `v1_beta.1.4`<br>✔ Media API `v1_beta.1.0` |
36
36
  | **Developer API** | ✔ Analytics API |
37
37
  | **Post Order API** | ✔ Cancellation API<br>✔ Case Management API<br>✔ Inquiry API<br>✔ Return API |
38
- | **Sell API** | ✔ Account API `v1.9.0`<br>✔ Analytics API `v1.3.0`<br>✔ Compliance API `v1.4.1`<br>✔ Feed API `v1.3.1`<br>✔ Finance API `v1.9.0`<br>✔ Fulfillment API `v1.19.10`<br>✔ Inventory API `v1.14.0`<br>✔ Listing API `v1_beta.2.1`<br>✔ Logistics API `v1_beta.0.0`<br>✔ Marketing API `v1.17.0`<br>✔ Metadata API `v1.7.1`<br>✔ Negotiation API `v1.1.0`<br>✔ Recommendation API `v1.1.0` |
38
+ | **Sell API** | ✔ Account API `v1.9.0`<br>✔ Analytics API `v1.3.0`<br>✔ Compliance API `v1.4.1`<br>✔ Feed API `v1.3.1`<br>✔ Finance API `v1.9.0`<br>✔ Fulfillment API `v1.19.10`<br>✔ Inventory API `v1.18.0`<br>✔ Listing API `v1_beta.2.1`<br>✔ Logistics API `v1_beta.0.0`<br>✔ Marketing API `v1.17.0`<br>✔ Metadata API `v1.7.1`<br>✔ Negotiation API `v1.1.0`<br>✔ Recommendation API `v1.1.0` |
39
39
 
40
40
  ### Traditional API
41
41
 
@@ -219,7 +219,7 @@ See the full Documentation [here](https://developer.ebay.com/api-docs/static/oau
219
219
  If no other token is set, this token will be obtained *automatically* in the process of calling an RESTful API.
220
220
 
221
221
  ### Auth'N'Auth
222
-
222
+ In the Single User Model, the application supports only a single user. In this model, you need only one Auth'n'Auth token.
223
223
  👉 The "old" way. Only works with Traditional API.
224
224
  Checkout the [Auth'N'Auth example](https://github.com/hendt/ebay-api/tree/master/examples/traditional/authNAuth.ts).
225
225
 
@@ -3,7 +3,7 @@ import { Browse, Deal, Feed, Marketing as BuyMarketing, MarketplaceInsights, Off
3
3
  import { Catalog, Charity, Identity, Media, Notification, Taxonomy, Translation } from './restful/commerce/index.js';
4
4
  import { Analytics as DeveloperAnalytics, KeyManagement } from './restful/developer/index.js';
5
5
  import { Cancellation, Case, Inquiry, Return, } from './restful/postOrder/index.js';
6
- import { Account, Analytics as SellAnalytics, Compliance, Feed as SellFeed, Finances, Fulfillment, Inventory, Listing, Logistics, Marketing as SellMarketing, Metadata, Negotiation, Recommendation } from './restful/sell/index.js';
6
+ import { AccountV1, AccountV2, Analytics as SellAnalytics, Compliance, Feed as SellFeed, Finances, Fulfillment, Inventory, Listing, Logistics, Marketing as SellMarketing, Metadata, Negotiation, Recommendation } from './restful/sell/index.js';
7
7
  import Traditional from './traditional/index.js';
8
8
  export default class ApiFactory extends Api {
9
9
  constructor() {
@@ -48,7 +48,8 @@ export default class ApiFactory extends Api {
48
48
  }
49
49
  createSellApi() {
50
50
  return {
51
- account: this.createRestfulApi(Account),
51
+ account: this.createRestfulApi(AccountV1),
52
+ accountV2: this.createRestfulApi(AccountV2),
52
53
  analytics: this.createRestfulApi(SellAnalytics),
53
54
  compliance: this.createRestfulApi(Compliance),
54
55
  fulfillment: this.createRestfulApi(Fulfillment),
@@ -3,6 +3,6 @@ import Restful, { OpenApi } from '../../index.js';
3
3
  export default class Analytics extends Restful implements OpenApi<operations> {
4
4
  static id: string;
5
5
  get basePath(): string;
6
- getRateLimits(apiContext: string, apiName: string): Promise<any>;
6
+ getRateLimits(apiContext?: string, apiName?: string): Promise<any>;
7
7
  getUserRateLimits(apiContext: string, apiName: string): Promise<any>;
8
8
  }
@@ -2,7 +2,7 @@ import { PaymentsProgramType } from '../../../../enums/index.js';
2
2
  import { CustomPolicyCreateRequest, CustomPolicyRequest, FulfillmentPolicyRequest, FulfillmentSellAccountProgram, InventoryLocation, InventoryLocationFull, PaymentPolicyRequest, ReturnPolicyRequest, SalesTaxBase } from '../../../../types/index.js';
3
3
  import { operations } from '../../../../types/restful/specs/sell_account_v1_oas3.js';
4
4
  import Restful, { OpenApi } from '../../index.js';
5
- export default class Account extends Restful implements OpenApi<operations> {
5
+ export default class AccountV1 extends Restful implements OpenApi<operations> {
6
6
  static id: string;
7
7
  get basePath(): string;
8
8
  getCustomPolicies(policyTypes: string): Promise<any>;
@@ -1,5 +1,5 @@
1
1
  import Restful from '../../index.js';
2
- class Account extends Restful {
2
+ class AccountV1 extends Restful {
3
3
  get basePath() {
4
4
  return '/sell/account/v1';
5
5
  }
@@ -216,5 +216,5 @@ class Account extends Restful {
216
216
  return this.get(`/country/${countryCode}/sales_tax_jurisdiction`);
217
217
  }
218
218
  }
219
- Account.id = 'Account';
220
- export default Account;
219
+ AccountV1.id = 'AccountV1';
220
+ export default AccountV1;
@@ -0,0 +1,11 @@
1
+ import { RateTableUpdate, UpdatePayoutPercentageRequest } from '../../../../types/index.js';
2
+ import { operations } from '../../../../types/restful/specs/sell_account_v2_oas3.js';
3
+ import Restful, { OpenApi } from '../../index.js';
4
+ export default class AccountV2 extends Restful implements OpenApi<operations> {
5
+ static id: string;
6
+ get basePath(): string;
7
+ getRateTable(rateTableId: string): Promise<any>;
8
+ updateShippingCost(rateTableId: string, body: RateTableUpdate): Promise<any>;
9
+ getPayoutSettings(): Promise<any>;
10
+ updatePayoutPercentage(body: UpdatePayoutPercentageRequest): Promise<any>;
11
+ }
@@ -0,0 +1,22 @@
1
+ import Restful from '../../index.js';
2
+ class AccountV2 extends Restful {
3
+ get basePath() {
4
+ return '/sell/account/v2';
5
+ }
6
+ getRateTable(rateTableId) {
7
+ rateTableId = encodeURIComponent(rateTableId);
8
+ return this.get(`/rate_table/${rateTableId}`);
9
+ }
10
+ updateShippingCost(rateTableId, body) {
11
+ rateTableId = encodeURIComponent(rateTableId);
12
+ return this.post(`/rate_table/${rateTableId}/update_shipping_cost`, body);
13
+ }
14
+ getPayoutSettings() {
15
+ return this.get('/payout_settings');
16
+ }
17
+ updatePayoutPercentage(body) {
18
+ return this.post(`/payout_settings/update_percentage`, body);
19
+ }
20
+ }
21
+ AccountV2.id = 'AccountV2';
22
+ export default AccountV2;
@@ -68,7 +68,10 @@ class Feed extends Restful {
68
68
  }
69
69
  getLatestResultFile(scheduleId) {
70
70
  scheduleId = encodeURIComponent(scheduleId);
71
- return this.get(`/schedule/${scheduleId}/download_result_file`);
71
+ return this.get(`/schedule/${scheduleId}/download_result_file`, {
72
+ responseType: 'arraybuffer',
73
+ responseEncoding: 'binary',
74
+ });
72
75
  }
73
76
  getScheduleTemplate(scheduleTemplateId) {
74
77
  scheduleTemplateId = encodeURIComponent(scheduleTemplateId);
@@ -104,7 +107,10 @@ class Feed extends Restful {
104
107
  }
105
108
  getResultFile(taskId) {
106
109
  taskId = encodeURIComponent(taskId);
107
- return this.get(`/task/${taskId}/download_result_file`);
110
+ return this.get(`/task/${taskId}/download_result_file`, {
111
+ responseType: 'arraybuffer',
112
+ responseEncoding: 'binary',
113
+ });
108
114
  }
109
115
  getTask(taskId) {
110
116
  taskId = encodeURIComponent(taskId);
@@ -12,7 +12,7 @@ export default class Fulfillment extends Restful implements OpenApi<operations>
12
12
  limit?: number;
13
13
  offset?: number;
14
14
  orderIds?: string | string[];
15
- fieldGroups?: string[];
15
+ fieldGroups?: string;
16
16
  }): Promise<any>;
17
17
  issueRefund(orderId: string, body?: IssueRefundRequest): Promise<any>;
18
18
  getShippingFulfillments(orderId: string): Promise<any>;
@@ -1,4 +1,5 @@
1
- import Account from './account/index.js';
1
+ import AccountV1 from './account/v1.js';
2
+ import AccountV2 from './account/v2.js';
2
3
  import Analytics from './analytics/index.js';
3
4
  import Compliance from './compliance/index.js';
4
5
  import Finances from './finances/index.js';
@@ -12,7 +13,8 @@ import Logistics from './logistics/index.js';
12
13
  import Negotiation from './negotiation/index.js';
13
14
  import Listing from './listing/index.js';
14
15
  export type Sell = {
15
- account: Account;
16
+ account: AccountV1;
17
+ accountV2: AccountV2;
16
18
  analytics: Analytics;
17
19
  compliance: Compliance;
18
20
  fulfillment: Fulfillment;
@@ -26,4 +28,4 @@ export type Sell = {
26
28
  negotiation: Negotiation;
27
29
  listing: Listing;
28
30
  };
29
- export { Account, Compliance, Analytics, Fulfillment, Inventory, Marketing, Metadata, Recommendation, Finances, Feed, Logistics, Negotiation, Listing };
31
+ export { AccountV1, AccountV2, Compliance, Analytics, Fulfillment, Inventory, Marketing, Metadata, Recommendation, Finances, Feed, Logistics, Negotiation, Listing };
@@ -1,4 +1,5 @@
1
- import Account from './account/index.js';
1
+ import AccountV1 from './account/v1.js';
2
+ import AccountV2 from './account/v2.js';
2
3
  import Analytics from './analytics/index.js';
3
4
  import Compliance from './compliance/index.js';
4
5
  import Finances from './finances/index.js';
@@ -11,4 +12,4 @@ import Feed from './feed/index.js';
11
12
  import Logistics from './logistics/index.js';
12
13
  import Negotiation from './negotiation/index.js';
13
14
  import Listing from './listing/index.js';
14
- export { Account, Compliance, Analytics, Fulfillment, Inventory, Marketing, Metadata, Recommendation, Finances, Feed, Logistics, Negotiation, Listing };
15
+ export { AccountV1, AccountV2, Compliance, Analytics, Fulfillment, Inventory, Marketing, Metadata, Recommendation, Finances, Feed, Logistics, Negotiation, Listing };
@@ -1,4 +1,4 @@
1
- import { BulkEbayOfferDetailsWithKeys, BulkInventoryItem, BulkMigrateListing, BulkOffer, BulkPriceQuantity, Compatibility, EbayOfferDetailsWithId, EbayOfferDetailsWithKeys, InventoryItem, InventoryItemGroup, InventoryLocation, InventoryLocationFull, OfferKeysWithId, PublishByInventoryItemGroupRequest, WithdrawByInventoryItemGroupRequest } from '../../../../types/index.js';
1
+ import { BulkEbayOfferDetailsWithKeys, BulkInventoryItem, BulkMigrateListing, BulkOffer, BulkPriceQuantity, Compatibility, EbayOfferDetailsWithId, EbayOfferDetailsWithKeys, InventoryItem, InventoryItemGroup, InventoryLocation, InventoryLocationFull, LocationMapping, OfferKeysWithId, PublishByInventoryItemGroupRequest, WithdrawByInventoryItemGroupRequest } from '../../../../types/index.js';
2
2
  import { operations } from '../../../../types/restful/specs/sell_inventory_v1_oas3.js';
3
3
  import Restful, { OpenApi } from '../../index.js';
4
4
  export default class Inventory extends Restful implements OpenApi<operations> {
@@ -49,4 +49,7 @@ export default class Inventory extends Restful implements OpenApi<operations> {
49
49
  createOrReplaceInventoryItemGroup(inventoryItemGroupKey: string, body: InventoryItemGroup): Promise<any>;
50
50
  deleteInventoryItemGroup(inventoryItemGroupKey: string): Promise<any>;
51
51
  bulkMigrateListing(body: BulkMigrateListing): Promise<any>;
52
+ getSkuLocationMapping(listingId: string, sku: string): Promise<any>;
53
+ createOrReplaceSkuLocationMapping(listingId: string, sku: string, body: LocationMapping): Promise<any>;
54
+ deleteSkuLocationMapping(listingId: string, sku: string): Promise<any>;
52
55
  }
@@ -103,10 +103,10 @@ class Inventory extends Restful {
103
103
  }
104
104
  publishOffer(offerId) {
105
105
  const id = encodeURIComponent(offerId);
106
- return this.post(`/offer/${id}/publish/`);
106
+ return this.post(`/offer/${id}/publish`);
107
107
  }
108
108
  publishOfferByInventoryItemGroup(body) {
109
- return this.post(`/offer/publish_by_inventory_item_group/`, body);
109
+ return this.post(`/offer/publish_by_inventory_item_group`, body);
110
110
  }
111
111
  withdrawOfferByInventoryItemGroup(body) {
112
112
  return this.post(`/offer/withdraw_by_inventory_item_group`, body);
@@ -138,6 +138,21 @@ class Inventory extends Restful {
138
138
  bulkMigrateListing(body) {
139
139
  return this.post(`/bulk_migrate_listing`, body);
140
140
  }
141
+ getSkuLocationMapping(listingId, sku) {
142
+ sku = encodeURIComponent(sku);
143
+ listingId = encodeURIComponent(listingId);
144
+ return this.get(`/listing/${listingId}/sku/${sku}/locations`);
145
+ }
146
+ createOrReplaceSkuLocationMapping(listingId, sku, body) {
147
+ sku = encodeURIComponent(sku);
148
+ listingId = encodeURIComponent(listingId);
149
+ return this.put(`/listing/${listingId}/sku/${sku}/locations`, body);
150
+ }
151
+ deleteSkuLocationMapping(listingId, sku) {
152
+ sku = encodeURIComponent(sku);
153
+ listingId = encodeURIComponent(listingId);
154
+ return this.delete(`/listing/${listingId}/sku/${sku}/locations`);
155
+ }
141
156
  }
142
157
  Inventory.id = 'Inventory';
143
158
  export default Inventory;