@wppconnect/wa-js 3.0.1 → 3.1.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 +3 -3
- package/dist/chat/functions/index.d.ts +1 -0
- package/dist/chat/functions/pinMsg.d.ts +60 -0
- package/dist/whatsapp/collections/PinInChatCollection.d.ts +29 -0
- package/dist/whatsapp/collections/index.d.ts +1 -0
- package/dist/whatsapp/enums/PIN_STATE.d.ts +22 -0
- package/dist/whatsapp/enums/index.d.ts +1 -0
- package/dist/whatsapp/functions/index.d.ts +2 -0
- package/dist/whatsapp/functions/isLegitErrorStack.d.ts +19 -0
- package/dist/whatsapp/functions/sendPinInChatMsg.d.ts +25 -0
- package/dist/whatsapp/misc/IsOfficialClient.d.ts +0 -1
- package/dist/whatsapp/models/MuteModel.d.ts +9 -3
- package/dist/whatsapp/models/PinInChatModel.d.ts +50 -0
- package/dist/whatsapp/stores.d.ts +1 -0
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
# 3.1.0 (2024-03-28)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Reverts
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* Added template to changelog ([9ebf70b](https://github.com/wppconnect-team/wa-js/commit/9ebf70b6defd370eba39cc5786bcc49df6cb5b2a))
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -49,6 +49,7 @@ export { openChatAt } from './openChatAt';
|
|
|
49
49
|
export { openChatBottom } from './openChatBottom';
|
|
50
50
|
export { openChatFromUnread } from './openChatFromUnread';
|
|
51
51
|
export { pin, unpin } from './pin';
|
|
52
|
+
export { pinMsg, unpinMsg } from './pinMsg';
|
|
52
53
|
export { LinkPreviewOptions, prepareLinkPreview } from './prepareLinkPreview';
|
|
53
54
|
export { MessageButtonsOptions, prepareMessageButtons, } from './prepareMessageButtons';
|
|
54
55
|
export { prepareRawMessage } from './prepareRawMessage';
|
|
@@ -0,0 +1,60 @@
|
|
|
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 { MsgKey, MsgModel } from '../../whatsapp';
|
|
17
|
+
import { SendMsgResult } from '../../whatsapp/enums';
|
|
18
|
+
/**
|
|
19
|
+
* Pin a message in chat
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```javascript
|
|
23
|
+
* // Pin a message in chat
|
|
24
|
+
* WPP.chat.pinMsg('true_[number]@c.us_ABCDEF');
|
|
25
|
+
*
|
|
26
|
+
* // Pin a message in chat for 30 days
|
|
27
|
+
* WPP.chat.pinMsg('true_[number]@c.us_ABCDEF', 2592000);
|
|
28
|
+
*
|
|
29
|
+
* // Unpin a message
|
|
30
|
+
* WPP.chat.pinMsg('true_[number]@c.us_ABCDEF', false);
|
|
31
|
+
* // or
|
|
32
|
+
* WPP.chat.unpinMsg('true_[number]@c.us_ABCDEF');
|
|
33
|
+
* ```
|
|
34
|
+
* @category Chat
|
|
35
|
+
*/
|
|
36
|
+
export declare function pinMsg(msgId: string | MsgKey, pin?: boolean, seconds?: number): Promise<{
|
|
37
|
+
message: MsgModel;
|
|
38
|
+
pinned: boolean;
|
|
39
|
+
result: SendMsgResult;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Unpin a message in chat
|
|
43
|
+
*
|
|
44
|
+
* @alias pin
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```javascript
|
|
48
|
+
* // Unpin a message
|
|
49
|
+
* WPP.chat.unpinMsg('true_[number]@c.us_ABCDEF');
|
|
50
|
+
*
|
|
51
|
+
* // Alias for
|
|
52
|
+
* WPP.chat.pinMsg('true_[number]@c.us_ABCDEF', false);
|
|
53
|
+
* ```
|
|
54
|
+
* @category Chat
|
|
55
|
+
*/
|
|
56
|
+
export declare function unpinMsg(msgId: string | MsgKey): Promise<{
|
|
57
|
+
message: MsgModel;
|
|
58
|
+
pinned: boolean;
|
|
59
|
+
result: SendMsgResult;
|
|
60
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
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 { PinInChatModel } from '../models/PinInChatModel';
|
|
17
|
+
import { Collection } from './Collection';
|
|
18
|
+
/**
|
|
19
|
+
* @whatsapp WAWebPinInChatCollection >= 2.3000.1012170943
|
|
20
|
+
*/
|
|
21
|
+
export declare class PinInChatCollection extends Collection<PinInChatModel> {
|
|
22
|
+
static model: PinInChatModel;
|
|
23
|
+
static cachePolicy?: any;
|
|
24
|
+
deleteByParentMessageKey(a?: any): any;
|
|
25
|
+
getByMsgKey(a?: any): PinInChatModel;
|
|
26
|
+
getByParentMsgKey(a?: any): PinInChatModel;
|
|
27
|
+
byChatId(a?: any): PinInChatModel[];
|
|
28
|
+
byIsFailedByMe(a?: any): any;
|
|
29
|
+
}
|
|
@@ -40,6 +40,7 @@ export * from './MuteCollection';
|
|
|
40
40
|
export * from './OrderCollection';
|
|
41
41
|
export * from './OrderItemCollection';
|
|
42
42
|
export * from './ParticipantCollection';
|
|
43
|
+
export * from './PinInChatCollection';
|
|
43
44
|
export * from './PresenceCollection';
|
|
44
45
|
export * from './ProductCollCollection';
|
|
45
46
|
export * from './ProductCollection';
|
|
@@ -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
|
+
/** @whatsapp WAWebPinMsgConstants >= 2.3000.1012170943
|
|
17
|
+
*/
|
|
18
|
+
export declare enum PIN_STATE {
|
|
19
|
+
INVALID = 0,
|
|
20
|
+
PIN = 1,
|
|
21
|
+
UNPIN = 2
|
|
22
|
+
}
|
|
@@ -75,6 +75,7 @@ export * from './handleSingleMsg';
|
|
|
75
75
|
export * from './initializeAltDeviceLinking';
|
|
76
76
|
export * from './isAnimatedWebp';
|
|
77
77
|
export * from './isAuthenticated';
|
|
78
|
+
export * from './isLegitErrorStack';
|
|
78
79
|
export * from './isRegistered';
|
|
79
80
|
export * from './isUnreadTypeMsg';
|
|
80
81
|
export * from './joinGroupViaInvite';
|
|
@@ -107,6 +108,7 @@ export * from './sendExitGroup';
|
|
|
107
108
|
export * from './sendGroupParticipants';
|
|
108
109
|
export * from './sendJoinGroupViaInvite';
|
|
109
110
|
export * from './sendNewsletterMessageJob';
|
|
111
|
+
export * from './sendPinInChatMsg';
|
|
110
112
|
export * from './sendQueryExists';
|
|
111
113
|
export * from './sendQueryGroupInvite';
|
|
112
114
|
export * from './sendQueryGroupInviteCode';
|
|
@@ -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 525438
|
|
18
|
+
*/
|
|
19
|
+
export declare function isLegitErrorStack(): boolean;
|
|
@@ -0,0 +1,25 @@
|
|
|
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 { SendMsgResult } from '../enums';
|
|
17
|
+
import { PIN_STATE } from '../enums/PIN_STATE';
|
|
18
|
+
import { MsgModel } from '../models';
|
|
19
|
+
/** @whatsapp WAWebSendPinMessageAction >= 2.3000.1012170943
|
|
20
|
+
*/
|
|
21
|
+
export declare function sendPinInChatMsg(msg: MsgModel, type: PIN_STATE, time?: number, d?: any): Promise<{
|
|
22
|
+
count: number;
|
|
23
|
+
messageSendResult: SendMsgResult;
|
|
24
|
+
t: number;
|
|
25
|
+
}>;
|
|
@@ -39,10 +39,16 @@ export declare class MuteModel extends Model<MuteCollection> {
|
|
|
39
39
|
idClass: typeof Wid;
|
|
40
40
|
allowedIds?: any;
|
|
41
41
|
constructor(proterties?: ModelPropertiesContructor<MuteModel>, options?: ModelOptions);
|
|
42
|
-
setMute(
|
|
43
|
-
mute(
|
|
42
|
+
setMute(expiration?: number, isAutoMuted?: boolean, sendDevice?: boolean): any;
|
|
43
|
+
mute(args: {
|
|
44
|
+
expiration: number;
|
|
45
|
+
sendDevice?: boolean;
|
|
46
|
+
isAutoMuted?: boolean;
|
|
47
|
+
}): Promise<number>;
|
|
44
48
|
canMute(): boolean;
|
|
45
|
-
unmute(
|
|
49
|
+
unmute(args: {
|
|
50
|
+
sendDevice?: boolean;
|
|
51
|
+
}): Promise<void>;
|
|
46
52
|
getCollection(): MuteCollection;
|
|
47
53
|
}
|
|
48
54
|
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
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 { CartCollection } from '../collections';
|
|
17
|
+
import { PinInChatCollection } from '../collections/PinInChatCollection';
|
|
18
|
+
import { MsgKey, Wid } from '../misc';
|
|
19
|
+
import { Model, ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
|
|
20
|
+
interface Props {
|
|
21
|
+
msgKey: MsgKey;
|
|
22
|
+
parentMsgKey: MsgKey;
|
|
23
|
+
senderTimestampMs: number;
|
|
24
|
+
t: number;
|
|
25
|
+
sender: Wid;
|
|
26
|
+
chatId: Wid;
|
|
27
|
+
pinType: number;
|
|
28
|
+
pinExpiryDuration: number;
|
|
29
|
+
id: MsgKey;
|
|
30
|
+
read: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface Session {
|
|
33
|
+
}
|
|
34
|
+
interface Derived {
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* @whatsapp WAWebPinInChatModel >= 2.3000.1012170943
|
|
38
|
+
*/
|
|
39
|
+
export declare interface PinInChatModel extends ModelProxy<Props, Session, Derived> {
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @whatsapp WAWebPinInChatModel >= 2.3000.1012170943
|
|
43
|
+
*/
|
|
44
|
+
export declare class PinInChatModel extends Model<CartCollection> {
|
|
45
|
+
constructor(proterties?: ModelPropertiesContructor<PinInChatModel>, options?: ModelOptions);
|
|
46
|
+
deleteByParentMessageKey(): void;
|
|
47
|
+
getByMsgKey(): CartCollection;
|
|
48
|
+
getByParentMsgKey(): PinInChatCollection;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -125,3 +125,4 @@ export declare const StickerPackStore: collections.StickerPackCollection;
|
|
|
125
125
|
* @whatsapp 545068 >= 2.2222.8
|
|
126
126
|
*/
|
|
127
127
|
export declare const StickerSearchStore: collections.StickerSearchCollection;
|
|
128
|
+
export declare const PinInChatStore: collections.PinInChatCollection;
|