@insure-os/client 0.0.74 → 0.0.76

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.d.ts CHANGED
@@ -673,6 +673,17 @@ declare enum ErrorType {
673
673
  TIMEOUT_ERROR = "TIMEOUT_ERROR",
674
674
  MAINTENANCE_ERROR = "MAINTENANCE_ERROR"
675
675
  }
676
+ /**
677
+ * Public contact details for the insurer that owns the current widget
678
+ * context. Surfaced by the engine on 503 responses so error pages can show
679
+ * "Call us" / "Email us" actions.
680
+ */
681
+ interface ErrorOrganisation {
682
+ name?: string | null;
683
+ admin_email?: string | null;
684
+ phone?: string | null;
685
+ quote_page_url?: string | null;
686
+ }
676
687
  /**
677
688
  * Custom error class for InsureOS operations
678
689
  */
@@ -682,7 +693,8 @@ declare class InsureOSError extends Error {
682
693
  statusCode?: number | undefined;
683
694
  retryAfter?: string | undefined;
684
695
  validationErrors?: Record<string, any> | undefined;
685
- constructor(type: ErrorType, message: string, retryable?: boolean, statusCode?: number | undefined, retryAfter?: string | undefined, validationErrors?: Record<string, any> | undefined);
696
+ organisation?: (ErrorOrganisation | null) | undefined;
697
+ constructor(type: ErrorType, message: string, retryable?: boolean, statusCode?: number | undefined, retryAfter?: string | undefined, validationErrors?: Record<string, any> | undefined, organisation?: (ErrorOrganisation | null) | undefined);
686
698
  }
687
699
  /**
688
700
  * Error handling strategy for different error types
@@ -909,6 +921,17 @@ declare function groupErrorsByField(errors: ValidationError[]): Record<string, V
909
921
 
910
922
  type AppErrorType = "initialization" | "calculation" | "network" | "validation" | "maintenance" | "unknown";
911
923
  type AppErrorSeverity = "warning" | "error" | "critical";
924
+ /**
925
+ * Public insurer contact info forwarded by the engine on 503 responses so
926
+ * error pages (currently the maintenance page) can render "Call us" /
927
+ * "Email us" actions.
928
+ */
929
+ interface AppErrorOrganisation {
930
+ name?: string | null;
931
+ admin_email?: string | null;
932
+ phone?: string | null;
933
+ quote_page_url?: string | null;
934
+ }
912
935
  interface AppError {
913
936
  id: string;
914
937
  type: AppErrorType;
@@ -921,6 +944,7 @@ interface AppError {
921
944
  timestamp: number;
922
945
  dismissed?: boolean;
923
946
  trackingId?: string;
947
+ organisation?: AppErrorOrganisation | null;
924
948
  }
925
949
  interface ServerErrorResponse {
926
950
  statusCode: number;