@iflyrpa/actions 4.0.1 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,14 +1,5 @@
1
- import * as __WEBPACK_EXTERNAL_MODULE_assert__ from "assert";
2
1
  import * as __WEBPACK_EXTERNAL_MODULE_crypto__ from "crypto";
3
2
  import * as __WEBPACK_EXTERNAL_MODULE_fs__ from "fs";
4
- import * as __WEBPACK_EXTERNAL_MODULE_http__ from "http";
5
- import * as __WEBPACK_EXTERNAL_MODULE_https__ from "https";
6
- import * as __WEBPACK_EXTERNAL_MODULE_net__ from "net";
7
- import * as __WEBPACK_EXTERNAL_MODULE_os__ from "os";
8
- import * as __WEBPACK_EXTERNAL_MODULE_tls__ from "tls";
9
- import * as __WEBPACK_EXTERNAL_MODULE_tty__ from "tty";
10
- import * as __WEBPACK_EXTERNAL_MODULE_url__ from "url";
11
- import * as __WEBPACK_EXTERNAL_MODULE_util__ from "util";
12
3
  import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_package_json_58ae5f06__ from "@iflyrpa/share/package.json";
13
4
  import * as __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__ from "@iflyrpa/share";
14
5
  import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
@@ -19,6 +10,7 @@ import * as __WEBPACK_EXTERNAL_MODULE_htmlparser2__ from "htmlparser2";
19
10
  import * as __WEBPACK_EXTERNAL_MODULE_mime_types_eebf54a5__ from "mime-types";
20
11
  import * as __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__ from "node:crypto";
21
12
  import * as __WEBPACK_EXTERNAL_MODULE_axios__ from "axios";
13
+ import * as __WEBPACK_EXTERNAL_MODULE_socks_proxy_agent_cb52aaad__ from "socks-proxy-agent";
22
14
  import * as __WEBPACK_EXTERNAL_MODULE_node_fetch_7c57b483__ from "node-fetch";
23
15
  import * as __WEBPACK_EXTERNAL_MODULE_form_data_cf000082__ from "form-data";
24
16
  import * as __WEBPACK_EXTERNAL_MODULE_node_https_626f33a7__ from "node:https";
@@ -28,1055 +20,6 @@ import * as __WEBPACK_EXTERNAL_MODULE_image_size_bc738ffb__ from "image-size";
28
20
  import * as __WEBPACK_EXTERNAL_MODULE_vm__ from "vm";
29
21
  import * as __WEBPACK_EXTERNAL_MODULE_node_vm_bd3d9cea__ from "node:vm";
