@iflyrpa/actions 4.0.2-beta.0 → 4.0.4-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/index.js CHANGED
@@ -1,1059 +1,4 @@
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
- },
1057
2
  "./src/utils/XhsXsCommonEnc.js": function(module) {
1058
3
  var encrypt_lookup = [
1059
4
  "Z",
@@ -5335,10 +4280,6 @@ nazkkBvqQbbAqVbQFTF/DPikppu6ZT6lGIXvJKCreeFiHA2qK6tS18SWVHW9ARz1
5335
4280
  }
5336
4281
  module.exports = encode_mnsv2;
5337
4282
  },
5338
- assert: function(module) {
5339
- "use strict";
5340
- module.exports = require("assert");
5341
- },
5342
4283
  crypto: function(module) {
5343
4284
  "use strict";
5344
4285
  module.exports = require("crypto");
@@ -5346,38 +4287,6 @@ nazkkBvqQbbAqVbQFTF/DPikppu6ZT6lGIXvJKCreeFiHA2qK6tS18SWVHW9ARz1
5346
4287
  fs: function(module) {
5347
4288
  "use strict";
5348
4289
  module.exports = require("fs");
5349
- },
5350
- http: function(module) {
5351
- "use strict";
5352
- module.exports = require("http");
5353
- },
5354
- https: function(module) {
5355
- "use strict";
5356
- module.exports = require("https");
5357
- },
5358
- net: function(module) {
5359
- "use strict";
5360
- module.exports = require("net");
5361
- },
5362
- os: function(module) {
5363
- "use strict";
5364
- module.exports = require("os");
5365
- },
5366
- tls: function(module) {
5367
- "use strict";
5368
- module.exports = require("tls");
5369
- },
5370
- tty: function(module) {
5371
- "use strict";
5372
- module.exports = require("tty");
5373
- },
5374
- url: function(module) {
5375
- "use strict";
5376
- module.exports = require("url");
5377
- },
5378
- util: function(module) {
5379
- "use strict";
5380
- module.exports = require("util");
5381
4290
  }
5382
4291
  };
5383
4292
  var __webpack_module_cache__ = {};
@@ -5389,7 +4298,7 @@ function __webpack_require__(moduleId) {
5389
4298
  loaded: false,
5390
4299
  exports: {}
5391
4300
  };
5392
- __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
4301
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
5393
4302
  module.loaded = true;
5394
4303
  return module.exports;
5395
4304
  }
@@ -5489,7 +4398,7 @@ var __webpack_exports__ = {};
5489
4398
  });
5490
4399
  const package_json_namespaceObject = require("@iflyrpa/share/package.json");
5491
4400
  var package_json_default = /*#__PURE__*/ __webpack_require__.n(package_json_namespaceObject);
5492
- var package_namespaceObject = JSON.parse('{"i8":"4.0.2-beta.0"}');
4401
+ var package_namespaceObject = JSON.parse('{"i8":"4.0.4-beta.0"}');
5493
4402
  const share_namespaceObject = require("@iflyrpa/share");
5494
4403
  const external_node_fs_namespaceObject = require("node:fs");
5495
4404
  var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
@@ -5505,7 +4414,93 @@ var __webpack_exports__ = {};
5505
4414
  var external_node_crypto_default = /*#__PURE__*/ __webpack_require__.n(external_node_crypto_namespaceObject);
5506
4415
  const external_axios_namespaceObject = require("axios");
5507
4416
  var external_axios_default = /*#__PURE__*/ __webpack_require__.n(external_axios_namespaceObject);
