talkyzap-wapp-api 1.0.12 → 1.0.14

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,4 +1,9 @@
1
- ## 3.16.9 (2025-03-27)
1
+ ## 3.17.7 (2025-05-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * improovments on queryExist ([1429676](https://github.com/wppconnect-team/wa-js/commit/14296766d99be4d76eb74fc757ce861c9833994e))
2
7
 
3
8
 
4
9
 
package/README.md CHANGED
@@ -90,7 +90,7 @@ There are a convection name for some exported modules:
90
90
 
91
91
  `WPP.group.demoteParticipant` - Demote a participant from admin.
92
92
 
93
- `WPP.group.getGroupInfo` - Get group information.
93
+ `WPP.group.getGroupInfoFromInviteCode` - Get group information from an invitation link or an invite code.
94
94
 
95
95
  ### Events
96
96
  `WPP.chat.on('chat.new_message')` - Event to dispatch on receive a new message
@@ -13,21 +13,5 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /**
17
- * Send a request order to business chat
18
- *
19
- * @example
20
- * ```javascript
21
- * const cart = WPP.cart.submit('[number]@c.us');
22
- * ```
23
- *
24
- * @example
25
- * ```javascript
26
- * // Send cart with a custom message
27
- * const cart = WPP.cart.submit('[number]@c.us', 'Custom message here');
28
- * ```
29
- *
30
- * @category Cart
31
- */
32
16
  import { SendMessageOptions } from '../../chat';
33
17
  export declare function submit(wid: string, msg?: string, options?: SendMessageOptions): Promise<any>;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2021 WPPConnect Team
2
+ * Copyright 2025 WPPConnect Team
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -81,6 +81,7 @@ export interface DocumentMessageOptions extends FileMessageOptions, MessageButto
81
81
  export interface ImageMessageOptions extends FileMessageOptions, MessageButtonsOptions {
82
82
  type: 'image';
83
83
  isViewOnce?: boolean;
84
+ isHD?: boolean;
84
85
  }
85
86
  export interface StickerMessageOptions extends FileMessageOptions {
86
87
  type: 'sticker';
@@ -90,6 +91,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
90
91
  isGif?: boolean;
91
92
  isPtv?: boolean;
92
93
  isViewOnce?: boolean;
94
+ isHD?: boolean;
93
95
  }
94
96
  /**
95
97
  * Send a file message, that can be an audio, document, image, sticker or video
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2021 WPPConnect Team
2
+ * Copyright 2025 WPPConnect Team
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
21
21
  * //Change the maximum size (bytes) for uploading media (max 70MB)
22
22
  * WPP.conn.setLimit('maxMediaSize',16777216);
23
23
  * ```
24
+ * @deprecated
24
25
  */
25
26
  export declare function setLimit(key: 'maxMediaSize', value: number): number;
26
27
  /**
@@ -51,6 +52,7 @@ export declare function setLimit(key: 'maxShare', value: number): number;
51
52
  * //Change the maximum time (seconds) of a video status
52
53
  * WPP.conn.setLimit('statusVideoMaxDuration',120);
53
54
  * ```
55
+ * @deprecated
54
56
  */
55
57
  export declare function setLimit(key: 'statusVideoMaxDuration', value: number): number;
