@iflyrpa/actions 1.2.24 → 1.2.25-beta.1

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/index.js CHANGED
@@ -1,4 +1,1059 @@
1
1
  var __webpack_modules__ = {
2
+ "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports1, __webpack_require__) {
3
+ "use strict";
4
+ var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
5
+ if (void 0 === k2) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
8
+ enumerable: true,
9
+ get: function() {
10
+ return m[k];
11
+ }
12
+ };
13
+ Object.defineProperty(o, k2, desc);
14
+ } : function(o, m, k, k2) {
15
+ if (void 0 === k2) k2 = k;
16
+ o[k2] = m[k];
17
+ });
18
+ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
19
+ Object.defineProperty(o, "default", {
20
+ enumerable: true,
21
+ value: v
22
+ });
23
+ } : function(o, v) {
24
+ o["default"] = v;
25
+ });
26
+ var __importStar = this && this.__importStar || function(mod) {
27
+ if (mod && mod.__esModule) return mod;
28
+ var result = {};
29
+ if (null != mod) {
30
+ for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
31
+ }
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ Object.defineProperty(exports1, "__esModule", {
36
+ value: true
37
+ });
38
+ exports1.req = exports1.json = exports1.toBuffer = void 0;
39
+ const http = __importStar(__webpack_require__("http"));
40
+ const https = __importStar(__webpack_require__("https"));
41
+ async function toBuffer(stream) {
42
+ let length = 0;
43
+ const chunks = [];
44
+ for await (const chunk of stream){
45
+ length += chunk.length;
46
+ chunks.push(chunk);
47
+ }
48
+ return Buffer.concat(chunks, length);
49
+ }
50
+ exports1.toBuffer = toBuffer;
51
+ async function json(stream) {
52
+ const buf = await toBuffer(stream);
53
+ const str = buf.toString('utf8');
54
+ try {
55
+ return JSON.parse(str);
56
+ } catch (_err) {
57
+ const err = _err;
58
+ err.message += ` (input: ${str})`;
59
+ throw err;
60
+ }
61
+ }
62
+ exports1.json = json;
63
+ function req(url, opts = {}) {
64
+ const href = 'string' == typeof url ? url : url.href;
65
+ const req1 = (href.startsWith('https:') ? https : http).request(url, opts);
66
+ const promise = new Promise((resolve, reject)=>{
67
+ req1.once('response', resolve).once('error', reject).end();
68
+ });
69
+ req1.then = promise.then.bind(promise);
70
+ return req1;
71
+ }
72
+ exports1.req = req;
73
+ },
74
+ "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js": function(__unused_webpack_module, exports1, __webpack_require__) {
75
+ "use strict";
76
+ var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
77
+ if (void 0 === k2) k2 = k;
78
+ var desc = Object.getOwnPropertyDescriptor(m, k);
79
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
80
+ enumerable: true,
81
+ get: function() {
82
+ return m[k];
83
+ }
84
+ };
85
+ Object.defineProperty(o, k2, desc);
86
+ } : function(o, m, k, k2) {
87
+ if (void 0 === k2) k2 = k;
88
+ o[k2] = m[k];
89
+ });
90
+ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
91
+ Object.defineProperty(o, "default", {
92
+ enumerable: true,
93
+ value: v
94
+ });
95
+ } : function(o, v) {
96
+ o["default"] = v;
97
+ });
98
+ var __importStar = this && this.__importStar || function(mod) {
99
+ if (mod && mod.__esModule) return mod;
100
+ var result = {};
101
+ if (null != mod) {
102
+ for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
103
+ }
104
+ __setModuleDefault(result, mod);
105
+ return result;
106
+ };
107
+ var __exportStar = this && this.__exportStar || function(m, exports1) {
108
+ for(var p in m)if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports1, p)) __createBinding(exports1, m, p);
109
+ };
110
+ Object.defineProperty(exports1, "__esModule", {
111
+ value: true
112
+ });
113
+ exports1.Agent = void 0;
114
+ const net = __importStar(__webpack_require__("net"));
115
+ const http = __importStar(__webpack_require__("http"));
116
+ const https_1 = __webpack_require__("https");
117
+ __exportStar(__webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"), exports1);
118
+ const INTERNAL = Symbol('AgentBaseInternalState');
119
+ class Agent extends http.Agent {
120
+ constructor(opts){
121
+ super(opts);
122
+ this[INTERNAL] = {};
123
+ }
124
+ isSecureEndpoint(options) {
125
+ if (options) {
126
+ if ('boolean' == typeof options.secureEndpoint) return options.secureEndpoint;
127
+ if ('string' == typeof options.protocol) return 'https:' === options.protocol;
128
+ }
129
+ const { stack } = new Error();
130
+ if ('string' != typeof stack) return false;
131
+ return stack.split('\n').some((l)=>-1 !== l.indexOf('(https.js:') || -1 !== l.indexOf('node:https:'));
132
+ }
133
+ incrementSockets(name) {
134
+ if (this.maxSockets === 1 / 0 && this.maxTotalSockets === 1 / 0) return null;
135
+ if (!this.sockets[name]) this.sockets[name] = [];
136
+ const fakeSocket = new net.Socket({
137
+ writable: false
138
+ });
139
+ this.sockets[name].push(fakeSocket);
140
+ this.totalSocketCount++;
141
+ return fakeSocket;
142
+ }
143
+ decrementSockets(name, socket) {
144
+ if (!this.sockets[name] || null === socket) return;
145
+ const sockets = this.sockets[name];
146
+ const index = sockets.indexOf(socket);
147
+ if (-1 !== index) {
148
+ sockets.splice(index, 1);
149
+ this.totalSocketCount--;
150
+ if (0 === sockets.length) delete this.sockets[name];
151
+ }
152
+ }
153
+ getName(options) {
154
+ const secureEndpoint = this.isSecureEndpoint(options);
155
+ if (secureEndpoint) return https_1.Agent.prototype.getName.call(this, options);
156
+ return super.getName(options);
157
+ }
158
+ createSocket(req, options, cb) {
159
+ const connectOpts = {
160
+ ...options,
161
+ secureEndpoint: this.isSecureEndpoint(options)
162
+ };
163
+ const name = this.getName(connectOpts);
164
+ const fakeSocket = this.incrementSockets(name);
165
+ Promise.resolve().then(()=>this.connect(req, connectOpts)).then((socket)=>{
166
+ this.decrementSockets(name, fakeSocket);
167
+ if (socket instanceof http.Agent) try {
168
+ return socket.addRequest(req, connectOpts);
169
+ } catch (err) {
170
+ return cb(err);
171
+ }
172
+ this[INTERNAL].currentSocket = socket;
173
+ super.createSocket(req, options, cb);
174
+ }, (err)=>{
175
+ this.decrementSockets(name, fakeSocket);
176
+ cb(err);
177
+ });
178
+ }
179
+ createConnection() {
180
+ const socket = this[INTERNAL].currentSocket;
181
+ this[INTERNAL].currentSocket = void 0;
182
+ if (!socket) throw new Error('No socket was returned in the `connect()` function');
183
+ return socket;
184
+ }
185
+ get defaultPort() {
186
+ return this[INTERNAL].defaultPort ?? ('https:' === this.protocol ? 443 : 80);
187
+ }
188
+ set defaultPort(v) {
189
+ if (this[INTERNAL]) this[INTERNAL].defaultPort = v;
190
+ }
191
+ get protocol() {
192
+ return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');
193
+ }
194
+ set protocol(v) {
195
+ if (this[INTERNAL]) this[INTERNAL].protocol = v;
196
+ }
197
+ }
198
+ exports1.Agent = Agent;
199
+ },
200
+ "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js": function(module, exports1, __webpack_require__) {
201
+ exports1.formatArgs = formatArgs;
202
+ exports1.save = save;
203
+ exports1.load = load;
204
+ exports1.useColors = useColors;
205
+ exports1.storage = localstorage();
206
+ exports1.destroy = (()=>{
207
+ let warned = false;
208
+ return ()=>{
209
+ if (!warned) {
210
+ warned = true;
211
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
212
+ }
213
+ };
214
+ })();
215
+ exports1.colors = [
216
+ '#0000CC',
217
+ '#0000FF',
218
+ '#0033CC',
219
+ '#0033FF',
220
+ '#0066CC',
221
+ '#0066FF',
222
+ '#0099CC',
223
+ '#0099FF',
224
+ '#00CC00',
225
+ '#00CC33',
226
+ '#00CC66',
227
+ '#00CC99',
228
+ '#00CCCC',
229
+ '#00CCFF',
230
+ '#3300CC',
231
+ '#3300FF',
232
+ '#3333CC',
233
+ '#3333FF',
234
+ '#3366CC',
235
+ '#3366FF',
236
+ '#3399CC',
237
+ '#3399FF',
238
+ '#33CC00',
239
+ '#33CC33',
240
+ '#33CC66',
241
+ '#33CC99',
242
+ '#33CCCC',
243
+ '#33CCFF',
244
+ '#6600CC',
245
+ '#6600FF',
246
+ '#6633CC',
247
+ '#6633FF',
248
+ '#66CC00',
249
+ '#66CC33',
250
+ '#9900CC',
251
+ '#9900FF',
252
+ '#9933CC',
253
+ '#9933FF',
254
+ '#99CC00',
255
+ '#99CC33',
256
+ '#CC0000',
257
+ '#CC0033',
258
+ '#CC0066',
259
+ '#CC0099',
260
+ '#CC00CC',
261
+ '#CC00FF',
262
+ '#CC3300',
263
+ '#CC3333',
264
+ '#CC3366',
265
+ '#CC3399',
266
+ '#CC33CC',
267
+ '#CC33FF',
268
+ '#CC6600',
269
+ '#CC6633',
270
+ '#CC9900',
271
+ '#CC9933',
272
+ '#CCCC00',
273
+ '#CCCC33',
274
+ '#FF0000',
275
+ '#FF0033',
276
+ '#FF0066',
277
+ '#FF0099',
278
+ '#FF00CC',
279
+ '#FF00FF',
280
+ '#FF3300',
281
+ '#FF3333',
282
+ '#FF3366',
283
+ '#FF3399',
284
+ '#FF33CC',
285
+ '#FF33FF',
286
+ '#FF6600',
287
+ '#FF6633',
288
+ '#FF9900',
289
+ '#FF9933',
290
+ '#FFCC00',
291
+ '#FFCC33'
292
+ ];
293
+ function useColors() {
294
+ if ('undefined' != typeof window && window.process && ('renderer' === window.process.type || window.process.__nwjs)) return true;
295
+ if ('undefined' != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return false;
296
+ let m;
297
+ 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+)/);
298
+ }
299
+ function formatArgs(args) {
300
+ args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
301
+ if (!this.useColors) return;
302
+ const c = 'color: ' + this.color;
303
+ args.splice(1, 0, c, 'color: inherit');
304
+ let index = 0;
305
+ let lastC = 0;
306
+ args[0].replace(/%[a-zA-Z%]/g, (match)=>{
307
+ if ('%%' === match) return;
308
+ index++;
309
+ if ('%c' === match) lastC = index;
310
+ });
311
+ args.splice(lastC, 0, c);
312
+ }
313
+ exports1.log = console.debug || console.log || (()=>{});
314
+ function save(namespaces) {
315
+ try {
316
+ if (namespaces) exports1.storage.setItem('debug', namespaces);
317
+ else exports1.storage.removeItem('debug');
318
+ } catch (error) {}
319
+ }
320
+ function load() {
321
+ let r;
322
+ try {
323
+ r = exports1.storage.getItem('debug');
324
+ } catch (error) {}
325
+ if (!r && 'undefined' != typeof process && 'env' in process) r = process.env.DEBUG;
326
+ return r;
327
+ }
328
+ function localstorage() {
329
+ try {
330
+ return localStorage;
331
+ } catch (error) {}
332
+ }
333
+ module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports1);
334
+ const { formatters } = module.exports;
335
+ formatters.j = function(v) {
336
+ try {
337
+ return JSON.stringify(v);
338
+ } catch (error) {
339
+ return '[UnexpectedJSONParseError]: ' + error.message;
340
+ }
341
+ };
342
+ },
343
+ "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js": function(module, __unused_webpack_exports, __webpack_require__) {
344
+ function setup(env) {
345
+ createDebug.debug = createDebug;
346
+ createDebug.default = createDebug;
347
+ createDebug.coerce = coerce;
348
+ createDebug.disable = disable;
349
+ createDebug.enable = enable;
350
+ createDebug.enabled = enabled;
351
+ createDebug.humanize = __webpack_require__("../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js");
352
+ createDebug.destroy = destroy;
353
+ Object.keys(env).forEach((key)=>{
354
+ createDebug[key] = env[key];
355
+ });
356
+ createDebug.names = [];
357
+ createDebug.skips = [];
358
+ createDebug.formatters = {};
359
+ function selectColor(namespace) {
360
+ let hash = 0;
361
+ for(let i = 0; i < namespace.length; i++){
362
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
363
+ hash |= 0;
364
+ }
365
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
366
+ }
367
+ createDebug.selectColor = selectColor;
368
+ function createDebug(namespace) {
369
+ let prevTime;
370
+ let enableOverride = null;
371
+ let namespacesCache;
372
+ let enabledCache;
373
+ function debug(...args) {
374
+ if (!debug.enabled) return;
375
+ const self = debug;
376
+ const curr = Number(new Date());
377
+ const ms = curr - (prevTime || curr);
378
+ self.diff = ms;
379
+ self.prev = prevTime;
380
+ self.curr = curr;
381
+ prevTime = curr;
382
+ args[0] = createDebug.coerce(args[0]);
383
+ if ('string' != typeof args[0]) args.unshift('%O');
384
+ let index = 0;
385
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format)=>{
386
+ if ('%%' === match) return '%';
387
+ index++;
388
+ const formatter = createDebug.formatters[format];
389
+ if ('function' == typeof formatter) {
390
+ const val = args[index];
391
+ match = formatter.call(self, val);
392
+ args.splice(index, 1);
393
+ index--;
394
+ }
395
+ return match;
396
+ });
397
+ createDebug.formatArgs.call(self, args);
398
+ const logFn = self.log || createDebug.log;
399
+ logFn.apply(self, args);
400
+ }
401
+ debug.namespace = namespace;
402
+ debug.useColors = createDebug.useColors();
403
+ debug.color = createDebug.selectColor(namespace);
404
+ debug.extend = extend;
405
+ debug.destroy = createDebug.destroy;
406
+ Object.defineProperty(debug, 'enabled', {
407
+ enumerable: true,
408
+ configurable: false,
409
+ get: ()=>{
410
+ if (null !== enableOverride) return enableOverride;
411
+ if (namespacesCache !== createDebug.namespaces) {
412
+ namespacesCache = createDebug.namespaces;
413
+ enabledCache = createDebug.enabled(namespace);
414
+ }
415
+ return enabledCache;
416
+ },
417
+ set: (v)=>{
418
+ enableOverride = v;
419
+ }
420
+ });
421
+ if ('function' == typeof createDebug.init) createDebug.init(debug);
422
+ return debug;
423
+ }
424
+ function extend(namespace, delimiter) {
425
+ const newDebug = createDebug(this.namespace + (void 0 === delimiter ? ':' : delimiter) + namespace);
426
+ newDebug.log = this.log;
427
+ return newDebug;
428
+ }
429
+ function enable(namespaces) {
430
+ createDebug.save(namespaces);
431
+ createDebug.namespaces = namespaces;
432
+ createDebug.names = [];
433
+ createDebug.skips = [];
434
+ const split = ('string' == typeof namespaces ? namespaces : '').trim().replace(' ', ',').split(',').filter(Boolean);
435
+ for (const ns of split)if ('-' === ns[0]) createDebug.skips.push(ns.slice(1));
436
+ else createDebug.names.push(ns);
437
+ }
438
+ function matchesTemplate(search, template) {
439
+ let searchIndex = 0;
440
+ let templateIndex = 0;
441
+ let starIndex = -1;
442
+ let matchIndex = 0;
443
+ while(searchIndex < search.length)if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || '*' === template[templateIndex])) {
444
+ if ('*' === template[templateIndex]) {
445
+ starIndex = templateIndex;
446
+ matchIndex = searchIndex;
447
+ templateIndex++;
448
+ } else {
449
+ searchIndex++;
450
+ templateIndex++;
451
+ }
452
+ } else {
453
+ if (-1 === starIndex) return false;
454
+ templateIndex = starIndex + 1;
455
+ matchIndex++;
456
+ searchIndex = matchIndex;
457
+ }
458
+ while(templateIndex < template.length && '*' === template[templateIndex])templateIndex++;
459
+ return templateIndex === template.length;
460
+ }
461
+ function disable() {
462
+ const namespaces = [
463
+ ...createDebug.names,
464
+ ...createDebug.skips.map((namespace)=>'-' + namespace)
465
+ ].join(',');
466
+ createDebug.enable('');
467
+ return namespaces;
468
+ }
469
+ function enabled(name) {
470
+ for (const skip of createDebug.skips)if (matchesTemplate(name, skip)) return false;
471
+ for (const ns of createDebug.names)if (matchesTemplate(name, ns)) return true;
472
+ return false;
473
+ }
474
+ function coerce(val) {
475
+ if (val instanceof Error) return val.stack || val.message;
476
+ return val;
477
+ }
478
+ function destroy() {
479
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
480
+ }
481
+ createDebug.enable(createDebug.load());
482
+ return createDebug;
483
+ }
484
+ module.exports = setup;
485
+ },
486
+ "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
487
+ 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");
488
+ else module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js");
489
+ },
490
+ "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js": function(module, exports1, __webpack_require__) {
491
+ const tty = __webpack_require__("tty");
492
+ const util = __webpack_require__("util");
493
+ exports1.init = init;
494
+ exports1.log = log;
495
+ exports1.formatArgs = formatArgs;
496
+ exports1.save = save;
497
+ exports1.load = load;
498
+ exports1.useColors = useColors;
499
+ exports1.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`.');
500
+ exports1.colors = [
501
+ 6,
502
+ 2,
503
+ 3,
504
+ 4,
505
+ 5,
506
+ 1
507
+ ];
508
+ try {
509
+ const supportsColor = __webpack_require__("../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js");
510
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports1.colors = [
511
+ 20,
512
+ 21,
513
+ 26,
514
+ 27,
515
+ 32,
516
+ 33,
517
+ 38,
518
+ 39,
519
+ 40,
520
+ 41,
521
+ 42,
522
+ 43,
523
+ 44,
524
+ 45,
525
+ 56,
526
+ 57,
527
+ 62,
528
+ 63,
529
+ 68,
530
+ 69,
531
+ 74,
532
+ 75,
533
+ 76,
534
+ 77,
535
+ 78,
536
+ 79,
537
+ 80,
538
+ 81,
539
+ 92,
540
+ 93,
541
+ 98,
542
+ 99,
543
+ 112,
544
+ 113,
545
+ 128,
546
+ 129,
547
+ 134,
548
+ 135,
549
+ 148,
550
+ 149,
551
+ 160,
552
+ 161,
553
+ 162,
554
+ 163,
555
+ 164,
556
+ 165,
557
+ 166,
558
+ 167,
559
+ 168,
560
+ 169,
561
+ 170,
562
+ 171,
563
+ 172,
564
+ 173,
565
+ 178,
566
+ 179,
567
+ 184,
568
+ 185,
569
+ 196,
570
+ 197,
571
+ 198,
572
+ 199,
573
+ 200,
574
+ 201,
575
+ 202,
576
+ 203,
577
+ 204,
578
+ 205,
579
+ 206,
580
+ 207,
581
+ 208,
582
+ 209,
583
+ 214,
584
+ 215,
585
+ 220,
586
+ 221
587
+ ];
588
+ } catch (error) {}
589
+ exports1.inspectOpts = Object.keys(process.env).filter((key)=>/^debug_/i.test(key)).reduce((obj, key)=>{
590
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k)=>k.toUpperCase());
591
+ let val = process.env[key];
592
+ val = /^(yes|on|true|enabled)$/i.test(val) ? true : /^(no|off|false|disabled)$/i.test(val) ? false : 'null' === val ? null : Number(val);
593
+ obj[prop] = val;
594
+ return obj;
595
+ }, {});
596
+ function useColors() {
597
+ return 'colors' in exports1.inspectOpts ? Boolean(exports1.inspectOpts.colors) : tty.isatty(process.stderr.fd);
598
+ }
599
+ function formatArgs(args) {
600
+ const { namespace: name, useColors } = this;
601
+ if (useColors) {
602
+ const c = this.color;
603
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
604
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
605
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
606
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
607
+ } else args[0] = getDate() + name + ' ' + args[0];
608
+ }
609
+ function getDate() {
610
+ if (exports1.inspectOpts.hideDate) return '';
611
+ return new Date().toISOString() + ' ';
612
+ }
613
+ function log(...args) {
614
+ return process.stderr.write(util.formatWithOptions(exports1.inspectOpts, ...args) + '\n');
615
+ }
616
+ function save(namespaces) {
617
+ if (namespaces) process.env.DEBUG = namespaces;
618
+ else delete process.env.DEBUG;
619
+ }
620
+ function load() {
621
+ return process.env.DEBUG;
622
+ }
623
+ function init(debug) {
624
+ debug.inspectOpts = {};
625
+ const keys = Object.keys(exports1.inspectOpts);
626
+ for(let i = 0; i < keys.length; i++)debug.inspectOpts[keys[i]] = exports1.inspectOpts[keys[i]];
627
+ }
628
+ module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports1);
629
+ const { formatters } = module.exports;
630
+ formatters.o = function(v) {
631
+ this.inspectOpts.colors = this.useColors;
632
+ return util.inspect(v, this.inspectOpts).split('\n').map((str)=>str.trim()).join(' ');
633
+ };
634
+ formatters.O = function(v) {
635
+ this.inspectOpts.colors = this.useColors;
636
+ return util.inspect(v, this.inspectOpts);
637
+ };
638
+ },
639
+ "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js": function(module) {
640
+ "use strict";
641
+ module.exports = (flag, argv = process.argv)=>{
642
+ const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
643
+ const position = argv.indexOf(prefix + flag);
644
+ const terminatorPosition = argv.indexOf('--');
645
+ return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
646
+ };
647
+ },
648
+ "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js": function(__unused_webpack_module, exports1, __webpack_require__) {
649
+ "use strict";
650
+ var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
651
+ if (void 0 === k2) k2 = k;
652
+ var desc = Object.getOwnPropertyDescriptor(m, k);
653
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
654
+ enumerable: true,
655
+ get: function() {
656
+ return m[k];
657
+ }
658
+ };
659
+ Object.defineProperty(o, k2, desc);
660
+ } : function(o, m, k, k2) {
661
+ if (void 0 === k2) k2 = k;
662
+ o[k2] = m[k];
663
+ });
664
+ var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
665
+ Object.defineProperty(o, "default", {
666
+ enumerable: true,
667
+ value: v
668
+ });
669
+ } : function(o, v) {
670
+ o["default"] = v;
671
+ });
672
+ var __importStar = this && this.__importStar || function(mod) {
673
+ if (mod && mod.__esModule) return mod;
674
+ var result = {};
675
+ if (null != mod) {
676
+ for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
677
+ }
678
+ __setModuleDefault(result, mod);
679
+ return result;
680
+ };
681
+ var __importDefault = this && this.__importDefault || function(mod) {
682
+ return mod && mod.__esModule ? mod : {
683
+ default: mod
684
+ };
685
+ };
686
+ Object.defineProperty(exports1, "__esModule", {
687
+ value: true
688
+ });
689
+ exports1.HttpsProxyAgent = void 0;
690
+ const net = __importStar(__webpack_require__("net"));
691
+ const tls = __importStar(__webpack_require__("tls"));
692
+ const assert_1 = __importDefault(__webpack_require__("assert"));
693
+ const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
694
+ const agent_base_1 = __webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js");
695
+ const url_1 = __webpack_require__("url");
696
+ 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");
697
+ const debug = (0, debug_1.default)('https-proxy-agent');
698
+ const setServernameFromNonIpHost = (options)=>{
699
+ if (void 0 === options.servername && options.host && !net.isIP(options.host)) return {
700
+ ...options,
701
+ servername: options.host
702
+ };
703
+ return options;
704
+ };
705
+ class HttpsProxyAgent extends agent_base_1.Agent {
706
+ constructor(proxy, opts){
707
+ super(opts);
708
+ this.options = {
709
+ path: void 0
710
+ };
711
+ this.proxy = 'string' == typeof proxy ? new url_1.URL(proxy) : proxy;
712
+ this.proxyHeaders = opts?.headers ?? {};
713
+ debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
714
+ const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
715
+ const port = this.proxy.port ? parseInt(this.proxy.port, 10) : 'https:' === this.proxy.protocol ? 443 : 80;
716
+ this.connectOpts = {
717
+ ALPNProtocols: [
718
+ 'http/1.1'
719
+ ],
720
+ ...opts ? omit(opts, 'headers') : null,
721
+ host,
722
+ port
723
+ };
724
+ }
725
+ async connect(req, opts) {
726
+ const { proxy } = this;
727
+ if (!opts.host) throw new TypeError('No "host" provided');
728
+ let socket;
729
+ if ('https:' === proxy.protocol) {
730
+ debug('Creating `tls.Socket`: %o', this.connectOpts);
731
+ socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
732
+ } else {
733
+ debug('Creating `net.Socket`: %o', this.connectOpts);
734
+ socket = net.connect(this.connectOpts);
735
+ }
736
+ const headers = 'function' == typeof this.proxyHeaders ? this.proxyHeaders() : {
737
+ ...this.proxyHeaders
738
+ };
739
+ const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
740
+ let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
741
+ if (proxy.username || proxy.password) {
742
+ const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
743
+ headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;
744
+ }
745
+ headers.Host = `${host}:${opts.port}`;
746
+ if (!headers['Proxy-Connection']) headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close';
747
+ for (const name of Object.keys(headers))payload += `${name}: ${headers[name]}\r\n`;
748
+ const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
749
+ socket.write(`${payload}\r\n`);
750
+ const { connect, buffered } = await proxyResponsePromise;
751
+ req.emit('proxyConnect', connect);
752
+ this.emit('proxyConnect', connect, req);
753
+ if (200 === connect.statusCode) {
754
+ req.once('socket', resume);
755
+ if (opts.secureEndpoint) {
756
+ debug('Upgrading socket connection to TLS');
757
+ return tls.connect({
758
+ ...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
759
+ socket
760
+ });
761
+ }
762
+ return socket;
763
+ }
764
+ socket.destroy();
765
+ const fakeSocket = new net.Socket({
766
+ writable: false
767
+ });
768
+ fakeSocket.readable = true;
769
+ req.once('socket', (s)=>{
770
+ debug('Replaying proxy buffer for failed request');
771
+ (0, assert_1.default)(s.listenerCount('data') > 0);
772
+ s.push(buffered);
773
+ s.push(null);
774
+ });
775
+ return fakeSocket;
776
+ }
777
+ }
778
+ HttpsProxyAgent.protocols = [
779
+ 'http',
780
+ 'https'
781
+ ];
782
+ exports1.HttpsProxyAgent = HttpsProxyAgent;
783
+ function resume(socket) {
784
+ socket.resume();
785
+ }
786
+ function omit(obj, ...keys) {
787
+ const ret = {};
788
+ let key;
789
+ for(key in obj)if (!keys.includes(key)) ret[key] = obj[key];
790
+ return ret;
791
+ }
792
+ },
793
+ "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js": function(__unused_webpack_module, exports1, __webpack_require__) {
794
+ "use strict";
795
+ var __importDefault = this && this.__importDefault || function(mod) {
796
+ return mod && mod.__esModule ? mod : {
797
+ default: mod
798
+ };
799
+ };
800
+ Object.defineProperty(exports1, "__esModule", {
801
+ value: true
802
+ });
803
+ exports1.parseProxyResponse = void 0;
804
+ const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
805
+ const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response');
806
+ function parseProxyResponse(socket) {
807
+ return new Promise((resolve, reject)=>{
808
+ let buffersLength = 0;
809
+ const buffers = [];
810
+ function read() {
811
+ const b = socket.read();
812
+ if (b) ondata(b);
813
+ else socket.once('readable', read);
814
+ }
815
+ function cleanup() {
816
+ socket.removeListener('end', onend);
817
+ socket.removeListener('error', onerror);
818
+ socket.removeListener('readable', read);
819
+ }
820
+ function onend() {
821
+ cleanup();
822
+ debug('onend');
823
+ reject(new Error('Proxy connection ended before receiving CONNECT response'));
824
+ }
825
+ function onerror(err) {
826
+ cleanup();
827
+ debug('onerror %o', err);
828
+ reject(err);
829
+ }
830
+ function ondata(b) {
831
+ buffers.push(b);
832
+ buffersLength += b.length;
833
+ const buffered = Buffer.concat(buffers, buffersLength);
834
+ const endOfHeaders = buffered.indexOf('\r\n\r\n');
835
+ if (-1 === endOfHeaders) {
836
+ debug('have not received end of HTTP headers yet...');
837
+ read();
838
+ return;
839
+ }
840
+ const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n');
841
+ const firstLine = headerParts.shift();
842
+ if (!firstLine) {
843
+ socket.destroy();
844
+ return reject(new Error('No header received from proxy CONNECT response'));
845
+ }
846
+ const firstLineParts = firstLine.split(' ');
847
+ const statusCode = +firstLineParts[1];
848
+ const statusText = firstLineParts.slice(2).join(' ');
849
+ const headers = {};
850
+ for (const header of headerParts){
851
+ if (!header) continue;
852
+ const firstColon = header.indexOf(':');
853
+ if (-1 === firstColon) {
854
+ socket.destroy();
855
+ return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
856
+ }
857
+ const key = header.slice(0, firstColon).toLowerCase();
858
+ const value = header.slice(firstColon + 1).trimStart();
859
+ const current = headers[key];
860
+ if ('string' == typeof current) headers[key] = [
861
+ current,
862
+ value
863
+ ];
864
+ else if (Array.isArray(current)) current.push(value);
865
+ else headers[key] = value;
866
+ }
867
+ debug('got proxy server response: %o %o', firstLine, headers);
868
+ cleanup();
869
+ resolve({
870
+ connect: {
871
+ statusCode,
872
+ statusText,
873
+ headers
874
+ },
875
+ buffered
876
+ });
877
+ }
878
+ socket.on('error', onerror);
879
+ socket.on('end', onend);
880
+ read();
881
+ });
882
+ }
883
+ exports1.parseProxyResponse = parseProxyResponse;
884
+ },
885
+ "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js": function(module) {
886
+ var s = 1000;
887
+ var m = 60 * s;
888
+ var h = 60 * m;
889
+ var d = 24 * h;
890
+ var w = 7 * d;
891
+ var y = 365.25 * d;
892
+ module.exports = function(val, options) {
893
+ options = options || {};
894
+ var type = typeof val;
895
+ if ('string' === type && val.length > 0) return parse(val);
896
+ if ('number' === type && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
897
+ throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
898
+ };
899
+ function parse(str) {
900
+ str = String(str);
901
+ if (str.length > 100) return;
902
+ 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);
903
+ if (!match) return;
904
+ var n = parseFloat(match[1]);
905
+ var type = (match[2] || 'ms').toLowerCase();
906
+ switch(type){
907
+ case 'years':
908
+ case 'year':
909
+ case 'yrs':
910
+ case 'yr':
911
+ case 'y':
912
+ return n * y;
913
+ case 'weeks':
914
+ case 'week':
915
+ case 'w':
916
+ return n * w;
917
+ case 'days':
918
+ case 'day':
919
+ case 'd':
920
+ return n * d;
921
+ case 'hours':
922
+ case 'hour':
923
+ case 'hrs':
924
+ case 'hr':
925
+ case 'h':
926
+ return n * h;
927
+ case 'minutes':
928
+ case 'minute':
929
+ case 'mins':
930
+ case 'min':
931
+ case 'm':
932
+ return n * m;
933
+ case 'seconds':
934
+ case 'second':
935
+ case 'secs':
936
+ case 'sec':
937
+ case 's':
938
+ return n * s;
939
+ case 'milliseconds':
940
+ case 'millisecond':
941
+ case 'msecs':
942
+ case 'msec':
943
+ case 'ms':
944
+ return n;
945
+ default:
946
+ return;
947
+ }
948
+ }
949
+ function fmtShort(ms) {
950
+ var msAbs = Math.abs(ms);
951
+ if (msAbs >= d) return Math.round(ms / d) + 'd';
952
+ if (msAbs >= h) return Math.round(ms / h) + 'h';
953
+ if (msAbs >= m) return Math.round(ms / m) + 'm';
954
+ if (msAbs >= s) return Math.round(ms / s) + 's';
955
+ return ms + 'ms';
956
+ }
957
+ function fmtLong(ms) {
958
+ var msAbs = Math.abs(ms);
959
+ if (msAbs >= d) return plural(ms, msAbs, d, 'day');
960
+ if (msAbs >= h) return plural(ms, msAbs, h, 'hour');
961
+ if (msAbs >= m) return plural(ms, msAbs, m, 'minute');
962
+ if (msAbs >= s) return plural(ms, msAbs, s, 'second');
963
+ return ms + ' ms';
964
+ }
965
+ function plural(ms, msAbs, n, name) {
966
+ var isPlural = msAbs >= 1.5 * n;
967
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
968
+ }
969
+ },
970
+ "../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
971
+ "use strict";
972
+ const os = __webpack_require__("os");
973
+ const tty = __webpack_require__("tty");
974
+ const hasFlag = __webpack_require__("../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js");
975
+ const { env } = process;
976
+ let flagForceColor;
977
+ if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
978
+ else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
979
+ function envForceColor() {
980
+ if ('FORCE_COLOR' in env) {
981
+ if ('true' === env.FORCE_COLOR) return 1;
982
+ if ('false' === env.FORCE_COLOR) return 0;
983
+ return 0 === env.FORCE_COLOR.length ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
984
+ }
985
+ }
986
+ function translateLevel(level) {
987
+ if (0 === level) return false;
988
+ return {
989
+ level,
990
+ hasBasic: true,
991
+ has256: level >= 2,
992
+ has16m: level >= 3
993
+ };
994
+ }
995
+ function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
996
+ const noFlagForceColor = envForceColor();
997
+ if (void 0 !== noFlagForceColor) flagForceColor = noFlagForceColor;
998
+ const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
999
+ if (0 === forceColor) return 0;
1000
+ if (sniffFlags) {
1001
+ if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) return 3;
1002
+ if (hasFlag('color=256')) return 2;
1003
+ }
1004
+ if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
1005
+ const min = forceColor || 0;
1006
+ if ('dumb' === env.TERM) return min;
1007
+ if ('win32' === process.platform) {
1008
+ const osRelease = os.release().split('.');
1009
+ if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
1010
+ return 1;
1011
+ }
1012
+ if ('CI' in env) {
1013
+ if ([
1014
+ 'TRAVIS',
1015
+ 'CIRCLECI',
1016
+ 'APPVEYOR',
1017
+ 'GITLAB_CI',
1018
+ 'GITHUB_ACTIONS',
1019
+ 'BUILDKITE',
1020
+ 'DRONE'
1021
+ ].some((sign)=>sign in env) || 'codeship' === env.CI_NAME) return 1;
1022
+ return min;
1023
+ }
1024
+ if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1025
+ if ('truecolor' === env.COLORTERM) return 3;
1026
+ if ('TERM_PROGRAM' in env) {
1027
+ const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
1028
+ switch(env.TERM_PROGRAM){
1029
+ case 'iTerm.app':
1030
+ return version >= 3 ? 3 : 2;
1031
+ case 'Apple_Terminal':
1032
+ return 2;
1033
+ }
1034
+ }
1035
+ if (/-256(color)?$/i.test(env.TERM)) return 2;
1036
+ if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
1037
+ if ('COLORTERM' in env) return 1;
1038
+ return min;
1039
+ }
1040
+ function getSupportLevel(stream, options = {}) {
1041
+ const level = supportsColor(stream, {
1042
+ streamIsTTY: stream && stream.isTTY,
1043
+ ...options
1044
+ });
1045
+ return translateLevel(level);
1046
+ }
1047
+ module.exports = {
1048
+ supportsColor: getSupportLevel,
1049
+ stdout: getSupportLevel({
1050
+ isTTY: tty.isatty(1)
1051
+ }),
1052
+ stderr: getSupportLevel({
1053
+ isTTY: tty.isatty(2)
1054
+ })
1055
+ };
1056
+ },
2
1057
  "./src/utils/XhsXsCommonEnc.js": function(module) {
3
1058
  var encrypt_lookup = [
4
1059
  "Z",
@@ -1746,6 +2801,42 @@ var __webpack_modules__ = {
1746
2801
  return Data2A_B(Base2Data(EnvData2CharCode(_0x315138, _0x1c32b3, _0x56536b)));
1747
2802
  }
1748
2803
  module[a0_0x45db08(0xae)] = GenAB;
2804
+ },
2805
+ assert: function(module) {
2806
+ "use strict";
2807
+ module.exports = require("assert");
2808
+ },
2809
+ http: function(module) {
2810
+ "use strict";
2811
+ module.exports = require("http");
2812
+ },
2813
+ https: function(module) {
2814
+ "use strict";
2815
+ module.exports = require("https");
2816
+ },
2817
+ net: function(module) {
2818
+ "use strict";
2819
+ module.exports = require("net");
2820
+ },
2821
+ os: function(module) {
2822
+ "use strict";
2823
+ module.exports = require("os");
2824
+ },
2825
+ tls: function(module) {
2826
+ "use strict";
2827
+ module.exports = require("tls");
2828
+ },
2829
+ tty: function(module) {
2830
+ "use strict";
2831
+ module.exports = require("tty");
2832
+ },
2833
+ url: function(module) {
2834
+ "use strict";
2835
+ module.exports = require("url");
2836
+ },
2837
+ util: function(module) {
2838
+ "use strict";
2839
+ module.exports = require("util");
1749
2840
  }
1750
2841
  };
1751
2842
  var __webpack_module_cache__ = {};
@@ -1757,7 +2848,7 @@ function __webpack_require__(moduleId) {
1757
2848
  loaded: false,
1758
2849
  exports: {}
1759
2850
  };
1760
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
2851
+ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1761
2852
  module.loaded = true;
1762
2853
  return module.exports;
1763
2854
  }
@@ -1810,6 +2901,7 @@ var __webpack_exports__ = {};
1810
2901
  __webpack_require__.r(__webpack_exports__);
1811
2902
  __webpack_require__.d(__webpack_exports__, {
1812
2903
  version: ()=>package_namespaceObject.i8,
2904
+ BetaFlag: ()=>BetaFlag,
1813
2905
  Action: ()=>Action
1814
2906
  });
1815
2907
  const external_node_fs_namespaceObject = require("node:fs");
@@ -1824,6 +2916,28 @@ var __webpack_exports__ = {};
1824
2916
  var external_mime_types_default = /*#__PURE__*/ __webpack_require__.n(external_mime_types_namespaceObject);
1825
2917
  const external_axios_namespaceObject = require("axios");
1826
2918
  var external_axios_default = /*#__PURE__*/ __webpack_require__.n(external_axios_namespaceObject);
2919
+ var dist = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js");
2920
+ const ProxyData = {
2921
+ api: "202101291430286754",
2922
+ md5akey: "6ec8d333e85044b7",
2923
+ akey: "91709114"
2924
+ };
2925
+ const ProxyAgent = async (adr, huiwenToken)=>{
2926
+ const http = new Http({});
2927
+ let ProxyInfo = await http.api({
2928
+ method: "GET",
2929
+ url: "https://preview.huiwen.top/api/publish/zdy/ip",
2930
+ params: {
2931
+ addr: adr
2932
+ },
2933
+ ...huiwenToken ? {
2934
+ headers: {
2935
+ token: huiwenToken
2936
+ }
2937
+ } : null
2938
+ });
2939
+ return 0 === ProxyInfo.code && ProxyInfo.data.length > 0 ? new dist.HttpsProxyAgent(`http://${ProxyData.api}:${ProxyData.akey}@${ProxyInfo.data[0].proxyAddress}`) : null;
2940
+ };
1827
2941
  class Http {
1828
2942
  static handleApiError(error) {
1829
2943
  if (error && "object" == typeof error && "code" in error && "message" in error) return error;
@@ -1833,10 +2947,17 @@ var __webpack_exports__ = {};
1833
2947
  data: error
1834
2948
  };
1835
2949
  }
