@merit-systems/echo-react-sdk 1.0.5 → 1.0.6
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/echo-react-sdk.umd.js +3 -3
- package/dist/echo-react-sdk.umd.js.map +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -2
- package/dist/index.js +6851 -3904
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Balance } from '@merit-systems/echo-typescript-sdk';
|
|
2
2
|
import { default as default_2 } from 'react';
|
|
3
|
+
import { EchoClient } from '@merit-systems/echo-typescript-sdk';
|
|
3
4
|
import { EchoContextValue as EchoContextValue_2 } from '..';
|
|
4
5
|
import { FreeBalance } from '@merit-systems/echo-typescript-sdk';
|
|
5
6
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
6
7
|
import { OpenAI as OpenAI_2 } from 'openai';
|
|
7
8
|
import { ReactNode } from 'react';
|
|
9
|
+
import { User } from 'oidc-client-ts';
|
|
8
10
|
|
|
9
11
|
export declare type EchoBalance = Balance;
|
|
10
12
|
|
|
@@ -16,6 +18,7 @@ export declare interface EchoConfig {
|
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export declare interface EchoContextValue {
|
|
21
|
+
rawUser: User | null | undefined;
|
|
19
22
|
user: EchoUser | null;
|
|
20
23
|
balance: EchoBalance | null;
|
|
21
24
|
freeTierBalance: FreeBalance | null;
|
|
@@ -23,6 +26,7 @@ export declare interface EchoContextValue {
|
|
|
23
26
|
isLoading: boolean;
|
|
24
27
|
error: string | null;
|
|
25
28
|
token: string | null;
|
|
29
|
+
echoClient: EchoClient | null;
|
|
26
30
|
signIn: () => Promise<void>;
|
|
27
31
|
signOut: () => Promise<void>;
|
|
28
32
|
refreshBalance: () => Promise<void>;
|
|
@@ -31,7 +35,7 @@ export declare interface EchoContextValue {
|
|
|
31
35
|
clearAuth: () => Promise<void>;
|
|
32
36
|
}
|
|
33
37
|
|
|
34
|
-
export declare function EchoProvider({ config, children }: EchoProviderProps): JSX_2.Element;
|
|
38
|
+
export declare function EchoProvider({ config, children }: EchoProviderProps): JSX_2.Element | null;
|
|
35
39
|
|
|
36
40
|
declare interface EchoProviderProps {
|
|
37
41
|
config: EchoConfig;
|
|
@@ -47,7 +51,7 @@ export declare interface EchoSignInProps {
|
|
|
47
51
|
children?: React.ReactNode;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
export declare function EchoTokenPurchase({
|
|
54
|
+
export declare function EchoTokenPurchase({ onPurchaseComplete, onError, className, children, }: EchoTokenPurchaseProps): JSX_2.Element;
|
|
51
55
|
|
|
52
56
|
export declare interface EchoTokenPurchaseProps {
|
|
53
57
|
amount?: number;
|
|
@@ -77,6 +81,16 @@ declare type OpenAI = OpenAI_2;
|
|
|
77
81
|
|
|
78
82
|
export declare function useEcho(): EchoContextValue_2;
|
|
79
83
|
|
|
84
|
+
/**
|
|
85
|
+
* Custom hook for managing EchoClient lifecycle
|
|
86
|
+
* Handles client creation, token management, and cleanup
|
|
87
|
+
*/
|
|
88
|
+
export declare function useEchoClient({ apiUrl }: UseEchoClientOptions): EchoClient | null;
|
|
89
|
+
|
|
90
|
+
declare interface UseEchoClientOptions {
|
|
91
|
+
apiUrl: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
80
94
|
export declare function useEchoOpenAI(options?: UseEchoOpenAIOptions): UseEchoOpenAIResult;
|
|
81
95
|
|
|
82
96
|
declare interface UseEchoOpenAIOptions {
|