@botpress/webchat 2.2.4 → 2.2.5

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@2.2.4 build /home/runner/work/echo/echo/packages/webchat-frontend
2
+ > @botpress/webchat@2.2.5 build /home/runner/work/echo/echo/packages/webchat-frontend
3
3
  > vite build
4
4
 
5
5
  vite v4.4.11 building for production...
@@ -17,10 +17,10 @@ rendering chunks...
17
17
  
18
18
  [vite:dts] Start generate declaration files...
19
19
  computing gzip size...
20
- dist/style.css  26.99 kB gzip: 5.35 kB
21
- dist/index.js 1,407.93 kB │ gzip: 354.54 kB
22
- [vite:dts] Declaration files built in 16195ms.
20
+ [vite:dts] Declaration files built in 14641ms.
23
21
  
24
- dist/style.css  26.99 kB │ gzip: 5.35 kB
25
- dist/index.umd.cjs 983.78 kB │ gzip: 297.74 kB
26
- ✓ built in 27.04s
22
+ dist/style.css  28.09 kB │ gzip: 5.42 kB
23
+ dist/index.js 1,409.51 kB │ gzip: 354.94 kB
24
+ dist/style.css  28.09 kB │ gzip: 5.42 kB
25
+ dist/index.umd.cjs 984.82 kB │ gzip: 298.04 kB
26
+ ✓ built in 24.35s
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from '../../utils';
2
- import { Events, Message, UserCredentials, UserData, WebchatClient, type User } from '../types';
2
+ import { Events, Message, UserCredentials, UserData, UserOptions, WebchatClient, type User } from '../types';
3
3
  import { type FileType } from '../../types';
4
4
  export type PushpinClientProps = {
5
5
  apiUrl: string;
@@ -22,7 +22,7 @@ export declare class PushpinClient extends EventEmitter<Events> implements Webch
22
22
  }>;
23
23
  updateUser(user: User): Promise<User>;
24
24
  get conversationId(): string | undefined;
25
- connect(creds?: UserCredentials, data?: UserData): Promise<UserCredentials | undefined>;
25
+ connect(creds?: UserCredentials, data?: UserData, opts?: UserOptions): Promise<UserCredentials | undefined>;
26
26
  private _initialConnect;
27
27
  private _reConnect;
28
28
  disconnect(): Promise<void>;
@@ -1,13 +1,14 @@
1
1
  import { EventEmitter } from '../utils';
2
2
  import { BlockObject, type FileType } from '../types/block-type';
3
+ import { UserProps } from '../types';
4
+ type SafeOmit<T, K extends keyof T> = Omit<T, K>;
3
5
  export type UserCredentials = {
4
6
  userId: string;
5
7
  userToken: string;
6
8
  };
7
- export type UserData = Record<string, unknown>;
8
- export type User = {
9
- data?: UserData;
10
- };
9
+ export type User = UserProps;
10
+ export type UserData = User['data'];
11
+ export type UserOptions = SafeOmit<User, 'data'>;
11
12
  export type Message = {
12
13
  id: string;
13
14
  conversationId: string;
@@ -46,7 +47,7 @@ export type WebchatClient = {
46
47
  userId: string | undefined;
47
48
  conversationId: string | undefined;
48
49
  on: EventEmitter<Events>['on'];
49
- connect(creds?: UserCredentials, data?: UserData): Promise<UserCredentials | undefined>;
50
+ connect(creds?: UserCredentials, data?: UserData, opts?: UserOptions): Promise<UserCredentials | undefined>;
50
51
  disconnect(): Promise<void>;
51
52
  getUser(): Promise<User>;
52
53
  updateUser(user: User): Promise<User>;