obi-sdk 0.1.4 → 0.1.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/index.d.ts +56 -0
- package/package.json +5 -4
package/index.d.ts
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export interface ObiAssistantConfig {
|
|
2
|
+
apiKey: string
|
|
3
|
+
position?: "bottom-right" | "bottom-left" | "top-right" | "top-left"
|
|
4
|
+
user?: {
|
|
5
|
+
id: string
|
|
6
|
+
email?: string
|
|
7
|
+
metadata?: Record<string, any>
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export declare class ObiAssistant {
|
|
12
|
+
static init(config: ObiAssistantConfig): HTMLElement
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export declare class ObiSDK {
|
|
16
|
+
// Core SDK methods
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare class ObiWidget extends HTMLElement {
|
|
20
|
+
apiKey: string
|
|
21
|
+
position?: string
|
|
22
|
+
user?: {
|
|
23
|
+
id: string
|
|
24
|
+
email?: string
|
|
25
|
+
metadata?: Record<string, any>
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export declare enum EventType {
|
|
30
|
+
CONNECTING = "connecting",
|
|
31
|
+
CONNECTED = "connected",
|
|
32
|
+
DISCONNECTED = "disconnected",
|
|
33
|
+
ERROR = "error",
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export declare enum SDKState {
|
|
37
|
+
IDLE = "idle",
|
|
38
|
+
LOADING = "loading",
|
|
39
|
+
READY = "ready",
|
|
40
|
+
ERROR = "error",
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Initialize the Obi Assistant widget with the latest SDK version
|
|
45
|
+
*/
|
|
46
|
+
export declare function initObi(config: ObiAssistantConfig): Promise<HTMLElement>
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Get the latest SDK instance for advanced usage
|
|
50
|
+
*/
|
|
51
|
+
export declare function getLatestSDK(): Promise<ObiSDK>
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Create a session using the latest SDK
|
|
55
|
+
*/
|
|
56
|
+
export declare function createLatestSession(options?: any): Promise<any>
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "obi-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "JavaScript SDK for Obi",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/obi-sdk.umd.js",
|
|
7
7
|
"module": "dist/obi-sdk.es.js",
|
|
8
|
-
"types": "
|
|
8
|
+
"types": "index.d.ts",
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
10
|
+
"dist",
|
|
11
|
+
"index.d.ts"
|
|
11
12
|
],
|
|
12
13
|
"scripts": {
|
|
13
14
|
"dev": "vite",
|
|
14
|
-
"build": "tsc && vite build
|
|
15
|
+
"build": "tsc && vite build",
|
|
15
16
|
"build:loader": "vite build --config vite.loader.config.js",
|
|
16
17
|
"build:standalone": "vite build --config vite.standalone.config.js",
|
|
17
18
|
"build:modular": "vite build --config vite.modular.config.js",
|