@wppconnect/wa-js 2.7.3 → 2.8.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## 2.8.2 (2022-07-12)
2
+
3
+ ### Bug Fixes
4
+
5
+ - Fixed eventEmitter export ([2532a20](https://github.com/wppconnect-team/wa-js/commit/2532a200933d13f61e37fa3557bbb790798330bc))
6
+
7
+ ## 2.8.1 (2022-07-11)
8
+
9
+ ### Bug Fixes
10
+
11
+ - Fixed WPP.chat.markIsUnread function (wppconnect-team/wppconnect[#1196](https://github.com/wppconnect-team/wa-js/issues/1196)) ([db7195e](https://github.com/wppconnect-team/wa-js/commit/db7195ee15a4e12c7a6b6a06bcb6bb711f59659b))
12
+
13
+ # 2.8.0 (2022-06-28)
14
+
15
+ ### Features
16
+
17
+ - Added googleAnalyticsUserProperty options ([f425767](https://github.com/wppconnect-team/wa-js/commit/f425767f0b30d95b24a15fca8ab7c269d4e3240d))
18
+
1
19
  ## 2.7.3 (2022-06-18)
2
20
 
3
21
  ## 2.7.2 (2022-06-17)
package/dist/config.d.ts CHANGED
@@ -45,10 +45,20 @@ export interface Config {
45
45
  * Google Analytics Id
46
46
  */
47
47
  googleAnalyticsId: string | null;
48
+ /**
49
+ * Google Analytics Id
50
+ */
51
+ googleAnalyticsUserProperty: {
52
+ [key: string]: string | number | boolean;
53
+ };
48
54
  /**
49
55
  * Link Preview API servers
50
56
  */
51
57
  linkPreviewApiServers: string[] | null;
58
+ /**
59
+ * Project name for google analytics
60
+ */
61
+ poweredBy: string | null;
52
62
  }
53
63
  export declare const defaultConfig: Config;
54
64
  export declare const config: Config;
@@ -13,7 +13,10 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { CancelablePromise, ConstructorOptions, event, EventAndListener, EventEmitter2, eventNS, GeneralEventEmitter, Listener, ListenerFn, ListenToOptions, OnceOptions, WaitForFilter, WaitForOptions } from 'eventemitter2';
16
+ import { CancelablePromise, ConstructorOptions, event, EventAndListener, EventEmitter2, eventNS, GeneralEventEmitter, Listener, ListenerFn, ListenToOptions, OnceOptions, WaitForOptions } from 'eventemitter2';
17
+ export interface WaitForFilter {
18
+ (...values: any[]): boolean;
19
+ }
17
20
  export interface OnOptions {
18
21
  /**
19
22
  * invoke the listener in async mode using setImmediate (fallback to setTimeout if not available) or process.nextTick depending on the nextTick option.
@@ -184,7 +184,7 @@ export declare const waitFor: {
184
184
  alfa: string;
185
185
  beta: (from: number, to: string) => void;
186
186
  })[Name]>>;
187
- <Name_1 extends "blocklist.sync" | "call.incoming_call" | keyof import("./eventTypes").ChatEventTypes | keyof import("./eventTypes").ConnEventTypes | "status.sync" | keyof import("./eventTypes").WebpackEvents | "alfa" | "beta">(event: Name_1, filter?: import("eventemitter2").WaitForFilter | undefined): import("eventemitter2").CancelablePromise<import("./eventEmitter").ListenerType<(import("./eventTypes").BlocklistEventTypes & import("./eventTypes").CallEventTypes & import("./eventTypes").ChatEventTypes & import("./eventTypes").ConnEventTypes & import("./eventTypes").StatusEventTypes & import("./eventTypes").WebpackEvents & {
187
+ <Name_1 extends "blocklist.sync" | "call.incoming_call" | keyof import("./eventTypes").ChatEventTypes | keyof import("./eventTypes").ConnEventTypes | "status.sync" | keyof import("./eventTypes").WebpackEvents | "alfa" | "beta">(event: Name_1, filter?: import("./eventEmitter").WaitForFilter | undefined): import("eventemitter2").CancelablePromise<import("./eventEmitter").ListenerType<(import("./eventTypes").BlocklistEventTypes & import("./eventTypes").CallEventTypes & import("./eventTypes").ChatEventTypes & import("./eventTypes").ConnEventTypes & import("./eventTypes").StatusEventTypes & import("./eventTypes").WebpackEvents & {
188
188
  alfa: string;
189
189
  beta: (from: number, to: string) => void;
190
190
  })[Name_1]>>;
@@ -35,5 +35,6 @@ export { promoteParticipants } from './promoteParticipants';
35
35
  export { removeParticipants } from './removeParticipants';
36
36
  export { revokeInviteCode } from './revokeInviteCode';
37
37
  export { setDescription } from './setDescription';
38
+ export { setIcon } from './setIcon';
38
39
  export { GroupProperty, setProperty } from './setProperty';
39
40
  export { setSubject } from './setSubject';
@@ -0,0 +1,31 @@
1
+ /*!
2
+ * Copyright 2021 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../../whatsapp';
17
+ /**
18
+ * Set the group icon (group profile picture)
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * await WPP.group.setIcon('[group@g.us]', 'data:image/jpeg;base64,.....');
23
+ * ```
24
+ */
25
+ export declare function setIcon(groupId: string | Wid, content: string): Promise<{
26
+ eurl: string;
27
+ status: number;
28
+ tag: string;
29
+ token: string;
30
+ _duplicate: boolean;
31
+ }>;
@@ -14,4 +14,5 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export { getMyStatus } from './getMyStatus';
17
+ export { setMyProfilePicture } from './setMyProfilePicture';
17
18
  export { setMyStatus } from './setMyStatus';
@@ -0,0 +1,32 @@
1
+ /*!
2
+ * Copyright 2021 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * Update your profile picture
18
+ *
19
+ * @example
20
+ * ```javascript
21
+ * await WPP.profile.setMyProfilePicture('data:image/jpeg;base64,.....');
22
+ * ```
23
+ *
24
+ * @category Chat
25
+ */
26
+ export declare function setMyProfilePicture(content: string): Promise<{
27
+ eurl: string;
28
+ status: number;
29
+ tag: string;
30
+ token: string;
31
+ _duplicate: boolean;
32
+ }>;
@@ -15,5 +15,7 @@
15
15
  */
16
16
  export { get } from './get';
17
17
  export { getMyStatus } from './getMyStatus';
18
+ export { ImageStatusOptions, sendImageStatus } from './sendImageStatus';
18
19
  export { sendRawStatus, SendStatusOptions } from './sendRawStatus';
19
20
  export { sendTextStatus, TextStatusOptions } from './sendTextStatus';
21
+ export { sendVideoStatus, VideoStatusOptions } from './sendVideoStatus';
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * Copyright 2021 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { SendStatusOptions } from './sendRawStatus';
17
+ export declare type ImageStatusOptions = SendStatusOptions;
18
+ /**
19
+ * Send a image message to status stories
20
+ *
21
+ * @example
22
+ * ```javascript
23
+ * WPP.status.sendImageStatus('data:image/jpeg;base64,<a long base64 file...>');
24
+ * ```
25
+ */
26
+ export declare function sendImageStatus(content: any, options?: ImageStatusOptions): Promise<any>;
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * Copyright 2021 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { SendStatusOptions } from './sendRawStatus';
17
+ export declare type VideoStatusOptions = SendStatusOptions;
18
+ /**
19
+ * Send a video message to status stories
20
+ *
21
+ * @example
22
+ * ```javascript
23
+ * WPP.status.sendVideoStatus('data:video/mp4;base64,<a long base64 file...>');
24
+ * ```
25
+ */
26
+ export declare function sendVideoStatus(content: any, options?: VideoStatusOptions): Promise<any>;
@@ -21,5 +21,6 @@ export * from './errors';
21
21
  export * from './fetchDataFromPNG';
22
22
  export * from './getVideoInfoFromBuffer';
23
23
  export * from './isBase64';
24
+ export * from './resizeImage';
24
25
  export * from './types';
25
26
  export * from './wrapFunction';
@@ -13,8 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Wid } from '../../whatsapp';
17
- export declare function queryExists(contactId: string | Wid): Promise<{
18
- wid: Wid;
19
- biz: boolean;
20
- } | null | undefined>;
16
+ import Compressor from 'compressorjs';
17
+ export declare function resizeImage(blob: Blob, options?: Compressor.Options): Promise<Blob | File>;
@@ -17,6 +17,7 @@ import { Wid } from '../misc';
17
17
  /**
18
18
  * @whatsapp 16104
19
19
  * @whatsapp 416104 >= 2.2222.8
20
+ * @whatsapp 963388 >= 2.2224.7
20
21
  */
21
22
  export declare function getFanOutList(param: {
22
23
  wids: Wid[];
@@ -23,3 +23,8 @@ export declare function getGroupSenderKeyList(wid: Wid): Promise<{
23
23
  skDistribList: Wid[];
24
24
  rotateKey: boolean;
25
25
  }>;
26
+ /**
27
+ * @whatsapp 43201
28
+ * @whatsapp 543201 >= 2.2222.8
29
+ */
30
+ export declare function markForgetSenderKey(wid: Wid, participants: Wid[]): Promise<any>;
@@ -54,5 +54,6 @@ export * from './setGroup';
54
54
  export * from './setPin';
55
55
  export * from './status';
56
56
  export * from './typeAttributeFromProtobuf';
57
+ export * from './updateParticipants';
57
58
  export * from './uploadProductImage';
58
59
  export * from './uploadThumbnail';
@@ -19,4 +19,10 @@ import { Wid } from '..';
19
19
  * @whatsapp 78426
20
20
  * @whatsapp 5018 >= 2.2204.13
21
21
  */
22
- export declare function sendSetPicture(chat: Wid, previewBase64: string, pictureBase64: string): Promise<void>;
22
+ export declare function sendSetPicture(chat: Wid, previewBase64: string, pictureBase64: string): Promise<{
23
+ eurl: string;
24
+ status: number;
25
+ tag: string;
26
+ token: string;
27
+ _duplicate: boolean;
28
+ }>;
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2021 WPPConnect Team
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import { Wid } from '../misc';
17
+ import { ParticipantModel } from '../models';
18
+ /**
19
+ * @whatsapp 951974 >= 2.2222.8
20
+ * @whatsapp 318615 >= 2.2224.7
21
+ */
22
+ export declare function updateParticipants(params: {
23
+ group: Wid;
24
+ participants: ParticipantModel[];
25
+ version: number;
26
+ isOffline: boolean;
27
+ }): Promise<any>;
@@ -15,8 +15,8 @@
15
15
  */
16
16
  import { StatusV3Collection } from '../collections';
17
17
  import { Wid } from '../misc';
18
- import { Model, ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
19
- import { PropsChatBase, SessionChatBase } from './ModelChatBase';
18
+ import { ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
19
+ import { ModelChatBase, PropsChatBase, SessionChatBase } from './ModelChatBase';
20
20
  interface Props extends PropsChatBase {
21
21
  t?: any;
22
22
  unreadCount?: any;
@@ -43,7 +43,7 @@ export declare interface StatusV3Model extends ModelProxy<Props, Session, Derive
43
43
  /** @whatsapp 47896
44
44
  * @whatsapp 547896 >= 2.2222.8
45
45
  */
46
- export declare class StatusV3Model extends Model<StatusV3Collection> {
46
+ export declare class StatusV3Model extends ModelChatBase {
47
47
  idClass: typeof Wid;
48
48
  constructor(proterties?: ModelPropertiesContructor<StatusV3Model>, options?: ModelOptions);
49
49
  setupStatusExpiration(): any;