@wppconnect/wa-js 2.24.5 → 2.24.7

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,5 +1 @@
1
- ## 2.24.5 (2023-07-02)
2
-
3
- ### Bug Fixes
4
-
5
- - Fixed compatibility of ContactModel for WhatsApp >= 2.2327.4 (fix [#1208](https://github.com/wppconnect-team/wa-js/issues/1208)) ([b960710](https://github.com/wppconnect-team/wa-js/commit/b960710f19b5422bdf39c5f9eb90a64f4580de31))
1
+ ## 2.24.7 (2023-07-11)
@@ -0,0 +1,22 @@
1
+ /*!
2
+ * Copyright 2023 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 { MsgKey, MsgModel } from '../../whatsapp';
17
+ /**
18
+ * Get a quoted message
19
+ *
20
+ * @category Chat
21
+ */
22
+ export declare function getQuotedMsgKey(msg: MsgModel): MsgKey;
@@ -33,6 +33,7 @@ export { getMessageById } from './getMessageById';
33
33
  export { getMessages, GetMessagesOptions } from './getMessages';
34
34
  export { getPlatformFromMessage } from './getPlatformFromMessage';
35
35
  export { getQuotedMsg } from './getQuotedMsg';
36
+ export { getQuotedMsgKey } from './getQuotedMsgKey';
36
37
  export { getReactions } from './getReactions';
37
38
  export { getVotes } from './getVotes';
38
39
  export { ChatListOptions, list } from './list';
@@ -18,6 +18,7 @@ export interface ChatListOptions {
18
18
  id?: Wid;
19
19
  count?: number;
20
20
  direction?: 'after' | 'before';
21
+ onlyCommunities?: boolean;
21
22
  onlyGroups?: boolean;
22
23
  onlyUsers?: boolean;
23
24
  onlyWithUnreadMessage?: boolean;
@@ -43,6 +44,9 @@ export interface ChatListOptions {
43
44
  * // Only groups chats
44
45
  * const chats = await WPP.chat.list({onlyGroups: true});
45
46
  *
47
+ * // Only communities chats
48
+ * const chats = await WPP.chat.list({onlyCommunities: true});
49
+ *
46
50
  * // Only with label Text
47
51
  * const chats = await WPP.chat.list({withLabels: ['Test']});
48
52
  *
@@ -39,11 +39,14 @@ import { Wid } from '../../whatsapp';
39
39
  * // How to send a custom invite link
40
40
  * const link = 'https://chat.whatsapp.com/' + result['number@c.us'].invite_code;
41
41
  * console.log(link);
42
+ *
43
+ * // Create a Subgroup for a community
44
+ * const result = await WPP.group.create('Test Group', ['number@c.us'], 'communit@g.us');
42
45
  * ```
43
46
  *
44
47
  * @category Group
45
48
  */
46
- export declare function create(groupName: string, participantsIds: (string | Wid) | (string | Wid)[]): Promise<{
49
+ export declare function create(groupName: string, participantsIds: (string | Wid) | (string | Wid)[], parentGroup: string | Wid): Promise<{
47
50
  gid: Wid;
48
51
  participants: {
49
52
  [key: `${number}@c.us`]: {
@@ -0,0 +1,19 @@
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
+ * @whatsapp 831914
18
+ */
19
+ export declare const SANITIZED_VERSION_STR: string;
@@ -14,3 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  export * from './DROP_ATTR';
17
+ export * from './SANITIZED_VERSION_STR';
@@ -15,7 +15,14 @@
15
15
  */
16
16
  import { InferArgs, InferReturn } from '../util';
17
17
  import * as webpack from '../webpack';
18
- export declare const _moduleIdMap: WeakMap<any, string>;
18
+ declare class CustomWeakMap extends WeakMap<object, string> {
19
+ protected stringMap: Map<string, string>;
20
+ delete(key: object | string): boolean;
21
+ get(key: object | string): string | undefined;
22
+ has(key: object | string): boolean;
23
+ set(key: object | string, value: string): this;
24
+ }
25
+ export declare const _moduleIdMap: CustomWeakMap;
19
26
  /**
20
27
  * The object of this function is to override the exports to create getters.
21
28
  *
@@ -48,3 +55,4 @@ export declare function exportProxyModel(exports: any, name: string): void;
48
55
  * ```
49
56
  */
50
57
  export declare function wrapModuleFunction<TFunc extends (...args: any[]) => any>(func: TFunc, callback: (func: TFunc, ...args: InferArgs<TFunc>) => InferReturn<TFunc>): void;
58
+ export {};
@@ -18,7 +18,11 @@ import { ContactModel } from '../models';
18
18
  * @whatsapp 780140 >= 2.2222.8
19
19
  * @whatsapp 48826 >= 2.2228.4
20
20
  */
21
- export declare function blockContact(contact: ContactModel): Promise<void>;
21
+ export declare function blockContact(contact: ContactModel | {
22
+ contact: ContactModel;
23
+ blockEntryPoint: string;
24
+ bizOptOutArgs: any | null;
25
+ }): Promise<void>;
22
26
  /** @whatsapp 80140
23
27
  * @whatsapp 780140 >= 2.2222.8
24
28
  * @whatsapp 48826 >= 2.2228.4
@@ -17,7 +17,7 @@ import { Wid } from '..';
17
17
  /**
18
18
  * @whatsapp 247355
19
19
  */
20
- export declare function createGroup(groupName: string, participants: Wid[], ephemeral?: number, dogfooding?: boolean): Promise<{
20
+ export declare function createGroup(groupName: string, participants: Wid[], ephemeral?: number, parentGroup?: Wid): Promise<{
21
21
  wid: Wid;
22
22
  participants: {
23
23
  wid: Wid;
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { Wid } from '..';
17
17
  /** @whatsapp 79583 */
18
- export declare function sendCreateGroup(groupName: string, participants: Wid[], ephemeral?: number, dogfooding?: boolean): Promise<{
18
+ export declare function sendCreateGroup(groupName: string, participants: Wid[], ephemeral?: number, parentGroup?: Wid): Promise<{
19
19
  gid: Wid;
20
20
  participants: ({
21
21
  [key: `${number}@c.us`]: {
@@ -20,6 +20,8 @@ interface Props {
20
20
  id: Wid;
21
21
  creation?: any;
22
22
  owner?: any;
23
+ subject?: string;
24
+ subjectTime?: any;
23
25
  desc?: string;
24
26
  descId?: string;
25
27
  descTime?: any;
@@ -28,21 +30,49 @@ interface Props {
28
30
  announce?: any;
29
31
  noFrequentlyForwarded?: any;
30
32
  ephemeralDuration?: any;
33
+ membershipApprovalMode?: any;
34
+ growthLockExpiration?: any;
35
+ growthLockType?: any;
36
+ reportToAdminMode?: any;
31
37
  size?: any;
38
+ numSubgroups?: any;
32
39
  support?: any;
40
+ suspended?: any;
41
+ terminated?: any;
33
42
  uniqueShortNameMap?: any;
34
43
  isLidAddressingMode: boolean;
44
+ isParentGroup: boolean;
45
+ isParentGroupClosed: boolean;
46
+ parentGroup?: any;
47
+ defaultSubgroup?: any;
48
+ unjoinedSubgroups?: any;
49
+ joinedSubgroups?: any;
50
+ allowNonAdminSubGroupCreation?: any;
51
+ lastActivityTimestamp?: any;
52
+ lastSeenActivityTimestamp?: any;
53
+ lastReportToAdminTimestamp?: any;
54
+ incognito?: any;
35
55
  }
36
56
  interface Session {
37
57
  stale?: any;
58
+ deviceStale?: any;
38
59
  trusted?: any;
39
60
  inviteCode?: any;
40
61
  groupInviteCodePromise?: any;
41
62
  revokeGroupInvitePromise?: any;
42
- revokeGroupV4AddInvitePromise?: any;
63
+ participantQueryPromise?: any;
64
+ deviceQueryPromise?: any;
65
+ unjoinedSubgroupsQueryPromise?: any;
66
+ displayedDesc?: any;
67
+ revokeGroupsV4AddInvitePromise?: any;
68
+ cachedDeviceCount?: any;
69
+ cachedDeviceSizeBucket?: any;
43
70
  }
44
71
  interface Derived {
45
72
  groupInviteLink?: any;
73
+ groupType?: string;
74
+ isIncognitoCag?: boolean;
75
+ isUnnamed?: boolean;
46
76
  }
47
77
  /** @whatsapp 14423
48
78
  * @whatsapp 614423 >= 2.2222.8