@wppconnect/wa-js 2.5.0 → 2.7.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,3 +1,30 @@
1
+ # 2.7.0 (2022-06-15)
2
+
3
+
4
+ ### Features
5
+
6
+ * Added Google Analytics ([946cc80](https://github.com/wppconnect-team/wa-js/commit/946cc80b691adcc2818a0702b821898f73311df7))
7
+
8
+
9
+
10
+ # 2.6.0 (2022-06-08)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Fixed doc type for WPP.chat.sendFileMessage ([7701d88](https://github.com/wppconnect-team/wa-js/commit/7701d882df10e87e2ac477805f97a5984dd14870))
16
+
17
+
18
+
19
+ ## 2.5.1 (2022-06-06)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * Fixed revoke messages for list type ([7938ae7](https://github.com/wppconnect-team/wa-js/commit/7938ae7dab6bfa9e44f68f78dab01bbeeeeca0b6))
25
+
26
+
27
+
1
28
  # 2.5.0 (2022-06-04)
2
29
 
3
30
 
@@ -0,0 +1,56 @@
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 { Wid } from '../../whatsapp';
17
+ export interface CallEventTypes {
18
+ /**
19
+ * Triggered when you a incoming call
20
+ *
21
+ * @example
22
+ * ```javascript
23
+ * WPP.on('call.incoming_call', (call) => {
24
+ * // Your code
25
+ * //Example: Reject any incoming call
26
+ * WPP.call.rejectCall(call.id);
27
+ * });
28
+ * ```
29
+ */
30
+ 'call.incoming_call': {
31
+ /**
32
+ * The call id
33
+ */
34
+ id: string;
35
+ /**
36
+ * Is a call from a group
37
+ */
38
+ isGroup: boolean;
39
+ /**
40
+ * Is call with video
41
+ */
42
+ isVideo: boolean;
43
+ /**
44
+ * timestamp of offer
45
+ */
46
+ offerTime: number;
47
+ /**
48
+ * Wid of sender without device id
49
+ */
50
+ sender: Wid;
51
+ /**
52
+ * Wid of sender with device id
53
+ */
54
+ peerJid: Wid;
55
+ };
56
+ }
@@ -0,0 +1,16 @@
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 './registerIncomingCallEvent';
@@ -0,0 +1,16 @@
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
+ export {};
@@ -0,0 +1,16 @@
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
+ export { rejectCall } from './rejectCall';
@@ -0,0 +1,36 @@
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
+ * Reject a incoming call
18
+ *
19
+ * @example
20
+ * ```javascript
21
+ * // Reject any incoming call
22
+ * WPP.call.rejectCall();
23
+ *
24
+ * // Reject specific call id
25
+ * WPP.call.rejectCall(callId);
26
+ *
27
+ * // Reject any incoming call
28
+ * WPP.on('call.incoming_call', (call) => {
29
+ * WPP.call.rejectCall(call.id);
30
+ * });
31
+ * ```
32
+ *
33
+ * @param {string} callId The call ID, empty to reject the first one
34
+ * @return {[type]} [return description]
35
+ */
36
+ export declare function rejectCall(callId?: string): Promise<boolean>;
@@ -0,0 +1,17 @@
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 './events';
17
+ export * from './functions';
@@ -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
+ /**
17
+ * Get your current catalog
18
+ *
19
+ * @example
20
+ * ```javascript
21
+ * // Get your current catalog
22
+ * const myCatalog = await WPP.catalog.getMyCatalog();
23
+ * ```
24
+ *
25
+ * @return Your current catalog
26
+ */
27
+ export declare function getMyCatalog(): Promise<import("../../whatsapp").CatalogModel | undefined>;
@@ -0,0 +1,16 @@
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
+ export { getMyCatalog } from './getMyCatalog';
@@ -0,0 +1,16 @@
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
+ export * from './functions';
@@ -19,6 +19,7 @@ export interface GetMessagesOptions {
19
19
  count?: number;
20
20
  direction?: 'after' | 'before';
21
21
  id?: string;
22
+ onlyUnread?: boolean;
22
23
  }
23
24
  /**
24
25
  * Fetch messages from a chat
@@ -35,6 +36,18 @@ export interface GetMessagesOptions {
35
36
  * count: -1,
36
37
  * });
37
38
  *
39
+ * // Last 20 unread messages
40
+ * WPP.chat.getMessages('[number]@c.us', {
41
+ * count: 20,
42
+ * onlyUnread: true,
43
+ * });
44
+ *
45
+ * // All unread messages
46
+ * WPP.chat.getMessages('[number]@c.us', {
47
+ * count: -1,
48
+ * onlyUnread: true,
49
+ * });
50
+ *
38
51
  * // 20 messages before specific message
39
52
  * WPP.chat.getMessages('[number]@c.us', {
40
53
  * count: 20,
@@ -16,7 +16,7 @@
16
16
  import { SendMessageOptions, SendMessageReturn } from '..';
17
17
  import { MessageButtonsOptions } from '.';
18
18
  export interface FileMessageOptions extends SendMessageOptions {
19
- type: string;
19
+ type?: string;
20
20
  caption?: string;
21
21
  footer?: string;
22
22
  filename?: string;
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  /**
17
- * Check is main interface is loaded and authenticated
17
+ * Check is main interface is authenticated and loaded, bot not synced
18
18
  *
19
19
  * @example
20
20
  * ```javascript
@@ -0,0 +1,24 @@
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
+ /**
17
+ * Check is main interface is authenticated, loaded and synced
18
+ *
19
+ * @example
20
+ * ```javascript
21
+ * const isMainReady = WPP.conn.isMainReady();
22
+ * ```
23
+ */
24
+ export declare function isMainReady(): boolean;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright 2021 WPPConnect Team
2
+ * Copyright 2022 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.
@@ -14,13 +14,15 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  import { BlocklistEventTypes } from '../blocklist/events/eventTypes';
17
+ import { CallEventTypes } from '../call/events/eventTypes';
17
18
  import { ChatEventTypes } from '../chat/events/eventTypes';
18
19
  import { ConnEventTypes } from '../conn/events/eventTypes';
19
20
  import { StatusEventTypes } from '../status/events/eventTypes';
20
21
  import { WebpackEvents } from '../webpack/eventTypes';
21
22
  export { BlocklistEventTypes } from '../blocklist/events/eventTypes';
23
+ export { CallEventTypes } from '../call/events/eventTypes';
22
24
  export { ChatEventTypes } from '../chat/events/eventTypes';
23
25
  export { ConnEventTypes } from '../conn/events/eventTypes';
24
26
  export { StatusEventTypes } from '../status/events/eventTypes';
25
27
  export { WebpackEvents } from '../webpack/eventTypes';
26
- export declare type EventTypes = BlocklistEventTypes & ChatEventTypes & ConnEventTypes & StatusEventTypes & WebpackEvents;
28
+ export declare type EventTypes = BlocklistEventTypes & CallEventTypes & ChatEventTypes & ConnEventTypes & StatusEventTypes & WebpackEvents;