@botpress/webchat 1.3.3 → 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 +15 -15
- package/dist/adapters/webchat-to-target.d.ts +3 -3
- package/dist/client/PushpinClient/inner-client/index.d.ts +2 -2
- package/dist/gen/client/index.d.ts +78 -13
- package/dist/gen/client/models.d.ts +210 -0
- 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/index.js +32872 -21167
- package/dist/index.umd.cjs +278 -95
- package/openapi.ts +5 -9
- package/package.json +3 -1
- package/dist/gen/client/api.d.ts +0 -2039
- 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
|
@@ -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
|
|
@@ -5,9 +5,9 @@ export type MessagingToTargetAdapters = adapters.Adapter<adapters.messaging.Mess
|
|
|
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
12
|
payload: {
|
|
13
13
|
type: "audio";
|
|
@@ -31,9 +31,9 @@ export declare const cardAdapter: (card: {
|
|
|
31
31
|
payload: string;
|
|
32
32
|
})[];
|
|
33
33
|
className?: string | undefined;
|
|
34
|
-
avatarUrl?: string | undefined;
|
|
35
|
-
subtitle?: string | undefined;
|
|
36
34
|
image?: string | undefined;
|
|
35
|
+
subtitle?: string | undefined;
|
|
36
|
+
avatarUrl?: string | undefined;
|
|
37
37
|
}) => {
|
|
38
38
|
payload: WithBubble<target.ColumnMessage>;
|
|
39
39
|
};
|
|
@@ -56,9 +56,9 @@ export declare const carouselAdapter: ({ items }: {
|
|
|
56
56
|
payload: string;
|
|
57
57
|
})[];
|
|
58
58
|
className?: string | undefined;
|
|
59
|
-
avatarUrl?: string | undefined;
|
|
60
|
-
subtitle?: string | undefined;
|
|
61
59
|
image?: string | undefined;
|
|
60
|
+
subtitle?: string | undefined;
|
|
61
|
+
avatarUrl?: string | undefined;
|
|
62
62
|
}[];
|
|
63
63
|
className?: string | undefined;
|
|
64
64
|
avatarUrl?: string | undefined;
|
|
@@ -76,8 +76,8 @@ export declare const choiceAdapter: (x: {
|
|
|
76
76
|
value: string;
|
|
77
77
|
}[];
|
|
78
78
|
className?: string | undefined;
|
|
79
|
-
avatarUrl?: string | undefined;
|
|
80
79
|
disableFreeText?: boolean | undefined;
|
|
80
|
+
avatarUrl?: string | undefined;
|
|
81
81
|
}) => {
|
|
82
82
|
disableInput: boolean | undefined;
|
|
83
83
|
payload: target.Message;
|
|
@@ -88,17 +88,17 @@ export declare const dropdownAdapter: (x: {
|
|
|
88
88
|
label: string;
|
|
89
89
|
}[];
|
|
90
90
|
type: "dropdown";
|
|
91
|
+
message?: string | undefined;
|
|
92
|
+
text?: string | undefined;
|
|
91
93
|
className?: string | undefined;
|
|
94
|
+
markdown?: boolean | undefined;
|
|
92
95
|
avatarUrl?: string | undefined;
|
|
93
|
-
message?: string | undefined;
|
|
94
96
|
allowCreation?: boolean | undefined;
|
|
95
97
|
placeholderText?: string | undefined;
|
|
96
98
|
allowMultiple?: boolean | undefined;
|
|
97
99
|
buttonText?: string | undefined;
|
|
98
100
|
width?: number | undefined;
|
|
99
101
|
displayInKeyboard?: boolean | undefined;
|
|
100
|
-
markdown?: boolean | undefined;
|
|
101
|
-
text?: string | undefined;
|
|
102
102
|
}) => {
|
|
103
103
|
disableInput: true;
|
|
104
104
|
payload: WithBubble<target.ColumnMessage>;
|
|
@@ -106,15 +106,15 @@ export declare const dropdownAdapter: (x: {
|
|
|
106
106
|
export declare const fileAdapter: ({ file, ...props }: {
|
|
107
107
|
type: "file";
|
|
108
108
|
file: string;
|
|
109
|
+
title?: string | undefined;
|
|
109
110
|
className?: string | undefined;
|
|
110
111
|
avatarUrl?: string | undefined;
|
|
111
|
-
title?: string | undefined;
|
|
112
112
|
}) => {
|
|
113
113
|
payload: {
|
|
114
114
|
type: "file";
|
|
115
|
+
title?: string | undefined;
|
|
115
116
|
className?: string | undefined;
|
|
116
117
|
avatarUrl?: string | undefined;
|
|
117
|
-
title?: string | undefined;
|
|
118
118
|
url: string;
|
|
119
119
|
};
|
|
120
120
|
};
|
|
@@ -133,10 +133,10 @@ export declare const locationAdapter: ({ type, latitude, longitude, title, addre
|
|
|
133
133
|
type: "location";
|
|
134
134
|
latitude: number;
|
|
135
135
|
longitude: number;
|
|
136
|
+
title?: string | undefined;
|
|
136
137
|
className?: string | undefined;
|
|
137
|
-
avatarUrl?: string | undefined;
|
|
138
138
|
address?: string | undefined;
|
|
139
|
-
|
|
139
|
+
avatarUrl?: string | undefined;
|
|
140
140
|
}) => {
|
|
141
141
|
payload: {
|
|
142
142
|
type: "location";
|
|
@@ -159,8 +159,8 @@ export declare const textAdapter: ({ type, text }: {
|
|
|
159
159
|
type: "text";
|
|
160
160
|
text: string;
|
|
161
161
|
className?: string | undefined;
|
|
162
|
-
avatarUrl?: string | undefined;
|
|
163
162
|
markdown?: boolean | undefined;
|
|
163
|
+
avatarUrl?: string | undefined;
|
|
164
164
|
}) => {
|
|
165
165
|
payload: WithBubble<{
|
|
166
166
|
type: "text";
|
|
@@ -170,9 +170,9 @@ export declare const textAdapter: ({ type, text }: {
|
|
|
170
170
|
export declare const videoAdapter: ({ type, video }: {
|
|
171
171
|
type: "video";
|
|
172
172
|
video: string;
|
|
173
|
+
title?: string | undefined;
|
|
173
174
|
className?: string | undefined;
|
|
174
175
|
avatarUrl?: string | undefined;
|
|
175
|
-
title?: string | undefined;
|
|
176
176
|
}) => {
|
|
177
177
|
payload: {
|
|
178
178
|
type: "video";
|
|
@@ -54,8 +54,8 @@ export declare const choiceAdapter: (webchatMessage: {
|
|
|
54
54
|
}[];
|
|
55
55
|
type: "choice";
|
|
56
56
|
text: string;
|
|
57
|
-
disableFreeText?: boolean | undefined;
|
|
58
57
|
className?: string | undefined;
|
|
58
|
+
disableFreeText?: boolean | undefined;
|
|
59
59
|
}) => {
|
|
60
60
|
disableInput: boolean | undefined;
|
|
61
61
|
payload: target.Message;
|
|
@@ -82,9 +82,9 @@ export declare const fileAdapter: (webchatMessage: {
|
|
|
82
82
|
}) => {
|
|
83
83
|
payload: {
|
|
84
84
|
type: "file";
|
|
85
|
+
title?: string | undefined;
|
|
85
86
|
className?: string | undefined;
|
|
86
87
|
avatarUrl?: string | undefined;
|
|
87
|
-
title?: string | undefined;
|
|
88
88
|
url: string;
|
|
89
89
|
};
|
|
90
90
|
};
|
|
@@ -103,8 +103,8 @@ export declare const locationAdapter: (webchatMessage: {
|
|
|
103
103
|
latitude: number;
|
|
104
104
|
longitude: number;
|
|
105
105
|
title?: string | undefined;
|
|
106
|
-
address?: string | undefined;
|
|
107
106
|
className?: string | undefined;
|
|
107
|
+
address?: string | undefined;
|
|
108
108
|
}) => {
|
|
109
109
|
payload: {
|
|
110
110
|
type: "location";
|
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The user object represents someone interacting with the bot within a specific integration. The same person interacting with a bot in slack and messenger will be represented with two different users.
|
|
3
|
+
*/
|
|
4
|
+
export interface User {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the [User](#schema_user)
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Picture url of the [User](#schema_user)
|
|
11
|
+
*/
|
|
12
|
+
pictureUrl?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Id of the [User](#schema_user)
|
|
15
|
+
*/
|
|
16
|
+
id: string;
|
|
17
|
+
/**
|
|
18
|
+
* Creation date of the [User](#schema_user) in ISO 8601 format
|
|
19
|
+
*/
|
|
20
|
+
createdAt: string;
|
|
21
|
+
/**
|
|
22
|
+
* Updating date of the [User](#schema_user) in ISO 8601 format
|
|
23
|
+
*/
|
|
24
|
+
updatedAt: string;
|
|
25
|
+
}
|
|
26
|
+
export interface Conversation {
|
|
27
|
+
/**
|
|
28
|
+
* Id of the [Conversation](#schema_conversation)
|
|
29
|
+
*/
|
|
30
|
+
id: string;
|
|
31
|
+
/**
|
|
32
|
+
* Creation date of the [Conversation](#schema_conversation) in ISO 8601 format
|
|
33
|
+
*/
|
|
34
|
+
createdAt: string;
|
|
35
|
+
/**
|
|
36
|
+
* Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
|
|
37
|
+
*/
|
|
38
|
+
updatedAt: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The Message object represents a message in a [Conversation](#schema_conversation) for a specific [User](#schema_user).
|
|
42
|
+
*/
|
|
43
|
+
export interface Message {
|
|
44
|
+
/**
|
|
45
|
+
* Id of the [Message](#schema_message)
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
/**
|
|
49
|
+
* Creation date of the [Message](#schema_message) in ISO 8601 format
|
|
50
|
+
*/
|
|
51
|
+
createdAt: string;
|
|
52
|
+
/**
|
|
53
|
+
* Payload is the content type of the message.
|
|
54
|
+
*/
|
|
55
|
+
payload: {
|
|
56
|
+
audioUrl: string;
|
|
57
|
+
/**
|
|
58
|
+
* CSS className to apply to the message
|
|
59
|
+
*/
|
|
60
|
+
className?: string;
|
|
61
|
+
type: "audio";
|
|
62
|
+
} | {
|
|
63
|
+
title: string;
|
|
64
|
+
subtitle?: string;
|
|
65
|
+
imageUrl?: string;
|
|
66
|
+
actions: {
|
|
67
|
+
action: "postback" | "url" | "say";
|
|
68
|
+
label: string;
|
|
69
|
+
value: string;
|
|
70
|
+
}[];
|
|
71
|
+
type: "card";
|
|
72
|
+
/**
|
|
73
|
+
* CSS className to apply to the message
|
|
74
|
+
*/
|
|
75
|
+
className?: string;
|
|
76
|
+
} | {
|
|
77
|
+
items: {
|
|
78
|
+
title: string;
|
|
79
|
+
subtitle?: string;
|
|
80
|
+
imageUrl?: string;
|
|
81
|
+
actions: {
|
|
82
|
+
action: "postback" | "url" | "say";
|
|
83
|
+
label: string;
|
|
84
|
+
value: string;
|
|
85
|
+
}[];
|
|
86
|
+
/**
|
|
87
|
+
* CSS className to apply to the message
|
|
88
|
+
*/
|
|
89
|
+
className?: string;
|
|
90
|
+
}[];
|
|
91
|
+
/**
|
|
92
|
+
* CSS className to apply to the message
|
|
93
|
+
*/
|
|
94
|
+
className?: string;
|
|
95
|
+
type: "carousel";
|
|
96
|
+
} | {
|
|
97
|
+
text: string;
|
|
98
|
+
options: {
|
|
99
|
+
label: string;
|
|
100
|
+
value: string;
|
|
101
|
+
}[];
|
|
102
|
+
/**
|
|
103
|
+
* CSS className to apply to the message
|
|
104
|
+
*/
|
|
105
|
+
className?: string;
|
|
106
|
+
type: "choice";
|
|
107
|
+
disableFreeText?: boolean;
|
|
108
|
+
} | {
|
|
109
|
+
text: string;
|
|
110
|
+
options: {
|
|
111
|
+
label: string;
|
|
112
|
+
value: string;
|
|
113
|
+
}[];
|
|
114
|
+
/**
|
|
115
|
+
* CSS className to apply to the message
|
|
116
|
+
*/
|
|
117
|
+
className?: string;
|
|
118
|
+
type: "dropdown";
|
|
119
|
+
} | {
|
|
120
|
+
fileUrl: string;
|
|
121
|
+
title?: string;
|
|
122
|
+
/**
|
|
123
|
+
* CSS className to apply to the message
|
|
124
|
+
*/
|
|
125
|
+
className?: string;
|
|
126
|
+
type: "file";
|
|
127
|
+
} | {
|
|
128
|
+
imageUrl: string;
|
|
129
|
+
/**
|
|
130
|
+
* CSS className to apply to the message
|
|
131
|
+
*/
|
|
132
|
+
className?: string;
|
|
133
|
+
type: "image";
|
|
134
|
+
} | {
|
|
135
|
+
latitude: number;
|
|
136
|
+
longitude: number;
|
|
137
|
+
address?: string;
|
|
138
|
+
title?: string;
|
|
139
|
+
/**
|
|
140
|
+
* CSS className to apply to the message
|
|
141
|
+
*/
|
|
142
|
+
className?: string;
|
|
143
|
+
type: "location";
|
|
144
|
+
} | {
|
|
145
|
+
markdown: string;
|
|
146
|
+
/**
|
|
147
|
+
* CSS className to apply to the message
|
|
148
|
+
*/
|
|
149
|
+
className?: string;
|
|
150
|
+
type: "markdown";
|
|
151
|
+
} | {
|
|
152
|
+
text: string;
|
|
153
|
+
/**
|
|
154
|
+
* CSS className to apply to the message
|
|
155
|
+
*/
|
|
156
|
+
className?: string;
|
|
157
|
+
type: "text";
|
|
158
|
+
} | {
|
|
159
|
+
videoUrl: string;
|
|
160
|
+
/**
|
|
161
|
+
* CSS className to apply to the message
|
|
162
|
+
*/
|
|
163
|
+
className?: string;
|
|
164
|
+
type: "video";
|
|
165
|
+
};
|
|
166
|
+
/**
|
|
167
|
+
* ID of the [User](#schema_user)
|
|
168
|
+
*/
|
|
169
|
+
userId: string;
|
|
170
|
+
/**
|
|
171
|
+
* ID of the [Conversation](#schema_conversation)
|
|
172
|
+
*/
|
|
173
|
+
conversationId: string;
|
|
174
|
+
}
|
|
175
|
+
export interface Event {
|
|
176
|
+
/**
|
|
177
|
+
* ID of the [Event](#schema_event).
|
|
178
|
+
*/
|
|
179
|
+
id: string;
|
|
180
|
+
/**
|
|
181
|
+
* Creation date of the [Event](#schema_event) in ISO 8601 format
|
|
182
|
+
*/
|
|
183
|
+
createdAt: string;
|
|
184
|
+
/**
|
|
185
|
+
* Payload is the content of the event.
|
|
186
|
+
*/
|
|
187
|
+
payload: {
|
|
188
|
+
type: "custom";
|
|
189
|
+
data: {
|
|
190
|
+
[k: string]: {
|
|
191
|
+
[k: string]: any;
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
} | {
|
|
195
|
+
type: "conversation_started";
|
|
196
|
+
data: {
|
|
197
|
+
[k: string]: {
|
|
198
|
+
[k: string]: any;
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
/**
|
|
203
|
+
* ID of the [Conversation](#schema_conversation).
|
|
204
|
+
*/
|
|
205
|
+
conversationId: string;
|
|
206
|
+
/**
|
|
207
|
+
* ID of the [User](#schema_user).
|
|
208
|
+
*/
|
|
209
|
+
userId: string;
|
|
210
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface AddParticipantRequestHeaders {
|
|
2
|
+
"x-user-key": string;
|
|
3
|
+
}
|
|
4
|
+
export interface AddParticipantRequestQuery {
|
|
5
|
+
}
|
|
6
|
+
export interface AddParticipantRequestParams {
|
|
7
|
+
id: string;
|
|
8
|
+
}
|
|
9
|
+
export interface AddParticipantRequestBody {
|
|
10
|
+
/**
|
|
11
|
+
* User id
|
|
12
|
+
*/
|
|
13
|
+
userId: string;
|
|
14
|
+
}
|
|
15
|
+
export type AddParticipantInput = AddParticipantRequestBody & AddParticipantRequestHeaders & AddParticipantRequestQuery & AddParticipantRequestParams;
|
|
16
|
+
export type AddParticipantRequest = {
|
|
17
|
+
headers: AddParticipantRequestHeaders;
|
|
18
|
+
query: AddParticipantRequestQuery;
|
|
19
|
+
params: AddParticipantRequestParams;
|
|
20
|
+
body: AddParticipantRequestBody;
|
|
21
|
+
};
|
|
22
|
+
export declare const parseReq: (input: AddParticipantInput) => AddParticipantRequest & {
|
|
23
|
+
path: string;
|
|
24
|
+
};
|
|
25
|
+
export interface AddParticipantResponse {
|
|
26
|
+
/**
|
|
27
|
+
* The user object represents someone interacting with the bot within a specific integration. The same person interacting with a bot in slack and messenger will be represented with two different users.
|
|
28
|
+
*/
|
|
29
|
+
participant: {
|
|
30
|
+
/**
|
|
31
|
+
* Name of the [User](#schema_user)
|
|
32
|
+
*/
|
|
33
|
+
name?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Picture url of the [User](#schema_user)
|
|
36
|
+
*/
|
|
37
|
+
pictureUrl?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Id of the [User](#schema_user)
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
/**
|
|
43
|
+
* Creation date of the [User](#schema_user) in ISO 8601 format
|
|
44
|
+
*/
|
|
45
|
+
createdAt: string;
|
|
46
|
+
/**
|
|
47
|
+
* Updating date of the [User](#schema_user) in ISO 8601 format
|
|
48
|
+
*/
|
|
49
|
+
updatedAt: string;
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface CreateConversationRequestHeaders {
|
|
2
|
+
"x-user-key": string;
|
|
3
|
+
}
|
|
4
|
+
export interface CreateConversationRequestQuery {
|
|
5
|
+
}
|
|
6
|
+
export interface CreateConversationRequestParams {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Conversation properties
|
|
10
|
+
*/
|
|
11
|
+
export interface CreateConversationRequestBody {
|
|
12
|
+
_?: string;
|
|
13
|
+
}
|
|
14
|
+
export type CreateConversationInput = CreateConversationRequestBody & CreateConversationRequestHeaders & CreateConversationRequestQuery & CreateConversationRequestParams;
|
|
15
|
+
export type CreateConversationRequest = {
|
|
16
|
+
headers: CreateConversationRequestHeaders;
|
|
17
|
+
query: CreateConversationRequestQuery;
|
|
18
|
+
params: CreateConversationRequestParams;
|
|
19
|
+
body: CreateConversationRequestBody;
|
|
20
|
+
};
|
|
21
|
+
export declare const parseReq: (input: CreateConversationInput) => CreateConversationRequest & {
|
|
22
|
+
path: string;
|
|
23
|
+
};
|
|
24
|
+
export interface CreateConversationResponse {
|
|
25
|
+
conversation: {
|
|
26
|
+
/**
|
|
27
|
+
* Id of the [Conversation](#schema_conversation)
|
|
28
|
+
*/
|
|
29
|
+
id: string;
|
|
30
|
+
/**
|
|
31
|
+
* Creation date of the [Conversation](#schema_conversation) in ISO 8601 format
|
|
32
|
+
*/
|
|
33
|
+
createdAt: string;
|
|
34
|
+
/**
|
|
35
|
+
* Updating date of the [Conversation](#schema_conversation) in ISO 8601 format
|
|
36
|
+
*/
|
|
37
|
+
updatedAt: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export interface CreateEventRequestHeaders {
|
|
2
|
+
"x-user-key": string;
|
|
3
|
+
}
|
|
4
|
+
export interface CreateEventRequestQuery {
|
|
5
|
+
}
|
|
6
|
+
export interface CreateEventRequestParams {
|
|
7
|
+
}
|
|
8
|
+
export interface CreateEventRequestBody {
|
|
9
|
+
/**
|
|
10
|
+
* Payload is the content type of the event.
|
|
11
|
+
*/
|
|
12
|
+
payload: {
|
|
13
|
+
type: "custom";
|
|
14
|
+
data: {
|
|
15
|
+
[k: string]: {
|
|
16
|
+
[k: string]: any;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
} | {
|
|
20
|
+
type: "conversation_started";
|
|
21
|
+
data: {
|
|
22
|
+
[k: string]: {
|
|
23
|
+
[k: string]: any;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* ID of the [Conversation](#schema_conversation)
|
|
29
|
+
*/
|
|
30
|
+
conversationId: string;
|
|
31
|
+
}
|
|
32
|
+
export type CreateEventInput = CreateEventRequestBody & CreateEventRequestHeaders & CreateEventRequestQuery & CreateEventRequestParams;
|
|
33
|
+
export type CreateEventRequest = {
|
|
34
|
+
headers: CreateEventRequestHeaders;
|
|
35
|
+
query: CreateEventRequestQuery;
|
|
36
|
+
params: CreateEventRequestParams;
|
|
37
|
+
body: CreateEventRequestBody;
|
|
38
|
+
};
|
|
39
|
+
export declare const parseReq: (input: CreateEventInput) => CreateEventRequest & {
|
|
40
|
+
path: string;
|
|
41
|
+
};
|
|
42
|
+
export interface CreateEventResponse {
|
|
43
|
+
event: {
|
|
44
|
+
/**
|
|
45
|
+
* ID of the [Event](#schema_event).
|
|
46
|
+
*/
|
|
47
|
+
id: string;
|
|
48
|
+
/**
|
|
49
|
+
* Creation date of the [Event](#schema_event) in ISO 8601 format
|
|
50
|
+
*/
|
|
51
|
+
createdAt: string;
|
|
52
|
+
/**
|
|
53
|
+
* Payload is the content of the event.
|
|
54
|
+
*/
|
|
55
|
+
payload: {
|
|
56
|
+
type: "custom";
|
|
57
|
+
data: {
|
|
58
|
+
[k: string]: {
|
|
59
|
+
[k: string]: any;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
} | {
|
|
63
|
+
type: "conversation_started";
|
|
64
|
+
data: {
|
|
65
|
+
[k: string]: {
|
|
66
|
+
[k: string]: any;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* ID of the [Conversation](#schema_conversation).
|
|
72
|
+
*/
|
|
73
|
+
conversationId: string;
|
|
74
|
+
/**
|
|
75
|
+
* ID of the [User](#schema_user).
|
|
76
|
+
*/
|
|
77
|
+
userId: string;
|
|
78
|
+
};
|
|
79
|
+
}
|