ebay-api 9.0.0 → 9.0.2
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.
- package/dist/api/traditional/XMLRequest.js +1 -1
- package/dist/auth/oAuth2.js +12 -12
- package/dist/ebay-api.min.mjs +1 -1
- package/dist/request.d.ts +2 -0
- package/dist/request.js +6 -0
- package/lib/api/traditional/XMLRequest.js +1 -1
- package/lib/auth/oAuth2.js +12 -12
- package/lib/ebay-api.min.js +1 -1
- package/lib/request.d.ts +2 -0
- package/lib/request.js +6 -0
- package/package.json +1 -1
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;
|