30
22
  var __webpack_modules__ = {
31
- "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports, __webpack_require__) {
32
- var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
33
- if (void 0 === k2) k2 = k;
34
- var desc = Object.getOwnPropertyDescriptor(m, k);
35
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
36
- enumerable: true,
37
- get: function() {
38
- return m[k];
39
- }
40
- };
41
- Object.defineProperty(o, k2, desc);
42
- } : function(o, m, k, k2) {
43
- if (void 0 === k2) k2 = k;
44
- o[k2] = m[k];
45
- });
46
- var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
47
- Object.defineProperty(o, "default", {
48
- enumerable: true,
49
- value: v
50
- });
51
- } : function(o, v) {
52
- o["default"] = v;
53
- });
54
- var __importStar = this && this.__importStar || function(mod) {
55
- if (mod && mod.__esModule) return mod;
56
- var result = {};
57
- if (null != mod) {
58
- for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
59
- }
60
- __setModuleDefault(result, mod);
61
- return result;
62
- };
63
- Object.defineProperty(exports, "__esModule", {
64
- value: true
65
- });
66
- exports.req = exports.json = exports.toBuffer = void 0;
67
- const http = __importStar(__webpack_require__("http"));
68
- const https = __importStar(__webpack_require__("https"));
69
- async function toBuffer(stream) {
70
- let length = 0;
71
- const chunks = [];
72
- for await (const chunk of stream){
73
- length += chunk.length;
74
- chunks.push(chunk);
75
- }
76
- return Buffer.concat(chunks, length);
77
- }
78
- exports.toBuffer = toBuffer;
79
- async function json(stream) {
80
- const buf = await toBuffer(stream);
81
- const str = buf.toString('utf8');
82
- try {
83
- return JSON.parse(str);
84
- } catch (_err) {
85
- const err = _err;
86
- err.message += ` (input: ${str})`;
87
- throw err;
88
- }
89
- }
90
- exports.json = json;
91
- function req(url, opts = {}) {
92
- const href = 'string' == typeof url ? url : url.href;
93
- const req1 = (href.startsWith('https:') ? https : http).request(url, opts);
94
- const promise = new Promise((resolve, reject)=>{
95
- req1.once('response', resolve).once('error', reject).end();
96
- });
97
- req1.then = promise.then.bind(promise);
98
- return req1;
99
- }
100
- exports.req = req;
101
- },
102
- "../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
103
- var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
104
- if (void 0 === k2) k2 = k;
105
- var desc = Object.getOwnPropertyDescriptor(m, k);
106
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
107
- enumerable: true,
108
- get: function() {
109
- return m[k];
110
- }
111
- };
112
- Object.defineProperty(o, k2, desc);
113
- } : function(o, m, k, k2) {
114
- if (void 0 === k2) k2 = k;
115
- o[k2] = m[k];
116
- });
117
- var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
118
- Object.defineProperty(o, "default", {
119
- enumerable: true,
120
- value: v
121
- });
122
- } : function(o, v) {
123
- o["default"] = v;
124
- });
125
- var __importStar = this && this.__importStar || function(mod) {
126
- if (mod && mod.__esModule) return mod;
127
- var result = {};
128
- if (null != mod) {
129
- for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
130
- }
131
- __setModuleDefault(result, mod);
132
- return result;
133
- };
134
- var __exportStar = this && this.__exportStar || function(m, exports) {
135
- for(var p in m)if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
136
- };
137
- Object.defineProperty(exports, "__esModule", {
138
- value: true
139
- });
140
- exports.Agent = void 0;
141
- const net = __importStar(__webpack_require__("net"));
142
- const http = __importStar(__webpack_require__("http"));
143
- const https_1 = __webpack_require__("https");
144
- __exportStar(__webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"), exports);
145
- const INTERNAL = Symbol('AgentBaseInternalState');
146
- class Agent extends http.Agent {
147
- constructor(opts){
148
- super(opts);
149
- this[INTERNAL] = {};
150
- }
151
- isSecureEndpoint(options) {
152
- if (options) {
153
- if ('boolean' == typeof options.secureEndpoint) return options.secureEndpoint;
154
- if ('string' == typeof options.protocol) return 'https:' === options.protocol;
155
- }
156
- const { stack } = new Error();
157
- if ('string' != typeof stack) return false;
158
- return stack.split('\n').some((l)=>-1 !== l.indexOf('(https.js:') || -1 !== l.indexOf('node:https:'));
159
- }
160
- incrementSockets(name) {
161
- if (this.maxSockets === 1 / 0 && this.maxTotalSockets === 1 / 0) return null;
162
- if (!this.sockets[name]) this.sockets[name] = [];
163
- const fakeSocket = new net.Socket({
164
- writable: false
165
- });
166
- this.sockets[name].push(fakeSocket);
167
- this.totalSocketCount++;
168
- return fakeSocket;
169
- }
170
- decrementSockets(name, socket) {
171
- if (!this.sockets[name] || null === socket) return;
172
- const sockets = this.sockets[name];
173
- const index = sockets.indexOf(socket);
174
- if (-1 !== index) {
175
- sockets.splice(index, 1);
176
- this.totalSocketCount--;
177
- if (0 === sockets.length) delete this.sockets[name];
178
- }
179
- }
180
- getName(options) {
181
- const secureEndpoint = this.isSecureEndpoint(options);
182
- if (secureEndpoint) return https_1.Agent.prototype.getName.call(this, options);
183
- return super.getName(options);
184
- }
185
- createSocket(req, options, cb) {
186
- const connectOpts = {
187
- ...options,
188
- secureEndpoint: this.isSecureEndpoint(options)
189
- };
190
- const name = this.getName(connectOpts);
191
- const fakeSocket = this.incrementSockets(name);
192
- Promise.resolve().then(()=>this.connect(req, connectOpts)).then((socket)=>{
193
- this.decrementSockets(name, fakeSocket);
194
- if (socket instanceof http.Agent) try {
195
- return socket.addRequest(req, connectOpts);
196
- } catch (err) {
197
- return cb(err);
198
- }
199
- this[INTERNAL].currentSocket = socket;
200
- super.createSocket(req, options, cb);
201
- }, (err)=>{
202
- this.decrementSockets(name, fakeSocket);
203
- cb(err);
204
- });
205
- }
206
- createConnection() {
207
- const socket = this[INTERNAL].currentSocket;
208
- this[INTERNAL].currentSocket = void 0;
209
- if (!socket) throw new Error('No socket was returned in the `connect()` function');
210
- return socket;
211
- }
212
- get defaultPort() {
213
- return this[INTERNAL].defaultPort ?? ('https:' === this.protocol ? 443 : 80);
214
- }
215
- set defaultPort(v) {
216
- if (this[INTERNAL]) this[INTERNAL].defaultPort = v;
217
- }
218
- get protocol() {
219
- return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');
220
- }
221
- set protocol(v) {
222
- if (this[INTERNAL]) this[INTERNAL].protocol = v;
223
- }
224
- }
225
- exports.Agent = Agent;
226
- },
227
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js": function(module, exports, __webpack_require__) {
228
- exports.formatArgs = formatArgs;
229
- exports.save = save;
230
- exports.load = load;
231
- exports.useColors = useColors;
232
- exports.storage = localstorage();
233
- exports.destroy = (()=>{
234
- let warned = false;
235
- return ()=>{
236
- if (!warned) {
237
- warned = true;
238
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
239
- }
240
- };
241
- })();
242
- exports.colors = [
243
- '#0000CC',
244
- '#0000FF',
245
- '#0033CC',
246
- '#0033FF',
247
- '#0066CC',
248
- '#0066FF',
249
- '#0099CC',
250
- '#0099FF',
251
- '#00CC00',
252
- '#00CC33',
253
- '#00CC66',
254
- '#00CC99',
255
- '#00CCCC',
256
- '#00CCFF',
257
- '#3300CC',
258
- '#3300FF',
259
- '#3333CC',
260
- '#3333FF',
261
- '#3366CC',
262
- '#3366FF',
263
- '#3399CC',
264
- '#3399FF',
265
- '#33CC00',
266
- '#33CC33',
267
- '#33CC66',
268
- '#33CC99',
269
- '#33CCCC',
270
- '#33CCFF',
271
- '#6600CC',
272
- '#6600FF',
273
- '#6633CC',
274
- '#6633FF',
275
- '#66CC00',
276
- '#66CC33',
277
- '#9900CC',
278
- '#9900FF',
279
- '#9933CC',
280
- '#9933FF',
281
- '#99CC00',
282
- '#99CC33',
283
- '#CC0000',
284
- '#CC0033',
285
- '#CC0066',
286
- '#CC0099',
287
- '#CC00CC',
288
- '#CC00FF',
289
- '#CC3300',
290
- '#CC3333',
291
- '#CC3366',
292
- '#CC3399',
293
- '#CC33CC',
294
- '#CC33FF',
295
- '#CC6600',
296
- '#CC6633',
297
- '#CC9900',
298
- '#CC9933',
299
- '#CCCC00',
300
- '#CCCC33',
301
- '#FF0000',
302
- '#FF0033',
303
- '#FF0066',
304
- '#FF0099',
305
- '#FF00CC',
306
- '#FF00FF',
307
- '#FF3300',
308
- '#FF3333',
309
- '#FF3366',
310
- '#FF3399',
311
- '#FF33CC',
312
- '#FF33FF',
313
- '#FF6600',
314
- '#FF6633',
315
- '#FF9900',
316
- '#FF9933',
317
- '#FFCC00',
318
- '#FFCC33'
319
- ];
320
- function useColors() {
321
- if ('undefined' != typeof window && window.process && ('renderer' === window.process.type || window.process.__nwjs)) return true;
322
- if ('undefined' != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return false;
323
- let m;
324
- 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+)/);
325
- }
326
- function formatArgs(args) {
327
- args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
328
- if (!this.useColors) return;
329
- const c = 'color: ' + this.color;
330
- args.splice(1, 0, c, 'color: inherit');
331
- let index = 0;
332
- let lastC = 0;
333
- args[0].replace(/%[a-zA-Z%]/g, (match)=>{
334
- if ('%%' === match) return;
335
- index++;
336
- if ('%c' === match) lastC = index;
337
- });
338
- args.splice(lastC, 0, c);
339
- }
340
- exports.log = console.debug || console.log || (()=>{});
341
- function save(namespaces) {
342
- try {
343
- if (namespaces) exports.storage.setItem('debug', namespaces);
344
- else exports.storage.removeItem('debug');
345
- } catch (error) {}
346
- }
347
- function load() {
348
- let r;
349
- try {
350
- r = exports.storage.getItem('debug');
351
- } catch (error) {}
352
- if (!r && 'undefined' != typeof process && 'env' in process) r = process.env.DEBUG;
353
- return r;
354
- }
355
- function localstorage() {
356
- try {
357
- return localStorage;
358
- } catch (error) {}
359
- }
360
- module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);
361
- const { formatters } = module.exports;
362
- formatters.j = function(v) {
363
- try {
364
- return JSON.stringify(v);
365
- } catch (error) {
366
- return '[UnexpectedJSONParseError]: ' + error.message;
367
- }
368
- };
369
- },
370
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js": function(module, __unused_webpack_exports, __webpack_require__) {
371
- function setup(env) {
372
- createDebug.debug = createDebug;
373
- createDebug.default = createDebug;
374
- createDebug.coerce = coerce;
375
- createDebug.disable = disable;
376
- createDebug.enable = enable;
377
- createDebug.enabled = enabled;
378
- createDebug.humanize = __webpack_require__("../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js");
379
- createDebug.destroy = destroy;
380
- Object.keys(env).forEach((key)=>{
381
- createDebug[key] = env[key];
382
- });
383
- createDebug.names = [];
384
- createDebug.skips = [];
385
- createDebug.formatters = {};
386
- function selectColor(namespace) {
387
- let hash = 0;
388
- for(let i = 0; i < namespace.length; i++){
389
- hash = (hash << 5) - hash + namespace.charCodeAt(i);
390
- hash |= 0;
391
- }
392
- return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
393
- }
394
- createDebug.selectColor = selectColor;
395
- function createDebug(namespace) {
396
- let prevTime;
397
- let enableOverride = null;
398
- let namespacesCache;
399
- let enabledCache;
400
- function debug(...args) {
401
- if (!debug.enabled) return;
402
- const self = debug;
403
- const curr = Number(new Date());
404
- const ms = curr - (prevTime || curr);
405
- self.diff = ms;
406
- self.prev = prevTime;
407
- self.curr = curr;
408
- prevTime = curr;
409
- args[0] = createDebug.coerce(args[0]);
410
- if ('string' != typeof args[0]) args.unshift('%O');
411
- let index = 0;
412
- args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format)=>{
413
- if ('%%' === match) return '%';
414
- index++;
415
- const formatter = createDebug.formatters[format];
416
- if ('function' == typeof formatter) {
417
- const val = args[index];
418
- match = formatter.call(self, val);
419
- args.splice(index, 1);
420
- index--;
421
- }
422
- return match;
423
- });
424
- createDebug.formatArgs.call(self, args);
425
- const logFn = self.log || createDebug.log;
426
- logFn.apply(self, args);
427
- }
428
- debug.namespace = namespace;
429
- debug.useColors = createDebug.useColors();
430
- debug.color = createDebug.selectColor(namespace);
431
- debug.extend = extend;
432
- debug.destroy = createDebug.destroy;
433
- Object.defineProperty(debug, 'enabled', {
434
- enumerable: true,
435
- configurable: false,
436
- get: ()=>{
437
- if (null !== enableOverride) return enableOverride;
438
- if (namespacesCache !== createDebug.namespaces) {
439
- namespacesCache = createDebug.namespaces;
440
- enabledCache = createDebug.enabled(namespace);
441
- }
442
- return enabledCache;
443
- },
444
- set: (v)=>{
445
- enableOverride = v;
446
- }
447
- });
448
- if ('function' == typeof createDebug.init) createDebug.init(debug);
449
- return debug;
450
- }
451
- function extend(namespace, delimiter) {
452
- const newDebug = createDebug(this.namespace + (void 0 === delimiter ? ':' : delimiter) + namespace);
453
- newDebug.log = this.log;
454
- return newDebug;
455
- }
456
- function enable(namespaces) {
457
- createDebug.save(namespaces);
458
- createDebug.namespaces = namespaces;
459
- createDebug.names = [];
460
- createDebug.skips = [];
461
- const split = ('string' == typeof namespaces ? namespaces : '').trim().replace(' ', ',').split(',').filter(Boolean);
462
- for (const ns of split)if ('-' === ns[0]) createDebug.skips.push(ns.slice(1));
463
- else createDebug.names.push(ns);
464
- }
465
- function matchesTemplate(search, template) {
466
- let searchIndex = 0;
467
- let templateIndex = 0;
468
- let starIndex = -1;
469
- let matchIndex = 0;
470
- while(searchIndex < search.length)if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || '*' === template[templateIndex])) {
471
- if ('*' === template[templateIndex]) {
472
- starIndex = templateIndex;
473
- matchIndex = searchIndex;
474
- templateIndex++;
475
- } else {
476
- searchIndex++;
477
- templateIndex++;
478
- }
479
- } else {
480
- if (-1 === starIndex) return false;
481
- templateIndex = starIndex + 1;
482
- matchIndex++;
483
- searchIndex = matchIndex;
484
- }
485
- while(templateIndex < template.length && '*' === template[templateIndex])templateIndex++;
486
- return templateIndex === template.length;
487
- }
488
- function disable() {
489
- const namespaces = [
490
- ...createDebug.names,
491
- ...createDebug.skips.map((namespace)=>'-' + namespace)
492
- ].join(',');
493
- createDebug.enable('');
494
- return namespaces;
495
- }
496
- function enabled(name) {
497
- for (const skip of createDebug.skips)if (matchesTemplate(name, skip)) return false;
498
- for (const ns of createDebug.names)if (matchesTemplate(name, ns)) return true;
499
- return false;
500
- }
501
- function coerce(val) {
502
- if (val instanceof Error) return val.stack || val.message;
503
- return val;
504
- }
505
- function destroy() {
506
- console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
507
- }
508
- createDebug.enable(createDebug.load());
509
- return createDebug;
510
- }
511
- module.exports = setup;
512
- },
513
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
514
- 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");
515
- else module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js");
516
- },
517
- "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js": function(module, exports, __webpack_require__) {
518
- const tty = __webpack_require__("tty");
519
- const util = __webpack_require__("util");
520
- exports.init = init;
521
- exports.log = log;
522
- exports.formatArgs = formatArgs;
523
- exports.save = save;
524
- exports.load = load;
525
- exports.useColors = useColors;
526
- exports.destroy = util.deprecate(()=>{}, 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
527
- exports.colors = [
528
- 6,
529
- 2,
530
- 3,
531
- 4,
532
- 5,
533
- 1
534
- ];
535
- try {
536
- const supportsColor = __webpack_require__("../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js");
537
- if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports.colors = [
538
- 20,
539
- 21,
540
- 26,
541
- 27,
542
- 32,
543
- 33,
544
- 38,
545
- 39,
546
- 40,
547
- 41,
548
- 42,
549
- 43,
550
- 44,
551
- 45,
552
- 56,
553
- 57,
554
- 62,
555
- 63,
556
- 68,
557
- 69,
558
- 74,
559
- 75,
560
- 76,
561
- 77,
562
- 78,
563
- 79,
564
- 80,
565
- 81,
566
- 92,
567
- 93,
568
- 98,
569
- 99,
570
- 112,
571
- 113,
572
- 128,
573
- 129,
574
- 134,
575
- 135,
576
- 148,
577
- 149,
578
- 160,
579
- 161,
580
- 162,
581
- 163,
582
- 164,
583
- 165,
584
- 166,
585
- 167,
586
- 168,
587
- 169,
588
- 170,
589
- 171,
590
- 172,
591
- 173,
592
- 178,
593
- 179,
594
- 184,
595
- 185,
596
- 196,
597
- 197,
598
- 198,
599
- 199,
600
- 200,
601
- 201,
602
- 202,
603
- 203,
604
- 204,
605
- 205,
606
- 206,
607
- 207,
608
- 208,
609
- 209,
610
- 214,
611
- 215,
612
- 220,
613
- 221
614
- ];
615
- } catch (error) {}
616
- exports.inspectOpts = Object.keys(process.env).filter((key)=>/^debug_/i.test(key)).reduce((obj, key)=>{
617
- const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k)=>k.toUpperCase());
618
- let val = process.env[key];
619
- val = /^(yes|on|true|enabled)$/i.test(val) ? true : /^(no|off|false|disabled)$/i.test(val) ? false : 'null' === val ? null : Number(val);
620
- obj[prop] = val;
621
- return obj;
622
- }, {});
623
- function useColors() {
624
- return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
625
- }
626
- function formatArgs(args) {
627
- const { namespace: name, useColors } = this;
628
- if (useColors) {
629
- const c = this.color;
630
- const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
631
- const prefix = ` ${colorCode};1m${name} \u001B[0m`;
632
- args[0] = prefix + args[0].split('\n').join('\n' + prefix);
633
- args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
634
- } else args[0] = getDate() + name + ' ' + args[0];
635
- }
636
- function getDate() {
637
- if (exports.inspectOpts.hideDate) return '';
638
- return new Date().toISOString() + ' ';
639
- }
640
- function log(...args) {
641
- return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
642
- }
643
- function save(namespaces) {
644
- if (namespaces) process.env.DEBUG = namespaces;
645
- else delete process.env.DEBUG;
646
- }
647
- function load() {
648
- return process.env.DEBUG;
649
- }
650
- function init(debug) {
651
- debug.inspectOpts = {};
652
- const keys = Object.keys(exports.inspectOpts);
653
- for(let i = 0; i < keys.length; i++)debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
654
- }
655
- module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);
656
- const { formatters } = module.exports;
657
- formatters.o = function(v) {
658
- this.inspectOpts.colors = this.useColors;
659
- return util.inspect(v, this.inspectOpts).split('\n').map((str)=>str.trim()).join(' ');
660
- };
661
- formatters.O = function(v) {
662
- this.inspectOpts.colors = this.useColors;
663
- return util.inspect(v, this.inspectOpts);
664
- };
665
- },
666
- "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js": function(module) {
667
- module.exports = (flag, argv = process.argv)=>{
668
- const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
669
- const position = argv.indexOf(prefix + flag);
670
- const terminatorPosition = argv.indexOf('--');
671
- return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
672
- };
673
- },
674
- "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
675
- var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
676
- if (void 0 === k2) k2 = k;
677
- var desc = Object.getOwnPropertyDescriptor(m, k);
678
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
679
- enumerable: true,
680
- get: function() {
681
- return m[k];
682
- }
683
- };
684
- Object.defineProperty(o, k2, desc);
685
- } : function(o, m, k, k2) {
686
- if (void 0 === k2) k2 = k;
687
- o[k2] = m[k];
688
- });
689
- var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
690
- Object.defineProperty(o, "default", {
691
- enumerable: true,
692
- value: v
693
- });
694
- } : function(o, v) {
695
- o["default"] = v;
696
- });
697
- var __importStar = this && this.__importStar || function(mod) {
698
- if (mod && mod.__esModule) return mod;
699
- var result = {};
700
- if (null != mod) {
701
- for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
702
- }
703
- __setModuleDefault(result, mod);
704
- return result;
705
- };
706
- var __importDefault = this && this.__importDefault || function(mod) {
707
- return mod && mod.__esModule ? mod : {
708
- default: mod
709
- };
710
- };
711
- Object.defineProperty(exports, "__esModule", {
712
- value: true
713
- });
714
- exports.HttpsProxyAgent = void 0;
715
- const net = __importStar(__webpack_require__("net"));
716
- const tls = __importStar(__webpack_require__("tls"));
717
- const assert_1 = __importDefault(__webpack_require__("assert"));
718
- const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
719
- const agent_base_1 = __webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js");
720
- const url_1 = __webpack_require__("url");
721
- 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");
722
- const debug = (0, debug_1.default)('https-proxy-agent');
723
- const setServernameFromNonIpHost = (options)=>{
724
- if (void 0 === options.servername && options.host && !net.isIP(options.host)) return {
725
- ...options,
726
- servername: options.host
727
- };
728
- return options;
729
- };
730
- class HttpsProxyAgent extends agent_base_1.Agent {
731
- constructor(proxy, opts){
732
- super(opts);
733
- this.options = {
734
- path: void 0
735
- };
736
- this.proxy = 'string' == typeof proxy ? new url_1.URL(proxy) : proxy;
737
- this.proxyHeaders = opts?.headers ?? {};
738
- debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
739
- const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
740
- const port = this.proxy.port ? parseInt(this.proxy.port, 10) : 'https:' === this.proxy.protocol ? 443 : 80;
741
- this.connectOpts = {
742
- ALPNProtocols: [
743
- 'http/1.1'
744
- ],
745
- ...opts ? omit(opts, 'headers') : null,
746
- host,
747
- port
748
- };
749
- }
750
- async connect(req, opts) {
751
- const { proxy } = this;
752
- if (!opts.host) throw new TypeError('No "host" provided');
753
- let socket;
754
- if ('https:' === proxy.protocol) {
755
- debug('Creating `tls.Socket`: %o', this.connectOpts);
756
- socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
757
- } else {
758
- debug('Creating `net.Socket`: %o', this.connectOpts);
759
- socket = net.connect(this.connectOpts);
760
- }
761
- const headers = 'function' == typeof this.proxyHeaders ? this.proxyHeaders() : {
762
- ...this.proxyHeaders
763
- };
764
- const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
765
- let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
766
- if (proxy.username || proxy.password) {
767
- const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
768
- headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;
769
- }
770
- headers.Host = `${host}:${opts.port}`;
771
- if (!headers['Proxy-Connection']) headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close';
772
- for (const name of Object.keys(headers))payload += `${name}: ${headers[name]}\r\n`;
773
- const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
774
- socket.write(`${payload}\r\n`);
775
- const { connect, buffered } = await proxyResponsePromise;
776
- req.emit('proxyConnect', connect);
777
- this.emit('proxyConnect', connect, req);
778
- if (200 === connect.statusCode) {
779
- req.once('socket', resume);
780
- if (opts.secureEndpoint) {
781
- debug('Upgrading socket connection to TLS');
782
- return tls.connect({
783
- ...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
784
- socket
785
- });
786
- }
787
- return socket;
788
- }
789
- socket.destroy();
790
- const fakeSocket = new net.Socket({
791
- writable: false
792
- });
793
- fakeSocket.readable = true;
794
- req.once('socket', (s)=>{
795
- debug('Replaying proxy buffer for failed request');
796
- (0, assert_1.default)(s.listenerCount('data') > 0);
797
- s.push(buffered);
798
- s.push(null);
799
- });
800
- return fakeSocket;
801
- }
802
- }
803
- HttpsProxyAgent.protocols = [
804
- 'http',
805
- 'https'
806
- ];
807
- exports.HttpsProxyAgent = HttpsProxyAgent;
808
- function resume(socket) {
809
- socket.resume();
810
- }
811
- function omit(obj, ...keys) {
812
- const ret = {};
813
- let key;
814
- for(key in obj)if (!keys.includes(key)) ret[key] = obj[key];
815
- return ret;
816
- }
817
- },
818
- "../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js": function(__unused_webpack_module, exports, __webpack_require__) {
819
- var __importDefault = this && this.__importDefault || function(mod) {
820
- return mod && mod.__esModule ? mod : {
821
- default: mod
822
- };
823
- };
824
- Object.defineProperty(exports, "__esModule", {
825
- value: true
826
- });
827
- exports.parseProxyResponse = void 0;
828
- const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
829
- const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response');
830
- function parseProxyResponse(socket) {
831
- return new Promise((resolve, reject)=>{
832
- let buffersLength = 0;
833
- const buffers = [];
834
- function read() {
835
- const b = socket.read();
836
- if (b) ondata(b);
837
- else socket.once('readable', read);
838
- }
839
- function cleanup() {
840
- socket.removeListener('end', onend);
841
- socket.removeListener('error', onerror);
842
- socket.removeListener('readable', read);
843
- }
844
- function onend() {
845
- cleanup();
846
- debug('onend');
847
- reject(new Error('Proxy connection ended before receiving CONNECT response'));
848
- }
849
- function onerror(err) {
850
- cleanup();
851
- debug('onerror %o', err);
852
- reject(err);
853
- }
854
- function ondata(b) {
855
- buffers.push(b);
856
- buffersLength += b.length;
857
- const buffered = Buffer.concat(buffers, buffersLength);
858
- const endOfHeaders = buffered.indexOf('\r\n\r\n');
859
- if (-1 === endOfHeaders) {
860
- debug('have not received end of HTTP headers yet...');
861
- read();
862
- return;
863
- }
864
- const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n');
865
- const firstLine = headerParts.shift();
866
- if (!firstLine) {
867
- socket.destroy();
868
- return reject(new Error('No header received from proxy CONNECT response'));
869
- }
870
- const firstLineParts = firstLine.split(' ');
871
- const statusCode = +firstLineParts[1];
872
- const statusText = firstLineParts.slice(2).join(' ');
873
- const headers = {};
874
- for (const header of headerParts){
875
- if (!header) continue;
876
- const firstColon = header.indexOf(':');
877
- if (-1 === firstColon) {
878
- socket.destroy();
879
- return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
880
- }
881
- const key = header.slice(0, firstColon).toLowerCase();
882
- const value = header.slice(firstColon + 1).trimStart();
883
- const current = headers[key];
884
- if ('string' == typeof current) headers[key] = [
885
- current,
886
- value
887
- ];
888
- else if (Array.isArray(current)) current.push(value);
889
- else headers[key] = value;
890
- }
891
- debug('got proxy server response: %o %o', firstLine, headers);
892
- cleanup();
893
- resolve({
894
- connect: {
895
- statusCode,
896
- statusText,
897
- headers
898
- },
899
- buffered
900
- });
901
- }
902
- socket.on('error', onerror);
903
- socket.on('end', onend);
904
- read();
905
- });
906
- }
907
- exports.parseProxyResponse = parseProxyResponse;
908
- },
909
- "../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js": function(module) {
910
- var s = 1000;
911
- var m = 60 * s;
912
- var h = 60 * m;
913
- var d = 24 * h;
914
- var w = 7 * d;
915
- var y = 365.25 * d;
916
- module.exports = function(val, options) {
917
- options = options || {};
918
- var type = typeof val;
919
- if ('string' === type && val.length > 0) return parse(val);
920
- if ('number' === type && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
921
- throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
922
- };
923
- function parse(str) {
924
- str = String(str);
925
- if (str.length > 100) return;
926
- 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);
927
- if (!match) return;
928
- var n = parseFloat(match[1]);
929
- var type = (match[2] || 'ms').toLowerCase();
930
- switch(type){
931
- case 'years':
932
- case 'year':
933
- case 'yrs':
934
- case 'yr':
935
- case 'y':
936
- return n * y;
937
- case 'weeks':
938
- case 'week':
939
- case 'w':
940
- return n * w;
941
- case 'days':
942
- case 'day':
943
- case 'd':
944
- return n * d;
945
- case 'hours':
946
- case 'hour':
947
- case 'hrs':
948
- case 'hr':
949
- case 'h':
950
- return n * h;
951
- case 'minutes':
952
- case 'minute':
953
- case 'mins':
954
- case 'min':
955
- case 'm':
956
- return n * m;
957
- case 'seconds':
958
- case 'second':
959
- case 'secs':
960
- case 'sec':
961
- case 's':
962
- return n * s;
963
- case 'milliseconds':
964
- case 'millisecond':
965
- case 'msecs':
966
- case 'msec':
967
- case 'ms':
968
- return n;
969
- default:
970
- return;
971
- }
972
- }
973
- function fmtShort(ms) {
974
- var msAbs = Math.abs(ms);
975
- if (msAbs >= d) return Math.round(ms / d) + 'd';
976
- if (msAbs >= h) return Math.round(ms / h) + 'h';
977
- if (msAbs >= m) return Math.round(ms / m) + 'm';
978
- if (msAbs >= s) return Math.round(ms / s) + 's';
979
- return ms + 'ms';
980
- }
981
- function fmtLong(ms) {
982
- var msAbs = Math.abs(ms);
983
- if (msAbs >= d) return plural(ms, msAbs, d, 'day');
984
- if (msAbs >= h) return plural(ms, msAbs, h, 'hour');
985
- if (msAbs >= m) return plural(ms, msAbs, m, 'minute');
986
- if (msAbs >= s) return plural(ms, msAbs, s, 'second');
987
- return ms + ' ms';
988
- }
989
- function plural(ms, msAbs, n, name) {
990
- var isPlural = msAbs >= 1.5 * n;
991
- return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
992
- }
993
- },
994
- "../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
995
- const os = __webpack_require__("os");
996
- const tty = __webpack_require__("tty");
997
- const hasFlag = __webpack_require__("../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js");
998
- const { env } = process;
999
- let flagForceColor;
1000
- if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
1001
- else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
1002
- function envForceColor() {
1003
- if ('FORCE_COLOR' in env) {
1004
- if ('true' === env.FORCE_COLOR) return 1;
1005
- if ('false' === env.FORCE_COLOR) return 0;
1006
- return 0 === env.FORCE_COLOR.length ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
1007
- }
1008
- }
1009
- function translateLevel(level) {
1010
- if (0 === level) return false;
1011
- return {
1012
- level,
1013
- hasBasic: true,
1014
- has256: level >= 2,
1015
- has16m: level >= 3
1016
- };
1017
- }
1018
- function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
1019
- const noFlagForceColor = envForceColor();
1020
- if (void 0 !== noFlagForceColor) flagForceColor = noFlagForceColor;
1021
- const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
1022
- if (0 === forceColor) return 0;
1023
- if (sniffFlags) {
1024
- if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) return 3;
1025
- if (hasFlag('color=256')) return 2;
1026
- }
1027
- if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
1028
- const min = forceColor || 0;
1029
- if ('dumb' === env.TERM) return min;
1030
- if ('win32' === process.platform) {
1031
- const osRelease = os.release().split('.');
1032
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
1033
- return 1;
1034
- }
1035
- if ('CI' in env) {
1036
- if ([
1037
- 'TRAVIS',
1038
- 'CIRCLECI',
1039
- 'APPVEYOR',
1040
- 'GITLAB_CI',
1041
- 'GITHUB_ACTIONS',
1042
- 'BUILDKITE',
1043
- 'DRONE'
1044
- ].some((sign)=>sign in env) || 'codeship' === env.CI_NAME) return 1;
1045
- return min;
1046
- }
1047
- if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
1048
- if ('truecolor' === env.COLORTERM) return 3;
1049
- if ('TERM_PROGRAM' in env) {
1050
- const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
1051
- switch(env.TERM_PROGRAM){
1052
- case 'iTerm.app':
1053
- return version >= 3 ? 3 : 2;
1054
- case 'Apple_Terminal':
1055
- return 2;
1056
- }
1057
- }
1058
- if (/-256(color)?$/i.test(env.TERM)) return 2;
1059
- if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
1060
- if ('COLORTERM' in env) return 1;
1061
- return min;
1062
- }
1063
- function getSupportLevel(stream, options = {}) {
1064
- const level = supportsColor(stream, {
1065
- streamIsTTY: stream && stream.isTTY,
1066
- ...options
1067
- });
1068
- return translateLevel(level);
1069
- }
1070
- module.exports = {
1071
- supportsColor: getSupportLevel,
1072
- stdout: getSupportLevel({
1073
- isTTY: tty.isatty(1)
1074
- }),
1075
- stderr: getSupportLevel({
1076
- isTTY: tty.isatty(2)
1077
- })
1078
- };
1079
- },
1080
23
  "./src/utils/XhsXsCommonEnc.js": function(module) {
1081
24
  var encrypt_lookup = [
1082
25
  "Z",
@@ -5357,38 +4300,11 @@ nazkkBvqQbbAqVbQFTF/DPikppu6ZT6lGIXvJKCreeFiHA2qK6tS18SWVHW9ARz1
5357
4300
  }
5358
4301
  module.exports = encode_mnsv2;
5359
4302
  },
