@wppconnect/wa-js 2.13.3 → 2.14.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,5 +1,5 @@
1
- ## 2.13.3 (2022-10-17)
1
+ # 2.14.0 (2022-10-30)
2
2
 
3
- ### Bug Fixes
3
+ ### Features
4
4
 
5
- - Fixed generated message ID for groups ([aceeb89](https://github.com/wppconnect-team/wa-js/commit/aceeb896886565708095f307f2ed621148b58571))
5
+ - Added WPP.conn.isRegistered function ([44c4664](https://github.com/wppconnect-team/wa-js/commit/44c46649047464c230565ca143418e72417bea99))
@@ -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';
@@ -13,25 +13,12 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- import { Wid } from '.';
17
- /** @whatsapp 86875
18
- * @whatsapp 56891 >= 2.2212.8
19
- * @whatsapp 656891 >= 2.2222.8
20
- */
21
- export declare class WapClass {
22
- queryExist(contactId: string): Promise<{
23
- status: 200;
24
- jid: Wid;
25
- biz?: true;
26
- }>;
27
- queryDisappearingMode(contactId: Wid): Promise<{
28
- status: 200;
29
- duration: number;
30
- settingTimestamp: number;
31
- }>;
32
- }
33
- /** @whatsapp 86875
34
- * @whatsapp 56891 >= 2.2212.8
35
- * @whatsapp 656891 >= 2.2222.8
16
+ /**
17
+ * Check is the current browser is logged before loading
18
+ *
19
+ * @example
20
+ * ```javascript
21
+ * const isRegistered = WPP.conn.isRegistered();
22
+ * ```
36
23
  */
37
- export declare const Wap: WapClass;
24
+ export declare function isRegistered(): boolean;
@@ -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;
@@ -13,7 +13,8 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- /** @whatsapp 88555 */
17
- export declare function isMDBackend(): boolean;
18
- /** @whatsapp 88555 */
19
- export declare function isLegacyWebdBackend(): boolean;
16
+ import { MsgModel } from '../models';
17
+ /**
18
+ * @whatsapp 973480 >= 2.2241.6
19
+ */
20
+ export declare function canReplyMsg(msg: MsgModel): boolean;
@@ -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';
@@ -34,7 +35,7 @@ export * from './getOrGenerate';
34
35
  export * from './groupParticipants';
35
36
  export * from './handleAck';
36
37
  export * from './isAuthenticated';
37
- export * from './isMDBackend';
38
+ export * from './isRegistered';
38
39
  export * from './markSeen';
39
40
  export * from './mediaTypeFromProtobuf';
40
41
  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;
@@ -37,6 +37,5 @@ export * from './Socket';
37
37
  export * from './Stream';
38
38
  export * from './UserPrefs';
39
39
  export * from './VCard';
40
- export * from './Wap';
41
40
  export * from './Wid';
42
41
  export * from './WidFactory';
@@ -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;