@wppconnect-team/wppconnect 1.9.3 → 1.9.4
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 +4 -0
- package/dist/api/layers/sender.layer.d.ts +32 -0
- package/dist/api/layers/sender.layer.js +43 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +0 -16
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ListMessageOptions } from '@wppconnect/wa-js/dist/chat';
|
|
1
2
|
import { Page } from 'puppeteer';
|
|
2
3
|
import { CreateConfig } from '../../config/create-config';
|
|
3
4
|
import { Message, SendFileResult, SendLinkResult, SendStickerResult } from '../model';
|
|
@@ -225,6 +226,37 @@ export declare class SenderLayer extends ListenerLayer {
|
|
|
225
226
|
* @category Chat
|
|
226
227
|
*/
|
|
227
228
|
sendMentioned(to: string, message: string, mentioned: string[]): Promise<void>;
|
|
229
|
+
/**
|
|
230
|
+
* Sends a list message
|
|
231
|
+
*
|
|
232
|
+
* ```typescript
|
|
233
|
+
* // Example
|
|
234
|
+
* client.sendListMessage('<number>@c.us', {
|
|
235
|
+
* buttonText: 'Click here',
|
|
236
|
+
* description: 'Choose one option',
|
|
237
|
+
* sections: [
|
|
238
|
+
* {
|
|
239
|
+
* title: 'Section 1',
|
|
240
|
+
* rows: [
|
|
241
|
+
* {
|
|
242
|
+
* rowId: 'my_custom_id',
|
|
243
|
+
* title: 'Test 1',
|
|
244
|
+
* description: 'Description 1',
|
|
245
|
+
* },
|
|
246
|
+
* {
|
|
247
|
+
* rowId: '2',
|
|
248
|
+
* title: 'Test 2',
|
|
249
|
+
* description: 'Description 2',
|
|
250
|
+
* },
|
|
251
|
+
* ],
|
|
252
|
+
* },
|
|
253
|
+
* ],
|
|
254
|
+
* });
|
|
255
|
+
* ```
|
|
256
|
+
*
|
|
257
|
+
* @category Chat
|
|
258
|
+
*/
|
|
259
|
+
sendListMessage(to: string, options: ListMessageOptions): Promise<void>;
|
|
228
260
|
/**
|
|
229
261
|
* Sets the chat state
|
|
230
262
|
* @category Chat
|
|
@@ -891,6 +891,49 @@ var SenderLayer = /** @class */ (function (_super) {
|
|
|
891
891
|
});
|
|
892
892
|
});
|
|
893
893
|
};
|
|
894
|
+
/**
|
|
895
|
+
* Sends a list message
|
|
896
|
+
*
|
|
897
|
+
* ```typescript
|
|
898
|
+
* // Example
|
|
899
|
+
* client.sendListMessage('<number>@c.us', {
|
|
900
|
+
* buttonText: 'Click here',
|
|
901
|
+
* description: 'Choose one option',
|
|
902
|
+
* sections: [
|
|
903
|
+
* {
|
|
904
|
+
* title: 'Section 1',
|
|
905
|
+
* rows: [
|
|
906
|
+
* {
|
|
907
|
+
* rowId: 'my_custom_id',
|
|
908
|
+
* title: 'Test 1',
|
|
909
|
+
* description: 'Description 1',
|
|
910
|
+
* },
|
|
911
|
+
* {
|
|
912
|
+
* rowId: '2',
|
|
913
|
+
* title: 'Test 2',
|
|
914
|
+
* description: 'Description 2',
|
|
915
|
+
* },
|
|
916
|
+
* ],
|
|
917
|
+
* },
|
|
918
|
+
* ],
|
|
919
|
+
* });
|
|
920
|
+
* ```
|
|
921
|
+
*
|
|
922
|
+
* @category Chat
|
|
923
|
+
*/
|
|
924
|
+
SenderLayer.prototype.sendListMessage = function (to, options) {
|
|
925
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
926
|
+
return __generator(this, function (_a) {
|
|
927
|
+
switch (_a.label) {
|
|
928
|
+
case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
|
|
929
|
+
var to = _a.to, options = _a.options;
|
|
930
|
+
WPP.chat.sendListMessage(to, options);
|
|
931
|
+
}, { to: to, options: options })];
|
|
932
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
933
|
+
}
|
|
934
|
+
});
|
|
935
|
+
});
|
|
936
|
+
};
|
|
894
937
|
/**
|
|
895
938
|
* Sets the chat state
|
|
896
939
|
* @category Chat
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as WAJS from '@wppconnect/wa-js';
|
|
1
2
|
export * from './api/model';
|
|
2
3
|
export * from './api/model/enum';
|
|
3
4
|
export { Whatsapp } from './api/whatsapp';
|
|
@@ -5,3 +6,4 @@ export { CreateConfig } from './config/create-config';
|
|
|
5
6
|
export { create } from './controllers/initializer';
|
|
6
7
|
export { defaultLogger } from './utils/logger';
|
|
7
8
|
export * as tokenStore from './token-store';
|
|
9
|
+
export type { WAJS };
|
package/dist/index.js
CHANGED
|
@@ -23,22 +23,6 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
};
|
|
24
24
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
25
|
exports.tokenStore = exports.defaultLogger = exports.create = exports.Whatsapp = void 0;
|
|
26
|
-
/*
|
|
27
|
-
* This file is part of WPPConnect.
|
|
28
|
-
*
|
|
29
|
-
* WPPConnect is free software: you can redistribute it and/or modify
|
|
30
|
-
* it under the terms of the GNU Lesser General Public License as published by
|
|
31
|
-
* the Free Software Foundation, either version 3 of the License, or
|
|
32
|
-
* (at your option) any later version.
|
|
33
|
-
*
|
|
34
|
-
* WPPConnect is distributed in the hope that it will be useful,
|
|
35
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
36
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
37
|
-
* GNU Lesser General Public License for more details.
|
|
38
|
-
*
|
|
39
|
-
* You should have received a copy of the GNU Lesser General Public License
|
|
40
|
-
* along with WPPConnect. If not, see <https://www.gnu.org/licenses/>.
|
|
41
|
-
*/
|
|
42
26
|
__exportStar(require("./api/model"), exports);
|
|
43
27
|
__exportStar(require("./api/model/enum"), exports);
|
|
44
28
|
var whatsapp_1 = require("./api/whatsapp");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wppconnect-team/wppconnect",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.4",
|
|
4
4
|
"description": "WPPConnect is an open source project developed by the JavaScript community with the aim of exporting functions from WhatsApp Web to the node, which can be used to support the creation of any interaction, such as customer service, media sending, intelligence recognition based on phrases artificial and many other things, use your imagination... 😀🤔💭",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
78
78
|
"@typescript-eslint/parser": "^4.33.0",
|
|
79
79
|
"@wppconnect-team/loader": "^1.0.5",
|
|
80
|
-
"babel-loader": "^8.2.
|
|
80
|
+
"babel-loader": "^8.2.3",
|
|
81
81
|
"commitizen": "^4.2.3",
|
|
82
82
|
"concurrently": "^6.3.0",
|
|
83
83
|
"conventional-changelog-cli": "^2.1.1",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"typedoc": "^0.21.0",
|
|
99
99
|
"typedoc-plugin-pages": "^1.1.0",
|
|
100
100
|
"typescript": "^4.4.4",
|
|
101
|
-
"webpack": "^5.59.
|
|
101
|
+
"webpack": "^5.59.1",
|
|
102
102
|
"webpack-cli": "^4.9.1"
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|