@fre4x/telegram 1.1.2 → 1.1.3
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
|
@@ -28398,22 +28398,26 @@ import { JSDOM } from "jsdom";
|
|
|
28398
28398
|
// ../packages/shared/dist/errors.js
|
|
28399
28399
|
function createApiError(message, statusCode) {
|
|
28400
28400
|
let hint = "Check your network connection and retry.";
|
|
28401
|
+
let type = "Service Error";
|
|
28401
28402
|
if (statusCode === 429) {
|
|
28402
|
-
|
|
28403
|
+
type = "Rate Limit";
|
|
28404
|
+
hint = "Request volume is too high. Suggestion: Wait briefly before retrying or reduce concurrent calls.";
|
|
28403
28405
|
} else if (statusCode === 401 || statusCode === 403) {
|
|
28404
|
-
|
|
28406
|
+
type = "Authentication Error";
|
|
28407
|
+
hint = "The request could not be authorized. Suggestion: Verify your API key or token in the environment configuration.";
|
|
28405
28408
|
} else if (statusCode && statusCode >= 500) {
|
|
28406
|
-
|
|
28409
|
+
type = "Upstream Error";
|
|
28410
|
+
hint = "The remote service is experiencing temporary issues. Suggestion: Try again in a few minutes.";
|
|
28407
28411
|
} else if (statusCode === 404) {
|
|
28408
|
-
|
|
28412
|
+
type = "Not Found";
|
|
28413
|
+
hint = "The requested information could not be found. Suggestion: Check if the ID, Ticker, or query parameters are correct.";
|
|
28409
28414
|
}
|
|
28410
|
-
const detail = statusCode ? ` (HTTP ${statusCode})` : "";
|
|
28411
28415
|
return {
|
|
28412
28416
|
isError: true,
|
|
28413
28417
|
content: [
|
|
28414
28418
|
{
|
|
28415
28419
|
type: "text",
|
|
28416
|
-
text:
|
|
28420
|
+
text: `${type}: ${message}
|
|
28417
28421
|
|
|
28418
28422
|
**Next Action**: ${hint}`
|
|
28419
28423
|
}
|
|
@@ -28471,7 +28475,8 @@ _Showing ${start}\u2013${end} of ${total}. Use \`offset: ${offset + limit}\` for
|
|
|
28471
28475
|
}
|
|
28472
28476
|
|
|
28473
28477
|
// ../packages/shared/dist/pagination.js
|
|
28474
|
-
var
|
|
28478
|
+
var zodCompat = zod_exports;
|
|
28479
|
+
var z2 = zodCompat.z ?? zodCompat.default?.z ?? zodCompat.default ?? zodCompat;
|
|
28475
28480
|
var paginationSchema = z2.object({
|
|
28476
28481
|
limit: z2.number().int().min(1).max(100).default(20).describe("Maximum results to return (1\u2013100, default 20)"),
|
|
28477
28482
|
offset: z2.number().int().min(0).default(0).describe("Number of results to skip for pagination (default 0)")
|
package/package.json
CHANGED