ebay-api 8.3.0 → 8.4.1

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 +45 -8
  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 +33 -17
  10. package/dist/api/traditional/XMLRequest.d.ts +3 -1
  11. package/dist/api/traditional/XMLRequest.js +3 -1
  12. package/dist/api/traditional/index.d.ts +1 -1
  13. package/dist/api/traditional/index.js +25 -15
  14. package/dist/eBayApi.d.ts +2 -1
  15. package/dist/eBayApi.js +12 -1
  16. package/dist/ebay-api.min.mjs +1 -1
  17. package/dist/errors/index.js +5 -0
  18. package/dist/types/apiTypes.d.ts +7 -0
  19. package/dist/types/traditonalTypes.d.ts +2 -1
  20. package/lib/api/digitalSignature.d.ts +43 -0
  21. package/lib/api/digitalSignature.js +112 -0
  22. package/lib/api/index.d.ts +2 -0
  23. package/lib/api/index.js +18 -0
  24. package/lib/api/restful/developer/keyManagement/index.d.ts +2 -4
  25. package/lib/api/restful/developer/keyManagement/index.js +5 -3
  26. package/lib/api/restful/index.d.ts +12 -7
  27. package/lib/api/restful/index.js +37 -21
  28. package/lib/api/traditional/XMLRequest.d.ts +3 -1
  29. package/lib/api/traditional/XMLRequest.js +2 -0
  30. package/lib/api/traditional/index.d.ts +1 -1
  31. package/lib/api/traditional/index.js +29 -19
  32. package/lib/eBayApi.d.ts +2 -1
  33. package/lib/eBayApi.js +12 -1
  34. package/lib/ebay-api.min.js +1 -1
  35. package/lib/errors/index.js +5 -0
  36. package/lib/types/apiTypes.d.ts +7 -0
  37. package/lib/types/traditonalTypes.d.ts +2 -1
  38. 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;
@@ -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.3.0",
4
+ "version": "8.4.1",
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",