@wppconnect/wa-js 2.22.1 → 2.23.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 +1 -1
- package/dist/call/functions/accept.d.ts +38 -0
- package/dist/call/functions/end.d.ts +36 -0
- package/dist/call/functions/index.d.ts +4 -1
- package/dist/call/functions/offer.d.ts +33 -0
- package/dist/call/functions/parseRelayResponse.d.ts +31 -0
- package/dist/call/functions/prepareDestination.d.ts +17 -0
- package/dist/call/functions/{rejectCall.d.ts → reject.d.ts} +4 -4
- package/dist/chat/functions/downloadMedia.d.ts +8 -0
- package/dist/config/Config.d.ts +5 -0
- package/dist/status/index.d.ts +1 -0
- package/dist/status/patch.d.ts +16 -0
- package/dist/whatsapp/collections/StatusV3Collection.d.ts +4 -2
- package/dist/whatsapp/functions/createFanoutMsgStanza.d.ts +24 -0
- package/dist/whatsapp/functions/encryptMsgProtobuf.d.ts +23 -0
- package/dist/whatsapp/functions/getVotes.d.ts +1 -1
- package/dist/whatsapp/functions/handleSingleMsg.d.ts +21 -0
- package/dist/whatsapp/functions/index.d.ts +4 -1
- package/dist/whatsapp/websocket/WapNode.d.ts +1 -1
- package/dist/wppconnect-wa.js +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
# 2.23.0 (2023-04-01)
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
* Accept a incoming call
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // Accept any incoming call
|
|
22
|
+
* WPP.call.accept();
|
|
23
|
+
*
|
|
24
|
+
* // Accept specific call id
|
|
25
|
+
* WPP.call.accept(callId);
|
|
26
|
+
*
|
|
27
|
+
* // Accept any incoming call
|
|
28
|
+
* WPP.on('call.incoming_call', (call) => {
|
|
29
|
+
* setTimeout(() => {
|
|
30
|
+
* WPP.call.accept(call.id);
|
|
31
|
+
* }, 1000);
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param {string} callId The call ID, empty to accept the first one
|
|
36
|
+
* @return {[type]} [return description]
|
|
37
|
+
*/
|
|
38
|
+
export declare function accept(callId?: string): Promise<boolean>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 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
|
+
* End a outcoming call
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```javascript
|
|
21
|
+
* // End any outcoming call
|
|
22
|
+
* WPP.call.end();
|
|
23
|
+
*
|
|
24
|
+
* // End specific call id
|
|
25
|
+
* WPP.call.end(callId);
|
|
26
|
+
*
|
|
27
|
+
* // End any outcoming call
|
|
28
|
+
* WPP.on('call.outcoming_call', (call) => {
|
|
29
|
+
* WPP.call.end(call.id);
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @param {string} callId The call ID, empty to end the first one
|
|
34
|
+
* @return {[type]} [return description]
|
|
35
|
+
*/
|
|
36
|
+
export declare function end(callId?: string): Promise<boolean>;
|
|
@@ -13,4 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
16
|
+
export { accept } from './accept';
|
|
17
|
+
export { end } from './end';
|
|
18
|
+
export { offer } from './offer';
|
|
19
|
+
export { reject, reject as rejectCall } from './reject';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 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
|
+
export interface CallOfferOptions {
|
|
18
|
+
isVideo?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Send a call offer
|
|
22
|
+
*
|
|
23
|
+
* This method only will send a call offer, but there are no audio/video
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```javascript
|
|
27
|
+
* // Send a call offer
|
|
28
|
+
* WPP.call.offer('[number]@c.us');
|
|
29
|
+
* // Send a video call offer
|
|
30
|
+
* WPP.call.offer('[number]@c.us', {isVideo: true});
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function offer(to: string | Wid, options?: CallOfferOptions): Promise<any>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 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 { websocket } from '../../whatsapp';
|
|
17
|
+
export declare function parseRelayResponse(response: websocket.WapNode): {
|
|
18
|
+
rte: {
|
|
19
|
+
ip: number[];
|
|
20
|
+
port: number;
|
|
21
|
+
} | null;
|
|
22
|
+
key: string;
|
|
23
|
+
relays: {
|
|
24
|
+
[key: string]: {
|
|
25
|
+
ip: number[];
|
|
26
|
+
port: number;
|
|
27
|
+
relay_id: string;
|
|
28
|
+
token: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 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 { websocket, Wid } from '../../whatsapp';
|
|
17
|
+
export declare function prepareDestionation(wids: Wid[], encKey: ArrayBufferLike): Promise<websocket.WapNode[]>;
|
|
@@ -19,18 +19,18 @@
|
|
|
19
19
|
* @example
|
|
20
20
|
* ```javascript
|
|
21
21
|
* // Reject any incoming call
|
|
22
|
-
* WPP.call.
|
|
22
|
+
* WPP.call.reject();
|
|
23
23
|
*
|
|
24
24
|
* // Reject specific call id
|
|
25
|
-
* WPP.call.
|
|
25
|
+
* WPP.call.reject(callId);
|
|
26
26
|
*
|
|
27
27
|
* // Reject any incoming call
|
|
28
28
|
* WPP.on('call.incoming_call', (call) => {
|
|
29
|
-
* WPP.call.
|
|
29
|
+
* WPP.call.reject(call.id);
|
|
30
30
|
* });
|
|
31
31
|
* ```
|
|
32
32
|
*
|
|
33
33
|
* @param {string} callId The call ID, empty to reject the first one
|
|
34
34
|
* @return {[type]} [return description]
|
|
35
35
|
*/
|
|
36
|
-
export declare function
|
|
36
|
+
export declare function reject(callId?: string): Promise<boolean>;
|
|
@@ -16,6 +16,14 @@
|
|
|
16
16
|
/**
|
|
17
17
|
* Download the blob of a media message
|
|
18
18
|
*
|
|
19
|
+
* ```javascript
|
|
20
|
+
* // Get a blob file
|
|
21
|
+
* await WPP.chat.downloadMedia('true_[number]@c.us_ABCDEF');
|
|
22
|
+
*
|
|
23
|
+
* // Get a base64Content
|
|
24
|
+
* await WPP.chat.downloadMedia('true_[number]@c.us_ABCDEF').then(WPP.util.blobToBase64);
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
19
27
|
* @category Message
|
|
20
28
|
*/
|
|
21
29
|
export declare function downloadMedia(id: string): Promise<Blob>;
|
package/dist/config/Config.d.ts
CHANGED
package/dist/status/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 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
|
+
export {};
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import { RawMessage } from '../../chat';
|
|
17
|
+
import { Wid } from '../misc';
|
|
16
18
|
import { StatusV3Model } from '../models';
|
|
17
19
|
import { BaseCollection } from '.';
|
|
18
20
|
/** @whatsapp 59387
|
|
@@ -24,9 +26,9 @@ export declare class StatusV3Collection extends BaseCollection<StatusV3Model> {
|
|
|
24
26
|
sync(e?: any): any;
|
|
25
27
|
logMetrics(e?: any): any;
|
|
26
28
|
hasSynced(): boolean;
|
|
27
|
-
handleUpdate(rawMsg?:
|
|
29
|
+
handleUpdate(rawMsg?: RawMessage, checksum?: any, isMsgUpdate?: boolean): any;
|
|
28
30
|
updateChecksum(e?: any): any;
|
|
29
|
-
addStatusMessages(
|
|
31
|
+
addStatusMessages(wid: Wid, msgs: RawMessage[]): any;
|
|
30
32
|
getUnexpired(e?: any): any;
|
|
31
33
|
getMyStatus(): StatusV3Model;
|
|
32
34
|
static comparator(): any;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 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, websocket, Wid } from '..';
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare function createFanoutMsgStanza(msg: MsgModel, proto: {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}, devices: Wid[], options: {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}): Promise<websocket.WapNode>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 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 309029 >= 2.2312.7
|
|
19
|
+
*/
|
|
20
|
+
export declare function encryptMsgProtobuf(wid: Wid, retryCount: number, protoMessage: any): Promise<{
|
|
21
|
+
type: string;
|
|
22
|
+
ciphertext: Uint8Array;
|
|
23
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 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 { RawMessage } from '../../chat';
|
|
17
|
+
import { Wid } from '../misc';
|
|
18
|
+
/**
|
|
19
|
+
* @whatsapp 359554 >= 2.2230.8
|
|
20
|
+
*/
|
|
21
|
+
export declare function handleSingleMsg(wid: Wid, msg: RawMessage, type: string, update: boolean, preserveOrder: boolean): Promise<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2023 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.
|
|
@@ -19,6 +19,7 @@ export * from './calculateFilehashFromBlob';
|
|
|
19
19
|
export * from './canEditMsg';
|
|
20
20
|
export * from './canReplyMsg';
|
|
21
21
|
export * from './collections';
|
|
22
|
+
export * from './createFanoutMsgStanza';
|
|
22
23
|
export * from './createGroup';
|
|
23
24
|
export * from './createMsgProtobuf';
|
|
24
25
|
export * from './createOrUpdateReactions';
|
|
@@ -26,6 +27,7 @@ export * from './editBusinessProfile';
|
|
|
26
27
|
export * from './encodeMaybeMediaType';
|
|
27
28
|
export * from './encryptAndSendGroupMsg';
|
|
28
29
|
export * from './encryptAndSendMsg';
|
|
30
|
+
export * from './encryptMsgProtobuf';
|
|
29
31
|
export * from './fetchLinkPreview';
|
|
30
32
|
export * from './findChat';
|
|
31
33
|
export * from './findFirstWebLink';
|
|
@@ -43,6 +45,7 @@ export * from './getSearchContext';
|
|
|
43
45
|
export * from './getVotes';
|
|
44
46
|
export * from './groupParticipants';
|
|
45
47
|
export * from './handleAck';
|
|
48
|
+
export * from './handleSingleMsg';
|
|
46
49
|
export * from './isAnimatedWebp';
|
|
47
50
|
export * from './isAuthenticated';
|
|
48
51
|
export * from './isRegistered';
|