5508
- var dist = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js");
4417
+ const external_socks_proxy_agent_namespaceObject = require("socks-proxy-agent");
4418
+ const PROXY_CREDENTIALS = [
4419
+ {
4420
+ ip: "47.110.131.129",
4421
+ portStart: 44001,
4422
+ portEnd: 44050,
4423
+ user: "m64ut33hvzUzuh",
4424
+ pass: "pV2nKbhvgciM3URoRjnvk5D1d0CryaE"
4425
+ },
4426
+ {
4427
+ ip: "47.110.131.129",
4428
+ portStart: 44051,
4429
+ portEnd: 44100,
4430
+ user: "m64uz9EMrVpaCk",
4431
+ pass: "pAhDnBmdn12odgffGJnbFt9Jts6EiRz"
4432
+ },
4433
+ {
4434
+ ip: "47.110.131.129",
4435
+ portStart: 44101,
4436
+ portEnd: 44150,
4437
+ user: "m64uacZLZ1hQuz",
4438
+ pass: "p0oyBQtTFXk9x5BniP1GT3t5zmy1kWX"
4439
+ },
4440
+ {
4441
+ ip: "47.110.131.129",
4442
+ portStart: 44151,
4443
+ portEnd: 44200,
4444
+ user: "m64ugn30hbrv5w",
4445
+ pass: "pDMlGki6kx5ObJmIVNX9IyaTyLCNdwF"
4446
+ },
4447
+ {
4448
+ ip: "47.110.131.129",
4449
+ portStart: 44201,
4450
+ portEnd: 44250,
4451
+ user: "m64uxrjtLEuuiJ",
4452
+ pass: "pgSS3tw48oFBFKieAjJjsCzfdbvOxyD"
4453
+ },
4454
+ {
4455
+ ip: "47.110.131.129",
4456
+ portStart: 45001,
4457
+ portEnd: 45050,
4458
+ user: "m63uGNqJq3SfCR",
4459
+ pass: "p9gDMdIlxrfwK6DPpYxad6nnLy2oz7b"
4460
+ },
4461
+ {
4462
+ ip: "47.110.131.129",
4463
+ portStart: 45051,
4464
+ portEnd: 45100,
4465
+ user: "m63usvfyWYu6vY",
4466
+ pass: "pu0hLZL81K5u43XbWlWKjZsNOAPG238"
4467
+ },
4468
+ {
4469
+ ip: "47.110.131.129",
4470
+ portStart: 45101,
4471
+ portEnd: 45150,
4472
+ user: "m63uI2pvHbB0b0",
4473
+ pass: "p353azuJBlrzuu2EidptuhdnBIybdUy"
4474
+ },
4475
+ {
4476
+ ip: "47.110.131.129",
4477
+ portStart: 45151,
4478
+ portEnd: 45200,
4479
+ user: "m63uSpJbw46qnQ",
4480
+ pass: "pYWdnwHHXoKgIOLfuvruZFlSaGN2ZVO"
4481
+ },
4482
+ {
4483
+ ip: "47.110.131.129",
4484
+ portStart: 45201,
4485
+ portEnd: 45250,
4486
+ user: "m63ufKz8YekqZq",
4487
+ pass: "phDmq6dBU85Z85A99LsrtluBgG5OFQ2"
4488
+ }
4489
+ ];
4490
+ function findProxyCredential(ip, port) {
4491
+ const portNum = Number(port);
4492
+ if (Number.isNaN(portNum)) return null;
4493
+ return PROXY_CREDENTIALS.find((c)=>c.ip === ip && portNum >= c.portStart && portNum <= c.portEnd) ?? null;
4494
+ }
4495
+ function buildProxyUrl(ip, port) {
4496
+ const credential = findProxyCredential(ip, port);
4497
+ if (credential) {
4498
+ const user = encodeURIComponent(credential.user);
4499
+ const pass = encodeURIComponent(credential.pass);
4500
+ return `socks5h://${user}:${pass}@${ip}:${port}`;
4501
+ }
4502
+ return `socks5h://${ip}:${port}`;
4503
+ }
5509
4504
  async function ProxyAgent(task, ip, adr, accountId, refresh) {
5510
4505
  const http = new Http({
5511
4506
  headers: {
@@ -5537,11 +4532,12 @@ var __webpack_exports__ = {};
5537
4532
  }
5538
4533
  };
5539
4534
  task.logger?.info(`请求代理:区域:${params.addr}, IP:${params.ip}, AccountId:${params.accountId}, 返回代理信息: ${ProxyInfo.data ? `${ProxyInfo.data.proxyIp}:${ProxyInfo.data.proxyPort}` : "无可用代理"}`, loggerInfo);
5540
- return "000000" === ProxyInfo.code && ProxyInfo.data ? {
4535
+ const proxyAgent = "000000" === ProxyInfo.code && ProxyInfo.data ? {
5541
4536
  ip: ProxyInfo.data.proxyIp,
5542
4537
  port: ProxyInfo.data.proxyPort,
5543
- agent: new dist.HttpsProxyAgent(`http://${ProxyInfo.data.proxyIp}:${ProxyInfo.data.proxyPort}`)
4538
+ agent: new external_socks_proxy_agent_namespaceObject.SocksProxyAgent(buildProxyUrl(ProxyInfo.data.proxyIp, ProxyInfo.data.proxyPort))
5544
4539
  } : null;
4540
+ return proxyAgent;
5545
4541
  }
5546
4542
  class Http {
5547
4543
  static handleApiError(error) {
@@ -5552,12 +4548,13 @@ var __webpack_exports__ = {};
5552
4548
  data: error
5553
4549
  };
5554
4550
  }
5555
- constructor(config, logger, adr, ip, accountId){
4551
+ constructor(config, logger, adr, ip, accountId, platform){
5556
4552
  this.agentPromise = void 0;
5557
4553
  this.apiClient = external_axios_default().create({
5558
4554
  ...config
5559
4555
  });
5560
4556
  this.logger = logger;
4557
+ this.platform = platform;
5561
4558
  if (ip) this.agentPromise = ProxyAgent({
5562
4559
  logger
5563
4560
  }, ip, adr, accountId);
@@ -5655,7 +4652,10 @@ var __webpack_exports__ = {};
5655
4652
  }
5656
4653
  }
5657
4654
  errorResponse.message = errorResponse.message ? errorResponse.message : _message;
5658
- if ("canceled" === errorResponse.message) errorResponse.message = "网络请求超时,请稍后重试!";
4655
+ if ("canceled" === errorResponse.message) {
4656
+ const message = errorResponse.extra?.isProxyRequest ? "代理连接建立超时,请更换区域或稍后重试!" : "网络请求超时,请稍后重试!";
4657
+ errorResponse.message = message;
4658
+ }
5659
4659
  if (error.message.includes("Proxy connection ended")) errorResponse.message = "所在区域代理连接超时,请更换区域或稍后重试!";
5660
4660
  throw errorResponse;
5661
4661
  });
@@ -5693,14 +4693,21 @@ var __webpack_exports__ = {};
5693
4693
  599
5694
4694
  ].includes(handledError.code);
5695
4695
  if (Rtimes < retries && isRetry) {
5696
- this.logger?.info(`进入第${Rtimes + 1}次重试!错误码: ${handledError.code}`);
4696
+ const url = config.url || "";
4697
+ this.logger?.warn(`进入第${Rtimes + 1}次重试!错误码: ${handledError.code}, 请求地址: ${url}`);
5697
4698
  await new Promise((resolve)=>setTimeout(resolve, retryDelay));
5698
4699
  return sessionRt(Rtimes + 1);
5699
4700
  }
5700
4701
  return Promise.reject(handledError);
5701
4702
  }
5702
4703
  };
5703
- if (this.agentPromise) agent = await this.agentPromise;
4704
+ if (this.agentPromise) {
4705
+ const requestUrl = config.url || "";
4706
+ const platformTag = this.platform ? `[${this.platform}]` : "";
4707
+ this.logger?.info(`${platformTag}[代理请求] 接口: ${requestUrl}`);
4708
+ agent = await this.agentPromise;
4709
+ if (agent) this.logger?.info(`${platformTag}[代理请求] 代理地址: ${agent.ip}:${agent.port}`);
4710
+ }
5704
4711
  return sessionRt(0);
5705
4712
  }
5706
4713
  }
@@ -10064,7 +9071,8 @@ var __webpack_exports__ = {};
10064
9071
  task.logger,
10065
9072
  params.proxyLoc,
10066
9073
  params.localIP,
10067
- params.accountId
9074
+ params.accountId,
9075
+ "baijiahao"
10068
9076
  ];
10069
9077
  const http = new Http({
10070
9078
  headers
@@ -13421,7 +12429,7 @@ var __webpack_exports__ = {};
13421
12429
  });
13422
12430
  } catch (err) {
13423
12431
  const msg = err instanceof Error ? err.message : String(err);
13424
- task.logger.warn(`获取二维码失败: ${msg}`);
12432
+ task.logger.warn(`[douyinGetVerifyQrCode] 获取二维码失败: ${msg}`);
13425
12433
  return (0, share_namespaceObject.response)(500, `获取二维码失败: ${msg}`, "");
13426
12434
  }
13427
12435
  };
@@ -14518,7 +13526,8 @@ var __webpack_exports__ = {};
14518
13526
  task.logger,
14519
13527
  "",
14520
13528
  "",
14521
- params.accountId
13529
+ params.accountId,
13530
+ "douyin"
14522
13531
  ];
