ebay-api 9.0.1 → 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
|
@@ -116,7 +116,7 @@ class XMLRequest {
|
|
|
116
116
|
log('error', error);
|
|
117
117
|
if (error.response?.data) {
|
|
118
118
|
const json = this.toJSON(error.response.data);
|
|
119
|
-
checkEBayTraditionalResponse(error.response, json);
|
|
119
|
+
checkEBayTraditionalResponse(error.response, json[this.callName + 'Response']);
|
|
120
120
|
}
|
|
121
121
|
throw error;
|
|
122
122
|
}
|
package/dist/auth/oAuth2.js
CHANGED
|
@@ -67,13 +67,13 @@ class OAuth2 extends Base {
|
|
|
67
67
|
throw new Error('Missing Cert Id (Client Secret)');
|
|
68
68
|
}
|
|
69
69
|
try {
|
|
70
|
-
const response = await this.req.
|
|
70
|
+
const response = await this.req.postForm(this.identityEndpoint, {
|
|
71
71
|
scope: this.scope.join(' '),
|
|
72
72
|
grant_type: 'client_credentials',
|
|
73
73
|
}, {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
auth: {
|
|
75
|
+
username: this.config.appId,
|
|
76
|
+
password: this.config.certId
|
|
77
77
|
}
|
|
78
78
|
});
|
|
79
79
|
return response.data;
|
|
@@ -105,14 +105,14 @@ class OAuth2 extends Base {
|
|
|
105
105
|
throw new Error('Missing Cert Id (Client Secret)');
|
|
106
106
|
}
|
|
107
107
|
try {
|
|
108
|
-
const response = await this.req.
|
|
108
|
+
const response = await this.req.postForm(this.identityEndpoint, {
|
|
109
109
|
grant_type: 'authorization_code',
|
|
110
110
|
code,
|
|
111
111
|
redirect_uri: ruName
|
|
112
112
|
}, {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
113
|
+
auth: {
|
|
114
|
+
username: this.config.appId,
|
|
115
|
+
password: this.config.certId
|
|
116
116
|
}
|
|
117
117
|
});
|
|
118
118
|
const token = response.data;
|
|
@@ -133,14 +133,14 @@ class OAuth2 extends Base {
|
|
|
133
133
|
throw new Error('Failed to refresh the user access token. Token or refresh_token is not set.');
|
|
134
134
|
}
|
|
135
135
|
try {
|
|
136
|
-
const response = await this.req.
|
|
136
|
+
const response = await this.req.postForm(this.identityEndpoint, {
|
|
137
137
|
grant_type: 'refresh_token',
|
|
138
138
|
refresh_token: this._authToken.refresh_token,
|
|
139
139
|
scope: this.scope.join(' ')
|
|
140
140
|
}, {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
141
|
+
auth: {
|
|
142
|
+
username: this.config.appId,
|
|
143
|
+
password: this.config.certId
|
|
144
144
|
}
|
|
145
145
|
});
|
|
146
146
|
const token = response.data;
|