@botpress/webchat 1.3.8 → 1.3.11

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @botpress/webchat@1.3.8 build /home/runner/work/echo/echo/packages/webchat-frontend
2
+ > @botpress/webchat@1.3.11 build /home/runner/work/echo/echo/packages/webchat-frontend
3
3
  > vite build
4
4
 
5
5
  vite v4.4.11 building for production...
@@ -11,15 +11,15 @@ transforming...
11
11
  [plugin:vite:resolve] Module "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.
12
12
  [plugin:vite:resolve] Module "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.
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
- ✓ 2426 modules transformed.
14
+ ✓ 2427 modules transformed.
15
15
  rendering chunks...
16
16
  
17
17
  [vite:dts] Start generate declaration files...
18
18
  computing gzip size...
19
- dist/index.js  1.09 kB gzip: 0.52 kB
20
- dist/index-de8cc2d3.js  118.52 kB │ gzip: 31.78 kB
21
- dist/index-8e9a70c6.js 1,297.30 kB │ gzip: 318.23 kB
22
- [vite:dts] Declaration files built in 14257ms.
19
+ [vite:dts] Declaration files built in 14769ms.
23
20
  
24
- dist/index.umd.cjs 987.65 kB │ gzip: 291.31 kB
25
- ✓ built in 23.50s
21
+ dist/index.js  1.09 kB │ gzip: 0.52 kB
22
+ dist/index-409d6709.js  118.52 kB gzip: 31.78 kB
23
+ dist/index-224357cc.js 1,298.16 kB │ gzip: 318.45 kB
24
+ dist/index.umd.cjs 988.34 kB │ gzip: 291.51 kB
25
+ ✓ built in 23.81s
@@ -1,6 +1,6 @@
1
1
  import { type MessagingSocketOptions, type UserCredentials } from '@botpress/messaging-socket';
2
2
  import { EventEmitter } from '../../utils';
3
- import { Events, UserData, WebchatClient } from '../types';
3
+ 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;
@@ -15,6 +15,8 @@ export declare class MessagingClient implements WebchatClient {
15
15
  readonly mode = "messaging";
16
16
  connect(creds?: UserCredentials, data?: UserData): Promise<UserCredentials | undefined>;
17
17
  disconnect(): Promise<void>;
18
+ getUser(): Promise<User>;
19
+ updateUser(): Promise<User>;
18
20
  sendMessage(message: string): Promise<void>;
19
21
  sendEvent(event: Record<string, any>): Promise<void>;
20
22
  switchConversation(id: string): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from '../../utils';
2
- import { Events, Message, UserCredentials, UserData, WebchatClient } from '../types';
2
+ import { Events, Message, UserCredentials, UserData, WebchatClient, type User } from '../types';
3
3
  export type PushpinClientProps = {
4
4
  apiUrl: string;
5
5
  clientId: string;
@@ -12,6 +12,12 @@ export declare class PushpinClient extends EventEmitter<Events> implements Webch
12
12
  readonly mode = "pushpin";
13
13
  get clientId(): string;
14
14
  get userId(): string | undefined;
15
+ getUser(): Promise<{
16
+ data: {
17
+ [k: string]: any;
18
+ } | undefined;
19
+ }>;
20
+ updateUser(user: User): Promise<User>;
15
21
  get conversationId(): string | undefined;
16
22
  connect(creds?: UserCredentials, data?: UserData): Promise<UserCredentials | undefined>;
17
23
  private _initialConnect;
@@ -4,7 +4,10 @@ export type UserCredentials = {
4
4
  userId: string;
5
5
  userToken: string;
6
6
  };
7
- export type UserData = Record<string, string>;
7
+ export type UserData = Record<string, unknown>;
8
+ export type User = {
9
+ data?: UserData;
10
+ };
8
11
  export type Message = {
9
12
  id: string;
10
13
  conversationId: string;
@@ -30,6 +33,8 @@ export type WebchatClient = {
30
33
  on: EventEmitter<Events>['on'];
31
34
  connect(creds?: UserCredentials, data?: UserData): Promise<UserCredentials | undefined>;
32
35
  disconnect(): Promise<void>;
36
+ getUser(): Promise<User>;
37
+ updateUser(user: User): Promise<User>;
33
38
  sendMessage(message: string): Promise<void>;
34
39
  sendEvent(event: Record<string, any>): Promise<void>;
35
40
  switchConversation(id: string): Promise<void>;
@@ -10,6 +10,12 @@ export interface User {
10
10
  * Picture url of the [User](#schema_user)
11
11
  */
12
12
  pictureUrl?: string;
13
+ /**
14
+ * User data
15
+ */
16
+ data?: {
17
+ [k: string]: any;
18
+ };
13
19
  /**
14
20
  * Id of the [User](#schema_user)
15
21
  */
@@ -35,6 +35,12 @@ export interface AddParticipantResponse {
35
35
  * Picture url of the [User](#schema_user)
36
36
  */
37
37
  pictureUrl?: string;
38
+ /**
39
+ * User data
40
+ */
41
+ data?: {
42
+ [k: string]: any;
43
+ };
38
44
  /**
39
45
  * Id of the [User](#schema_user)
40
46
  */
@@ -43,6 +43,12 @@ export interface CreateUserResponse {
43
43
  * Picture url of the [User](#schema_user)
44
44
  */
45
45
  pictureUrl?: string;
46
+ /**
47
+ * User data
48
+ */
49
+ data?: {
50
+ [k: string]: any;
51
+ };
46
52
  /**
47
53
  * Id of the [User](#schema_user)
48
54
  */
@@ -32,6 +32,12 @@ export interface GetParticipantResponse {
32
32
  * Picture url of the [User](#schema_user)
33
33
  */
34
34
  pictureUrl?: string;
35
+ /**
36
+ * User data
37
+ */
38
+ data?: {
39
+ [k: string]: any;
40
+ };
35
41
  /**
36
42
  * Id of the [User](#schema_user)
37
43
  */
@@ -30,6 +30,12 @@ export interface GetUserResponse {
30
30
  * Picture url of the [User](#schema_user)
31
31
  */
32
32
  pictureUrl?: string;
33
+ /**
34
+ * User data
35
+ */
36
+ data?: {
37
+ [k: string]: any;
38
+ };
33
39
  /**
34
40
  * Id of the [User](#schema_user)
35
41
  */
@@ -29,6 +29,12 @@ export interface ListParticipantsResponse {
29
29
  * Picture url of the [User](#schema_user)
30
30
  */
31
31
  pictureUrl?: string;
32
+ /**
33
+ * User data
34
+ */
35
+ data?: {
36
+ [k: string]: any;
37
+ };
32
38
  /**
33
39
  * Id of the [User](#schema_user)
34
40
  */
@@ -44,6 +44,12 @@ export interface UpdateUserResponse {
44
44
  * Picture url of the [User](#schema_user)
45
45
  */
46
46
  pictureUrl?: string;
47
+ /**
48
+ * User data
49
+ */
50
+ data?: {
51
+ [k: string]: any;
52
+ };
47
53
  /**
48
54
  * Id of the [User](#schema_user)
49
55
  */