ebay-api 9.4.3 → 9.4.4
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/README.md +1 -1
- package/dist/ebay-api.min.mjs +1 -1
- package/dist/errors/index.d.ts +5 -2
- package/dist/errors/index.js +4 -1
- package/lib/ebay-api.min.js +1 -1
- package/lib/errors/index.d.ts +5 -2
- package/lib/errors/index.js +4 -1
- package/package.json +1 -1
package/lib/errors/index.d.ts
CHANGED
|
@@ -73,9 +73,12 @@ export type EBayRestfulError = {
|
|
|
73
73
|
inputRefIds?: any[];
|
|
74
74
|
httpStatusCode: number;
|
|
75
75
|
};
|
|
76
|
-
export type
|
|
76
|
+
export type EBayRestfulErrorsResponse = {
|
|
77
77
|
errors: EBayRestfulError[];
|
|
78
78
|
};
|
|
79
|
+
export type EBayRestfulErrorResponse = {
|
|
80
|
+
error: EBayRestfulError[];
|
|
81
|
+
};
|
|
79
82
|
export type EBaySimpleError = {
|
|
80
83
|
message: string;
|
|
81
84
|
description?: string;
|
|
@@ -89,7 +92,7 @@ export type EBayOAuthErrorResponse = {
|
|
|
89
92
|
error: string;
|
|
90
93
|
error_description?: string;
|
|
91
94
|
};
|
|
92
|
-
export type EBayApiErrorResponse = string | EBayPostOrderErrorResponse | EBayRestfulErrorResponse | EBayTraditionalErrorResponse | EBayOAuthErrorResponse;
|
|
95
|
+
export type EBayApiErrorResponse = string | EBayPostOrderErrorResponse | EBayRestfulErrorsResponse | EBayRestfulErrorResponse | EBayTraditionalErrorResponse | EBayOAuthErrorResponse;
|
|
93
96
|
export type ApiRequestResult = {
|
|
94
97
|
response: {
|
|
95
98
|
data?: EBayApiErrorResponse;
|
package/lib/errors/index.js
CHANGED
|
@@ -94,12 +94,15 @@ function getEBayError(data) {
|
|
|
94
94
|
if ('error' in data && typeof data.error === 'string') {
|
|
95
95
|
return {
|
|
96
96
|
message: data.error,
|
|
97
|
-
description: data.error_description || ''
|
|
97
|
+
description: 'error_description' in data ? data.error_description || '' : ''
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
if ('errors' in data && Array.isArray(data.errors)) {
|
|
101
101
|
return data.errors[0];
|
|
102
102
|
}
|
|
103
|
+
if ('error' in data && Array.isArray(data.error)) {
|
|
104
|
+
return data.error[0];
|
|
105
|
+
}
|
|
103
106
|
if ('errorMessage' in data) {
|
|
104
107
|
return Array.isArray(data.errorMessage?.error) ? data.errorMessage.error[0] : data.errorMessage.error;
|
|
105
108
|
}
|