56
58
  /**
@@ -48,4 +48,11 @@ export declare function getGroupInfoFromInviteCode(inviteCode: string): Promise<
48
48
  subjectTime: number;
49
49
  support: boolean;
50
50
  suspended: boolean;
51
+ isParentGroup: boolean;
52
+ isParentGroupClosed: boolean;
53
+ defaultSubgroup: boolean;
54
+ generalSubgroup: boolean;
55
+ membershipApprovalMode: boolean;
56
+ isLidAddressingMode: boolean;
57
+ generalChatAutoAddDisabled: boolean;
51
58
  }>;
@@ -32,3 +32,20 @@ export declare enum CALL_STATES {
32
32
  FAILED = "FAILED",
33
33
  NOT_ANSWERED = "NOT_ANSWERED"
34
34
  }
35
+ export declare enum CALL_STATES {
36
+ None = 0,
37
+ Calling = 1,
38
+ PreacceptReceived = 2,
39
+ ReceivedCall = 3,
40
+ AcceptSent = 4,
41
+ AcceptReceived = 5,
42
+ CallActive = 6,
43
+ CallActiveElseWhere = 7,
44
+ ReceivedCallWithoutOffer = 8,
45
+ Rejoining = 9,
46
+ Link = 10,
47
+ ConnectedLonely = 11,
48
+ PreCalling = 12,
49
+ CallStateEnding = 13,
50
+ CallBCallStarting = 14
51
+ }
@@ -0,0 +1,28 @@
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 WAWebCreateChat >= 2.3000.0
18
+ */
19
+ export declare function checkChatExistedOrCreate(options: {
20
+ destinationChat: any;
21
+ msgMeta: null;
22
+ chatOriginType: any;
23
+ initialProps: any;
24
+ options: {
25
+ forceUsync: any;
26
+ nextPrivacyMode: any;
27
+ };
28
+ }): Promise<any>;
@@ -120,8 +120,13 @@ export declare function getPnForLid(contact: ContactModel): any;
120
120
  export declare function getDisplayNameOrPnForLid(contact: ContactModel): any;
121
121
  /**
122
122
  * @whatsapp 714574 >= 2.2327.4
123
+ * @deprecated Use getFormattedUsernameOrPhone instead
123
124
  */
124
125
  export declare function getFormattedPhone(contact: ContactModel): any;
126
+ /**
127
+ * @whatsapp 714574 >= 2.2327.4
128
+ */
129
+ export declare function getFormattedUsernameOrPhone(contact: ContactModel): any;
125
130
  /**
126
131
  * @whatsapp 714574 >= 2.2327.4
127
132
  */
@@ -0,0 +1,38 @@
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 WAWebCreateChat >= 2.3000.0
19
+ */
20
+ export declare function createChatRecord(id: Wid, chatRecord: {
21
+ id: string;
22
+ accountLid?: string;
23
+ bizBotSystemMsgType?: string;
24
+ createdLocally: boolean;
25
+ disappearingModeInitiatedByMe?: boolean;
26
+ disappearingModeInitiator?: string;
27
+ disappearingModeTrigger?: string;
28
+ ephemeralDuration?: number;
29
+ ephemeralSettingTimestamp?: number;
30
+ isAutoMuted: boolean;
31
+ lidOriginType?: string;
32
+ notSpam?: boolean;
33
+ t?: number;
34
+ tcToken: ArrayBuffer;
35
+ tcTokenSenderTimestamp?: number;
36
+ tcTokenTimestamp: number;
37
+ unreadCount: number;
38
+ }): Promise<undefined>;
@@ -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 '..';
17
+ /**
18
+ * @whatsapp WAWebMexFetchGroupInviteCodeJob
19
+ */
20
+ export declare function fetchMexGroupInviteCode(groupId: Wid): Promise<{
21
+ inviteCode: string;
22
+ }>;
@@ -19,4 +19,4 @@ import { ChatModel } from '../models';
19
19
  * @whatsapp 650101 >= 2.2222.8
20
20
  * @whatsapp 211739 >= 2.2228.4
21
21
  */
22
- export declare function findChat(wid: Wid): Promise<ChatModel>;
22
+ export declare function findChat(wid: Wid, type: 'createChat' | 'chatListUtils' | 'username_contactless_search'): Promise<ChatModel>;
@@ -17,4 +17,7 @@ import { Wid } from '../misc';
17
17
  import { ChatModel } from '../models';
18
18
  /** @whatsapp WAWebFindChatAction
19
19
  */
20
- export declare function findOrCreateLatestChat(wid: Wid, type?: 'username_contactless_search' | 'forwardSelectedModals'): Promise<ChatModel>;
20
+ export declare function findOrCreateLatestChat(wid: Wid, type?: 'username_contactless_search' | 'forwardSelectedModals' | 'newChatFlow' | 'chatInfoTopCard'): Promise<{
21
+ chat: ChatModel;
22
+ created: boolean;
23
+ }>;
@@ -14,7 +14,8 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { Wid } from '../misc';
17
+ import { ChatModel } from '../models';
17
18
  /**
18
19
  * @whatsapp WAWebChatGetExistingBridge >= 2.3000.0
19
20
  */
