@wppconnect/wa-js 2.2.2 → 2.3.0

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,12 @@
1
+ # 2.3.0 (2022-05-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Fixed promise time for WPP.chat.markIsComposing with duration ([e94718b](https://github.com/wppconnect-team/wa-js/commit/e94718b37af7f9bfbb181473fc5ac3d0f2782c13))
7
+
8
+
9
+
1
10
  ## 2.2.2 (2022-05-15)
2
11
 
3
12
 
@@ -0,0 +1,54 @@
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
+ * Archive a chat
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * // Archive a chat
23
+ * WPP.chat.archive('[number]@c.us');
24
+ *
25
+ * // Unarchive a chat
26
+ * WPP.chat.archive('[number]@c.us', false);
27
+ * // or
28
+ * WPP.chat.unarchive('[number]@c.us');
29
+ * ```
30
+ * @category Chat
31
+ */
32
+ export declare function archive(chatId: string | Wid, archive?: boolean): Promise<{
33
+ wid: Wid;
34
+ archive: boolean;
35
+ }>;
36
+ /**
37
+ * Unarchive a chat
38
+ *
39
+ * @alias archive
40
+ *
41
+ * @example
42
+ * ```javascript
43
+ * // Unarchive a chat
44
+ * WPP.chat.unarchive('[number]@c.us');
45
+ *
46
+ * // Alias for
47
+ * WPP.chat.archive('[number]@c.us', false);
48
+ * ```
49
+ * @category Chat
50
+ */
51
+ export declare function unarchive(chatId: string | Wid): Promise<{
52
+ wid: Wid;
53
+ archive: boolean;
54
+ }>;
@@ -13,6 +13,7 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ export { archive, unarchive } from './archive';
16
17
  export { canMute } from './canMute';
17
18
  export { clear } from './clear';
18
19
  export { delete } from './delete';
@@ -32,6 +33,7 @@ export { mute } from './mute';
32
33
  export { openChatAt } from './openChatAt';
33
34
  export { openChatBottom } from './openChatBottom';
34
35
  export { openChatFromUnread } from './openChatFromUnread';
36
+ export { pin, unpin } from './pin';
35
37
  export { LinkPreviewOptions, prepareLinkPreview } from './prepareLinkPreview';
36
38
  export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageButtons';
37
39
  export { prepareRawMessage } from './prepareRawMessage';
@@ -0,0 +1,54 @@
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
+ * Pin a chat
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * // Pin a chat
23
+ * WPP.chat.pin('[number]@c.us');
24
+ *
25
+ * // Unpin a chat
26
+ * WPP.chat.pin('[number]@c.us', false);
27
+ * // or
28
+ * WPP.chat.unpin('[number]@c.us');
29
+ * ```
30
+ * @category Chat
31
+ */
32
+ export declare function pin(chatId: string | Wid, pin?: boolean): Promise<{
33
+ wid: Wid;
34
+ pin: boolean;
35
+ }>;
36
+ /**
37
+ * Unpin a chat
38
+ *
39
+ * @alias pin
40
+ *
41
+ * @example
42
+ * ```javascript
43
+ * // Unpin a chat
44
+ * WPP.chat.unpin('[number]@c.us');
45
+ *
46
+ * // Alias for
47
+ * WPP.chat.pin('[number]@c.us', false);
48
+ * ```
49
+ * @category Chat
50
+ */
51
+ export declare function unpin(chatId: string | Wid): Promise<{
52
+ wid: Wid;
53
+ pin: boolean;
54
+ }>;
@@ -51,7 +51,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
51
51
  * // Single document
