@fre4x/fred 1.0.54 → 1.0.57
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 +12 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18438,22 +18438,26 @@ var require_follow_redirects = __commonJS({
|
|
|
18438
18438
|
// ../packages/shared/dist/errors.js
|
|
18439
18439
|
function createApiError(message, statusCode) {
|
|
18440
18440
|
let hint = "Check your network connection and retry.";
|
|
18441
|
+
let type = "Service Error";
|
|
18441
18442
|
if (statusCode === 429) {
|
|
18442
|
-
|
|
18443
|
+
type = "Rate Limit";
|
|
18444
|
+
hint = "Request volume is too high. Suggestion: Wait briefly before retrying or reduce concurrent calls.";
|
|
18443
18445
|
} else if (statusCode === 401 || statusCode === 403) {
|
|
18444
|
-
|
|
18446
|
+
type = "Authentication Error";
|
|
18447
|
+
hint = "The request could not be authorized. Suggestion: Verify your API key or token in the environment configuration.";
|
|
18445
18448
|
} else if (statusCode && statusCode >= 500) {
|
|
18446
|
-
|
|
18449
|
+
type = "Upstream Error";
|
|
18450
|
+
hint = "The remote service is experiencing temporary issues. Suggestion: Try again in a few minutes.";
|
|
18447
18451
|
} else if (statusCode === 404) {
|
|
18448
|
-
|
|
18452
|
+
type = "Not Found";
|
|
18453
|
+
hint = "The requested information could not be found. Suggestion: Check if the ID, Ticker, or query parameters are correct.";
|
|
18449
18454
|
}
|
|
18450
|
-
const detail = statusCode ? ` (HTTP ${statusCode})` : "";
|
|
18451
18455
|
return {
|
|
18452
18456
|
isError: true,
|
|
18453
18457
|
content: [
|
|
18454
18458
|
{
|
|
18455
18459
|
type: "text",
|
|
18456
|
-
text:
|
|
18460
|
+
text: `${type}: ${message}
|
|
18457
18461
|
|
|
18458
18462
|
**Next Action**: ${hint}`
|
|
18459
18463
|
}
|
|
@@ -32517,7 +32521,8 @@ config(en_default());
|
|
|
32517
32521
|
var zod_default = external_exports;
|
|
32518
32522
|
|
|
32519
32523
|
// ../packages/shared/dist/pagination.js
|
|
32520
|
-
var
|
|
32524
|
+
var zodCompat = zod_exports;
|
|
32525
|
+
var z2 = zodCompat.z ?? zodCompat.default?.z ?? zodCompat.default ?? zodCompat;
|
|
32521
32526
|
var paginationSchema = z2.object({
|
|
32522
32527
|
limit: z2.number().int().min(1).max(100).default(20).describe("Maximum results to return (1\u2013100, default 20)"),
|
|
32523
32528
|
offset: z2.number().int().min(0).default(0).describe("Number of results to skip for pagination (default 0)")
|