ebay-api 8.2.0 → 8.4.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 (44) hide show
  1. package/README.md +37 -2
  2. package/dist/api/digitalSignature.d.ts +43 -0
  3. package/dist/api/digitalSignature.js +105 -0
  4. package/dist/api/index.d.ts +2 -0
  5. package/dist/api/index.js +18 -0
  6. package/dist/api/restful/developer/keyManagement/index.d.ts +2 -4
  7. package/dist/api/restful/developer/keyManagement/index.js +5 -3
  8. package/dist/api/restful/index.d.ts +12 -7
  9. package/dist/api/restful/index.js +30 -17
  10. package/dist/api/restful/sell/marketing/index.d.ts +184 -1
  11. package/dist/api/restful/sell/marketing/index.js +260 -0
  12. package/dist/api/traditional/XMLRequest.d.ts +3 -1
  13. package/dist/api/traditional/XMLRequest.js +3 -1
  14. package/dist/api/traditional/index.d.ts +1 -1
  15. package/dist/api/traditional/index.js +25 -15
  16. package/dist/eBayApi.d.ts +2 -1
  17. package/dist/eBayApi.js +12 -1
  18. package/dist/ebay-api.min.mjs +1 -1
  19. package/dist/errors/index.js +5 -0
  20. package/dist/types/apiTypes.d.ts +7 -0
  21. package/dist/types/restfulTypes.d.ts +90 -0
  22. package/dist/types/traditonalTypes.d.ts +2 -1
  23. package/lib/api/digitalSignature.d.ts +43 -0
  24. package/lib/api/digitalSignature.js +112 -0
  25. package/lib/api/index.d.ts +2 -0
  26. package/lib/api/index.js +18 -0
  27. package/lib/api/restful/developer/keyManagement/index.d.ts +2 -4
  28. package/lib/api/restful/developer/keyManagement/index.js +5 -3
  29. package/lib/api/restful/index.d.ts +12 -7
  30. package/lib/api/restful/index.js +34 -21
  31. package/lib/api/restful/sell/marketing/index.d.ts +184 -1
  32. package/lib/api/restful/sell/marketing/index.js +260 -0
  33. package/lib/api/traditional/XMLRequest.d.ts +3 -1
  34. package/lib/api/traditional/XMLRequest.js +2 -0
  35. package/lib/api/traditional/index.d.ts +1 -1
  36. package/lib/api/traditional/index.js +29 -19
  37. package/lib/eBayApi.d.ts +2 -1
  38. package/lib/eBayApi.js +12 -1
  39. package/lib/ebay-api.min.js +1 -1
  40. package/lib/errors/index.js +5 -0
  41. package/lib/types/apiTypes.d.ts +7 -0
  42. package/lib/types/restfulTypes.d.ts +90 -0
  43. package/lib/types/traditonalTypes.d.ts +2 -1
  44. package/package.json +2 -1
@@ -128,6 +128,11 @@ const mapEBayError = (err) => {
128
128
  description: data.error_description || ''
129
129
  };
130
130
  }
131
+ else if (typeof data === 'string') {
132
+ eBayError = {
133
+ message: data
134
+ };
135
+ }
131
136
  else {
132
137
  eBayError = data;
133
138
  }
@@ -16,10 +16,17 @@ export type TraditionalConfig = {
16
16
  siteId?: number;
17
17
  authToken?: string | null;
18
18
  };
19
+ export type Cipher = 'sha256' | 'sha512';
20
+ export type Signature = {
21
+ cipher?: Cipher;
22
+ jwe: string;
23
+ privateKey: string;
24
+ };
19
25
  export type eBayConfig = Keyset & {
20
26
  sandbox: boolean;
21
27
  ruName?: string;
22
28
  scope?: Scope;
29
+ signature?: Signature | null;
23
30
  } & TraditionalConfig & RestConfig;
