@botpress/webchat 1.3.2 → 1.3.4
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/.turbo/turbo-build.log +23 -0
- package/dist/adapters/messaging-to-target.d.ts +72 -40
- package/dist/adapters/target.d.ts +5 -0
- package/dist/adapters/webchat-to-target.d.ts +58 -34
- package/dist/client/MessagingClient/client.d.ts +1 -0
- package/dist/client/PushpinClient/inner-client/index.d.ts +2 -2
- package/dist/client/types.d.ts +1 -0
- package/dist/components/Block.d.ts +7 -5
- package/dist/contexts/WebchatContext.d.ts +3 -7
- package/dist/gen/client/index.d.ts +78 -13
- package/dist/gen/{models/message.t.d.ts → client/models.d.ts} +91 -3
- package/dist/gen/client/operations/addParticipant.d.ts +51 -0
- package/dist/gen/client/operations/createConversation.d.ts +39 -0
- package/dist/gen/client/operations/createEvent.d.ts +79 -0
- package/dist/gen/client/operations/createMessage.d.ts +274 -0
- package/dist/gen/client/operations/createUser.d.ts +60 -0
- package/dist/gen/client/operations/deleteConversation.d.ts +22 -0
- package/dist/gen/client/operations/deleteMessage.d.ts +22 -0
- package/dist/gen/client/operations/deleteUser.d.ts +21 -0
- package/dist/gen/client/operations/getConversation.d.ts +36 -0
- package/dist/gen/client/operations/getEvent.d.ts +58 -0
- package/dist/gen/client/operations/getMessage.d.ts +157 -0
- package/dist/gen/client/operations/getParticipant.d.ts +48 -0
- package/dist/gen/client/operations/getUser.d.ts +46 -0
- package/dist/gen/client/operations/listConversationMessages.d.ts +161 -0
- package/dist/gen/client/operations/listConversations.d.ts +42 -0
- package/dist/gen/client/operations/listParticipants.d.ts +51 -0
- package/dist/gen/client/operations/listenConversation.d.ts +22 -0
- package/dist/gen/client/operations/removeParticipant.d.ts +23 -0
- package/dist/gen/client/operations/updateUser.d.ts +60 -0
- package/dist/gen/signals/{customSignal.t.d.ts → custom.t.d.ts} +1 -1
- package/dist/gen/signals/index.d.ts +16 -16
- package/dist/gen/signals/{messageCreatedSignal.t.d.ts → messageCreated.t.d.ts} +1 -1
- package/dist/gen/signals/{webchatConfigSignal.t.d.ts → webchatConfig.t.d.ts} +1 -1
- package/dist/gen/signals/{webchatVisibilitySignal.t.d.ts → webchatVisibility.t.d.ts} +1 -1
- package/dist/index.js +32913 -21174
- package/dist/index.umd.cjs +278 -95
- package/dist/types/block-type.d.ts +3 -3
- package/openapi.ts +6 -11
- package/package.json +4 -1
- package/dist/gen/client/api.d.ts +0 -2012
- package/dist/gen/client/base.d.ts +0 -54
- package/dist/gen/client/client.d.ts +0 -61
- package/dist/gen/client/common.d.ts +0 -65
- package/dist/gen/client/configuration.d.ts +0 -83
- package/dist/gen/models/conversation.j.d.ts +0 -20
- package/dist/gen/models/conversation.t.d.ts +0 -10
- package/dist/gen/models/conversation.z.d.ts +0 -15
- package/dist/gen/models/index.d.ts +0 -1014
- package/dist/gen/models/message.j.d.ts +0 -490
- package/dist/gen/models/message.z.d.ts +0 -439
- package/dist/gen/models/user.j.d.ts +0 -26
- package/dist/gen/models/user.t.d.ts +0 -12
- package/dist/gen/models/user.z.d.ts +0 -21
- /package/dist/gen/signals/{customSignal.j.d.ts → custom.j.d.ts} +0 -0
- /package/dist/gen/signals/{customSignal.z.d.ts → custom.z.d.ts} +0 -0
- /package/dist/gen/signals/{messageCreatedSignal.j.d.ts → messageCreated.j.d.ts} +0 -0
- /package/dist/gen/signals/{messageCreatedSignal.z.d.ts → messageCreated.z.d.ts} +0 -0
- /package/dist/gen/signals/{webchatConfigSignal.j.d.ts → webchatConfig.j.d.ts} +0 -0
- /package/dist/gen/signals/{webchatConfigSignal.z.d.ts → webchatConfig.z.d.ts} +0 -0
- /package/dist/gen/signals/{webchatVisibilitySignal.j.d.ts → webchatVisibility.j.d.ts} +0 -0
- /package/dist/gen/signals/{webchatVisibilitySignal.z.d.ts → webchatVisibility.z.d.ts} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
|
|
2
|
+
> @botpress/webchat@1.3.4 build /home/runner/work/echo/echo/packages/webchat-frontend
|
|
3
|
+
> vite build
|
|
4
|
+
|
|
5
|
+
[36mvite v4.4.11 [32mbuilding for production...[36m[39m
|
|
6
|
+
transforming...
|
|
7
|
+
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "crypto" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/packages/webchat-frontend/src/gen/client/errors.ts". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
8
|
+
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "node:http" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.8.2/node_modules/@botpress/sdk/dist/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
9
|
+
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "util" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@botpress+sdk@0.8.2/node_modules/@botpress/sdk/dist/index.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
10
|
+
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "path" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.6.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/url.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
11
|
+
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "path" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@apidevtools+json-schema-ref-parser@11.6.1/node_modules/@apidevtools/json-schema-ref-parser/dist/lib/util/convert-path-to-posix.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
12
|
+
[1m[33m[plugin:vite:resolve][39m[22m [33mModule "util" has been externalized for browser compatibility, imported by "/home/runner/work/echo/echo/node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/esm/types.js". See http://vitejs.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.[39m
|
|
13
|
+
../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/esm/types.js (1:9) "inspect" is not exported by "__vite-browser-external", imported by "../../node_modules/.pnpm/@jsdevtools+ono@7.1.3/node_modules/@jsdevtools/ono/esm/types.js".
|
|
14
|
+
[32m✓[39m 2306 modules transformed.
|
|
15
|
+
rendering chunks...
|
|
16
|
+
[32m
|
|
17
|
+
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
18
|
+
computing gzip size...
|
|
19
|
+
[32m[36m[vite:dts][32m Declaration files built in 14532ms.
|
|
20
|
+
[39m
|
|
21
|
+
[2mdist/[22m[36mindex.js [39m[1m[33m1,501.30 kB[39m[22m[2m │ gzip: 369.07 kB[22m
|
|
22
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[33m1,034.78 kB[39m[22m[2m │ gzip: 308.50 kB[22m
|
|
23
|
+
[32m✓ built in 25.13s[39m
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import * as adapters from 'webchat-adapters';
|
|
2
2
|
import * as target from './target';
|
|
3
3
|
type WithBubble<T extends target.Message> = target.BubbleOf<T>;
|
|
4
|
-
export type MessagingToTargetAdapters = adapters.Adapter<adapters.messaging.Messages, target.
|
|
4
|
+
export type MessagingToTargetAdapters = adapters.Adapter<adapters.messaging.Messages, target.AdaptersOutput>;
|
|
5
5
|
export declare const audioAdapter: ({ type, audio }: {
|
|
6
6
|
type: "audio";
|
|
7
7
|
audio: string;
|
|
8
|
+
title?: string | undefined;
|
|
8
9
|
className?: string | undefined;
|
|
9
10
|
avatarUrl?: string | undefined;
|
|
10
|
-
title?: string | undefined;
|
|
11
11
|
}) => {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
payload: {
|
|
13
|
+
type: "audio";
|
|
14
|
+
url: string;
|
|
15
|
+
};
|
|
14
16
|
};
|
|
15
17
|
export declare const cardAdapter: (card: {
|
|
16
18
|
title: string;
|
|
@@ -29,10 +31,12 @@ export declare const cardAdapter: (card: {
|
|
|
29
31
|
payload: string;
|
|
30
32
|
})[];
|
|
31
33
|
className?: string | undefined;
|
|
32
|
-
avatarUrl?: string | undefined;
|
|
33
|
-
subtitle?: string | undefined;
|
|
34
34
|
image?: string | undefined;
|
|
35
|
-
|
|
35
|
+
subtitle?: string | undefined;
|
|
36
|
+
avatarUrl?: string | undefined;
|
|
37
|
+
}) => {
|
|
38
|
+
payload: WithBubble<target.ColumnMessage>;
|
|
39
|
+
};
|
|
36
40
|
export declare const carouselAdapter: ({ items }: {
|
|
37
41
|
type: "carousel";
|
|
38
42
|
items: {
|
|
@@ -52,15 +56,17 @@ export declare const carouselAdapter: ({ items }: {
|
|
|
52
56
|
payload: string;
|
|
53
57
|
})[];
|
|
54
58
|
className?: string | undefined;
|
|
55
|
-
avatarUrl?: string | undefined;
|
|
56
|
-
subtitle?: string | undefined;
|
|
57
59
|
image?: string | undefined;
|
|
60
|
+
subtitle?: string | undefined;
|
|
61
|
+
avatarUrl?: string | undefined;
|
|
58
62
|
}[];
|
|
59
63
|
className?: string | undefined;
|
|
60
64
|
avatarUrl?: string | undefined;
|
|
61
65
|
}) => {
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
payload: {
|
|
67
|
+
type: "carousel";
|
|
68
|
+
blocks: target.ColumnMessage[];
|
|
69
|
+
};
|
|
64
70
|
};
|
|
65
71
|
export declare const choiceAdapter: (x: {
|
|
66
72
|
type: "single-choice";
|
|
@@ -70,39 +76,47 @@ export declare const choiceAdapter: (x: {
|
|
|
70
76
|
value: string;
|
|
71
77
|
}[];
|
|
72
78
|
className?: string | undefined;
|
|
73
|
-
avatarUrl?: string | undefined;
|
|
74
79
|
disableFreeText?: boolean | undefined;
|
|
75
|
-
|
|
80
|
+
avatarUrl?: string | undefined;
|
|
81
|
+
}) => {
|
|
82
|
+
disableInput: boolean | undefined;
|
|
83
|
+
payload: target.Message;
|
|
84
|
+
};
|
|
76
85
|
export declare const dropdownAdapter: (x: {
|
|
77
86
|
options: {
|
|
78
87
|
value: string;
|
|
79
88
|
label: string;
|
|
80
89
|
}[];
|
|
81
90
|
type: "dropdown";
|
|
91
|
+
message?: string | undefined;
|
|
92
|
+
text?: string | undefined;
|
|
82
93
|
className?: string | undefined;
|
|
94
|
+
markdown?: boolean | undefined;
|
|
83
95
|
avatarUrl?: string | undefined;
|
|
84
|
-
message?: string | undefined;
|
|
85
96
|
allowCreation?: boolean | undefined;
|
|
86
97
|
placeholderText?: string | undefined;
|
|
87
98
|
allowMultiple?: boolean | undefined;
|
|
88
99
|
buttonText?: string | undefined;
|
|
89
100
|
width?: number | undefined;
|
|
90
101
|
displayInKeyboard?: boolean | undefined;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
}) => {
|
|
103
|
+
disableInput: true;
|
|
104
|
+
payload: WithBubble<target.ColumnMessage>;
|
|
105
|
+
};
|
|
94
106
|
export declare const fileAdapter: ({ file, ...props }: {
|
|
95
107
|
type: "file";
|
|
96
108
|
file: string;
|
|
97
|
-
className?: string | undefined;
|
|
98
|
-
avatarUrl?: string | undefined;
|
|
99
109
|
title?: string | undefined;
|
|
100
|
-
}) => {
|
|
101
|
-
type: "file";
|
|
102
110
|
className?: string | undefined;
|
|
103
111
|
avatarUrl?: string | undefined;
|
|
104
|
-
|
|
105
|
-
|
|
112
|
+
}) => {
|
|
113
|
+
payload: {
|
|
114
|
+
type: "file";
|
|
115
|
+
title?: string | undefined;
|
|
116
|
+
className?: string | undefined;
|
|
117
|
+
avatarUrl?: string | undefined;
|
|
118
|
+
url: string;
|
|
119
|
+
};
|
|
106
120
|
};
|
|
107
121
|
export declare const imageAdapter: ({ type, image }: {
|
|
108
122
|
type: "image";
|
|
@@ -110,42 +124,60 @@ export declare const imageAdapter: ({ type, image }: {
|
|
|
110
124
|
className?: string | undefined;
|
|
111
125
|
avatarUrl?: string | undefined;
|
|
112
126
|
}) => {
|
|
113
|
-
|
|
114
|
-
|
|
127
|
+
payload: {
|
|
128
|
+
type: "image";
|
|
129
|
+
url: string;
|
|
130
|
+
};
|
|
115
131
|
};
|
|
116
132
|
export declare const locationAdapter: ({ type, latitude, longitude, title, address }: {
|
|
117
133
|
type: "location";
|
|
118
134
|
latitude: number;
|
|
119
135
|
longitude: number;
|
|
136
|
+
title?: string | undefined;
|
|
120
137
|
className?: string | undefined;
|
|
121
|
-
avatarUrl?: string | undefined;
|
|
122
138
|
address?: string | undefined;
|
|
123
|
-
|
|
139
|
+
avatarUrl?: string | undefined;
|
|
124
140
|
}) => {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
141
|
+
payload: {
|
|
142
|
+
type: "location";
|
|
143
|
+
latitude: number;
|
|
144
|
+
longitude: number;
|
|
145
|
+
title: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
export declare const quickReplyAdapter: ({ text, payload }: {
|
|
149
|
+
type: "quick_reply";
|
|
150
|
+
text: string;
|
|
151
|
+
payload?: string | undefined;
|
|
152
|
+
}) => {
|
|
153
|
+
payload: {
|
|
154
|
+
type: "text";
|
|
155
|
+
text: string;
|
|
156
|
+
};
|
|
129
157
|
};
|
|
130
158
|
export declare const textAdapter: ({ type, text }: {
|
|
131
159
|
type: "text";
|
|
132
160
|
text: string;
|
|
133
161
|
className?: string | undefined;
|
|
134
|
-
avatarUrl?: string | undefined;
|
|
135
162
|
markdown?: boolean | undefined;
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
163
|
+
avatarUrl?: string | undefined;
|
|
164
|
+
}) => {
|
|
165
|
+
payload: WithBubble<{
|
|
166
|
+
type: "text";
|
|
167
|
+
text: string;
|
|
168
|
+
}>;
|
|
169
|
+
};
|
|
140
170
|
export declare const videoAdapter: ({ type, video }: {
|
|
141
171
|
type: "video";
|
|
142
172
|
video: string;
|
|
173
|
+
title?: string | undefined;
|
|
143
174
|
className?: string | undefined;
|
|
144
175
|
avatarUrl?: string | undefined;
|
|
145
|
-
title?: string | undefined;
|
|
146
176
|
}) => {
|
|
147
|
-
|
|
148
|
-
|
|
177
|
+
payload: {
|
|
178
|
+
type: "video";
|
|
179
|
+
url: string;
|
|
180
|
+
};
|
|
149
181
|
};
|
|
150
|
-
export declare const messageAdapter: (message: adapters.messaging.Message) => target.
|
|
182
|
+
export declare const messageAdapter: (message: adapters.messaging.Message) => target.AdapterOutput;
|
|
151
183
|
export {};
|
|
@@ -75,3 +75,8 @@ export type RowOf<T extends Message> = Omit<RowMessage, 'blocks'> & {
|
|
|
75
75
|
blocks: T[];
|
|
76
76
|
};
|
|
77
77
|
export type Messages = adapters.MessagesOf<Message>;
|
|
78
|
+
export type AdapterOutput = {
|
|
79
|
+
payload: Message;
|
|
80
|
+
disableInput?: boolean;
|
|
81
|
+
};
|
|
82
|
+
export type AdaptersOutput = Record<keyof Messages, AdapterOutput>;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import * as adapters from 'webchat-adapters';
|
|
2
2
|
import * as target from './target';
|
|
3
|
-
export type WebchatToTargetAdapters = adapters.Adapter<adapters.webchat.Messages, target.
|
|
3
|
+
export type WebchatToTargetAdapters = adapters.Adapter<adapters.webchat.Messages, target.AdaptersOutput>;
|
|
4
4
|
export declare const audioAdapter: (webchatMessage: {
|
|
5
5
|
type: "audio";
|
|
6
6
|
audioUrl: string;
|
|
7
7
|
className?: string | undefined;
|
|
8
8
|
}) => {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
payload: {
|
|
10
|
+
type: "audio";
|
|
11
|
+
url: string;
|
|
12
|
+
};
|
|
11
13
|
};
|
|
12
14
|
export declare const cardAdapter: (webchatMessage: {
|
|
13
15
|
title: string;
|
|
@@ -20,8 +22,10 @@ export declare const cardAdapter: (webchatMessage: {
|
|
|
20
22
|
className?: string | undefined;
|
|
21
23
|
subtitle?: string | undefined;
|
|
22
24
|
imageUrl?: string | undefined;
|
|
23
|
-
}) =>
|
|
24
|
-
|
|
25
|
+
}) => {
|
|
26
|
+
payload: Omit<target.BubbleMessage, "block"> & {
|
|
27
|
+
block: target.ColumnMessage;
|
|
28
|
+
};
|
|
25
29
|
};
|
|
26
30
|
export declare const carouselAdapter: (webchatMessage: {
|
|
27
31
|
type: "carousel";
|
|
@@ -38,8 +42,10 @@ export declare const carouselAdapter: (webchatMessage: {
|
|
|
38
42
|
}[];
|
|
39
43
|
className?: string | undefined;
|
|
40
44
|
}) => {
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
payload: {
|
|
46
|
+
type: "carousel";
|
|
47
|
+
blocks: target.ColumnMessage[];
|
|
48
|
+
};
|
|
43
49
|
};
|
|
44
50
|
export declare const choiceAdapter: (webchatMessage: {
|
|
45
51
|
options: {
|
|
@@ -48,9 +54,12 @@ export declare const choiceAdapter: (webchatMessage: {
|
|
|
48
54
|
}[];
|
|
49
55
|
type: "choice";
|
|
50
56
|
text: string;
|
|
51
|
-
disableFreeText?: boolean | undefined;
|
|
52
57
|
className?: string | undefined;
|
|
53
|
-
|
|
58
|
+
disableFreeText?: boolean | undefined;
|
|
59
|
+
}) => {
|
|
60
|
+
disableInput: boolean | undefined;
|
|
61
|
+
payload: target.Message;
|
|
62
|
+
};
|
|
54
63
|
export declare const dropdownAdapter: (webchatMessage: {
|
|
55
64
|
options: {
|
|
56
65
|
value: string;
|
|
@@ -59,8 +68,11 @@ export declare const dropdownAdapter: (webchatMessage: {
|
|
|
59
68
|
type: "dropdown";
|
|
60
69
|
text: string;
|
|
61
70
|
className?: string | undefined;
|
|
62
|
-
}) =>
|
|
63
|
-
|
|
71
|
+
}) => {
|
|
72
|
+
disableInput: true;
|
|
73
|
+
payload: Omit<target.BubbleMessage, "block"> & {
|
|
74
|
+
block: target.ColumnMessage;
|
|
75
|
+
};
|
|
64
76
|
};
|
|
65
77
|
export declare const fileAdapter: (webchatMessage: {
|
|
66
78
|
type: "file";
|
|
@@ -68,51 +80,61 @@ export declare const fileAdapter: (webchatMessage: {
|
|
|
68
80
|
title?: string | undefined;
|
|
69
81
|
className?: string | undefined;
|
|
70
82
|
}) => {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
83
|
+
payload: {
|
|
84
|
+
type: "file";
|
|
85
|
+
title?: string | undefined;
|
|
86
|
+
className?: string | undefined;
|
|
87
|
+
avatarUrl?: string | undefined;
|
|
88
|
+
url: string;
|
|
89
|
+
};
|
|
76
90
|
};
|
|
77
91
|
export declare const imageAdapter: (webchatMessage: {
|
|
78
92
|
type: "image";
|
|
79
93
|
imageUrl: string;
|
|
80
94
|
className?: string | undefined;
|
|
81
95
|
}) => {
|
|
82
|
-
|
|
83
|
-
|
|
96
|
+
payload: {
|
|
97
|
+
type: "image";
|
|
98
|
+
url: string;
|
|
99
|
+
};
|
|
84
100
|
};
|
|
85
101
|
export declare const locationAdapter: (webchatMessage: {
|
|
86
102
|
type: "location";
|
|
87
103
|
latitude: number;
|
|
88
104
|
longitude: number;
|
|
89
105
|
title?: string | undefined;
|
|
90
|
-
address?: string | undefined;
|
|
91
106
|
className?: string | undefined;
|
|
107
|
+
address?: string | undefined;
|
|
92
108
|
}) => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
109
|
+
payload: {
|
|
110
|
+
type: "location";
|
|
111
|
+
latitude: number;
|
|
112
|
+
longitude: number;
|
|
113
|
+
title: string;
|
|
114
|
+
};
|
|
97
115
|
};
|
|
98
116
|
export declare const markdownAdapter: (webchatMessage: {
|
|
99
117
|
type: "markdown";
|
|
100
118
|
markdown: string;
|
|
101
119
|
className?: string | undefined;
|
|
102
|
-
}) =>
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
120
|
+
}) => {
|
|
121
|
+
payload: Omit<target.BubbleMessage, "block"> & {
|
|
122
|
+
block: {
|
|
123
|
+
type: "text";
|
|
124
|
+
text: string;
|
|
125
|
+
};
|
|
106
126
|
};
|
|
107
127
|
};
|
|
108
128
|
export declare const textAdapter: (webchatMessage: {
|
|
109
129
|
type: "text";
|
|
110
130
|
text: string;
|
|
111
131
|
className?: string | undefined;
|
|
112
|
-
}) =>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
132
|
+
}) => {
|
|
133
|
+
payload: Omit<target.BubbleMessage, "block"> & {
|
|
134
|
+
block: {
|
|
135
|
+
type: "text";
|
|
136
|
+
text: string;
|
|
137
|
+
};
|
|
116
138
|
};
|
|
117
139
|
};
|
|
118
140
|
export declare const videoAdapter: (webchatMessage: {
|
|
@@ -120,7 +142,9 @@ export declare const videoAdapter: (webchatMessage: {
|
|
|
120
142
|
videoUrl: string;
|
|
121
143
|
className?: string | undefined;
|
|
122
144
|
}) => {
|
|
123
|
-
|
|
124
|
-
|
|
145
|
+
payload: {
|
|
146
|
+
type: "video";
|
|
147
|
+
url: string;
|
|
148
|
+
};
|
|
125
149
|
};
|
|
126
|
-
export declare const messageAdapter: (message: adapters.webchat.Message) => target.
|
|
150
|
+
export declare const messageAdapter: (message: adapters.webchat.Message) => target.AdapterOutput;
|
|
@@ -22,6 +22,7 @@ export declare class MessagingClient implements WebchatClient {
|
|
|
22
22
|
newConversation(): Promise<void>;
|
|
23
23
|
listMessages(limit?: number): Promise<{
|
|
24
24
|
payload: import("../../adapters/target").Message;
|
|
25
|
+
disableInput: boolean | undefined;
|
|
25
26
|
id: string;
|
|
26
27
|
conversationId: string;
|
|
27
28
|
authorId: string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Client as AutoGeneratedClient } from '../../../gen/client';
|
|
2
2
|
import { SignalListener } from './signal-listener';
|
|
3
3
|
export type { Message, Conversation, User } from '../../../gen/client';
|
|
4
4
|
export * from '../../../gen/client/errors';
|
|
@@ -37,5 +37,5 @@ export declare class Client implements IClient {
|
|
|
37
37
|
readonly deleteUser: IAutoClient['deleteUser'];
|
|
38
38
|
readonly createEvent: IAutoClient['createEvent'];
|
|
39
39
|
readonly getEvent: IAutoClient['getEvent'];
|
|
40
|
-
readonly listenConversation: ({ id,
|
|
40
|
+
readonly listenConversation: ({ id, "x-user-key": userKey, }: ListenConversationArgs) => Promise<SignalListener>;
|
|
41
41
|
}
|
package/dist/client/types.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
block:
|
|
5
|
-
}
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { BlockObjects, BlockType, CommonBlockProps } from '../types';
|
|
3
|
+
type BlockProps<T extends BlockType> = CommonBlockProps & {
|
|
4
|
+
block: BlockObjects[T];
|
|
5
|
+
};
|
|
6
|
+
export declare const Block: <T extends "text" | "image" | "button" | "audio" | "video" | "file" | "location" | "column" | "row" | "bubble" | "carousel" | "dropdown">({ block, styles, ...props }: BlockProps<T>) => JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import { CSSProperties, FC, ReactNode, RefObject } from 'react';
|
|
2
|
-
import { Theme, Configuration,
|
|
2
|
+
import { Theme, Configuration, BlockObjects, MessageObject, CommonBlockProps, BlockType } from '../types';
|
|
3
3
|
import { EventEmitter, Events } from '../utils';
|
|
4
4
|
import { WebchatClient } from '../client';
|
|
5
5
|
export type StyleOptions = {
|
|
6
6
|
className?: string;
|
|
7
7
|
style?: CSSProperties;
|
|
8
8
|
};
|
|
9
|
-
export type Renderers
|
|
10
|
-
[T in
|
|
11
|
-
type: T;
|
|
12
|
-
}> & {
|
|
13
|
-
styles: BlockStyles;
|
|
14
|
-
}>;
|
|
9
|
+
export type Renderers = {
|
|
10
|
+
[T in BlockType]: FC<CommonBlockProps & BlockObjects[T]>;
|
|
15
11
|
};
|
|
16
12
|
export type ModalProps = {
|
|
17
13
|
title: string | null;
|
|
@@ -1,13 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
2
|
+
import * as addParticipant from './operations/addParticipant';
|
|
3
|
+
import * as createConversation from './operations/createConversation';
|
|
4
|
+
import * as deleteConversation from './operations/deleteConversation';
|
|
5
|
+
import * as getConversation from './operations/getConversation';
|
|
6
|
+
import * as getParticipant from './operations/getParticipant';
|
|
7
|
+
import * as listConversationMessages from './operations/listConversationMessages';
|
|
8
|
+
import * as listConversations from './operations/listConversations';
|
|
9
|
+
import * as listParticipants from './operations/listParticipants';
|
|
10
|
+
import * as listenConversation from './operations/listenConversation';
|
|
11
|
+
import * as removeParticipant from './operations/removeParticipant';
|
|
12
|
+
import * as createMessage from './operations/createMessage';
|
|
13
|
+
import * as deleteMessage from './operations/deleteMessage';
|
|
14
|
+
import * as getMessage from './operations/getMessage';
|
|
15
|
+
import * as createUser from './operations/createUser';
|
|
16
|
+
import * as deleteUser from './operations/deleteUser';
|
|
17
|
+
import * as getUser from './operations/getUser';
|
|
18
|
+
import * as updateUser from './operations/updateUser';
|
|
19
|
+
import * as createEvent from './operations/createEvent';
|
|
20
|
+
import * as getEvent from './operations/getEvent';
|
|
21
|
+
export * from './models';
|
|
22
|
+
export * as addParticipant from './operations/addParticipant';
|
|
23
|
+
export * as createConversation from './operations/createConversation';
|
|
24
|
+
export * as deleteConversation from './operations/deleteConversation';
|
|
25
|
+
export * as getConversation from './operations/getConversation';
|
|
26
|
+
export * as getParticipant from './operations/getParticipant';
|
|
27
|
+
export * as listConversationMessages from './operations/listConversationMessages';
|
|
28
|
+
export * as listConversations from './operations/listConversations';
|
|
29
|
+
export * as listParticipants from './operations/listParticipants';
|
|
30
|
+
export * as listenConversation from './operations/listenConversation';
|
|
31
|
+
export * as removeParticipant from './operations/removeParticipant';
|
|
32
|
+
export * as createMessage from './operations/createMessage';
|
|
33
|
+
export * as deleteMessage from './operations/deleteMessage';
|
|
34
|
+
export * as getMessage from './operations/getMessage';
|
|
35
|
+
export * as createUser from './operations/createUser';
|
|
36
|
+
export * as deleteUser from './operations/deleteUser';
|
|
37
|
+
export * as getUser from './operations/getUser';
|
|
38
|
+
export * as updateUser from './operations/updateUser';
|
|
39
|
+
export * as createEvent from './operations/createEvent';
|
|
40
|
+
export * as getEvent from './operations/getEvent';
|
|
41
|
+
export declare class Client {
|
|
42
|
+
private axiosInstance;
|
|
43
|
+
constructor(axiosInstance: AxiosInstance);
|
|
44
|
+
readonly addParticipant: (input: addParticipant.AddParticipantInput) => Promise<addParticipant.AddParticipantResponse>;
|
|
45
|
+
readonly createConversation: (input: createConversation.CreateConversationInput) => Promise<createConversation.CreateConversationResponse>;
|
|
46
|
+
readonly deleteConversation: (input: deleteConversation.DeleteConversationInput) => Promise<deleteConversation.DeleteConversationResponse>;
|
|
47
|
+
readonly getConversation: (input: getConversation.GetConversationInput) => Promise<getConversation.GetConversationResponse>;
|
|
48
|
+
readonly getParticipant: (input: getParticipant.GetParticipantInput) => Promise<getParticipant.GetParticipantResponse>;
|
|
49
|
+
readonly listConversationMessages: (input: listConversationMessages.ListConversationMessagesInput) => Promise<listConversationMessages.ListConversationMessagesResponse>;
|
|
50
|
+
readonly listConversations: (input: listConversations.ListConversationsInput) => Promise<listConversations.ListConversationsResponse>;
|
|
51
|
+
readonly listParticipants: (input: listParticipants.ListParticipantsInput) => Promise<listParticipants.ListParticipantsResponse>;
|
|
52
|
+
readonly listenConversation: (input: listenConversation.ListenConversationInput) => Promise<listenConversation.ListenConversationResponse>;
|
|
53
|
+
readonly removeParticipant: (input: removeParticipant.RemoveParticipantInput) => Promise<removeParticipant.RemoveParticipantResponse>;
|
|
54
|
+
readonly createMessage: (input: createMessage.CreateMessageInput) => Promise<createMessage.CreateMessageResponse>;
|
|
55
|
+
readonly deleteMessage: (input: deleteMessage.DeleteMessageInput) => Promise<deleteMessage.DeleteMessageResponse>;
|
|
56
|
+
readonly getMessage: (input: getMessage.GetMessageInput) => Promise<getMessage.GetMessageResponse>;
|
|
57
|
+
readonly createUser: (input: createUser.CreateUserInput) => Promise<createUser.CreateUserResponse>;
|
|
58
|
+
readonly deleteUser: (input: deleteUser.DeleteUserInput) => Promise<deleteUser.DeleteUserResponse>;
|
|
59
|
+
readonly getUser: (input: getUser.GetUserInput) => Promise<getUser.GetUserResponse>;
|
|
60
|
+
readonly updateUser: (input: updateUser.UpdateUserInput) => Promise<updateUser.UpdateUserResponse>;
|
|
61
|
+
readonly createEvent: (input: createEvent.CreateEventInput) => Promise<createEvent.CreateEventResponse>;
|
|
62
|
+
readonly getEvent: (input: getEvent.GetEventInput) => Promise<getEvent.GetEventResponse>;
|
|
63
|
+
}
|
|
64
|
+
type Primitive = string | number | boolean;
|
|
65
|
+
type Value<P extends Primitive> = P | P[] | Record<string, P>;
|
|
66
|
+
type QueryValue = Value<string> | Value<boolean> | Value<number> | undefined;
|
|
67
|
+
type AnyQueryParams = Record<string, QueryValue>;
|
|
68
|
+
type HeaderValue = string | undefined;
|
|
69
|
+
type AnyHeaderParams = Record<string, HeaderValue>;
|
|
70
|
+
type AnyBodyParams = Record<string, any>;
|
|
71
|
+
type ParsedRequest = {
|
|
72
|
+
method: string;
|
|
73
|
+
path: string;
|
|
74
|
+
query: AnyQueryParams;
|
|
75
|
+
headers: AnyHeaderParams;
|
|
76
|
+
body: AnyBodyParams;
|
|
77
|
+
};
|
|
78
|
+
export declare const toAxiosRequest: (req: ParsedRequest) => AxiosRequestConfig;
|