@amigo-ai/sdk 1.1.0 → 1.1.1

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.
@@ -26,21 +26,30 @@ export declare class AmigoError extends Error {
26
26
  */
27
27
  toJSON(): Record<string, unknown>;
28
28
  }
29
+ type AmigoErrorOptions = NonNullable<ConstructorParameters<typeof AmigoError>[1]>;
29
30
  export declare class BadRequestError extends AmigoError {
31
+ constructor(message: string, options?: AmigoErrorOptions);
30
32
  }
31
33
  export declare class AuthenticationError extends AmigoError {
34
+ constructor(message: string, options?: AmigoErrorOptions);
32
35
  }
33
36
  export declare class PermissionError extends AmigoError {
37
+ constructor(message: string, options?: AmigoErrorOptions);
34
38
  }
35
39
  export declare class NotFoundError extends AmigoError {
40
+ constructor(message: string, options?: AmigoErrorOptions);
36
41
  }
37
42
  export declare class ConflictError extends AmigoError {
43
+ constructor(message: string, options?: AmigoErrorOptions);
38
44
  }
39
45
  export declare class RateLimitError extends AmigoError {
46
+ constructor(message: string, options?: AmigoErrorOptions);
40
47
  }
41
48
  export declare class ServerError extends AmigoError {
49
+ constructor(message: string, options?: AmigoErrorOptions);
42
50
  }
43
51
  export declare class ServiceUnavailableError extends ServerError {
52
+ constructor(message: string, options?: AmigoErrorOptions);
44
53
  }
45
54
  export declare class ConfigurationError extends AmigoError {
46
55
  readonly field?: string | undefined;
@@ -48,7 +57,7 @@ export declare class ConfigurationError extends AmigoError {
48
57
  }
49
58
  export declare class ValidationError extends BadRequestError {
50
59
  fieldErrors?: Record<string, string> | undefined;
51
- constructor(msg: string, fieldErrors?: Record<string, string> | undefined);
60
+ constructor(msg: string, optionsOrFieldErrors?: AmigoErrorOptions | Record<string, string>, fieldErrors?: Record<string, string> | undefined);
52
61
  }
53
62
  export declare class NetworkError extends AmigoError {
54
63
  readonly originalError?: Error | undefined;
@@ -69,3 +78,4 @@ export declare class ParseError extends AmigoError {
69
78
  export declare function isAmigoError(error: unknown): error is AmigoError;
70
79
  export declare function createApiError(response: Response, body?: unknown): AmigoError;
71
80
  export declare function createErrorMiddleware(): Middleware;
81
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amigo-ai/sdk",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Official TypeScript SDK for the Amigo classic and Platform APIs",
5
5
  "keywords": [
6
6
  "amigo",