5360
- assert: function(module) {
5361
- module.exports = __WEBPACK_EXTERNAL_MODULE_assert__;
5362
- },
5363
4303
  crypto: function(module) {
5364
4304
  module.exports = __WEBPACK_EXTERNAL_MODULE_crypto__;
5365
4305
  },
5366
4306
  fs: function(module) {
5367
4307
  module.exports = __WEBPACK_EXTERNAL_MODULE_fs__;
5368
- },
5369
- http: function(module) {
5370
- module.exports = __WEBPACK_EXTERNAL_MODULE_http__;
5371
- },
5372
- https: function(module) {
5373
- module.exports = __WEBPACK_EXTERNAL_MODULE_https__;
5374
- },
5375
- net: function(module) {
5376
- module.exports = __WEBPACK_EXTERNAL_MODULE_net__;
5377
- },
5378
- os: function(module) {
5379
- module.exports = __WEBPACK_EXTERNAL_MODULE_os__;
5380
- },
5381
- tls: function(module) {
5382
- module.exports = __WEBPACK_EXTERNAL_MODULE_tls__;
5383
- },
5384
- tty: function(module) {
5385
- module.exports = __WEBPACK_EXTERNAL_MODULE_tty__;
5386
- },
5387
- url: function(module) {
5388
- module.exports = __WEBPACK_EXTERNAL_MODULE_url__;
5389
- },
5390
- util: function(module) {
5391
- module.exports = __WEBPACK_EXTERNAL_MODULE_util__;
5392
4308
  }