14523
13532
  const http = new Http({
14524
13533
  headers
@@ -14555,12 +13564,11 @@ var __webpack_exports__ = {};
14555
13564
  publishData.item.common.creation_id = generateRandomString(8) + Date.now();
14556
13565
  let decision = null;
14557
13566
  proxyHttp.addResponseInterceptor((response)=>{
14558
- console.log("拦截器收到响应:", JSON.stringify(response.data));
14559
- task.logger.warn(`[douyinPublish] 拦截器收到响应response.headers: ${JSON.stringify(response.headers)} `);
14560
- task.logger.warn(`[douyinPublish] 拦截器收到响应response.data: ${JSON.stringify(response.data)} `);
13567
+ task.logger.info(`[douyinPublish] 拦截器收到响应response.headers: ${JSON.stringify(response.headers)} `);
13568
+ task.logger.info(`[douyinPublish] 拦截器收到响应response.data: ${JSON.stringify(response.data)} `);
14561
13569
  decision = parseVerifyPassportDecision(response.headers["x-tt-verify-passport-decision"]);
14562
13570
  if (needsVerification(decision)) {
14563
- task.logger.warn(`[douyinPublish] 检测到需要验证: ${JSON.stringify(decision)}`);
13571
+ task.logger.info(`[douyinPublish] 检测到需要验证: ${JSON.stringify(decision)}`);
14564
13572
  return;
14565
13573
  }
14566
13574
  if (!response || !response.data) return;
@@ -14609,32 +13617,31 @@ var __webpack_exports__ = {};
14609
13617
  ts_sign = decoded.ts_sign;
14610
13618
  }
14611
13619
  } catch (error) {
14612
- task.logger.warn(`解析 bd_ticket_guard_server_data 失败,回退到 web_protect: ${error}`);
13620
+ task.logger.info(`[douyinPublish] 解析 bd_ticket_guard_server_data 失败,回退到 web_protect: ${error}`);
14613
13621
  }
14614
13622
  let ec_privateKey;
14615
13623
  try {
14616
13624
  ec_privateKey = JSON.parse(JSON.parse(params.extraParam["security-sdk/s_sdk_crypt_sdk"] || "{}").data || "{}").ec_privateKey;
14617
13625
  if (!ec_privateKey) {
14618
- task.logger.error("ec_privateKey 为空");
13626
+ task.logger.error("[douyinPublish] ec_privateKey 为空");
14619
13627
  return (0, share_namespaceObject.response)(414, "安全参数 ec_privateKey 缺失,请重新获取后重试", "");
14620
13628
  }
14621
13629
  } catch (error) {
14622
- task.logger.error(`解析 ec_privateKey 失败: ${error}`);
13630
+ task.logger.error(`[douyinPublish] 解析 ec_privateKey 失败: ${error}`);
14623
13631
  return (0, share_namespaceObject.response)(414, "安全参数 ec_privateKey 解析失败,请重新获取后重试", "");
14624
13632
  }
14625
13633
  let certificate;
14626
13634
  try {
14627
13635
  certificate = JSON.parse(params.extraParam["security-sdk/s_sdk_server_cert_key"] || "{}").cert;
14628
13636
  if (!certificate) {
14629
- task.logger.error("certificate 为空");
13637
+ task.logger.error("[douyinPublish] certificate 为空");
14630
13638
  return (0, share_namespaceObject.response)(414, "安全参数 certificate 缺失,请重新获取后重试", "");
14631
13639
  }
14632
13640
  } catch (error) {
14633
- task.logger.error(`解析 certificate 失败: ${error}`);
13641
+ task.logger.error(`[douyinPublish] 解析 certificate 失败: ${error}`);
14634
13642
  return (0, share_namespaceObject.response)(414, "安全参数 certificate 解析失败,请重新获取后重试", "");
14635
13643
  }
14636
13644
  const ree_public_key = webProtectData.client_cert.replace("pub.", "");
14637
- task.logger.info(`生成 bdTicketGuardClientData 的参数: ticket: ${ticket?.substring(0, 20)}..., ts_sign: ${ts_sign}, ree_public_key: ${ree_public_key?.substring(0, 20)}...`);
14638
13645
  let bdTicketGuardClientData;
14639
13646
  try {
14640
13647
  bdTicketGuardClientData = getBdV2({
@@ -14645,14 +13652,14 @@ var __webpack_exports__ = {};
14645
13652
  bd_ticket_guard_ree_public_key: ree_public_key
14646
13653
  });
14647
13654
  if (!bdTicketGuardClientData || !bdTicketGuardClientData["headers_bd_ticket_guard_client_data"]) {
14648
- task.logger.error(`bdTicketGuardClientData 生成失败或不完整: ${JSON.stringify(bdTicketGuardClientData)}`);
13655
+ task.logger.error(`[douyinPublish] bdTicketGuardClientData 生成失败或不完整: ${JSON.stringify(bdTicketGuardClientData)}`);
14649
13656
  return (0, share_namespaceObject.response)(414, "安全参数 bdTicketGuardClientData 生成失败,请重新获取后重试", "");
14650
13657
  }
14651
13658
  } catch (error) {
14652
- task.logger.error(`生成 bdTicketGuardClientData 失败: ${error}`);
13659
+ task.logger.error(`[douyinPublish] 生成 bdTicketGuardClientData 失败: ${error}`);
14653
13660
  return (0, share_namespaceObject.response)(414, "安全参数 bdTicketGuardClientData 生成异常,请重新获取后重试", "");
14654
13661
  }
14655
- task.logger.info("bdTicketGuardClientData 生成成功");
13662
+ task.logger.info("[douyinPublish] bdTicketGuardClientData 生成成功");
14656
13663
  const publishQuery = {
14657
13664
  ...publishParams,
14658
13665
  a_bogus: ""
@@ -14662,12 +13669,11 @@ var __webpack_exports__ = {};
14662
13669
  try {
14663
13670
  aBogus = mock_getABogus(`https://creator.douyin.com/web/api/media/aweme/create_v2/?${queryString}`, publishData, userAgent);
14664
13671
  if (!aBogus || aBogus.length < 10) {
14665
- task.logger.error(`a_bogus 生成异常,长度过短: ${aBogus}`);
13672
+ task.logger.error(`[douyinPublish] a_bogus 生成异常,长度过短: ${aBogus}`);
14666
13673
  return (0, share_namespaceObject.response)(414, "安全参数 a_bogus 生成失败,请重试", "");
14667
13674
  }
14668
- task.logger.info(`a_bogus 生成成功: ${aBogus.substring(0, 20)}...`);
14669
13675
  } catch (error) {
14670
- task.logger.error(`生成 a_bogus 失败: ${error}`);
13676
+ task.logger.error(`[douyinPublish] 生成 a_bogus 失败: ${error}`);
14671
13677
  return (0, share_namespaceObject.response)(414, "安全参数 a_bogus 生成异常,请重试", "");
14672
13678
  }
14673
13679
  publishQuery.a_bogus = aBogus;
@@ -14681,20 +13687,20 @@ var __webpack_exports__ = {};
14681
13687
  userAgent
14682
13688
  });
14683
13689
  if (!csrfToken || csrfToken.length < 10) {
14684
- task.logger.error(`csrfToken 生成异常,长度过短: ${csrfToken}`);
13690
+ task.logger.error(`[douyinPublish] csrfToken 生成异常,长度过短: ${csrfToken}`);
14685
13691
  return (0, share_namespaceObject.response)(414, "安全参数 csrfToken 生成失败,请重试", "");
14686
13692
  }
14687
- task.logger.info(`csrfToken 生成成功: ${csrfToken.substring(0, 20)}...`);
13693
+ task.logger.info(`[douyinPublish] csrfToken 生成成功: ${csrfToken.substring(0, 20)}...`);
14688
13694
  } catch (error) {
14689
- task.logger.error(`生成 csrfToken 失败: ${error}`);
13695
+ task.logger.error(`[douyinPublish] 生成 csrfToken 失败: ${error}`);
14690
13696
  return (0, share_namespaceObject.response)(414, "安全参数 csrfToken 生成异常,请重试", "");
14691
13697
  }
