emailr 1.9.0 → 1.11.0
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/index.js +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -158,7 +158,8 @@ var HttpClient = class {
|
|
|
158
158
|
} catch {
|
|
159
159
|
errorData = { error: response.statusText || "Unknown error" };
|
|
160
160
|
}
|
|
161
|
-
const
|
|
161
|
+
const rawError = errorData.error;
|
|
162
|
+
const message = typeof rawError === "string" ? rawError : rawError?.message || JSON.stringify(rawError) || "An error occurred";
|
|
162
163
|
switch (response.status) {
|
|
163
164
|
case 400:
|
|
164
165
|
throw new ValidationError(message, errorData.details, requestId);
|
package/dist/index.mjs
CHANGED
|
@@ -125,7 +125,8 @@ var HttpClient = class {
|
|
|
125
125
|
} catch {
|
|
126
126
|
errorData = { error: response.statusText || "Unknown error" };
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const rawError = errorData.error;
|
|
129
|
+
const message = typeof rawError === "string" ? rawError : rawError?.message || JSON.stringify(rawError) || "An error occurred";
|
|
129
130
|
switch (response.status) {
|
|
130
131
|
case 400:
|
|
131
132
|
throw new ValidationError(message, errorData.details, requestId);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "emailr",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"description": "Official Emailr API SDK for TypeScript/JavaScript",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
"files": [
|
|
16
16
|
"dist"
|
|
17
17
|
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"typecheck": "tsc --noEmit"
|
|
22
|
+
},
|
|
18
23
|
"keywords": [
|
|
19
24
|
"emailr",
|
|
20
25
|
"email",
|
|
@@ -31,10 +36,5 @@
|
|
|
31
36
|
},
|
|
32
37
|
"engines": {
|
|
33
38
|
"node": ">=18.0.0"
|
|
34
|
-
},
|
|
35
|
-
"scripts": {
|
|
36
|
-
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
37
|
-
"test": "vitest run",
|
|
38
|
-
"typecheck": "tsc --noEmit"
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
}
|