20
- export declare function getExisting(chatId: Wid): Promise<any>;
21
+ export declare function getExisting(chatId: Wid): Promise<ChatModel | null>;
@@ -0,0 +1,20 @@
1
+ /*!
2
+ * Copyright 2024 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 WAWebApiContact
19
+ */
20
+ export declare function getPhoneNumber(wid: Wid): any;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2023 WPPConnect Team
2
+ * Copyright 2025 WPPConnect Team
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -23,10 +23,12 @@ export * from './canEditCaption';
23
23
  export * from './canEditMsg';
24
24
  export * from './canReplyMsg';
25
25
  export * from './changeOptInStatusForExternalWebBeta';
26
+ export * from './checkChatExistedOrCreate';
26
27
  export * from './collections';
27
28
  export * from './colorIndexToHex';
28
29
  export * from './contactFunctions';
29
30
  export * from './createChat';
31
+ export * from './createChatRecord';
30
32
  export * from './createEventCallLink';
31
33
  export * from './createFanoutMsgStanza';
32
34
  export * from './createGroup';
@@ -45,6 +47,7 @@ export * from './encryptAndSendSenderKeyMsg';
45
47
  export * from './encryptAndSendStatusMsg';
46
48
  export * from './encryptMsgProtobuf';
47
49
  export * from './fetchLinkPreview';
50
+ export * from './fetchMexGroupInviteCode';
48
51
  export * from './findChat';
49
52
  export * from './findCommonGroups';
50
53
  export * from './findFirstWebLink';
@@ -75,6 +78,7 @@ export * from './getNextLabelId';
75
78
  export * from './getNumChatsPinned';
76
79
  export * from './getOrderInfo';
77
80
  export * from './getParticipants';
81
+ export * from './getPhoneNumber';
78
82
  export * from './getPrivacyDisallowedListTable';
79
83
  export * from './getPushname';
80
84
  export * from './getQuotedMsgObj';
@@ -99,7 +103,6 @@ export * from './isWid';
99
103
  export * from './joinGroupViaInvite';
100
104
  export * from './keepMessage';
101
105
  export * from './labelAddAction';
102
- export * from './labelAddAction';
103
106
  export * from './markSeen';
104
107
  export * from './mediaTypeFromProtobuf';
105
108
  export * from './membershipApprovalRequestAction';
@@ -17,6 +17,7 @@ import { Wid } from '..';
17
17
  export interface QueryGroupInviteResult {
18
18
  announce: boolean;
19
19
  creation: number;
20
+ /** description of the group; linebreaks are formatted using `"\n"` */
20
21
  desc: string;
21
22
  descId: string;
22
23
  descOwner?: Wid;
@@ -32,13 +33,22 @@ export interface QueryGroupInviteResult {
32
33
  }[];
33
34
  pvId?: string;
34
35
  restrict: boolean;
36
+ /** how many members the group currently has */
35
37
  size: number;
36
38
  status: number;
39
+ /** title of the group */
37
40
  subject: string;
38
41
  subjectOwner?: Wid;
39
42
  subjectTime: number;
40
43
  support: boolean;
41
44
  suspended: boolean;
45
+ isParentGroup: boolean;
46
+ isParentGroupClosed: boolean;
47
+ defaultSubgroup: boolean;
48
+ generalSubgroup: boolean;
49
+ membershipApprovalMode: boolean;
50
+ isLidAddressingMode: boolean;
51
+ generalChatAutoAddDisabled: boolean;
42
52
  }