24
31
  export type ApiConfig = {
25
32
  autoRefreshToken?: boolean;
@@ -477,6 +477,96 @@ export type CreateAdRequest = {
477
477
  export type BulkCreateAdRequest = {
478
478
  requests: CreateAdRequest[];
479
479
  };
480
+ export type AdStatus = 'ACTIVE' | 'PAUSED' | 'ARCHIVED';
481
+ export type UpdateAdStatusRequest = {
482
+ adId: string;
483
+ adStatus: AdStatus;
484
+ };
485
+ export type BulkUpdateAdStatusRequest = {
486
+ items: UpdateAdStatusRequest[];
487
+ };
488
+ export type UpdateAdStatusByListingIdRequest = {
489
+ adGroupId: string;
490
+ adStatus: AdStatus;
491
+ listingId: string;
492
+ };
493
+ export type BulkUpdateAdStatusByListingIdRequest = {
494
+ items: UpdateAdStatusByListingIdRequest[];
495
+ };
496
+ export type CreateAdGroupRequest = {
497
+ defaultBid: Amount;
498
+ name: string;
499
+ };
500
+ export type AdGroupStatus = 'ACTIVE' | 'PAUSED' | 'ARCHIVED';
501
+ export type UpdateAdGroupRequest = {
502
+ adGroupStatus: AdGroupStatus;
503
+ defaultBid: Amount;
504
+ name: string;
505
+ };
506
+ export type KeywordRequest = {
507
+ keywordText: string;
508
+ matchType: string;
509
+ };
510
+ export type TargetedBidRequest = {
511
+ keywords: KeywordRequest[];
512
+ };
513
+ export type TargetedKeywordRequest = {
514
+ additionalInfo: string[];
515
+ exclusions: string[];
516
+ listingIds: string[];
517
+ matchType: string;
518
+ };
519
+ export type DynamicAdRatePreference = {
520
+ adRateAdjustmentPercent: string;
521
+ adRateCapPercent: string;
522
+ };
523
+ export type UpdateAdrateStrategyRequest = {
524
+ adRateStrategy: string;
525
+ bidPercentage: string;
526
+ dynamicAdRatePreferences: DynamicAdRatePreference[];
527
+ };
528
+ export type BudgetRequest = {
529
+ amount: Amount;
530
+ };
531
+ export type UpdateCampaignBudgetRequest = {
532
+ daily: BudgetRequest;
533
+ };
534
+ export type CreateKeywordRequest = {
535
+ adGroupId: string;
536
+ bid: Amount;
537
+ keywordText: string;
538
+ matchType: string;
539
+ };
540
+ export type UpdateKeywordRequest = {
541
+ bid: Amount;
542
+ keywordStatus: string;
543
+ };
544
+ export type UpdateKeywordByKeywordIdRequest = {
545
+ bid: Amount;
546
+ keywordId: string;
547
+ keywordStatus: string;
548
+ };
549
+ export type BulkCreateKeywordRequest = {
550
+ requests: CreateKeywordRequest[];
551
+ };
552
+ export type BulkUpdateKeywordRequest = {
553
+ requests: UpdateKeywordByKeywordIdRequest[];
554
+ };
555
+ export type CreateNegativeKeywordRequest = {
556
+ adGroupId: string;
557
+ campaignId: string;
558
+ negativeKeywordMatchType: string;
559
+ negativeKeywordText: string;
560
+ };
561
+ export type BulkCreateNegativeKeywordRequest = {
562
+ requests: CreateNegativeKeywordRequest[];
563
+ };
564
+ export type BulkUpdateNegativeKeywordRequest = {
565
+ requests: CreateNegativeKeywordRequest[];
566
+ };
567
+ export type UpdateNegativeKeywordRequest = {
568
+ negativeKeywordStatus: string;
569
+ };
480
570
  export type DeleteAdsByInventoryReferenceRequest = {
481
571
  inventoryReferenceId: string;
482
572
  inventoryReferenceType: string;
@@ -5,7 +5,7 @@ import MerchandisingCalls from '../api/traditional/merchandising/index.js';
5
5
  import ShoppingCalls from '../api/traditional/shopping/index.js';
6
6
  import TradingCalls from '../api/traditional/trading/index.js';
7
7
  import { TraditionalApiConfig } from '../api/traditional/XMLRequest.js';
8
- export type XMLApiCall = (fields?: Fields, apiConfig?: TraditionalApiConfig) => Promise<any>;
8
+ export type XMLApiCall = (fields?: Fields | null, apiConfig?: TraditionalApiConfig) => Promise<any>;
9
9
  export type Trading = {
10
10
  [key in typeof TradingCalls[number]]: XMLApiCall;
11
11
  };
@@ -28,6 +28,7 @@ type Endpoint = {
28
28
  export type TraditionalApi = {
29
29
  endpoint: Endpoint;
30
30
  xmlns: string;
31
+ path: string;
31
32
  calls: typeof TradingCalls | typeof ShoppingCalls | typeof FindingCalls | typeof ClientAlertsCalls | typeof MerchandisingCalls;
32
33
  headers: (callName: string, accessToken?: string | null) => object;
33
34
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ebay-api",
3
3
  "author": "Daniil Tomilow",
4
- "version": "8.2.0",
4
+ "version": "8.4.0",
5
5
  "description": "eBay API for Node and Browser",
6
6
  "type": "module",
7
7
  "main": "./lib/index.js",
@@ -95,6 +95,7 @@
95
95
  "@rollup/plugin-json": "^5.0.2",
96
96
  "@rollup/plugin-node-resolve": "^15.0.1",
97
97
  "@rollup/plugin-terser": "^0.2.0",
98
+ "@rollup/plugin-virtual": "^3.0.1",
98
99
  "@types/chai": "^4.3.4",
99
100
  "@types/debug": "^4.1.7",
100
101
  "@types/mocha": "^10.0.1",