@aizu-chat/react 0.0.10 → 0.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.
- package/dist/index.d.mts +127 -4
- package/dist/index.d.ts +127 -4
- package/dist/index.js +900 -280
- package/dist/index.mjs +2039 -8
- package/package.json +12 -28
- package/dist/chunk-2TI7IWH7.mjs +0 -67
- package/dist/chunk-33CPD3DF.mjs +0 -59
- package/dist/chunk-HDOMF6SD.mjs +0 -1370
- package/dist/chunk-KLPKNMIP.mjs +0 -15
- package/dist/chunk-TXBCCMO7.mjs +0 -1186
- package/dist/components.d.mts +0 -59
- package/dist/components.d.ts +0 -59
- package/dist/components.js +0 -1441
- package/dist/components.mjs +0 -14
- package/dist/hooks.d.mts +0 -6
- package/dist/hooks.d.ts +0 -6
- package/dist/hooks.js +0 -40
- package/dist/hooks.mjs +0 -8
- package/dist/sdk.d.mts +0 -38
- package/dist/sdk.d.ts +0 -38
- package/dist/sdk.js +0 -136
- package/dist/sdk.mjs +0 -10
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React, { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
interface AizuClientConfig {
|
|
5
|
+
hostUrl: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}
|
|
9
|
+
interface ChatRequest {
|
|
10
|
+
query: string;
|
|
11
|
+
thread_id?: string;
|
|
12
|
+
resource_id?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ChatResponse {
|
|
15
|
+
thread_id: string;
|
|
16
|
+
resource_id: string;
|
|
17
|
+
response: string;
|
|
18
|
+
products?: Product[];
|
|
19
|
+
type?: TypeResponse;
|
|
20
|
+
}
|
|
21
|
+
interface Product {
|
|
22
|
+
product_id: string;
|
|
23
|
+
spu?: string;
|
|
24
|
+
sku: string;
|
|
25
|
+
title: string;
|
|
26
|
+
description: string;
|
|
27
|
+
handle: string;
|
|
28
|
+
price: number;
|
|
29
|
+
stock: number;
|
|
30
|
+
thumbnail?: string | null;
|
|
31
|
+
rating?: number;
|
|
32
|
+
review_count?: number;
|
|
33
|
+
estimated_delivery_days?: number;
|
|
34
|
+
similarity?: number;
|
|
35
|
+
}
|
|
36
|
+
declare enum TypeResponse {
|
|
37
|
+
SUGGEST_PRODUCTS = "suggest_products",
|
|
38
|
+
REQUEST_CLARIFICATION = "request_clarification",
|
|
39
|
+
START_SHOPPING = "start_shopping"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare class AizuClient {
|
|
43
|
+
private hostUrl;
|
|
44
|
+
private apiKey;
|
|
45
|
+
private timeout;
|
|
46
|
+
constructor(config: AizuClientConfig);
|
|
47
|
+
private request;
|
|
48
|
+
chat(params: ChatRequest, options?: {
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
}): Promise<ChatResponse>;
|
|
51
|
+
}
|
|
52
|
+
declare const createAizuClient: ({ hostUrl, apiKey, timeout, }: {
|
|
53
|
+
hostUrl: string;
|
|
54
|
+
apiKey: string;
|
|
55
|
+
timeout?: number;
|
|
56
|
+
}) => AizuClient;
|
|
57
|
+
|
|
58
|
+
interface AizuChatProps {
|
|
59
|
+
aizuClient: AizuClient;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare const AizuChat: ({ aizuClient }: AizuChatProps) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
|
|
64
|
+
type ButtonProps = ComponentProps<"button">;
|
|
65
|
+
declare const Button: React.NamedExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
66
|
+
|
|
67
|
+
type LoadingProps = {
|
|
68
|
+
message?: string;
|
|
69
|
+
};
|
|
70
|
+
declare const Loading: ({ message }: LoadingProps) => react_jsx_runtime.JSX.Element;
|
|
71
|
+
|
|
72
|
+
declare enum MockResponseENUM {
|
|
73
|
+
CATEGORY_SMARTPHONE = "CATEGORY_SMARTPHONE",
|
|
74
|
+
CATEGORY_NOTEBOOK = "CATEGORY_NOTEBOOK",
|
|
75
|
+
QUICK_MENU_SHOP = "QUICK_MENU_SHOP",
|
|
76
|
+
ERROR = "ERROR",
|
|
77
|
+
BUDGET_INQUIRY = "BUDGET_INQUIRY",
|
|
78
|
+
CODE_CANT_USE = "CODE_CANT_USE",
|
|
79
|
+
QUICK_MENU_PAYMENT_FAILED = "QUICK_MENU_PAYMENT_FAILED",
|
|
80
|
+
FOUND_NOTEBOOK = "FOUND_NOTEBOOK",
|
|
81
|
+
FOUND_COMPUTER = "FOUND_COMPUTER",
|
|
82
|
+
PRODUCT_FOUND_LESS_10000 = "PRODUCT_FOUND_LESS_10000",
|
|
83
|
+
PRODUCT_FOUND_RANGE_10000_20000 = "PRODUCT_FOUND_RANGE_10000_20000",
|
|
84
|
+
PRODUCT_FOUND_RANGE_20000_30000 = "PRODUCT_FOUND_RANGE_20000_30000",
|
|
85
|
+
PRODUCT_FOUND_MORE_30000 = "PRODUCT_FOUND_MORE_30000",
|
|
86
|
+
PRODUCT_PHONE_ALL = "PRODUCT_PHONE_ALL",
|
|
87
|
+
NOTFOUND_PRODUCT = "NOTFOUND_PRODUCT",
|
|
88
|
+
NO_ACTION = "NO_ACTION",
|
|
89
|
+
SHIPPING_INFO = "SHIPPING_INFO",
|
|
90
|
+
PAYMENT_METHODS = "PAYMENT_METHODS",
|
|
91
|
+
WARRANTY_INFO = "WARRANTY_INFO",
|
|
92
|
+
RETURN_POLICY = "RETURN_POLICY",
|
|
93
|
+
PROMOTION_INFO = "PROMOTION_INFO",
|
|
94
|
+
STOCK_AVAILABLE = "STOCK_AVAILABLE",
|
|
95
|
+
OUT_OF_STOCK = "OUT_OF_STOCK",
|
|
96
|
+
SPEC_INQUIRY = "SPEC_INQUIRY"
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
type Menu = {
|
|
100
|
+
id: string;
|
|
101
|
+
title: string;
|
|
102
|
+
mockResponse: MockResponseENUM;
|
|
103
|
+
mockRetryResponse?: MockResponseENUM;
|
|
104
|
+
value?: string;
|
|
105
|
+
phoneNumber?: string;
|
|
106
|
+
imageUrl?: string;
|
|
107
|
+
url?: string;
|
|
108
|
+
};
|
|
109
|
+
type QuickMenusProps = {
|
|
110
|
+
bannerSrc?: string;
|
|
111
|
+
message?: string;
|
|
112
|
+
menus: Menu[];
|
|
113
|
+
handleClick: (menu: Menu) => Promise<void>;
|
|
114
|
+
};
|
|
115
|
+
declare const QuickMenus: ({ bannerSrc, message, menus, handleClick }: QuickMenusProps) => react_jsx_runtime.JSX.Element;
|
|
116
|
+
|
|
117
|
+
interface TestComponentProps {
|
|
118
|
+
client: AizuClient;
|
|
119
|
+
}
|
|
120
|
+
declare const TestComponent: ({ client }: TestComponentProps) => react_jsx_runtime.JSX.Element;
|
|
121
|
+
|
|
122
|
+
declare const useCustom: () => {
|
|
123
|
+
count: number;
|
|
124
|
+
increment: () => void;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export { AizuChat, AizuClient, type AizuClientConfig, Button, type ButtonProps, type ChatRequest, type ChatResponse, Loading, type Menu, type Product, QuickMenus, type QuickMenusProps, TestComponent, TypeResponse, createAizuClient, useCustom };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,127 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React, { ComponentProps } from 'react';
|
|
3
|
+
|
|
4
|
+
interface AizuClientConfig {
|
|
5
|
+
hostUrl: string;
|
|
6
|
+
apiKey: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
}
|
|
9
|
+
interface ChatRequest {
|
|
10
|
+
query: string;
|
|
11
|
+
thread_id?: string;
|
|
12
|
+
resource_id?: string;
|
|
13
|
+
}
|
|
14
|
+
interface ChatResponse {
|
|
15
|
+
thread_id: string;
|
|
16
|
+
resource_id: string;
|
|
17
|
+
response: string;
|
|
18
|
+
products?: Product[];
|
|
19
|
+
type?: TypeResponse;
|
|
20
|
+
}
|
|
21
|
+
interface Product {
|
|
22
|
+
product_id: string;
|
|
23
|
+
spu?: string;
|
|
24
|
+
sku: string;
|
|
25
|
+
title: string;
|
|
26
|
+
description: string;
|
|
27
|
+
handle: string;
|
|
28
|
+
price: number;
|
|
29
|
+
stock: number;
|
|
30
|
+
thumbnail?: string | null;
|
|
31
|
+
rating?: number;
|
|
32
|
+
review_count?: number;
|
|
33
|
+
estimated_delivery_days?: number;
|
|
34
|
+
similarity?: number;
|
|
35
|
+
}
|
|
36
|
+
declare enum TypeResponse {
|
|
37
|
+
SUGGEST_PRODUCTS = "suggest_products",
|
|
38
|
+
REQUEST_CLARIFICATION = "request_clarification",
|
|
39
|
+
START_SHOPPING = "start_shopping"
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
declare class AizuClient {
|
|
43
|
+
private hostUrl;
|
|
44
|
+
private apiKey;
|
|
45
|
+
private timeout;
|
|
46
|
+
constructor(config: AizuClientConfig);
|
|
47
|
+
private request;
|
|
48
|
+
chat(params: ChatRequest, options?: {
|
|
49
|
+
signal?: AbortSignal;
|
|
50
|
+
}): Promise<ChatResponse>;
|
|
51
|
+
}
|
|
52
|
+
declare const createAizuClient: ({ hostUrl, apiKey, timeout, }: {
|
|
53
|
+
hostUrl: string;
|
|
54
|
+
apiKey: string;
|
|
55
|
+
timeout?: number;
|
|
56
|
+
}) => AizuClient;
|
|
57
|
+
|
|
58
|
+
interface AizuChatProps {
|
|
59
|
+
aizuClient: AizuClient;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
declare const AizuChat: ({ aizuClient }: AizuChatProps) => react_jsx_runtime.JSX.Element;
|
|
63
|
+
|
|
64
|
+
type ButtonProps = ComponentProps<"button">;
|
|
65
|
+
declare const Button: React.NamedExoticComponent<Omit<React.DetailedHTMLProps<React.ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
66
|
+
|
|
67
|
+
type LoadingProps = {
|
|
68
|
+
message?: string;
|
|
69
|
+
};
|
|
70
|
+
declare const Loading: ({ message }: LoadingProps) => react_jsx_runtime.JSX.Element;
|
|
71
|
+
|
|
72
|
+
declare enum MockResponseENUM {
|
|
73
|
+
CATEGORY_SMARTPHONE = "CATEGORY_SMARTPHONE",
|
|
74
|
+
CATEGORY_NOTEBOOK = "CATEGORY_NOTEBOOK",
|
|
75
|
+
QUICK_MENU_SHOP = "QUICK_MENU_SHOP",
|
|
76
|
+
ERROR = "ERROR",
|
|
77
|
+
BUDGET_INQUIRY = "BUDGET_INQUIRY",
|
|
78
|
+
CODE_CANT_USE = "CODE_CANT_USE",
|
|
79
|
+
QUICK_MENU_PAYMENT_FAILED = "QUICK_MENU_PAYMENT_FAILED",
|
|
80
|
+
FOUND_NOTEBOOK = "FOUND_NOTEBOOK",
|
|
81
|
+
FOUND_COMPUTER = "FOUND_COMPUTER",
|
|
82
|
+
PRODUCT_FOUND_LESS_10000 = "PRODUCT_FOUND_LESS_10000",
|
|
83
|
+
PRODUCT_FOUND_RANGE_10000_20000 = "PRODUCT_FOUND_RANGE_10000_20000",
|
|
84
|
+
PRODUCT_FOUND_RANGE_20000_30000 = "PRODUCT_FOUND_RANGE_20000_30000",
|
|
85
|
+
PRODUCT_FOUND_MORE_30000 = "PRODUCT_FOUND_MORE_30000",
|
|
86
|
+
PRODUCT_PHONE_ALL = "PRODUCT_PHONE_ALL",
|
|
87
|
+
NOTFOUND_PRODUCT = "NOTFOUND_PRODUCT",
|
|
88
|
+
NO_ACTION = "NO_ACTION",
|
|
89
|
+
SHIPPING_INFO = "SHIPPING_INFO",
|
|
90
|
+
PAYMENT_METHODS = "PAYMENT_METHODS",
|
|
91
|
+
WARRANTY_INFO = "WARRANTY_INFO",
|
|
92
|
+
RETURN_POLICY = "RETURN_POLICY",
|
|
93
|
+
PROMOTION_INFO = "PROMOTION_INFO",
|
|
94
|
+
STOCK_AVAILABLE = "STOCK_AVAILABLE",
|
|
95
|
+
OUT_OF_STOCK = "OUT_OF_STOCK",
|
|
96
|
+
SPEC_INQUIRY = "SPEC_INQUIRY"
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
type Menu = {
|
|
100
|
+
id: string;
|
|
101
|
+
title: string;
|
|
102
|
+
mockResponse: MockResponseENUM;
|
|
103
|
+
mockRetryResponse?: MockResponseENUM;
|
|
104
|
+
value?: string;
|
|
105
|
+
phoneNumber?: string;
|
|
106
|
+
imageUrl?: string;
|
|
107
|
+
url?: string;
|
|
108
|
+
};
|
|
109
|
+
type QuickMenusProps = {
|
|
110
|
+
bannerSrc?: string;
|
|
111
|
+
message?: string;
|
|
112
|
+
menus: Menu[];
|
|
113
|
+
handleClick: (menu: Menu) => Promise<void>;
|
|
114
|
+
};
|
|
115
|
+
declare const QuickMenus: ({ bannerSrc, message, menus, handleClick }: QuickMenusProps) => react_jsx_runtime.JSX.Element;
|
|
116
|
+
|
|
117
|
+
interface TestComponentProps {
|
|
118
|
+
client: AizuClient;
|
|
119
|
+
}
|
|
120
|
+
declare const TestComponent: ({ client }: TestComponentProps) => react_jsx_runtime.JSX.Element;
|
|
121
|
+
|
|
122
|
+
declare const useCustom: () => {
|
|
123
|
+
count: number;
|
|
124
|
+
increment: () => void;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export { AizuChat, AizuClient, type AizuClientConfig, Button, type ButtonProps, type ChatRequest, type ChatResponse, Loading, type Menu, type Product, QuickMenus, type QuickMenusProps, TestComponent, TypeResponse, createAizuClient, useCustom };
|