@wppconnect-team/wppconnect 1.14.0 → 1.14.3

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,25 @@
1
+ ## 1.14.3 (2022-06-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **deps:** update dependency @wppconnect/wa-js to ^2.7.2 ([#1181](https://github.com/wppconnect-team/wppconnect/issues/1181)) ([5208e62](https://github.com/wppconnect-team/wppconnect/commit/5208e621cf79ca5d80cca5ecf3c7b9068ca44e91))
7
+
8
+
9
+
10
+ ## 1.14.2 (2022-06-11)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * Added filename for sendFile when is using path or URL (fix [#1168](https://github.com/wppconnect-team/wppconnect/issues/1168)) ([5534fad](https://github.com/wppconnect-team/wppconnect/commit/5534fad0e056563cc3ce6b7699ea06f5eaff6da8))
16
+
17
+
18
+
19
+ ## 1.14.1 (2022-06-08)
20
+
21
+
22
+
1
23
  # 1.14.0 (2022-06-08)
2
24
 
3
25
 
@@ -31,10 +31,18 @@ export declare class SenderLayer extends ListenerLayer {
31
31
  * client.sendText('<number>@c.us', 'A simple message');
32
32
  *
33
33
  * // With buttons
34
- * client.sendText('<number>@c.us', 'A simple message with buttons', {
34
+ * client.sendText('<number>@c.us', 'WPPConnect message with buttons', {
35
35
  * useTemplateButtons: true, // False for legacy
36
36
  * buttons: [
37
37
  * {
38
+ * url: 'https://wppconnect-team.github.io/',
39
+ * text: 'WPPConnect Site'
40
+ * },
41
+ * {
42
+ * phoneNumber: '+55 11 22334455',
43
+ * text: 'Call me'
44
+ * },
45
+ * {
38
46
  * id: 'your custom id 1',
39
47
  * text: 'Some text'
40
48
  * },
@@ -157,6 +165,38 @@ export declare class SenderLayer extends ListenerLayer {
157
165
  sendFileFromBase64(chatId: string, base64: string, filename: string, caption?: string): Promise<any>;
158
166
  /**
159
167
  * Sends file from path or base64
168
+ *
169
+ * @example
170
+ * ```javascript
171
+ * // Simple message
172
+ * client.sendFile('<number>@c.us', 'data:text/plain;base64,V1BQQ29ubmVjdA==');
173
+ *
174
+ * // With buttons
175
+ * client.sendFile('<number>@c.us', 'data:text/plain;base64,V1BQQ29ubmVjdA==', {
176
+ * useTemplateButtons: true, // False for legacy
177
+ * buttons: [
178
+ * {
179
+ * url: 'https://wppconnect-team.github.io/',
180
+ * text: 'WPPConnect Site'
181
+ * },
182
+ * {
183
+ * phoneNumber: '+55 11 22334455',
184
+ * text: 'Call me'
185
+ * },
186
+ * {
187
+ * id: 'your custom id 1',
188
+ * text: 'Some text'
189
+ * },
190
+ * {
191
+ * id: 'another id 2',
192
+ * text: 'Another text'
193
+ * }
194
+ * ],
195
+ * title: 'Title text' // Optional
196
+ * footer: 'Footer text' // Optional
197
+ * });
198
+ * ```
199
+ *
160
200
  * @category Chat
161
201
  * @param to Chat id
162
202
  * @param pathOrBase64 File path
@@ -156,10 +156,18 @@ var SenderLayer = /** @class */ (function (_super) {
156
156
  * client.sendText('<number>@c.us', 'A simple message');
157
157
  *
158
158
  * // With buttons
159
- * client.sendText('<number>@c.us', 'A simple message with buttons', {
159
+ * client.sendText('<number>@c.us', 'WPPConnect message with buttons', {
160
160
  * useTemplateButtons: true, // False for legacy
161
161
  * buttons: [
162
162
  * {
163
+ * url: 'https://wppconnect-team.github.io/',
164
+ * text: 'WPPConnect Site'
165
+ * },
166
+ * {
167
+ * phoneNumber: '+55 11 22334455',
168
+ * text: 'Call me'
169
+ * },
170
+ * {
163
171
  * id: 'your custom id 1',
164
172
  * text: 'Some text'
165
173
  * },
@@ -620,6 +628,9 @@ var SenderLayer = /** @class */ (function (_super) {
620
628
  if (fileContent) {
621
629
  base64 = fileContent;
622
630
  }
631
+ if (!options.filename) {
632
+ options.filename = path.basename(pathOrBase64);
633
+ }
623
634
  _a.label = 5;
624
635
  case 5:
625
636
  if (!base64) {
@@ -176,7 +176,7 @@ function create(sessionOrOption, catchQR, statusFind, options, browserSessionTok
176
176
  }
177
177
  }
178
178
  if (!mergedOptions.browserWS) {
179
- logger.error("Using browser folder '".concat(mergedOptions.puppeteerOptions.userDataDir, "'"), {
179
+ logger.info("Using browser folder '".concat(mergedOptions.puppeteerOptions.userDataDir, "'"), {
180
180
  session: session,
181
181
  type: 'browser',
182
182
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wppconnect-team/wppconnect",
3
- "version": "1.14.0",
3
+ "version": "1.14.3",
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",
@@ -58,7 +58,7 @@
58
58
  },
59
59
  "homepage": "https://github.com/wppconnect-team/wppconnect#readme",
60
60
  "devDependencies": {
61
- "@babel/core": "^7.18.2",
61
+ "@babel/core": "^7.18.5",
62
62
  "@babel/eslint-parser": "^7.18.2",
63
63
  "@babel/eslint-plugin": "^7.17.7",
64
64
  "@babel/preset-env": "^7.18.2",
@@ -68,17 +68,17 @@
68
68
  "@types/atob": "^2.1.2",
69
69
  "@types/mime-types": "^2.1.1",
70
70
  "@types/mocha": "^9.1.1",
71
- "@types/node": "^16.11.38",
71
+ "@types/node": "^16.11.41",
72
72
  "@types/rimraf": "^3.0.2",
73
- "@types/sharp": "^0.30.2",
73
+ "@types/sharp": "^0.30.4",
74
74
  "@types/shelljs": "^0.8.11",
75
75
  "@types/tmp": "^0.2.3",
76
76
  "@types/ws": "^8.5.3",
77
- "@typescript-eslint/eslint-plugin": "^5.27.0",
78
- "@typescript-eslint/parser": "^5.27.0",
77
+ "@typescript-eslint/eslint-plugin": "^5.27.1",
78
+ "@typescript-eslint/parser": "^5.27.1",
79
79
  "babel-loader": "^8.2.5",
80
80
  "commitizen": "^4.2.4",
81
- "concurrently": "^7.2.1",
81
+ "concurrently": "^7.2.2",
82
82
  "conventional-changelog-cli": "^2.2.2",
83
83
  "copy-webpack-plugin": "^11.0.0",
84
84
  "eslint": "^8.17.0",
@@ -98,11 +98,11 @@
98
98
  "typedoc-plugin-pages": "^1.1.0",
99
99
  "typescript": "^4.7.3",
100
100
  "webpack": "^5.73.0",
101
- "webpack-cli": "^4.9.2"
101
+ "webpack-cli": "^4.10.0"
102
102
  },
103
103
  "dependencies": {
104
- "@wppconnect/wa-js": "^2.6.0",
105
- "@wppconnect/wa-version": "^1.1.89",
104
+ "@wppconnect/wa-js": "^2.7.2",
105
+ "@wppconnect/wa-version": "^1.1.93",
106
106
  "atob": "^2.1.2",
107
107
  "axios": "^0.27.2",
108
108
  "boxen": "^5.1.2",
@@ -129,7 +129,7 @@
129
129
  "tmp": "^0.2.1",
130
130
  "tree-kill": "^1.2.2",
131
131
  "winston": "^3.7.2",
132
- "ws": "^8.7.0"
132
+ "ws": "^8.8.0"
133
133
  },
134
134
  "optionalDependencies": {
135
135
  "fsevents": "^2.3.2"