ebay-api 9.0.1 → 9.0.3

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.
@@ -89,7 +89,7 @@ export type EBayApiErrorResponse = string | EBayPostOrderErrorResponse | EBayRes
89
89
  export type ApiRequestResult = {
90
90
  response: {
91
91
  data?: EBayApiErrorResponse;
92
- status?: string;
92
+ status?: number;
93
93
  statusText?: string;
94
94
  headers?: Record<string, string>;
95
95
  };
@@ -103,7 +103,7 @@ export type ApiRequestResult = {
103
103
  export type ErrorCommonMeta = {
104
104
  res?: {
105
105
  data: any;
106
- status?: string;
106
+ status?: number;
107
107
  statusText?: string;
108
108
  headers?: Record<string, string>;
109
109
  };
package/lib/request.d.ts CHANGED
@@ -12,6 +12,7 @@ export interface IEBayApiRequest<T = AxiosInstance, C = AxiosRequestConfig, R =
12
12
  get(url: string, config?: C): Promise<R>;
13
13
  delete(url: string, config?: C): Promise<R>;
14
14
  post(url: string, data?: any, config?: C): Promise<R>;
15
+ postForm(url: string, data?: any, config?: C): Promise<R>;
15
16
  put(url: string, data?: any, config?: C): Promise<R>;
16
17
  }
17
18
  export declare class AxiosRequest implements IEBayApiRequest {
@@ -21,4 +22,5 @@ export declare class AxiosRequest implements IEBayApiRequest {
21
22
  post<R = any>(url: string, payload?: any, config?: AxiosRequestConfig): Promise<R>;
22
23
  delete<R = any>(url: string, config?: AxiosRequestConfig): Promise<R>;
23
24
  put<R = any>(url: string, payload?: any, config?: AxiosRequestConfig): Promise<R>;
25
+ postForm<R = any>(url: string, payload?: any, config?: AxiosRequestConfig): Promise<R>;
24
26
  }
package/lib/request.js CHANGED
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AxiosRequest = exports.multipartHeader = exports.defaultGlobalHeaders = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
8
  const debug_1 = __importDefault(require("debug"));
9
+ const qs_1 = require("qs");
9
10
  const log = (0, debug_1.default)('ebay:request');
10
11
  exports.defaultGlobalHeaders = {
11
12
  'Access-Control-Allow-Origin': '*',
@@ -40,5 +41,10 @@ class AxiosRequest {
40
41
  log('put: ' + url, { payload, config });
41
42
  return this.instance.put(url, payload, config);
42
43
  }
44
+ postForm(url, payload, config) {
45
+ log('postForm: ' + url);
46
+ const body = (0, qs_1.stringify)(payload);
47
+ return this.instance.post(url, body, config);
48
+ }
43
49
  }
44
50
  exports.AxiosRequest = AxiosRequest;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ebay-api",
3
3
  "author": "Daniil Tomilow",
4
- "version": "9.0.1",
4
+ "version": "9.0.3",
5
5
  "description": "eBay API for Node and Browser",
6
6
  "type": "module",
7
7
  "main": "./lib/index.js",