@fre4x/yahoo-finance 1.0.55 → 1.0.58
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
|
@@ -38262,22 +38262,26 @@ var StdioServerTransport = class {
|
|
|
38262
38262
|
// ../packages/shared/dist/errors.js
|
|
38263
38263
|
function createApiError(message, statusCode) {
|
|
38264
38264
|
let hint = "Check your network connection and retry.";
|
|
38265
|
+
let type = "Service Error";
|
|
38265
38266
|
if (statusCode === 429) {
|
|
38266
|
-
|
|
38267
|
+
type = "Rate Limit";
|
|
38268
|
+
hint = "Request volume is too high. Suggestion: Wait briefly before retrying or reduce concurrent calls.";
|
|
38267
38269
|
} else if (statusCode === 401 || statusCode === 403) {
|
|
38268
|
-
|
|
38270
|
+
type = "Authentication Error";
|
|
38271
|
+
hint = "The request could not be authorized. Suggestion: Verify your API key or token in the environment configuration.";
|
|
38269
38272
|
} else if (statusCode && statusCode >= 500) {
|
|
38270
|
-
|
|
38273
|
+
type = "Upstream Error";
|
|
38274
|
+
hint = "The remote service is experiencing temporary issues. Suggestion: Try again in a few minutes.";
|
|
38271
38275
|
} else if (statusCode === 404) {
|
|
38272
|
-
|
|
38276
|
+
type = "Not Found";
|
|
38277
|
+
hint = "The requested information could not be found. Suggestion: Check if the ID, Ticker, or query parameters are correct.";
|
|
38273
38278
|
}
|
|
38274
|
-
const detail = statusCode ? ` (HTTP ${statusCode})` : "";
|
|
38275
38279
|
return {
|
|
38276
38280
|
isError: true,
|
|
38277
38281
|
content: [
|
|
38278
38282
|
{
|
|
38279
38283
|
type: "text",
|
|
38280
|
-
text:
|
|
38284
|
+
text: `${type}: ${message}
|
|
38281
38285
|
|
|
38282
38286
|
**Next Action**: ${hint}`
|
|
38283
38287
|
}
|
|
@@ -38327,7 +38331,8 @@ _Showing ${start}\u2013${end} of ${total}. Use \`offset: ${offset + limit}\` for
|
|
|
38327
38331
|
}
|
|
38328
38332
|
|
|
38329
38333
|
// ../packages/shared/dist/pagination.js
|
|
38330
|
-
var
|
|
38334
|
+
var zodCompat = zod_exports;
|
|
38335
|
+
var z2 = zodCompat.z ?? zodCompat.default?.z ?? zodCompat.default ?? zodCompat;
|
|
38331
38336
|
var paginationSchema = z2.object({
|
|
38332
38337
|
limit: z2.number().int().min(1).max(100).default(20).describe("Maximum results to return (1\u2013100, default 20)"),
|
|
38333
38338
|
offset: z2.number().int().min(0).default(0).describe("Number of results to skip for pagination (default 0)")
|