5393
4309
  };
5394
4310
  var __webpack_module_cache__ = {};
@@ -5400,7 +4316,7 @@ function __webpack_require__(moduleId) {
5400
4316
  loaded: false,
5401
4317
  exports: {}
5402
4318
  };
5403
- __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
4319
+ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
5404
4320
  module.loaded = true;
5405
4321
  return module.exports;
5406
4322
  }
@@ -5435,9 +4351,94 @@ function __webpack_require__(moduleId) {
5435
4351
  };
5436
4352
  })();
5437
4353
  var package_namespaceObject = {
5438
- i8: "4.0.1"
4354
+ i8: "4.0.3"
5439
4355
  };
5440
- var dist = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js");
4356
+ const PROXY_CREDENTIALS = [
4357
+ {
4358
+ ip: "47.110.131.129",
4359
+ portStart: 44001,
4360
+ portEnd: 44050,
4361
+ user: "m64ut33hvzUzuh",
4362
+ pass: "pV2nKbhvgciM3URoRjnvk5D1d0CryaE"
4363
+ },
4364
+ {
4365
+ ip: "47.110.131.129",
4366
+ portStart: 44051,
4367
+ portEnd: 44100,
4368
+ user: "m64uz9EMrVpaCk",
4369
+ pass: "pAhDnBmdn12odgffGJnbFt9Jts6EiRz"
4370
+ },
4371
+ {
4372
+ ip: "47.110.131.129",
4373
+ portStart: 44101,
4374
+ portEnd: 44150,
4375
+ user: "m64uacZLZ1hQuz",
4376
+ pass: "p0oyBQtTFXk9x5BniP1GT3t5zmy1kWX"
4377
+ },
4378
+ {
4379
+ ip: "47.110.131.129",
4380
+ portStart: 44151,
4381
+ portEnd: 44200,
4382
+ user: "m64ugn30hbrv5w",
4383
+ pass: "pDMlGki6kx5ObJmIVNX9IyaTyLCNdwF"
4384
+ },
4385
+ {
4386
+ ip: "47.110.131.129",
4387
+ portStart: 44201,
4388
+ portEnd: 44250,
4389
+ user: "m64uxrjtLEuuiJ",
4390
+ pass: "pgSS3tw48oFBFKieAjJjsCzfdbvOxyD"
4391
+ },
4392
+ {
4393
+ ip: "47.110.131.129",
4394
+ portStart: 45001,
4395
+ portEnd: 45050,
4396
+ user: "m63uGNqJq3SfCR",
4397
+ pass: "p9gDMdIlxrfwK6DPpYxad6nnLy2oz7b"
4398
+ },
4399
+ {
4400
+ ip: "47.110.131.129",
4401
+ portStart: 45051,
4402
+ portEnd: 45100,
4403
+ user: "m63usvfyWYu6vY",
4404
+ pass: "pu0hLZL81K5u43XbWlWKjZsNOAPG238"
4405
+ },
4406
+ {
4407
+ ip: "47.110.131.129",
4408
+ portStart: 45101,
4409
+ portEnd: 45150,
4410
+ user: "m63uI2pvHbB0b0",
4411
+ pass: "p353azuJBlrzuu2EidptuhdnBIybdUy"
4412
+ },
4413
+ {
4414
+ ip: "47.110.131.129",
4415
+ portStart: 45151,
4416
+ portEnd: 45200,
4417
+ user: "m63uSpJbw46qnQ",
4418
+ pass: "pYWdnwHHXoKgIOLfuvruZFlSaGN2ZVO"
4419
+ },
4420
+ {
4421
+ ip: "47.110.131.129",
4422
+ portStart: 45201,
4423
+ portEnd: 45250,
4424
+ user: "m63ufKz8YekqZq",
4425
+ pass: "phDmq6dBU85Z85A99LsrtluBgG5OFQ2"
4426
+ }
4427
+ ];
4428
+ function findProxyCredential(ip, port) {
4429
+ const portNum = Number(port);
4430
+ if (Number.isNaN(portNum)) return null;
4431
+ return PROXY_CREDENTIALS.find((c)=>c.ip === ip && portNum >= c.portStart && portNum <= c.portEnd) ?? null;
4432
+ }
4433
+ function buildProxyUrl(ip, port) {
4434
+ const credential = findProxyCredential(ip, port);
4435
+ if (credential) {
4436
+ const user = encodeURIComponent(credential.user);
4437
+ const pass = encodeURIComponent(credential.pass);
4438
+ return `socks5h://${user}:${pass}@${ip}:${port}`;
4439
+ }
4440
+ return `socks5h://${ip}:${port}`;
4441
+ }
5441
4442
  async function ProxyAgent(task, ip, adr, accountId, refresh) {
5442
4443
  const http = new Http({
5443
4444
  headers: {
@@ -5469,11 +4470,12 @@ async function ProxyAgent(task, ip, adr, accountId, refresh) {
5469
4470
  }
5470
4471
  };
5471
4472
  task.logger?.info(`请求代理:区域:${params.addr}, IP:${params.ip}, AccountId:${params.accountId}, 返回代理信息: ${ProxyInfo.data ? `${ProxyInfo.data.proxyIp}:${ProxyInfo.data.proxyPort}` : "无可用代理"}`, loggerInfo);
5472
- return "000000" === ProxyInfo.code && ProxyInfo.data ? {
4473
+ const proxyAgent = "000000" === ProxyInfo.code && ProxyInfo.data ? {
5473
4474
  ip: ProxyInfo.data.proxyIp,
5474
4475
  port: ProxyInfo.data.proxyPort,
5475
- agent: new dist.HttpsProxyAgent(`http://${ProxyInfo.data.proxyIp}:${ProxyInfo.data.proxyPort}`)
4476
+ agent: new __WEBPACK_EXTERNAL_MODULE_socks_proxy_agent_cb52aaad__.SocksProxyAgent(buildProxyUrl(ProxyInfo.data.proxyIp, ProxyInfo.data.proxyPort))
5476
4477
  } : null;
4478
+ return proxyAgent;
5477
4479
  }
5478
4480
  class Http {
5479
4481
  static handleApiError(error) {
@@ -5484,12 +4486,13 @@ class Http {
5484
4486
  data: error
5485
4487
  };
5486
4488
  }
5487
- constructor(config, logger, adr, ip, accountId){
4489
+ constructor(config, logger, adr, ip, accountId, platform){
5488
4490
  this.agentPromise = void 0;
5489
4491
  this.apiClient = __WEBPACK_EXTERNAL_MODULE_axios__["default"].create({
5490
4492
  ...config
5491
4493
  });
5492
4494
  this.logger = logger;
4495
+ this.platform = platform;
5493
4496
  if (ip) this.agentPromise = ProxyAgent({
5494
4497
  logger
5495
4498
  }, ip, adr, accountId);
@@ -5587,7 +4590,10 @@ class Http {
5587
4590
  }
5588
4591
  }
5589
4592
  errorResponse.message = errorResponse.message ? errorResponse.message : _message;
5590
- if ("canceled" === errorResponse.message) errorResponse.message = "网络请求超时,请稍后重试!";
4593
+ if ("canceled" === errorResponse.message) {
4594
+ const message = errorResponse.extra?.isProxyRequest ? "代理连接建立超时,请更换区域或稍后重试!" : "网络请求超时,请稍后重试!";
4595
+ errorResponse.message = message;
4596
+ }
5591
4597
  if (error.message.includes("Proxy connection ended")) errorResponse.message = "所在区域代理连接超时,请更换区域或稍后重试!";
5592
4598
  throw errorResponse;
5593
4599
  });
@@ -5625,14 +4631,21 @@ class Http {
5625
4631
  599
5626
4632
  ].includes(handledError.code);
5627
4633
  if (Rtimes < retries && isRetry) {
5628
- this.logger?.info(`进入第${Rtimes + 1}次重试!错误码: ${handledError.code}`);
4634
+ const url = config.url || "";
4635
+ this.logger?.warn(`进入第${Rtimes + 1}次重试!错误码: ${handledError.code}, 请求地址: ${url}`);
5629
4636
  await new Promise((resolve)=>setTimeout(resolve, retryDelay));
5630
4637
  return sessionRt(Rtimes + 1);
5631
4638
  }
5632
4639
  return Promise.reject(handledError);
5633
4640
  }
5634
4641
  };
5635
- if (this.agentPromise) agent = await this.agentPromise;
4642
+ if (this.agentPromise) {
4643
+ const requestUrl = config.url || "";
4644
+ const platformTag = this.platform ? `[${this.platform}]` : "";
4645
+ this.logger?.info(`${platformTag}[代理请求] 接口: ${requestUrl}`);
4646
+ agent = await this.agentPromise;
4647
+ if (agent) this.logger?.info(`${platformTag}[代理请求] 代理地址: ${agent.ip}:${agent.port}`);
4648
+ }
5636
4649
  return sessionRt(0);
5637
4650
  }