1836
- constructor(config){
2950
+ constructor(config, adr, huiwenToken){
1837
2951
  this.apiClient = external_axios_default().create({
1838
- ...config
2952
+ ...config,
2953
+ proxy: {
2954
+ host: "192.168.137.1",
2955
+ port: 9000,
2956
+ protocol: "http"
2957
+ }
1839
2958
  });
2959
+ this.adr = adr;
2960
+ this.heiwenToken = huiwenToken;
1840
2961
  }
1841
2962
  addResponseInterceptor(findError) {
1842
2963
  this.apiClient.interceptors.response.use((response)=>{
@@ -1865,16 +2986,60 @@ var __webpack_exports__ = {};
1865
2986
  errorResponse.data = serverError;
1866
2987
  }
1867
2988
  }
2989
+ if (error.code) switch(error.code){
2990
+ case "ECONNRESET":
2991
+ errorResponse.message = "连接被重置,请检查网络或稍后重试!";
2992
+ break;
2993
+ case "ENOTFOUND":
2994
+ errorResponse.message = "域名解析失败,请检查 URL 是否正确!";
2995
+ break;
2996
+ case "ETIMEDOUT":
2997
+ errorResponse.message = "网络请求超时,请检查网络连接!";
2998
+ break;
2999
+ case "ECONNREFUSED":
3000
+ errorResponse.message = "服务器拒绝连接,请稍后重试!";
3001
+ break;
3002
+ case "EAI_AGAIN":
3003
+ errorResponse.message = "DNS 查询超时,请稍后重试!";
3004
+ break;
3005
+ default:
3006
+ errorResponse.message = `网络错误: ${error.message}`;
3007
+ break;
3008
+ }
1868
3009
  return Promise.reject(errorResponse);
1869
3010
  });
