@wppconnect/wa-js 1.1.4 → 1.1.5

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
+ ## 1.1.5 (2022-01-15)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Allow WPP.contact.queryExists to throw exception (wppconnect-team/wppconnect[#793](https://github.com/wppconnect-team/wa-js/issues/793)) ([7331aad](https://github.com/wppconnect-team/wa-js/commit/7331aadb06b77550ba0c959d29ba6118bb5fa0f2))
7
+
8
+
9
+
1
10
  ## 1.1.4 (2022-01-14)
2
11
 
3
12
 
@@ -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
+ * Check if is possible to mute this chat
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * const canMute = WPP.chat.canMute('<number>@c.us');
23
+ * ```
24
+ *
25
+ * @category Chat
26
+ */
27
+ export declare function canMute(chatId: string | Wid): boolean;
@@ -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 { canMute } from './canMute';
16
17
  export { clear } from './clear';
17
18
  export { delete } from './delete';
18
19
  export { deleteMessage, DeleteMessageReturn } from './deleteMessage';
@@ -27,6 +28,7 @@ export { markIsPaused } from './markIsPaused';
27
28
  export { markIsRead } from './markIsRead';
28
29
  export { markIsRecording } from './markIsRecording';
29
30
  export { markIsUnread } from './markIsUnread';
31
+ export { mute } from './mute';
30
32
  export { LinkPreviewOptions, prepareLinkPreview } from './prepareLinkPreview';
31
33
  export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageButtons';
32
34
  export { prepareRawMessage } from './prepareRawMessage';
@@ -35,3 +37,4 @@ export { ListMessageOptions, sendListMessage } from './sendListMessage';
35
37
  export { sendRawMessage } from './sendRawMessage';
36
38
  export { sendTextMessage, TextMessageOptions } from './sendTextMessage';
37
39
  export { sendVCardContactMessage, VCardContact, } from './sendVCardContactMessage';
40
+ export { unmute } from './unmute';
@@ -0,0 +1,45 @@
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
+ * Mute a chat, you can use duration or expiration
19
+ * For expiration, use unix timestamp (seconds only)
20
+ * For duration, use seconds
21
+ *
22
+ * @example
23
+ * ```javascript
24
+ * // Mute for 60 seconds
25
+ * WPP.chat.mute('<number>@c.us', {duration: 60});
26
+ *
27
+ * // Mute util 2021-01-01
28
+ * WPP.chat.mute('<number>@c.us', {expiration: 1641006000});
29
+ *
30
+ * // or using date
31
+ * const expiration = new Date('2022-01-01 00:00:00');
32
+ * WPP.chat.mute('<number>@c.us', {expiration: expiration});
33
+ * ```
34
+ *
35
+ * @category Chat
36
+ */
37
+ export declare function mute(chatId: string | Wid, time: {
38
+ expiration: number | Date;
39
+ } | {
40
+ duration: number;
41
+ }): Promise<{
42
+ wid: Wid;
43
+ expiration: number;
44
+ isMuted: boolean;
45
+ }>;
@@ -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
+ * Unmute a chat
19
+ *
20
+ * @example
21
+ * ```javascript
22
+ * WPP.chat.unmute('<number>@c.us');
23
+ * ```
24
+ *
25
+ * @category Chat
26
+ */
27
+ export declare function unmute(chatId: string | Wid): Promise<void>;
@@ -25,6 +25,7 @@ export * from './isAuthenticated';
25
25
  export * from './markSeen';
26
26
  export * from './msgFindQuery';
27
27
  export * from './products';
28
+ export * from './profilePic';
28
29
  export * from './randomId';
29
30
  export * from './sendClear';
30
31
  export * from './sendCreateGroup';
@@ -0,0 +1,21 @@
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
+ * This function can be used to define a group picture or self profile
19
+ * @whatsapp 2.2149.4:13729
20
+ */
21
+ export declare function sendSetPicture(chat: Wid, previewBase64: string, pictureBase64: string): Promise<void>;
@@ -18,4 +18,17 @@ import { Wid } from '..';
18
18
  export declare function sendQueryExists(contact: Wid): Promise<{
19
19
  wid: Wid;
20
20
  biz: boolean;
21
+ bizInfo?: {
22
+ verifiedName?: {
23
+ isApi: boolean;
24
+ level: string;
25
+ name: string;
26
+ privacyMode: any;
27
+ serial: string;
28
+ };
29
+ };
30
+ disappearingMode?: {
31
+ duration: number;
32
+ settingTimestamp: number;
33
+ };
21
34
  }>;
@@ -16,7 +16,7 @@
16
16
  import { ChatCollection } from '../collections';
17
17
  import { SendMsgResult } from '../enums';
18
18
  import { MsgKey, MsgLoad, Wid } from '../misc';
19
- import { GroupMetadataModel, MsgModel } from '.';
19
+ import { GroupMetadataModel, MsgModel, MuteModel } from '.';
20
20
  import { ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
21
21
  import { ModelChatBase, PropsChatBase, SessionChatBase } from './ModelChatBase';
22
22
  interface Props extends PropsChatBase {
@@ -66,7 +66,7 @@ interface Session extends SessionChatBase {
66
66
  quotedMsgAdminGroupJid?: any;
67
67
  groupMetadata?: GroupMetadataModel;
68
68
  presence?: any;
69
- mute?: any;
69
+ mute: MuteModel;
70
70
  contact?: any;
71
71
  liveLocation?: any;
72
72
  liveLocationQueried?: any;
@@ -18,7 +18,7 @@ import { Wid } from '../misc';
18
18
  import { Model, ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
19
19
  interface Props {
20
20
  id: Wid;
21
- expiration?: any;
21
+ expiration: number;
22
22
  }
23
23
  interface Session {
24
24
  stale?: any;
@@ -36,9 +36,9 @@ export declare class MuteModel extends Model<MuteCollection> {
36
36
  allowedIds?: any;
37
37
  constructor(proterties?: ModelPropertiesContructor<MuteModel>, options?: ModelOptions);
38
38
  setMute(e?: any, t?: any): any;
39
- mute(e?: any, t?: any, r?: any): any;
39
+ mute(expiration: number, sendAction?: boolean, sequence?: number): Promise<number>;
40
40
  canMute(): boolean;
41
- unmute(e?: any, t?: any): any;
41
+ unmute(sendAction?: boolean, sequence?: number): Promise<void>;
42
42
  getCollection(): MuteCollection;
43
43
  }
44
44
  export {};