5638
4651
  }
@@ -9992,7 +9005,8 @@ const mockAction = async (task, params)=>{
9992
9005
  task.logger,
9993
9006
  params.proxyLoc,
9994
9007
  params.localIP,
9995
- params.accountId
9008
+ params.accountId,
9009
+ "baijiahao"
9996
9010
  ];
9997
9011
  const http = new Http({
9998
9012
  headers
@@ -10202,6 +9216,7 @@ const mockAction = async (task, params)=>{
10202
9216
  platform: "baijiahao",
10203
9217
  publishParams: publishData
10204
9218
  });
9219
+ task.logger.info(`[baijiahaoPublish] publishResult: ${JSON.stringify(res)} `);
10205
9220
  const isSuccess = 0 === res.errno;
10206
9221
  const data = res?.ret?.article_id;
10207
9222
  const message = isSuccess ? isDraft ? "文章同步成功!" : `文章发布成功!${res.proxyInfo || ""}` : res.errmsg || (isDraft ? "文章同步失败,请稍后重试。" : "文章发布失败,请稍后重试。");
@@ -13345,7 +12360,7 @@ const douyinGetVerifyQrCode = async (task, params)=>{
13345
12360
  });
13346
12361
  } catch (err) {
13347
12362
  const msg = err instanceof Error ? err.message : String(err);
13348
- task.logger.warn(`获取二维码失败: ${msg}`);
12363
+ task.logger.warn(`[douyinGetVerifyQrCode] 获取二维码失败: ${msg}`);
13349
12364
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, `获取二维码失败: ${msg}`, "");
13350
12365
  }
13351
12366
  };
@@ -14438,7 +13453,8 @@ const mock_mockAction = async (task, params)=>{
14438
13453
  task.logger,
14439
13454
  "",
14440
13455
  "",
14441
- params.accountId
13456
+ params.accountId,
13457
+ "douyin"
14442
13458
  ];
