@wppconnect/wa-js 2.13.4 → 2.14.1
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 +5 -1
- package/dist/chat/functions/canReply.d.ts +27 -0
- package/dist/chat/functions/index.d.ts +1 -0
- package/dist/conn/functions/index.d.ts +1 -0
- package/dist/conn/functions/isRegistered.d.ts +24 -0
- package/dist/webpack/index.d.ts +14 -0
- package/dist/whatsapp/functions/canReplyMsg.d.ts +20 -0
- package/dist/whatsapp/functions/getSearchContext.d.ts +28 -0
- package/dist/whatsapp/functions/index.d.ts +3 -0
- package/dist/whatsapp/functions/isRegistered.d.ts +19 -0
- package/dist/whatsapp/misc/Cmd.d.ts +4 -3
- package/dist/whatsapp/models/ChatModel.d.ts +1 -2
- package/dist/whatsapp/models/MsgModel.d.ts +1 -1
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1 +1,5 @@
|
|
|
1
|
-
## 2.
|
|
1
|
+
## 2.14.1 (2022-11-01)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- Fixed WPP.chat.starMessage function (fix [#729](https://github.com/wppconnect-team/wa-js/issues/729)) ([bfa6969](https://github.com/wppconnect-team/wa-js/commit/bfa69697e8adbc8e2da82b4a9984d46daf01d79f))
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 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 { Stringable } from '../../types';
|
|
17
|
+
import { MsgKey, MsgModel } from '../../whatsapp';
|
|
18
|
+
/**
|
|
19
|
+
* Get if message can reply
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```javascript
|
|
23
|
+
* WPP.chat.canReply('[message_id]');
|
|
24
|
+
* ```
|
|
25
|
+
* @category Message
|
|
26
|
+
*/
|
|
27
|
+
export declare function canReply(messageId: string | MsgKey | MsgModel | Stringable): Promise<boolean>;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
export { archive, unarchive } from './archive';
|
|
17
17
|
export { canMarkPlayed } from './canMarkPlayed';
|
|
18
18
|
export { canMute } from './canMute';
|
|
19
|
+
export { canReply } from './canReply';
|
|
19
20
|
export { clear } from './clear';
|
|
20
21
|
export { delete } from './delete';
|
|
21
22
|
export { deleteMessage, DeleteMessageReturn } from './deleteMessage';
|
|
@@ -22,6 +22,7 @@ export { isIdle } from './isIdle';
|
|
|
22
22
|
export { isMainLoaded } from './isMainLoaded';
|
|
23
23
|
export { isMainReady } from './isMainReady';
|
|
24
24
|
export { isMultiDevice } from './isMultiDevice';
|
|
25
|
+
export { isRegistered } from './isRegistered';
|
|
25
26
|
export { logout } from './logout';
|
|
26
27
|
export { markAvailable, markUnavailable } from './markAvailable';
|
|
27
28
|
export { refreshQR } from './refreshQR';
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
* Check is the current browser is logged before loading
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* const isRegistered = WPP.conn.isRegistered();
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function isRegistered(): boolean;
|
package/dist/webpack/index.d.ts
CHANGED
|
@@ -40,6 +40,12 @@ export declare let webpackRequire: (<T = any>(moduleId: string) => T) & {
|
|
|
40
40
|
*/
|
|
41
41
|
e: (id: string) => Promise<void>;
|
|
42
42
|
};
|
|
43
|
+
/**
|
|
44
|
+
* Fallback modules for forward compatibility
|
|
45
|
+
*/
|
|
46
|
+
export declare const fallbackModules: {
|
|
47
|
+
[key: string]: any;
|
|
48
|
+
};
|
|
43
49
|
export declare function injectLoader(): void;
|
|
44
50
|
export declare function moduleSource(moduleId: string): any;
|
|
45
51
|
export declare function isReactComponent(moduleId: string): boolean | undefined;
|
|
@@ -63,3 +69,11 @@ export declare function search<T = any>(condition: SearchModuleCondition, revers
|
|
|
63
69
|
export declare function modules(condition?: SearchModuleCondition, reverse?: boolean): {
|
|
64
70
|
[key: string]: any;
|
|
65
71
|
};
|
|
72
|
+
export declare function loadModule<T = any>(moduleId: string): T;
|
|
73
|
+
/**
|
|
74
|
+
* Inject a new module content
|
|
75
|
+
* @param moduleId Module ID
|
|
76
|
+
* @param content The module content
|
|
77
|
+
* @returns
|
|
78
|
+
*/
|
|
79
|
+
export declare function injectFallbackModule(moduleId: number | string, content: any): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { MsgModel } from '../models';
|
|
17
|
+
/**
|
|
18
|
+
* @whatsapp 973480 >= 2.2241.6
|
|
19
|
+
*/
|
|
20
|
+
export declare function canReplyMsg(msg: MsgModel): boolean;
|
|
@@ -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
|
+
import { MsgKey, MsgLoad } from '../misc';
|
|
17
|
+
import { ChatModel, MsgModel } from '../models';
|
|
18
|
+
/**
|
|
19
|
+
* @whatsapp 738599 >= 2.2242.5
|
|
20
|
+
*/
|
|
21
|
+
export declare function getSearchContext(chat: ChatModel, msg: MsgModel | MsgKey, options?: {
|
|
22
|
+
isQuotedMsgAvailable: boolean;
|
|
23
|
+
}): {
|
|
24
|
+
collection: MsgLoad;
|
|
25
|
+
msg?: MsgModel;
|
|
26
|
+
key?: MsgKey;
|
|
27
|
+
highlightMsg: true;
|
|
28
|
+
};
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
export * from './addAndSendMsgToChat';
|
|
17
17
|
export * from './blockContact';
|
|
18
18
|
export * from './calculateFilehashFromBlob';
|
|
19
|
+
export * from './canReplyMsg';
|
|
19
20
|
export * from './collections';
|
|
20
21
|
export * from './createMsgProtobuf';
|
|
21
22
|
export * from './createOrUpdateReactions';
|
|
@@ -31,9 +32,11 @@ export * from './genMinimalLinkPreview';
|
|
|
31
32
|
export * from './getFanOutList';
|
|
32
33
|
export * from './getGroupSenderKeyList';
|
|
33
34
|
export * from './getOrGenerate';
|
|
35
|
+
export * from './getSearchContext';
|
|
34
36
|
export * from './groupParticipants';
|
|
35
37
|
export * from './handleAck';
|
|
36
38
|
export * from './isAuthenticated';
|
|
39
|
+
export * from './isRegistered';
|
|
37
40
|
export * from './markSeen';
|
|
38
41
|
export * from './mediaTypeFromProtobuf';
|
|
39
42
|
export * from './msgFindQuery';
|
|
@@ -0,0 +1,19 @@
|
|
|
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 673168
|
|
18
|
+
*/
|
|
19
|
+
export declare function isRegistered(): boolean;
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { ChatModel } from '..';
|
|
17
|
+
import { getSearchContext } from '../functions';
|
|
17
18
|
import { MsgModel } from '../models';
|
|
18
19
|
import { EventEmitter } from '.';
|
|
19
20
|
/** @whatsapp 88102
|
|
@@ -49,15 +50,15 @@ export declare class CmdClass extends EventEmitter {
|
|
|
49
50
|
openMediaViewerForAlbumMedia(e?: any): void;
|
|
50
51
|
productImageViewerModal(e?: any, t?: any): void;
|
|
51
52
|
ephemeralDrawer(e?: any, t?: any): void;
|
|
52
|
-
sendStarMsgs(
|
|
53
|
-
sendUnstarMsgs(
|
|
53
|
+
sendStarMsgs(chat: ChatModel, msgs: MsgModel[], id?: any, toastPosition?: any): void;
|
|
54
|
+
sendUnstarMsgs(chat: ChatModel, msgs: MsgModel[], id?: any, toastPosition?: any): void;
|
|
54
55
|
sendDeleteMsgs(chat: ChatModel, msgs: MsgModel[], clearMedia?: boolean, toastPosition?: any): void;
|
|
55
56
|
sendRevokeMsgs(chat: ChatModel, msgs: MsgModel[], options?: {
|
|
56
57
|
clearMedia?: boolean;
|
|
57
58
|
toastPosition?: any;
|
|
58
59
|
}): void;
|
|
59
60
|
_openChat(e?: any, t?: any): void;
|
|
60
|
-
openChatAt(chat: ChatModel, context: ReturnType<
|
|
61
|
+
openChatAt(chat: ChatModel, context: ReturnType<typeof getSearchContext>): Promise<boolean>;
|
|
61
62
|
openChatFromUnread(chat: ChatModel): Promise<boolean>;
|
|
62
63
|
openChatBottom(chat: ChatModel): Promise<boolean>;
|
|
63
64
|
scrollToPtt(e?: any): void;
|
|
@@ -131,7 +131,7 @@ export declare class ChatModel extends ModelChatBase {
|
|
|
131
131
|
loadEarlierMsgs(e?: any, t?: any): any;
|
|
132
132
|
isMostRecentCMC(e?: any): boolean;
|
|
133
133
|
loadRecentMsgs(e?: any): any;
|
|
134
|
-
getSearchContext(msg: MsgModel | MsgKey, options?: {
|
|
134
|
+
getSearchContext?(msg: MsgModel | MsgKey, options?: {
|
|
135
135
|
isQuotedMsgAvailable: boolean;
|
|
136
136
|
}): {
|
|
137
137
|
collection: MsgLoad;
|
|
@@ -139,7 +139,6 @@ export declare class ChatModel extends ModelChatBase {
|
|
|
139
139
|
key?: MsgKey;
|
|
140
140
|
highlightMsg: true;
|
|
141
141
|
};
|
|
142
|
-
sendStarMsgs(msgs: MsgModel[], star: boolean): any;
|
|
143
142
|
sendRevokeMsgs(messages: MsgModel[], deleteMediaInDevice?: boolean): Promise<SendMsgResult>;
|
|
144
143
|
sendRevokeMsgs(messages: MsgModel[], sender: string, deleteMediaInDevice?: boolean): Promise<SendMsgResult>;
|
|
145
144
|
sendDeleteMsgs(messages: MsgModel[], deleteMediaInDevice?: boolean): Promise<SendMsgResult>;
|
|
@@ -317,7 +317,7 @@ export declare class MsgModel extends Model {
|
|
|
317
317
|
hasSymbol(): boolean;
|
|
318
318
|
mayFail(): any;
|
|
319
319
|
isUnsentPhoneMsg(): boolean;
|
|
320
|
-
canReply(): boolean;
|
|
320
|
+
canReply?(): boolean;
|
|
321
321
|
canPrivateReply(): boolean;
|
|
322
322
|
canPrivateReplyInRestrictedGrp(): boolean;
|
|
323
323
|
canForward(): boolean;
|