@wppconnect/wa-js 3.1.0 → 3.2.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,9 +1,9 @@
1
- # 3.1.0 (2024-03-28)
1
+ # 3.2.0 (2024-04-25)
2
2
 
3
3
 
4
- ### Reverts
4
+ ### Features
5
5
 
6
- * Added template to changelog ([9ebf70b](https://github.com/wppconnect-team/wa-js/commit/9ebf70b6defd370eba39cc5786bcc49df6cb5b2a))
6
+ * Added WPP.newsletter.getSubscribers function ([#1861](https://github.com/wppconnect-team/wa-js/issues/1861)) (close [#1746](https://github.com/wppconnect-team/wa-js/issues/1746)) ([31bdbb5](https://github.com/wppconnect-team/wa-js/commit/31bdbb5ea4aa94183b03ab0f636700d0f677aa08))
7
7
 
8
8
 
9
9
 
package/README.md CHANGED
@@ -54,7 +54,7 @@ npm run wa-source
54
54
  # build javascript files
55
55
  npm run build:prd # or build:dev for development
56
56
 
57
- # lauch a local browser with automatic injection
57
+ # launch a local browser with automatic injection
58
58
  npm run launch:local
59
59
 
60
60
  # or only run in VSCode
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2023 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 @@ export interface ChatListOptions {
20
20
  direction?: 'after' | 'before';
21
21
  onlyCommunities?: boolean;
22
22
  onlyGroups?: boolean;
23
+ onlyNewsletter?: boolean;
23
24
  onlyUsers?: boolean;
24
25
  onlyWithUnreadMessage?: boolean;
25
26
  withLabels?: string[];
@@ -47,6 +48,9 @@ export interface ChatListOptions {
47
48
  * // Only communities chats
48
49
  * const chats = await WPP.chat.list({onlyCommunities: true});
49
50
  *
51
+ * // Only Newsletter
52
+ * const chats = await WPP.chat.list({onlyNewsletter: true});
53
+ *
50
54
  * // Only with label Text
51
55
  * const chats = await WPP.chat.list({withLabels: ['Test']});
52
56
  *
@@ -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,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,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
+ }>;
@@ -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 WAWebPollsVotesSchema => 2.3000.x
18
+ */
19
+ export declare function getTableVotes(args?: any): any;
@@ -58,6 +58,7 @@ export * from './getGroupSenderKeyList';
58
58
  export * from './getGroupSizeLimit';
59
59
  export * from './getHistorySyncProgress';
60
60
  export * from './getMembershipApprovalRequests';
61
+ export * from './getNewsletterSubscribers';
61
62
  export * from './getNextLabelId';
62
63
  export * from './getNumChatsPinned';
63
64
  export * from './getOrderInfo';
@@ -66,6 +67,7 @@ export * from './getPushname';
66
67
  export * from './getQuotedMsgObj';
67
68
  export * from './getReactions';
68
69
  export * from './getSearchContext';
70
+ export * from './getTableVotes';
69
71
  export * from './getVotes';
70
72
  export * from './getWhatsAppWebExternalBetaJoinedIdb';
71
73
  export * from './GROUP_JID';
@@ -132,3 +134,4 @@ export * from './uploadMedia';
132
134
  export * from './uploadProductImage';
133
135
  export * from './uploadThumbnail';
134
136
  export * from './upsertVotes';
137
+ export * from './voteFromDbRow';
@@ -13,12 +13,15 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
+ import { MsgModel } from '../models';
16
17
  /** @whatsapp 397995
17
18
  */
18
19
  export declare function sendNewsletterMessageJob(data: {
19
- msgData: any;
20
+ msgData?: any;
21
+ msg?: MsgModel;
20
22
  newsletterJid: string;
21
23
  type: string;
24
+ editType?: 'media' | 'text';
22
25
  }): Promise<{
23
26
  ack: {
24
27
  t: number;
@@ -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 WAWebPollsDbSerialization >= 2.3000.x
19
+ */
20
+ export declare function voteFromDbRow(msg: MsgModel): Promise<any>;