1870
3011
  }
1871
- async api(config) {
1872
- try {
1873
- const response = await this.apiClient(config);
1874
- return response.data;
1875
- } catch (error) {
1876
- return Promise.reject(Http.handleApiError(error));
1877
- }
3012
+ async api(config, options) {
3013
+ const retries = options?.retries ?? 0;
3014
+ const retryDelay = options?.retryDelay ?? 500;
3015
+ const sessionRt = async (Rtimes)=>{
3016
+ try {
3017
+ const agent = this.adr ? await ProxyAgent(this.adr, this.heiwenToken) : void 0;
3018
+ if (this.adr && null == agent) return Promise.reject({
3019
+ code: 200,
3020
+ message: "当前发文IP地址暂不支持!"
3021
+ });
3022
+ this.proxyInfo = agent?.proxy.host;
3023
+ const response = await this.apiClient({
3024
+ ...config,
3025
+ ...agent ? {
3026
+ httpAgent: agent,
3027
+ httpsAgent: agent
3028
+ } : {}
3029
+ });
3030
+ return response.data;
3031
+ } catch (error) {
3032
+ const handledError = Http.handleApiError(error);
3033
+ const isRetry = handledError.code >= 500 || 0 === handledError.code;
3034
+ if (Rtimes < retries && isRetry) {
3035
+ console.log("Loger: 进入重试!");
3036
+ await new Promise((resolve)=>setTimeout(resolve, retryDelay));
3037
+ return sessionRt(Rtimes + 1);
3038
+ }
3039
+ return Promise.reject(handledError);
3040
+ }
3041
+ };
3042
+ return sessionRt(0);
1878
3043
  }
1879
3044
  }
