@botpress/webchat 1.3.11 → 1.3.13
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 +7 -7
- package/dist/client/MessagingClient/client.d.ts +2 -1
- package/dist/client/PushpinClient/index.d.ts +2 -0
- package/dist/client/types.d.ts +14 -2
- package/dist/gen/client/index.d.ts +7 -17
- package/dist/gen/client/operations/updateUser.d.ts +1 -1
- package/dist/gen/client/to-axios.d.ts +16 -0
- package/dist/hooks/useClient.d.ts +1 -2
- package/dist/{index-224357cc.js → index-45673b38.js} +3540 -3545
- package/dist/{index-409d6709.js → index-c46225a0.js} +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +96 -96
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @botpress/webchat@1.3.
|
|
2
|
+
> @botpress/webchat@1.3.13 build /home/runner/work/echo/echo/packages/webchat-frontend
|
|
3
3
|
> vite build
|
|
4
4
|
|
|
5
5
|
[36mvite v4.4.11 [32mbuilding for production...[36m[39m
|
|
@@ -11,15 +11,15 @@ transforming...
|
|
|
11
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
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
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
|
|
14
|
+
[32m✓[39m 2428 modules transformed.
|
|
15
15
|
rendering chunks...
|
|
16
16
|
[32m
|
|
17
17
|
[36m[vite:dts][32m Start generate declaration files...[39m
|
|
18
18
|
computing gzip size...
|
|
19
|
-
[32m[36m[vite:dts][32m Declaration files built in
|
|
19
|
+
[32m[36m[vite:dts][32m Declaration files built in 14828ms.
|
|
20
20
|
[39m
|
|
21
21
|
[2mdist/[22m[36mindex.js [39m[1m[2m 1.09 kB[22m[1m[22m[2m │ gzip: 0.52 kB[22m
|
|
22
|
-
[2mdist/[22m[36mindex-
|
|
23
|
-
[2mdist/[22m[36mindex-
|
|
24
|
-
[2mdist/[22m[36mindex.umd.cjs [39m[1m[
|
|
25
|
-
[32m✓ built in
|
|
22
|
+
[2mdist/[22m[36mindex-c46225a0.js [39m[1m[2m 118.52 kB[22m[1m[22m[2m │ gzip: 31.78 kB[22m
|
|
23
|
+
[2mdist/[22m[36mindex-45673b38.js [39m[1m[33m1,298.86 kB[39m[22m[2m │ gzip: 318.49 kB[22m
|
|
24
|
+
[2mdist/[22m[36mindex.umd.cjs [39m[1m[33m989.00 kB[39m[22m[2m │ gzip: 291.51 kB[22m
|
|
25
|
+
[32m✓ built in 24.20s[39m
|
|
@@ -4,7 +4,8 @@ import { Events, UserData, WebchatClient, type User } from '../types';
|
|
|
4
4
|
export type MessagingClientProps = MessagingSocketOptions;
|
|
5
5
|
export declare class MessagingClient implements WebchatClient {
|
|
6
6
|
private socket;
|
|
7
|
-
clientId: string
|
|
7
|
+
clientId: string;
|
|
8
|
+
apiUrl: string;
|
|
8
9
|
userId: string | undefined;
|
|
9
10
|
conversationId: string | undefined;
|
|
10
11
|
private userToken;
|
|
@@ -7,9 +7,11 @@ export type PushpinClientProps = {
|
|
|
7
7
|
export declare class PushpinClient extends EventEmitter<Events> implements WebchatClient {
|
|
8
8
|
private _client;
|
|
9
9
|
private _webhookId;
|
|
10
|
+
private _apiUrl;
|
|
10
11
|
private _state;
|
|
11
12
|
constructor(props: PushpinClientProps);
|
|
12
13
|
readonly mode = "pushpin";
|
|
14
|
+
get apiUrl(): string;
|
|
13
15
|
get clientId(): string;
|
|
14
16
|
get userId(): string | undefined;
|
|
15
17
|
getUser(): Promise<{
|
package/dist/client/types.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type Message = {
|
|
|
16
16
|
disableInput?: boolean;
|
|
17
17
|
payload: BlockObject;
|
|
18
18
|
};
|
|
19
|
-
export type
|
|
19
|
+
export type WebchatEvents = {
|
|
20
20
|
conversation: string | undefined;
|
|
21
21
|
message: Message;
|
|
22
22
|
messageSent: string;
|
|
@@ -25,9 +25,20 @@ export type Events = {
|
|
|
25
25
|
webchatConfig: Record<string, any>;
|
|
26
26
|
customEvent: Record<string, any>;
|
|
27
27
|
};
|
|
28
|
+
type ValueOf<T> = T[keyof T];
|
|
29
|
+
type AnyEvent = ValueOf<{
|
|
30
|
+
[K in keyof WebchatEvents]: {
|
|
31
|
+
type: K;
|
|
32
|
+
payload: WebchatEvents[K];
|
|
33
|
+
};
|
|
34
|
+
}>;
|
|
35
|
+
export type Events = WebchatEvents & {
|
|
36
|
+
'*': AnyEvent;
|
|
37
|
+
};
|
|
28
38
|
export type WebchatClient = {
|
|
29
39
|
mode: 'messaging' | 'pushpin';
|
|
30
|
-
clientId: string
|
|
40
|
+
clientId: string;
|
|
41
|
+
apiUrl: string;
|
|
31
42
|
userId: string | undefined;
|
|
32
43
|
conversationId: string | undefined;
|
|
33
44
|
on: EventEmitter<Events>['on'];
|
|
@@ -42,3 +53,4 @@ export type WebchatClient = {
|
|
|
42
53
|
newConversation(): Promise<void>;
|
|
43
54
|
listMessages(): Promise<Message[]>;
|
|
44
55
|
};
|
|
56
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { AxiosInstance
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { toAxiosRequest } from './to-axios';
|
|
2
3
|
import * as addParticipant from './operations/addParticipant';
|
|
3
4
|
import * as createConversation from './operations/createConversation';
|
|
4
5
|
import * as deleteConversation from './operations/deleteConversation';
|
|
@@ -38,9 +39,13 @@ export * as getUser from './operations/getUser';
|
|
|
38
39
|
export * as updateUser from './operations/updateUser';
|
|
39
40
|
export * as createEvent from './operations/createEvent';
|
|
40
41
|
export * as getEvent from './operations/getEvent';
|
|
42
|
+
export type ClientProps = {
|
|
43
|
+
toAxiosRequest: typeof toAxiosRequest;
|
|
44
|
+
};
|
|
41
45
|
export declare class Client {
|
|
42
46
|
private axiosInstance;
|
|
43
|
-
|
|
47
|
+
private props;
|
|
48
|
+
constructor(axiosInstance: AxiosInstance, props?: Partial<ClientProps>);
|
|
44
49
|
readonly addParticipant: (input: addParticipant.AddParticipantInput) => Promise<addParticipant.AddParticipantResponse>;
|
|
45
50
|
readonly createConversation: (input: createConversation.CreateConversationInput) => Promise<createConversation.CreateConversationResponse>;
|
|
46
51
|
readonly deleteConversation: (input: deleteConversation.DeleteConversationInput) => Promise<deleteConversation.DeleteConversationResponse>;
|
|
@@ -61,18 +66,3 @@ export declare class Client {
|
|
|
61
66
|
readonly createEvent: (input: createEvent.CreateEventInput) => Promise<createEvent.CreateEventResponse>;
|
|
62
67
|
readonly getEvent: (input: getEvent.GetEventInput) => Promise<getEvent.GetEventResponse>;
|
|
63
68
|
}
|
|
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;
|
|
@@ -19,7 +19,7 @@ export interface UpdateUserRequestBody {
|
|
|
19
19
|
*/
|
|
20
20
|
userData?: {
|
|
21
21
|
[k: string]: any;
|
|
22
|
-
};
|
|
22
|
+
} | null;
|
|
23
23
|
}
|
|
24
24
|
export type UpdateUserInput = UpdateUserRequestBody & UpdateUserRequestHeaders & UpdateUserRequestQuery & UpdateUserRequestParams;
|
|
25
25
|
export type UpdateUserRequest = {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from "axios";
|
|
2
|
+
export type Primitive = string | number | boolean;
|
|
3
|
+
export type Value<P extends Primitive> = P | P[] | Record<string, P>;
|
|
4
|
+
export type QueryValue = Value<string> | Value<boolean> | Value<number> | undefined;
|
|
5
|
+
export type AnyQueryParams = Record<string, QueryValue>;
|
|
6
|
+
export type HeaderValue = string | undefined;
|
|
7
|
+
export type AnyHeaderParams = Record<string, HeaderValue>;
|
|
8
|
+
export type AnyBodyParams = Record<string, any>;
|
|
9
|
+
export type ParsedRequest = {
|
|
10
|
+
method: string;
|
|
11
|
+
path: string;
|
|
12
|
+
query: AnyQueryParams;
|
|
13
|
+
headers: AnyHeaderParams;
|
|
14
|
+
body: AnyBodyParams;
|
|
15
|
+
};
|
|
16
|
+
export declare const toAxiosRequest: (req: ParsedRequest) => AxiosRequestConfig;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { WebchatClient } from '../client';
|
|
2
1
|
type UseClientOptions = {
|
|
3
2
|
mode?: 'messaging' | 'pushpin';
|
|
4
3
|
clientId: string;
|
|
5
4
|
apiUrl?: string;
|
|
6
5
|
};
|
|
7
|
-
export declare const useClient: ({ clientId, apiUrl, mode, }: UseClientOptions) => WebchatClient
|
|
6
|
+
export declare const useClient: ({ clientId, apiUrl, mode, }: UseClientOptions) => import("..").WebchatClient;
|
|
8
7
|
export {};
|