14443
13459
  const http = new Http({
14444
13460
  headers
@@ -14474,14 +13490,12 @@ const mock_mockAction = async (task, params)=>{
14474
13490
  }
14475
13491
  publishData.item.common.creation_id = generateRandomString(8) + Date.now();
14476
13492
  let decision = null;
14477
- task.logger.info(`[douyinPublish] proxyHttp 代理信息: ${proxyHttp.proxyInfo} `);
14478
13493
  proxyHttp.addResponseInterceptor((response)=>{
14479
- console.log("拦截器收到响应:", JSON.stringify(response.data));
14480
- task.logger.warn(`[douyinPublish] 拦截器收到响应response.headers: ${JSON.stringify(response.headers)} `);
14481
- task.logger.warn(`[douyinPublish] 拦截器收到响应response.data: ${JSON.stringify(response.data)} `);
13494
+ task.logger.info(`[douyinPublish] 拦截器收到响应response.headers: ${JSON.stringify(response.headers)} `);
13495
+ task.logger.info(`[douyinPublish] 拦截器收到响应response.data: ${JSON.stringify(response.data)} `);
14482
13496
  decision = parseVerifyPassportDecision(response.headers["x-tt-verify-passport-decision"]);
14483
13497
  if (needsVerification(decision)) {
14484
- task.logger.warn(`[douyinPublish] 检测到需要验证: ${JSON.stringify(decision)}`);
13498
+ task.logger.info(`[douyinPublish] 检测到需要验证: ${JSON.stringify(decision)}`);
14485
13499
  return;
14486
13500
  }
14487
13501
  if (!response || !response.data) return;
@@ -14530,32 +13544,31 @@ const mock_mockAction = async (task, params)=>{
14530
13544
  ts_sign = decoded.ts_sign;
14531
13545
  }
14532
13546
  } catch (error) {
14533
- task.logger.warn(`解析 bd_ticket_guard_server_data 失败,回退到 web_protect: ${error}`);
13547
+ task.logger.info(`[douyinPublish] 解析 bd_ticket_guard_server_data 失败,回退到 web_protect: ${error}`);
14534
13548
  }
14535
13549
  let ec_privateKey;
14536
13550
  try {
14537
13551
  ec_privateKey = JSON.parse(JSON.parse(params.extraParam["security-sdk/s_sdk_crypt_sdk"] || "{}").data || "{}").ec_privateKey;
14538
13552
  if (!ec_privateKey) {
14539
- task.logger.error("ec_privateKey 为空");
13553
+ task.logger.error("[douyinPublish] ec_privateKey 为空");
14540
13554
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 ec_privateKey 缺失,请重新获取后重试", "");
14541
13555
  }
14542
13556
  } catch (error) {
14543
- task.logger.error(`解析 ec_privateKey 失败: ${error}`);
13557
+ task.logger.error(`[douyinPublish] 解析 ec_privateKey 失败: ${error}`);
14544
13558
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 ec_privateKey 解析失败,请重新获取后重试", "");
14545
13559
  }
14546
13560
  let certificate;
14547
13561
  try {
14548
13562
  certificate = JSON.parse(params.extraParam["security-sdk/s_sdk_server_cert_key"] || "{}").cert;
14549
13563
  if (!certificate) {
14550
- task.logger.error("certificate 为空");
13564
+ task.logger.error("[douyinPublish] certificate 为空");
14551
13565
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 certificate 缺失,请重新获取后重试", "");
14552
13566
  }
14553
13567
  } catch (error) {
14554
- task.logger.error(`解析 certificate 失败: ${error}`);
13568
+ task.logger.error(`[douyinPublish] 解析 certificate 失败: ${error}`);
14555
13569
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 certificate 解析失败,请重新获取后重试", "");
14556
13570
  }
14557
13571
  const ree_public_key = webProtectData.client_cert.replace("pub.", "");
14558
- task.logger.info(`生成 bdTicketGuardClientData 的参数: ticket: ${ticket?.substring(0, 20)}..., ts_sign: ${ts_sign}, ree_public_key: ${ree_public_key?.substring(0, 20)}...`);
14559
13572
  let bdTicketGuardClientData;
14560
13573
  try {
14561
13574
  bdTicketGuardClientData = getBdV2({
@@ -14566,14 +13579,14 @@ const mock_mockAction = async (task, params)=>{
14566
13579
  bd_ticket_guard_ree_public_key: ree_public_key
14567
13580
  });
14568
13581
  if (!bdTicketGuardClientData || !bdTicketGuardClientData["headers_bd_ticket_guard_client_data"]) {
14569
- task.logger.error(`bdTicketGuardClientData 生成失败或不完整: ${JSON.stringify(bdTicketGuardClientData)}`);
13582
+ task.logger.error(`[douyinPublish] bdTicketGuardClientData 生成失败或不完整: ${JSON.stringify(bdTicketGuardClientData)}`);
14570
13583
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 bdTicketGuardClientData 生成失败,请重新获取后重试", "");
14571
13584
  }
14572
13585
  } catch (error) {
14573
- task.logger.error(`生成 bdTicketGuardClientData 失败: ${error}`);
13586
+ task.logger.error(`[douyinPublish] 生成 bdTicketGuardClientData 失败: ${error}`);
14574
13587
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 bdTicketGuardClientData 生成异常,请重新获取后重试", "");
14575
13588
  }
14576
- task.logger.info("bdTicketGuardClientData 生成成功");
13589
+ task.logger.info("[douyinPublish] bdTicketGuardClientData 生成成功");
14577
13590
  const publishQuery = {
14578
13591
  ...publishParams,
14579
13592
  a_bogus: ""
@@ -14583,12 +13596,11 @@ const mock_mockAction = async (task, params)=>{
14583
13596
  try {
14584
13597
  aBogus = mock_getABogus(`https://creator.douyin.com/web/api/media/aweme/create_v2/?${queryString}`, publishData, userAgent);
14585
13598
  if (!aBogus || aBogus.length < 10) {
14586
- task.logger.error(`a_bogus 生成异常,长度过短: ${aBogus}`);
13599
+ task.logger.error(`[douyinPublish] a_bogus 生成异常,长度过短: ${aBogus}`);
14587
13600
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 a_bogus 生成失败,请重试", "");
14588
13601
  }
14589
- task.logger.info(`a_bogus 生成成功: ${aBogus.substring(0, 20)}...`);
14590
13602
  } catch (error) {
14591
- task.logger.error(`生成 a_bogus 失败: ${error}`);
13603
+ task.logger.error(`[douyinPublish] 生成 a_bogus 失败: ${error}`);
14592
13604
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 a_bogus 生成异常,请重试", "");
14593
13605
  }
14594
13606
  publishQuery.a_bogus = aBogus;
@@ -14602,25 +13614,22 @@ const mock_mockAction = async (task, params)=>{
14602
13614
  userAgent
14603
13615
  });
14604
13616
  if (!csrfToken || csrfToken.length < 10) {
14605
- task.logger.error(`csrfToken 生成异常,长度过短: ${csrfToken}`);
13617
+ task.logger.error(`[douyinPublish] csrfToken 生成异常,长度过短: ${csrfToken}`);
14606
13618
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 csrfToken 生成失败,请重试", "");
14607
13619
  }
14608
- task.logger.info(`csrfToken 生成成功: ${csrfToken.substring(0, 20)}...`);
13620
+ task.logger.info(`[douyinPublish] csrfToken 生成成功: ${csrfToken.substring(0, 20)}...`);
14609
13621
  } catch (error) {
14610
- task.logger.error(`生成 csrfToken 失败: ${error}`);
13622
+ task.logger.error(`[douyinPublish] 生成 csrfToken 失败: ${error}`);
14611
13623
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 csrfToken 生成异常,请重试", "");
14612
13624
  }
14613
13625
  let sessionDtrait;
14614
13626
  try {
14615
13627
  sessionDtrait = mock_generateDtrait("/web/api/media/aweme/create_v2/");
14616
- task.logger.info(`sessionDtrait 生成成功: ${sessionDtrait || "(空)"}`);
13628
+ task.logger.info(`[douyinPublish] sessionDtrait 生成成功: ${sessionDtrait || "(空)"}`);
14617
13629
  } catch (error) {
14618
- task.logger.error(`生成 sessionDtrait 失败: ${error}`);
13630
+ task.logger.error(`[douyinPublish] 生成 sessionDtrait 失败: ${error}`);
14619
13631
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(414, "安全参数 sessionDtrait 生成异常,请重试", "");
14620
13632
  }
14621
- task.logger.info("[douyinPublish] 发布数据", {
14622
- data: JSON.stringify(publishData)
14623
- });
14624
13633
  task.logger.info(`[douyinPublish] headers: ${JSON.stringify({
14625
13634
  ...headers,
14626
13635
  Referer: "https://creator.douyin.com/creator-micro/content/post/image?default-tab=3&enter_from=publish_page&media_type=image&type=new",
@@ -14635,29 +13644,57 @@ const mock_mockAction = async (task, params)=>{
14635
13644
  "x-tt-session-dtrait": sessionDtrait || ""
14636
13645
  })}`);
14637
13646
  task.logger.info(`[douyinPublish] url: https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`);
14638
- const publishResult = await proxyHttp.api({
14639
- method: "post",
14640
- url: `https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`,
14641
- data: publishData,
14642
- defaultErrorMsg: "发布异常,请稍后重试。",
14643
- headers: {
14644
- ...headers,
14645
- Referer: "https://creator.douyin.com/creator-micro/content/post/image?default-tab=3&enter_from=publish_page&media_type=image&type=new",
14646
- "Content-Type": "application/json",
14647
- Accept: "application/json, text/plain, */*",
14648
- "bd-ticket-guard-client-data": bdTicketGuardClientData["headers_bd_ticket_guard_client_data"],
14649
- "bd-ticket-guard-ree-public-key": bdTicketGuardClientData["headers_bd_ticket_guard_ree_public_key"],
14650
- "bd-ticket-guard-version": "2",
14651
- "bd-ticket-guard-web-sign-type": "1",
14652
- "bd-ticket-guard-web-version": "2",
14653
- "x-secsdk-csrf-token": csrfToken,
14654
- "x-tt-session-dtrait": sessionDtrait || ""
13647
+ let publishResult;
13648
+ try {
13649
+ publishResult = await proxyHttp.api({
13650
+ method: "post",
13651
+ url: `https://creator.douyin.com/web/api/media/aweme/create_v2/?${publishQueryParams}`,
13652
+ data: publishData,
13653
+ defaultErrorMsg: "发布异常,请稍后重试。",
13654
+ headers: {
13655
+ ...headers,
13656
+ Referer: "https://creator.douyin.com/creator-micro/content/post/image?default-tab=3&enter_from=publish_page&media_type=image&type=new",
13657
+ "Content-Type": "application/json",
13658
+ Accept: "application/json, text/plain, */*",
13659
+ "bd-ticket-guard-client-data": bdTicketGuardClientData["headers_bd_ticket_guard_client_data"],
13660
+ "bd-ticket-guard-ree-public-key": bdTicketGuardClientData["headers_bd_ticket_guard_ree_public_key"],
13661
+ "bd-ticket-guard-version": "2",
13662
+ "bd-ticket-guard-web-sign-type": "1",
13663
+ "bd-ticket-guard-web-version": "2",
13664
+ "x-secsdk-csrf-token": csrfToken,
13665
+ "x-tt-session-dtrait": sessionDtrait || ""
13666
+ }
13667
+ }, {
13668
+ timeout: 60000,
13669
+ retries: 3,
13670
+ retryDelay: 2000
13671
+ });
13672
+ } catch (error) {
13673
+ const handledError = Http.handleApiError(error);
13674
+ const isProxyOrNetworkError = [
13675
+ 599,
13676
+ 500,
13677
+ 502,
13678
+ 503,
13679
+ 504
13680
+ ].includes(handledError.code);
13681
+ if (isProxyOrNetworkError) {
13682
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
13683
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
13684
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
13685
+ task.logger.error(`[douyinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
13686
+ await updateTaskState?.({
13687
+ state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
13688
+ error: message
13689
+ });
13690
+ return {
13691
+ code: 414,
13692
+ data: "",
13693
+ message
13694
+ };
14655
13695
  }
14656
- }, {
14657
- timeout: 60000,
14658
- retries: 3,
14659
- retryDelay: 2000
14660
- });
13696
+ throw error;
13697
+ }
14661
13698
  task.logger.info(`[douyinPublish] decision值: ${JSON.stringify(decision)}, needsVerification(decision): ${needsVerification(decision)}`);
14662
13699
  if (needsVerification(decision)) {
14663
13700
  const details = [
@@ -15448,7 +14485,7 @@ const rpaAction_Server = async (task, params)=>{
15448
14485
  decision?.verify_title,
15449
14486
  decision?.verify_desc
15450
14487
  ].filter(Boolean).join(" ");
15451
- const message = `发布失败,需要二次验证${details ? `:${details}` : ""}`;
14488
+ const message = `[douyinPublish rpa-server]发布失败,需要二次验证${details ? `:${details}` : ""}`;
15452
14489
  task.logger?.warn(message);
15453
14490
  await updateTaskState?.({
15454
14491
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
@@ -15958,7 +14995,7 @@ const getWeixinCollection = async (_task, params)=>{
15958
14995
  ajax: 1
15959
14996
  }
15960
14997
  });
15961
- return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res.list_resp.items, 0 === res.base_resp.ret ? "微信合计信息获取成功!" : "微信合集信息获取失败!");
14998
+ return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res.list_resp?.items ?? [], 0 === res.base_resp.ret ? "微信合计信息获取成功!" : "微信合集信息获取失败!");
15962
14999
  };
15963
15000
  const getWeixinConfig = async (_task, params)=>{
15964
15001
  const http = new Http({
@@ -19009,7 +18046,7 @@ async function publishDynamic(cookies, uin, fingerPrintDeviceId, aId, proxyHttp,
19009
18046
  return apiResponse;
19010
18047
  }
19011
18048
  const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19012
- task.logger.info("开始执行视频号发布 - Mock API 方式");
18049
+ task.logger.info("[shipinhaoPublish] 开始执行视频号发布 - Mock API 方式");
19013
18050
  const updateTaskState = task.taskStageStore?.update?.bind(task.taskStageStore, task.taskId || "");
19014
18051
  if (!params.extraParam.fingerPrintDeviceId || !params.extraParam.aId) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(400, "fingerPrintDeviceId和aId 不能为空", "");
19015
18052
  try {
@@ -19026,7 +18063,8 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19026
18063
  task.logger,
19027
18064
  params.proxyLoc,
19028
18065
  params.localIP,
19029
- params.accountId
18066
+ params.accountId,
18067
+ "shipinhao"
19030
18068
  ];
19031
18069
  const http = new Http({
19032
18070
  headers
@@ -19034,7 +18072,7 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19034
18072
  const proxyHttp = new Http(...args);
19035
18073
  if (!params.banners || 0 === params.banners.length) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(400, "至少需要一张图片", "");
19036
18074
  const images = params.banners.slice(0, 18).filter((img)=>"string" == typeof img);
19037
- task.logger.info("获取用户信息...");
18075
+ task.logger.info("[shipinhaoPublish] 获取用户信息...");
19038
18076
  console.log("cookieString", cookieString);
19039
18077
  const userInfo = await mock_getUserInfo(cookieString, http);
19040
18078
  console.log(JSON.stringify(userInfo));
@@ -19044,17 +18082,17 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19044
18082
  }
19045
18083
  const finderUsername = userInfo.data.finderUser.finderUsername;
19046
18084
  console.log(finderUsername);
19047
- task.logger.info("获取上传认证密钥...");
18085
+ task.logger.info("[shipinhaoPublish] 获取上传认证密钥...");
19048
18086
  const authKeyResponse = await getUploadAuthKey(cookieString, finderUsername, http);
19049
18087
  if (0 !== authKeyResponse.errCode || !authKeyResponse.data?.authKey) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(authKeyResponse.errCode || 500, `获取上传认证参数失败: ${authKeyResponse.errMsg}`, "");
19050
18088
  const authKey = authKeyResponse.data.authKey;
19051
18089
  const uin = authKeyResponse.data.uin;
19052
18090
  if (!uin) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, "获取用户 uin 失败", "");
19053
18091
  const taskId = String(generateUUID());
19054
- task.logger.info(`开始上传 ${images.length} 张图片...`);
18092
+ task.logger.info(`[shipinhaoPublish] 开始上传 ${images.length} 张图片...`);
19055
18093
  const uploadedImages = [];
19056
18094
  for(let i = 0; i < images.length; i++){
19057
- task.logger.info(`上传图片 ${i + 1}/${images.length}...`);
18095
+ task.logger.info(`[shipinhaoPublish] 上传图片 ${i + 1}/${images.length}...`);
19058
18096
  const uploadResult = await uploadImageComplete(images[i], taskId, finderUsername, uin, authKey, http);
19059
18097
  console.log(JSON.stringify(uploadResult));
19060
18098
  if (!uploadResult.DownloadURL) return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, `图片上传失败: ${uploadResult.errMsg}`, "");
@@ -19071,7 +18109,7 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19071
18109
  urlCdnTaskId: ""
19072
18110
  });
19073
18111
  }
19074
- task.logger.info("正在发布...");
18112
+ task.logger.info("[shipinhaoPublish] 正在发布...");
19075
18113
  const topicNames = params.topic || void 0;
19076
18114
  const addressInfo = params.address ? {
19077
18115
  name: params.address.name,
@@ -19081,32 +18119,61 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19081
18119
  address: params.address.address,
19082
18120
  uid: params.address.poi_id
19083
18121
  } : void 0;
19084
- const publishResult = await publishDynamic(cookieString, uin, fingerPrintDeviceId, aId, proxyHttp, {
19085
- token: params.huiwenToken || "",
19086
- enverionment: task.enverionment || "development",
19087
- articleId: params.articleId,
19088
- postId: params.articleId,
19089
- eip: proxyHttp.proxyInfo,
19090
- proxyIp: params.localIP,
19091
- accountId: params.accountId,
19092
- uid: params.uid
19093
- }, {
19094
- title: params.title,
19095
- content: params.content,
19096
- images: uploadedImages,
19097
- finderUsername,
19098
- publishType: params.publishType || "1",
19099
- topic: topicNames,
19100
- link: params.link,
19101
- address: addressInfo,
19102
- collection: params.collection,
19103
- scheduledPublish: params.scheduledPublish,
19104
- music: params.music
19105
- });
18122
+ let publishResult;
18123
+ try {
18124
+ publishResult = await publishDynamic(cookieString, uin, fingerPrintDeviceId, aId, proxyHttp, {
18125
+ token: params.huiwenToken || "",
18126
+ enverionment: task.enverionment || "development",
18127
+ articleId: params.articleId,
18128
+ postId: params.articleId,
18129
+ eip: proxyHttp.proxyInfo,
18130
+ proxyIp: params.localIP,
18131
+ accountId: params.accountId,
18132
+ uid: params.uid
18133
+ }, {
18134
+ title: params.title,
18135
+ content: params.content,
18136
+ images: uploadedImages,
18137
+ finderUsername,
18138
+ publishType: params.publishType || "1",
18139
+ topic: topicNames,
18140
+ link: params.link,
18141
+ address: addressInfo,
18142
+ collection: params.collection,
18143
+ scheduledPublish: params.scheduledPublish,
18144
+ music: params.music
18145
+ });
18146
+ } catch (error) {
18147
+ const handledError = Http.handleApiError(error);
18148
+ const isProxyOrNetworkError = [
18149
+ 599,
18150
+ 500,
18151
+ 502,
18152
+ 503,
18153
+ 504
18154
+ ].includes(handledError.code);
18155
+ if (isProxyOrNetworkError) {
18156
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
18157
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
18158
+ const message = `图文发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
18159
+ task.logger.error(`[shipinhaoPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
18160
+ await updateTaskState?.({
18161
+ state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
18162
+ error: message
18163
+ });
18164
+ return {
18165
+ code: 414,
18166
+ data: "",
18167
+ message
18168
+ };
18169
+ }
18170
+ throw error;
18171
+ }
18172
+ task.logger.info(`[shipinhaoPublish] publishResult: ${JSON.stringify(publishResult)} `);
19106
18173
  const resultCode = publishResult.data?.baseResp?.errcode ?? publishResult.errCode;
19107
18174
  const resultMsg = publishResult.data?.baseResp?.errmsg ?? publishResult.errMsg;
19108
18175
  if (0 === resultCode) {
19109
- task.logger.info("发布成功");
18176
+ task.logger.info("[shipinhaoPublish] 发布成功");
19110
18177
  const publishId = uploadedImages[0]?.thumbUrl?.split("encfilekey=")[1]?.split("&")[0] || "";
19111
18178
  await updateTaskState?.({
19112
18179
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.SUCCESS,
@@ -19121,7 +18188,7 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19121
18188
  else if (300333 === resultCode || 300334 === resultCode) errorMessage = "登录失效";
19122
18189
  else if (300330 === resultCode) errorMessage = "未登录";
19123
18190
  else if (300002 === resultCode) errorMessage = "官方平台在校验音乐/位置/定时信息时失败了,请重新编辑后发布";
19124
- task.logger.error(`发布失败: ${errorMessage}`);
18191
+ task.logger.error(`[shipinhaoPublish] 发布失败: ${errorMessage}`);
19125
18192
  await updateTaskState?.({
19126
18193
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
19127
18194
  error: errorMessage
@@ -19129,7 +18196,7 @@ const shipinhaoPublish_mock_mockAction = async (task, params)=>{
19129
18196
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(resultCode || 500, errorMessage, "");
19130
18197
  } catch (error) {
19131
18198
  const errorMsg = error instanceof Error ? error.message : "发布失败";
19132
- task.logger.error(`发布异常: ${errorMsg}`);
18199
+ task.logger.error(`[shipinhaoPublish] 发布异常: ${errorMsg}`);
19133
18200
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(500, errorMsg, "");
19134
18201
  }
19135
18202
  };
@@ -20361,7 +19428,8 @@ const toutiaoPublish_mock_mockAction = async (task, params)=>{
20361
19428
  task.logger,
20362
19429
  params.proxyLoc,
20363
19430
  params.localIP,
20364
- params.accountId
19431
+ params.accountId,
19432
+ "toutiao"
20365
19433
  ];
20366
19434
  const http = new Http({
20367
19435
  headers
@@ -21694,7 +20762,8 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
21694
20762
  task.logger,
21695
20763
  params.proxyLoc,
21696
20764
  params.localIP,
21697
- params.accountId
20765
+ params.accountId,
20766
+ "weixin"
21698
20767
  ];
21699
20768
  const http = new Http({
21700
20769
  headers
@@ -22417,28 +21486,55 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
22417
21486
  isNeedCode: "true",
22418
21487
  userType: "1"
22419
21488
  });
22420
- await proxyHttp.api({
22421
- method: "post",
22422
- url: "https://mp.weixin.qq.com/cgi-bin/masssend",
22423
- params: {
22424
- t: "ajax-response",
22425
- token: params.token,
22426
- lang: "zh_CN",
22427
- ...params.masssend ? {
22428
- ...params.settingInfo.timer ? {
22429
- action: "time_send"
22430
- } : {}
22431
- } : {
22432
- is_release_publish_page: 1
22433
- }
22434
- },
22435
- data: publishData,
22436
- defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
22437
- }, {
22438
- retries: 3,
22439
- retryDelay: 500,
22440
- timeout: 12000
22441
- });
21489
+ try {
21490
+ await proxyHttp.api({
21491
+ method: "post",
21492
+ url: "https://mp.weixin.qq.com/cgi-bin/masssend",
21493
+ params: {
21494
+ t: "ajax-response",
21495
+ token: params.token,
21496
+ lang: "zh_CN",
21497
+ ...params.masssend ? {
21498
+ ...params.settingInfo.timer ? {
21499
+ action: "time_send"
21500
+ } : {}
21501
+ } : {
21502
+ is_release_publish_page: 1
21503
+ }
21504
+ },
21505
+ data: publishData,
21506
+ defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
21507
+ }, {
21508
+ retries: 3,
21509
+ retryDelay: 500,
21510
+ timeout: 12000
21511
+ });
21512
+ } catch (error) {
21513
+ const handledError = Http.handleApiError(error);
21514
+ const isProxyOrNetworkError = [
21515
+ 599,
21516
+ 500,
21517
+ 502,
21518
+ 503,
21519
+ 504
21520
+ ].includes(handledError.code);
21521
+ if (isProxyOrNetworkError) {
21522
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
21523
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
21524
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
21525
+ task.logger.error(`[weixinPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
21526
+ await updateTaskState?.({
21527
+ state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
21528
+ error: message
21529
+ });
21530
+ return {
21531
+ code: 414,
21532
+ data: "",
21533
+ message
21534
+ };
21535
+ }
21536
+ throw error;
21537
+ }
22442
21538
  if ("publish" === params.saveType) reportLogger({
22443
21539
  token: params.huiwenToken || "",
22444
21540
  enverionment: task.enverionment || "development",
@@ -23576,14 +22672,15 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23576
22672
  task.logger,
23577
22673
  params.proxyLoc,
23578
22674
  params.localIP,
23579
- params.accountId
22675
+ params.accountId,
22676
+ "xiaohongshu"
23580
22677
  ];
23581
22678
  const http = new Http({
23582
22679
  headers
23583
22680
  });
23584
22681
  const proxyHttp = new Http(...args);
23585
22682
  proxyHttp.addResponseInterceptor((response)=>{
23586
- const responseData = response.data;
22683
+ const responseData = response?.data;
23587
22684
  if (response && responseData?.code && 0 !== responseData.code || responseData?.code && !responseData.success) {
23588
22685
  const errmsg = xiaohongshuPublish_mock_errnoMap[responseData.code] || response.config.defaultErrorMsg || "文章发布异常,请稍后重试。";
23589
22686
  return {
@@ -23606,11 +22703,6 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23606
22703
  if (params.banners.length > 18) {
23607
22704
  const num = Math.ceil(params.banners.length / 14);
23608
22705
  for(let i = 0; i < num; i++){
23609
- const start = 14 * i;
23610
- params.banners.length;
23611
- ({
23612
- ...fetchCoverParams
23613
- });
23614
22706
  const batchCoverIdInfo = await proxyHttp.api({
23615
22707
  method: "get",
23616
22708
  baseURL: "https://creator.xiaohongshu.com",
@@ -23623,7 +22715,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23623
22715
  retryDelay: 20,
23624
22716
  timeout: 3000
23625
22717
  });
23626
- for (const item of batchCoverIdInfo.data.uploadTempPermits)for (const fileId of item.fileIds)uploadInfos.push({
22718
+ for (const item of batchCoverIdInfo?.data?.uploadTempPermits ?? [])for (const fileId of item.fileIds)uploadInfos.push({
23627
22719
  bucket: item.bucket || "",
23628
22720
  uploadAddr: item.uploadAddr || "",
23629
22721
  fileIds: fileId,
@@ -23643,7 +22735,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23643
22735
  retryDelay: 20,
23644
22736
  timeout: 3000
23645
22737
  });
23646
- for (const item of coverIdInfo.data.uploadTempPermits)for (const fileId of item.fileIds)uploadInfos.push({
22738
+ for (const item of coverIdInfo?.data?.uploadTempPermits ?? [])for (const fileId of item.fileIds)uploadInfos.push({
23647
22739
  bucket: item.bucket || "",
23648
22740
  uploadAddr: item.uploadAddr || "",
23649
22741
  fileIds: fileId,
@@ -23840,7 +22932,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23840
22932
  retries: 3,
23841
22933
  retryDelay: 20,
23842
22934
  timeout: 3000
23843
- }).then((userData)=>userData.data?.userDetail?.id));
22935
+ }).then((userData)=>userData?.data?.userDetail?.id));
23844
22936
  const business_binds = {
23845
22937
  version: 1,
23846
22938
  bizType: "",
@@ -23901,18 +22993,45 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23901
22993
  });
23902
22994
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(data, message);
23903
22995
  }
23904
- task.logger.info(`[xiaohongshuPublish] publishData: ${JSON.stringify(publishData)} `);
23905
- const publishResult = await proxyHttp.api({
23906
- method: "post",
23907
- url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
23908
- data: publishData,
23909
- headers: publishXsHeader,
23910
- defaultErrorMsg: "文章发布异常,请稍后重试。"
23911
- }, {
23912
- retries: 2,
23913
- retryDelay: 500,
23914
- timeout: 12000
23915
- });
22996
+ let publishResult;
22997
+ try {
22998
+ publishResult = await proxyHttp.api({
22999
+ method: "post",
23000
+ url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
23001
+ data: publishData,
23002
+ headers: publishXsHeader,
23003
+ defaultErrorMsg: "文章发布异常,请稍后重试。"
23004
+ }, {
23005
+ retries: 2,
23006
+ retryDelay: 500,
23007
+ timeout: 12000
23008
+ });
23009
+ } catch (error) {
23010
+ const handledError = Http.handleApiError(error);
23011
+ const isProxyOrNetworkError = [
23012
+ 599,
23013
+ 500,
23014
+ 502,
23015
+ 503,
23016
+ 504
23017
+ ].includes(handledError.code);
23018
+ if (isProxyOrNetworkError) {
23019
+ const isProxyRequest = handledError.extra?.isProxyRequest === true;
23020
+ const errorType = 599 === handledError.code || isProxyRequest ? "代理错误" : "网络错误";
23021
+ const message = `文章发布失败,${errorType}:${handledError.message}${task.debug ? ` ${http.proxyInfo}` : ""}`;
23022
+ task.logger.error(`[xiaohongshuPublish] ${errorType},直接返回: ${message}`, stringifyError(handledError));
23023
+ await updateTaskState?.({
23024
+ state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
23025
+ error: message
23026
+ });
23027
+ return {
23028
+ code: 414,
23029
+ data: "",
23030
+ message
23031
+ };
23032
+ }
23033
+ throw error;
23034
+ }
23916
23035
  reportLogger({
23917
23036
  token: params.huiwenToken || "",
23918
23037
  enverionment: task.enverionment || "development",
@@ -23924,9 +23043,10 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
23924
23043
  platform: "xiaohongshu",
23925
23044
  publishParams: publishData
23926
23045
  });
23046
+ task.logger.info(`[xiaohongshuPublish] publishResult: ${JSON.stringify(publishResult)} `);
23927
23047
  const isSuccess = publishResult.success;
23928
23048
  const message = `文章发布${isSuccess ? "成功" : `失败,原因:${publishResult.msg}`}${task.debug ? ` ${http.proxyInfo}` : ""}`;
23929
- const data = isSuccess ? publishResult.data?.id || "" : "";
23049
+ const data = isSuccess ? publishResult?.data?.id || "" : "";
23930
23050
  if (!isSuccess) {
23931
23051
  await updateTaskState?.({
23932
23052
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
@@ -24618,14 +23738,15 @@ const rpaAction_Server_Mock = async (task, params)=>{
24618
23738
  task.logger,
24619
23739
  params.proxyLoc,
24620
23740
  params.localIP,
24621
- params.accountId
23741
+ params.accountId,
23742
+ "xiaohongshu-rpa"
24622
23743
  ];
24623
23744
  const http = new Http({
24624
23745
  headers
24625
23746
  });
24626
23747
  const proxyHttp = new Http(...args);
24627
23748
  proxyHttp.addResponseInterceptor((response)=>{
24628
- const responseData = response.data;
23749
+ const responseData = response?.data;
24629
23750
  if (response && responseData?.code && 0 !== responseData.code || responseData?.code && !responseData.success) {
24630
23751
  const errmsg = rpa_server_mock_errnoMap[responseData.code] || response.config.defaultErrorMsg || "文章发布异常,请稍后重试。";
24631
23752
  return {
@@ -24646,7 +23767,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24646
23767
  const fetchCoverXsHeader = rpa_server_mock_xsEncrypt.signHeadersGet(fetchCoverUrl, recordCookie, "ugc", fetchCoverParams);
24647
23768
  const uploadInfos = [];
24648
23769
  if (params.banners.length > 18) {
24649
- let num = Math.ceil(params.banners.length / 14);
23770
+ const num = Math.ceil(params.banners.length / 14);
24650
23771
  for(let i = 0; i < num; i++){
24651
23772
  const start = 14 * i;
24652
23773
  params.banners.length;
@@ -24665,7 +23786,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24665
23786
  retryDelay: 20,
24666
23787
  timeout: 3000
24667
23788
  });
24668
- for (const item of batchCoverIdInfo.data.uploadTempPermits)for (const fileId of item.fileIds)uploadInfos.push({
23789
+ for (const item of batchCoverIdInfo?.data?.uploadTempPermits ?? [])for (const fileId of item?.fileIds ?? [])uploadInfos.push({
24669
23790
  bucket: item.bucket || "",
24670
23791
  uploadAddr: item.uploadAddr || "",
24671
23792
  fileIds: fileId,
@@ -24685,7 +23806,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24685
23806
  retryDelay: 20,
24686
23807
  timeout: 3000
24687
23808
  });
24688
- for (const item of coverIdInfo.data.uploadTempPermits)for (const fileId of item.fileIds)uploadInfos.push({
23809
+ for (const item of coverIdInfo?.data?.uploadTempPermits ?? [])for (const fileId of item?.fileIds ?? [])uploadInfos.push({
24689
23810
  bucket: item.bucket || "",
24690
23811
  uploadAddr: item.uploadAddr || "",
24691
23812
  fileIds: fileId,
@@ -24767,7 +23888,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24767
23888
  retryDelay: 20,
24768
23889
  timeout: 3000
24769
23890
  });
24770
- Object.assign(topic, createTopic.data.topic_infos[0]);
23891
+ Object.assign(topic, createTopic?.data?.topic_infos[0]);
24771
23892
  }
24772
23893
  }));
24773
23894
  const visibleRangeMap = {
@@ -24851,7 +23972,7 @@ const rpaAction_Server_Mock = async (task, params)=>{
24851
23972
  retries: 3,
24852
23973
  retryDelay: 20,
24853
23974
  timeout: 3000
24854
- }).then((userData)=>userData.data?.userDetail?.id));
23975
+ }).then((userData)=>userData?.data?.userDetail?.id));
24855
23976
  const business_binds = {
24856
23977
  version: 1,
24857
23978
  bizType: "",
@@ -24942,9 +24063,10 @@ const rpaAction_Server_Mock = async (task, params)=>{
24942
24063
  retryDelay: 500,
24943
24064
  timeout: 12000
24944
24065
  });
24066
+ task.logger.info(`[xiaohongshuPublish server mock] publishResult: ${JSON.stringify(publishResult)} `);
24945
24067
  const isSuccess = publishResult.success;
24946
24068
  const message = `文章发布${isSuccess ? "成功" : `失败,原因:${publishResult.msg}`}${task.debug ? ` ${http.proxyInfo}` : ""}`;
24947
- const data = isSuccess ? publishResult.data?.id || "" : "";
24069
+ const data = isSuccess ? publishResult?.data?.id || "" : "";
24948
24070
  if (!isSuccess) {
24949
24071
  await updateTaskState?.({
24950
24072
  state: __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.TaskState.FAILED,
@@ -25143,7 +24265,7 @@ const xiaohongshuWebIntimacySearch = async (_task, params)=>{
25143
24265
  timeout: 3000
25144
24266
  });
25145
24267
  const isSuccess = 0 === res.code;
25146
- if (isSuccess) intimacyDetail = res.data.items;
24268
+ if (isSuccess) intimacyDetail = res.data?.items;
25147
24269
  const message = `搜索@列表数据${isSuccess ? "成功" : `失败,原因:${res.msg}`}${_task.debug ? ` ${http.proxyInfo}` : ""}`;
25148
24270
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(isSuccess ? 0 : 414, message, intimacyDetail);
25149
24271
  };
@@ -25325,7 +24447,7 @@ const xiaohongshuWebNoteFeed = async (_task, params)=>{
25325
24447
  timeout: 3000
25326
24448
  });
25327
24449
  _task.logger.info(`API 响应: ${JSON.stringify(res)}`);
25328
- const isSuccess = 0 === res.code && res.data && res.data.items && res.data.items.length > 0;
24450
+ const isSuccess = 0 === res.code && res.data && res.data?.items && res.data?.items.length > 0;
25329
24451
  const message = `获取指定文章详情${isSuccess ? "成功" : `失败,原因:${res.msg || "返回数据为空,可能笔记不存在或参数错误"}`}${_task.debug ? ` ${http.proxyInfo}` : ""}`;
25330
24452
  const data = isSuccess ? res.data?.items[0].note_card || {} : {};
25331
24453
  return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.response)(isSuccess ? 0 : 414, message, data);