@signaliz/sdk 1.0.36 → 1.0.37

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.
@@ -22,16 +22,19 @@ function parseError(status, body) {
22
22
  details: body.error.details
23
23
  });
24
24
  }
25
+ const code = typeof body?.error_code === "string" && body.error_code.trim() ? body.error_code.trim() : `HTTP_${status}`;
25
26
  return new SignalizError({
26
- code: `HTTP_${status}`,
27
+ code,
27
28
  message: body?.message || body?.error || `Request failed with status ${status}`,
28
- errorType: mapErrorType(void 0, status)
29
+ errorType: mapErrorType(code, status),
30
+ details: body?.details || (body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : void 0)
29
31
  });
30
32
  }
31
33
  function mapErrorType(code, status) {
32
34
  if (code === "RATE_LIMITED" || status === 429) return "rate_limited";
33
35
  if (code === "VALIDATION_ERROR" || status === 400) return "validation";
34
36
  if (code === "NOT_FOUND" || status === 404) return "not_found";
37
+ if (code === "NO_SUPPORTED_SIGNAL") return "not_found";
35
38
  if (code === "AUTH_EXPIRED" || status === 401) return "auth_expired";
36
39
  if (code === "INSUFFICIENT_CREDITS" || status === 402) return "insufficient_credits";
37
40
  if (code === "TIMEOUT" || status === 504) return "timeout";
package/dist/index.js CHANGED
@@ -49,16 +49,19 @@ function parseError(status, body) {
49
49
  details: body.error.details
50
50
  });
51
51
  }
52
+ const code = typeof body?.error_code === "string" && body.error_code.trim() ? body.error_code.trim() : `HTTP_${status}`;
52
53
  return new SignalizError({
53
- code: `HTTP_${status}`,
54
+ code,
54
55
  message: body?.message || body?.error || `Request failed with status ${status}`,
55
- errorType: mapErrorType(void 0, status)
56
+ errorType: mapErrorType(code, status),
57
+ details: body?.details || (body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : void 0)
56
58
  });
57
59
  }
58
60
  function mapErrorType(code, status) {
59
61
  if (code === "RATE_LIMITED" || status === 429) return "rate_limited";
60
62
  if (code === "VALIDATION_ERROR" || status === 400) return "validation";
61
63
  if (code === "NOT_FOUND" || status === 404) return "not_found";
64
+ if (code === "NO_SUPPORTED_SIGNAL") return "not_found";
62
65
  if (code === "AUTH_EXPIRED" || status === 401) return "auth_expired";
63
66
  if (code === "INSUFFICIENT_CREDITS" || status === 402) return "insufficient_credits";
64
67
  if (code === "TIMEOUT" || status === 504) return "timeout";
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Signaliz,
3
3
  SignalizError
4
- } from "./chunk-WKE2PNXT.mjs";
4
+ } from "./chunk-WHD7INKU.mjs";
5
5
  export {
6
6
  Signaliz,
7
7
  SignalizError
@@ -53,16 +53,19 @@ function parseError(status, body) {
53
53
  details: body.error.details
54
54
  });
55
55
  }
56
+ const code = typeof body?.error_code === "string" && body.error_code.trim() ? body.error_code.trim() : `HTTP_${status}`;
56
57
  return new SignalizError({
57
- code: `HTTP_${status}`,
58
+ code,
58
59
  message: body?.message || body?.error || `Request failed with status ${status}`,
59
- errorType: mapErrorType(void 0, status)
60
+ errorType: mapErrorType(code, status),
61
+ details: body?.details || (body?.retry_eligible !== void 0 ? { retry_eligible: body.retry_eligible } : void 0)
60
62
  });
61
63
  }
62
64
  function mapErrorType(code, status) {
63
65
  if (code === "RATE_LIMITED" || status === 429) return "rate_limited";
64
66
  if (code === "VALIDATION_ERROR" || status === 400) return "validation";
65
67
  if (code === "NOT_FOUND" || status === 404) return "not_found";
68
+ if (code === "NO_SUPPORTED_SIGNAL") return "not_found";
66
69
  if (code === "AUTH_EXPIRED" || status === 401) return "auth_expired";
67
70
  if (code === "INSUFFICIENT_CREDITS" || status === 402) return "insufficient_credits";
68
71
  if (code === "TIMEOUT" || status === 504) return "timeout";
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  Signaliz
4
- } from "./chunk-WKE2PNXT.mjs";
4
+ } from "./chunk-WHD7INKU.mjs";
5
5
 
6
6
  // src/mcp-config.ts
7
7
  import * as fs from "fs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@signaliz/sdk",
3
- "version": "1.0.36",
3
+ "version": "1.0.37",
4
4
  "description": "Signaliz SDK for Find Email, Verify Email, Company Signal Enrichment, and Signal to Copy AI.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",