1880
3045
  function getRandomInRange(min, max) {
@@ -2081,6 +3246,71 @@ var __webpack_exports__ = {};
2081
3246
  const share_namespaceObject = require("@iflyrpa/share");
2082
3247
  const external_form_data_namespaceObject = require("form-data");
2083
3248
  var external_form_data_default = /*#__PURE__*/ __webpack_require__.n(external_form_data_namespaceObject);
3249
+ const external_node_crypto_namespaceObject = require("node:crypto");
3250
+ var external_node_crypto_default = /*#__PURE__*/ __webpack_require__.n(external_node_crypto_namespaceObject);
3251
+ const generateTopicHtml = function(topic, id, sv_small_images) {
3252
+ const generateUid = function() {
3253
+ const e = ()=>Math.floor(65536 * (1 + Math.random())).toString(16).substring(1);
3254
+ return e() + e() + e() + e() + e() + e() + e() + e();
3255
+ };
3256
+ const topicBase = function(topic, id, sv_small_images) {
3257
+ const t = function(r) {
3258
+ let n = [];
3259
+ let e = 0;
3260
+ for(; e < 256; ++e)n[e] = (e + 256).toString(16).substr(1);
3261
+ let o = 0;
3262
+ return [
3263
+ n[r[o++]],
3264
+ n[r[o++]],
3265
+ n[r[o++]],
3266
+ n[r[o++]],
3267
+ "-",
3268
+ n[r[o++]],
3269
+ n[r[o++]],
3270
+ "-",
3271
+ n[r[o++]],
3272
+ n[r[o++]],
3273
+ "-",
3274
+ n[r[o++]],
3275
+ n[r[o++]],
3276
+ "-",
3277
+ n[r[o++]],
3278
+ n[r[o++]],
3279
+ n[r[o++]],
3280
+ n[r[o++]],
3281
+ n[r[o++]],
3282
+ n[r[o++]]
3283
+ ].join("");
3284
+ };
3285
+ const s = external_node_crypto_default().randomBytes(16);
3286
+ s[6] = 15 & s[6] | 64, s[8] = 63 & s[8] | 128;
3287
+ return {
3288
+ id: id || t(s),
3289
+ sv_small_images: sv_small_images || "",
3290
+ title: topic.replace(/[^\u4E00-\u9FA5a-zA-Z0-9]/g, ""),
3291
+ isCreate: 1
3292
+ };
3293
+ };
3294
+ const n = id ? topicBase(topic, id, sv_small_images) : topicBase(topic);
3295
+ const topicAttr = {
3296
+ style: "border:none;display:inline-block;color:#3E5599;text-decoration:none;font-style:normal;",
3297
+ 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, "&amp;"),
3298
+ target: "_blank",
3299
+ "data-bjh-cover": "".concat(n.sv_small_images && (n.sv_small_images.https || n.sv_small_images.http)),
3300
+ "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, "&amp;"),
3301
+ "data-bjh-box": "topic",
3302
+ "data-bjh-title": n.title,
3303
+ "data-bjh-id": id || n.id,
3304
+ "data-bjh-type": "topic",
3305
+ contenteditable: "false",
3306
+ "data-ignore-remove-style": "1",
3307
+ "data-bjh-create": id ? "0" : "1",
3308
+ "data-bjh-adinspiration": "0",
3309
+ "data-diagnose-id": generateUid()
3310
+ };
3311
+ const attrStr = Object.entries(topicAttr).map(([key, val])=>`${key}="${val}"`).join(" ");
3312
+ return `<p><span data-diagnose-id=${generateUid()}></span><a ${attrStr}>#${n.title}#</a></p>`;
3313
+ };
2084
3314
  const errnoMap = {
2085
3315
  20040706: "正文图片和封面图片推荐jpg、png格式。",
2086
3316
  20040084: "正文图片和封面图片推荐jpg、png格式。",
@@ -2095,16 +3325,19 @@ var __webpack_exports__ = {};
2095
3325
  20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
2096
3326
  20040124: "服务器异常,请稍后重试!",
2097
3327
  20040001: "当前用户未登录,请登陆后重试!",
2098
- 401100025: "该应用不支持此媒资类型"
3328
+ 401100025: "该应用不支持此媒资类型",
3329
+ 401100033: "图片宽高不满足要求",
3330
+ '-6': "文章分类信息错误"
2099
3331
  };
