@iflyrpa/actions 1.2.24 → 1.2.25-beta.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/dist/actions/baijiahaoPublish/index.d.ts +8 -0
- package/dist/actions/baijiahaoPublish/utils.d.ts +10 -0
- package/dist/actions/getWeixinCollection/index.d.ts +32 -0
- package/dist/actions/getXhsCollection/index.d.ts +31 -0
- package/dist/actions/getXhsGroup/index.d.ts +19 -0
- package/dist/actions/getXhsHotTopic/index.d.ts +35 -0
- package/dist/actions/searchBjhTopicList/index.d.ts +12 -0
- package/dist/actions/toutiaoPublish/index.d.ts +4 -0
- package/dist/actions/weixinPublish/index.d.ts +5 -0
- package/dist/actions/weixinPublish/utils.d.ts +6 -0
- package/dist/actions/xiaohongshuPublish/index.d.ts +9 -1
- package/dist/bundle.js +1578 -94
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1603 -51
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1596 -51
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/utils/http.d.ts +9 -3
- package/dist/utils/proxy.d.ts +2 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_assert__ from "assert";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_http__ from "http";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_https__ from "https";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_net__ from "net";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_os__ from "os";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tls__ from "tls";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tty__ from "tty";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE_url__ from "url";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE_util__ from "util";
|
|
1
10
|
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
2
11
|
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
3
12
|
import * as __WEBPACK_EXTERNAL_MODULE_dom_serializer_aa70940b__ from "dom-serializer";
|
|
@@ -7,9 +16,1058 @@ import * as __WEBPACK_EXTERNAL_MODULE_mime_types_eebf54a5__ from "mime-types";
|
|
|
7
16
|
import * as __WEBPACK_EXTERNAL_MODULE_axios__ from "axios";
|
|
8
17
|
import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__ from "@iflyrpa/share";
|
|
9
18
|
import * as __WEBPACK_EXTERNAL_MODULE_form_data_cf000082__ from "form-data";
|
|
10
|
-
import * as __WEBPACK_EXTERNAL_MODULE_node_buffer_fb286294__ from "node:buffer";
|
|
11
19
|
import * as __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__ from "node:crypto";
|
|
20
|
+
import * as __WEBPACK_EXTERNAL_MODULE_node_buffer_fb286294__ from "node:buffer";
|
|
12
21
|
var __webpack_modules__ = {
|
|
22
|
+
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
23
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
24
|
+
if (void 0 === k2) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return m[k];
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(o, k2, desc);
|
|
33
|
+
} : function(o, m, k, k2) {
|
|
34
|
+
if (void 0 === k2) k2 = k;
|
|
35
|
+
o[k2] = m[k];
|
|
36
|
+
});
|
|
37
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
38
|
+
Object.defineProperty(o, "default", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
value: v
|
|
41
|
+
});
|
|
42
|
+
} : function(o, v) {
|
|
43
|
+
o["default"] = v;
|
|
44
|
+
});
|
|
45
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
46
|
+
if (mod && mod.__esModule) return mod;
|
|
47
|
+
var result = {};
|
|
48
|
+
if (null != mod) {
|
|
49
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
50
|
+
}
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(exports, "__esModule", {
|
|
55
|
+
value: true
|
|
56
|
+
});
|
|
57
|
+
exports.req = exports.json = exports.toBuffer = void 0;
|
|
58
|
+
const http = __importStar(__webpack_require__("http"));
|
|
59
|
+
const https = __importStar(__webpack_require__("https"));
|
|
60
|
+
async function toBuffer(stream) {
|
|
61
|
+
let length = 0;
|
|
62
|
+
const chunks = [];
|
|
63
|
+
for await (const chunk of stream){
|
|
64
|
+
length += chunk.length;
|
|
65
|
+
chunks.push(chunk);
|
|
66
|
+
}
|
|
67
|
+
return Buffer.concat(chunks, length);
|
|
68
|
+
}
|
|
69
|
+
exports.toBuffer = toBuffer;
|
|
70
|
+
async function json(stream) {
|
|
71
|
+
const buf = await toBuffer(stream);
|
|
72
|
+
const str = buf.toString('utf8');
|
|
73
|
+
try {
|
|
74
|
+
return JSON.parse(str);
|
|
75
|
+
} catch (_err) {
|
|
76
|
+
const err = _err;
|
|
77
|
+
err.message += ` (input: ${str})`;
|
|
78
|
+
throw err;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.json = json;
|
|
82
|
+
function req(url, opts = {}) {
|
|
83
|
+
const href = 'string' == typeof url ? url : url.href;
|
|
84
|
+
const req1 = (href.startsWith('https:') ? https : http).request(url, opts);
|
|
85
|
+
const promise = new Promise((resolve, reject)=>{
|
|
86
|
+
req1.once('response', resolve).once('error', reject).end();
|
|
87
|
+
});
|
|
88
|
+
req1.then = promise.then.bind(promise);
|
|
89
|
+
return req1;
|
|
90
|
+
}
|
|
91
|
+
exports.req = req;
|
|
92
|
+
},
|
|
93
|
+
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
94
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
95
|
+
if (void 0 === k2) k2 = k;
|
|
96
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
97
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function() {
|
|
100
|
+
return m[k];
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
Object.defineProperty(o, k2, desc);
|
|
104
|
+
} : function(o, m, k, k2) {
|
|
105
|
+
if (void 0 === k2) k2 = k;
|
|
106
|
+
o[k2] = m[k];
|
|
107
|
+
});
|
|
108
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
109
|
+
Object.defineProperty(o, "default", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
value: v
|
|
112
|
+
});
|
|
113
|
+
} : function(o, v) {
|
|
114
|
+
o["default"] = v;
|
|
115
|
+
});
|
|
116
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
117
|
+
if (mod && mod.__esModule) return mod;
|
|
118
|
+
var result = {};
|
|
119
|
+
if (null != mod) {
|
|
120
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
121
|
+
}
|
|
122
|
+
__setModuleDefault(result, mod);
|
|
123
|
+
return result;
|
|
124
|
+
};
|
|
125
|
+
var __exportStar = this && this.__exportStar || function(m, exports) {
|
|
126
|
+
for(var p in m)if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
127
|
+
};
|
|
128
|
+
Object.defineProperty(exports, "__esModule", {
|
|
129
|
+
value: true
|
|
130
|
+
});
|
|
131
|
+
exports.Agent = void 0;
|
|
132
|
+
const net = __importStar(__webpack_require__("net"));
|
|
133
|
+
const http = __importStar(__webpack_require__("http"));
|
|
134
|
+
const https_1 = __webpack_require__("https");
|
|
135
|
+
__exportStar(__webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"), exports);
|
|
136
|
+
const INTERNAL = Symbol('AgentBaseInternalState');
|
|
137
|
+
class Agent extends http.Agent {
|
|
138
|
+
constructor(opts){
|
|
139
|
+
super(opts);
|
|
140
|
+
this[INTERNAL] = {};
|
|
141
|
+
}
|
|
142
|
+
isSecureEndpoint(options) {
|
|
143
|
+
if (options) {
|
|
144
|
+
if ('boolean' == typeof options.secureEndpoint) return options.secureEndpoint;
|
|
145
|
+
if ('string' == typeof options.protocol) return 'https:' === options.protocol;
|
|
146
|
+
}
|
|
147
|
+
const { stack } = new Error();
|
|
148
|
+
if ('string' != typeof stack) return false;
|
|
149
|
+
return stack.split('\n').some((l)=>-1 !== l.indexOf('(https.js:') || -1 !== l.indexOf('node:https:'));
|
|
150
|
+
}
|
|
151
|
+
incrementSockets(name) {
|
|
152
|
+
if (this.maxSockets === 1 / 0 && this.maxTotalSockets === 1 / 0) return null;
|
|
153
|
+
if (!this.sockets[name]) this.sockets[name] = [];
|
|
154
|
+
const fakeSocket = new net.Socket({
|
|
155
|
+
writable: false
|
|
156
|
+
});
|
|
157
|
+
this.sockets[name].push(fakeSocket);
|
|
158
|
+
this.totalSocketCount++;
|
|
159
|
+
return fakeSocket;
|
|
160
|
+
}
|
|
161
|
+
decrementSockets(name, socket) {
|
|
162
|
+
if (!this.sockets[name] || null === socket) return;
|
|
163
|
+
const sockets = this.sockets[name];
|
|
164
|
+
const index = sockets.indexOf(socket);
|
|
165
|
+
if (-1 !== index) {
|
|
166
|
+
sockets.splice(index, 1);
|
|
167
|
+
this.totalSocketCount--;
|
|
168
|
+
if (0 === sockets.length) delete this.sockets[name];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
getName(options) {
|
|
172
|
+
const secureEndpoint = this.isSecureEndpoint(options);
|
|
173
|
+
if (secureEndpoint) return https_1.Agent.prototype.getName.call(this, options);
|
|
174
|
+
return super.getName(options);
|
|
175
|
+
}
|
|
176
|
+
createSocket(req, options, cb) {
|
|
177
|
+
const connectOpts = {
|
|
178
|
+
...options,
|
|
179
|
+
secureEndpoint: this.isSecureEndpoint(options)
|
|
180
|
+
};
|
|
181
|
+
const name = this.getName(connectOpts);
|
|
182
|
+
const fakeSocket = this.incrementSockets(name);
|
|
183
|
+
Promise.resolve().then(()=>this.connect(req, connectOpts)).then((socket)=>{
|
|
184
|
+
this.decrementSockets(name, fakeSocket);
|
|
185
|
+
if (socket instanceof http.Agent) try {
|
|
186
|
+
return socket.addRequest(req, connectOpts);
|
|
187
|
+
} catch (err) {
|
|
188
|
+
return cb(err);
|
|
189
|
+
}
|
|
190
|
+
this[INTERNAL].currentSocket = socket;
|
|
191
|
+
super.createSocket(req, options, cb);
|
|
192
|
+
}, (err)=>{
|
|
193
|
+
this.decrementSockets(name, fakeSocket);
|
|
194
|
+
cb(err);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
createConnection() {
|
|
198
|
+
const socket = this[INTERNAL].currentSocket;
|
|
199
|
+
this[INTERNAL].currentSocket = void 0;
|
|
200
|
+
if (!socket) throw new Error('No socket was returned in the `connect()` function');
|
|
201
|
+
return socket;
|
|
202
|
+
}
|
|
203
|
+
get defaultPort() {
|
|
204
|
+
return this[INTERNAL].defaultPort ?? ('https:' === this.protocol ? 443 : 80);
|
|
205
|
+
}
|
|
206
|
+
set defaultPort(v) {
|
|
207
|
+
if (this[INTERNAL]) this[INTERNAL].defaultPort = v;
|
|
208
|
+
}
|
|
209
|
+
get protocol() {
|
|
210
|
+
return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');
|
|
211
|
+
}
|
|
212
|
+
set protocol(v) {
|
|
213
|
+
if (this[INTERNAL]) this[INTERNAL].protocol = v;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
exports.Agent = Agent;
|
|
217
|
+
},
|
|
218
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js": function(module, exports, __webpack_require__) {
|
|
219
|
+
exports.formatArgs = formatArgs;
|
|
220
|
+
exports.save = save;
|
|
221
|
+
exports.load = load;
|
|
222
|
+
exports.useColors = useColors;
|
|
223
|
+
exports.storage = localstorage();
|
|
224
|
+
exports.destroy = (()=>{
|
|
225
|
+
let warned = false;
|
|
226
|
+
return ()=>{
|
|
227
|
+
if (!warned) {
|
|
228
|
+
warned = true;
|
|
229
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
})();
|
|
233
|
+
exports.colors = [
|
|
234
|
+
'#0000CC',
|
|
235
|
+
'#0000FF',
|
|
236
|
+
'#0033CC',
|
|
237
|
+
'#0033FF',
|
|
238
|
+
'#0066CC',
|
|
239
|
+
'#0066FF',
|
|
240
|
+
'#0099CC',
|
|
241
|
+
'#0099FF',
|
|
242
|
+
'#00CC00',
|
|
243
|
+
'#00CC33',
|
|
244
|
+
'#00CC66',
|
|
245
|
+
'#00CC99',
|
|
246
|
+
'#00CCCC',
|
|
247
|
+
'#00CCFF',
|
|
248
|
+
'#3300CC',
|
|
249
|
+
'#3300FF',
|
|
250
|
+
'#3333CC',
|
|
251
|
+
'#3333FF',
|
|
252
|
+
'#3366CC',
|
|
253
|
+
'#3366FF',
|
|
254
|
+
'#3399CC',
|
|
255
|
+
'#3399FF',
|
|
256
|
+
'#33CC00',
|
|
257
|
+
'#33CC33',
|
|
258
|
+
'#33CC66',
|
|
259
|
+
'#33CC99',
|
|
260
|
+
'#33CCCC',
|
|
261
|
+
'#33CCFF',
|
|
262
|
+
'#6600CC',
|
|
263
|
+
'#6600FF',
|
|
264
|
+
'#6633CC',
|
|
265
|
+
'#6633FF',
|
|
266
|
+
'#66CC00',
|
|
267
|
+
'#66CC33',
|
|
268
|
+
'#9900CC',
|
|
269
|
+
'#9900FF',
|
|
270
|
+
'#9933CC',
|
|
271
|
+
'#9933FF',
|
|
272
|
+
'#99CC00',
|
|
273
|
+
'#99CC33',
|
|
274
|
+
'#CC0000',
|
|
275
|
+
'#CC0033',
|
|
276
|
+
'#CC0066',
|
|
277
|
+
'#CC0099',
|
|
278
|
+
'#CC00CC',
|
|
279
|
+
'#CC00FF',
|
|
280
|
+
'#CC3300',
|
|
281
|
+
'#CC3333',
|
|
282
|
+
'#CC3366',
|
|
283
|
+
'#CC3399',
|
|
284
|
+
'#CC33CC',
|
|
285
|
+
'#CC33FF',
|
|
286
|
+
'#CC6600',
|
|
287
|
+
'#CC6633',
|
|
288
|
+
'#CC9900',
|
|
289
|
+
'#CC9933',
|
|
290
|
+
'#CCCC00',
|
|
291
|
+
'#CCCC33',
|
|
292
|
+
'#FF0000',
|
|
293
|
+
'#FF0033',
|
|
294
|
+
'#FF0066',
|
|
295
|
+
'#FF0099',
|
|
296
|
+
'#FF00CC',
|
|
297
|
+
'#FF00FF',
|
|
298
|
+
'#FF3300',
|
|
299
|
+
'#FF3333',
|
|
300
|
+
'#FF3366',
|
|
301
|
+
'#FF3399',
|
|
302
|
+
'#FF33CC',
|
|
303
|
+
'#FF33FF',
|
|
304
|
+
'#FF6600',
|
|
305
|
+
'#FF6633',
|
|
306
|
+
'#FF9900',
|
|
307
|
+
'#FF9933',
|
|
308
|
+
'#FFCC00',
|
|
309
|
+
'#FFCC33'
|
|
310
|
+
];
|
|
311
|
+
function useColors() {
|
|
312
|
+
if ('undefined' != typeof window && window.process && ('renderer' === window.process.type || window.process.__nwjs)) return true;
|
|
313
|
+
if ('undefined' != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return false;
|
|
314
|
+
let m;
|
|
315
|
+
return 'undefined' != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || 'undefined' != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || 'undefined' != typeof navigator && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || 'undefined' != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
316
|
+
}
|
|
317
|
+
function formatArgs(args) {
|
|
318
|
+
args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
|
319
|
+
if (!this.useColors) return;
|
|
320
|
+
const c = 'color: ' + this.color;
|
|
321
|
+
args.splice(1, 0, c, 'color: inherit');
|
|
322
|
+
let index = 0;
|
|
323
|
+
let lastC = 0;
|
|
324
|
+
args[0].replace(/%[a-zA-Z%]/g, (match)=>{
|
|
325
|
+
if ('%%' === match) return;
|
|
326
|
+
index++;
|
|
327
|
+
if ('%c' === match) lastC = index;
|
|
328
|
+
});
|
|
329
|
+
args.splice(lastC, 0, c);
|
|
330
|
+
}
|
|
331
|
+
exports.log = console.debug || console.log || (()=>{});
|
|
332
|
+
function save(namespaces) {
|
|
333
|
+
try {
|
|
334
|
+
if (namespaces) exports.storage.setItem('debug', namespaces);
|
|
335
|
+
else exports.storage.removeItem('debug');
|
|
336
|
+
} catch (error) {}
|
|
337
|
+
}
|
|
338
|
+
function load() {
|
|
339
|
+
let r;
|
|
340
|
+
try {
|
|
341
|
+
r = exports.storage.getItem('debug');
|
|
342
|
+
} catch (error) {}
|
|
343
|
+
if (!r && 'undefined' != typeof process && 'env' in process) r = process.env.DEBUG;
|
|
344
|
+
return r;
|
|
345
|
+
}
|
|
346
|
+
function localstorage() {
|
|
347
|
+
try {
|
|
348
|
+
return localStorage;
|
|
349
|
+
} catch (error) {}
|
|
350
|
+
}
|
|
351
|
+
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);
|
|
352
|
+
const { formatters } = module.exports;
|
|
353
|
+
formatters.j = function(v) {
|
|
354
|
+
try {
|
|
355
|
+
return JSON.stringify(v);
|
|
356
|
+
} catch (error) {
|
|
357
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
},
|
|
361
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
362
|
+
function setup(env) {
|
|
363
|
+
createDebug.debug = createDebug;
|
|
364
|
+
createDebug.default = createDebug;
|
|
365
|
+
createDebug.coerce = coerce;
|
|
366
|
+
createDebug.disable = disable;
|
|
367
|
+
createDebug.enable = enable;
|
|
368
|
+
createDebug.enabled = enabled;
|
|
369
|
+
createDebug.humanize = __webpack_require__("../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js");
|
|
370
|
+
createDebug.destroy = destroy;
|
|
371
|
+
Object.keys(env).forEach((key)=>{
|
|
372
|
+
createDebug[key] = env[key];
|
|
373
|
+
});
|
|
374
|
+
createDebug.names = [];
|
|
375
|
+
createDebug.skips = [];
|
|
376
|
+
createDebug.formatters = {};
|
|
377
|
+
function selectColor(namespace) {
|
|
378
|
+
let hash = 0;
|
|
379
|
+
for(let i = 0; i < namespace.length; i++){
|
|
380
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
381
|
+
hash |= 0;
|
|
382
|
+
}
|
|
383
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
384
|
+
}
|
|
385
|
+
createDebug.selectColor = selectColor;
|
|
386
|
+
function createDebug(namespace) {
|
|
387
|
+
let prevTime;
|
|
388
|
+
let enableOverride = null;
|
|
389
|
+
let namespacesCache;
|
|
390
|
+
let enabledCache;
|
|
391
|
+
function debug(...args) {
|
|
392
|
+
if (!debug.enabled) return;
|
|
393
|
+
const self = debug;
|
|
394
|
+
const curr = Number(new Date());
|
|
395
|
+
const ms = curr - (prevTime || curr);
|
|
396
|
+
self.diff = ms;
|
|
397
|
+
self.prev = prevTime;
|
|
398
|
+
self.curr = curr;
|
|
399
|
+
prevTime = curr;
|
|
400
|
+
args[0] = createDebug.coerce(args[0]);
|
|
401
|
+
if ('string' != typeof args[0]) args.unshift('%O');
|
|
402
|
+
let index = 0;
|
|
403
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format)=>{
|
|
404
|
+
if ('%%' === match) return '%';
|
|
405
|
+
index++;
|
|
406
|
+
const formatter = createDebug.formatters[format];
|
|
407
|
+
if ('function' == typeof formatter) {
|
|
408
|
+
const val = args[index];
|
|
409
|
+
match = formatter.call(self, val);
|
|
410
|
+
args.splice(index, 1);
|
|
411
|
+
index--;
|
|
412
|
+
}
|
|
413
|
+
return match;
|
|
414
|
+
});
|
|
415
|
+
createDebug.formatArgs.call(self, args);
|
|
416
|
+
const logFn = self.log || createDebug.log;
|
|
417
|
+
logFn.apply(self, args);
|
|
418
|
+
}
|
|
419
|
+
debug.namespace = namespace;
|
|
420
|
+
debug.useColors = createDebug.useColors();
|
|
421
|
+
debug.color = createDebug.selectColor(namespace);
|
|
422
|
+
debug.extend = extend;
|
|
423
|
+
debug.destroy = createDebug.destroy;
|
|
424
|
+
Object.defineProperty(debug, 'enabled', {
|
|
425
|
+
enumerable: true,
|
|
426
|
+
configurable: false,
|
|
427
|
+
get: ()=>{
|
|
428
|
+
if (null !== enableOverride) return enableOverride;
|
|
429
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
430
|
+
namespacesCache = createDebug.namespaces;
|
|
431
|
+
enabledCache = createDebug.enabled(namespace);
|
|
432
|
+
}
|
|
433
|
+
return enabledCache;
|
|
434
|
+
},
|
|
435
|
+
set: (v)=>{
|
|
436
|
+
enableOverride = v;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
if ('function' == typeof createDebug.init) createDebug.init(debug);
|
|
440
|
+
return debug;
|
|
441
|
+
}
|
|
442
|
+
function extend(namespace, delimiter) {
|
|
443
|
+
const newDebug = createDebug(this.namespace + (void 0 === delimiter ? ':' : delimiter) + namespace);
|
|
444
|
+
newDebug.log = this.log;
|
|
445
|
+
return newDebug;
|
|
446
|
+
}
|
|
447
|
+
function enable(namespaces) {
|
|
448
|
+
createDebug.save(namespaces);
|
|
449
|
+
createDebug.namespaces = namespaces;
|
|
450
|
+
createDebug.names = [];
|
|
451
|
+
createDebug.skips = [];
|
|
452
|
+
const split = ('string' == typeof namespaces ? namespaces : '').trim().replace(' ', ',').split(',').filter(Boolean);
|
|
453
|
+
for (const ns of split)if ('-' === ns[0]) createDebug.skips.push(ns.slice(1));
|
|
454
|
+
else createDebug.names.push(ns);
|
|
455
|
+
}
|
|
456
|
+
function matchesTemplate(search, template) {
|
|
457
|
+
let searchIndex = 0;
|
|
458
|
+
let templateIndex = 0;
|
|
459
|
+
let starIndex = -1;
|
|
460
|
+
let matchIndex = 0;
|
|
461
|
+
while(searchIndex < search.length)if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || '*' === template[templateIndex])) {
|
|
462
|
+
if ('*' === template[templateIndex]) {
|
|
463
|
+
starIndex = templateIndex;
|
|
464
|
+
matchIndex = searchIndex;
|
|
465
|
+
templateIndex++;
|
|
466
|
+
} else {
|
|
467
|
+
searchIndex++;
|
|
468
|
+
templateIndex++;
|
|
469
|
+
}
|
|
470
|
+
} else {
|
|
471
|
+
if (-1 === starIndex) return false;
|
|
472
|
+
templateIndex = starIndex + 1;
|
|
473
|
+
matchIndex++;
|
|
474
|
+
searchIndex = matchIndex;
|
|
475
|
+
}
|
|
476
|
+
while(templateIndex < template.length && '*' === template[templateIndex])templateIndex++;
|
|
477
|
+
return templateIndex === template.length;
|
|
478
|
+
}
|
|
479
|
+
function disable() {
|
|
480
|
+
const namespaces = [
|
|
481
|
+
...createDebug.names,
|
|
482
|
+
...createDebug.skips.map((namespace)=>'-' + namespace)
|
|
483
|
+
].join(',');
|
|
484
|
+
createDebug.enable('');
|
|
485
|
+
return namespaces;
|
|
486
|
+
}
|
|
487
|
+
function enabled(name) {
|
|
488
|
+
for (const skip of createDebug.skips)if (matchesTemplate(name, skip)) return false;
|
|
489
|
+
for (const ns of createDebug.names)if (matchesTemplate(name, ns)) return true;
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
function coerce(val) {
|
|
493
|
+
if (val instanceof Error) return val.stack || val.message;
|
|
494
|
+
return val;
|
|
495
|
+
}
|
|
496
|
+
function destroy() {
|
|
497
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
498
|
+
}
|
|
499
|
+
createDebug.enable(createDebug.load());
|
|
500
|
+
return createDebug;
|
|
501
|
+
}
|
|
502
|
+
module.exports = setup;
|
|
503
|
+
},
|
|
504
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
505
|
+
if ('undefined' == typeof process || 'renderer' === process.type || true === process.browser || process.__nwjs) module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js");
|
|
506
|
+
else module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js");
|
|
507
|
+
},
|
|
508
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js": function(module, exports, __webpack_require__) {
|
|
509
|
+
const tty = __webpack_require__("tty");
|
|
510
|
+
const util = __webpack_require__("util");
|
|
511
|
+
exports.init = init;
|
|
512
|
+
exports.log = log;
|
|
513
|
+
exports.formatArgs = formatArgs;
|
|
514
|
+
exports.save = save;
|
|
515
|
+
exports.load = load;
|
|
516
|
+
exports.useColors = useColors;
|
|
517
|
+
exports.destroy = util.deprecate(()=>{}, 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
518
|
+
exports.colors = [
|
|
519
|
+
6,
|
|
520
|
+
2,
|
|
521
|
+
3,
|
|
522
|
+
4,
|
|
523
|
+
5,
|
|
524
|
+
1
|
|
525
|
+
];
|
|
526
|
+
try {
|
|
527
|
+
const supportsColor = __webpack_require__("../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js");
|
|
528
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports.colors = [
|
|
529
|
+
20,
|
|
530
|
+
21,
|
|
531
|
+
26,
|
|
532
|
+
27,
|
|
533
|
+
32,
|
|
534
|
+
33,
|
|
535
|
+
38,
|
|
536
|
+
39,
|
|
537
|
+
40,
|
|
538
|
+
41,
|
|
539
|
+
42,
|
|
540
|
+
43,
|
|
541
|
+
44,
|
|
542
|
+
45,
|
|
543
|
+
56,
|
|
544
|
+
57,
|
|
545
|
+
62,
|
|
546
|
+
63,
|
|
547
|
+
68,
|
|
548
|
+
69,
|
|
549
|
+
74,
|
|
550
|
+
75,
|
|
551
|
+
76,
|
|
552
|
+
77,
|
|
553
|
+
78,
|
|
554
|
+
79,
|
|
555
|
+
80,
|
|
556
|
+
81,
|
|
557
|
+
92,
|
|
558
|
+
93,
|
|
559
|
+
98,
|
|
560
|
+
99,
|
|
561
|
+
112,
|
|
562
|
+
113,
|
|
563
|
+
128,
|
|
564
|
+
129,
|
|
565
|
+
134,
|
|
566
|
+
135,
|
|
567
|
+
148,
|
|
568
|
+
149,
|
|
569
|
+
160,
|
|
570
|
+
161,
|
|
571
|
+
162,
|
|
572
|
+
163,
|
|
573
|
+
164,
|
|
574
|
+
165,
|
|
575
|
+
166,
|
|
576
|
+
167,
|
|
577
|
+
168,
|
|
578
|
+
169,
|
|
579
|
+
170,
|
|
580
|
+
171,
|
|
581
|
+
172,
|
|
582
|
+
173,
|
|
583
|
+
178,
|
|
584
|
+
179,
|
|
585
|
+
184,
|
|
586
|
+
185,
|
|
587
|
+
196,
|
|
588
|
+
197,
|
|
589
|
+
198,
|
|
590
|
+
199,
|
|
591
|
+
200,
|
|
592
|
+
201,
|
|
593
|
+
202,
|
|
594
|
+
203,
|
|
595
|
+
204,
|
|
596
|
+
205,
|
|
597
|
+
206,
|
|
598
|
+
207,
|
|
599
|
+
208,
|
|
600
|
+
209,
|
|
601
|
+
214,
|
|
602
|
+
215,
|
|
603
|
+
220,
|
|
604
|
+
221
|
|
605
|
+
];
|
|
606
|
+
} catch (error) {}
|
|
607
|
+
exports.inspectOpts = Object.keys(process.env).filter((key)=>/^debug_/i.test(key)).reduce((obj, key)=>{
|
|
608
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k)=>k.toUpperCase());
|
|
609
|
+
let val = process.env[key];
|
|
610
|
+
val = /^(yes|on|true|enabled)$/i.test(val) ? true : /^(no|off|false|disabled)$/i.test(val) ? false : 'null' === val ? null : Number(val);
|
|
611
|
+
obj[prop] = val;
|
|
612
|
+
return obj;
|
|
613
|
+
}, {});
|
|
614
|
+
function useColors() {
|
|
615
|
+
return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
616
|
+
}
|
|
617
|
+
function formatArgs(args) {
|
|
618
|
+
const { namespace: name, useColors } = this;
|
|
619
|
+
if (useColors) {
|
|
620
|
+
const c = this.color;
|
|
621
|
+
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
622
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
623
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
624
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
625
|
+
} else args[0] = getDate() + name + ' ' + args[0];
|
|
626
|
+
}
|
|
627
|
+
function getDate() {
|
|
628
|
+
if (exports.inspectOpts.hideDate) return '';
|
|
629
|
+
return new Date().toISOString() + ' ';
|
|
630
|
+
}
|
|
631
|
+
function log(...args) {
|
|
632
|
+
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
|
|
633
|
+
}
|
|
634
|
+
function save(namespaces) {
|
|
635
|
+
if (namespaces) process.env.DEBUG = namespaces;
|
|
636
|
+
else delete process.env.DEBUG;
|
|
637
|
+
}
|
|
638
|
+
function load() {
|
|
639
|
+
return process.env.DEBUG;
|
|
640
|
+
}
|
|
641
|
+
function init(debug) {
|
|
642
|
+
debug.inspectOpts = {};
|
|
643
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
644
|
+
for(let i = 0; i < keys.length; i++)debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
645
|
+
}
|
|
646
|
+
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);
|
|
647
|
+
const { formatters } = module.exports;
|
|
648
|
+
formatters.o = function(v) {
|
|
649
|
+
this.inspectOpts.colors = this.useColors;
|
|
650
|
+
return util.inspect(v, this.inspectOpts).split('\n').map((str)=>str.trim()).join(' ');
|
|
651
|
+
};
|
|
652
|
+
formatters.O = function(v) {
|
|
653
|
+
this.inspectOpts.colors = this.useColors;
|
|
654
|
+
return util.inspect(v, this.inspectOpts);
|
|
655
|
+
};
|
|
656
|
+
},
|
|
657
|
+
"../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js": function(module) {
|
|
658
|
+
module.exports = (flag, argv = process.argv)=>{
|
|
659
|
+
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
660
|
+
const position = argv.indexOf(prefix + flag);
|
|
661
|
+
const terminatorPosition = argv.indexOf('--');
|
|
662
|
+
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
663
|
+
};
|
|
664
|
+
},
|
|
665
|
+
"../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
666
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
667
|
+
if (void 0 === k2) k2 = k;
|
|
668
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
669
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
670
|
+
enumerable: true,
|
|
671
|
+
get: function() {
|
|
672
|
+
return m[k];
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
Object.defineProperty(o, k2, desc);
|
|
676
|
+
} : function(o, m, k, k2) {
|
|
677
|
+
if (void 0 === k2) k2 = k;
|
|
678
|
+
o[k2] = m[k];
|
|
679
|
+
});
|
|
680
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
681
|
+
Object.defineProperty(o, "default", {
|
|
682
|
+
enumerable: true,
|
|
683
|
+
value: v
|
|
684
|
+
});
|
|
685
|
+
} : function(o, v) {
|
|
686
|
+
o["default"] = v;
|
|
687
|
+
});
|
|
688
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
689
|
+
if (mod && mod.__esModule) return mod;
|
|
690
|
+
var result = {};
|
|
691
|
+
if (null != mod) {
|
|
692
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
693
|
+
}
|
|
694
|
+
__setModuleDefault(result, mod);
|
|
695
|
+
return result;
|
|
696
|
+
};
|
|
697
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
698
|
+
return mod && mod.__esModule ? mod : {
|
|
699
|
+
default: mod
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
Object.defineProperty(exports, "__esModule", {
|
|
703
|
+
value: true
|
|
704
|
+
});
|
|
705
|
+
exports.HttpsProxyAgent = void 0;
|
|
706
|
+
const net = __importStar(__webpack_require__("net"));
|
|
707
|
+
const tls = __importStar(__webpack_require__("tls"));
|
|
708
|
+
const assert_1 = __importDefault(__webpack_require__("assert"));
|
|
709
|
+
const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
|
|
710
|
+
const agent_base_1 = __webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js");
|
|
711
|
+
const url_1 = __webpack_require__("url");
|
|
712
|
+
const parse_proxy_response_1 = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js");
|
|
713
|
+
const debug = (0, debug_1.default)('https-proxy-agent');
|
|
714
|
+
const setServernameFromNonIpHost = (options)=>{
|
|
715
|
+
if (void 0 === options.servername && options.host && !net.isIP(options.host)) return {
|
|
716
|
+
...options,
|
|
717
|
+
servername: options.host
|
|
718
|
+
};
|
|
719
|
+
return options;
|
|
720
|
+
};
|
|
721
|
+
class HttpsProxyAgent extends agent_base_1.Agent {
|
|
722
|
+
constructor(proxy, opts){
|
|
723
|
+
super(opts);
|
|
724
|
+
this.options = {
|
|
725
|
+
path: void 0
|
|
726
|
+
};
|
|
727
|
+
this.proxy = 'string' == typeof proxy ? new url_1.URL(proxy) : proxy;
|
|
728
|
+
this.proxyHeaders = opts?.headers ?? {};
|
|
729
|
+
debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
|
|
730
|
+
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
|
|
731
|
+
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : 'https:' === this.proxy.protocol ? 443 : 80;
|
|
732
|
+
this.connectOpts = {
|
|
733
|
+
ALPNProtocols: [
|
|
734
|
+
'http/1.1'
|
|
735
|
+
],
|
|
736
|
+
...opts ? omit(opts, 'headers') : null,
|
|
737
|
+
host,
|
|
738
|
+
port
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
async connect(req, opts) {
|
|
742
|
+
const { proxy } = this;
|
|
743
|
+
if (!opts.host) throw new TypeError('No "host" provided');
|
|
744
|
+
let socket;
|
|
745
|
+
if ('https:' === proxy.protocol) {
|
|
746
|
+
debug('Creating `tls.Socket`: %o', this.connectOpts);
|
|
747
|
+
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
748
|
+
} else {
|
|
749
|
+
debug('Creating `net.Socket`: %o', this.connectOpts);
|
|
750
|
+
socket = net.connect(this.connectOpts);
|
|
751
|
+
}
|
|
752
|
+
const headers = 'function' == typeof this.proxyHeaders ? this.proxyHeaders() : {
|
|
753
|
+
...this.proxyHeaders
|
|
754
|
+
};
|
|
755
|
+
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
756
|
+
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
|
|
757
|
+
if (proxy.username || proxy.password) {
|
|
758
|
+
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
|
759
|
+
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;
|
|
760
|
+
}
|
|
761
|
+
headers.Host = `${host}:${opts.port}`;
|
|
762
|
+
if (!headers['Proxy-Connection']) headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close';
|
|
763
|
+
for (const name of Object.keys(headers))payload += `${name}: ${headers[name]}\r\n`;
|
|
764
|
+
const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
|
|
765
|
+
socket.write(`${payload}\r\n`);
|
|
766
|
+
const { connect, buffered } = await proxyResponsePromise;
|
|
767
|
+
req.emit('proxyConnect', connect);
|
|
768
|
+
this.emit('proxyConnect', connect, req);
|
|
769
|
+
if (200 === connect.statusCode) {
|
|
770
|
+
req.once('socket', resume);
|
|
771
|
+
if (opts.secureEndpoint) {
|
|
772
|
+
debug('Upgrading socket connection to TLS');
|
|
773
|
+
return tls.connect({
|
|
774
|
+
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
|
|
775
|
+
socket
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
return socket;
|
|
779
|
+
}
|
|
780
|
+
socket.destroy();
|
|
781
|
+
const fakeSocket = new net.Socket({
|
|
782
|
+
writable: false
|
|
783
|
+
});
|
|
784
|
+
fakeSocket.readable = true;
|
|
785
|
+
req.once('socket', (s)=>{
|
|
786
|
+
debug('Replaying proxy buffer for failed request');
|
|
787
|
+
(0, assert_1.default)(s.listenerCount('data') > 0);
|
|
788
|
+
s.push(buffered);
|
|
789
|
+
s.push(null);
|
|
790
|
+
});
|
|
791
|
+
return fakeSocket;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
HttpsProxyAgent.protocols = [
|
|
795
|
+
'http',
|
|
796
|
+
'https'
|
|
797
|
+
];
|
|
798
|
+
exports.HttpsProxyAgent = HttpsProxyAgent;
|
|
799
|
+
function resume(socket) {
|
|
800
|
+
socket.resume();
|
|
801
|
+
}
|
|
802
|
+
function omit(obj, ...keys) {
|
|
803
|
+
const ret = {};
|
|
804
|
+
let key;
|
|
805
|
+
for(key in obj)if (!keys.includes(key)) ret[key] = obj[key];
|
|
806
|
+
return ret;
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
"../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
810
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
811
|
+
return mod && mod.__esModule ? mod : {
|
|
812
|
+
default: mod
|
|
813
|
+
};
|
|
814
|
+
};
|
|
815
|
+
Object.defineProperty(exports, "__esModule", {
|
|
816
|
+
value: true
|
|
817
|
+
});
|
|
818
|
+
exports.parseProxyResponse = void 0;
|
|
819
|
+
const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
|
|
820
|
+
const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response');
|
|
821
|
+
function parseProxyResponse(socket) {
|
|
822
|
+
return new Promise((resolve, reject)=>{
|
|
823
|
+
let buffersLength = 0;
|
|
824
|
+
const buffers = [];
|
|
825
|
+
function read() {
|
|
826
|
+
const b = socket.read();
|
|
827
|
+
if (b) ondata(b);
|
|
828
|
+
else socket.once('readable', read);
|
|
829
|
+
}
|
|
830
|
+
function cleanup() {
|
|
831
|
+
socket.removeListener('end', onend);
|
|
832
|
+
socket.removeListener('error', onerror);
|
|
833
|
+
socket.removeListener('readable', read);
|
|
834
|
+
}
|
|
835
|
+
function onend() {
|
|
836
|
+
cleanup();
|
|
837
|
+
debug('onend');
|
|
838
|
+
reject(new Error('Proxy connection ended before receiving CONNECT response'));
|
|
839
|
+
}
|
|
840
|
+
function onerror(err) {
|
|
841
|
+
cleanup();
|
|
842
|
+
debug('onerror %o', err);
|
|
843
|
+
reject(err);
|
|
844
|
+
}
|
|
845
|
+
function ondata(b) {
|
|
846
|
+
buffers.push(b);
|
|
847
|
+
buffersLength += b.length;
|
|
848
|
+
const buffered = Buffer.concat(buffers, buffersLength);
|
|
849
|
+
const endOfHeaders = buffered.indexOf('\r\n\r\n');
|
|
850
|
+
if (-1 === endOfHeaders) {
|
|
851
|
+
debug('have not received end of HTTP headers yet...');
|
|
852
|
+
read();
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n');
|
|
856
|
+
const firstLine = headerParts.shift();
|
|
857
|
+
if (!firstLine) {
|
|
858
|
+
socket.destroy();
|
|
859
|
+
return reject(new Error('No header received from proxy CONNECT response'));
|
|
860
|
+
}
|
|
861
|
+
const firstLineParts = firstLine.split(' ');
|
|
862
|
+
const statusCode = +firstLineParts[1];
|
|
863
|
+
const statusText = firstLineParts.slice(2).join(' ');
|
|
864
|
+
const headers = {};
|
|
865
|
+
for (const header of headerParts){
|
|
866
|
+
if (!header) continue;
|
|
867
|
+
const firstColon = header.indexOf(':');
|
|
868
|
+
if (-1 === firstColon) {
|
|
869
|
+
socket.destroy();
|
|
870
|
+
return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
871
|
+
}
|
|
872
|
+
const key = header.slice(0, firstColon).toLowerCase();
|
|
873
|
+
const value = header.slice(firstColon + 1).trimStart();
|
|
874
|
+
const current = headers[key];
|
|
875
|
+
if ('string' == typeof current) headers[key] = [
|
|
876
|
+
current,
|
|
877
|
+
value
|
|
878
|
+
];
|
|
879
|
+
else if (Array.isArray(current)) current.push(value);
|
|
880
|
+
else headers[key] = value;
|
|
881
|
+
}
|
|
882
|
+
debug('got proxy server response: %o %o', firstLine, headers);
|
|
883
|
+
cleanup();
|
|
884
|
+
resolve({
|
|
885
|
+
connect: {
|
|
886
|
+
statusCode,
|
|
887
|
+
statusText,
|
|
888
|
+
headers
|
|
889
|
+
},
|
|
890
|
+
buffered
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
socket.on('error', onerror);
|
|
894
|
+
socket.on('end', onend);
|
|
895
|
+
read();
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
exports.parseProxyResponse = parseProxyResponse;
|
|
899
|
+
},
|
|
900
|
+
"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js": function(module) {
|
|
901
|
+
var s = 1000;
|
|
902
|
+
var m = 60 * s;
|
|
903
|
+
var h = 60 * m;
|
|
904
|
+
var d = 24 * h;
|
|
905
|
+
var w = 7 * d;
|
|
906
|
+
var y = 365.25 * d;
|
|
907
|
+
module.exports = function(val, options) {
|
|
908
|
+
options = options || {};
|
|
909
|
+
var type = typeof val;
|
|
910
|
+
if ('string' === type && val.length > 0) return parse(val);
|
|
911
|
+
if ('number' === type && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
|
|
912
|
+
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
|
|
913
|
+
};
|
|
914
|
+
function parse(str) {
|
|
915
|
+
str = String(str);
|
|
916
|
+
if (str.length > 100) return;
|
|
917
|
+
var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
|
|
918
|
+
if (!match) return;
|
|
919
|
+
var n = parseFloat(match[1]);
|
|
920
|
+
var type = (match[2] || 'ms').toLowerCase();
|
|
921
|
+
switch(type){
|
|
922
|
+
case 'years':
|
|
923
|
+
case 'year':
|
|
924
|
+
case 'yrs':
|
|
925
|
+
case 'yr':
|
|
926
|
+
case 'y':
|
|
927
|
+
return n * y;
|
|
928
|
+
case 'weeks':
|
|
929
|
+
case 'week':
|
|
930
|
+
case 'w':
|
|
931
|
+
return n * w;
|
|
932
|
+
case 'days':
|
|
933
|
+
case 'day':
|
|
934
|
+
case 'd':
|
|
935
|
+
return n * d;
|
|
936
|
+
case 'hours':
|
|
937
|
+
case 'hour':
|
|
938
|
+
case 'hrs':
|
|
939
|
+
case 'hr':
|
|
940
|
+
case 'h':
|
|
941
|
+
return n * h;
|
|
942
|
+
case 'minutes':
|
|
943
|
+
case 'minute':
|
|
944
|
+
case 'mins':
|
|
945
|
+
case 'min':
|
|
946
|
+
case 'm':
|
|
947
|
+
return n * m;
|
|
948
|
+
case 'seconds':
|
|
949
|
+
case 'second':
|
|
950
|
+
case 'secs':
|
|
951
|
+
case 'sec':
|
|
952
|
+
case 's':
|
|
953
|
+
return n * s;
|
|
954
|
+
case 'milliseconds':
|
|
955
|
+
case 'millisecond':
|
|
956
|
+
case 'msecs':
|
|
957
|
+
case 'msec':
|
|
958
|
+
case 'ms':
|
|
959
|
+
return n;
|
|
960
|
+
default:
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
function fmtShort(ms) {
|
|
965
|
+
var msAbs = Math.abs(ms);
|
|
966
|
+
if (msAbs >= d) return Math.round(ms / d) + 'd';
|
|
967
|
+
if (msAbs >= h) return Math.round(ms / h) + 'h';
|
|
968
|
+
if (msAbs >= m) return Math.round(ms / m) + 'm';
|
|
969
|
+
if (msAbs >= s) return Math.round(ms / s) + 's';
|
|
970
|
+
return ms + 'ms';
|
|
971
|
+
}
|
|
972
|
+
function fmtLong(ms) {
|
|
973
|
+
var msAbs = Math.abs(ms);
|
|
974
|
+
if (msAbs >= d) return plural(ms, msAbs, d, 'day');
|
|
975
|
+
if (msAbs >= h) return plural(ms, msAbs, h, 'hour');
|
|
976
|
+
if (msAbs >= m) return plural(ms, msAbs, m, 'minute');
|
|
977
|
+
if (msAbs >= s) return plural(ms, msAbs, s, 'second');
|
|
978
|
+
return ms + ' ms';
|
|
979
|
+
}
|
|
980
|
+
function plural(ms, msAbs, n, name) {
|
|
981
|
+
var isPlural = msAbs >= 1.5 * n;
|
|
982
|
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
"../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
986
|
+
const os = __webpack_require__("os");
|
|
987
|
+
const tty = __webpack_require__("tty");
|
|
988
|
+
const hasFlag = __webpack_require__("../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js");
|
|
989
|
+
const { env } = process;
|
|
990
|
+
let flagForceColor;
|
|
991
|
+
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
|
|
992
|
+
else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
|
|
993
|
+
function envForceColor() {
|
|
994
|
+
if ('FORCE_COLOR' in env) {
|
|
995
|
+
if ('true' === env.FORCE_COLOR) return 1;
|
|
996
|
+
if ('false' === env.FORCE_COLOR) return 0;
|
|
997
|
+
return 0 === env.FORCE_COLOR.length ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
function translateLevel(level) {
|
|
1001
|
+
if (0 === level) return false;
|
|
1002
|
+
return {
|
|
1003
|
+
level,
|
|
1004
|
+
hasBasic: true,
|
|
1005
|
+
has256: level >= 2,
|
|
1006
|
+
has16m: level >= 3
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
1010
|
+
const noFlagForceColor = envForceColor();
|
|
1011
|
+
if (void 0 !== noFlagForceColor) flagForceColor = noFlagForceColor;
|
|
1012
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
1013
|
+
if (0 === forceColor) return 0;
|
|
1014
|
+
if (sniffFlags) {
|
|
1015
|
+
if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) return 3;
|
|
1016
|
+
if (hasFlag('color=256')) return 2;
|
|
1017
|
+
}
|
|
1018
|
+
if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
|
|
1019
|
+
const min = forceColor || 0;
|
|
1020
|
+
if ('dumb' === env.TERM) return min;
|
|
1021
|
+
if ('win32' === process.platform) {
|
|
1022
|
+
const osRelease = os.release().split('.');
|
|
1023
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1024
|
+
return 1;
|
|
1025
|
+
}
|
|
1026
|
+
if ('CI' in env) {
|
|
1027
|
+
if ([
|
|
1028
|
+
'TRAVIS',
|
|
1029
|
+
'CIRCLECI',
|
|
1030
|
+
'APPVEYOR',
|
|
1031
|
+
'GITLAB_CI',
|
|
1032
|
+
'GITHUB_ACTIONS',
|
|
1033
|
+
'BUILDKITE',
|
|
1034
|
+
'DRONE'
|
|
1035
|
+
].some((sign)=>sign in env) || 'codeship' === env.CI_NAME) return 1;
|
|
1036
|
+
return min;
|
|
1037
|
+
}
|
|
1038
|
+
if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
1039
|
+
if ('truecolor' === env.COLORTERM) return 3;
|
|
1040
|
+
if ('TERM_PROGRAM' in env) {
|
|
1041
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
1042
|
+
switch(env.TERM_PROGRAM){
|
|
1043
|
+
case 'iTerm.app':
|
|
1044
|
+
return version >= 3 ? 3 : 2;
|
|
1045
|
+
case 'Apple_Terminal':
|
|
1046
|
+
return 2;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
1050
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
1051
|
+
if ('COLORTERM' in env) return 1;
|
|
1052
|
+
return min;
|
|
1053
|
+
}
|
|
1054
|
+
function getSupportLevel(stream, options = {}) {
|
|
1055
|
+
const level = supportsColor(stream, {
|
|
1056
|
+
streamIsTTY: stream && stream.isTTY,
|
|
1057
|
+
...options
|
|
1058
|
+
});
|
|
1059
|
+
return translateLevel(level);
|
|
1060
|
+
}
|
|
1061
|
+
module.exports = {
|
|
1062
|
+
supportsColor: getSupportLevel,
|
|
1063
|
+
stdout: getSupportLevel({
|
|
1064
|
+
isTTY: tty.isatty(1)
|
|
1065
|
+
}),
|
|
1066
|
+
stderr: getSupportLevel({
|
|
1067
|
+
isTTY: tty.isatty(2)
|
|
1068
|
+
})
|
|
1069
|
+
};
|
|
1070
|
+
},
|
|
13
1071
|
"./src/utils/XhsXsCommonEnc.js": function(module) {
|
|
14
1072
|
var encrypt_lookup = [
|
|
15
1073
|
"Z",
|
|
@@ -1757,6 +2815,33 @@ var __webpack_modules__ = {
|
|
|
1757
2815
|
return Data2A_B(Base2Data(EnvData2CharCode(_0x315138, _0x1c32b3, _0x56536b)));
|
|
1758
2816
|
}
|
|
1759
2817
|
module[a0_0x45db08(0xae)] = GenAB;
|
|
2818
|
+
},
|
|
2819
|
+
assert: function(module) {
|
|
2820
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_assert__;
|
|
2821
|
+
},
|
|
2822
|
+
http: function(module) {
|
|
2823
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_http__;
|
|
2824
|
+
},
|
|
2825
|
+
https: function(module) {
|
|
2826
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_https__;
|
|
2827
|
+
},
|
|
2828
|
+
net: function(module) {
|
|
2829
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_net__;
|
|
2830
|
+
},
|
|
2831
|
+
os: function(module) {
|
|
2832
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_os__;
|
|
2833
|
+
},
|
|
2834
|
+
tls: function(module) {
|
|
2835
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_tls__;
|
|
2836
|
+
},
|
|
2837
|
+
tty: function(module) {
|
|
2838
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_tty__;
|
|
2839
|
+
},
|
|
2840
|
+
url: function(module) {
|
|
2841
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_url__;
|
|
2842
|
+
},
|
|
2843
|
+
util: function(module) {
|
|
2844
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_util__;
|
|
1760
2845
|
}
|
|
1761
2846
|
};
|
|
1762
2847
|
var __webpack_module_cache__ = {};
|
|
@@ -1768,7 +2853,7 @@ function __webpack_require__(moduleId) {
|
|
|
1768
2853
|
loaded: false,
|
|
1769
2854
|
exports: {}
|
|
1770
2855
|
};
|
|
1771
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
2856
|
+
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
1772
2857
|
module.loaded = true;
|
|
1773
2858
|
return module.exports;
|
|
1774
2859
|
}
|
|
@@ -1779,6 +2864,28 @@ function __webpack_require__(moduleId) {
|
|
|
1779
2864
|
return module;
|
|
1780
2865
|
};
|
|
1781
2866
|
})();
|
|
2867
|
+
var dist = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js");
|
|
2868
|
+
const ProxyData = {
|
|
2869
|
+
api: "202101291430286754",
|
|
2870
|
+
md5akey: "6ec8d333e85044b7",
|
|
2871
|
+
akey: "91709114"
|
|
2872
|
+
};
|
|
2873
|
+
const ProxyAgent = async (adr, huiwenToken)=>{
|
|
2874
|
+
const http = new Http({});
|
|
2875
|
+
let ProxyInfo = await http.api({
|
|
2876
|
+
method: "GET",
|
|
2877
|
+
url: "https://preview.huiwen.top/api/publish/zdy/ip",
|
|
2878
|
+
params: {
|
|
2879
|
+
addr: adr
|
|
2880
|
+
},
|
|
2881
|
+
...huiwenToken ? {
|
|
2882
|
+
headers: {
|
|
2883
|
+
token: huiwenToken
|
|
2884
|
+
}
|
|
2885
|
+
} : null
|
|
2886
|
+
});
|
|
2887
|
+
return 0 === ProxyInfo.code && ProxyInfo.data.length > 0 ? new dist.HttpsProxyAgent(`http://${ProxyData.api}:${ProxyData.akey}@${ProxyInfo.data[0].proxyAddress}`) : null;
|
|
2888
|
+
};
|
|
1782
2889
|
class Http {
|
|
1783
2890
|
static handleApiError(error) {
|
|
1784
2891
|
if (error && "object" == typeof error && "code" in error && "message" in error) return error;
|
|
@@ -1788,10 +2895,12 @@ class Http {
|
|
|
1788
2895
|
data: error
|
|
1789
2896
|
};
|
|
1790
2897
|
}
|
|
1791
|
-
constructor(config){
|
|
2898
|
+
constructor(config, adr, huiwenToken){
|
|
1792
2899
|
this.apiClient = __WEBPACK_EXTERNAL_MODULE_axios__["default"].create({
|
|
1793
2900
|
...config
|
|
1794
2901
|
});
|
|
2902
|
+
this.adr = adr;
|
|
2903
|
+
this.heiwenToken = huiwenToken;
|
|
1795
2904
|
}
|
|
1796
2905
|
addResponseInterceptor(findError) {
|
|
1797
2906
|
this.apiClient.interceptors.response.use((response)=>{
|
|
@@ -1820,16 +2929,60 @@ class Http {
|
|
|
1820
2929
|
errorResponse.data = serverError;
|
|
1821
2930
|
}
|
|
1822
2931
|
}
|
|
2932
|
+
if (error.code) switch(error.code){
|
|
2933
|
+
case "ECONNRESET":
|
|
2934
|
+
errorResponse.message = "连接被重置,请检查网络或稍后重试!";
|
|
2935
|
+
break;
|
|
2936
|
+
case "ENOTFOUND":
|
|
2937
|
+
errorResponse.message = "域名解析失败,请检查 URL 是否正确!";
|
|
2938
|
+
break;
|
|
2939
|
+
case "ETIMEDOUT":
|
|
2940
|
+
errorResponse.message = "网络请求超时,请检查网络连接!";
|
|
2941
|
+
break;
|
|
2942
|
+
case "ECONNREFUSED":
|
|
2943
|
+
errorResponse.message = "服务器拒绝连接,请稍后重试!";
|
|
2944
|
+
break;
|
|
2945
|
+
case "EAI_AGAIN":
|
|
2946
|
+
errorResponse.message = "DNS 查询超时,请稍后重试!";
|
|
2947
|
+
break;
|
|
2948
|
+
default:
|
|
2949
|
+
errorResponse.message = `网络错误: ${error.message}`;
|
|
2950
|
+
break;
|
|
2951
|
+
}
|
|
1823
2952
|
return Promise.reject(errorResponse);
|
|
1824
2953
|
});
|
|
1825
2954
|
}
|
|
1826
|
-
async api(config) {
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
2955
|
+
async api(config, options) {
|
|
2956
|
+
const retries = options?.retries ?? 0;
|
|
2957
|
+
const retryDelay = options?.retryDelay ?? 500;
|
|
2958
|
+
const sessionRt = async (Rtimes)=>{
|
|
2959
|
+
try {
|
|
2960
|
+
const agent = this.adr ? await ProxyAgent(this.adr, this.heiwenToken) : void 0;
|
|
2961
|
+
if (this.adr && null == agent) return Promise.reject({
|
|
2962
|
+
code: 200,
|
|
2963
|
+
message: "当前发文IP地址暂不支持!"
|
|
2964
|
+
});
|
|
2965
|
+
this.proxyInfo = agent?.proxy.host;
|
|
2966
|
+
const response = await this.apiClient({
|
|
2967
|
+
...config,
|
|
2968
|
+
...agent ? {
|
|
2969
|
+
httpAgent: agent,
|
|
2970
|
+
httpsAgent: agent
|
|
2971
|
+
} : {}
|
|
2972
|
+
});
|
|
2973
|
+
return response.data;
|
|
2974
|
+
} catch (error) {
|
|
2975
|
+
const handledError = Http.handleApiError(error);
|
|
2976
|
+
const isRetry = handledError.code >= 500 || 0 === handledError.code;
|
|
2977
|
+
if (Rtimes < retries && isRetry) {
|
|
2978
|
+
console.log("Loger: 进入重试!");
|
|
2979
|
+
await new Promise((resolve)=>setTimeout(resolve, retryDelay));
|
|
2980
|
+
return sessionRt(Rtimes + 1);
|
|
2981
|
+
}
|
|
2982
|
+
return Promise.reject(handledError);
|
|
2983
|
+
}
|
|
2984
|
+
};
|
|
2985
|
+
return sessionRt(0);
|
|
1833
2986
|
}
|
|
1834
2987
|
}
|
|
1835
2988
|
function getRandomInRange(min, max) {
|
|
@@ -2033,6 +3186,69 @@ const parseUrlQueryString = (url)=>{
|
|
|
2033
3186
|
return queryStringObject;
|
|
2034
3187
|
};
|
|
2035
3188
|
const defaultParams = (params, defaults)=>Object.assign({}, defaults, params);
|
|
3189
|
+
const generateTopicHtml = function(topic, id, sv_small_images) {
|
|
3190
|
+
const generateUid = function() {
|
|
3191
|
+
const e = ()=>Math.floor(65536 * (1 + Math.random())).toString(16).substring(1);
|
|
3192
|
+
return e() + e() + e() + e() + e() + e() + e() + e();
|
|
3193
|
+
};
|
|
3194
|
+
const topicBase = function(topic, id, sv_small_images) {
|
|
3195
|
+
const t = function(r) {
|
|
3196
|
+
let n = [];
|
|
3197
|
+
let e = 0;
|
|
3198
|
+
for(; e < 256; ++e)n[e] = (e + 256).toString(16).substr(1);
|
|
3199
|
+
let o = 0;
|
|
3200
|
+
return [
|
|
3201
|
+
n[r[o++]],
|
|
3202
|
+
n[r[o++]],
|
|
3203
|
+
n[r[o++]],
|
|
3204
|
+
n[r[o++]],
|
|
3205
|
+
"-",
|
|
3206
|
+
n[r[o++]],
|
|
3207
|
+
n[r[o++]],
|
|
3208
|
+
"-",
|
|
3209
|
+
n[r[o++]],
|
|
3210
|
+
n[r[o++]],
|
|
3211
|
+
"-",
|
|
3212
|
+
n[r[o++]],
|
|
3213
|
+
n[r[o++]],
|
|
3214
|
+
"-",
|
|
3215
|
+
n[r[o++]],
|
|
3216
|
+
n[r[o++]],
|
|
3217
|
+
n[r[o++]],
|
|
3218
|
+
n[r[o++]],
|
|
3219
|
+
n[r[o++]],
|
|
3220
|
+
n[r[o++]]
|
|
3221
|
+
].join("");
|
|
3222
|
+
};
|
|
3223
|
+
const s = __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__["default"].randomBytes(16);
|
|
3224
|
+
s[6] = 15 & s[6] | 64, s[8] = 63 & s[8] | 128;
|
|
3225
|
+
return {
|
|
3226
|
+
id: id || t(s),
|
|
3227
|
+
sv_small_images: sv_small_images || "",
|
|
3228
|
+
title: topic.replace(/[^\u4E00-\u9FA5a-zA-Z0-9]/g, ""),
|
|
3229
|
+
isCreate: 1
|
|
3230
|
+
};
|
|
3231
|
+
};
|
|
3232
|
+
const n = id ? topicBase(topic, id, sv_small_images) : topicBase(topic);
|
|
3233
|
+
const topicAttr = {
|
|
3234
|
+
style: "border:none;display:inline-block;color:#3E5599;text-decoration:none;font-style:normal;",
|
|
3235
|
+
href: `https://m.baidu.com/s?word=%23${n.title}%23&topic_id=${n.id}&sa=edit&sfrom=1023524a&append=1&newwindow=0&upqrade=1`.replace(/&/g, "&"),
|
|
3236
|
+
target: "_blank",
|
|
3237
|
+
"data-bjh-cover": "".concat(n.sv_small_images && (n.sv_small_images.https || n.sv_small_images.http)),
|
|
3238
|
+
"data-bjh-src": `https://m.baidu.com/s?word=%23${n.title}%23&topic_id=${n.id}&sa=edit&sfrom=1023524a&append=1&newwindow=0&upqrade=1`.replace(/&/g, "&"),
|
|
3239
|
+
"data-bjh-box": "topic",
|
|
3240
|
+
"data-bjh-title": n.title,
|
|
3241
|
+
"data-bjh-id": id || n.id,
|
|
3242
|
+
"data-bjh-type": "topic",
|
|
3243
|
+
contenteditable: "false",
|
|
3244
|
+
"data-ignore-remove-style": "1",
|
|
3245
|
+
"data-bjh-create": id ? "0" : "1",
|
|
3246
|
+
"data-bjh-adinspiration": "0",
|
|
3247
|
+
"data-diagnose-id": generateUid()
|
|
3248
|
+
};
|
|
3249
|
+
const attrStr = Object.entries(topicAttr).map(([key, val])=>`${key}="${val}"`).join(" ");
|
|
3250
|
+
return `<p><span data-diagnose-id=${generateUid()}></span><a ${attrStr}>#${n.title}#</a></p>`;
|
|
3251
|
+
};
|
|
2036
3252
|
const errnoMap = {
|
|
2037
3253
|
20040706: "正文图片和封面图片推荐jpg、png格式。",
|
|
2038
3254
|
20040084: "正文图片和封面图片推荐jpg、png格式。",
|
|
@@ -2047,16 +3263,19 @@ const errnoMap = {
|
|
|
2047
3263
|
20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
|
|
2048
3264
|
20040124: "服务器异常,请稍后重试!",
|
|
2049
3265
|
20040001: "当前用户未登录,请登陆后重试!",
|
|
2050
|
-
401100025: "该应用不支持此媒资类型"
|
|
3266
|
+
401100025: "该应用不支持此媒资类型",
|
|
3267
|
+
401100033: "图片宽高不满足要求",
|
|
3268
|
+
'-6': "文章分类信息错误"
|
|
2051
3269
|
};
|
|
2052
3270
|
const mockAction = async (task, params)=>{
|
|
2053
3271
|
const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
|
|
2054
3272
|
const tmpCachePath = task.getTmpPath();
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
3273
|
+
const headers = {
|
|
3274
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3275
|
+
token: params.token
|
|
3276
|
+
};
|
|
3277
|
+
let http = new Http({
|
|
3278
|
+
headers
|
|
2060
3279
|
});
|
|
2061
3280
|
http.addResponseInterceptor((response)=>{
|
|
2062
3281
|
const msgType = "draft" === params.saveType ? "同步" : "发布";
|
|
@@ -2108,7 +3327,21 @@ const mockAction = async (task, params)=>{
|
|
|
2108
3327
|
};
|
|
2109
3328
|
const originContentImages = extractImgTag(params.content);
|
|
2110
3329
|
const targetContentImages = await uploadImages(originContentImages);
|
|
2111
|
-
|
|
3330
|
+
if (params.settingInfo.baijiahaoTopic && !params.settingInfo.baijiahaoTopic?.id) {
|
|
3331
|
+
let topicCheck = await http.api({
|
|
3332
|
+
method: "get",
|
|
3333
|
+
url: "https://baijiahao.baidu.com/pcui/topic/topiccheck",
|
|
3334
|
+
params: {
|
|
3335
|
+
topicName: params.settingInfo.baijiahaoTopic?.title
|
|
3336
|
+
}
|
|
3337
|
+
});
|
|
3338
|
+
if (0 != topicCheck.errno) return {
|
|
3339
|
+
code: 200,
|
|
3340
|
+
message: topicCheck.errmsg,
|
|
3341
|
+
data: ''
|
|
3342
|
+
};
|
|
3343
|
+
}
|
|
3344
|
+
const content = replaceImgSrc(params.settingInfo?.baijiahaoTopic && params.settingInfo.baijiahaoTopic?.title ? params.content + generateTopicHtml(params.settingInfo?.baijiahaoTopic?.title, params.settingInfo?.baijiahaoTopic?.id || "", params.settingInfo.baijiahaoTopic?.sv_small_images || "") : params.content, (dom)=>{
|
|
2112
3345
|
if (dom.attribs.src) {
|
|
2113
3346
|
const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
|
|
2114
3347
|
dom.attribs.src = targetContentImages[idx].bos_url;
|
|
@@ -2168,11 +3401,23 @@ const mockAction = async (task, params)=>{
|
|
|
2168
3401
|
activity_list,
|
|
2169
3402
|
...params.settingInfo.timer ? {
|
|
2170
3403
|
timer_time: params.settingInfo.timer
|
|
3404
|
+
} : {},
|
|
3405
|
+
...params.settingInfo.baijiahaoCms ? {
|
|
3406
|
+
'cate_user_cms[0]': params.settingInfo.baijiahaoCms[0],
|
|
3407
|
+
'cate_user_cms[1]': params.settingInfo.baijiahaoCms[1]
|
|
3408
|
+
} : {},
|
|
3409
|
+
...params.settingInfo.baijiahaoEventSpec ? {
|
|
3410
|
+
'event_spec[time]': params.settingInfo.baijiahaoEventSpec.time,
|
|
3411
|
+
'event_spec[pos]': params.settingInfo.baijiahaoEventSpec.pos
|
|
2171
3412
|
} : {}
|
|
2172
3413
|
};
|
|
2173
3414
|
const isDraft = "draft" === params.saveType;
|
|
2174
3415
|
const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
|
|
2175
|
-
|
|
3416
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3417
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
3418
|
+
headers
|
|
3419
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
3420
|
+
const res = await proxyHttp.api({
|
|
2176
3421
|
method: "post",
|
|
2177
3422
|
url: saveUrl,
|
|
2178
3423
|
data: publishData,
|
|
@@ -2182,8 +3427,11 @@ const mockAction = async (task, params)=>{
|
|
|
2182
3427
|
referer: "https://baijiahao.baidu.com/builder/rc/edit?type=news"
|
|
2183
3428
|
},
|
|
2184
3429
|
defaultErrorMsg: isDraft ? "文章同步出现异常,请稍后重试。" : "文章发布出现异常,请稍后重试。"
|
|
3430
|
+
}, {
|
|
3431
|
+
retries: 2,
|
|
3432
|
+
retryDelay: 500
|
|
2185
3433
|
});
|
|
2186
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res.ret
|
|
3434
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 == res.errno ? res?.ret?.article_id || '' : "", 0 == res.errno ? `文章发布成功!` + (proxyHttp.proxyInfo || "") : res.errmsg ?? '文章发布失败,请稍后重试。');
|
|
2187
3435
|
};
|
|
2188
3436
|
const rpaAction = async (task, params)=>{
|
|
2189
3437
|
const tmpCachePath = task.getTmpPath();
|
|
@@ -2309,6 +3557,7 @@ const rpaAction = async (task, params)=>{
|
|
|
2309
3557
|
}
|
|
2310
3558
|
};
|
|
2311
3559
|
page.on("response", handleResponse);
|
|
3560
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
2312
3561
|
const operatorContainer = page.locator(".editor-component-operator");
|
|
2313
3562
|
if ("draft" === params.saveType) await operatorContainer.locator(".op-btn-outter-content").filter({
|
|
2314
3563
|
hasText: "存草稿"
|
|
@@ -3047,12 +4296,13 @@ const get3101DetailError = (errorList, message, saveType)=>{
|
|
|
3047
4296
|
const mock_mockAction = async (task, params)=>{
|
|
3048
4297
|
const { toutiaoSingleCover, toutiaoMultCover, toutiaoCoverType, toutiaoOriginal, toutiaoExclusive, toutiaoClaim } = params.settingInfo;
|
|
3049
4298
|
const tmpCachePath = task.getTmpPath();
|
|
4299
|
+
const headers = {
|
|
4300
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
4301
|
+
origin: "https://mp.toutiao.com",
|
|
4302
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
4303
|
+
};
|
|
3050
4304
|
const http = new Http({
|
|
3051
|
-
headers
|
|
3052
|
-
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3053
|
-
origin: "https://mp.toutiao.com",
|
|
3054
|
-
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
3055
|
-
}
|
|
4305
|
+
headers
|
|
3056
4306
|
});
|
|
3057
4307
|
http.addResponseInterceptor((response)=>{
|
|
3058
4308
|
if (response.data?.code !== 0) {
|
|
@@ -3129,11 +4379,14 @@ const mock_mockAction = async (task, params)=>{
|
|
|
3129
4379
|
device_platform: "mp",
|
|
3130
4380
|
is_message: 0
|
|
3131
4381
|
},
|
|
3132
|
-
tuwen_wtt_trans_flag: "0",
|
|
4382
|
+
tuwen_wtt_trans_flag: params.settingInfo?.toutiaoTransWtt ? "2" : "0",
|
|
3133
4383
|
info_source: sourceData,
|
|
3134
4384
|
...location ? {
|
|
3135
4385
|
city: location.label,
|
|
3136
4386
|
city_code: location.value
|
|
4387
|
+
} : null,
|
|
4388
|
+
...params.settingInfo?.toutiaoCollectionId ? {
|
|
4389
|
+
want_join_collection_id: params.settingInfo.toutiaoCollectionId
|
|
3137
4390
|
} : null
|
|
3138
4391
|
};
|
|
3139
4392
|
const publishData = {
|
|
@@ -3179,6 +4432,7 @@ const mock_mockAction = async (task, params)=>{
|
|
|
3179
4432
|
article_ad_type: getAddTypeValue(params.settingInfo.toutiaoAd),
|
|
3180
4433
|
claim_exclusive: toutiaoExclusive ? toutiaoExclusive : toutiaoOriginal?.includes("exclusive") ? 1 : 0
|
|
3181
4434
|
};
|
|
4435
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3182
4436
|
const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
|
|
3183
4437
|
let publishOption = {};
|
|
3184
4438
|
if (msToken) {
|
|
@@ -3210,8 +4464,14 @@ const mock_mockAction = async (task, params)=>{
|
|
|
3210
4464
|
},
|
|
3211
4465
|
defaultErrorMsg: "draft" === params.saveType ? "文章同步异常,请稍后重试。" : "文章发布异常,请稍后重试。"
|
|
3212
4466
|
};
|
|
3213
|
-
const
|
|
3214
|
-
|
|
4467
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
4468
|
+
headers
|
|
4469
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
4470
|
+
const publishResult = await proxyHttp.api(publishOption, {
|
|
4471
|
+
retries: 2,
|
|
4472
|
+
retryDelay: 500
|
|
4473
|
+
});
|
|
4474
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data.pgc_id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
3215
4475
|
};
|
|
3216
4476
|
const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
|
|
3217
4477
|
const rpa_rpaAction = async (task, params)=>{
|
|
@@ -3423,6 +4683,7 @@ const rpa_rpaAction = async (task, params)=>{
|
|
|
3423
4683
|
const confirmBtn = page.locator('div.byte-modal-footer button.byte-btn-primary:has-text("确定")');
|
|
3424
4684
|
if (await confirmBtn.isVisible()) await confirmBtn.click();
|
|
3425
4685
|
}
|
|
4686
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3426
4687
|
if ("publish" === params.saveType) {
|
|
3427
4688
|
await page.locator(".publish-footer button").filter({
|
|
3428
4689
|
hasText: params.settingInfo.timer ? "定时发布" : "确认发布"
|
|
@@ -3879,6 +5140,24 @@ const SearchAccountInfo = async (_task, params)=>{
|
|
|
3879
5140
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(null, "暂不支持该平台");
|
|
3880
5141
|
}
|
|
3881
5142
|
};
|
|
5143
|
+
const searchBjhTopicList = async (_task, params)=>{
|
|
5144
|
+
const cookies = params.cookies ?? [];
|
|
5145
|
+
const http = new Http({
|
|
5146
|
+
headers: {
|
|
5147
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
5148
|
+
token: params.token
|
|
5149
|
+
}
|
|
5150
|
+
});
|
|
5151
|
+
const res = await http.api({
|
|
5152
|
+
method: "get",
|
|
5153
|
+
url: "https://baijiahao.baidu.com/pcui/pcpublisher/searchtopic",
|
|
5154
|
+
params: {
|
|
5155
|
+
content: params.topicContent,
|
|
5156
|
+
resource_type: 1
|
|
5157
|
+
}
|
|
5158
|
+
});
|
|
5159
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res?.data?.hot ?? [], "百家号" + (0 == res.errno ? "话题获取成功!" : "话题获取失败"));
|
|
5160
|
+
};
|
|
3882
5161
|
const searchPublishInfo_types_errorResponse = (message, code = 500)=>({
|
|
3883
5162
|
code,
|
|
3884
5163
|
message,
|
|
@@ -4163,10 +5442,10 @@ async function handleBaijiahaoData(params) {
|
|
|
4163
5442
|
}
|
|
4164
5443
|
const final = filtered.slice(0, pageSize);
|
|
4165
5444
|
const articleCell = final.map((item)=>({
|
|
4166
|
-
title: item.title,
|
|
4167
|
-
imageUrl: JSON.parse(item.cover_images)[0]
|
|
5445
|
+
title: item?.is_transfer ?? false ? item.content || "" : item.title,
|
|
5446
|
+
imageUrl: JSON.parse(item.cover_images)[0]?.src || "",
|
|
4168
5447
|
createTime: Math.floor(new Date(item.publish_at.replace(/-/g, "/")).getTime() / 1000),
|
|
4169
|
-
redirectUrl: item.url,
|
|
5448
|
+
redirectUrl: item.url || item.share_url,
|
|
4170
5449
|
recommendNum: item.rec_amount | item.forward_num,
|
|
4171
5450
|
collectNum: item.collection_amount,
|
|
4172
5451
|
readNum: item.read_amount | item.read_num,
|
|
@@ -4317,6 +5596,51 @@ const getWeixinConfig = async (_task, params)=>{
|
|
|
4317
5596
|
};
|
|
4318
5597
|
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(filtered, 0 === res.base_resp.ret ? "微信配置信息获取成功!" : "微信配置信息获取失败!");
|
|
4319
5598
|
};
|
|
5599
|
+
const getWeixinCollection = async (_task, params)=>{
|
|
5600
|
+
const http = new Http({
|
|
5601
|
+
headers: {
|
|
5602
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
5603
|
+
}
|
|
5604
|
+
});
|
|
5605
|
+
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
5606
|
+
const res = await http.api({
|
|
5607
|
+
method: "get",
|
|
5608
|
+
url: "https://mp.weixin.qq.com/cgi-bin/appmsgalbummgr",
|
|
5609
|
+
params: {
|
|
5610
|
+
action: 'list',
|
|
5611
|
+
begin: 0,
|
|
5612
|
+
count: 100,
|
|
5613
|
+
sub_title: '',
|
|
5614
|
+
type: 0,
|
|
5615
|
+
latest: 1,
|
|
5616
|
+
need_pay: 0,
|
|
5617
|
+
fingerprint,
|
|
5618
|
+
token: params.token,
|
|
5619
|
+
lang: 'zh_CN',
|
|
5620
|
+
f: 'json',
|
|
5621
|
+
ajax: 1
|
|
5622
|
+
}
|
|
5623
|
+
});
|
|
5624
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res.list_resp.items, 0 === res.base_resp.ret ? "微信合计信息获取成功!" : "微信合集信息获取失败!");
|
|
5625
|
+
};
|
|
5626
|
+
const getXhsCollection = async (_task, params)=>{
|
|
5627
|
+
const http = new Http({
|
|
5628
|
+
headers: {
|
|
5629
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
5630
|
+
referer: "https://creator.xiaohongshu.com",
|
|
5631
|
+
origin: "https://creator.xiaohongshu.com"
|
|
5632
|
+
}
|
|
5633
|
+
});
|
|
5634
|
+
try {
|
|
5635
|
+
const res = await http.api({
|
|
5636
|
+
method: "get",
|
|
5637
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
|
|
5638
|
+
});
|
|
5639
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.result ? res.data.collections : [], "合集信息获取" + (0 === res.result ? "成功!" : `失败!`));
|
|
5640
|
+
} catch (error) {
|
|
5641
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)([]);
|
|
5642
|
+
}
|
|
5643
|
+
};
|
|
4320
5644
|
const weitoutiaoPublish_mock_mockAction = async (task, params)=>{
|
|
4321
5645
|
const tmpCachePath = task.getTmpPath();
|
|
4322
5646
|
const http = new Http({
|
|
@@ -4463,6 +5787,16 @@ const QuotaType = {
|
|
|
4463
5787
|
Normal: "kQuotaTypeMassSendNormal",
|
|
4464
5788
|
ProductActivity: "kQuotaTypeMassSendProductActivity"
|
|
4465
5789
|
};
|
|
5790
|
+
function genTopicHTML(topics) {
|
|
5791
|
+
if (!topics || 0 === topics.length) return "";
|
|
5792
|
+
const rn = ()=>{
|
|
5793
|
+
const O = Date.now().toString(36);
|
|
5794
|
+
const B = Math.random().toString(36).substring(2, 8);
|
|
5795
|
+
return `${O}-${B}`;
|
|
5796
|
+
};
|
|
5797
|
+
const aTags = topics.map((topic)=>`<a class="wx_topic_link" topic-id="${rn()}" style="color: #576B95 !important;" data-topic="1">#${topic}</a>`).join(" ");
|
|
5798
|
+
return `<p style="line-height: 1.75;margin: 0px 0px 24px;padding: 0px;" data-bothblock="0px"><span leaf="">${aTags}</span></p>`;
|
|
5799
|
+
}
|
|
4466
5800
|
const GET_QRCODE_DEFAULT_ERROR = "二维码获取异常,请稍后重试。";
|
|
4467
5801
|
const weixinPublish_mock_errnoMap = {
|
|
4468
5802
|
200003: "微信公众号号登录状态失效,请重新绑定账号后重试。",
|
|
@@ -4477,10 +5811,14 @@ const weixinPublish_mock_errnoMap = {
|
|
|
4477
5811
|
"-1": "系统错误,请注意备份内容后重试",
|
|
4478
5812
|
770001: "不支持发布审核中或转码中的视频",
|
|
4479
5813
|
200074: "系统繁忙,请稍后重试!",
|
|
4480
|
-
64702: "标题超出64字长度限制,请修改标题后重试。"
|
|
5814
|
+
64702: "标题超出64字长度限制,请修改标题后重试。",
|
|
5815
|
+
64552: "请检查阅读原文中的链接后重试。"
|
|
4481
5816
|
};
|
|
4482
5817
|
const ignoreErrno = [
|
|
4483
|
-
154019
|
|
5818
|
+
154019,
|
|
5819
|
+
154011,
|
|
5820
|
+
154008,
|
|
5821
|
+
154009
|
|
4484
5822
|
];
|
|
4485
5823
|
const userTypeMap = {
|
|
4486
5824
|
所有用户: 1,
|
|
@@ -4514,13 +5852,14 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
4514
5852
|
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
4515
5853
|
const client_time_diff = +Number("1743488763") - Math.floor(new Date().getTime() / 1000);
|
|
4516
5854
|
const tmpCachePath = task.getTmpPath();
|
|
5855
|
+
const headers = {
|
|
5856
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0",
|
|
5857
|
+
Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
5858
|
+
origin: "https://mp.weixin.qq.com",
|
|
5859
|
+
referer: `https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit&action=edit&isNew=1&type=77&createType=0&token=${params.token}&lang=zh_CN×tamp=${Date.now()}`
|
|
5860
|
+
};
|
|
4517
5861
|
const http = new Http({
|
|
4518
|
-
headers
|
|
4519
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0",
|
|
4520
|
-
Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
4521
|
-
origin: "https://mp.weixin.qq.com",
|
|
4522
|
-
referer: `https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit&action=edit&isNew=1&type=77&createType=0&token=${params.token}&lang=zh_CN×tamp=${Date.now()}`
|
|
4523
|
-
}
|
|
5862
|
+
headers
|
|
4524
5863
|
});
|
|
4525
5864
|
http.addResponseInterceptor((response)=>{
|
|
4526
5865
|
const responseData = response.data;
|
|
@@ -4584,7 +5923,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
4584
5923
|
};
|
|
4585
5924
|
const originContentImages = extractImgTag(params.content);
|
|
4586
5925
|
const targetContentImages = await uploadImages(originContentImages);
|
|
4587
|
-
const content = replaceImgSrc(params.content, (dom)=>{
|
|
5926
|
+
const content = replaceImgSrc(params.settingInfo.wxTopic && params.settingInfo.wxTopic.length > 0 ? params.content + genTopicHTML(params.settingInfo.wxTopic) : params.content, (dom)=>{
|
|
4588
5927
|
if (dom.attribs.src) {
|
|
4589
5928
|
const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
|
|
4590
5929
|
dom.attribs.src = targetContentImages[idx].cdn_url;
|
|
@@ -4857,9 +6196,15 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
4857
6196
|
allow_fast_reprint0: params?.settingInfo?.wxQuickReprint ? 1 : 0,
|
|
4858
6197
|
disable_recommend0: params?.settingInfo?.wxNotAllowRecommend ? 1 : 0,
|
|
4859
6198
|
claim_source_type0: params?.settingInfo?.wxCreationSource?.[0] || "",
|
|
6199
|
+
appmsg_album_info0: JSON.stringify({
|
|
6200
|
+
appmsg_album_infos: params.settingInfo?.wxCollectionInfo ? [
|
|
6201
|
+
params.settingInfo.wxCollectionInfo
|
|
6202
|
+
] : []
|
|
6203
|
+
}),
|
|
4860
6204
|
masssend_check: 1,
|
|
4861
6205
|
is_masssend: 1
|
|
4862
6206
|
};
|
|
6207
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
4863
6208
|
const { appMsgId } = await http.api({
|
|
4864
6209
|
method: "post",
|
|
4865
6210
|
url: "https://mp.weixin.qq.com/cgi-bin/operate_appmsg",
|
|
@@ -4878,6 +6223,42 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
4878
6223
|
data: appMsgId,
|
|
4879
6224
|
message: "微信公众号保存草稿成功。"
|
|
4880
6225
|
};
|
|
6226
|
+
let checkTimes = 0;
|
|
6227
|
+
let copyrightStatRes = {
|
|
6228
|
+
base_resp: {
|
|
6229
|
+
ret: -1
|
|
6230
|
+
},
|
|
6231
|
+
list: ''
|
|
6232
|
+
};
|
|
6233
|
+
do {
|
|
6234
|
+
checkTimes++;
|
|
6235
|
+
const copyrightStat = http.api({
|
|
6236
|
+
method: 'post',
|
|
6237
|
+
url: 'https://mp.weixin.qq.com/cgi-bin/masssend',
|
|
6238
|
+
params: {
|
|
6239
|
+
action: 'get_appmsg_copyright_stat',
|
|
6240
|
+
token: params.token,
|
|
6241
|
+
lang: 'zh_CN'
|
|
6242
|
+
},
|
|
6243
|
+
data: weixinPublish_mock_generatorFormData({
|
|
6244
|
+
token: params.token,
|
|
6245
|
+
lang: 'zh_CN',
|
|
6246
|
+
f: 'json',
|
|
6247
|
+
ajax: 1,
|
|
6248
|
+
fingerprint,
|
|
6249
|
+
random: Math.random().toString(),
|
|
6250
|
+
first_check: 1 === checkTimes ? 1 : 0,
|
|
6251
|
+
type: 10,
|
|
6252
|
+
appMsgId
|
|
6253
|
+
})
|
|
6254
|
+
});
|
|
6255
|
+
copyrightStatRes = await copyrightStat;
|
|
6256
|
+
if (154008 === copyrightStatRes.base_resp.ret && copyrightStatRes?.list) return {
|
|
6257
|
+
code: 200,
|
|
6258
|
+
message: `文章内容未通过原创校验,请修改后重试!`,
|
|
6259
|
+
data: JSON.parse(copyrightStatRes.list).list
|
|
6260
|
+
};
|
|
6261
|
+
}while (154011 === copyrightStatRes.base_resp.ret && checkTimes < 10);
|
|
4881
6262
|
const masssendpage = ()=>http.api({
|
|
4882
6263
|
method: "get",
|
|
4883
6264
|
url: "https://mp.weixin.qq.com/cgi-bin/masssendpage",
|
|
@@ -5085,7 +6466,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
5085
6466
|
responseType: "arraybuffer"
|
|
5086
6467
|
});
|
|
5087
6468
|
const qrcodeBuffer = Buffer.from(qrcodeResult);
|
|
5088
|
-
const qrcodeFilePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath,
|
|
6469
|
+
const qrcodeFilePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath, `weixin_qrcode_${Date.now()}.jpg`);
|
|
5089
6470
|
__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].writeFileSync(qrcodeFilePath, new Uint8Array(qrcodeBuffer));
|
|
5090
6471
|
params.safeQrcodeCallback?.(qrcodeFilePath);
|
|
5091
6472
|
let code = "";
|
|
@@ -5140,7 +6521,10 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
5140
6521
|
uuid
|
|
5141
6522
|
})
|
|
5142
6523
|
});
|
|
5143
|
-
|
|
6524
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
6525
|
+
headers
|
|
6526
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
6527
|
+
await proxyHttp.api({
|
|
5144
6528
|
method: "post",
|
|
5145
6529
|
url: "https://mp.weixin.qq.com/cgi-bin/masssend",
|
|
5146
6530
|
params: {
|
|
@@ -5188,8 +6572,11 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
5188
6572
|
userType: "1"
|
|
5189
6573
|
}),
|
|
5190
6574
|
defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
|
|
6575
|
+
}, {
|
|
6576
|
+
retries: 2,
|
|
6577
|
+
retryDelay: 500
|
|
5191
6578
|
});
|
|
5192
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(appMsgId,
|
|
6579
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(appMsgId, `微信公众号发布完成!` + (proxyHttp.proxyInfo || ""));
|
|
5193
6580
|
};
|
|
5194
6581
|
const waitQrcodeResultMaxTime = 2000 * scanRetryMaxCount;
|
|
5195
6582
|
const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
@@ -5518,6 +6905,7 @@ const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
5518
6905
|
await poperInstance.locator('.frm_radio_item label[for="not_recomment_0"]').click();
|
|
5519
6906
|
}
|
|
5520
6907
|
await page.waitForTimeout(1000);
|
|
6908
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
5521
6909
|
const articleId = await new Promise(async (resolve)=>{
|
|
5522
6910
|
const handleResponse = async (response)=>{
|
|
5523
6911
|
const url = response.url();
|
|
@@ -5854,6 +7242,11 @@ const xiaohongshuPublish_mock_errnoMap = {
|
|
|
5854
7242
|
const mock_xsEncrypt = new Xhshow();
|
|
5855
7243
|
const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
5856
7244
|
const tmpCachePath = task.getTmpPath();
|
|
7245
|
+
if (params?.selfDeclaration?.type == "source-statement" && "transshipment" == params.selfDeclaration.childType && params.originalBind) return {
|
|
7246
|
+
code: 200,
|
|
7247
|
+
message: "原创声明与转载声明互斥,请重新选择后发布!",
|
|
7248
|
+
data: ""
|
|
7249
|
+
};
|
|
5857
7250
|
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
5858
7251
|
if (!a1Cookie) return {
|
|
5859
7252
|
code: 200,
|
|
@@ -5988,6 +7381,11 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
5988
7381
|
Object.assign(topic, createTopic.data.topic_infos[0]);
|
|
5989
7382
|
}
|
|
5990
7383
|
}));
|
|
7384
|
+
const visibleRangeMap = {
|
|
7385
|
+
public: 0,
|
|
7386
|
+
private: 1,
|
|
7387
|
+
friends: 4
|
|
7388
|
+
};
|
|
5991
7389
|
const publishData = {
|
|
5992
7390
|
common: {
|
|
5993
7391
|
ats: [],
|
|
@@ -6005,7 +7403,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
6005
7403
|
type: "normal",
|
|
6006
7404
|
privacy_info: {
|
|
6007
7405
|
op_type: 1,
|
|
6008
|
-
type:
|
|
7406
|
+
type: visibleRangeMap[params.visibleRange] || 1
|
|
6009
7407
|
},
|
|
6010
7408
|
post_loc: params.address ? {
|
|
6011
7409
|
name: params.address?.name,
|
|
@@ -6057,6 +7455,10 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
6057
7455
|
};
|
|
6058
7456
|
}
|
|
6059
7457
|
}
|
|
7458
|
+
const bizId = params?.originalBind && (params.cookies.find((it)=>"x-user-id-creator.xiaohongshu.com" === it.name)?.value || await http.api({
|
|
7459
|
+
method: "get",
|
|
7460
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
|
|
7461
|
+
}).then((userData)=>userData.data?.userDetail?.id));
|
|
6060
7462
|
const business_binds = {
|
|
6061
7463
|
version: 1,
|
|
6062
7464
|
bizType: "",
|
|
@@ -6065,18 +7467,52 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
6065
7467
|
notePostTiming: params.isImmediatelyPublish ? {} : {
|
|
6066
7468
|
postTime: params.scheduledPublish
|
|
6067
7469
|
},
|
|
6068
|
-
|
|
6069
|
-
|
|
7470
|
+
coProduceBind: {
|
|
7471
|
+
enable: !!params?.coProduceBind
|
|
7472
|
+
},
|
|
7473
|
+
noteCopyBind: {
|
|
7474
|
+
copyable: !!params?.noteCopyBind
|
|
7475
|
+
},
|
|
7476
|
+
optionRelationList: params.originalBind ? [
|
|
7477
|
+
{
|
|
7478
|
+
type: "ORIGINAL_STATEMENT",
|
|
7479
|
+
relationList: [
|
|
7480
|
+
{
|
|
7481
|
+
bizId,
|
|
7482
|
+
bizType: "ORIGINAL_STATEMENT",
|
|
7483
|
+
extraInfo: "{}"
|
|
7484
|
+
}
|
|
7485
|
+
]
|
|
7486
|
+
}
|
|
7487
|
+
] : [],
|
|
7488
|
+
...params?.groupBind ? {
|
|
7489
|
+
groupBind: {
|
|
7490
|
+
groupId: params?.groupBind?.group_id,
|
|
7491
|
+
groupName: params.groupBind?.group_name,
|
|
7492
|
+
desc: params.groupBind?.desc,
|
|
7493
|
+
avatar: params.groupBind?.avatar
|
|
7494
|
+
}
|
|
7495
|
+
} : {
|
|
7496
|
+
groupBind: {}
|
|
6070
7497
|
},
|
|
6071
7498
|
...params.selfDeclaration ? {
|
|
6072
7499
|
userDeclarationBind
|
|
7500
|
+
} : {},
|
|
7501
|
+
...params?.collectionId ? {
|
|
7502
|
+
noteCollectionBind: {
|
|
7503
|
+
id: params.collectionId
|
|
7504
|
+
}
|
|
6073
7505
|
} : {}
|
|
6074
7506
|
};
|
|
6075
7507
|
publishData.common.business_binds = JSON.stringify(business_binds);
|
|
6076
7508
|
const publishXt = Date.now().toString();
|
|
6077
7509
|
const publishXs = mock_xsEncrypt.signXsPost("/web_api/sns/v2/note", a1Cookie, "xhs-pc-web", publishData);
|
|
6078
7510
|
const xscommon = GenXSCommon(a1Cookie, publishXt, publishXs);
|
|
6079
|
-
const
|
|
7511
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
7512
|
+
headers
|
|
7513
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
7514
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
7515
|
+
const publishResult = await proxyHttp.api({
|
|
6080
7516
|
method: "post",
|
|
6081
7517
|
url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
|
|
6082
7518
|
data: publishData,
|
|
@@ -6086,8 +7522,11 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
6086
7522
|
"x-s-common": xscommon
|
|
6087
7523
|
},
|
|
6088
7524
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
7525
|
+
}, {
|
|
7526
|
+
retries: 2,
|
|
7527
|
+
retryDelay: 500
|
|
6089
7528
|
});
|
|
6090
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data?.id);
|
|
7529
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data?.id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
6091
7530
|
};
|
|
6092
7531
|
const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
|
|
6093
7532
|
const rpa_xsEncrypt = new Xhshow();
|
|
@@ -6283,6 +7722,7 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
6283
7722
|
hasText: "仅自己可见"
|
|
6284
7723
|
}).click();
|
|
6285
7724
|
}
|
|
7725
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
6286
7726
|
const releaseTimeInstance = page.locator("label").filter({
|
|
6287
7727
|
hasText: params.isImmediatelyPublish ? "立即发布" : "定时发布"
|
|
6288
7728
|
});
|
|
@@ -6307,27 +7747,117 @@ const xiaohongshuPublish = async (task, params)=>{
|
|
|
6307
7747
|
if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
|
|
6308
7748
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
6309
7749
|
};
|
|
7750
|
+
const getXhsGroup_xsEncrypt = new Xhshow();
|
|
7751
|
+
const getXhsGroup = async (_task, params)=>{
|
|
7752
|
+
const http = new Http({
|
|
7753
|
+
headers: {
|
|
7754
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
7755
|
+
referer: "https://creator.xiaohongshu.com",
|
|
7756
|
+
origin: "https://creator.xiaohongshu.com"
|
|
7757
|
+
}
|
|
7758
|
+
});
|
|
7759
|
+
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
7760
|
+
if (!a1Cookie) return {
|
|
7761
|
+
code: 200,
|
|
7762
|
+
message: "账号数据异常,请重新绑定账号后重试。",
|
|
7763
|
+
data: []
|
|
7764
|
+
};
|
|
7765
|
+
try {
|
|
7766
|
+
const xt = Date.now().toString();
|
|
7767
|
+
const groupListParams = {
|
|
7768
|
+
note_id: ""
|
|
7769
|
+
};
|
|
7770
|
+
const fatchGroup = "/api/im/web/nns/group_list";
|
|
7771
|
+
const xs = getXhsGroup_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", groupListParams);
|
|
7772
|
+
const res = await http.api({
|
|
7773
|
+
method: "get",
|
|
7774
|
+
url: "https://edith.xiaohongshu.com/api/im/web/nns/group_list",
|
|
7775
|
+
params: groupListParams,
|
|
7776
|
+
headers: {
|
|
7777
|
+
"x-s": xs,
|
|
7778
|
+
"x-t": xt
|
|
7779
|
+
}
|
|
7780
|
+
});
|
|
7781
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.code ? res.data.group_list : [], "群聊信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
|
|
7782
|
+
} catch (error) {
|
|
7783
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)([]);
|
|
7784
|
+
}
|
|
7785
|
+
};
|
|
7786
|
+
const getXhsHotTopic_xsEncrypt = new Xhshow();
|
|
7787
|
+
const getXhsHotTopic = async (_task, params)=>{
|
|
7788
|
+
const http = new Http({
|
|
7789
|
+
headers: {
|
|
7790
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
7791
|
+
referer: "https://creator.xiaohongshu.com",
|
|
7792
|
+
origin: "https://creator.xiaohongshu.com"
|
|
7793
|
+
}
|
|
7794
|
+
});
|
|
7795
|
+
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
7796
|
+
if (!a1Cookie) return {
|
|
7797
|
+
code: 200,
|
|
7798
|
+
message: "账号数据异常,请重新绑定账号后重试。",
|
|
7799
|
+
data: []
|
|
7800
|
+
};
|
|
7801
|
+
try {
|
|
7802
|
+
const xt = Date.now().toString();
|
|
7803
|
+
const hotTopicParams = {
|
|
7804
|
+
sort: 1,
|
|
7805
|
+
type: 1,
|
|
7806
|
+
source: 3,
|
|
7807
|
+
topic_activity: 1
|
|
7808
|
+
};
|
|
7809
|
+
const fatchGroup = "/api/galaxy/v2/creator/activity_center/list";
|
|
7810
|
+
const xs = getXhsHotTopic_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", hotTopicParams);
|
|
7811
|
+
const res = await http.api({
|
|
7812
|
+
method: "get",
|
|
7813
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/v2/creator/activity_center/list",
|
|
7814
|
+
params: hotTopicParams,
|
|
7815
|
+
headers: {
|
|
7816
|
+
"x-s": xs,
|
|
7817
|
+
"x-t": xt
|
|
7818
|
+
}
|
|
7819
|
+
});
|
|
7820
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 === res.code ? res.data.activity_list : [], "热门信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
|
|
7821
|
+
} catch (error) {
|
|
7822
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)([]);
|
|
7823
|
+
}
|
|
7824
|
+
};
|
|
6310
7825
|
var package_namespaceObject = {
|
|
6311
|
-
i8: "1.2.
|
|
7826
|
+
i8: "1.2.24"
|
|
6312
7827
|
};
|
|
7828
|
+
const BetaFlag = "HuiwenCanary";
|
|
6313
7829
|
class Action {
|
|
6314
7830
|
constructor(task){
|
|
6315
7831
|
this.task = task;
|
|
6316
7832
|
}
|
|
6317
7833
|
async bindTask(func, params) {
|
|
6318
7834
|
let responseData;
|
|
6319
|
-
|
|
6320
|
-
|
|
7835
|
+
this.task.isBeta = this.task?.isFeatOn ? this.task?.isFeatOn(BetaFlag) : false;
|
|
7836
|
+
this.task._timerRecord = {
|
|
7837
|
+
ActionStart: Date.now()
|
|
7838
|
+
};
|
|
7839
|
+
if (this.task?.setArticleId) this.task.setArticleId(params.articleId ?? "");
|
|
7840
|
+
if (this.task?.setSaveType ?? false) this.task.setSaveType(params.saveType ?? "");
|
|
7841
|
+
if (this.task?.isInitializedGB !== void 0) this.task.setGbInitType(this.task.isInitializedGB);
|
|
7842
|
+
if ("object" == typeof params) params.cookies = params?.cookies ?? [];
|
|
6321
7843
|
try {
|
|
6322
7844
|
responseData = await func(this.task, params);
|
|
6323
7845
|
} catch (error) {
|
|
6324
7846
|
responseData = Http.handleApiError(error);
|
|
7847
|
+
} finally{
|
|
7848
|
+
this.task._timerRecord['ActionEnd'] = Date.now();
|
|
6325
7849
|
}
|
|
7850
|
+
if (this.task.isBeta && this.task.setTimeConsuming) this.task.setTimeConsuming(this.task._timerRecord);
|
|
6326
7851
|
if (200 === responseData.code) this.task.logger.info(`${func.name} action params error`, responseData);
|
|
6327
7852
|
else if (0 !== responseData.code) {
|
|
6328
7853
|
this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
|
|
6329
7854
|
this.task.logger.info(`${func.name} action failed`);
|
|
6330
7855
|
} else this.task.logger.info(`${func.name} action success`);
|
|
7856
|
+
if (this.task.debug && this.task._timerRecord['PrePublish']) {
|
|
7857
|
+
console.log("预处理图片耗时:", (this.task._timerRecord['PrePublish'] - this.task._timerRecord['ActionStart']) / 1000, "s");
|
|
7858
|
+
console.log("发文接口耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['PrePublish']) / 1000, "s");
|
|
7859
|
+
}
|
|
7860
|
+
this.task.debug && console.log("Action整体耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['ActionStart']) / 1000, "s");
|
|
6331
7861
|
return responseData;
|
|
6332
7862
|
}
|
|
6333
7863
|
FetchArticles(params) {
|
|
@@ -6363,6 +7893,9 @@ class Action {
|
|
|
6363
7893
|
BjhFansExport(params) {
|
|
6364
7894
|
return this.bindTask(BjhFansExport, params);
|
|
6365
7895
|
}
|
|
7896
|
+
SearchBjhTopicList(params) {
|
|
7897
|
+
return this.bindTask(searchBjhTopicList, params);
|
|
7898
|
+
}
|
|
6366
7899
|
searchToutiaoUserID(params) {
|
|
6367
7900
|
return this.bindTask(searchToutiaoUserInfo, params);
|
|
6368
7901
|
}
|
|
@@ -6375,6 +7908,18 @@ class Action {
|
|
|
6375
7908
|
getWeixinConfig(params) {
|
|
6376
7909
|
return this.bindTask(getWeixinConfig, params);
|
|
6377
7910
|
}
|
|
7911
|
+
getWeixinCollection(params) {
|
|
7912
|
+
return this.bindTask(getWeixinCollection, params);
|
|
7913
|
+
}
|
|
7914
|
+
getXhsCollection(params) {
|
|
7915
|
+
return this.bindTask(getXhsCollection, params);
|
|
7916
|
+
}
|
|
7917
|
+
getXhsGroup(params) {
|
|
7918
|
+
return this.bindTask(getXhsGroup, params);
|
|
7919
|
+
}
|
|
7920
|
+
getXhsHotTopic(params) {
|
|
7921
|
+
return this.bindTask(getXhsHotTopic, params);
|
|
7922
|
+
}
|
|
6378
7923
|
getBaijiahaoConfig(params) {
|
|
6379
7924
|
return this.bindTask(getBaijiahaoConfig, params);
|
|
6380
7925
|
}
|
|
@@ -6407,6 +7952,6 @@ class Action {
|
|
|
6407
7952
|
}
|
|
6408
7953
|
}
|
|
6409
7954
|
var __webpack_exports__version = package_namespaceObject.i8;
|
|
6410
|
-
export { Action, __webpack_exports__version as version };
|
|
7955
|
+
export { Action, BetaFlag, __webpack_exports__version as version };
|
|
6411
7956
|
|
|
6412
7957
|
//# sourceMappingURL=index.mjs.map
|