talkyzap-wapp-api 1.0.1 → 1.0.3

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.1.1 (2024-04-10)
1
+ ## 3.3.1 (2024-06-09)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Fixed delete messages for me ([5cdf157](https://github.com/wppconnect-team/wa-js/commit/5cdf157ae1c7ad02ff099979cf6a0a949c436ee0))
2
7
 
3
8
 
4
9
 
@@ -36,8 +36,14 @@ export interface MessageButtonsOptions {
36
36
  /**
37
37
  * Set to use template buttons instead of reply buttons.
38
38
  * @default: undefined - auto detect
39
+ * @deprecated
39
40
  */
40
41
  useTemplateButtons?: boolean | null;
42
+ /**
43
+ * Set to use interactive message instead of reply buttons.
44
+ * @default: undefined - auto detect
45
+ */
46
+ useInteractiveMesssage?: boolean | null;
41
47
  /**
42
48
  * Footer text for buttons
43
49
  */
@@ -44,6 +44,7 @@ export interface AutoDetectMessageOptions extends FileMessageOptions {
44
44
  export interface AudioMessageOptions extends FileMessageOptions {
45
45
  type: 'audio';
46
46
  isPtt?: boolean;
47
+ isViewOnce?: boolean;
47
48
  /**
48
49
  * Send an audio message as a PTT with waveform
49
50
  *
@@ -87,6 +88,7 @@ export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsO
87
88
  type: 'video';
88
89
  isGif?: boolean;
89
90
  isPtv?: boolean;
91
+ isViewOnce?: boolean;
90
92
  }
91
93
  /**
92
94
  * Send a file message, that can be an audio, document, image, sticker or video
@@ -35,20 +35,6 @@ export interface GroupInviteMessage extends SendMessageOptions {
35
35
  * groupId: '789@g.us'
36
36
  * }
37
37
  * );
38
- *
39
- * // After a invite
40
- * const result = await WPP.group.addParticipants('789@g.us', '123@c.us');
41
- * const participant = result['123@c.us'];
42
- * if (participant.invite_code) {
43
- * WPP.chat.sendGroupInviteMessage(
44
- * '123@c.us',
45
- * {
46
- * inviteCode: participant.invite_code,
47
- * inviteCodeExpiration: participant.invite_code_exp,
48
- * groupId: '789@g.us'
49
- * }
50
- * );
51
- * }
52
38
  * ```
53
39
  *
54
40
  * @category Message
@@ -110,6 +110,9 @@ export interface SendMessageOptions {
110
110
  }
111
111
  export interface SendMessageReturn {
112
112
  id: string;
113
+ from?: string;
114
+ to?: string;
115
+ latestEditMsgKey?: MsgKey;
113
116
  ack: number;
114
117
  sendMsgResult: Promise<SendMsgResult>;
115
118
  }
@@ -30,6 +30,7 @@ export interface QueryExistsResult {
30
30
  duration: number;
31
31
  settingTimestamp: number;
32
32
  };
33
+ status?: string;
33
34
  }
34
35
  /**
35
36
  * Check if the number exists and what is correct ID
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2021 WPPConnect Team
2
+ * Copyright 2024 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.
@@ -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 '../../whatsapp';
17
+ /**
18
+ * Get an array of past participants of a group
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * WPP.group.getPastParticipants('[group-id]@g.us');
23
+ * ```
24
+ *
25
+ * @category Group
26
+ */
27
+ export declare function getPastParticipants(groupId: string | Wid): Promise<import("../../whatsapp").ParticipantModel[]>;
@@ -29,6 +29,7 @@ export { getGroupSizeLimit } from './getGroupSizeLimit';
29
29
  export { getInviteCode } from './getInviteCode';
30
30
  export { getMembershipRequests } from './getMembershipRequests';
31
31
  export { getParticipants } from './getParticipants';
32
+ export { getPastParticipants } from './getPastParticipants';
32
33
  export { iAmAdmin } from './iAmAdmin';
33
34
  export { iAmMember } from './iAmMember';
34
35
  export { iAmRestrictedMember } from './iAmRestrictedMember';
@@ -0,0 +1,26 @@
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
+ /**
17
+ * Get subscribers of a newsletters
18
+ *
19
+ * @example
20
+ * ```javascript
21
+ * const code = WPP.newsletter.getSubscribers('[newsletter-id]@newsletter');
22
+ * ```
23
+ *
24
+ * @category Newsletter
25
+ */
26
+ export declare function getSubscribers(id: string): Promise<any>;
@@ -16,4 +16,5 @@
16
16
  export { create } from './create';
17
17
  export { destroy } from './destroy';
18
18
  export { edit } from './edit';
19
+ export { getSubscribers } from './getSubscribers';
19
20
  export { mute } from './mute';
@@ -16,26 +16,8 @@
16
16
  /**
17
17
  * Fetch preview link data from a remote server
18
18
  */
19
- export declare function fetchRemoteLinkPreviewData(url: string): Promise<{
20
- title: any;
21
- description: any;
22
- canonicalUrl: any;
23
- matchedText: string;
24
- richPreviewType: number;
25
- doNotPlayInline: boolean;
26
- imageUrl: any;
27
- } | null | undefined>;
19
+ export declare function fetchRemoteLinkPreviewData(url: string): Promise<any>;
28
20
  /**
29
21
  * Generate the preview link thumbnail data
30
22
  */
31
- export declare function generateThumbnailLinkPreviewData(url: string): Promise<{
32
- thumbnail: unknown;
33
- thumbnailHQ: string;
34
- mediaKey: any;
35
- mediaKeyTimestamp: any;
36
- thumbnailDirectPath: any;
37
- thumbnailSha256: string;
38
- thumbnailEncSha256: any;
39
- thumbnailWidth: number;
40
- thumbnailHeight: number;
41
- } | null>;
23
+ export declare function generateThumbnailLinkPreviewData(url: string): Promise<any>;
@@ -16,7 +16,10 @@
16
16
  import { Wid } from '../misc';
17
17
  import { StatusModel } from '../models';
18
18
  import { BaseCollection } from '.';
19
- /** @whatsapp 46133 */
19
+ /**
20
+ * @whatsapp 46133
21
+ * @whatsapp WAWebTextStatusCollection >= 2.3000.1013010908
22
+ * */
20
23
  export declare class StatusCollection extends BaseCollection<StatusModel> {
21
24
  static model: StatusModel;
22
25
  static idClass: typeof Wid;
@@ -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 { MsgModel } from '../models';
17
+ /**
18
+ * @whatsapp WAWebMsgActionCapability >= 2.3000.0
19
+ */
20
+ export declare function canEditCaption(msg: MsgModel): boolean;
@@ -0,0 +1,34 @@
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 276084
19
+ */
20
+ export declare function getNewsletterSubscribers(jid: string, param2: number, view: 'LIMITED'): Promise<{
21
+ subscribers: {
22
+ id: Wid;
23
+ isContact?: boolean;
24
+ isGroup?: boolean;
25
+ isOnline?: boolean;
26
+ isUser?: boolean;
27
+ shortname?: string;
28
+ state?: string;
29
+ displayName?: string;
30
+ phoneNumber?: string;
31
+ subscribeTime?: number;
32
+ t: number;
33
+ }[];
34
+ }>;
@@ -18,6 +18,7 @@ export * from './addAndSendMsgToChat';
18
18
  export * from './addToLabelCollection';
19
19
  export * from './blockContact';
20
20
  export * from './calculateFilehashFromBlob';
21
+ export * from './canEditCaption';
21
22
  export * from './canEditMsg';
22
23
  export * from './canReplyMsg';
23
24
  export * from './changeOptInStatusForExternalWebBeta';
@@ -58,6 +59,7 @@ export * from './getGroupSenderKeyList';
58
59
  export * from './getGroupSizeLimit';
59
60
  export * from './getHistorySyncProgress';
60
61
  export * from './getMembershipApprovalRequests';
62
+ export * from './getNewsletterSubscribers';
61
63
  export * from './getNextLabelId';
62
64
  export * from './getNumChatsPinned';
63
65
  export * from './getOrderInfo';
@@ -79,6 +81,7 @@ export * from './isAuthenticated';
79
81
  export * from './isLegitErrorStack';
80
82
  export * from './isRegistered';
81
83
  export * from './isUnreadTypeMsg';
84
+ export * from './isWid';
82
85
  export * from './joinGroupViaInvite';
83
86
  export * from './keepMessage';
84
87
  export * from './labelAddAction';
@@ -0,0 +1,19 @@
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
+ /**
17
+ * @whatsapp 469475
18
+ */
19
+ export declare function isWid(number: string): boolean;
@@ -17,6 +17,6 @@ import { Wid } from '..';
17
17
  /**
18
18
  * @whatsapp 153438
19
19
  */
20
- export declare function queryGroupInviteCode(groupId: Wid): Promise<{
20
+ export declare function queryGroupInviteCode(groupId: Wid, iAmAdmin: boolean): Promise<{
21
21
  code: string;
22
22
  }>;
@@ -19,5 +19,6 @@ import { ChatModel } from '../models';
19
19
  * @whatsapp 510236 >= 2.2222.8
20
20
  * @whatsapp 742348 >= 2.2228.4
21
21
  * @whatsapp 456180 >= 2.2230.8
22
+ * @whatsapp WAWebSetPinChatAction >= 2.3000.x
22
23
  */
23
24
  export declare function setPin(chat: ChatModel, pin: boolean): Promise<void>;
@@ -52,8 +52,23 @@ export declare class CmdClass extends EventEmitter {
52
52
  ephemeralDrawer(e?: any, t?: any): void;
53
53
  sendStarMsgs(chat: ChatModel, msgs: MsgModel[], id?: any, toastPosition?: any): void;
54
54
  sendUnstarMsgs(chat: ChatModel, msgs: MsgModel[], id?: any, toastPosition?: any): void;
55
- sendDeleteMsgs(chat: ChatModel, msgs: MsgModel[], clearMedia?: boolean, toastPosition?: any): void;
56
- sendRevokeMsgs(chat: ChatModel, msgs: MsgModel[], options?: {
55
+ /** Whatsapp <= 2.3000.1014080102 */
56
+ sendDeleteMsgs(chat: ChatModel, msg: {
57
+ type: string;
58
+ list: MsgModel[];
59
+ } | MsgModel[], options?: {
60
+ clearMedia?: boolean;
61
+ toastPosition?: any;
62
+ }): void;
63
+ /** Whatsapp >= 2.3000.1014080102 */
64
+ sendDeleteMsgs(chat: ChatModel, msg: {
65
+ type: string;
66
+ list: MsgModel[];
67
+ } | MsgModel[], clearMedia?: boolean): void;
68
+ sendRevokeMsgs(chat: ChatModel, msg: {
69
+ type: string;
70
+ list: MsgModel[];
71
+ } | MsgModel[], options?: {
57
72
  clearMedia?: boolean;
58
73
  toastPosition?: any;
59
74
  }): void;
@@ -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 './Wid';
17
+ /**
18
+ * @whatsapp 459857
19
+ */
20
+ export declare class USyncQuery {
21
+ constructor();
22
+ $1(): any;
23
+ execute(): any;
24
+ withBotProfileProtocol(): any;
25
+ withBusinessProtocol(): any;
26
+ withContactProtocol(): any;
27
+ withContext(a: any): any;
28
+ withDeviceProtocol(): Wid;
29
+ withDisappearingModeProtocol(): any;
30
+ withFeaturesProtocol(a: any): any;
31
+ withLidProtocol(): Wid;
32
+ withMode(a: any): any;
33
+ withPictureProtocol(): any;
34
+ withStatusProtocol(): any;
35
+ withTextStatusProtocol(): any;
36
+ withUser(a: any): any;
37
+ withUsernameProtocol(): any;
38
+ }
@@ -0,0 +1,26 @@
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
+ /**
17
+ * @whatsapp 459857
18
+ */
19
+ export declare class USyncUser {
20
+ constructor();
21
+ withPhone(a: any): any;
22
+ withId(a: any): any;
23
+ withLid(a: any): any;
24
+ withType(a: any): any;
25
+ withUsername(a: any): any;
26
+ }
@@ -29,7 +29,7 @@ export * from './MediaObjectUtil';
29
29
  export * from './MediaPrep';
30
30
  export * from './MediaUtils';
31
31
  export * from './MsgKey';
32
- export * from './MsgLoadState';
32
+ export * from './MsgLoad';
33
33
  export * from './NetworkStatus';
34
34
  export * from './OpaqueData';
35
35
  export * from './ProductCatalogSession';
@@ -37,6 +37,8 @@ export * from './ServerProps';
37
37
  export * from './Socket';
38
38
  export * from './Stream';
39
39
  export * from './UserPrefs';
40
+ export * from './USyncQuery';
41
+ export * from './USyncUser';
40
42
  export * from './VCard';
41
43
  export * from './Wid';
42
44
  export * from './WidFactory';
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2021 WPPConnect Team
2
+ * Copyright 2024 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.
@@ -20,6 +20,7 @@ interface Props {
20
20
  id: Wid;
21
21
  creation?: any;
22
22
  owner?: any;
23
+ memberAddMode?: string;
23
24
  subject?: string;
24
25
  subjectTime?: any;
25
26
  desc?: string;
@@ -85,7 +86,8 @@ export declare interface GroupMetadataModel extends ModelProxy<Props, Session, D
85
86
  export declare class GroupMetadataModel extends Model {
86
87
  idClass: typeof Wid;
87
88
  participants: ParticipantCollection;
88
- constructor(proterties?: ModelPropertiesContructor<GroupMetadataModel>, options?: ModelOptions);
89
+ pastParticipants: ParticipantCollection;
90
+ constructor(properties?: ModelPropertiesContructor<GroupMetadataModel>, options?: ModelOptions);
89
91
  hasUniqueShortNameMention(e?: any): boolean;
90
92
  canSetSubject(): boolean;
91
93
  canSetDescription(): boolean;