2100
3332
  const mockAction = async (task, params)=>{
2101
3333
  const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
2102
3334
  const tmpCachePath = task.getTmpPath();
2103
- const http = new Http({
2104
- headers: {
2105
- cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
2106
- token: params.token
2107
- }
3335
+ const headers = {
3336
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
3337
+ token: params.token
3338
+ };
3339
+ let http = new Http({
3340
+ headers
2108
3341
  });
2109
3342
  http.addResponseInterceptor((response)=>{
2110
3343
  const msgType = "draft" === params.saveType ? "同步" : "发布";
@@ -2156,7 +3389,21 @@ var __webpack_exports__ = {};
2156
3389
  };
2157
3390
  const originContentImages = extractImgTag(params.content);
2158
3391
  const targetContentImages = await uploadImages(originContentImages);
2159
- const content = replaceImgSrc(params.content, (dom)=>{
3392
+ if (params.settingInfo.baijiahaoTopic && !params.settingInfo.baijiahaoTopic?.id) {
3393
+ let topicCheck = await http.api({
3394
+ method: "get",
3395
+ url: "https://baijiahao.baidu.com/pcui/topic/topiccheck",
3396
+ params: {
3397
+ topicName: params.settingInfo.baijiahaoTopic?.title
3398
+ }
3399
+ });
3400
+ if (0 != topicCheck.errno) return {
3401
+ code: 200,
3402
+ message: topicCheck.errmsg,
3403
+ data: ''
3404
+ };
3405
+ }
3406
+ 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)=>{
2160
3407
  if (dom.attribs.src) {
2161
3408
  const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
2162
3409
  dom.attribs.src = targetContentImages[idx].bos_url;
@@ -2216,11 +3463,23 @@ var __webpack_exports__ = {};
2216
3463
  activity_list,
2217
3464
  ...params.settingInfo.timer ? {
2218
3465
  timer_time: params.settingInfo.timer
3466
+ } : {},
3467
+ ...params.settingInfo.baijiahaoCms ? {
3468
+ 'cate_user_cms[0]': params.settingInfo.baijiahaoCms[0],
3469
+ 'cate_user_cms[1]': params.settingInfo.baijiahaoCms[1]
3470
+ } : {},
3471
+ ...params.settingInfo.baijiahaoEventSpec ? {
3472
+ 'event_spec[time]': params.settingInfo.baijiahaoEventSpec.time,
3473
+ 'event_spec[pos]': params.settingInfo.baijiahaoEventSpec.pos
2219
3474
  } : {}
2220
3475
  };
2221
3476
  const isDraft = "draft" === params.saveType;
2222
3477
  const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
2223
- const res = await http.api({
3478
+ task._timerRecord['PrePublish'] = Date.now();
3479
+ const proxyHttp = task?.isBeta ?? false ? new Http({
3480
+ headers
3481
+ }, params.proxyLoc, params.huiwenToken) : http;
3482
+ const res = await proxyHttp.api({
2224
3483
  method: "post",
2225
3484
  url: saveUrl,
2226
3485
  data: publishData,
@@ -2230,8 +3489,11 @@ var __webpack_exports__ = {};
2230
3489
  referer: "https://baijiahao.baidu.com/builder/rc/edit?type=news"
2231
3490
  },
2232
3491
  defaultErrorMsg: isDraft ? "文章同步出现异常,请稍后重试。" : "文章发布出现异常,请稍后重试。"
3492
+ }, {
3493
+ retries: 2,
3494
+ retryDelay: 500
2233
3495
  });
2234
- return (0, share_namespaceObject.success)(res.ret.article_id, "百家号发布完成。");
3496
+ return (0, share_namespaceObject.success)(0 == res.errno ? res?.ret?.article_id || '' : "", 0 == res.errno ? `文章发布成功!` + (proxyHttp.proxyInfo || "") : res.errmsg ?? '文章发布失败,请稍后重试。');
2235
3497
  };
2236
3498
  const rpaAction = async (task, params)=>{
2237
3499
  const tmpCachePath = task.getTmpPath();
@@ -2357,6 +3619,7 @@ var __webpack_exports__ = {};
2357
3619
  }
2358
3620
  };
2359
3621
  page.on("response", handleResponse);
3622
+ task._timerRecord['PrePublish'] = Date.now();
2360
3623
  const operatorContainer = page.locator(".editor-component-operator");
2361
3624
  if ("draft" === params.saveType) await operatorContainer.locator(".op-btn-outter-content").filter({
2362
3625
  hasText: "存草稿"
@@ -2659,8 +3922,6 @@ var __webpack_exports__ = {};
2659
3922
  }
2660
3923
  };
2661
3924
  const external_node_buffer_namespaceObject = require("node:buffer");
2662
- const external_node_crypto_namespaceObject = require("node:crypto");
2663
- var external_node_crypto_default = /*#__PURE__*/ __webpack_require__.n(external_node_crypto_namespaceObject);
2664
3925
  class CryptoConfig {
2665
3926
  static{
2666
3927
  this.MAX_32BIT = 0xFFFFFFFF;
@@ -3098,12 +4359,13 @@ var __webpack_exports__ = {};
3098
4359
  const mock_mockAction = async (task, params)=>{
3099
4360
  const { toutiaoSingleCover, toutiaoMultCover, toutiaoCoverType, toutiaoOriginal, toutiaoExclusive, toutiaoClaim } = params.settingInfo;
3100
4361
  const tmpCachePath = task.getTmpPath();
4362
+ const headers = {
4363
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
4364
+ origin: "https://mp.toutiao.com",
4365
+ referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
4366
+ };
3101
4367
  const http = new Http({
3102
- headers: {
3103
- cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
3104
- origin: "https://mp.toutiao.com",
3105
- referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
3106
- }
4368
+ headers
3107
4369
  });
3108
4370
  http.addResponseInterceptor((response)=>{
3109
4371
  if (response.data?.code !== 0) {
@@ -3180,11 +4442,14 @@ var __webpack_exports__ = {};
3180
4442
  device_platform: "mp",
3181
4443
  is_message: 0
3182
4444
  },
3183
- tuwen_wtt_trans_flag: "0",
4445
+ tuwen_wtt_trans_flag: params.settingInfo?.toutiaoTransWtt ? "2" : "0",
3184
4446
  info_source: sourceData,
3185
4447
  ...location ? {
3186
4448
  city: location.label,
3187
4449
  city_code: location.value
4450
+ } : null,
4451
+ ...params.settingInfo?.toutiaoCollectionId ? {
4452
+ want_join_collection_id: params.settingInfo.toutiaoCollectionId
3188
4453
  } : null
3189
4454
  };
3190
4455
  const publishData = {
@@ -3230,6 +4495,7 @@ var __webpack_exports__ = {};
3230
4495
  article_ad_type: getAddTypeValue(params.settingInfo.toutiaoAd),
3231
4496
  claim_exclusive: toutiaoExclusive ? toutiaoExclusive : toutiaoOriginal?.includes("exclusive") ? 1 : 0
3232
4497
  };
4498
+ task._timerRecord['PrePublish'] = Date.now();
3233
4499
  const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
3234
4500
  let publishOption = {};
3235
4501
  if (msToken) {
@@ -3261,8 +4527,14 @@ var __webpack_exports__ = {};
3261
4527
  },
3262
4528
  defaultErrorMsg: "draft" === params.saveType ? "文章同步异常,请稍后重试。" : "文章发布异常,请稍后重试。"
3263
4529
  };
3264
- const publishResult = await http.api(publishOption);
3265
- return (0, share_namespaceObject.success)(publishResult.data.pgc_id);
4530
+ const proxyHttp = task?.isBeta ?? false ? new Http({
4531
+ headers
4532
+ }, params.proxyLoc, params.huiwenToken) : http;
4533
+ const publishResult = await proxyHttp.api(publishOption, {
4534
+ retries: 2,
4535
+ retryDelay: 500
4536
+ });
4537
+ return (0, share_namespaceObject.success)(publishResult.data.pgc_id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
3266
4538
  };
3267
4539
  const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
3268
4540
  const rpa_rpaAction = async (task, params)=>{
@@ -3474,6 +4746,7 @@ var __webpack_exports__ = {};
3474
4746
  const confirmBtn = page.locator('div.byte-modal-footer button.byte-btn-primary:has-text("确定")');
3475
4747
  if (await confirmBtn.isVisible()) await confirmBtn.click();
3476
4748
  }
4749
+ task._timerRecord['PrePublish'] = Date.now();
3477
4750
  if ("publish" === params.saveType) {
3478
4751
  await page.locator(".publish-footer button").filter({
3479
4752
  hasText: params.settingInfo.timer ? "定时发布" : "确认发布"
@@ -3930,6 +5203,24 @@ var __webpack_exports__ = {};
3930
5203
  return (0, share_namespaceObject.success)(null, "暂不支持该平台");
3931
5204
  }
3932
5205
  };
5206
+ const searchBjhTopicList = async (_task, params)=>{
5207
+ const cookies = params.cookies ?? [];
5208
+ const http = new Http({
5209
+ headers: {
5210
+ cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
5211
+ token: params.token
5212
+ }
5213
+ });
5214
+ const res = await http.api({
5215
+ method: "get",
5216
+ url: "https://baijiahao.baidu.com/pcui/pcpublisher/searchtopic",
5217
+ params: {
5218
+ content: params.topicContent,
5219
+ resource_type: 1
5220
+ }
5221
+ });
5222
+ return (0, share_namespaceObject.success)(res?.data?.hot ?? [], "百家号" + (0 == res.errno ? "话题获取成功!" : "话题获取失败"));
5223
+ };
3933
5224
  const searchPublishInfo_types_errorResponse = (message, code = 500)=>({
3934
5225
  code,
3935
5226
  message,
@@ -4214,10 +5505,10 @@ var __webpack_exports__ = {};
4214
5505
  }
4215
5506
  const final = filtered.slice(0, pageSize);
4216
5507
  const articleCell = final.map((item)=>({
4217
- title: item.title,
4218
- imageUrl: JSON.parse(item.cover_images)[0].src,
5508
+ title: item?.is_transfer ?? false ? item.content || "" : item.title,
5509
+ imageUrl: JSON.parse(item.cover_images)[0]?.src || "",
4219
5510
  createTime: Math.floor(new Date(item.publish_at.replace(/-/g, "/")).getTime() / 1000),
4220
- redirectUrl: item.url,
5511
+ redirectUrl: item.url || item.share_url,
4221
5512
  recommendNum: item.rec_amount | item.forward_num,
4222
5513
  collectNum: item.collection_amount,
4223
5514
  readNum: item.read_amount | item.read_num,
@@ -4368,6 +5659,51 @@ var __webpack_exports__ = {};
4368
5659
  };
4369
5660
  return (0, share_namespaceObject.success)(filtered, 0 === res.base_resp.ret ? "微信配置信息获取成功!" : "微信配置信息获取失败!");
4370
5661
  };
5662
+ const getWeixinCollection = async (_task, params)=>{
5663
+ const http = new Http({
5664
+ headers: {
5665
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
5666
+ }
5667
+ });
5668
+ const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
5669
+ const res = await http.api({
5670
+ method: "get",
5671
+ url: "https://mp.weixin.qq.com/cgi-bin/appmsgalbummgr",
5672
+ params: {
5673
+ action: 'list',
5674
+ begin: 0,
5675
+ count: 100,
5676
+ sub_title: '',
5677
+ type: 0,
5678
+ latest: 1,
5679
+ need_pay: 0,
5680
+ fingerprint,
5681
+ token: params.token,
5682
+ lang: 'zh_CN',
5683
+ f: 'json',
5684
+ ajax: 1
5685
+ }
5686
+ });
5687
+ return (0, share_namespaceObject.success)(res.list_resp.items, 0 === res.base_resp.ret ? "微信合计信息获取成功!" : "微信合集信息获取失败!");
5688
+ };
5689
+ const getXhsCollection = async (_task, params)=>{
5690
+ const http = new Http({
5691
+ headers: {
5692
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
5693
+ referer: "https://creator.xiaohongshu.com",
5694
+ origin: "https://creator.xiaohongshu.com"
5695
+ }
5696
+ });
5697
+ try {
5698
+ const res = await http.api({
5699
+ method: "get",
5700
+ url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
5701
+ });
5702
+ return (0, share_namespaceObject.success)(0 === res.result ? res.data.collections : [], "合集信息获取" + (0 === res.result ? "成功!" : `失败!`));
5703
+ } catch (error) {
5704
+ return (0, share_namespaceObject.success)([]);
5705
+ }
5706
+ };
4371
5707
  const weitoutiaoPublish_mock_mockAction = async (task, params)=>{
4372
5708
  const tmpCachePath = task.getTmpPath();
4373
5709
  const http = new Http({
@@ -4514,6 +5850,16 @@ var __webpack_exports__ = {};
4514
5850
  Normal: "kQuotaTypeMassSendNormal",
4515
5851
  ProductActivity: "kQuotaTypeMassSendProductActivity"
4516
5852
  };
5853
+ function genTopicHTML(topics) {
5854
+ if (!topics || 0 === topics.length) return "";
5855
+ const rn = ()=>{
5856
+ const O = Date.now().toString(36);
5857
+ const B = Math.random().toString(36).substring(2, 8);
5858
+ return `${O}-${B}`;
5859
+ };
5860
+ const aTags = topics.map((topic)=>`<a class="wx_topic_link" topic-id="${rn()}" style="color: #576B95 !important;" data-topic="1">#${topic}</a>`).join("&nbsp;");
5861
+ return `<p style="line-height: 1.75;margin: 0px 0px 24px;padding: 0px;" data-bothblock="0px"><span leaf="">${aTags}</span></p>`;
5862
+ }
4517
5863
  const GET_QRCODE_DEFAULT_ERROR = "二维码获取异常,请稍后重试。";
4518
5864
  const weixinPublish_mock_errnoMap = {
4519
5865
  200003: "微信公众号号登录状态失效,请重新绑定账号后重试。",
@@ -4528,10 +5874,14 @@ var __webpack_exports__ = {};
4528
5874
  "-1": "系统错误,请注意备份内容后重试",
4529
5875
  770001: "不支持发布审核中或转码中的视频",
4530
5876
  200074: "系统繁忙,请稍后重试!",
4531
- 64702: "标题超出64字长度限制,请修改标题后重试。"
5877
+ 64702: "标题超出64字长度限制,请修改标题后重试。",
5878
+ 64552: "请检查阅读原文中的链接后重试。"
4532
5879
  };
4533
5880
  const ignoreErrno = [
4534
- 154019
5881
+ 154019,
5882
+ 154011,
5883
+ 154008,
5884
+ 154009
4535
5885
  ];
4536
5886
  const userTypeMap = {
4537
5887
  所有用户: 1,
@@ -4565,13 +5915,14 @@ var __webpack_exports__ = {};
4565
5915
  const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
4566
5916
  const client_time_diff = +Number("1743488763") - Math.floor(new Date().getTime() / 1000);
4567
5917
  const tmpCachePath = task.getTmpPath();
5918
+ const headers = {
5919
+ "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",
5920
+ Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
5921
+ origin: "https://mp.weixin.qq.com",
5922
+ 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&timestamp=${Date.now()}`
5923
+ };
4568
5924
  const http = new Http({
4569
- headers: {
4570
- "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",
4571
- Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
4572
- origin: "https://mp.weixin.qq.com",
4573
- 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&timestamp=${Date.now()}`
4574
- }
5925
+ headers
4575
5926
  });
4576
5927
  http.addResponseInterceptor((response)=>{
4577
5928
  const responseData = response.data;
@@ -4635,7 +5986,7 @@ var __webpack_exports__ = {};
4635
5986
  };
4636
5987
  const originContentImages = extractImgTag(params.content);
4637
5988
  const targetContentImages = await uploadImages(originContentImages);
4638
- const content = replaceImgSrc(params.content, (dom)=>{
5989
+ const content = replaceImgSrc(params.settingInfo.wxTopic && params.settingInfo.wxTopic.length > 0 ? params.content + genTopicHTML(params.settingInfo.wxTopic) : params.content, (dom)=>{
4639
5990
  if (dom.attribs.src) {
4640
5991
  const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
4641
5992
  dom.attribs.src = targetContentImages[idx].cdn_url;
@@ -4908,9 +6259,15 @@ var __webpack_exports__ = {};
4908
6259
  allow_fast_reprint0: params?.settingInfo?.wxQuickReprint ? 1 : 0,
4909
6260
  disable_recommend0: params?.settingInfo?.wxNotAllowRecommend ? 1 : 0,
4910
6261
  claim_source_type0: params?.settingInfo?.wxCreationSource?.[0] || "",
6262
+ appmsg_album_info0: JSON.stringify({
6263
+ appmsg_album_infos: params.settingInfo?.wxCollectionInfo ? [
6264
+ params.settingInfo.wxCollectionInfo
6265
+ ] : []
6266
+ }),
4911
6267
  masssend_check: 1,
4912
6268
  is_masssend: 1
4913
6269
  };
6270
+ task._timerRecord['PrePublish'] = Date.now();
4914
6271
  const { appMsgId } = await http.api({
4915
6272
  method: "post",
4916
6273
  url: "https://mp.weixin.qq.com/cgi-bin/operate_appmsg",
@@ -4929,6 +6286,42 @@ var __webpack_exports__ = {};
4929
6286
  data: appMsgId,
4930
6287
  message: "微信公众号保存草稿成功。"
4931
6288
  };
6289
+ let checkTimes = 0;
6290
+ let copyrightStatRes = {
6291
+ base_resp: {
6292
+ ret: -1
6293
+ },
6294
+ list: ''
6295
+ };
6296
+ do {
6297
+ checkTimes++;
6298
+ const copyrightStat = http.api({
6299
+ method: 'post',
6300
+ url: 'https://mp.weixin.qq.com/cgi-bin/masssend',
6301
+ params: {
6302
+ action: 'get_appmsg_copyright_stat',
6303
+ token: params.token,
6304
+ lang: 'zh_CN'
6305
+ },
6306
+ data: weixinPublish_mock_generatorFormData({
6307
+ token: params.token,
6308
+ lang: 'zh_CN',
6309
+ f: 'json',
6310
+ ajax: 1,
6311
+ fingerprint,
6312
+ random: Math.random().toString(),
6313
+ first_check: 1 === checkTimes ? 1 : 0,
6314
+ type: 10,
6315
+ appMsgId
6316
+ })
6317
+ });
6318
+ copyrightStatRes = await copyrightStat;
6319
+ if (154008 === copyrightStatRes.base_resp.ret && copyrightStatRes?.list) return {
6320
+ code: 200,
6321
+ message: `文章内容未通过原创校验,请修改后重试!`,
6322
+ data: JSON.parse(copyrightStatRes.list).list
6323
+ };
6324
+ }while (154011 === copyrightStatRes.base_resp.ret && checkTimes < 10);
4932
6325
  const masssendpage = ()=>http.api({
4933
6326
  method: "get",
4934
6327
  url: "https://mp.weixin.qq.com/cgi-bin/masssendpage",
@@ -5136,7 +6529,7 @@ var __webpack_exports__ = {};
5136
6529
  responseType: "arraybuffer"
5137
6530
  });
5138
6531
  const qrcodeBuffer = Buffer.from(qrcodeResult);
5139
- const qrcodeFilePath = external_node_path_default().join(tmpCachePath, "weixin_qrcode.jpg");
6532
+ const qrcodeFilePath = external_node_path_default().join(tmpCachePath, `weixin_qrcode_${Date.now()}.jpg`);
5140
6533
  external_node_fs_default().writeFileSync(qrcodeFilePath, new Uint8Array(qrcodeBuffer));
5141
6534
  params.safeQrcodeCallback?.(qrcodeFilePath);
5142
6535
  let code = "";
@@ -5191,7 +6584,10 @@ var __webpack_exports__ = {};
5191
6584
  uuid
5192
6585
  })
5193
6586
  });
5194
- await http.api({
6587
+ const proxyHttp = task?.isBeta ?? false ? new Http({
6588
+ headers
6589
+ }, params.proxyLoc, params.huiwenToken) : http;
6590
+ await proxyHttp.api({
5195
6591
  method: "post",
5196
6592
  url: "https://mp.weixin.qq.com/cgi-bin/masssend",
5197
6593
  params: {
@@ -5239,8 +6635,11 @@ var __webpack_exports__ = {};
5239
6635
  userType: "1"
5240
6636
  }),
5241
6637
  defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
6638
+ }, {
6639
+ retries: 2,
6640
+ retryDelay: 500
5242
6641
  });
5243
- return (0, share_namespaceObject.success)(appMsgId, params.settingInfo.timer ? "微信公众号文章定时发布成功。" : "微信公众号发布完成。");
6642
+ return (0, share_namespaceObject.success)(appMsgId, `微信公众号发布完成!` + (proxyHttp.proxyInfo || ""));
5244
6643
  };
5245
6644
  const waitQrcodeResultMaxTime = 2000 * scanRetryMaxCount;
5246
6645
  const weixinPublish_rpa_rpaAction = async (task, params)=>{
@@ -5569,6 +6968,7 @@ var __webpack_exports__ = {};
5569
6968
  await poperInstance.locator('.frm_radio_item label[for="not_recomment_0"]').click();
5570
6969
  }
5571
6970
  await page.waitForTimeout(1000);
6971
+ task._timerRecord['PrePublish'] = Date.now();
5572
6972
  const articleId = await new Promise(async (resolve)=>{
5573
6973
  const handleResponse = async (response)=>{
5574
6974
  const url = response.url();
@@ -5905,6 +7305,11 @@ var __webpack_exports__ = {};
5905
7305
  const mock_xsEncrypt = new Xhshow();
5906
7306
  const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
5907
7307
  const tmpCachePath = task.getTmpPath();
7308
+ if (params?.selfDeclaration?.type == "source-statement" && "transshipment" == params.selfDeclaration.childType && params.originalBind) return {
7309
+ code: 200,
7310
+ message: "原创声明与转载声明互斥,请重新选择后发布!",
7311
+ data: ""
7312
+ };
5908
7313
  const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
5909
7314
  if (!a1Cookie) return {
5910
7315
  code: 200,
@@ -6039,6 +7444,11 @@ var __webpack_exports__ = {};
6039
7444
  Object.assign(topic, createTopic.data.topic_infos[0]);
6040
7445
  }
6041
7446
  }));
7447
+ const visibleRangeMap = {
7448
+ public: 0,
7449
+ private: 1,
7450
+ friends: 4
7451
+ };
6042
7452
  const publishData = {
6043
7453
  common: {
6044
7454
  ats: [],
@@ -6056,7 +7466,7 @@ var __webpack_exports__ = {};
6056
7466
  type: "normal",
6057
7467
  privacy_info: {
6058
7468
  op_type: 1,
6059
- type: "public" === params.visibleRange ? 0 : 1
7469
+ type: visibleRangeMap[params.visibleRange] || 1
6060
7470
  },
6061
7471
  post_loc: params.address ? {
6062
7472
  name: params.address?.name,
@@ -6108,6 +7518,10 @@ var __webpack_exports__ = {};
6108
7518
  };
6109
7519
  }
6110
7520
  }
7521
+ const bizId = params?.originalBind && (params.cookies.find((it)=>"x-user-id-creator.xiaohongshu.com" === it.name)?.value || await http.api({
7522
+ method: "get",
7523
+ url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
7524
+ }).then((userData)=>userData.data?.userDetail?.id));
6111
7525
  const business_binds = {
6112
7526
  version: 1,
6113
7527
  bizType: "",
@@ -6116,18 +7530,52 @@ var __webpack_exports__ = {};
6116
7530
  notePostTiming: params.isImmediatelyPublish ? {} : {
6117
7531
  postTime: params.scheduledPublish
6118
7532
  },
6119
- noteCollectionBind: {
6120
- id: ""
7533
+ coProduceBind: {
7534
+ enable: !!params?.coProduceBind
7535
+ },
7536
+ noteCopyBind: {
7537
+ copyable: !!params?.noteCopyBind
7538
+ },
7539
+ optionRelationList: params.originalBind ? [
7540
+ {
7541
+ type: "ORIGINAL_STATEMENT",
7542
+ relationList: [
7543
+ {
7544
+ bizId,
7545
+ bizType: "ORIGINAL_STATEMENT",
7546
+ extraInfo: "{}"
7547
+ }
7548
+ ]
7549
+ }
7550
+ ] : [],
7551
+ ...params?.groupBind ? {
7552
+ groupBind: {
7553
+ groupId: params?.groupBind?.group_id,
7554
+ groupName: params.groupBind?.group_name,
7555
+ desc: params.groupBind?.desc,
7556
+ avatar: params.groupBind?.avatar
7557
+ }
7558
+ } : {
7559
+ groupBind: {}
6121
7560
  },
6122
7561
  ...params.selfDeclaration ? {
6123
7562
  userDeclarationBind
7563
+ } : {},
7564
+ ...params?.collectionId ? {
7565
+ noteCollectionBind: {
7566
+ id: params.collectionId
7567
+ }
6124
7568
  } : {}
6125
7569
  };
6126
7570
  publishData.common.business_binds = JSON.stringify(business_binds);
6127
7571
  const publishXt = Date.now().toString();
6128
7572
  const publishXs = mock_xsEncrypt.signXsPost("/web_api/sns/v2/note", a1Cookie, "xhs-pc-web", publishData);
6129
7573
  const xscommon = GenXSCommon(a1Cookie, publishXt, publishXs);
6130
- const publishResult = await http.api({
7574
+ const proxyHttp = task?.isBeta ?? false ? new Http({
7575
+ headers
7576
+ }, params.proxyLoc, params.huiwenToken) : http;
7577
+ task._timerRecord['PrePublish'] = Date.now();
7578
+ const publishResult = await proxyHttp.api({
6131
7579
  method: "post",
6132
7580
  url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
6133
7581
  data: publishData,
@@ -6137,8 +7585,11 @@ var __webpack_exports__ = {};
6137
7585
  "x-s-common": xscommon
6138
7586
  },
6139
7587
  defaultErrorMsg: "文章发布异常,请稍后重试。"
7588
+ }, {
7589
+ retries: 2,
7590
+ retryDelay: 500
6140
7591
  });
6141
- return (0, share_namespaceObject.success)(publishResult.data?.id);
7592
+ return (0, share_namespaceObject.success)(publishResult.data?.id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
6142
7593
  };
6143
7594
  const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
6144
7595
  const rpa_xsEncrypt = new Xhshow();
@@ -6334,6 +7785,7 @@ var __webpack_exports__ = {};
6334
7785
  hasText: "仅自己可见"
6335
7786
  }).click();
6336
7787
  }
7788
+ task._timerRecord['PrePublish'] = Date.now();
6337
7789
  const releaseTimeInstance = page.locator("label").filter({
6338
7790
  hasText: params.isImmediatelyPublish ? "立即发布" : "定时发布"
6339
7791
  });
@@ -6358,27 +7810,134 @@ var __webpack_exports__ = {};
6358
7810
  if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
6359
7811
  return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
6360
7812
  };
6361
- var package_namespaceObject = {
6362
- i8: "1.2.23"
7813
+ const getXhsGroup_xsEncrypt = new Xhshow();
7814
+ const getXhsGroup = async (_task, params)=>{
7815
+ const http = new Http({
7816
+ headers: {
7817
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
7818
+ referer: "https://creator.xiaohongshu.com",
7819
+ origin: "https://creator.xiaohongshu.com"
7820
+ }
7821
+ });
7822
+ const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
7823
+ if (!a1Cookie) return {
7824
+ code: 200,
7825
+ message: "账号数据异常,请重新绑定账号后重试。",
7826
+ data: []
7827
+ };
7828
+ try {
7829
+ const xt = Date.now().toString();
7830
+ const groupListParams = {
7831
+ note_id: ""
7832
+ };
7833
+ const fatchGroup = "/api/im/web/nns/group_list";
7834
+ const xs = getXhsGroup_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", groupListParams);
7835
+ const res = await http.api({
7836
+ method: "get",
7837
+ url: "https://edith.xiaohongshu.com/api/im/web/nns/group_list",
7838
+ params: groupListParams,
7839
+ headers: {
7840
+ "x-s": xs,
7841
+ "x-t": xt
7842
+ }
7843
+ });
7844
+ return (0, share_namespaceObject.success)(0 === res.code ? res.data.group_list : [], "群聊信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
7845
+ } catch (error) {
7846
+ return (0, share_namespaceObject.success)([]);
7847
+ }
6363
7848
  };
7849
+ const getXhsHotTopic_xsEncrypt = new Xhshow();
7850
+ const getXhsHotTopic = async (_task, params)=>{
7851
+ const http = new Http({
7852
+ headers: {
7853
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
7854
+ referer: "https://creator.xiaohongshu.com",
7855
+ origin: "https://creator.xiaohongshu.com"
7856
+ }
7857
+ });
7858
+ const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
7859
+ if (!a1Cookie) return {
7860
+ code: 200,
7861
+ message: "账号数据异常,请重新绑定账号后重试。",
7862
+ data: []
7863
+ };
7864
+ try {
7865
+ const xt = Date.now().toString();
7866
+ const hotTopicParams = {
7867
+ sort: 1,
7868
+ type: 1,
7869
+ source: 3,
7870
+ topic_activity: 1
7871
+ };
7872
+ const fatchGroup = "/api/galaxy/v2/creator/activity_center/list";
7873
+ const xs = getXhsHotTopic_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", hotTopicParams);
7874
+ const res = await http.api({
7875
+ method: "get",
7876
+ url: "https://creator.xiaohongshu.com/api/galaxy/v2/creator/activity_center/list",
7877
+ params: hotTopicParams,
7878
+ headers: {
7879
+ "x-s": xs,
7880
+ "x-t": xt
7881
+ }
7882
+ });
7883
+ return (0, share_namespaceObject.success)(0 === res.code ? res.data.activity_list : [], "热门信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
7884
+ } catch (error) {
7885
+ return (0, share_namespaceObject.success)([]);
7886
+ }
7887
+ };
7888
+ const getToutiaoCollection = async (_task, params)=>{
7889
+ const cookies = params.cookies ?? [];
7890
+ const http = new Http({
7891
+ headers: {
7892
+ cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
7893
+ referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
7894
+ }
7895
+ });
7896
+ const res = await http.api({
7897
+ method: "get",
7898
+ url: "https://mp.toutiao.com/mp/fe_api/collection/list",
7899
+ params: {
7900
+ page_num: 0,
7901
+ page_size: 100,
7902
+ need_sub_item_count: true
7903
+ }
7904
+ });
7905
+ return (0, share_namespaceObject.success)(0 === res.code ? res.data : [], 0 === res.code ? "获取头条号合集成功!" : "获取头条号合集失败!");
7906
+ };
7907
+ var package_namespaceObject = JSON.parse('{"i8":"1.2.25-beta.0"}');
7908
+ const BetaFlag = "HuiwenCanary";
6364
7909
  class Action {
6365
7910
  constructor(task){
6366
7911
  this.task = task;
6367
7912
  }
6368
7913
  async bindTask(func, params) {
6369
7914
  let responseData;
6370
- if (this.task.setArticleId) this.task.setArticleId(params.articleId ?? "");
6371
- if ("object" == typeof params && null !== params) params.cookies = params?.cookies ?? [];
7915
+ this.task.isBeta = this.task?.isFeatOn ? this.task?.isFeatOn(BetaFlag) : false;
7916
+ this.task._timerRecord = {
7917
+ ActionStart: Date.now()
7918
+ };
7919
+ if (this.task?.setArticleId) this.task.setArticleId(params.articleId ?? "");
7920
+ if (this.task?.setSaveType ?? false) this.task.setSaveType(params.saveType ?? "");
7921
+ if (this.task?.isInitializedGB !== void 0) this.task.setGbInitType(this.task.isInitializedGB);
7922
+ if ("object" == typeof params) params.cookies = params?.cookies ?? [];
6372
7923
  try {
6373
7924
  responseData = await func(this.task, params);
6374
7925
  } catch (error) {
6375
7926
  responseData = Http.handleApiError(error);
7927
+ } finally{
7928
+ this.task._timerRecord['ActionEnd'] = Date.now();
6376
7929
  }
7930
+ if (this.task.isBeta && this.task.setTimeConsuming) this.task.setTimeConsuming(this.task._timerRecord);
6377
7931
  if (200 === responseData.code) this.task.logger.info(`${func.name} action params error`, responseData);
6378
7932
  else if (0 !== responseData.code) {
6379
7933
  this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
6380
7934
  this.task.logger.info(`${func.name} action failed`);
6381
7935
  } else this.task.logger.info(`${func.name} action success`);
7936
+ if (this.task.debug && this.task._timerRecord['PrePublish']) {
7937
+ console.log("预处理图片耗时:", (this.task._timerRecord['PrePublish'] - this.task._timerRecord['ActionStart']) / 1000, "s");
7938
+ console.log("发文接口耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['PrePublish']) / 1000, "s");
7939
+ }
7940
+ this.task.debug && console.log("Action整体耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['ActionStart']) / 1000, "s");
6382
7941
  return responseData;
6383
7942
  }
6384
7943
  FetchArticles(params) {
@@ -6414,6 +7973,9 @@ var __webpack_exports__ = {};
6414
7973
  BjhFansExport(params) {
6415
7974
  return this.bindTask(BjhFansExport, params);
6416
7975
  }
7976
+ SearchBjhTopicList(params) {
7977
+ return this.bindTask(searchBjhTopicList, params);
7978
+ }
6417
7979
  searchToutiaoUserID(params) {
6418
7980
  return this.bindTask(searchToutiaoUserInfo, params);
6419
7981
  }
@@ -6423,9 +7985,24 @@ var __webpack_exports__ = {};
6423
7985
  getToutiaoConfig(params) {
6424
7986
  return this.bindTask(getToutiaoConfig, params);
6425
7987
  }
7988
+ getToutiaoCollection(params) {
7989
+ return this.bindTask(getToutiaoCollection, params);
7990
+ }
6426
7991
  getWeixinConfig(params) {
6427
7992
  return this.bindTask(getWeixinConfig, params);
6428
7993
  }
7994
+ getWeixinCollection(params) {
7995
+ return this.bindTask(getWeixinCollection, params);
7996
+ }
7997
+ getXhsCollection(params) {
7998
+ return this.bindTask(getXhsCollection, params);
7999
+ }
8000
+ getXhsGroup(params) {
8001
+ return this.bindTask(getXhsGroup, params);
8002
+ }
8003
+ getXhsHotTopic(params) {
8004
+ return this.bindTask(getXhsHotTopic, params);
8005
+ }
6429
8006
  getBaijiahaoConfig(params) {
6430
8007
  return this.bindTask(getBaijiahaoConfig, params);
6431
8008
  }