@axsdk/core 0.1.8 → 0.2.0

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.
@@ -9,7 +9,9 @@ export declare class ApiError extends Error {
9
9
  readonly status: number;
10
10
  readonly statusText: string;
11
11
  readonly response?: unknown;
12
- constructor(message: string, status: number, statusText: string, response?: unknown);
12
+ url: string;
13
+ method: string;
14
+ constructor(message: string, status: number, statusText: string, response?: unknown, url?: string, method?: string);
13
15
  isClientError(): boolean;
14
16
  isServerError(): boolean;
15
17
  isNetworkError(): boolean;
package/dist/axapi.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ApiClient, type RequestInterceptor } from './apiclient';
1
+ import { ApiClient, type RequestInterceptor, type ErrorInterceptor } from './apiclient';
2
2
  export declare const api: ApiClient;
3
- export declare function init(ri: RequestInterceptor): void;
3
+ export declare function init(ri: RequestInterceptor, ei?: ErrorInterceptor): void;
4
4
  export declare function health(): Promise<unknown>;
5
5
  export declare function createSession(): Promise<unknown>;
6
6
  export declare function getMessages(): Promise<unknown>;
@@ -8,3 +8,4 @@ export declare function postMessage(text: string, images: string[]): Promise<unk
8
8
  export declare function cancelSession(sessionID: string): Promise<unknown>;
9
9
  export declare function getPendingCalls(): Promise<unknown>;
10
10
  export declare function updateCall(callID: string, status: string, result: string): Promise<unknown>;
11
+ export declare function postAnswers(requestID: string, status: string, answers: string[]): Promise<unknown>;
package/dist/axsdk.d.ts CHANGED
@@ -2,7 +2,7 @@ import EventEmitter from 'eventemitter3';
2
2
  import { type StoreApi } from 'zustand/vanilla';
3
3
  import type { AXSDKConfig, AXHandler } from './types';
4
4
  export type * from './types';
5
- import { type AppState, type ChatState } from './store';
5
+ import { type AppState, type ChatState, type ErrorState } from './store';
6
6
  declare class AxSdk extends EventEmitter {
7
7
  config: AXSDKConfig | undefined;
8
8
  constructor();
@@ -16,9 +16,11 @@ declare class AxSdk extends EventEmitter {
16
16
  getLanguage(): string;
17
17
  t(id: string): string;
18
18
  getChatStore(): StoreApi<ChatState>;
19
+ getErrorStore(): StoreApi<ErrorState>;
19
20
  getChatState(): ChatState;
20
21
  resetSession(): void;
21
22
  sendMessage(text: string): void;
23
+ private errorInterceptor;
22
24
  private requestInterceptor;
23
25
  }
24
26
  export declare const AXSDK: AxSdk;
@@ -1,3 +1,5 @@
1
+ import type { MessageError } from './types/chat';
2
+ export declare function setError(id: string, error: MessageError): void;
1
3
  export declare function updateFromMessages(payload: unknown): Promise<void>;
2
4
  export declare function updateFromSessionStatus(payload: unknown): Promise<string | undefined>;
3
5
  export declare function updateFromSessionUpdate(payload: unknown): Promise<void>;
package/dist/index.d.ts CHANGED
@@ -1 +1,3 @@
1
1
  export * from './axtools';
2
+ export { errorStore } from './store';
3
+ export type { ApiError, ErrorState } from './store';