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
@@ -200,9 +200,17 @@ const handleEBayError = (error) => {
200
200
  };
201
201
  exports.handleEBayError = handleEBayError;
202
202
  const checkEBayTraditionalResponse = (apiResponse, data) => {
203
+ if (!data) {
204
+ log('checkEBayTraditionalResponse: No data found in response.');
205
+ return;
206
+ }
203
207
  if (!('Errors' in data) && !('errorMessage' in data)) {
204
208
  return;
205
209
  }
210
+ if ('Errors' in data && data.Ack !== 'Failure') {
211
+ log(`checkEBayTraditionalResponse: eBay API returned ${data.Ack}`);
212
+ return;
213
+ }
206
214
  const { message, meta, description, errorCode, firstError } = (0, exports.extractEBayError)(apiResponse, data);
207
215
  if (typeof errorCode === 'undefined') {
208
216
  throw new EBayApiError(message, description, meta, errorCode, firstError);
@@ -0,0 +1,154 @@
1
+ export interface paths {
2
+ "/rate_table/{rate_table_id}": {
3
+ get: operations["getRateTable"];
4
+ };
5
+ "/rate_table/{rate_table_id}/update_shipping_cost": {
6
+ post: operations["updateShippingCost"];
7
+ };
8
+ "/payout_settings": {
9
+ get: operations["getPayoutSettings"];
10
+ };
11
+ "/payout_settings/update_percentage": {
12
+ post: operations["updatePayoutPercentage"];
13
+ };
14
+ }
15
+ export type webhooks = Record<string, never>;
16
+ export interface components {
17
+ schemas: {
18
+ Amount: {
19
+ currency?: string;
20
+ value?: string;
21
+ };
22
+ Error: {
23
+ category?: string;
24
+ domain?: string;
25
+ errorId?: number;
26
+ inputRefIds?: (string)[];
27
+ longMessage?: string;
28
+ message?: string;
29
+ outputRefIds?: (string)[];
30
+ parameters?: (components["schemas"]["ErrorParameter"])[];
31
+ subdomain?: string;
32
+ };
33
+ ErrorParameter: {
34
+ name?: string;
35
+ value?: string;
36
+ };
37
+ PayoutInstrument: {
38
+ accountLastFourDigits?: string;
39
+ instrumentId?: string;
40
+ instrumentStatus?: string;
41
+ instrumentType?: string;
42
+ nickname?: string;
43
+ payoutPercentage?: string;
44
+ };
45
+ PayoutSettingsResponse: {
46
+ payoutInstruments?: (components["schemas"]["PayoutInstrument"])[];
47
+ };
48
+ Rate: {
49
+ additionalCost?: components["schemas"]["Amount"];
50
+ rateId?: string;
51
+ shippingCategory?: string;
52
+ shippingCost?: components["schemas"]["Amount"];
53
+ shippingRegionNames?: (string)[];
54
+ shippingServiceCode?: string;
55
+ };
56
+ RateTableDetails: {
57
+ marketplaceId?: string;
58
+ name?: string;
59
+ rates?: (components["schemas"]["Rate"])[];
60
+ rateTableBasis?: string;
61
+ rateTableId?: string;
62
+ shippingOptionType?: string;
63
+ };
64
+ RateTableUpdate: {
65
+ rates?: (components["schemas"]["RateUpdate"])[];
66
+ };
67
+ RateUpdate: {
68
+ additionalCost?: components["schemas"]["Amount"];
69
+ rateId?: string;
70
+ shippingCost?: components["schemas"]["Amount"];
71
+ };
72
+ UpdatePayoutPercentage: {
73
+ instrumentId?: string;
74
+ payoutPercentage?: string;
75
+ };
76
+ UpdatePayoutPercentageRequest: {
77
+ payoutInstruments?: (components["schemas"]["UpdatePayoutPercentage"])[];
78
+ };
79
+ };
80
+ responses: never;
81
+ parameters: never;
82
+ requestBodies: never;
83
+ headers: never;
84
+ pathItems: never;
85
+ }
86
+ export type external = Record<string, never>;
87
+ export interface operations {
88
+ getRateTable: {
89
+ parameters: {
90
+ path: {
91
+ rate_table_id: string;
92
+ };
93
+ };
94
+ responses: {
95
+ 200: {
96
+ content: {
97
+ "application/json": components["schemas"]["RateTableDetails"];
98
+ };
99
+ };
100
+ 400: never;
101
+ 404: never;
102
+ 500: never;
103
+ };
104
+ };
105
+ updateShippingCost: {
106
+ parameters: {
107
+ header: {
108
+ "Content-Type": string;
109
+ };
110
+ path: {
111
+ rate_table_id: string;
112
+ };
113
+ };
114
+ requestBody?: {
115
+ content: {
116
+ "application/json": components["schemas"]["RateTableUpdate"];
117
+ };
118
+ };
119
+ responses: {
120
+ 204: never;
121
+ 400: never;
122
+ 404: never;
123
+ 409: never;
124
+ 500: never;
125
+ };
126
+ };
127
+ getPayoutSettings: {
128
+ responses: {
129
+ 200: {
130
+ content: {
131
+ "application/json": components["schemas"]["PayoutSettingsResponse"];
132
+ };
133
+ };
134
+ 500: never;
135
+ };
136
+ };
137
+ updatePayoutPercentage: {
138
+ parameters: {
139
+ header: {
140
+ "Content-Type": string;
141
+ };
142
+ };
143
+ requestBody?: {
144
+ content: {
145
+ "application/json": components["schemas"]["UpdatePayoutPercentageRequest"];
146
+ };
147
+ };
148
+ responses: {
149
+ 204: never;
150
+ 400: never;
151
+ 500: never;
152
+ };
153
+ };
154
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -29,6 +29,11 @@ export interface paths {
29
29
  "/bulk_migrate_listing": {
30
30
  post: operations["bulkMigrateListing"];
31
31
  };
32
+ "/listing/{listingId}/sku/{sku}/locations": {
33
+ get: operations["getSkuLocationMapping"];
34
+ put: operations["createOrReplaceSkuLocationMapping"];
35
+ delete: operations["deleteSkuLocationMapping"];
36
+ };
32
37
  "/bulk_create_offer": {
33
38
  post: operations["bulkCreateOffer"];
34
39
  };
@@ -47,10 +52,10 @@ export interface paths {
47
52
  "/offer/get_listing_fees": {
48
53
  post: operations["getListingFees"];
49
54
  };
50
- "/offer/{offerId}/publish/": {
55
+ "/offer/{offerId}/publish": {
51
56
  post: operations["publishOffer"];
52
57
  };
53
- "/offer/publish_by_inventory_item_group/": {
58
+ "/offer/publish_by_inventory_item_group": {
54
59
  post: operations["publishOfferByInventoryItemGroup"];
55
60
  };
56
61
  "/offer/{offerId}/withdraw": {
@@ -169,12 +174,19 @@ export interface components {
169
174
  name?: string;
170
175
  values?: (string)[];
171
176
  };
177
+ CountryPolicy: {
178
+ country?: string;
179
+ policyIds?: (string)[];
180
+ };
172
181
  Dimension: {
173
182
  height?: number;
174
183
  length?: number;
175
184
  unit?: string;
176
185
  width?: number;
177
186
  };
187
+ Document: {
188
+ documentId?: string;
189
+ };
178
190
  EbayOfferDetailsWithAll: {
179
191
  availableQuantity?: number;
180
192
  categoryId?: string;
@@ -288,6 +300,9 @@ export interface components {
288
300
  auction?: number;
289
301
  fixedPrice?: number;
290
302
  };
303
+ FulfillmentCenterSpecifications: {
304
+ sameDayShippingCutOffTimes?: components["schemas"]["SameDayShippingCutOffTimes"];
305
+ };
291
306
  GeoCoordinates: {
292
307
  latitude?: number;
293
308
  longitude?: number;
@@ -385,13 +400,17 @@ export interface components {
385
400
  total?: number;
386
401
  };
387
402
  InventoryLocation: {
403
+ location?: components["schemas"]["LocationDetails"];
388
404
  locationAdditionalInformation?: string;
389
405
  locationInstructions?: string;
406
+ locationTypes?: (string)[];
390
407
  locationWebUrl?: string;
391
408
  name?: string;
392
409
  operatingHours?: (components["schemas"]["OperatingHours"])[];
393
410
  phone?: string;
394
411
  specialHours?: (components["schemas"]["SpecialHours"])[];
412
+ timeZoneId?: string;
413
+ fulfillmentCenterSpecifications?: components["schemas"]["FulfillmentCenterSpecifications"];
395
414
  };
396
415
  InventoryLocationFull: {
397
416
  location?: components["schemas"]["LocationDetails"];
@@ -404,6 +423,8 @@ export interface components {
404
423
  operatingHours?: (components["schemas"]["OperatingHours"])[];
405
424
  phone?: string;
406
425
  specialHours?: (components["schemas"]["SpecialHours"])[];
426
+ timeZoneId?: string;
427
+ fulfillmentCenterSpecifications?: components["schemas"]["FulfillmentCenterSpecifications"];
407
428
  };
408
429
  InventoryLocationResponse: {
409
430
  location?: components["schemas"]["Location"];
@@ -417,9 +438,12 @@ export interface components {
417
438
  operatingHours?: (components["schemas"]["OperatingHours"])[];
418
439
  phone?: string;
419
440
  specialHours?: (components["schemas"]["SpecialHours"])[];
441
+ timeZoneId?: string;
442
+ fulfillmentCenterSpecifications?: components["schemas"]["FulfillmentCenterSpecifications"];
420
443
  };
421
444
  ListingDetails: {
422
445
  listingId?: string;
446
+ listingOnHold?: boolean;
423
447
  listingStatus?: string;
424
448
  soldQuantity?: number;
425
449
  };
@@ -440,10 +464,16 @@ export interface components {
440
464
  geoCoordinates?: components["schemas"]["GeoCoordinates"];
441
465
  locationId?: string;
442
466
  };
467
+ LocationAvailabilityDetails: {
468
+ merchantLocationKey?: string;
469
+ };
443
470
  LocationDetails: {
444
471
  address?: components["schemas"]["Address"];
445
472
  geoCoordinates?: components["schemas"]["GeoCoordinates"];
446
473
  };
474
+ LocationMapping: {
475
+ locations?: (components["schemas"]["LocationAvailabilityDetails"])[];
476
+ };
447
477
  LocationResponse: {
448
478
  href?: string;
449
479
  limit?: number;
@@ -453,6 +483,17 @@ export interface components {
453
483
  total?: number;
454
484
  locations?: (components["schemas"]["InventoryLocationResponse"])[];
455
485
  };
486
+ Manufacturer: {
487
+ addressLine1?: string;
488
+ addressLine2?: string;
489
+ city?: string;
490
+ companyName?: string;
491
+ country?: string;
492
+ email?: string;
493
+ phone?: string;
494
+ postalCode?: string;
495
+ stateOrProvince?: string;
496
+ };
456
497
  MigrateListing: {
457
498
  listingId?: string;
458
499
  };
@@ -513,9 +554,15 @@ export interface components {
513
554
  dayOfWeekEnum?: string;
514
555
  intervals?: (components["schemas"]["Interval"])[];
515
556
  };
557
+ Overrides: {
558
+ cutOffTime?: string;
559
+ endDate?: string;
560
+ startDate?: string;
561
+ };
516
562
  PackageWeightAndSize: {
517
563
  dimensions?: components["schemas"]["Dimension"];
518
564
  packageType?: string;
565
+ shippingIrregular?: boolean;
519
566
  weight?: components["schemas"]["Weight"];
520
567
  };
521
568
  PickupAtLocationAvailability: {
@@ -571,6 +618,11 @@ export interface components {
571
618
  gtin?: string;
572
619
  ktype?: string;
573
620
  };
621
+ ProductSafety: {
622
+ component?: string;
623
+ pictograms?: (string)[];
624
+ statements?: (string)[];
625
+ };
574
626
  PublishByInventoryItemGroupRequest: {
575
627
  inventoryItemGroupKey?: string;
576
628
  marketplaceId?: string;
@@ -580,15 +632,35 @@ export interface components {
580
632
  warnings?: (components["schemas"]["Error"])[];
581
633
  };
582
634
  RegionalProductCompliancePolicies: {
583
- countryPolicies?: (string)[];
635
+ countryPolicies?: (components["schemas"]["CountryPolicy"])[];
584
636
  };
585
637
  RegionalTakeBackPolicies: {
586
- countryPolicies?: (string)[];
638
+ countryPolicies?: (components["schemas"]["CountryPolicy"])[];
587
639
  };
588
640
  Regulatory: {
641
+ documents?: (components["schemas"]["Document"])[];
589
642
  energyEfficiencyLabel?: components["schemas"]["EnergyEfficiencyLabel"];
590
643
  hazmat?: components["schemas"]["Hazmat"];
644
+ manufacturer?: components["schemas"]["Manufacturer"];
645
+ productSafety?: components["schemas"]["ProductSafety"];
591
646
  repairScore?: number;
647
+ responsiblePersons?: (components["schemas"]["ResponsiblePerson"])[];
648
+ };
649
+ ResponsiblePerson: {
650
+ addressLine1?: string;
651
+ addressLine2?: string;
652
+ city?: string;
653
+ companyName?: string;
654
+ country?: string;
655
+ email?: string;
656
+ phone?: string;
657
+ postalCode?: string;
658
+ stateOrProvince?: string;
659
+ types?: (string)[];
660
+ };
661
+ SameDayShippingCutOffTimes: {
662
+ overrides?: (components["schemas"]["Overrides"])[];
663
+ weeklySchedule?: (components["schemas"]["WeeklySchedule"])[];
592
664
  };
593
665
  ShipToLocationAvailability: {
594
666
  availabilityDistributions?: (components["schemas"]["AvailabilityDistribution"])[];
@@ -631,6 +703,10 @@ export interface components {
631
703
  instance?: components["schemas"]["Version"];
632
704
  version?: string;
633
705
  };
706
+ WeeklySchedule: {
707
+ cutOffTime?: string;
708
+ dayOfWeekEnum?: (string)[];
709
+ };
634
710
  Weight: {
635
711
  unit?: string;
636
712
  value?: number;
@@ -960,6 +1036,59 @@ export interface operations {
960
1036
  500: never;
961
1037
  };
962
1038
  };
1039
+ getSkuLocationMapping: {
1040
+ parameters: {
1041
+ path: {
1042
+ listingId: string;
1043
+ sku: string;
1044
+ };
1045
+ };
1046
+ responses: {
1047
+ 200: {
1048
+ content: {
1049
+ "application/json": components["schemas"]["LocationMapping"];
1050
+ };
1051
+ };
1052
+ 400: never;
1053
+ 404: never;
1054
+ 500: never;
1055
+ };
1056
+ };
1057
+ createOrReplaceSkuLocationMapping: {
1058
+ parameters: {
1059
+ header: {
1060
+ "Content-Type": string;
1061
+ };
1062
+ path: {
1063
+ listingId: string;
1064
+ sku: string;
1065
+ };
1066
+ };
1067
+ requestBody: {
1068
+ content: {
1069
+ "application/json": components["schemas"]["LocationMapping"];
1070
+ };
1071
+ };
1072
+ responses: {
1073
+ 204: never;
1074
+ 400: never;
1075
+ 500: never;
1076
+ };
1077
+ };
1078
+ deleteSkuLocationMapping: {
1079
+ parameters: {
1080
+ path: {
1081
+ listingId: string;
1082
+ sku: string;
1083
+ };
1084
+ };
1085
+ responses: {
1086
+ 204: never;
1087
+ 400: never;
1088
+ 404: never;
1089
+ 500: never;
1090
+ };
1091
+ };
963
1092
  bulkCreateOffer: {
964
1093
  parameters: {
965
1094
  header: {
@@ -7,7 +7,8 @@ import { operations as commerceCatalogOperations } from './restful/specs/commerc
7
7
  import { components as commerceMedia } from './restful/specs/commerce_media_v1_beta_oas3.js';
8
8
  import { components as commerceNotification } from './restful/specs/commerce_notification_v1_oas3.js';
9
9
  import { components as commerceTranslation } from './restful/specs/commerce_translation_v1_beta_oas3.js';
10
- import { components as sellAccount } from './restful/specs/sell_account_v1_oas3.js';
10
+ import { components as sellAccountV1 } from './restful/specs/sell_account_v1_oas3.js';
11
+ import { components as sellAccountV2 } from './restful/specs/sell_account_v2_oas3.js';
11
12
  import { components as sellCompliance } from './restful/specs/sell_compliance_v1_oas3.js';
12
13
  import { components as sellFulfillment } from './restful/specs/sell_fulfillment_v1_oas3.js';
13
14
  import { components as sellInventory } from './restful/specs/sell_inventory_v1_oas3.js';
@@ -380,13 +381,15 @@ export type UpdatePaymentInformation = buyOrder['schemas']['UpdatePaymentInforma
380
381
  export type UpdateQuantity = buyOrder['schemas']['UpdateQuantity'];
381
382
  export type UpdateShippingOption = buyOrder['schemas']['UpdateShippingOption'];
382
383
  export type SuppressViolationRequest = sellCompliance['schemas']['SuppressViolationRequest'];
383
- export type CustomPolicyCreateRequest = sellAccount['schemas']['CustomPolicyCreateRequest'];
384
- export type CustomPolicyRequest = sellAccount['schemas']['CustomPolicyRequest'];
385
- export type FulfillmentPolicyRequest = sellAccount['schemas']['FulfillmentPolicyRequest'];
386
- export type FulfillmentSellAccountProgram = sellAccount['schemas']['Program'];
387
- export type PaymentPolicyRequest = sellAccount['schemas']['PaymentPolicyRequest'];
388
- export type ReturnPolicyRequest = sellAccount['schemas']['ReturnPolicyRequest'];
389
- export type SalesTaxBase = sellAccount['schemas']['SalesTaxBase'];
384
+ export type CustomPolicyCreateRequest = sellAccountV1['schemas']['CustomPolicyCreateRequest'];
385
+ export type CustomPolicyRequest = sellAccountV1['schemas']['CustomPolicyRequest'];
386
+ export type FulfillmentPolicyRequest = sellAccountV1['schemas']['FulfillmentPolicyRequest'];
387
+ export type FulfillmentSellAccountProgram = sellAccountV1['schemas']['Program'];
388
+ export type PaymentPolicyRequest = sellAccountV1['schemas']['PaymentPolicyRequest'];
389
+ export type ReturnPolicyRequest = sellAccountV1['schemas']['ReturnPolicyRequest'];
390
+ export type SalesTaxBase = sellAccountV1['schemas']['SalesTaxBase'];
391
+ export type RateTableUpdate = sellAccountV2['schemas']['RateTableUpdate'];
392
+ export type UpdatePayoutPercentageRequest = sellAccountV2['schemas']['UpdatePayoutPercentageRequest'];
390
393
  export type LineItemReference = sellFulfillment['schemas']['LineItemReference'];
391
394
  export type UpdateEvidencePaymentDisputeRequest = sellFulfillment['schemas']['UpdateEvidencePaymentDisputeRequest'];
392
395
  export type RefundItem = sellFulfillment['schemas']['RefundItem'];
@@ -410,6 +413,7 @@ export type OfferKeysWithId = sellInventory['schemas']['OfferKeysWithId'];
410
413
  export type PublishByInventoryItemGroupRequest = sellInventory['schemas']['PublishByInventoryItemGroupRequest'];
411
414
  export type WithdrawByInventoryItemGroupRequest = sellInventory['schemas']['WithdrawByInventoryItemGroupRequest'];
412
415
  export type InventoryItem = sellInventory['schemas']['InventoryItem'];
416
+ export type LocationMapping = sellInventory['schemas']['LocationMapping'];
413
417
  export type BulkCreateAdRequest = sellMarketing['schemas']['BulkCreateAdRequest'];
414
418
  export type BulkCreateAdsByInventoryReferenceRequest = sellMarketing['schemas']['BulkCreateAdsByInventoryReferenceRequest'];
415
419
  export type BulkCreateKeywordRequest = sellMarketing['schemas']['BulkCreateKeywordRequest'];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ebay-api",
3
3
  "author": "Daniil Tomilow",
4
- "version": "9.1.1",
4
+ "version": "9.2.0",
5
5
  "description": "eBay API for Node and Browser",
6
6
  "type": "module",
7
7
  "main": "./lib/index.js",