52
52
  * WPP.chat.sendFileMessage(
53
53
  * '[number]@c.us',
54
- * 'data:image/jpeg;base64,<a long base64 file...>',
54
+ * 'data:application/msword;base64,<a long base64 file...>',
55
55
  * {
56
56
  * type: 'document',
57
57
  * caption: 'My document', // Optional
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ import './deviceName';
18
18
  import * as webpack from './webpack';
19
19
  export { webpack };
20
20
  export { isInjected, isReady } from './webpack';
21
- export * as config from './config';
21
+ export { config } from './config';
22
22
  export * as blocklist from './blocklist';
23
23
  export * as chat from './chat';
24
24
  export * as conn from './conn';
@@ -13,7 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /** @whatsapp 83578 */
16
+ /** @whatsapp 83578
17
+ * @whatsapp 88950 >= 2.2218.4
18
+ */
17
19
  export declare enum LogoutReason {
18
20
  USER_INITIATED = "user_initiated",
19
21
  SYNCD_FAILURE = "syncd_failure",
@@ -0,0 +1,20 @@
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 { MsgModel } from '../models';
17
+ /**
18
+ * @whatsapp 51974
19
+ */
20
+ export declare function encryptAndSendGroupMsg(message: MsgModel, protobuf: any): Promise<any>;
@@ -0,0 +1,20 @@
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 { MsgModel } from '../models';
17
+ /**
18
+ * @whatsapp 95547
19
+ */
20
+ export declare function encryptAndSendMsg(message: MsgModel): Promise<any>;
@@ -0,0 +1,22 @@
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
+ /**
18
+ * @whatsapp 16104
19
+ */
20
+ export declare function getFanOutList(param: {
21
+ wids: Wid[];
22
+ }): Promise<Wid[]>;
@@ -0,0 +1,24 @@
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
+ /**
18
+ * @whatsapp 43201
19
+ */
20
+ export declare function getGroupSenderKeyList(wid: Wid): Promise<{
21
+ skList: Wid[];
22
+ skDistribList: Wid[];
23
+ rotateKey: boolean;
24
+ }>;
@@ -15,5 +15,6 @@
15
15
  */
16
16
  /** @whatsapp 98250
17
17
  * @whatsapp 16413 >= 2.2204.13
18
+ * @whatsapp 66333 >= 2.2218.4
18
19
  */
19
20
  export declare function getOrGenerate(): string;
@@ -16,11 +16,15 @@
16
16
  export * from './addAndSendMsgToChat';
17
17
  export * from './blockContact';
18
18
  export * from './createMsgProtobuf';
19
+ export * from './encryptAndSendGroupMsg';
20
+ export * from './encryptAndSendMsg';
19
21
  export * from './fetchLinkPreview';
20
22
  export * from './findChat';
21
23
  export * from './findFirstWebLink';
22
24
  export * from './generateVideoThumbsAndDuration';
23
25
  export * from './genMinimalLinkPreview';
26
+ export * from './getFanOutList';
27
+ export * from './getGroupSenderKeyList';
24
28
  export * from './getOrGenerate';
25
29
  export * from './groupParticipants';
26
30
  export * from './handleAck';
@@ -43,7 +47,9 @@ export * from './sendQueryGroupInvite';
43
47
  export * from './sendReactionToMsg';
44
48
  export * from './sendRevokeGroupInviteCode';
45
49
  export * from './sendTextMsgToChat';
50
+ export * from './setArchive';
46
51
  export * from './setGroup';
52
+ export * from './setPin';
47
53
  export * from './status';
48
54
  export * from './typeAttributeFromProtobuf';
49
55
  export * from './uploadProductImage';
@@ -13,7 +13,9 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /** @whatsapp 95318 */
16
+ /** @whatsapp 95318
17
+ * @whatsapp 58853 >= 2.2218.4
18
+ */
17
19
  export declare function mediaTypeFromProtobuf(protoMessage: {
18
20
  [key: string]: any;
19
21
  }): string;
@@ -0,0 +1,20 @@
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 { ChatModel } from '../models';
17
+ /**
18
+ * @whatsapp 59992
19
+ */
20
+ export declare function setArchive(chat: ChatModel, archive: boolean, id?: string): Promise<void>;
@@ -0,0 +1,20 @@
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 { ChatModel } from '../models';
17
+ /**
18
+ * @whatsapp 10236
19
+ */
20
+ export declare function setPin(chat: ChatModel, pin: boolean): Promise<void>;
@@ -15,7 +15,9 @@
15
15
  */
16
16
  import { ChatModel } from '..';
17
17
  import { EventEmitter } from '.';
18
- /** @whatsapp 88102 */
18
+ /** @whatsapp 88102
19
+ * @whatsapp 81572 >= 2.2218.4
20
+ */
19
21
  export declare class CmdClass extends EventEmitter {
20
22
  isMainLoaded: boolean;
21
23
  uiBusy: number;
@@ -144,5 +146,7 @@ export declare class CmdClass extends EventEmitter {
144
146
  showCountrySelector(e?: any, t?: any, r?: any): void;
145
147
  toggleStickerMaker(): void;
146
148
  }
147
- /** @whatsapp 88102 */
149
+ /** @whatsapp 88102
150
+ * @whatsapp 81572 >= 2.2218.4
151
+ */
148
152
  export declare const Cmd: CmdClass;
@@ -60,6 +60,8 @@ declare class FeatureClass extends EventEmitter {
60
60
  isGroupCatchUpEnabled(): boolean;
61
61
  isInAppSupportEnabled(): boolean;
62
62
  }
63
- /** @whatsapp 7293 */
63
+ /** @whatsapp 7293
64
+ * @whatsapp 38184 >= 2.2218.4
65
+ */
64
66
  export declare const Features: FeatureClass;
65
67
  export {};
@@ -16,6 +16,7 @@
16
16
  import { Wid } from './Wid';
17
17
  /** @whatsapp 99234
18
18
  * @whatsapp 11362 >= 2.2212.5
19
+ * @whatsapp 78820 >= 2.2218.4
19
20
  */
20
21
  export declare namespace UserPrefs {
21
22
  function setMe(wid: Wid): void;
@@ -26,6 +26,7 @@ declare class NoiseInfo {
26
26
  }
27
27
  /** @whatsapp 15875
28
28
  * @whatsapp 14111 >= 2.2204.13
29
+ * @whatsapp 34898 >= 2.2218.4
29
30
  */
30
31
  export declare const waNoiseInfo: NoiseInfo;
31
32
  export {};
@@ -68,6 +68,8 @@ declare class SignalStore {
68
68
  markKeyAsUploaded(e?: any): any;
69
69
  rotateSignedPreKey(e?: any, t?: any): any;
70
70
  }
71
- /** @whatsapp 11849 */
71
+ /** @whatsapp 11849
72
+ * @whatsapp 40623 >= 2.2218.4
73
+ */
72
74
  export declare const waSignalStore: SignalStore;
73
75
  export {};