@wppconnect-team/wppconnect 1.13.1 → 1.13.2

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,12 @@
1
+ ## 1.13.2 (2022-05-28)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Migrate archiveChat and pinChat methods to WA-JS ([cee7e1c](https://github.com/wppconnect-team/wppconnect/commit/cee7e1ced23409d66365e42a35602265e0c09536))
7
+
8
+
9
+
1
10
  ## 1.13.1 (2022-05-10)
2
11
 
3
12
 
@@ -39,7 +39,10 @@ export declare class ControlsLayer extends UILayer {
39
39
  * @param option {boolean} true or false
40
40
  * @returns boolean
41
41
  */
42
- archiveChat(chatId: string, option?: boolean): Promise<boolean>;
42
+ archiveChat(chatId: string, option?: boolean): Promise<{
43
+ wid: import("@wppconnect/wa-js/dist/whatsapp").Wid;
44
+ archive: boolean;
45
+ }>;
43
46
  /**
44
47
  * Pin and Unpin chat messages with true or false
45
48
  * @category Chat
@@ -48,7 +51,10 @@ export declare class ControlsLayer extends UILayer {
48
51
  * @param nonExistent {boolean} Pin chat, non-existent (optional)
49
52
  * @returns object
50
53
  */
51
- pinChat(chatId: string, option: boolean, nonExistent?: boolean): Promise<object>;
54
+ pinChat(chatId: string, option: boolean, nonExistent?: boolean): Promise<{
55
+ wid: import("@wppconnect/wa-js/dist/whatsapp").Wid;
56
+ pin: boolean;
57
+ }>;
52
58
  /**
53
59
  * Deletes all messages of given chat
54
60
  * @category Chat
@@ -163,7 +163,7 @@ var ControlsLayer = /** @class */ (function (_super) {
163
163
  return __generator(this, function (_a) {
164
164
  return [2 /*return*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
165
165
  var chatId = _a.chatId, option = _a.option;
166
- return WAPI.archiveChat(chatId, option);
166
+ return WPP.chat.archive(chatId, option);
167
167
  }, { chatId: chatId, option: option })];
168
168
  });
169
169
  });
@@ -178,19 +178,22 @@ var ControlsLayer = /** @class */ (function (_super) {
178
178
  */
179
179
  ControlsLayer.prototype.pinChat = function (chatId, option, nonExistent) {
180
180
  return __awaiter(this, void 0, void 0, function () {
181
- var result;
182
181
  return __generator(this, function (_a) {
183
182
  switch (_a.label) {
184
- case 0: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
185
- var chatId = _a.chatId, option = _a.option, nonExistent = _a.nonExistent;
186
- return WAPI.pinChat(chatId, option, nonExistent);
187
- }, { chatId: chatId, option: option, nonExistent: nonExistent })];
183
+ case 0:
184
+ if (!nonExistent) return [3 /*break*/, 2];
185
+ return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
186
+ var chatId = _a.chatId;
187
+ return WPP.chat.find(chatId);
188
+ }, { chatId: chatId })];
188
189
  case 1:
189
- result = _a.sent();
190
- if (result['erro'] == true) {
191
- throw result;
192
- }
193
- return [2 /*return*/, result];
190
+ _a.sent();
191
+ _a.label = 2;
192
+ case 2: return [4 /*yield*/, (0, helpers_1.evaluateAndReturn)(this.page, function (_a) {
193
+ var chatId = _a.chatId, option = _a.option;
194
+ return WPP.chat.pin(chatId, option);
195
+ }, { chatId: chatId, option: option })];
196
+ case 3: return [2 /*return*/, _a.sent()];
194
197
  }
195
198
  });
196
199
  });
@@ -1,2 +1,2 @@
1
- declare const useragentOverride = "WhatsApp/2.2043.8 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36";
1
+ declare const useragentOverride = "\"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36";
2
2
  export { useragentOverride };
@@ -17,5 +17,5 @@
17
17
  */
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  exports.useragentOverride = void 0;
20
- var useragentOverride = 'WhatsApp/2.2043.8 Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36';
20
+ var useragentOverride = '"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36';
21
21
  exports.useragentOverride = useragentOverride;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wppconnect-team/wppconnect",
3
- "version": "1.13.1",
3
+ "version": "1.13.2",
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,30 +58,30 @@
58
58
  },
59
59
  "homepage": "https://github.com/wppconnect-team/wppconnect#readme",
60
60
  "devDependencies": {
61
- "@babel/core": "^7.17.10",
62
- "@babel/eslint-parser": "^7.17.0",
61
+ "@babel/core": "^7.18.2",
62
+ "@babel/eslint-parser": "^7.18.2",
63
63
  "@babel/eslint-plugin": "^7.17.7",
64
- "@babel/preset-env": "^7.17.10",
65
- "@commitlint/cli": "^16.2.4",
66
- "@commitlint/config-conventional": "^16.2.4",
67
- "@commitlint/cz-commitlint": "^16.2.4",
64
+ "@babel/preset-env": "^7.18.2",
65
+ "@commitlint/cli": "^17.0.1",
66
+ "@commitlint/config-conventional": "^17.0.0",
67
+ "@commitlint/cz-commitlint": "^17.0.0",
68
68
  "@types/atob": "^2.1.2",
69
- "@types/mime-types": "^2.1.0",
69
+ "@types/mime-types": "^2.1.1",
70
70
  "@types/mocha": "^9.1.1",
71
- "@types/node": "^14.18.16",
72
- "@types/rimraf": "^3.0.0",
71
+ "@types/node": "^16.11.36",
72
+ "@types/rimraf": "^3.0.2",
73
73
  "@types/sharp": "^0.30.2",
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.23.0",
78
- "@typescript-eslint/parser": "^5.23.0",
77
+ "@typescript-eslint/eslint-plugin": "^5.26.0",
78
+ "@typescript-eslint/parser": "^5.26.0",
79
79
  "babel-loader": "^8.2.5",
80
- "commitizen": "^4.2.3",
81
- "concurrently": "^7.1.0",
80
+ "commitizen": "^4.2.4",
81
+ "concurrently": "^7.2.1",
82
82
  "conventional-changelog-cli": "^2.2.2",
83
- "copy-webpack-plugin": "^10.2.4",
84
- "eslint": "^8.15.0",
83
+ "copy-webpack-plugin": "^11.0.0",
84
+ "eslint": "^8.16.0",
85
85
  "eslint-config-prettier": "^8.5.0",
86
86
  "eslint-plugin-prettier": "^4.0.0",
87
87
  "gulp": "^4.0.2",
@@ -90,31 +90,31 @@
90
90
  "mocha": "^10.0.0",
91
91
  "prettier": "^2.6.2",
92
92
  "pretty-quick": "^3.1.3",
93
- "regenerator-runtime": "^0.13.7",
93
+ "regenerator-runtime": "^0.13.9",
94
94
  "release-it": "^15.0.0",
95
95
  "shx": "^0.3.4",
96
- "ts-node": "^10.7.0",
96
+ "ts-node": "^10.8.0",
97
97
  "typedoc": "^0.21.10",
98
98
  "typedoc-plugin-pages": "^1.1.0",
99
- "typescript": "^4.6.4",
100
- "webpack": "^5.72.0",
99
+ "typescript": "^4.7.2",
100
+ "webpack": "^5.72.1",
101
101
  "webpack-cli": "^4.9.2"
102
102
  },
103
103
  "dependencies": {
104
- "@wppconnect/wa-js": "^2.2.1",
105
- "@wppconnect/wa-version": "^1.1.74",
104
+ "@wppconnect/wa-js": "^2.4.0",
105
+ "@wppconnect/wa-version": "^1.1.88",
106
106
  "atob": "^2.1.2",
107
107
  "axios": "^0.27.2",
108
108
  "boxen": "^5.1.2",
109
- "catch-exit": "^1.1.0",
109
+ "catch-exit": "^1.2.2",
110
110
  "chalk": "~4.1.2",
111
111
  "chrome-launcher": "^0.15.0",
112
- "execa": "^5.0.0",
112
+ "execa": "^5.1.1",
113
113
  "file-type": "~16.5.3",
114
- "futoin-hkdf": "^1.5.0",
114
+ "futoin-hkdf": "^1.5.1",
115
115
  "latest-version": "^5.1.0",
116
116
  "logform": "^2.4.0",
117
- "lookpath": "^1.2.0",
117
+ "lookpath": "^1.2.2",
118
118
  "mime-types": "^2.1.35",
119
119
  "puppeteer": "*",
120
120
  "puppeteer-extra": "^3.2.3",
@@ -125,14 +125,14 @@
125
125
  "reflect-metadata": "^0.1.13",
126
126
  "rimraf": "^3.0.2",
127
127
  "sanitize-filename": "^1.6.3",
128
- "sharp": "^0.30.4",
128
+ "sharp": "^0.30.5",
129
129
  "tmp": "^0.2.1",
130
130
  "tree-kill": "^1.2.2",
131
131
  "winston": "^3.7.2",
132
- "ws": "^8.6.0"
132
+ "ws": "^8.7.0"
133
133
  },
134
134
  "optionalDependencies": {
135
- "fsevents": "^2.3.1"
135
+ "fsevents": "^2.3.2"
136
136
  },
137
137
  "directories": {
138
138
  "doc": "docs",