14692
13698
  let sessionDtrait;
14693
13699
  try {
14694
13700
  sessionDtrait = mock_generateDtrait("/web/api/media/aweme/create_v2/");
14695
- task.logger.info(`sessionDtrait 生成成功: ${sessionDtrait || "(空)"}`);
13701
+ task.logger.info(`[douyinPublish] sessionDtrait 生成成功: ${sessionDtrait || "(空)"}`);
14696
13702
  } catch (error) {
14697
- task.logger.error(`生成 sessionDtrait 失败: ${error}`);
13703
+ task.logger.error(`[douyinPublish] 生成 sessionDtrait 失败: ${error}`);
14698
13704
  return (0, share_namespaceObject.response)(414, "安全参数 sessionDtrait 生成异常,请重试", "");
14699
13705
  }
14700
13706
  task.logger.info(`[douyinPublish] headers: ${JSON.stringify({
@@ -14746,8 +13752,10 @@ var __webpack_exports__ = {};
14746
13752
  504
14747
13753
  ].includes(handledError.code);
14748
13754
  if (isProxyOrNetworkError) {
14749
- const message = `图文发布失败,原因:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
14750
- task.logger.error(`[douyinPublish] 代理/网络错误,直接返回: ${message}`, stringifyError(handledError));
13755
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
13756
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
13757
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
13758
+ task.logger.error(`[douyinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
14751
13759
  await updateTaskState?.({
14752
13760
  state: share_namespaceObject.TaskState.FAILED,
14753
13761
  error: message
@@ -15550,7 +14558,7 @@ var __webpack_exports__ = {};
15550
14558
  decision?.verify_title,
15551
14559
  decision?.verify_desc
15552
14560
  ].filter(Boolean).join(" ");
15553
- const message = `发布失败,需要二次验证${details ? `:${details}` : ""}`;
14561
+ const message = `[douyinPublish rpa-server]发布失败,需要二次验证${details ? `:${details}` : ""}`;
15554
14562
  task.logger?.warn(message);
15555
14563
  await updateTaskState?.({
15556
14564
  state: share_namespaceObject.TaskState.FAILED,
@@ -16634,18 +15642,44 @@ var __webpack_exports__ = {};
16634
15642
  collectNum: schemas_number(),
16635
15643
  shareNum: schemas_number()
16636
15644
  });
15645
+ const DouyinArticleSchema = BaseArticleSchema.extend({
15646
+ playNum: schemas_number(),
15647
+ likeNum: schemas_number(),
15648
+ commentNum: schemas_number(),
15649
+ shareNum: schemas_number(),
15650
+ collectNum: schemas_number(),
15651
+ awemeId: schemas_string(),
15652
+ awemeType: schemas_number(),
15653
+ duration: schemas_number().optional(),
15654
+ status: schemas_string(),
15655
+ publicUrl: schemas_string()
15656
+ });
15657
+ const ShipinhaoArticleSchema = BaseArticleSchema.extend({
15658
+ readNum: schemas_number(),
15659
+ likeNum: schemas_number(),
15660
+ commentNum: schemas_number(),
15661
+ forwardNum: schemas_number(),
15662
+ favNum: schemas_number(),
15663
+ objectId: schemas_string(),
15664
+ postType: schemas_string(),
15665
+ postStatus: schemas_number()
15666
+ });
16637
15667
  const FetchArticlesDataSchema = schemas_object({
16638
15668
  articleCell: schemas_array(union([
16639
15669
  ToutiaoArticleSchema,
16640
15670
  WeixinArticleSchema,
16641
15671
  BaijiahaoArticleSchema,
16642
- XiaohongshuArticleSchema
15672
+ XiaohongshuArticleSchema,
15673
+ DouyinArticleSchema,
15674
+ ShipinhaoArticleSchema
16643
15675
  ])).optional(),
16644
15676
  timerPublish: schemas_array(union([
16645
15677
  ToutiaoArticleSchema,
16646
15678
  WeixinArticleSchema,
16647
15679
  BaijiahaoArticleSchema,
16648
- XiaohongshuArticleSchema
15680
+ XiaohongshuArticleSchema,
15681
+ DouyinArticleSchema,
15682
+ ShipinhaoArticleSchema
16649
15683
  ])).optional(),
16650
15684
  pagination: schemas_object({
16651
15685
  total: schemas_number().optional(),
@@ -16760,6 +15794,247 @@ var __webpack_exports__ = {};
16760
15794
  return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "百家号文章数据获取失败");
16761
15795
  }
16762
15796
  }
15797
+ async function handleDouyinData(_task, params) {
15798
+ try {
15799
+ const { cookies, pageNum = 1, pageSize = 12, status = 0, showOriginalData = false, onlySuccess = false } = params;
15800
+ const headers = {
15801
+ cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
15802
+ referer: "https://creator.douyin.com"
15803
+ };
15804
+ const args = [
15805
+ {
15806
+ headers
15807
+ },
15808
+ _task.logger,
15809
+ params.proxyLoc,
15810
+ params.localIP,
15811
+ params.accountId
15812
+ ];
15813
+ const http = new Http(...args);
15814
+ let authorUid = "";
15815
+ try {
15816
+ const userInfo = await http.api({
15817
+ method: "get",
15818
+ url: "https://creator.douyin.com/aweme/v1/creator/user/info/"
15819
+ }, {
15820
+ retries: 3,
15821
+ retryDelay: 100,
15822
+ timeout: 5000
15823
+ });
15824
+ authorUid = userInfo.user_profile?.unique_id || "";
15825
+ if (!userInfo.has_data_mgmt_perm) _task.logger.warn("抖音账号未开通数据中心权限,近7日数据不可用");
15826
+ } catch (error) {
15827
+ _task.logger.warn("获取抖音用户信息失败");
15828
+ }
15829
+ async function fetchWorks(cursor) {
15830
+ return await http.api({
15831
+ method: "get",
15832
+ url: "https://creator.douyin.com/janus/douyin/creator/pc/work_list",
15833
+ params: {
15834
+ scene: "star_atlas",
15835
+ device_platform: "android",
15836
+ aid: 1128,
15837
+ status,
15838
+ count: pageSize,
15839
+ max_cursor: cursor
15840
+ }
15841
+ }, {
15842
+ retries: 3,
15843
+ retryDelay: 100,
15844
+ timeout: 5000
15845
+ });
15846
+ }
15847
+ const firstPageCursor = (pageNum - 1) * pageSize;
15848
+ const workListResponse = await fetchWorks(firstPageCursor);
15849
+ if (!workListResponse || !workListResponse.aweme_list) return searchPublishInfo_types_errorResponse("抖音数据获取失败,请检查账号状态", 414);
15850
+ const allWorks = [
15851
+ ...workListResponse.aweme_list
15852
+ ];
15853
+ let hasMore = workListResponse.has_more;
15854
+ let currentCursor = workListResponse.max_cursor;
15855
+ while(allWorks.length < pageSize && hasMore && !onlySuccess){
15856
+ const nextPageResponse = await fetchWorks(currentCursor);
15857
+ allWorks.push(...nextPageResponse.aweme_list);
15858
+ hasMore = nextPageResponse.has_more;
15859
+ currentCursor = nextPageResponse.max_cursor;
15860
+ if (allWorks.length >= 2 * pageSize) break;
15861
+ }
15862
+ const finalWorks = allWorks.slice(0, pageSize);
15863
+ const articleCell = finalWorks.map((item)=>{
15864
+ const workDetailUrl = `https://creator.douyin.com/creator-micro/work-management/work-detail/${item.aweme_id}`;
15865
+ const workPublicUrl = authorUid ? `https://www.douyin.com/user/${authorUid}?modal_id=${item.aweme_id}` : `https://www.douyin.com/video/${item.aweme_id}`;
15866
+ return {
15867
+ title: item.desc || "无作品描述",
15868
+ imageUrl: item.Cover?.url_list?.[0] || "",
15869
+ createTime: item.create_time,
15870
+ redirectUrl: workDetailUrl,
15871
+ playNum: item.statistics?.play_count || 0,
15872
+ likeNum: item.statistics?.digg_count || 0,
15873
+ commentNum: item.statistics?.comment_count || 0,
15874
+ shareNum: item.statistics?.share_count || 0,
15875
+ collectNum: item.statistics?.collect_count || 0,
15876
+ awemeId: item.aweme_id,
15877
+ awemeType: item.aweme_type,
15878
+ duration: item.duration,
15879
+ status: item.status?.is_private ? "private" : item.status?.in_reviewing ? "reviewing" : "public",
15880
+ publicUrl: workPublicUrl,
15881
+ ...showOriginalData ? {
15882
+ originalData: item
15883
+ } : {}
15884
+ };
15885
+ });
15886
+ return (0, share_namespaceObject.success)({
15887
+ articleCell,
15888
+ ...onlySuccess ? {
15889
+ pagination: {
15890
+ total: workListResponse.total || workListResponse.aweme_list.length,
15891
+ nextPage: workListResponse.has_more,
15892
+ pageNum,
15893
+ pageSize
15894
+ }
15895
+ } : null
15896
+ }, "抖音数据获取成功");
15897
+ } catch (error) {
15898
+ return searchPublishInfo_types_errorResponse(error instanceof Error ? error.message : "抖音数据获取失败");
15899
+ }
15900
+ }
15901
+ async function handleShipinhaoData(_task, params) {
15902
+ try {
15903
+ const { cookies, postType = "all", pageNum = 1, pageSize = 20, showOriginalData = false } = params;
15904
+ const aidCookie = cookies.find((it)=>"_aid" === it.name)?.value;
15905
+ const aid = aidCookie || "9d3e0e9f-b842-498d-a273-4285d58df264";
15906
+ const uinCookie = cookies.find((it)=>"uin" === it.name || "wxuin" === it.name)?.value || "0000000000";
15907
+ const deviceIdCookie = cookies.find((it)=>"device_id" === it.name || "finger_print_device_id" === it.name)?.value;
15908
+ const headers = {
15909
+ cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
15910
+ referer: "https://channels.weixin.qq.com",
15911
+ origin: "https://channels.weixin.qq.com",
15912
+ "content-type": "application/json",
15913
+ "X-WECHAT-UIN": uinCookie,
15914
+ ...deviceIdCookie ? {
15915
+ "finger-print-device-id": deviceIdCookie
15916
+ } : {}
15917
+ };
15918
+ const args = [
15919
+ {
15920
+ headers
15921
+ },
15922
+ _task.logger,
15923
+ params.proxyLoc,
15924
+ params.localIP,
15925
+ params.accountId
15926
+ ];
15927
+ const http = new Http(...args);
15928
+ const finderIdCookie = cookies.find((it)=>"_log_finder_id" === it.name || "finder_id" === it.name)?.value || "";
15929
+ async function fetchPosts(currentPage, userpageType, pageUrl) {
15930
+ return await http.api({
15931
+ method: "post",
15932
+ url: "https://channels.weixin.qq.com/micro/content/cgi-bin/mmfinderassistant-bin/post/post_list",
15933
+ params: {
15934
+ _aid: aid,
15935
+ _rid: `${Date.now().toString(16)}-${Math.random().toString(36).substring(2, 9)}`,
15936
+ _pageUrl: encodeURIComponent(pageUrl)
15937
+ },
15938
+ data: {
15939
+ pageSize,
15940
+ currentPage,
15941
+ userpageType,
15942
+ stickyOrder: true,
15943
+ timestamp: Date.now().toString(),
15944
+ _log_finder_uin: "",
15945
+ _log_finder_id: finderIdCookie,
15946
+ rawKeyBuff: "",
15947
+ pluginSessionId: null,
15948
+ scene: 7,
15949
+ reqScene: 7
15950
+ }
15951
+ }, {
15952
+ retries: 3,
15953
+ retryDelay: 100,
15954
+ timeout: 5000
15955
+ });
15956
+ }
15957
+ const mapPost = (item, forcePostType)=>{
15958
+ let imageUrl = "";
15959
+ if (item.desc?.media?.[0]?.thumbUrl) imageUrl = item.desc.media[0].thumbUrl;
15960
+ else if (item.desc?.media?.[0]?.coverUrl) imageUrl = item.desc.media[0].coverUrl;
15961
+ else if (item.cover?.url) imageUrl = item.cover.url;
15962
+ else if (item.media_url) imageUrl = item.media_url;
15963
+ const title = item.desc?.description || item.object_desc || "无标题";
15964
+ return {
15965
+ title,
15966
+ imageUrl,
15967
+ createTime: item.createTime || item.create_time,
15968
+ redirectUrl: "https://channels.weixin.qq.com/platform",
15969
+ readNum: item.readCount || item.read_count || 0,
15970
+ likeNum: item.likeCount || item.like_count || 0,
15971
+ commentNum: item.commentCount || item.comment_count || 0,
15972
+ forwardNum: item.forwardCount || item.forward_count || 0,
15973
+ favNum: item.favCount || item.fav_count || 0,
15974
+ objectId: item.exportId || item.objectId || "",
15975
+ postType: forcePostType,
15976
+ postStatus: item.status || item.post_status || 0,
15977
+ ...showOriginalData ? {
15978
+ originalData: item
15979
+ } : {}
15980
+ };
15981
+ };
15982
+ const allArticles = [];
15983
+ const needVideo = "all" === postType || "video" === postType;
15984
+ const needArticle = "all" === postType || "article" === postType;
15985
+ const AUTH_ERROR_CODES = [
15986
+ 300333,
15987
+ 300334
15988
+ ];
15989
+ if (needVideo) try {
15990
+ const videoPageUrl = "https://channels.weixin.qq.com/micro/content/post/list";
15991
+ const videoResponse = await fetchPosts(pageNum, 11, videoPageUrl);
15992
+ if (videoResponse.errCode && AUTH_ERROR_CODES.includes(videoResponse.errCode)) throw new Error(`AUTH_ERROR:${videoResponse.errMsg || "登录已失效"}`);
15993
+ if (videoResponse.errCode) _task.logger.warn(`视频号API错误:${videoResponse.errMsg} (${videoResponse.errCode})`);
15994
+ else {
15995
+ const posts = videoResponse.data?.list || videoResponse.posts || videoResponse.post_list || [];
15996
+ const videoArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "video"));
15997
+ allArticles.push(...videoArticles);
15998
+ _task.logger.info(`视频号视频获取成功,共${videoArticles.length}条`);
15999
+ }
16000
+ } catch (error) {
16001
+ const errMsg = error instanceof Error ? error.message : String(error);
16002
+ if (errMsg.startsWith("AUTH_ERROR:")) throw error;
16003
+ _task.logger.warn(`获取视频号视频失败:${errMsg}`);
16004
+ }
16005
+ if (needArticle) try {
16006
+ const articlePageUrl = "https://channels.weixin.qq.com/micro/content/post/finderNewLifePostList";
16007
+ const articleResponse = await fetchPosts(pageNum, 10, articlePageUrl);
16008
+ if (articleResponse.errCode && AUTH_ERROR_CODES.includes(articleResponse.errCode)) throw new Error(`AUTH_ERROR:${articleResponse.errMsg || "登录已失效"}`);
16009
+ if (articleResponse.errCode) _task.logger.warn(`视频号图文API错误:${articleResponse.errMsg} (${articleResponse.errCode})`);
16010
+ else {
16011
+ const posts = articleResponse.data?.list || articleResponse.posts || articleResponse.post_list || [];
16012
+ const articleArticles = posts.filter((item)=>item.createTime || item.create_time).map((item)=>mapPost(item, "article"));
16013
+ allArticles.push(...articleArticles);
16014
+ _task.logger.info(`视频号图文获取成功,共${articleArticles.length}条`);
16015
+ }
16016
+ } catch (error) {
16017
+ const errMsg = error instanceof Error ? error.message : String(error);
16018
+ if (errMsg.startsWith("AUTH_ERROR:")) throw error;
16019
+ _task.logger.warn(`获取视频号图文失败:${errMsg}`);
16020
+ }
16021
+ allArticles.sort((a, b)=>b.createTime - a.createTime);
16022
+ _task.logger.info(`视频号数据获取成功,${JSON.stringify(allArticles)}`);
16023
+ return (0, share_namespaceObject.success)({
16024
+ articleCell: allArticles,
16025
+ pagination: {
16026
+ total: allArticles.length,
16027
+ nextPage: false,
16028
+ pageNum,
16029
+ pageSize
16030
+ }
16031
+ }, "视频号数据获取成功");
16032
+ } catch (error) {
16033
+ const errMsg = error instanceof Error ? error.message : String(error);
16034
+ if (errMsg.startsWith("AUTH_ERROR:")) return searchPublishInfo_types_errorResponse("视频号数据获取失败,请检查账号状态", 414);
16035
+ return searchPublishInfo_types_errorResponse(errMsg || "视频号数据获取失败");
16036
+ }
16037
+ }
16763
16038
  async function handleToutiaoData(_task, params) {
16764
16039
  try {
16765
16040
  const { cookies, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false, containsArticle = false } = params;
@@ -16792,7 +16067,7 @@ var __webpack_exports__ = {};
16792
16067
  app_id: 1231
16793
16068
  }
16794
16069
  });