43
53
  /** @whatsapp 10790
44
54
  * @whatsapp 810790 >= 2.2222.8
@@ -0,0 +1,41 @@
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 './Wid';
17
+ /** @whatsapp WAWebApiContact
18
+ */
19
+ export declare namespace ApiContact {
20
+ function checkPnToLidMapping(a?: any, b?: any): any;
21
+ function clearLidPnMappingCache(): any;
22
+ function createOrMergeAddressBookContacts(a?: any): any;
23
+ function deleteAddressBookContacts(a?: any): any;
24
+ function getAccountLidFromChat(a?: any): Wid;
25
+ function getAllLidContacts(): Wid[];
26
+ function getAlternateDeviceWid(a?: any): Wid;
27
+ function getAlternateUserWid(a?: any): Wid;
28
+ function getContactHash(a?: any): any;
29
+ function getContactRecord(a?: any): any;
30
+ function getContactUsername(a?: any): any;
31
+ function getCurrentLid(a?: any): any;
32
+ function getCurrentLidDevice(a?: any): any;
33
+ function getLatestLid(a?: any): any;
34
+ function getPhoneNumber(wid: Wid): Wid;
35
+ function getPnIfLidIsLatestMapping(a?: any): any;
36
+ function hasLidMapping(a?: any): any;
37
+ function isAddressBookContact(a?: any): any;
38
+ function setNotAddressBookContacts(a?: any): any;
39
+ function updateContactAdvHostedType(a?: any, b?: any): any;
40
+ function updateLidMetadata(a?: any, b?: any): any;
41
+ }
@@ -26,6 +26,7 @@ export declare namespace MediaPrep {
26
26
  asGif?: boolean;
27
27
  isAudio?: boolean;
28
28
  asSticker?: boolean;
29
+ maxDimension?: number;
29
30
  }): MediaPrep;
30
31
  class MediaPrep {
31
32
  constructor(type: OUTWARD_TYPES, p: any);
@@ -0,0 +1,30 @@
1
+ /*!
2
+ * Copyright 2025 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 WAWebServerPropConstants
18
+ */
19
+ interface ServerPropsModel {
20
+ MMS_VCARD_AUTODOWNLOAD_SIZE_KB: number;
21
+ VCARD_AS_DOCUMENT_SIZE_KB: number;
22
+ VCARD_MAX_SIZE_KB: number;
23
+ MULTICAST_LIMIT_GLOBAL: number;
24
+ PTT_PLAYBACK_SPEED_HIDE_DELAY: number;
25
+ DEFAULT_MAX_FILE_SIZE_BYTES: number;
26
+ MAX_FILE_SIZE_BYTES: number;
27
+ UNINITIALIZED_VALUE_WEB_BIZ_PROFILE_OPTIONS: number;
28
+ }
29
+ export declare const ServerPropsConstants: ServerPropsModel;
30
+ export {};
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2021 WPPConnect Team
2
+ * Copyright 2025 WPPConnect Team
3
3
  *
4
4
  * Licensed under the Apache License, Version 2.0 (the "License");
5
5
  * you may not use this file except in compliance with the License.
@@ -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 * from './ApiContact';
16
17
  export * from './Base64';
17
18
  export * from './Browser';
18
19
  export * from './ChatPresence';
@@ -36,6 +37,7 @@ export * from './NetworkStatus';
36
37
  export * from './OpaqueData';
37
38
  export * from './ProductCatalogSession';
38
39
  export * from './ServerProps';
40
+ export * from './ServerPropsConstants';
39
41
  export * from './Socket';
40
42
  export * from './Stream';
41
43
  export * from './UserPrefs';
@@ -15,13 +15,18 @@
15
15
  */
16
16
  import { Model, ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
17
17
  interface Props {
18
+ id: string;
19
+ incomplete: boolean;
20
+ realProgress: number | null;
21
+ fakeProgress: number;
22
+ remainingPausedSeconds?: number;
23
+ _fakePausedCompletionTimeout: number;
24
+ _progressIncrementTimeout: number;
25
+ _lastUpdateSeconds: number;
18
26
  }
19
27
  interface Session {
20
28
  }
21
29
  interface Derived {
22
- progress: number | null;
23
- paused: boolean;
24
- inProgress: boolean;
25
30
  }
26
31
  /**
27
32
  * @whatsapp 649959 >= 2.2244.5
@@ -35,6 +40,8 @@ export declare class HistorySyncProgressModel extends Model {
35
40
  constructor(proterties?: ModelPropertiesContructor<HistorySyncProgressModel>, options?: ModelOptions);
36
41
  setInProgress(inProgress: boolean): void;
37
42
  setPaused(paused: boolean): void;
43
+ setIncomplete(value: boolean): void;
38
44
  setProgress(progress: number): void;
45
+ pausedExpiryCheckpoint(a?: number): void;
39
46
  }
40
47
  export {};