@hebo-ai/gateway 0.10.1 → 0.10.2

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.
@@ -1,9 +1,14 @@
1
+ import * as z from "zod";
2
+ export declare const AnthropicErrorSchema: z.ZodObject<{
3
+ type: z.ZodLiteral<"error">;
4
+ error: z.ZodObject<{
5
+ type: z.ZodString;
6
+ message: z.ZodString;
7
+ }, z.core.$strip>;
8
+ }, z.core.$strip>;
1
9
  export declare class AnthropicError {
2
- readonly type = "error";
3
- readonly error: {
4
- type: string;
5
- message: string;
6
- };
10
+ readonly type: "error";
11
+ readonly error: z.infer<typeof AnthropicErrorSchema>["error"];
7
12
  constructor(message: string, type?: string);
8
13
  }
9
14
  export declare function toAnthropicError(error: unknown): AnthropicError;
@@ -1,6 +1,14 @@
1
+ import * as z from "zod";
1
2
  import { resolveRequestId } from "../utils/headers";
2
3
  import { toResponse } from "../utils/response";
3
4
  import { getErrorMeta, maybeMaskMessage } from "./utils";
5
+ export const AnthropicErrorSchema = z.object({
6
+ type: z.literal("error"),
7
+ error: z.object({
8
+ type: z.string(),
9
+ message: z.string(),
10
+ }),
11
+ });
4
12
  export class AnthropicError {
5
13
  type = "error";
6
14
  error;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hebo-ai/gateway",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "AI gateway as a framework. For full control over models, routing & lifecycle. OpenAI /chat/completions, OpenResponses /responses & Anthropic /messages.",
5
5
  "keywords": [
6
6
  "ai",