16795
- if (0 !== visitedUid.code) return searchPublishInfo_types_errorResponse("头条号账号信息获取失败,请检查账号状态", 414);
16070
+ if (0 !== visitedUid.code) return searchPublishInfo_types_errorResponse("头条号数据获取失败,请检查账号状态", 414);
16796
16071
  const articleInfo = await http.api({
16797
16072
  method: "get",
16798
16073
  url: "https://mp.toutiao.com/api/feed/mp_provider/v1/",
@@ -16901,7 +16176,7 @@ var __webpack_exports__ = {};
16901
16176
  const size = onlySuccess ? 10 : pageSize > 20 ? 20 : pageSize;
16902
16177
  let begin = (lastPage ?? pageNum) - 1;
16903
16178
  const rawArticlesInfo = await fetchArticles(begin * size, size, token);
16904
- if (rawArticlesInfo.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return searchPublishInfo_types_errorResponse("登陆已失效,请重新登陆!", 414);
16179
+ if (rawArticlesInfo.includes("请重新<a id='jumpUrl' href='/'>登录</a>")) return searchPublishInfo_types_errorResponse("微信公众号数据获取失败,请检查账号状态", 414);
16905
16180
  const articlesInfo = ParsePublishPage(rawArticlesInfo);
16906
16181
  let articleCell = [];
16907
16182
  if (!onlySuccess && pageSize > 20) {
@@ -17063,7 +16338,7 @@ var __webpack_exports__ = {};
17063
16338
  const a1Cookie = cookies.find((it)=>"a1" === it.name)?.value;
17064
16339
  if (!a1Cookie) return {
17065
16340
  code: 414,
17066
- message: "账号数据异常",
16341
+ message: "小红书数据获取失败,请检查账号状态",
17067
16342
  data: {}
17068
16343
  };
17069
16344
  if (onlySuccess && 10 !== pageSize) return {
@@ -17182,7 +16457,7 @@ var __webpack_exports__ = {};
17182
16457
  }, "小红书文章数据获取成功");
17183
16458
  }
17184
16459
  const FetchArticlesParamsSchema = ActionCommonParamsSchema.extend({
17185
- platform: schemas_string().describe("社交平台:weixin, toutiao, baijiahao, xiaohongshu"),
16460
+ platform: schemas_string().describe("社交平台:weixin, toutiao, baijiahao, xiaohongshu, douyin, shipinhao"),
17186
16461
  token: union([
17187
16462
  schemas_string(),
17188
16463
  schemas_number()
@@ -17194,7 +16469,14 @@ var __webpack_exports__ = {};
17194
16469
  showOriginalData: schemas_boolean().optional().describe("是否展示原始数据,默认false"),
17195
16470
  cursor: schemas_number().optional().describe("仅用于微信分页游标,默认为空"),
17196
16471
  lastPage: schemas_number().optional(),
17197
- containsArticle: schemas_boolean().optional().describe("是否包含文章内容,默认false")
16472
+ containsArticle: schemas_boolean().optional().describe("是否包含文章内容,默认false"),
16473
+ status: schemas_number().optional().describe("抖音作品状态:0=全部"),
16474
+ includeAccount: schemas_boolean().optional().describe("是否包含账号数据,默认true"),
16475
+ postType: schemas_enum([
16476
+ "video",
16477
+ "article",
16478
+ "all"
16479
+ ]).optional().describe("视频号作品类型:video=视频, article=图文, all=全部")
17198
16480
  });
17199
16481
  const FetchArticles = async (_task, params)=>{
17200
16482
  const { platform } = params;
@@ -17207,6 +16489,10 @@ var __webpack_exports__ = {};
17207
16489
  return handleBaijiahaoData(_task, params);
17208
16490
  case "xiaohongshu":
17209
16491
  return handleXiaohongshuData(_task, params);
16492
+ case "douyin":
16493
+ return handleDouyinData(_task, params);
16494
+ case "shipinhao":
16495
+ return handleShipinhaoData(_task, params);
17210
16496
  default:
17211
16497
  return (0, share_namespaceObject.success)({}, "暂不支持该平台");
17212
16498
  }
@@ -19115,7 +18401,7 @@ var __webpack_exports__ = {};
19115
18401
  return apiResponse;
19116
18402
  }
19117
18403
  const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19118
- task.logger.info("开始执行视频号发布 - Mock API 方式");
18404
+ task.logger.info("[shipinhaoPublish] 开始执行视频号发布 - Mock API 方式");
19119
18405
  const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
19120
18406
  if (!params.extraParam.fingerPrintDeviceId || !params.extraParam.aId) return (0, share_namespaceObject.response)(400, "fingerPrintDeviceId和aId 不能为空", "");
19121
18407
  try {
@@ -19132,7 +18418,8 @@ var __webpack_exports__ = {};
19132
18418
  task.logger,
19133
18419
  params.proxyLoc,
19134
18420
  params.localIP,
19135
- params.accountId
18421
+ params.accountId,
18422
+ "shipinhao"
19136
18423
  ];
19137
18424
  const http = new Http({
19138
18425
  headers
@@ -19140,7 +18427,7 @@ var __webpack_exports__ = {};
19140
18427
  const proxyHttp = new Http(...args);
19141
18428
  if (!params.banners || 0 === params.banners.length) return (0, share_namespaceObject.response)(400, "至少需要一张图片", "");
19142
18429
  const images = params.banners.slice(0, 18).filter((img)=>"string" == typeof img);
19143
- task.logger.info("获取用户信息...");
18430
+ task.logger.info("[shipinhaoPublish] 获取用户信息...");
19144
18431
  console.log("cookieString", cookieString);
19145
18432
  const userInfo = await mock_getUserInfo(cookieString, http);
19146
18433
  console.log(JSON.stringify(userInfo));
@@ -19150,17 +18437,17 @@ var __webpack_exports__ = {};
19150
18437
  }
19151
18438
  const finderUsername = userInfo.data.finderUser.finderUsername;
19152
18439
  console.log(finderUsername);
19153
- task.logger.info("获取上传认证密钥...");
18440
+ task.logger.info("[shipinhaoPublish] 获取上传认证密钥...");
19154
18441
  const authKeyResponse = await getUploadAuthKey(cookieString, finderUsername, http);
19155
18442
  if (0 !== authKeyResponse.errCode || !authKeyResponse.data?.authKey) return (0, share_namespaceObject.response)(authKeyResponse.errCode || 500, `获取上传认证参数失败: ${authKeyResponse.errMsg}`, "");
19156
18443
  const authKey = authKeyResponse.data.authKey;
19157
18444
  const uin = authKeyResponse.data.uin;
19158
18445
  if (!uin) return (0, share_namespaceObject.response)(500, "获取用户 uin 失败", "");
19159
18446
  const taskId = String(generateUUID());
19160
- task.logger.info(`开始上传 ${images.length} 张图片...`);
18447
+ task.logger.info(`[shipinhaoPublish] 开始上传 ${images.length} 张图片...`);
19161
18448
  const uploadedImages = [];
19162
18449
  for(let i = 0; i < images.length; i++){
19163
- task.logger.info(`上传图片 ${i + 1}/${images.length}...`);
18450
+ task.logger.info(`[shipinhaoPublish] 上传图片 ${i + 1}/${images.length}...`);
19164
18451
  const uploadResult = await uploadImageComplete(images[i], taskId, finderUsername, uin, authKey, http);
19165
18452
  console.log(JSON.stringify(uploadResult));
19166
18453
  if (!uploadResult.DownloadURL) return (0, share_namespaceObject.response)(500, `图片上传失败: ${uploadResult.errMsg}`, "");
@@ -19177,7 +18464,7 @@ var __webpack_exports__ = {};
19177
18464
  urlCdnTaskId: ""
19178
18465
  });
19179
18466
  }
19180
- task.logger.info("正在发布...");
18467
+ task.logger.info("[shipinhaoPublish] 正在发布...");
19181
18468
  const topicNames = params.topic || void 0;
19182
18469
  const addressInfo = params.address ? {
19183
18470
  name: params.address.name,
@@ -19221,8 +18508,10 @@ var __webpack_exports__ = {};
19221
18508
  504
19222
18509
  ].includes(handledError.code);
19223
18510
  if (isProxyOrNetworkError) {
19224
- const message = `图文发布失败,原因:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
19225
- task.logger.error(`[shipinhaoPublish] 代理/网络错误,直接返回: ${message}`, stringifyError(handledError));
18511
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
18512
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
18513
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
18514
+ task.logger.error(`[shipinhaoPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
19226
18515
  await updateTaskState?.({
19227
18516
  state: share_namespaceObject.TaskState.FAILED,
19228
18517
  error: message
@@ -19239,7 +18528,7 @@ var __webpack_exports__ = {};
19239
18528
  const resultCode = publishResult.data?.baseResp?.errcode ?? publishResult.errCode;
19240
18529
  const resultMsg = publishResult.data?.baseResp?.errmsg ?? publishResult.errMsg;
19241
18530
  if (0 === resultCode) {
19242
- task.logger.info("发布成功");
18531
+ task.logger.info("[shipinhaoPublish] 发布成功");
19243
18532
  const publishId = uploadedImages[0]?.thumbUrl?.split("encfilekey=")[1]?.split("&")[0] || "";
19244
18533
  await updateTaskState?.({
19245
18534
  state: share_namespaceObject.TaskState.SUCCESS,
@@ -19254,7 +18543,7 @@ var __webpack_exports__ = {};
19254
18543
  else if (300333 === resultCode || 300334 === resultCode) errorMessage = "登录失效";
19255
18544
  else if (300330 === resultCode) errorMessage = "未登录";
19256
18545
  else if (300002 === resultCode) errorMessage = "官方平台在校验音乐/位置/定时信息时失败了,请重新编辑后发布";
19257
- task.logger.error(`发布失败: ${errorMessage}`);
18546
+ task.logger.error(`[shipinhaoPublish] 发布失败: ${errorMessage}`);
19258
18547
  await updateTaskState?.({
19259
18548
  state: share_namespaceObject.TaskState.FAILED,
19260
18549
  error: errorMessage
@@ -19262,7 +18551,7 @@ var __webpack_exports__ = {};
19262
18551
  return (0, share_namespaceObject.response)(resultCode || 500, errorMessage, "");
19263
18552
  } catch (error) {
19264
18553
  const errorMsg = error instanceof Error ? error.message : "发布失败";
19265
- task.logger.error(`发布异常: ${errorMsg}`);
18554
+ task.logger.error(`[shipinhaoPublish] 发布异常: ${errorMsg}`);
19266
18555
  return (0, share_namespaceObject.response)(500, errorMsg, "");
19267
18556
  }
19268
18557
  };
@@ -20494,7 +19783,8 @@ var __webpack_exports__ = {};
20494
19783
  task.logger,
20495
19784
  params.proxyLoc,
20496
19785
  params.localIP,
20497
- params.accountId
19786
+ params.accountId,
19787
+ "toutiao"
20498
19788
  ];
20499
19789
  const http = new Http({
20500
19790
  headers
@@ -21827,7 +21117,8 @@ var __webpack_exports__ = {};
21827
21117
  task.logger,
21828
21118
  params.proxyLoc,
21829
21119
  params.localIP,
21830
- params.accountId
21120
+ params.accountId,
21121
+ "weixin"
21831
21122
  ];
21832
21123
  const http = new Http({
21833
21124
  headers
@@ -22583,8 +21874,10 @@ var __webpack_exports__ = {};
22583
21874
  504
22584
21875
  ].includes(handledError.code);
22585
21876
  if (isProxyOrNetworkError) {
22586
- const message = `文章发布失败,原因:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
22587
- task.logger.error(`[weixinPublish] 代理/网络错误,直接返回: ${message}`, stringifyError(handledError));
21877
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
21878
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
21879
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
21880
+ task.logger.error(`[weixinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
22588
21881
  await updateTaskState?.({
22589
21882
  state: share_namespaceObject.TaskState.FAILED,
22590
21883
  error: message
@@ -23734,7 +23027,8 @@ var __webpack_exports__ = {};
23734
23027
  task.logger,
23735
23028
  params.proxyLoc,
23736
23029
  params.localIP,
23737
- params.accountId
23030
+ params.accountId,
23031
+ "xiaohongshu"
23738
23032
  ];
23739
23033
  const http = new Http({
23740
23034
  headers
@@ -24077,8 +23371,10 @@ var __webpack_exports__ = {};
24077
23371
  504
24078
23372
  ].includes(handledError.code);
24079
23373
  if (isProxyOrNetworkError) {
24080
- const message = `文章发布失败,原因:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
24081
- task.logger.error(`[xiaohongshuPublish] 代理/网络错误,直接返回: ${message}`, stringifyError(handledError));
23374
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
23375
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
23376
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
23377
+ task.logger.error(`[xiaohongshuPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
24082
23378
  await updateTaskState?.({
24083
23379
  state: share_namespaceObject.TaskState.FAILED,
24084
23380
  error: message
@@ -24797,7 +24093,8 @@ var __webpack_exports__ = {};
24797
24093
  task.logger,
24798
24094
  params.proxyLoc,
24799
24095
  params.localIP,
24800
- params.accountId
24096
+ params.accountId,
24097
+ "xiaohongshu-rpa"
24801
24098
  ];
24802
24099
  const http = new Http({
24803
24100
  headers