@iflyrpa/actions 1.2.24 → 1.2.25-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions/baijiahaoPublish/index.d.ts +8 -0
- package/dist/actions/baijiahaoPublish/utils.d.ts +10 -0
- package/dist/actions/getToutiaoCollection/index.d.ts +40 -0
- package/dist/actions/getWeixinCollection/index.d.ts +32 -0
- package/dist/actions/getXhsCollection/index.d.ts +31 -0
- package/dist/actions/getXhsGroup/index.d.ts +19 -0
- package/dist/actions/getXhsHotTopic/index.d.ts +35 -0
- package/dist/actions/searchBjhTopicList/index.d.ts +12 -0
- package/dist/actions/toutiaoPublish/index.d.ts +4 -0
- package/dist/actions/weixinPublish/index.d.ts +5 -0
- package/dist/actions/weixinPublish/utils.d.ts +6 -0
- package/dist/actions/xiaohongshuPublish/index.d.ts +9 -1
- package/dist/bundle.js +1604 -95
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1630 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1623 -53
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/utils/http.d.ts +9 -3
- package/dist/utils/proxy.d.ts +2 -0
- package/package.json +2 -2
package/dist/bundle.js
CHANGED
|
@@ -1,5 +1,203 @@
|
|
|
1
1
|
/*! For license information please see bundle.js.LICENSE.txt */
|
|
2
2
|
var __webpack_modules__ = {
|
|
3
|
+
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports1, __webpack_require__) {
|
|
4
|
+
"use strict";
|
|
5
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
6
|
+
if (void 0 === k2) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function() {
|
|
11
|
+
return m[k];
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
} : function(o, m, k, k2) {
|
|
16
|
+
if (void 0 === k2) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
});
|
|
19
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
20
|
+
Object.defineProperty(o, "default", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
value: v
|
|
23
|
+
});
|
|
24
|
+
} : function(o, v) {
|
|
25
|
+
o["default"] = v;
|
|
26
|
+
});
|
|
27
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (null != mod) {
|
|
31
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
32
|
+
}
|
|
33
|
+
__setModuleDefault(result, mod);
|
|
34
|
+
return result;
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports1, "__esModule", {
|
|
37
|
+
value: true
|
|
38
|
+
});
|
|
39
|
+
exports1.req = exports1.json = exports1.toBuffer = void 0;
|
|
40
|
+
const http = __importStar(__webpack_require__("http"));
|
|
41
|
+
const https = __importStar(__webpack_require__("https"));
|
|
42
|
+
async function toBuffer(stream) {
|
|
43
|
+
let length = 0;
|
|
44
|
+
const chunks = [];
|
|
45
|
+
for await (const chunk of stream){
|
|
46
|
+
length += chunk.length;
|
|
47
|
+
chunks.push(chunk);
|
|
48
|
+
}
|
|
49
|
+
return Buffer.concat(chunks, length);
|
|
50
|
+
}
|
|
51
|
+
exports1.toBuffer = toBuffer;
|
|
52
|
+
async function json(stream) {
|
|
53
|
+
const buf = await toBuffer(stream);
|
|
54
|
+
const str = buf.toString('utf8');
|
|
55
|
+
try {
|
|
56
|
+
return JSON.parse(str);
|
|
57
|
+
} catch (_err) {
|
|
58
|
+
const err = _err;
|
|
59
|
+
err.message += ` (input: ${str})`;
|
|
60
|
+
throw err;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports1.json = json;
|
|
64
|
+
function req(url, opts = {}) {
|
|
65
|
+
const href = 'string' == typeof url ? url : url.href;
|
|
66
|
+
const req1 = (href.startsWith('https:') ? https : http).request(url, opts);
|
|
67
|
+
const promise = new Promise((resolve, reject)=>{
|
|
68
|
+
req1.once('response', resolve).once('error', reject).end();
|
|
69
|
+
});
|
|
70
|
+
req1.then = promise.then.bind(promise);
|
|
71
|
+
return req1;
|
|
72
|
+
}
|
|
73
|
+
exports1.req = req;
|
|
74
|
+
},
|
|
75
|
+
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js": function(__unused_webpack_module, exports1, __webpack_require__) {
|
|
76
|
+
"use strict";
|
|
77
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
78
|
+
if (void 0 === k2) k2 = k;
|
|
79
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
80
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function() {
|
|
83
|
+
return m[k];
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
Object.defineProperty(o, k2, desc);
|
|
87
|
+
} : function(o, m, k, k2) {
|
|
88
|
+
if (void 0 === k2) k2 = k;
|
|
89
|
+
o[k2] = m[k];
|
|
90
|
+
});
|
|
91
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
92
|
+
Object.defineProperty(o, "default", {
|
|
93
|
+
enumerable: true,
|
|
94
|
+
value: v
|
|
95
|
+
});
|
|
96
|
+
} : function(o, v) {
|
|
97
|
+
o["default"] = v;
|
|
98
|
+
});
|
|
99
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
100
|
+
if (mod && mod.__esModule) return mod;
|
|
101
|
+
var result = {};
|
|
102
|
+
if (null != mod) {
|
|
103
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
104
|
+
}
|
|
105
|
+
__setModuleDefault(result, mod);
|
|
106
|
+
return result;
|
|
107
|
+
};
|
|
108
|
+
var __exportStar = this && this.__exportStar || function(m, exports1) {
|
|
109
|
+
for(var p in m)if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports1, p)) __createBinding(exports1, m, p);
|
|
110
|
+
};
|
|
111
|
+
Object.defineProperty(exports1, "__esModule", {
|
|
112
|
+
value: true
|
|
113
|
+
});
|
|
114
|
+
exports1.Agent = void 0;
|
|
115
|
+
const net = __importStar(__webpack_require__("net"));
|
|
116
|
+
const http = __importStar(__webpack_require__("http"));
|
|
117
|
+
const https_1 = __webpack_require__("https");
|
|
118
|
+
__exportStar(__webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"), exports1);
|
|
119
|
+
const INTERNAL = Symbol('AgentBaseInternalState');
|
|
120
|
+
class Agent extends http.Agent {
|
|
121
|
+
constructor(opts){
|
|
122
|
+
super(opts);
|
|
123
|
+
this[INTERNAL] = {};
|
|
124
|
+
}
|
|
125
|
+
isSecureEndpoint(options) {
|
|
126
|
+
if (options) {
|
|
127
|
+
if ('boolean' == typeof options.secureEndpoint) return options.secureEndpoint;
|
|
128
|
+
if ('string' == typeof options.protocol) return 'https:' === options.protocol;
|
|
129
|
+
}
|
|
130
|
+
const { stack } = new Error();
|
|
131
|
+
if ('string' != typeof stack) return false;
|
|
132
|
+
return stack.split('\n').some((l)=>-1 !== l.indexOf('(https.js:') || -1 !== l.indexOf('node:https:'));
|
|
133
|
+
}
|
|
134
|
+
incrementSockets(name) {
|
|
135
|
+
if (this.maxSockets === 1 / 0 && this.maxTotalSockets === 1 / 0) return null;
|
|
136
|
+
if (!this.sockets[name]) this.sockets[name] = [];
|
|
137
|
+
const fakeSocket = new net.Socket({
|
|
138
|
+
writable: false
|
|
139
|
+
});
|
|
140
|
+
this.sockets[name].push(fakeSocket);
|
|
141
|
+
this.totalSocketCount++;
|
|
142
|
+
return fakeSocket;
|
|
143
|
+
}
|
|
144
|
+
decrementSockets(name, socket) {
|
|
145
|
+
if (!this.sockets[name] || null === socket) return;
|
|
146
|
+
const sockets = this.sockets[name];
|
|
147
|
+
const index = sockets.indexOf(socket);
|
|
148
|
+
if (-1 !== index) {
|
|
149
|
+
sockets.splice(index, 1);
|
|
150
|
+
this.totalSocketCount--;
|
|
151
|
+
if (0 === sockets.length) delete this.sockets[name];
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
getName(options) {
|
|
155
|
+
const secureEndpoint = this.isSecureEndpoint(options);
|
|
156
|
+
if (secureEndpoint) return https_1.Agent.prototype.getName.call(this, options);
|
|
157
|
+
return super.getName(options);
|
|
158
|
+
}
|
|
159
|
+
createSocket(req, options, cb) {
|
|
160
|
+
const connectOpts = {
|
|
161
|
+
...options,
|
|
162
|
+
secureEndpoint: this.isSecureEndpoint(options)
|
|
163
|
+
};
|
|
164
|
+
const name = this.getName(connectOpts);
|
|
165
|
+
const fakeSocket = this.incrementSockets(name);
|
|
166
|
+
Promise.resolve().then(()=>this.connect(req, connectOpts)).then((socket)=>{
|
|
167
|
+
this.decrementSockets(name, fakeSocket);
|
|
168
|
+
if (socket instanceof http.Agent) try {
|
|
169
|
+
return socket.addRequest(req, connectOpts);
|
|
170
|
+
} catch (err) {
|
|
171
|
+
return cb(err);
|
|
172
|
+
}
|
|
173
|
+
this[INTERNAL].currentSocket = socket;
|
|
174
|
+
super.createSocket(req, options, cb);
|
|
175
|
+
}, (err)=>{
|
|
176
|
+
this.decrementSockets(name, fakeSocket);
|
|
177
|
+
cb(err);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
createConnection() {
|
|
181
|
+
const socket = this[INTERNAL].currentSocket;
|
|
182
|
+
this[INTERNAL].currentSocket = void 0;
|
|
183
|
+
if (!socket) throw new Error('No socket was returned in the `connect()` function');
|
|
184
|
+
return socket;
|
|
185
|
+
}
|
|
186
|
+
get defaultPort() {
|
|
187
|
+
return this[INTERNAL].defaultPort ?? ('https:' === this.protocol ? 443 : 80);
|
|
188
|
+
}
|
|
189
|
+
set defaultPort(v) {
|
|
190
|
+
if (this[INTERNAL]) this[INTERNAL].defaultPort = v;
|
|
191
|
+
}
|
|
192
|
+
get protocol() {
|
|
193
|
+
return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');
|
|
194
|
+
}
|
|
195
|
+
set protocol(v) {
|
|
196
|
+
if (this[INTERNAL]) this[INTERNAL].protocol = v;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
exports1.Agent = Agent;
|
|
200
|
+
},
|
|
3
201
|
"../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
4
202
|
module.exports = {
|
|
5
203
|
parallel: __webpack_require__("../../node_modules/.pnpm/asynckit@0.4.0/node_modules/asynckit/parallel.js"),
|
|
@@ -292,12 +490,439 @@ var __webpack_modules__ = {
|
|
|
292
490
|
});
|
|
293
491
|
if (this._currentStream && this._currentStream.dataSize) this.dataSize += this._currentStream.dataSize;
|
|
294
492
|
};
|
|
295
|
-
CombinedStream.prototype._emitError = function(err) {
|
|
296
|
-
this._reset();
|
|
297
|
-
this.emit('error', err);
|
|
493
|
+
CombinedStream.prototype._emitError = function(err) {
|
|
494
|
+
this._reset();
|
|
495
|
+
this.emit('error', err);
|
|
496
|
+
};
|
|
497
|
+
},
|
|
498
|
+
"../../node_modules/.pnpm/debug@4.3.6/node_modules/debug/src/browser.js": function(module, exports1, __webpack_require__) {
|
|
499
|
+
exports1.formatArgs = formatArgs;
|
|
500
|
+
exports1.save = save;
|
|
501
|
+
exports1.load = load;
|
|
502
|
+
exports1.useColors = useColors;
|
|
503
|
+
exports1.storage = localstorage();
|
|
504
|
+
exports1.destroy = (()=>{
|
|
505
|
+
let warned = false;
|
|
506
|
+
return ()=>{
|
|
507
|
+
if (!warned) {
|
|
508
|
+
warned = true;
|
|
509
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
510
|
+
}
|
|
511
|
+
};
|
|
512
|
+
})();
|
|
513
|
+
exports1.colors = [
|
|
514
|
+
'#0000CC',
|
|
515
|
+
'#0000FF',
|
|
516
|
+
'#0033CC',
|
|
517
|
+
'#0033FF',
|
|
518
|
+
'#0066CC',
|
|
519
|
+
'#0066FF',
|
|
520
|
+
'#0099CC',
|
|
521
|
+
'#0099FF',
|
|
522
|
+
'#00CC00',
|
|
523
|
+
'#00CC33',
|
|
524
|
+
'#00CC66',
|
|
525
|
+
'#00CC99',
|
|
526
|
+
'#00CCCC',
|
|
527
|
+
'#00CCFF',
|
|
528
|
+
'#3300CC',
|
|
529
|
+
'#3300FF',
|
|
530
|
+
'#3333CC',
|
|
531
|
+
'#3333FF',
|
|
532
|
+
'#3366CC',
|
|
533
|
+
'#3366FF',
|
|
534
|
+
'#3399CC',
|
|
535
|
+
'#3399FF',
|
|
536
|
+
'#33CC00',
|
|
537
|
+
'#33CC33',
|
|
538
|
+
'#33CC66',
|
|
539
|
+
'#33CC99',
|
|
540
|
+
'#33CCCC',
|
|
541
|
+
'#33CCFF',
|
|
542
|
+
'#6600CC',
|
|
543
|
+
'#6600FF',
|
|
544
|
+
'#6633CC',
|
|
545
|
+
'#6633FF',
|
|
546
|
+
'#66CC00',
|
|
547
|
+
'#66CC33',
|
|
548
|
+
'#9900CC',
|
|
549
|
+
'#9900FF',
|
|
550
|
+
'#9933CC',
|
|
551
|
+
'#9933FF',
|
|
552
|
+
'#99CC00',
|
|
553
|
+
'#99CC33',
|
|
554
|
+
'#CC0000',
|
|
555
|
+
'#CC0033',
|
|
556
|
+
'#CC0066',
|
|
557
|
+
'#CC0099',
|
|
558
|
+
'#CC00CC',
|
|
559
|
+
'#CC00FF',
|
|
560
|
+
'#CC3300',
|
|
561
|
+
'#CC3333',
|
|
562
|
+
'#CC3366',
|
|
563
|
+
'#CC3399',
|
|
564
|
+
'#CC33CC',
|
|
565
|
+
'#CC33FF',
|
|
566
|
+
'#CC6600',
|
|
567
|
+
'#CC6633',
|
|
568
|
+
'#CC9900',
|
|
569
|
+
'#CC9933',
|
|
570
|
+
'#CCCC00',
|
|
571
|
+
'#CCCC33',
|
|
572
|
+
'#FF0000',
|
|
573
|
+
'#FF0033',
|
|
574
|
+
'#FF0066',
|
|
575
|
+
'#FF0099',
|
|
576
|
+
'#FF00CC',
|
|
577
|
+
'#FF00FF',
|
|
578
|
+
'#FF3300',
|
|
579
|
+
'#FF3333',
|
|
580
|
+
'#FF3366',
|
|
581
|
+
'#FF3399',
|
|
582
|
+
'#FF33CC',
|
|
583
|
+
'#FF33FF',
|
|
584
|
+
'#FF6600',
|
|
585
|
+
'#FF6633',
|
|
586
|
+
'#FF9900',
|
|
587
|
+
'#FF9933',
|
|
588
|
+
'#FFCC00',
|
|
589
|
+
'#FFCC33'
|
|
590
|
+
];
|
|
591
|
+
function useColors() {
|
|
592
|
+
if ('undefined' != typeof window && window.process && ('renderer' === window.process.type || window.process.__nwjs)) return true;
|
|
593
|
+
if ('undefined' != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return false;
|
|
594
|
+
let m;
|
|
595
|
+
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+)/);
|
|
596
|
+
}
|
|
597
|
+
function formatArgs(args) {
|
|
598
|
+
args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
|
599
|
+
if (!this.useColors) return;
|
|
600
|
+
const c = 'color: ' + this.color;
|
|
601
|
+
args.splice(1, 0, c, 'color: inherit');
|
|
602
|
+
let index = 0;
|
|
603
|
+
let lastC = 0;
|
|
604
|
+
args[0].replace(/%[a-zA-Z%]/g, (match)=>{
|
|
605
|
+
if ('%%' === match) return;
|
|
606
|
+
index++;
|
|
607
|
+
if ('%c' === match) lastC = index;
|
|
608
|
+
});
|
|
609
|
+
args.splice(lastC, 0, c);
|
|
610
|
+
}
|
|
611
|
+
exports1.log = console.debug || console.log || (()=>{});
|
|
612
|
+
function save(namespaces) {
|
|
613
|
+
try {
|
|
614
|
+
if (namespaces) exports1.storage.setItem('debug', namespaces);
|
|
615
|
+
else exports1.storage.removeItem('debug');
|
|
616
|
+
} catch (error) {}
|
|
617
|
+
}
|
|
618
|
+
function load() {
|
|
619
|
+
let r;
|
|
620
|
+
try {
|
|
621
|
+
r = exports1.storage.getItem('debug');
|
|
622
|
+
} catch (error) {}
|
|
623
|
+
if (!r && 'undefined' != typeof process && 'env' in process) r = process.env.DEBUG;
|
|
624
|
+
return r;
|
|
625
|
+
}
|
|
626
|
+
function localstorage() {
|
|
627
|
+
try {
|
|
628
|
+
return localStorage;
|
|
629
|
+
} catch (error) {}
|
|
630
|
+
}
|
|
631
|
+
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.3.6/node_modules/debug/src/common.js")(exports1);
|
|
632
|
+
const { formatters } = module.exports;
|
|
633
|
+
formatters.j = function(v) {
|
|
634
|
+
try {
|
|
635
|
+
return JSON.stringify(v);
|
|
636
|
+
} catch (error) {
|
|
637
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
638
|
+
}
|
|
639
|
+
};
|
|
640
|
+
},
|
|
641
|
+
"../../node_modules/.pnpm/debug@4.3.6/node_modules/debug/src/common.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
642
|
+
function setup(env) {
|
|
643
|
+
createDebug.debug = createDebug;
|
|
644
|
+
createDebug.default = createDebug;
|
|
645
|
+
createDebug.coerce = coerce;
|
|
646
|
+
createDebug.disable = disable;
|
|
647
|
+
createDebug.enable = enable;
|
|
648
|
+
createDebug.enabled = enabled;
|
|
649
|
+
createDebug.humanize = __webpack_require__("../../node_modules/.pnpm/ms@2.1.2/node_modules/ms/index.js");
|
|
650
|
+
createDebug.destroy = destroy;
|
|
651
|
+
Object.keys(env).forEach((key)=>{
|
|
652
|
+
createDebug[key] = env[key];
|
|
653
|
+
});
|
|
654
|
+
createDebug.names = [];
|
|
655
|
+
createDebug.skips = [];
|
|
656
|
+
createDebug.formatters = {};
|
|
657
|
+
function selectColor(namespace) {
|
|
658
|
+
let hash = 0;
|
|
659
|
+
for(let i = 0; i < namespace.length; i++){
|
|
660
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
661
|
+
hash |= 0;
|
|
662
|
+
}
|
|
663
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
664
|
+
}
|
|
665
|
+
createDebug.selectColor = selectColor;
|
|
666
|
+
function createDebug(namespace) {
|
|
667
|
+
let prevTime;
|
|
668
|
+
let enableOverride = null;
|
|
669
|
+
let namespacesCache;
|
|
670
|
+
let enabledCache;
|
|
671
|
+
function debug(...args) {
|
|
672
|
+
if (!debug.enabled) return;
|
|
673
|
+
const self1 = debug;
|
|
674
|
+
const curr = Number(new Date());
|
|
675
|
+
const ms = curr - (prevTime || curr);
|
|
676
|
+
self1.diff = ms;
|
|
677
|
+
self1.prev = prevTime;
|
|
678
|
+
self1.curr = curr;
|
|
679
|
+
prevTime = curr;
|
|
680
|
+
args[0] = createDebug.coerce(args[0]);
|
|
681
|
+
if ('string' != typeof args[0]) args.unshift('%O');
|
|
682
|
+
let index = 0;
|
|
683
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format)=>{
|
|
684
|
+
if ('%%' === match) return '%';
|
|
685
|
+
index++;
|
|
686
|
+
const formatter = createDebug.formatters[format];
|
|
687
|
+
if ('function' == typeof formatter) {
|
|
688
|
+
const val = args[index];
|
|
689
|
+
match = formatter.call(self1, val);
|
|
690
|
+
args.splice(index, 1);
|
|
691
|
+
index--;
|
|
692
|
+
}
|
|
693
|
+
return match;
|
|
694
|
+
});
|
|
695
|
+
createDebug.formatArgs.call(self1, args);
|
|
696
|
+
const logFn = self1.log || createDebug.log;
|
|
697
|
+
logFn.apply(self1, args);
|
|
698
|
+
}
|
|
699
|
+
debug.namespace = namespace;
|
|
700
|
+
debug.useColors = createDebug.useColors();
|
|
701
|
+
debug.color = createDebug.selectColor(namespace);
|
|
702
|
+
debug.extend = extend;
|
|
703
|
+
debug.destroy = createDebug.destroy;
|
|
704
|
+
Object.defineProperty(debug, 'enabled', {
|
|
705
|
+
enumerable: true,
|
|
706
|
+
configurable: false,
|
|
707
|
+
get: ()=>{
|
|
708
|
+
if (null !== enableOverride) return enableOverride;
|
|
709
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
710
|
+
namespacesCache = createDebug.namespaces;
|
|
711
|
+
enabledCache = createDebug.enabled(namespace);
|
|
712
|
+
}
|
|
713
|
+
return enabledCache;
|
|
714
|
+
},
|
|
715
|
+
set: (v)=>{
|
|
716
|
+
enableOverride = v;
|
|
717
|
+
}
|
|
718
|
+
});
|
|
719
|
+
if ('function' == typeof createDebug.init) createDebug.init(debug);
|
|
720
|
+
return debug;
|
|
721
|
+
}
|
|
722
|
+
function extend(namespace, delimiter) {
|
|
723
|
+
const newDebug = createDebug(this.namespace + (void 0 === delimiter ? ':' : delimiter) + namespace);
|
|
724
|
+
newDebug.log = this.log;
|
|
725
|
+
return newDebug;
|
|
726
|
+
}
|
|
727
|
+
function enable(namespaces) {
|
|
728
|
+
createDebug.save(namespaces);
|
|
729
|
+
createDebug.namespaces = namespaces;
|
|
730
|
+
createDebug.names = [];
|
|
731
|
+
createDebug.skips = [];
|
|
732
|
+
let i;
|
|
733
|
+
const split = ('string' == typeof namespaces ? namespaces : '').split(/[\s,]+/);
|
|
734
|
+
const len = split.length;
|
|
735
|
+
for(i = 0; i < len; i++)if (!!split[i]) {
|
|
736
|
+
namespaces = split[i].replace(/\*/g, '.*?');
|
|
737
|
+
if ('-' === namespaces[0]) createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
|
|
738
|
+
else createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
function disable() {
|
|
742
|
+
const namespaces = [
|
|
743
|
+
...createDebug.names.map(toNamespace),
|
|
744
|
+
...createDebug.skips.map(toNamespace).map((namespace)=>'-' + namespace)
|
|
745
|
+
].join(',');
|
|
746
|
+
createDebug.enable('');
|
|
747
|
+
return namespaces;
|
|
748
|
+
}
|
|
749
|
+
function enabled(name) {
|
|
750
|
+
if ('*' === name[name.length - 1]) return true;
|
|
751
|
+
let i;
|
|
752
|
+
let len;
|
|
753
|
+
for(i = 0, len = createDebug.skips.length; i < len; i++)if (createDebug.skips[i].test(name)) return false;
|
|
754
|
+
for(i = 0, len = createDebug.names.length; i < len; i++)if (createDebug.names[i].test(name)) return true;
|
|
755
|
+
return false;
|
|
756
|
+
}
|
|
757
|
+
function toNamespace(regexp) {
|
|
758
|
+
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
|
|
759
|
+
}
|
|
760
|
+
function coerce(val) {
|
|
761
|
+
if (val instanceof Error) return val.stack || val.message;
|
|
762
|
+
return val;
|
|
763
|
+
}
|
|
764
|
+
function destroy() {
|
|
765
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
766
|
+
}
|
|
767
|
+
createDebug.enable(createDebug.load());
|
|
768
|
+
return createDebug;
|
|
769
|
+
}
|
|
770
|
+
module.exports = setup;
|
|
771
|
+
},
|
|
772
|
+
"../../node_modules/.pnpm/debug@4.3.6/node_modules/debug/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
773
|
+
if ('undefined' == typeof process || 'renderer' === process.type || true === process.browser || process.__nwjs) module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.3.6/node_modules/debug/src/browser.js");
|
|
774
|
+
else module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.3.6/node_modules/debug/src/node.js");
|
|
775
|
+
},
|
|
776
|
+
"../../node_modules/.pnpm/debug@4.3.6/node_modules/debug/src/node.js": function(module, exports1, __webpack_require__) {
|
|
777
|
+
const tty = __webpack_require__("tty");
|
|
778
|
+
const util = __webpack_require__("util");
|
|
779
|
+
exports1.init = init;
|
|
780
|
+
exports1.log = log;
|
|
781
|
+
exports1.formatArgs = formatArgs;
|
|
782
|
+
exports1.save = save;
|
|
783
|
+
exports1.load = load;
|
|
784
|
+
exports1.useColors = useColors;
|
|
785
|
+
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`.');
|
|
786
|
+
exports1.colors = [
|
|
787
|
+
6,
|
|
788
|
+
2,
|
|
789
|
+
3,
|
|
790
|
+
4,
|
|
791
|
+
5,
|
|
792
|
+
1
|
|
793
|
+
];
|
|
794
|
+
try {
|
|
795
|
+
const supportsColor = __webpack_require__("../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js");
|
|
796
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports1.colors = [
|
|
797
|
+
20,
|
|
798
|
+
21,
|
|
799
|
+
26,
|
|
800
|
+
27,
|
|
801
|
+
32,
|
|
802
|
+
33,
|
|
803
|
+
38,
|
|
804
|
+
39,
|
|
805
|
+
40,
|
|
806
|
+
41,
|
|
807
|
+
42,
|
|
808
|
+
43,
|
|
809
|
+
44,
|
|
810
|
+
45,
|
|
811
|
+
56,
|
|
812
|
+
57,
|
|
813
|
+
62,
|
|
814
|
+
63,
|
|
815
|
+
68,
|
|
816
|
+
69,
|
|
817
|
+
74,
|
|
818
|
+
75,
|
|
819
|
+
76,
|
|
820
|
+
77,
|
|
821
|
+
78,
|
|
822
|
+
79,
|
|
823
|
+
80,
|
|
824
|
+
81,
|
|
825
|
+
92,
|
|
826
|
+
93,
|
|
827
|
+
98,
|
|
828
|
+
99,
|
|
829
|
+
112,
|
|
830
|
+
113,
|
|
831
|
+
128,
|
|
832
|
+
129,
|
|
833
|
+
134,
|
|
834
|
+
135,
|
|
835
|
+
148,
|
|
836
|
+
149,
|
|
837
|
+
160,
|
|
838
|
+
161,
|
|
839
|
+
162,
|
|
840
|
+
163,
|
|
841
|
+
164,
|
|
842
|
+
165,
|
|
843
|
+
166,
|
|
844
|
+
167,
|
|
845
|
+
168,
|
|
846
|
+
169,
|
|
847
|
+
170,
|
|
848
|
+
171,
|
|
849
|
+
172,
|
|
850
|
+
173,
|
|
851
|
+
178,
|
|
852
|
+
179,
|
|
853
|
+
184,
|
|
854
|
+
185,
|
|
855
|
+
196,
|
|
856
|
+
197,
|
|
857
|
+
198,
|
|
858
|
+
199,
|
|
859
|
+
200,
|
|
860
|
+
201,
|
|
861
|
+
202,
|
|
862
|
+
203,
|
|
863
|
+
204,
|
|
864
|
+
205,
|
|
865
|
+
206,
|
|
866
|
+
207,
|
|
867
|
+
208,
|
|
868
|
+
209,
|
|
869
|
+
214,
|
|
870
|
+
215,
|
|
871
|
+
220,
|
|
872
|
+
221
|
|
873
|
+
];
|
|
874
|
+
} catch (error) {}
|
|
875
|
+
exports1.inspectOpts = Object.keys(process.env).filter((key)=>/^debug_/i.test(key)).reduce((obj, key)=>{
|
|
876
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k)=>k.toUpperCase());
|
|
877
|
+
let val = process.env[key];
|
|
878
|
+
val = /^(yes|on|true|enabled)$/i.test(val) ? true : /^(no|off|false|disabled)$/i.test(val) ? false : 'null' === val ? null : Number(val);
|
|
879
|
+
obj[prop] = val;
|
|
880
|
+
return obj;
|
|
881
|
+
}, {});
|
|
882
|
+
function useColors() {
|
|
883
|
+
return 'colors' in exports1.inspectOpts ? Boolean(exports1.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
884
|
+
}
|
|
885
|
+
function formatArgs(args) {
|
|
886
|
+
const { namespace: name, useColors } = this;
|
|
887
|
+
if (useColors) {
|
|
888
|
+
const c = this.color;
|
|
889
|
+
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
890
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
891
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
892
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
893
|
+
} else args[0] = getDate() + name + ' ' + args[0];
|
|
894
|
+
}
|
|
895
|
+
function getDate() {
|
|
896
|
+
if (exports1.inspectOpts.hideDate) return '';
|
|
897
|
+
return new Date().toISOString() + ' ';
|
|
898
|
+
}
|
|
899
|
+
function log(...args) {
|
|
900
|
+
return process.stderr.write(util.formatWithOptions(exports1.inspectOpts, ...args) + '\n');
|
|
901
|
+
}
|
|
902
|
+
function save(namespaces) {
|
|
903
|
+
if (namespaces) process.env.DEBUG = namespaces;
|
|
904
|
+
else delete process.env.DEBUG;
|
|
905
|
+
}
|
|
906
|
+
function load() {
|
|
907
|
+
return process.env.DEBUG;
|
|
908
|
+
}
|
|
909
|
+
function init(debug) {
|
|
910
|
+
debug.inspectOpts = {};
|
|
911
|
+
const keys = Object.keys(exports1.inspectOpts);
|
|
912
|
+
for(let i = 0; i < keys.length; i++)debug.inspectOpts[keys[i]] = exports1.inspectOpts[keys[i]];
|
|
913
|
+
}
|
|
914
|
+
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.3.6/node_modules/debug/src/common.js")(exports1);
|
|
915
|
+
const { formatters } = module.exports;
|
|
916
|
+
formatters.o = function(v) {
|
|
917
|
+
this.inspectOpts.colors = this.useColors;
|
|
918
|
+
return util.inspect(v, this.inspectOpts).split('\n').map((str)=>str.trim()).join(' ');
|
|
919
|
+
};
|
|
920
|
+
formatters.O = function(v) {
|
|
921
|
+
this.inspectOpts.colors = this.useColors;
|
|
922
|
+
return util.inspect(v, this.inspectOpts);
|
|
298
923
|
};
|
|
299
924
|
},
|
|
300
|
-
"../../node_modules/.pnpm/debug@4.
|
|
925
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js": function(module, exports1, __webpack_require__) {
|
|
301
926
|
exports1.formatArgs = formatArgs;
|
|
302
927
|
exports1.save = save;
|
|
303
928
|
exports1.load = load;
|
|
@@ -430,7 +1055,7 @@ var __webpack_modules__ = {
|
|
|
430
1055
|
return localStorage;
|
|
431
1056
|
} catch (error) {}
|
|
432
1057
|
}
|
|
433
|
-
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.
|
|
1058
|
+
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports1);
|
|
434
1059
|
const { formatters } = module.exports;
|
|
435
1060
|
formatters.j = function(v) {
|
|
436
1061
|
try {
|
|
@@ -440,7 +1065,7 @@ var __webpack_modules__ = {
|
|
|
440
1065
|
}
|
|
441
1066
|
};
|
|
442
1067
|
},
|
|
443
|
-
"../../node_modules/.pnpm/debug@4.
|
|
1068
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
444
1069
|
function setup(env) {
|
|
445
1070
|
createDebug.debug = createDebug;
|
|
446
1071
|
createDebug.default = createDebug;
|
|
@@ -448,7 +1073,7 @@ var __webpack_modules__ = {
|
|
|
448
1073
|
createDebug.disable = disable;
|
|
449
1074
|
createDebug.enable = enable;
|
|
450
1075
|
createDebug.enabled = enabled;
|
|
451
|
-
createDebug.humanize = __webpack_require__("../../node_modules/.pnpm/ms@2.1.
|
|
1076
|
+
createDebug.humanize = __webpack_require__("../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js");
|
|
452
1077
|
createDebug.destroy = destroy;
|
|
453
1078
|
Object.keys(env).forEach((key)=>{
|
|
454
1079
|
createDebug[key] = env[key];
|
|
@@ -531,34 +1156,46 @@ var __webpack_modules__ = {
|
|
|
531
1156
|
createDebug.namespaces = namespaces;
|
|
532
1157
|
createDebug.names = [];
|
|
533
1158
|
createDebug.skips = [];
|
|
534
|
-
|
|
535
|
-
const split
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
1159
|
+
const split = ('string' == typeof namespaces ? namespaces : '').trim().replace(' ', ',').split(',').filter(Boolean);
|
|
1160
|
+
for (const ns of split)if ('-' === ns[0]) createDebug.skips.push(ns.slice(1));
|
|
1161
|
+
else createDebug.names.push(ns);
|
|
1162
|
+
}
|
|
1163
|
+
function matchesTemplate(search, template) {
|
|
1164
|
+
let searchIndex = 0;
|
|
1165
|
+
let templateIndex = 0;
|
|
1166
|
+
let starIndex = -1;
|
|
1167
|
+
let matchIndex = 0;
|
|
1168
|
+
while(searchIndex < search.length)if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || '*' === template[templateIndex])) {
|
|
1169
|
+
if ('*' === template[templateIndex]) {
|
|
1170
|
+
starIndex = templateIndex;
|
|
1171
|
+
matchIndex = searchIndex;
|
|
1172
|
+
templateIndex++;
|
|
1173
|
+
} else {
|
|
1174
|
+
searchIndex++;
|
|
1175
|
+
templateIndex++;
|
|
1176
|
+
}
|
|
1177
|
+
} else {
|
|
1178
|
+
if (-1 === starIndex) return false;
|
|
1179
|
+
templateIndex = starIndex + 1;
|
|
1180
|
+
matchIndex++;
|
|
1181
|
+
searchIndex = matchIndex;
|
|
541
1182
|
}
|
|
1183
|
+
while(templateIndex < template.length && '*' === template[templateIndex])templateIndex++;
|
|
1184
|
+
return templateIndex === template.length;
|
|
542
1185
|
}
|
|
543
1186
|
function disable() {
|
|
544
1187
|
const namespaces = [
|
|
545
|
-
...createDebug.names
|
|
546
|
-
...createDebug.skips.map(
|
|
1188
|
+
...createDebug.names,
|
|
1189
|
+
...createDebug.skips.map((namespace)=>'-' + namespace)
|
|
547
1190
|
].join(',');
|
|
548
1191
|
createDebug.enable('');
|
|
549
1192
|
return namespaces;
|
|
550
1193
|
}
|
|
551
1194
|
function enabled(name) {
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
let len;
|
|
555
|
-
for(i = 0, len = createDebug.skips.length; i < len; i++)if (createDebug.skips[i].test(name)) return false;
|
|
556
|
-
for(i = 0, len = createDebug.names.length; i < len; i++)if (createDebug.names[i].test(name)) return true;
|
|
1195
|
+
for (const skip of createDebug.skips)if (matchesTemplate(name, skip)) return false;
|
|
1196
|
+
for (const ns of createDebug.names)if (matchesTemplate(name, ns)) return true;
|
|
557
1197
|
return false;
|
|
558
1198
|
}
|
|
559
|
-
function toNamespace(regexp) {
|
|
560
|
-
return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
|
|
561
|
-
}
|
|
562
1199
|
function coerce(val) {
|
|
563
1200
|
if (val instanceof Error) return val.stack || val.message;
|
|
564
1201
|
return val;
|
|
@@ -571,11 +1208,11 @@ var __webpack_modules__ = {
|
|
|
571
1208
|
}
|
|
572
1209
|
module.exports = setup;
|
|
573
1210
|
},
|
|
574
|
-
"../../node_modules/.pnpm/debug@4.
|
|
575
|
-
if ('undefined' == typeof process || 'renderer' === process.type || true === process.browser || process.__nwjs) module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.
|
|
576
|
-
else module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.
|
|
1211
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1212
|
+
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");
|
|
1213
|
+
else module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js");
|
|
577
1214
|
},
|
|
578
|
-
"../../node_modules/.pnpm/debug@4.
|
|
1215
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js": function(module, exports1, __webpack_require__) {
|
|
579
1216
|
const tty = __webpack_require__("tty");
|
|
580
1217
|
const util = __webpack_require__("util");
|
|
581
1218
|
exports1.init = init;
|
|
@@ -713,7 +1350,7 @@ var __webpack_modules__ = {
|
|
|
713
1350
|
const keys = Object.keys(exports1.inspectOpts);
|
|
714
1351
|
for(let i = 0; i < keys.length; i++)debug.inspectOpts[keys[i]] = exports1.inspectOpts[keys[i]];
|
|
715
1352
|
}
|
|
716
|
-
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.
|
|
1353
|
+
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports1);
|
|
717
1354
|
const { formatters } = module.exports;
|
|
718
1355
|
formatters.o = function(v) {
|
|
719
1356
|
this.inspectOpts.colors = this.useColors;
|
|
@@ -1514,6 +2151,243 @@ var __webpack_modules__ = {
|
|
|
1514
2151
|
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
1515
2152
|
};
|
|
1516
2153
|
},
|
|
2154
|
+
"../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js": function(__unused_webpack_module, exports1, __webpack_require__) {
|
|
2155
|
+
"use strict";
|
|
2156
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
2157
|
+
if (void 0 === k2) k2 = k;
|
|
2158
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2159
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
2160
|
+
enumerable: true,
|
|
2161
|
+
get: function() {
|
|
2162
|
+
return m[k];
|
|
2163
|
+
}
|
|
2164
|
+
};
|
|
2165
|
+
Object.defineProperty(o, k2, desc);
|
|
2166
|
+
} : function(o, m, k, k2) {
|
|
2167
|
+
if (void 0 === k2) k2 = k;
|
|
2168
|
+
o[k2] = m[k];
|
|
2169
|
+
});
|
|
2170
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
2171
|
+
Object.defineProperty(o, "default", {
|
|
2172
|
+
enumerable: true,
|
|
2173
|
+
value: v
|
|
2174
|
+
});
|
|
2175
|
+
} : function(o, v) {
|
|
2176
|
+
o["default"] = v;
|
|
2177
|
+
});
|
|
2178
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
2179
|
+
if (mod && mod.__esModule) return mod;
|
|
2180
|
+
var result = {};
|
|
2181
|
+
if (null != mod) {
|
|
2182
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
2183
|
+
}
|
|
2184
|
+
__setModuleDefault(result, mod);
|
|
2185
|
+
return result;
|
|
2186
|
+
};
|
|
2187
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
2188
|
+
return mod && mod.__esModule ? mod : {
|
|
2189
|
+
default: mod
|
|
2190
|
+
};
|
|
2191
|
+
};
|
|
2192
|
+
Object.defineProperty(exports1, "__esModule", {
|
|
2193
|
+
value: true
|
|
2194
|
+
});
|
|
2195
|
+
exports1.HttpsProxyAgent = void 0;
|
|
2196
|
+
const net = __importStar(__webpack_require__("net"));
|
|
2197
|
+
const tls = __importStar(__webpack_require__("tls"));
|
|
2198
|
+
const assert_1 = __importDefault(__webpack_require__("assert"));
|
|
2199
|
+
const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
|
|
2200
|
+
const agent_base_1 = __webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js");
|
|
2201
|
+
const url_1 = __webpack_require__("url");
|
|
2202
|
+
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");
|
|
2203
|
+
const debug = (0, debug_1.default)('https-proxy-agent');
|
|
2204
|
+
const setServernameFromNonIpHost = (options)=>{
|
|
2205
|
+
if (void 0 === options.servername && options.host && !net.isIP(options.host)) return {
|
|
2206
|
+
...options,
|
|
2207
|
+
servername: options.host
|
|
2208
|
+
};
|
|
2209
|
+
return options;
|
|
2210
|
+
};
|
|
2211
|
+
class HttpsProxyAgent extends agent_base_1.Agent {
|
|
2212
|
+
constructor(proxy, opts){
|
|
2213
|
+
super(opts);
|
|
2214
|
+
this.options = {
|
|
2215
|
+
path: void 0
|
|
2216
|
+
};
|
|
2217
|
+
this.proxy = 'string' == typeof proxy ? new url_1.URL(proxy) : proxy;
|
|
2218
|
+
this.proxyHeaders = opts?.headers ?? {};
|
|
2219
|
+
debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
|
|
2220
|
+
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
|
|
2221
|
+
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : 'https:' === this.proxy.protocol ? 443 : 80;
|
|
2222
|
+
this.connectOpts = {
|
|
2223
|
+
ALPNProtocols: [
|
|
2224
|
+
'http/1.1'
|
|
2225
|
+
],
|
|
2226
|
+
...opts ? omit(opts, 'headers') : null,
|
|
2227
|
+
host,
|
|
2228
|
+
port
|
|
2229
|
+
};
|
|
2230
|
+
}
|
|
2231
|
+
async connect(req, opts) {
|
|
2232
|
+
const { proxy } = this;
|
|
2233
|
+
if (!opts.host) throw new TypeError('No "host" provided');
|
|
2234
|
+
let socket;
|
|
2235
|
+
if ('https:' === proxy.protocol) {
|
|
2236
|
+
debug('Creating `tls.Socket`: %o', this.connectOpts);
|
|
2237
|
+
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
2238
|
+
} else {
|
|
2239
|
+
debug('Creating `net.Socket`: %o', this.connectOpts);
|
|
2240
|
+
socket = net.connect(this.connectOpts);
|
|
2241
|
+
}
|
|
2242
|
+
const headers = 'function' == typeof this.proxyHeaders ? this.proxyHeaders() : {
|
|
2243
|
+
...this.proxyHeaders
|
|
2244
|
+
};
|
|
2245
|
+
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
2246
|
+
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
|
|
2247
|
+
if (proxy.username || proxy.password) {
|
|
2248
|
+
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
|
2249
|
+
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;
|
|
2250
|
+
}
|
|
2251
|
+
headers.Host = `${host}:${opts.port}`;
|
|
2252
|
+
if (!headers['Proxy-Connection']) headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close';
|
|
2253
|
+
for (const name of Object.keys(headers))payload += `${name}: ${headers[name]}\r\n`;
|
|
2254
|
+
const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
|
|
2255
|
+
socket.write(`${payload}\r\n`);
|
|
2256
|
+
const { connect, buffered } = await proxyResponsePromise;
|
|
2257
|
+
req.emit('proxyConnect', connect);
|
|
2258
|
+
this.emit('proxyConnect', connect, req);
|
|
2259
|
+
if (200 === connect.statusCode) {
|
|
2260
|
+
req.once('socket', resume);
|
|
2261
|
+
if (opts.secureEndpoint) {
|
|
2262
|
+
debug('Upgrading socket connection to TLS');
|
|
2263
|
+
return tls.connect({
|
|
2264
|
+
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
|
|
2265
|
+
socket
|
|
2266
|
+
});
|
|
2267
|
+
}
|
|
2268
|
+
return socket;
|
|
2269
|
+
}
|
|
2270
|
+
socket.destroy();
|
|
2271
|
+
const fakeSocket = new net.Socket({
|
|
2272
|
+
writable: false
|
|
2273
|
+
});
|
|
2274
|
+
fakeSocket.readable = true;
|
|
2275
|
+
req.once('socket', (s)=>{
|
|
2276
|
+
debug('Replaying proxy buffer for failed request');
|
|
2277
|
+
(0, assert_1.default)(s.listenerCount('data') > 0);
|
|
2278
|
+
s.push(buffered);
|
|
2279
|
+
s.push(null);
|
|
2280
|
+
});
|
|
2281
|
+
return fakeSocket;
|
|
2282
|
+
}
|
|
2283
|
+
}
|
|
2284
|
+
HttpsProxyAgent.protocols = [
|
|
2285
|
+
'http',
|
|
2286
|
+
'https'
|
|
2287
|
+
];
|
|
2288
|
+
exports1.HttpsProxyAgent = HttpsProxyAgent;
|
|
2289
|
+
function resume(socket) {
|
|
2290
|
+
socket.resume();
|
|
2291
|
+
}
|
|
2292
|
+
function omit(obj, ...keys) {
|
|
2293
|
+
const ret = {};
|
|
2294
|
+
let key;
|
|
2295
|
+
for(key in obj)if (!keys.includes(key)) ret[key] = obj[key];
|
|
2296
|
+
return ret;
|
|
2297
|
+
}
|
|
2298
|
+
},
|
|
2299
|
+
"../../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__) {
|
|
2300
|
+
"use strict";
|
|
2301
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
2302
|
+
return mod && mod.__esModule ? mod : {
|
|
2303
|
+
default: mod
|
|
2304
|
+
};
|
|
2305
|
+
};
|
|
2306
|
+
Object.defineProperty(exports1, "__esModule", {
|
|
2307
|
+
value: true
|
|
2308
|
+
});
|
|
2309
|
+
exports1.parseProxyResponse = void 0;
|
|
2310
|
+
const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
|
|
2311
|
+
const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response');
|
|
2312
|
+
function parseProxyResponse(socket) {
|
|
2313
|
+
return new Promise((resolve, reject)=>{
|
|
2314
|
+
let buffersLength = 0;
|
|
2315
|
+
const buffers = [];
|
|
2316
|
+
function read() {
|
|
2317
|
+
const b = socket.read();
|
|
2318
|
+
if (b) ondata(b);
|
|
2319
|
+
else socket.once('readable', read);
|
|
2320
|
+
}
|
|
2321
|
+
function cleanup() {
|
|
2322
|
+
socket.removeListener('end', onend);
|
|
2323
|
+
socket.removeListener('error', onerror);
|
|
2324
|
+
socket.removeListener('readable', read);
|
|
2325
|
+
}
|
|
2326
|
+
function onend() {
|
|
2327
|
+
cleanup();
|
|
2328
|
+
debug('onend');
|
|
2329
|
+
reject(new Error('Proxy connection ended before receiving CONNECT response'));
|
|
2330
|
+
}
|
|
2331
|
+
function onerror(err) {
|
|
2332
|
+
cleanup();
|
|
2333
|
+
debug('onerror %o', err);
|
|
2334
|
+
reject(err);
|
|
2335
|
+
}
|
|
2336
|
+
function ondata(b) {
|
|
2337
|
+
buffers.push(b);
|
|
2338
|
+
buffersLength += b.length;
|
|
2339
|
+
const buffered = Buffer.concat(buffers, buffersLength);
|
|
2340
|
+
const endOfHeaders = buffered.indexOf('\r\n\r\n');
|
|
2341
|
+
if (-1 === endOfHeaders) {
|
|
2342
|
+
debug('have not received end of HTTP headers yet...');
|
|
2343
|
+
read();
|
|
2344
|
+
return;
|
|
2345
|
+
}
|
|
2346
|
+
const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n');
|
|
2347
|
+
const firstLine = headerParts.shift();
|
|
2348
|
+
if (!firstLine) {
|
|
2349
|
+
socket.destroy();
|
|
2350
|
+
return reject(new Error('No header received from proxy CONNECT response'));
|
|
2351
|
+
}
|
|
2352
|
+
const firstLineParts = firstLine.split(' ');
|
|
2353
|
+
const statusCode = +firstLineParts[1];
|
|
2354
|
+
const statusText = firstLineParts.slice(2).join(' ');
|
|
2355
|
+
const headers = {};
|
|
2356
|
+
for (const header of headerParts){
|
|
2357
|
+
if (!header) continue;
|
|
2358
|
+
const firstColon = header.indexOf(':');
|
|
2359
|
+
if (-1 === firstColon) {
|
|
2360
|
+
socket.destroy();
|
|
2361
|
+
return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
2362
|
+
}
|
|
2363
|
+
const key = header.slice(0, firstColon).toLowerCase();
|
|
2364
|
+
const value = header.slice(firstColon + 1).trimStart();
|
|
2365
|
+
const current = headers[key];
|
|
2366
|
+
if ('string' == typeof current) headers[key] = [
|
|
2367
|
+
current,
|
|
2368
|
+
value
|
|
2369
|
+
];
|
|
2370
|
+
else if (Array.isArray(current)) current.push(value);
|
|
2371
|
+
else headers[key] = value;
|
|
2372
|
+
}
|
|
2373
|
+
debug('got proxy server response: %o %o', firstLine, headers);
|
|
2374
|
+
cleanup();
|
|
2375
|
+
resolve({
|
|
2376
|
+
connect: {
|
|
2377
|
+
statusCode,
|
|
2378
|
+
statusText,
|
|
2379
|
+
headers
|
|
2380
|
+
},
|
|
2381
|
+
buffered
|
|
2382
|
+
});
|
|
2383
|
+
}
|
|
2384
|
+
socket.on('error', onerror);
|
|
2385
|
+
socket.on('end', onend);
|
|
2386
|
+
read();
|
|
2387
|
+
});
|
|
2388
|
+
}
|
|
2389
|
+
exports1.parseProxyResponse = parseProxyResponse;
|
|
2390
|
+
},
|
|
1517
2391
|
"../../node_modules/.pnpm/mime-db@1.52.0/node_modules/mime-db/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
1518
2392
|
/*!
|
|
1519
2393
|
* mime-db
|
|
@@ -1683,6 +2557,91 @@ var __webpack_modules__ = {
|
|
|
1683
2557
|
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
1684
2558
|
}
|
|
1685
2559
|
},
|
|
2560
|
+
"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js": function(module) {
|
|
2561
|
+
var s = 1000;
|
|
2562
|
+
var m = 60 * s;
|
|
2563
|
+
var h = 60 * m;
|
|
2564
|
+
var d = 24 * h;
|
|
2565
|
+
var w = 7 * d;
|
|
2566
|
+
var y = 365.25 * d;
|
|
2567
|
+
module.exports = function(val, options) {
|
|
2568
|
+
options = options || {};
|
|
2569
|
+
var type = typeof val;
|
|
2570
|
+
if ('string' === type && val.length > 0) return parse(val);
|
|
2571
|
+
if ('number' === type && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
|
|
2572
|
+
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
|
|
2573
|
+
};
|
|
2574
|
+
function parse(str) {
|
|
2575
|
+
str = String(str);
|
|
2576
|
+
if (str.length > 100) return;
|
|
2577
|
+
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);
|
|
2578
|
+
if (!match) return;
|
|
2579
|
+
var n = parseFloat(match[1]);
|
|
2580
|
+
var type = (match[2] || 'ms').toLowerCase();
|
|
2581
|
+
switch(type){
|
|
2582
|
+
case 'years':
|
|
2583
|
+
case 'year':
|
|
2584
|
+
case 'yrs':
|
|
2585
|
+
case 'yr':
|
|
2586
|
+
case 'y':
|
|
2587
|
+
return n * y;
|
|
2588
|
+
case 'weeks':
|
|
2589
|
+
case 'week':
|
|
2590
|
+
case 'w':
|
|
2591
|
+
return n * w;
|
|
2592
|
+
case 'days':
|
|
2593
|
+
case 'day':
|
|
2594
|
+
case 'd':
|
|
2595
|
+
return n * d;
|
|
2596
|
+
case 'hours':
|
|
2597
|
+
case 'hour':
|
|
2598
|
+
case 'hrs':
|
|
2599
|
+
case 'hr':
|
|
2600
|
+
case 'h':
|
|
2601
|
+
return n * h;
|
|
2602
|
+
case 'minutes':
|
|
2603
|
+
case 'minute':
|
|
2604
|
+
case 'mins':
|
|
2605
|
+
case 'min':
|
|
2606
|
+
case 'm':
|
|
2607
|
+
return n * m;
|
|
2608
|
+
case 'seconds':
|
|
2609
|
+
case 'second':
|
|
2610
|
+
case 'secs':
|
|
2611
|
+
case 'sec':
|
|
2612
|
+
case 's':
|
|
2613
|
+
return n * s;
|
|
2614
|
+
case 'milliseconds':
|
|
2615
|
+
case 'millisecond':
|
|
2616
|
+
case 'msecs':
|
|
2617
|
+
case 'msec':
|
|
2618
|
+
case 'ms':
|
|
2619
|
+
return n;
|
|
2620
|
+
default:
|
|
2621
|
+
return;
|
|
2622
|
+
}
|
|
2623
|
+
}
|
|
2624
|
+
function fmtShort(ms) {
|
|
2625
|
+
var msAbs = Math.abs(ms);
|
|
2626
|
+
if (msAbs >= d) return Math.round(ms / d) + 'd';
|
|
2627
|
+
if (msAbs >= h) return Math.round(ms / h) + 'h';
|
|
2628
|
+
if (msAbs >= m) return Math.round(ms / m) + 'm';
|
|
2629
|
+
if (msAbs >= s) return Math.round(ms / s) + 's';
|
|
2630
|
+
return ms + 'ms';
|
|
2631
|
+
}
|
|
2632
|
+
function fmtLong(ms) {
|
|
2633
|
+
var msAbs = Math.abs(ms);
|
|
2634
|
+
if (msAbs >= d) return plural(ms, msAbs, d, 'day');
|
|
2635
|
+
if (msAbs >= h) return plural(ms, msAbs, h, 'hour');
|
|
2636
|
+
if (msAbs >= m) return plural(ms, msAbs, m, 'minute');
|
|
2637
|
+
if (msAbs >= s) return plural(ms, msAbs, s, 'second');
|
|
2638
|
+
return ms + ' ms';
|
|
2639
|
+
}
|
|
2640
|
+
function plural(ms, msAbs, n, name) {
|
|
2641
|
+
var isPlural = msAbs >= 1.5 * n;
|
|
2642
|
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
2643
|
+
}
|
|
2644
|
+
},
|
|
1686
2645
|
"../../node_modules/.pnpm/proxy-from-env@1.1.0/node_modules/proxy-from-env/index.js": function(__unused_webpack_module, exports1, __webpack_require__) {
|
|
1687
2646
|
"use strict";
|
|
1688
2647
|
var parseUrl = __webpack_require__("url").parse;
|
|
@@ -3582,6 +4541,10 @@ var __webpack_modules__ = {
|
|
|
3582
4541
|
"use strict";
|
|
3583
4542
|
module.exports = require("https");
|
|
3584
4543
|
},
|
|
4544
|
+
net: function(module) {
|
|
4545
|
+
"use strict";
|
|
4546
|
+
module.exports = require("net");
|
|
4547
|
+
},
|
|
3585
4548
|
os: function(module) {
|
|
3586
4549
|
"use strict";
|
|
3587
4550
|
module.exports = require("os");
|
|
@@ -3594,6 +4557,10 @@ var __webpack_modules__ = {
|
|
|
3594
4557
|
"use strict";
|
|
3595
4558
|
module.exports = require("stream");
|
|
3596
4559
|
},
|
|
4560
|
+
tls: function(module) {
|
|
4561
|
+
"use strict";
|
|
4562
|
+
module.exports = require("tls");
|
|
4563
|
+
},
|
|
3597
4564
|
tty: function(module) {
|
|
3598
4565
|
"use strict";
|
|
3599
4566
|
module.exports = require("tty");
|
|
@@ -3620,7 +4587,7 @@ function __webpack_require__(moduleId) {
|
|
|
3620
4587
|
loaded: false,
|
|
3621
4588
|
exports: {}
|
|
3622
4589
|
};
|
|
3623
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
4590
|
+
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
3624
4591
|
module.loaded = true;
|
|
3625
4592
|
return module.exports;
|
|
3626
4593
|
}
|
|
@@ -3673,6 +4640,7 @@ var __webpack_exports__ = {};
|
|
|
3673
4640
|
__webpack_require__.r(__webpack_exports__);
|
|
3674
4641
|
__webpack_require__.d(__webpack_exports__, {
|
|
3675
4642
|
version: ()=>package_namespaceObject.i8,
|
|
4643
|
+
BetaFlag: ()=>BetaFlag,
|
|
3676
4644
|
Action: ()=>Action
|
|
3677
4645
|
});
|
|
3678
4646
|
var common_utils_namespaceObject = {};
|
|
@@ -14630,6 +15598,28 @@ var __webpack_exports__ = {};
|
|
|
14630
15598
|
axios.HttpStatusCode = helpers_HttpStatusCode;
|
|
14631
15599
|
axios.default = axios;
|
|
14632
15600
|
const lib_axios = axios;
|
|
15601
|
+
var dist = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js");
|
|
15602
|
+
const ProxyData = {
|
|
15603
|
+
api: "202101291430286754",
|
|
15604
|
+
md5akey: "6ec8d333e85044b7",
|
|
15605
|
+
akey: "91709114"
|
|
15606
|
+
};
|
|
15607
|
+
const ProxyAgent = async (adr, huiwenToken)=>{
|
|
15608
|
+
const http = new Http({});
|
|
15609
|
+
let ProxyInfo = await http.api({
|
|
15610
|
+
method: "GET",
|
|
15611
|
+
url: "https://preview.huiwen.top/api/publish/zdy/ip",
|
|
15612
|
+
params: {
|
|
15613
|
+
addr: adr
|
|
15614
|
+
},
|
|
15615
|
+
...huiwenToken ? {
|
|
15616
|
+
headers: {
|
|
15617
|
+
token: huiwenToken
|
|
15618
|
+
}
|
|
15619
|
+
} : null
|
|
15620
|
+
});
|
|
15621
|
+
return 0 === ProxyInfo.code && ProxyInfo.data.length > 0 ? new dist.HttpsProxyAgent(`http://${ProxyData.api}:${ProxyData.akey}@${ProxyInfo.data[0].proxyAddress}`) : null;
|
|
15622
|
+
};
|
|
14633
15623
|
class Http {
|
|
14634
15624
|
static handleApiError(error) {
|
|
14635
15625
|
if (error && "object" == typeof error && "code" in error && "message" in error) return error;
|
|
@@ -14639,10 +15629,17 @@ var __webpack_exports__ = {};
|
|
|
14639
15629
|
data: error
|
|
14640
15630
|
};
|
|
14641
15631
|
}
|
|
14642
|
-
constructor(config){
|
|
15632
|
+
constructor(config, adr, huiwenToken){
|
|
14643
15633
|
this.apiClient = lib_axios.create({
|
|
14644
|
-
...config
|
|
15634
|
+
...config,
|
|
15635
|
+
proxy: {
|
|
15636
|
+
host: "192.168.137.1",
|
|
15637
|
+
port: 9000,
|
|
15638
|
+
protocol: "http"
|
|
15639
|
+
}
|
|
14645
15640
|
});
|
|
15641
|
+
this.adr = adr;
|
|
15642
|
+
this.heiwenToken = huiwenToken;
|
|
14646
15643
|
}
|
|
14647
15644
|
addResponseInterceptor(findError) {
|
|
14648
15645
|
this.apiClient.interceptors.response.use((response)=>{
|
|
@@ -14671,16 +15668,60 @@ var __webpack_exports__ = {};
|
|
|
14671
15668
|
errorResponse.data = serverError;
|
|
14672
15669
|
}
|
|
14673
15670
|
}
|
|
15671
|
+
if (error.code) switch(error.code){
|
|
15672
|
+
case "ECONNRESET":
|
|
15673
|
+
errorResponse.message = "连接被重置,请检查网络或稍后重试!";
|
|
15674
|
+
break;
|
|
15675
|
+
case "ENOTFOUND":
|
|
15676
|
+
errorResponse.message = "域名解析失败,请检查 URL 是否正确!";
|
|
15677
|
+
break;
|
|
15678
|
+
case "ETIMEDOUT":
|
|
15679
|
+
errorResponse.message = "网络请求超时,请检查网络连接!";
|
|
15680
|
+
break;
|
|
15681
|
+
case "ECONNREFUSED":
|
|
15682
|
+
errorResponse.message = "服务器拒绝连接,请稍后重试!";
|
|
15683
|
+
break;
|
|
15684
|
+
case "EAI_AGAIN":
|
|
15685
|
+
errorResponse.message = "DNS 查询超时,请稍后重试!";
|
|
15686
|
+
break;
|
|
15687
|
+
default:
|
|
15688
|
+
errorResponse.message = `网络错误: ${error.message}`;
|
|
15689
|
+
break;
|
|
15690
|
+
}
|
|
14674
15691
|
return Promise.reject(errorResponse);
|
|
14675
15692
|
});
|
|
14676
15693
|
}
|
|
14677
|
-
async api(config) {
|
|
14678
|
-
|
|
14679
|
-
|
|
14680
|
-
|
|
14681
|
-
|
|
14682
|
-
|
|
14683
|
-
|
|
15694
|
+
async api(config, options) {
|
|
15695
|
+
const retries = options?.retries ?? 0;
|
|
15696
|
+
const retryDelay = options?.retryDelay ?? 500;
|
|
15697
|
+
const sessionRt = async (Rtimes)=>{
|
|
15698
|
+
try {
|
|
15699
|
+
const agent = this.adr ? await ProxyAgent(this.adr, this.heiwenToken) : void 0;
|
|
15700
|
+
if (this.adr && null == agent) return Promise.reject({
|
|
15701
|
+
code: 200,
|
|
15702
|
+
message: "当前发文IP地址暂不支持!"
|
|
15703
|
+
});
|
|
15704
|
+
this.proxyInfo = agent?.proxy.host;
|
|
15705
|
+
const response = await this.apiClient({
|
|
15706
|
+
...config,
|
|
15707
|
+
...agent ? {
|
|
15708
|
+
httpAgent: agent,
|
|
15709
|
+
httpsAgent: agent
|
|
15710
|
+
} : {}
|
|
15711
|
+
});
|
|
15712
|
+
return response.data;
|
|
15713
|
+
} catch (error) {
|
|
15714
|
+
const handledError = Http.handleApiError(error);
|
|
15715
|
+
const isRetry = handledError.code >= 500 || 0 === handledError.code;
|
|
15716
|
+
if (Rtimes < retries && isRetry) {
|
|
15717
|
+
console.log("Loger: 进入重试!");
|
|
15718
|
+
await new Promise((resolve)=>setTimeout(resolve, retryDelay));
|
|
15719
|
+
return sessionRt(Rtimes + 1);
|
|
15720
|
+
}
|
|
15721
|
+
return Promise.reject(handledError);
|
|
15722
|
+
}
|
|
15723
|
+
};
|
|
15724
|
+
return sessionRt(0);
|
|
14684
15725
|
}
|
|
14685
15726
|
}
|
|
14686
15727
|
function getRandomInRange(min, max) {
|
|
@@ -14920,17 +15961,13 @@ var __webpack_exports__ = {};
|
|
|
14920
15961
|
async function downloadImage(url, savePath) {
|
|
14921
15962
|
await ensureFile(savePath);
|
|
14922
15963
|
return new Promise((resolve, reject)=>{
|
|
14923
|
-
|
|
15964
|
+
const handleResponse = (response)=>{
|
|
14924
15965
|
if (301 === response.statusCode || 302 === response.statusCode) {
|
|
14925
15966
|
const redirectUrl = response.headers.location;
|
|
14926
|
-
if (redirectUrl) external_node_https_namespaceObject.get(redirectUrl, (
|
|
14927
|
-
|
|
14928
|
-
|
|
14929
|
-
|
|
14930
|
-
fileStream.close();
|
|
14931
|
-
console.log(`${response.statusCode} 下载完成,文件已保存至:`, savePath);
|
|
14932
|
-
resolve(savePath);
|
|
14933
|
-
});
|
|
15967
|
+
if (redirectUrl) external_node_https_namespaceObject.get(redirectUrl, handleResponse).on("error", handleError);
|
|
15968
|
+
else reject({
|
|
15969
|
+
code: 200,
|
|
15970
|
+
message: "图片下载失败: 跳转地址无效"
|
|
14934
15971
|
});
|
|
14935
15972
|
} else if (200 === response.statusCode) {
|
|
14936
15973
|
const fileStream = external_node_fs_namespaceObject.createWriteStream(savePath);
|
|
@@ -14940,15 +15977,75 @@ var __webpack_exports__ = {};
|
|
|
14940
15977
|
console.log("下载完成,文件已保存至:", savePath);
|
|
14941
15978
|
resolve(savePath);
|
|
14942
15979
|
});
|
|
15980
|
+
fileStream.on("error", (err)=>{
|
|
15981
|
+
reject({
|
|
15982
|
+
code: 500,
|
|
15983
|
+
message: `图片Buffer写入失败: ${err.message}`
|
|
15984
|
+
});
|
|
15985
|
+
});
|
|
14943
15986
|
} else {
|
|
14944
15987
|
console.log("图片下载失败:", response.statusCode);
|
|
14945
15988
|
response.resume();
|
|
14946
|
-
reject(
|
|
15989
|
+
reject({
|
|
15990
|
+
code: 500,
|
|
15991
|
+
message: `图片下载失败,状态码: ${response.statusCode}`
|
|
15992
|
+
});
|
|
15993
|
+
}
|
|
15994
|
+
};
|
|
15995
|
+
const handleError = (error)=>{
|
|
15996
|
+
let customMessage = {
|
|
15997
|
+
code: 500,
|
|
15998
|
+
message: "请求图片时发生未知错误,请检查网络连接或稍后重试!"
|
|
15999
|
+
};
|
|
16000
|
+
switch(error.code){
|
|
16001
|
+
case "ECONNRESET":
|
|
16002
|
+
customMessage = {
|
|
16003
|
+
code: 500,
|
|
16004
|
+
message: "连接被重置,请检查网络连接或稍后重试!"
|
|
16005
|
+
};
|
|
16006
|
+
break;
|
|
16007
|
+
case "ENOTFOUND":
|
|
16008
|
+
customMessage = {
|
|
16009
|
+
code: 500,
|
|
16010
|
+
message: "域名解析失败,请检查网络连接或稍后重试!"
|
|
16011
|
+
};
|
|
16012
|
+
break;
|
|
16013
|
+
case "ETIMEDOUT":
|
|
16014
|
+
customMessage = {
|
|
16015
|
+
code: 500,
|
|
16016
|
+
message: "超时,请检查网络连接或稍后重试!"
|
|
16017
|
+
};
|
|
16018
|
+
break;
|
|
16019
|
+
case "ECONNREFUSED":
|
|
16020
|
+
customMessage = {
|
|
16021
|
+
code: 500,
|
|
16022
|
+
message: "目标服务器拒绝连接,请检查网络连接或稍后重试!"
|
|
16023
|
+
};
|
|
16024
|
+
break;
|
|
16025
|
+
case "EAI_AGAIN":
|
|
16026
|
+
customMessage = {
|
|
16027
|
+
code: 500,
|
|
16028
|
+
message: " DNS 查询超时,请检查网络连接或稍后重试!"
|
|
16029
|
+
};
|
|
16030
|
+
break;
|
|
16031
|
+
default:
|
|
16032
|
+
break;
|
|
14947
16033
|
}
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
16034
|
+
customMessage.message = "请求图片时" + customMessage.message;
|
|
16035
|
+
customMessage.extra = {
|
|
16036
|
+
url
|
|
16037
|
+
};
|
|
16038
|
+
reject(customMessage);
|
|
16039
|
+
};
|
|
16040
|
+
const req = external_node_https_namespaceObject.get(url, handleResponse);
|
|
16041
|
+
req.setTimeout(10000, ()=>{
|
|
16042
|
+
req.destroy();
|
|
16043
|
+
reject({
|
|
16044
|
+
code: 200,
|
|
16045
|
+
message: "图片下载超时,请检查网络连接或稍后重试!"
|
|
16046
|
+
});
|
|
14951
16047
|
});
|
|
16048
|
+
req.on("error", handleError);
|
|
14952
16049
|
});
|
|
14953
16050
|
}
|
|
14954
16051
|
function getFilenameFromUrl(imageUrl) {
|
|
@@ -14967,6 +16064,71 @@ var __webpack_exports__ = {};
|
|
|
14967
16064
|
for(let de = 0; de < length; de++)T += H.charAt(Math.floor(Math.random() * H.length));
|
|
14968
16065
|
return T;
|
|
14969
16066
|
};
|
|
16067
|
+
const external_node_crypto_namespaceObject = require("node:crypto");
|
|
16068
|
+
var external_node_crypto_default = /*#__PURE__*/ __webpack_require__.n(external_node_crypto_namespaceObject);
|
|
16069
|
+
const generateTopicHtml = function(topic, id, sv_small_images) {
|
|
16070
|
+
const generateUid = function() {
|
|
16071
|
+
const e = ()=>Math.floor(65536 * (1 + Math.random())).toString(16).substring(1);
|
|
16072
|
+
return e() + e() + e() + e() + e() + e() + e() + e();
|
|
16073
|
+
};
|
|
16074
|
+
const topicBase = function(topic, id, sv_small_images) {
|
|
16075
|
+
const t = function(r) {
|
|
16076
|
+
let n = [];
|
|
16077
|
+
let e = 0;
|
|
16078
|
+
for(; e < 256; ++e)n[e] = (e + 256).toString(16).substr(1);
|
|
16079
|
+
let o = 0;
|
|
16080
|
+
return [
|
|
16081
|
+
n[r[o++]],
|
|
16082
|
+
n[r[o++]],
|
|
16083
|
+
n[r[o++]],
|
|
16084
|
+
n[r[o++]],
|
|
16085
|
+
"-",
|
|
16086
|
+
n[r[o++]],
|
|
16087
|
+
n[r[o++]],
|
|
16088
|
+
"-",
|
|
16089
|
+
n[r[o++]],
|
|
16090
|
+
n[r[o++]],
|
|
16091
|
+
"-",
|
|
16092
|
+
n[r[o++]],
|
|
16093
|
+
n[r[o++]],
|
|
16094
|
+
"-",
|
|
16095
|
+
n[r[o++]],
|
|
16096
|
+
n[r[o++]],
|
|
16097
|
+
n[r[o++]],
|
|
16098
|
+
n[r[o++]],
|
|
16099
|
+
n[r[o++]],
|
|
16100
|
+
n[r[o++]]
|
|
16101
|
+
].join("");
|
|
16102
|
+
};
|
|
16103
|
+
const s = external_node_crypto_default().randomBytes(16);
|
|
16104
|
+
s[6] = 15 & s[6] | 64, s[8] = 63 & s[8] | 128;
|
|
16105
|
+
return {
|
|
16106
|
+
id: id || t(s),
|
|
16107
|
+
sv_small_images: sv_small_images || "",
|
|
16108
|
+
title: topic.replace(/[^\u4E00-\u9FA5a-zA-Z0-9]/g, ""),
|
|
16109
|
+
isCreate: 1
|
|
16110
|
+
};
|
|
16111
|
+
};
|
|
16112
|
+
const n = id ? topicBase(topic, id, sv_small_images) : topicBase(topic);
|
|
16113
|
+
const topicAttr = {
|
|
16114
|
+
style: "border:none;display:inline-block;color:#3E5599;text-decoration:none;font-style:normal;",
|
|
16115
|
+
href: `https://m.baidu.com/s?word=%23${n.title}%23&topic_id=${n.id}&sa=edit&sfrom=1023524a&append=1&newwindow=0&upqrade=1`.replace(/&/g, "&"),
|
|
16116
|
+
target: "_blank",
|
|
16117
|
+
"data-bjh-cover": "".concat(n.sv_small_images && (n.sv_small_images.https || n.sv_small_images.http)),
|
|
16118
|
+
"data-bjh-src": `https://m.baidu.com/s?word=%23${n.title}%23&topic_id=${n.id}&sa=edit&sfrom=1023524a&append=1&newwindow=0&upqrade=1`.replace(/&/g, "&"),
|
|
16119
|
+
"data-bjh-box": "topic",
|
|
16120
|
+
"data-bjh-title": n.title,
|
|
16121
|
+
"data-bjh-id": id || n.id,
|
|
16122
|
+
"data-bjh-type": "topic",
|
|
16123
|
+
contenteditable: "false",
|
|
16124
|
+
"data-ignore-remove-style": "1",
|
|
16125
|
+
"data-bjh-create": id ? "0" : "1",
|
|
16126
|
+
"data-bjh-adinspiration": "0",
|
|
16127
|
+
"data-diagnose-id": generateUid()
|
|
16128
|
+
};
|
|
16129
|
+
const attrStr = Object.entries(topicAttr).map(([key, val])=>`${key}="${val}"`).join(" ");
|
|
16130
|
+
return `<p><span data-diagnose-id=${generateUid()}></span><a ${attrStr}>#${n.title}#</a></p>`;
|
|
16131
|
+
};
|
|
14970
16132
|
const errnoMap = {
|
|
14971
16133
|
20040706: "正文图片和封面图片推荐jpg、png格式。",
|
|
14972
16134
|
20040084: "正文图片和封面图片推荐jpg、png格式。",
|
|
@@ -14981,16 +16143,19 @@ var __webpack_exports__ = {};
|
|
|
14981
16143
|
20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
|
|
14982
16144
|
20040124: "服务器异常,请稍后重试!",
|
|
14983
16145
|
20040001: "当前用户未登录,请登陆后重试!",
|
|
14984
|
-
401100025: "该应用不支持此媒资类型"
|
|
16146
|
+
401100025: "该应用不支持此媒资类型",
|
|
16147
|
+
401100033: "图片宽高不满足要求",
|
|
16148
|
+
'-6': "文章分类信息错误"
|
|
14985
16149
|
};
|
|
14986
16150
|
const mockAction = async (task, params)=>{
|
|
14987
16151
|
const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
|
|
14988
16152
|
const tmpCachePath = task.getTmpPath();
|
|
14989
|
-
const
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
16153
|
+
const headers = {
|
|
16154
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
16155
|
+
token: params.token
|
|
16156
|
+
};
|
|
16157
|
+
let http = new Http({
|
|
16158
|
+
headers
|
|
14994
16159
|
});
|
|
14995
16160
|
http.addResponseInterceptor((response)=>{
|
|
14996
16161
|
const msgType = "draft" === params.saveType ? "同步" : "发布";
|
|
@@ -15042,7 +16207,21 @@ var __webpack_exports__ = {};
|
|
|
15042
16207
|
};
|
|
15043
16208
|
const originContentImages = extractImgTag(params.content);
|
|
15044
16209
|
const targetContentImages = await uploadImages(originContentImages);
|
|
15045
|
-
|
|
16210
|
+
if (params.settingInfo.baijiahaoTopic && !params.settingInfo.baijiahaoTopic?.id) {
|
|
16211
|
+
let topicCheck = await http.api({
|
|
16212
|
+
method: "get",
|
|
16213
|
+
url: "https://baijiahao.baidu.com/pcui/topic/topiccheck",
|
|
16214
|
+
params: {
|
|
16215
|
+
topicName: params.settingInfo.baijiahaoTopic?.title
|
|
16216
|
+
}
|
|
16217
|
+
});
|
|
16218
|
+
if (0 != topicCheck.errno) return {
|
|
16219
|
+
code: 200,
|
|
16220
|
+
message: topicCheck.errmsg,
|
|
16221
|
+
data: ''
|
|
16222
|
+
};
|
|
16223
|
+
}
|
|
16224
|
+
const content = replaceImgSrc(params.settingInfo?.baijiahaoTopic && params.settingInfo.baijiahaoTopic?.title ? params.content + generateTopicHtml(params.settingInfo?.baijiahaoTopic?.title, params.settingInfo?.baijiahaoTopic?.id || "", params.settingInfo.baijiahaoTopic?.sv_small_images || "") : params.content, (dom)=>{
|
|
15046
16225
|
if (dom.attribs.src) {
|
|
15047
16226
|
const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
|
|
15048
16227
|
dom.attribs.src = targetContentImages[idx].bos_url;
|
|
@@ -15102,11 +16281,23 @@ var __webpack_exports__ = {};
|
|
|
15102
16281
|
activity_list,
|
|
15103
16282
|
...params.settingInfo.timer ? {
|
|
15104
16283
|
timer_time: params.settingInfo.timer
|
|
16284
|
+
} : {},
|
|
16285
|
+
...params.settingInfo.baijiahaoCms ? {
|
|
16286
|
+
'cate_user_cms[0]': params.settingInfo.baijiahaoCms[0],
|
|
16287
|
+
'cate_user_cms[1]': params.settingInfo.baijiahaoCms[1]
|
|
16288
|
+
} : {},
|
|
16289
|
+
...params.settingInfo.baijiahaoEventSpec ? {
|
|
16290
|
+
'event_spec[time]': params.settingInfo.baijiahaoEventSpec.time,
|
|
16291
|
+
'event_spec[pos]': params.settingInfo.baijiahaoEventSpec.pos
|
|
15105
16292
|
} : {}
|
|
15106
16293
|
};
|
|
15107
16294
|
const isDraft = "draft" === params.saveType;
|
|
15108
16295
|
const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
|
|
15109
|
-
|
|
16296
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
16297
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
16298
|
+
headers
|
|
16299
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
16300
|
+
const res = await proxyHttp.api({
|
|
15110
16301
|
method: "post",
|
|
15111
16302
|
url: saveUrl,
|
|
15112
16303
|
data: publishData,
|
|
@@ -15116,8 +16307,11 @@ var __webpack_exports__ = {};
|
|
|
15116
16307
|
referer: "https://baijiahao.baidu.com/builder/rc/edit?type=news"
|
|
15117
16308
|
},
|
|
15118
16309
|
defaultErrorMsg: isDraft ? "文章同步出现异常,请稍后重试。" : "文章发布出现异常,请稍后重试。"
|
|
16310
|
+
}, {
|
|
16311
|
+
retries: 2,
|
|
16312
|
+
retryDelay: 500
|
|
15119
16313
|
});
|
|
15120
|
-
return success(res.ret
|
|
16314
|
+
return success(0 == res.errno ? res?.ret?.article_id || '' : "", 0 == res.errno ? `文章发布成功!` + (proxyHttp.proxyInfo || "") : res.errmsg ?? '文章发布失败,请稍后重试。');
|
|
15121
16315
|
};
|
|
15122
16316
|
const rpaAction = async (task, params)=>{
|
|
15123
16317
|
const tmpCachePath = task.getTmpPath();
|
|
@@ -15243,6 +16437,7 @@ var __webpack_exports__ = {};
|
|
|
15243
16437
|
}
|
|
15244
16438
|
};
|
|
15245
16439
|
page.on("response", handleResponse);
|
|
16440
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
15246
16441
|
const operatorContainer = page.locator(".editor-component-operator");
|
|
15247
16442
|
if ("draft" === params.saveType) await operatorContainer.locator(".op-btn-outter-content").filter({
|
|
15248
16443
|
hasText: "存草稿"
|
|
@@ -15545,8 +16740,6 @@ var __webpack_exports__ = {};
|
|
|
15545
16740
|
}
|
|
15546
16741
|
};
|
|
15547
16742
|
const external_node_buffer_namespaceObject = require("node:buffer");
|
|
15548
|
-
const external_node_crypto_namespaceObject = require("node:crypto");
|
|
15549
|
-
var external_node_crypto_default = /*#__PURE__*/ __webpack_require__.n(external_node_crypto_namespaceObject);
|
|
15550
16743
|
class CryptoConfig {
|
|
15551
16744
|
static{
|
|
15552
16745
|
this.MAX_32BIT = 0xFFFFFFFF;
|
|
@@ -15984,12 +17177,13 @@ var __webpack_exports__ = {};
|
|
|
15984
17177
|
const mock_mockAction = async (task, params)=>{
|
|
15985
17178
|
const { toutiaoSingleCover, toutiaoMultCover, toutiaoCoverType, toutiaoOriginal, toutiaoExclusive, toutiaoClaim } = params.settingInfo;
|
|
15986
17179
|
const tmpCachePath = task.getTmpPath();
|
|
17180
|
+
const headers = {
|
|
17181
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
17182
|
+
origin: "https://mp.toutiao.com",
|
|
17183
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
17184
|
+
};
|
|
15987
17185
|
const http = new Http({
|
|
15988
|
-
headers
|
|
15989
|
-
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
15990
|
-
origin: "https://mp.toutiao.com",
|
|
15991
|
-
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
15992
|
-
}
|
|
17186
|
+
headers
|
|
15993
17187
|
});
|
|
15994
17188
|
http.addResponseInterceptor((response)=>{
|
|
15995
17189
|
if (response.data?.code !== 0) {
|
|
@@ -16066,11 +17260,14 @@ var __webpack_exports__ = {};
|
|
|
16066
17260
|
device_platform: "mp",
|
|
16067
17261
|
is_message: 0
|
|
16068
17262
|
},
|
|
16069
|
-
tuwen_wtt_trans_flag: "0",
|
|
17263
|
+
tuwen_wtt_trans_flag: params.settingInfo?.toutiaoTransWtt ? "2" : "0",
|
|
16070
17264
|
info_source: sourceData,
|
|
16071
17265
|
...location ? {
|
|
16072
17266
|
city: location.label,
|
|
16073
17267
|
city_code: location.value
|
|
17268
|
+
} : null,
|
|
17269
|
+
...params.settingInfo?.toutiaoCollectionId ? {
|
|
17270
|
+
want_join_collection_id: params.settingInfo.toutiaoCollectionId
|
|
16074
17271
|
} : null
|
|
16075
17272
|
};
|
|
16076
17273
|
const publishData = {
|
|
@@ -16116,6 +17313,7 @@ var __webpack_exports__ = {};
|
|
|
16116
17313
|
article_ad_type: getAddTypeValue(params.settingInfo.toutiaoAd),
|
|
16117
17314
|
claim_exclusive: toutiaoExclusive ? toutiaoExclusive : toutiaoOriginal?.includes("exclusive") ? 1 : 0
|
|
16118
17315
|
};
|
|
17316
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
16119
17317
|
const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
|
|
16120
17318
|
let publishOption = {};
|
|
16121
17319
|
if (msToken) {
|
|
@@ -16147,8 +17345,14 @@ var __webpack_exports__ = {};
|
|
|
16147
17345
|
},
|
|
16148
17346
|
defaultErrorMsg: "draft" === params.saveType ? "文章同步异常,请稍后重试。" : "文章发布异常,请稍后重试。"
|
|
16149
17347
|
};
|
|
16150
|
-
const
|
|
16151
|
-
|
|
17348
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
17349
|
+
headers
|
|
17350
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
17351
|
+
const publishResult = await proxyHttp.api(publishOption, {
|
|
17352
|
+
retries: 2,
|
|
17353
|
+
retryDelay: 500
|
|
17354
|
+
});
|
|
17355
|
+
return success(publishResult.data.pgc_id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
16152
17356
|
};
|
|
16153
17357
|
const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
|
|
16154
17358
|
const rpa_rpaAction = async (task, params)=>{
|
|
@@ -16360,6 +17564,7 @@ var __webpack_exports__ = {};
|
|
|
16360
17564
|
const confirmBtn = page.locator('div.byte-modal-footer button.byte-btn-primary:has-text("确定")');
|
|
16361
17565
|
if (await confirmBtn.isVisible()) await confirmBtn.click();
|
|
16362
17566
|
}
|
|
17567
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
16363
17568
|
if ("publish" === params.saveType) {
|
|
16364
17569
|
await page.locator(".publish-footer button").filter({
|
|
16365
17570
|
hasText: params.settingInfo.timer ? "定时发布" : "确认发布"
|
|
@@ -16816,6 +18021,24 @@ var __webpack_exports__ = {};
|
|
|
16816
18021
|
return success(null, "暂不支持该平台");
|
|
16817
18022
|
}
|
|
16818
18023
|
};
|
|
18024
|
+
const searchBjhTopicList = async (_task, params)=>{
|
|
18025
|
+
const cookies = params.cookies ?? [];
|
|
18026
|
+
const http = new Http({
|
|
18027
|
+
headers: {
|
|
18028
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
18029
|
+
token: params.token
|
|
18030
|
+
}
|
|
18031
|
+
});
|
|
18032
|
+
const res = await http.api({
|
|
18033
|
+
method: "get",
|
|
18034
|
+
url: "https://baijiahao.baidu.com/pcui/pcpublisher/searchtopic",
|
|
18035
|
+
params: {
|
|
18036
|
+
content: params.topicContent,
|
|
18037
|
+
resource_type: 1
|
|
18038
|
+
}
|
|
18039
|
+
});
|
|
18040
|
+
return success(res?.data?.hot ?? [], "百家号" + (0 == res.errno ? "话题获取成功!" : "话题获取失败"));
|
|
18041
|
+
};
|
|
16819
18042
|
const searchPublishInfo_types_errorResponse = (message, code = 500)=>({
|
|
16820
18043
|
code,
|
|
16821
18044
|
message,
|
|
@@ -17100,10 +18323,10 @@ var __webpack_exports__ = {};
|
|
|
17100
18323
|
}
|
|
17101
18324
|
const final = filtered.slice(0, pageSize);
|
|
17102
18325
|
const articleCell = final.map((item)=>({
|
|
17103
|
-
title: item.title,
|
|
17104
|
-
imageUrl: JSON.parse(item.cover_images)[0]
|
|
18326
|
+
title: item?.is_transfer ?? false ? item.content || "" : item.title,
|
|
18327
|
+
imageUrl: JSON.parse(item.cover_images)[0]?.src || "",
|
|
17105
18328
|
createTime: Math.floor(new Date(item.publish_at.replace(/-/g, "/")).getTime() / 1000),
|
|
17106
|
-
redirectUrl: item.url,
|
|
18329
|
+
redirectUrl: item.url || item.share_url,
|
|
17107
18330
|
recommendNum: item.rec_amount | item.forward_num,
|
|
17108
18331
|
collectNum: item.collection_amount,
|
|
17109
18332
|
readNum: item.read_amount | item.read_num,
|
|
@@ -17254,6 +18477,51 @@ var __webpack_exports__ = {};
|
|
|
17254
18477
|
};
|
|
17255
18478
|
return success(filtered, 0 === res.base_resp.ret ? "微信配置信息获取成功!" : "微信配置信息获取失败!");
|
|
17256
18479
|
};
|
|
18480
|
+
const getWeixinCollection = async (_task, params)=>{
|
|
18481
|
+
const http = new Http({
|
|
18482
|
+
headers: {
|
|
18483
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";")
|
|
18484
|
+
}
|
|
18485
|
+
});
|
|
18486
|
+
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
18487
|
+
const res = await http.api({
|
|
18488
|
+
method: "get",
|
|
18489
|
+
url: "https://mp.weixin.qq.com/cgi-bin/appmsgalbummgr",
|
|
18490
|
+
params: {
|
|
18491
|
+
action: 'list',
|
|
18492
|
+
begin: 0,
|
|
18493
|
+
count: 100,
|
|
18494
|
+
sub_title: '',
|
|
18495
|
+
type: 0,
|
|
18496
|
+
latest: 1,
|
|
18497
|
+
need_pay: 0,
|
|
18498
|
+
fingerprint,
|
|
18499
|
+
token: params.token,
|
|
18500
|
+
lang: 'zh_CN',
|
|
18501
|
+
f: 'json',
|
|
18502
|
+
ajax: 1
|
|
18503
|
+
}
|
|
18504
|
+
});
|
|
18505
|
+
return success(res.list_resp.items, 0 === res.base_resp.ret ? "微信合计信息获取成功!" : "微信合集信息获取失败!");
|
|
18506
|
+
};
|
|
18507
|
+
const getXhsCollection = async (_task, params)=>{
|
|
18508
|
+
const http = new Http({
|
|
18509
|
+
headers: {
|
|
18510
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
18511
|
+
referer: "https://creator.xiaohongshu.com",
|
|
18512
|
+
origin: "https://creator.xiaohongshu.com"
|
|
18513
|
+
}
|
|
18514
|
+
});
|
|
18515
|
+
try {
|
|
18516
|
+
const res = await http.api({
|
|
18517
|
+
method: "get",
|
|
18518
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
|
|
18519
|
+
});
|
|
18520
|
+
return success(0 === res.result ? res.data.collections : [], "合集信息获取" + (0 === res.result ? "成功!" : `失败!`));
|
|
18521
|
+
} catch (error) {
|
|
18522
|
+
return success([]);
|
|
18523
|
+
}
|
|
18524
|
+
};
|
|
17257
18525
|
const weitoutiaoPublish_mock_mockAction = async (task, params)=>{
|
|
17258
18526
|
const tmpCachePath = task.getTmpPath();
|
|
17259
18527
|
const http = new Http({
|
|
@@ -17400,6 +18668,16 @@ var __webpack_exports__ = {};
|
|
|
17400
18668
|
Normal: "kQuotaTypeMassSendNormal",
|
|
17401
18669
|
ProductActivity: "kQuotaTypeMassSendProductActivity"
|
|
17402
18670
|
};
|
|
18671
|
+
function genTopicHTML(topics) {
|
|
18672
|
+
if (!topics || 0 === topics.length) return "";
|
|
18673
|
+
const rn = ()=>{
|
|
18674
|
+
const O = Date.now().toString(36);
|
|
18675
|
+
const B = Math.random().toString(36).substring(2, 8);
|
|
18676
|
+
return `${O}-${B}`;
|
|
18677
|
+
};
|
|
18678
|
+
const aTags = topics.map((topic)=>`<a class="wx_topic_link" topic-id="${rn()}" style="color: #576B95 !important;" data-topic="1">#${topic}</a>`).join(" ");
|
|
18679
|
+
return `<p style="line-height: 1.75;margin: 0px 0px 24px;padding: 0px;" data-bothblock="0px"><span leaf="">${aTags}</span></p>`;
|
|
18680
|
+
}
|
|
17403
18681
|
const GET_QRCODE_DEFAULT_ERROR = "二维码获取异常,请稍后重试。";
|
|
17404
18682
|
const weixinPublish_mock_errnoMap = {
|
|
17405
18683
|
200003: "微信公众号号登录状态失效,请重新绑定账号后重试。",
|
|
@@ -17414,10 +18692,14 @@ var __webpack_exports__ = {};
|
|
|
17414
18692
|
"-1": "系统错误,请注意备份内容后重试",
|
|
17415
18693
|
770001: "不支持发布审核中或转码中的视频",
|
|
17416
18694
|
200074: "系统繁忙,请稍后重试!",
|
|
17417
|
-
64702: "标题超出64字长度限制,请修改标题后重试。"
|
|
18695
|
+
64702: "标题超出64字长度限制,请修改标题后重试。",
|
|
18696
|
+
64552: "请检查阅读原文中的链接后重试。"
|
|
17418
18697
|
};
|
|
17419
18698
|
const ignoreErrno = [
|
|
17420
|
-
154019
|
|
18699
|
+
154019,
|
|
18700
|
+
154011,
|
|
18701
|
+
154008,
|
|
18702
|
+
154009
|
|
17421
18703
|
];
|
|
17422
18704
|
const userTypeMap = {
|
|
17423
18705
|
所有用户: 1,
|
|
@@ -17451,13 +18733,14 @@ var __webpack_exports__ = {};
|
|
|
17451
18733
|
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
17452
18734
|
const client_time_diff = +Number("1743488763") - Math.floor(new Date().getTime() / 1000);
|
|
17453
18735
|
const tmpCachePath = task.getTmpPath();
|
|
18736
|
+
const headers = {
|
|
18737
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0",
|
|
18738
|
+
Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
18739
|
+
origin: "https://mp.weixin.qq.com",
|
|
18740
|
+
referer: `https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit&action=edit&isNew=1&type=77&createType=0&token=${params.token}&lang=zh_CN×tamp=${Date.now()}`
|
|
18741
|
+
};
|
|
17454
18742
|
const http = new Http({
|
|
17455
|
-
headers
|
|
17456
|
-
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36 Edg/134.0.0.0",
|
|
17457
|
-
Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
17458
|
-
origin: "https://mp.weixin.qq.com",
|
|
17459
|
-
referer: `https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit&action=edit&isNew=1&type=77&createType=0&token=${params.token}&lang=zh_CN×tamp=${Date.now()}`
|
|
17460
|
-
}
|
|
18743
|
+
headers
|
|
17461
18744
|
});
|
|
17462
18745
|
http.addResponseInterceptor((response)=>{
|
|
17463
18746
|
const responseData = response.data;
|
|
@@ -17521,7 +18804,7 @@ var __webpack_exports__ = {};
|
|
|
17521
18804
|
};
|
|
17522
18805
|
const originContentImages = extractImgTag(params.content);
|
|
17523
18806
|
const targetContentImages = await uploadImages(originContentImages);
|
|
17524
|
-
const content = replaceImgSrc(params.content, (dom)=>{
|
|
18807
|
+
const content = replaceImgSrc(params.settingInfo.wxTopic && params.settingInfo.wxTopic.length > 0 ? params.content + genTopicHTML(params.settingInfo.wxTopic) : params.content, (dom)=>{
|
|
17525
18808
|
if (dom.attribs.src) {
|
|
17526
18809
|
const idx = originContentImages.findIndex((it)=>it === dom.attribs.src);
|
|
17527
18810
|
dom.attribs.src = targetContentImages[idx].cdn_url;
|
|
@@ -17794,9 +19077,15 @@ var __webpack_exports__ = {};
|
|
|
17794
19077
|
allow_fast_reprint0: params?.settingInfo?.wxQuickReprint ? 1 : 0,
|
|
17795
19078
|
disable_recommend0: params?.settingInfo?.wxNotAllowRecommend ? 1 : 0,
|
|
17796
19079
|
claim_source_type0: params?.settingInfo?.wxCreationSource?.[0] || "",
|
|
19080
|
+
appmsg_album_info0: JSON.stringify({
|
|
19081
|
+
appmsg_album_infos: params.settingInfo?.wxCollectionInfo ? [
|
|
19082
|
+
params.settingInfo.wxCollectionInfo
|
|
19083
|
+
] : []
|
|
19084
|
+
}),
|
|
17797
19085
|
masssend_check: 1,
|
|
17798
19086
|
is_masssend: 1
|
|
17799
19087
|
};
|
|
19088
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
17800
19089
|
const { appMsgId } = await http.api({
|
|
17801
19090
|
method: "post",
|
|
17802
19091
|
url: "https://mp.weixin.qq.com/cgi-bin/operate_appmsg",
|
|
@@ -17815,6 +19104,42 @@ var __webpack_exports__ = {};
|
|
|
17815
19104
|
data: appMsgId,
|
|
17816
19105
|
message: "微信公众号保存草稿成功。"
|
|
17817
19106
|
};
|
|
19107
|
+
let checkTimes = 0;
|
|
19108
|
+
let copyrightStatRes = {
|
|
19109
|
+
base_resp: {
|
|
19110
|
+
ret: -1
|
|
19111
|
+
},
|
|
19112
|
+
list: ''
|
|
19113
|
+
};
|
|
19114
|
+
do {
|
|
19115
|
+
checkTimes++;
|
|
19116
|
+
const copyrightStat = http.api({
|
|
19117
|
+
method: 'post',
|
|
19118
|
+
url: 'https://mp.weixin.qq.com/cgi-bin/masssend',
|
|
19119
|
+
params: {
|
|
19120
|
+
action: 'get_appmsg_copyright_stat',
|
|
19121
|
+
token: params.token,
|
|
19122
|
+
lang: 'zh_CN'
|
|
19123
|
+
},
|
|
19124
|
+
data: weixinPublish_mock_generatorFormData({
|
|
19125
|
+
token: params.token,
|
|
19126
|
+
lang: 'zh_CN',
|
|
19127
|
+
f: 'json',
|
|
19128
|
+
ajax: 1,
|
|
19129
|
+
fingerprint,
|
|
19130
|
+
random: Math.random().toString(),
|
|
19131
|
+
first_check: 1 === checkTimes ? 1 : 0,
|
|
19132
|
+
type: 10,
|
|
19133
|
+
appMsgId
|
|
19134
|
+
})
|
|
19135
|
+
});
|
|
19136
|
+
copyrightStatRes = await copyrightStat;
|
|
19137
|
+
if (154008 === copyrightStatRes.base_resp.ret && copyrightStatRes?.list) return {
|
|
19138
|
+
code: 200,
|
|
19139
|
+
message: `文章内容未通过原创校验,请修改后重试!`,
|
|
19140
|
+
data: JSON.parse(copyrightStatRes.list).list
|
|
19141
|
+
};
|
|
19142
|
+
}while (154011 === copyrightStatRes.base_resp.ret && checkTimes < 10);
|
|
17818
19143
|
const masssendpage = ()=>http.api({
|
|
17819
19144
|
method: "get",
|
|
17820
19145
|
url: "https://mp.weixin.qq.com/cgi-bin/masssendpage",
|
|
@@ -18022,7 +19347,7 @@ var __webpack_exports__ = {};
|
|
|
18022
19347
|
responseType: "arraybuffer"
|
|
18023
19348
|
});
|
|
18024
19349
|
const qrcodeBuffer = Buffer.from(qrcodeResult);
|
|
18025
|
-
const qrcodeFilePath = external_node_path_default().join(tmpCachePath,
|
|
19350
|
+
const qrcodeFilePath = external_node_path_default().join(tmpCachePath, `weixin_qrcode_${Date.now()}.jpg`);
|
|
18026
19351
|
external_node_fs_default().writeFileSync(qrcodeFilePath, new Uint8Array(qrcodeBuffer));
|
|
18027
19352
|
params.safeQrcodeCallback?.(qrcodeFilePath);
|
|
18028
19353
|
let code = "";
|
|
@@ -18077,7 +19402,10 @@ var __webpack_exports__ = {};
|
|
|
18077
19402
|
uuid
|
|
18078
19403
|
})
|
|
18079
19404
|
});
|
|
18080
|
-
|
|
19405
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
19406
|
+
headers
|
|
19407
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
19408
|
+
await proxyHttp.api({
|
|
18081
19409
|
method: "post",
|
|
18082
19410
|
url: "https://mp.weixin.qq.com/cgi-bin/masssend",
|
|
18083
19411
|
params: {
|
|
@@ -18125,8 +19453,11 @@ var __webpack_exports__ = {};
|
|
|
18125
19453
|
userType: "1"
|
|
18126
19454
|
}),
|
|
18127
19455
|
defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
|
|
19456
|
+
}, {
|
|
19457
|
+
retries: 2,
|
|
19458
|
+
retryDelay: 500
|
|
18128
19459
|
});
|
|
18129
|
-
return success(appMsgId,
|
|
19460
|
+
return success(appMsgId, `微信公众号发布完成!` + (proxyHttp.proxyInfo || ""));
|
|
18130
19461
|
};
|
|
18131
19462
|
const waitQrcodeResultMaxTime = 2000 * scanRetryMaxCount;
|
|
18132
19463
|
const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
@@ -18455,6 +19786,7 @@ var __webpack_exports__ = {};
|
|
|
18455
19786
|
await poperInstance.locator('.frm_radio_item label[for="not_recomment_0"]').click();
|
|
18456
19787
|
}
|
|
18457
19788
|
await page.waitForTimeout(1000);
|
|
19789
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
18458
19790
|
const articleId = await new Promise(async (resolve)=>{
|
|
18459
19791
|
const handleResponse = async (response)=>{
|
|
18460
19792
|
const url = response.url();
|
|
@@ -18791,6 +20123,11 @@ var __webpack_exports__ = {};
|
|
|
18791
20123
|
const mock_xsEncrypt = new Xhshow();
|
|
18792
20124
|
const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
18793
20125
|
const tmpCachePath = task.getTmpPath();
|
|
20126
|
+
if (params?.selfDeclaration?.type == "source-statement" && "transshipment" == params.selfDeclaration.childType && params.originalBind) return {
|
|
20127
|
+
code: 200,
|
|
20128
|
+
message: "原创声明与转载声明互斥,请重新选择后发布!",
|
|
20129
|
+
data: ""
|
|
20130
|
+
};
|
|
18794
20131
|
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
18795
20132
|
if (!a1Cookie) return {
|
|
18796
20133
|
code: 200,
|
|
@@ -18925,6 +20262,11 @@ var __webpack_exports__ = {};
|
|
|
18925
20262
|
Object.assign(topic, createTopic.data.topic_infos[0]);
|
|
18926
20263
|
}
|
|
18927
20264
|
}));
|
|
20265
|
+
const visibleRangeMap = {
|
|
20266
|
+
public: 0,
|
|
20267
|
+
private: 1,
|
|
20268
|
+
friends: 4
|
|
20269
|
+
};
|
|
18928
20270
|
const publishData = {
|
|
18929
20271
|
common: {
|
|
18930
20272
|
ats: [],
|
|
@@ -18942,7 +20284,7 @@ var __webpack_exports__ = {};
|
|
|
18942
20284
|
type: "normal",
|
|
18943
20285
|
privacy_info: {
|
|
18944
20286
|
op_type: 1,
|
|
18945
|
-
type:
|
|
20287
|
+
type: visibleRangeMap[params.visibleRange] || 1
|
|
18946
20288
|
},
|
|
18947
20289
|
post_loc: params.address ? {
|
|
18948
20290
|
name: params.address?.name,
|
|
@@ -18994,6 +20336,10 @@ var __webpack_exports__ = {};
|
|
|
18994
20336
|
};
|
|
18995
20337
|
}
|
|
18996
20338
|
}
|
|
20339
|
+
const bizId = params?.originalBind && (params.cookies.find((it)=>"x-user-id-creator.xiaohongshu.com" === it.name)?.value || await http.api({
|
|
20340
|
+
method: "get",
|
|
20341
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/user/my-info"
|
|
20342
|
+
}).then((userData)=>userData.data?.userDetail?.id));
|
|
18997
20343
|
const business_binds = {
|
|
18998
20344
|
version: 1,
|
|
18999
20345
|
bizType: "",
|
|
@@ -19002,18 +20348,52 @@ var __webpack_exports__ = {};
|
|
|
19002
20348
|
notePostTiming: params.isImmediatelyPublish ? {} : {
|
|
19003
20349
|
postTime: params.scheduledPublish
|
|
19004
20350
|
},
|
|
19005
|
-
|
|
19006
|
-
|
|
20351
|
+
coProduceBind: {
|
|
20352
|
+
enable: !!params?.coProduceBind
|
|
20353
|
+
},
|
|
20354
|
+
noteCopyBind: {
|
|
20355
|
+
copyable: !!params?.noteCopyBind
|
|
20356
|
+
},
|
|
20357
|
+
optionRelationList: params.originalBind ? [
|
|
20358
|
+
{
|
|
20359
|
+
type: "ORIGINAL_STATEMENT",
|
|
20360
|
+
relationList: [
|
|
20361
|
+
{
|
|
20362
|
+
bizId,
|
|
20363
|
+
bizType: "ORIGINAL_STATEMENT",
|
|
20364
|
+
extraInfo: "{}"
|
|
20365
|
+
}
|
|
20366
|
+
]
|
|
20367
|
+
}
|
|
20368
|
+
] : [],
|
|
20369
|
+
...params?.groupBind ? {
|
|
20370
|
+
groupBind: {
|
|
20371
|
+
groupId: params?.groupBind?.group_id,
|
|
20372
|
+
groupName: params.groupBind?.group_name,
|
|
20373
|
+
desc: params.groupBind?.desc,
|
|
20374
|
+
avatar: params.groupBind?.avatar
|
|
20375
|
+
}
|
|
20376
|
+
} : {
|
|
20377
|
+
groupBind: {}
|
|
19007
20378
|
},
|
|
19008
20379
|
...params.selfDeclaration ? {
|
|
19009
20380
|
userDeclarationBind
|
|
20381
|
+
} : {},
|
|
20382
|
+
...params?.collectionId ? {
|
|
20383
|
+
noteCollectionBind: {
|
|
20384
|
+
id: params.collectionId
|
|
20385
|
+
}
|
|
19010
20386
|
} : {}
|
|
19011
20387
|
};
|
|
19012
20388
|
publishData.common.business_binds = JSON.stringify(business_binds);
|
|
19013
20389
|
const publishXt = Date.now().toString();
|
|
19014
20390
|
const publishXs = mock_xsEncrypt.signXsPost("/web_api/sns/v2/note", a1Cookie, "xhs-pc-web", publishData);
|
|
19015
20391
|
const xscommon = GenXSCommon(a1Cookie, publishXt, publishXs);
|
|
19016
|
-
const
|
|
20392
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
20393
|
+
headers
|
|
20394
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
20395
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
20396
|
+
const publishResult = await proxyHttp.api({
|
|
19017
20397
|
method: "post",
|
|
19018
20398
|
url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
|
|
19019
20399
|
data: publishData,
|
|
@@ -19023,8 +20403,11 @@ var __webpack_exports__ = {};
|
|
|
19023
20403
|
"x-s-common": xscommon
|
|
19024
20404
|
},
|
|
19025
20405
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
20406
|
+
}, {
|
|
20407
|
+
retries: 2,
|
|
20408
|
+
retryDelay: 500
|
|
19026
20409
|
});
|
|
19027
|
-
return success(publishResult.data?.id);
|
|
20410
|
+
return success(publishResult.data?.id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
19028
20411
|
};
|
|
19029
20412
|
const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
|
|
19030
20413
|
const rpa_xsEncrypt = new Xhshow();
|
|
@@ -19220,6 +20603,7 @@ var __webpack_exports__ = {};
|
|
|
19220
20603
|
hasText: "仅自己可见"
|
|
19221
20604
|
}).click();
|
|
19222
20605
|
}
|
|
20606
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
19223
20607
|
const releaseTimeInstance = page.locator("label").filter({
|
|
19224
20608
|
hasText: params.isImmediatelyPublish ? "立即发布" : "定时发布"
|
|
19225
20609
|
});
|
|
@@ -19244,27 +20628,134 @@ var __webpack_exports__ = {};
|
|
|
19244
20628
|
if ("mockApi" === params.actionType) return xiaohongshuPublish_mock_mockAction(task, params);
|
|
19245
20629
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
19246
20630
|
};
|
|
19247
|
-
|
|
19248
|
-
|
|
20631
|
+
const getXhsGroup_xsEncrypt = new Xhshow();
|
|
20632
|
+
const getXhsGroup = async (_task, params)=>{
|
|
20633
|
+
const http = new Http({
|
|
20634
|
+
headers: {
|
|
20635
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
20636
|
+
referer: "https://creator.xiaohongshu.com",
|
|
20637
|
+
origin: "https://creator.xiaohongshu.com"
|
|
20638
|
+
}
|
|
20639
|
+
});
|
|
20640
|
+
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
20641
|
+
if (!a1Cookie) return {
|
|
20642
|
+
code: 200,
|
|
20643
|
+
message: "账号数据异常,请重新绑定账号后重试。",
|
|
20644
|
+
data: []
|
|
20645
|
+
};
|
|
20646
|
+
try {
|
|
20647
|
+
const xt = Date.now().toString();
|
|
20648
|
+
const groupListParams = {
|
|
20649
|
+
note_id: ""
|
|
20650
|
+
};
|
|
20651
|
+
const fatchGroup = "/api/im/web/nns/group_list";
|
|
20652
|
+
const xs = getXhsGroup_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", groupListParams);
|
|
20653
|
+
const res = await http.api({
|
|
20654
|
+
method: "get",
|
|
20655
|
+
url: "https://edith.xiaohongshu.com/api/im/web/nns/group_list",
|
|
20656
|
+
params: groupListParams,
|
|
20657
|
+
headers: {
|
|
20658
|
+
"x-s": xs,
|
|
20659
|
+
"x-t": xt
|
|
20660
|
+
}
|
|
20661
|
+
});
|
|
20662
|
+
return success(0 === res.code ? res.data.group_list : [], "群聊信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
|
|
20663
|
+
} catch (error) {
|
|
20664
|
+
return success([]);
|
|
20665
|
+
}
|
|
20666
|
+
};
|
|
20667
|
+
const getXhsHotTopic_xsEncrypt = new Xhshow();
|
|
20668
|
+
const getXhsHotTopic = async (_task, params)=>{
|
|
20669
|
+
const http = new Http({
|
|
20670
|
+
headers: {
|
|
20671
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
20672
|
+
referer: "https://creator.xiaohongshu.com",
|
|
20673
|
+
origin: "https://creator.xiaohongshu.com"
|
|
20674
|
+
}
|
|
20675
|
+
});
|
|
20676
|
+
const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
|
|
20677
|
+
if (!a1Cookie) return {
|
|
20678
|
+
code: 200,
|
|
20679
|
+
message: "账号数据异常,请重新绑定账号后重试。",
|
|
20680
|
+
data: []
|
|
20681
|
+
};
|
|
20682
|
+
try {
|
|
20683
|
+
const xt = Date.now().toString();
|
|
20684
|
+
const hotTopicParams = {
|
|
20685
|
+
sort: 1,
|
|
20686
|
+
type: 1,
|
|
20687
|
+
source: 3,
|
|
20688
|
+
topic_activity: 1
|
|
20689
|
+
};
|
|
20690
|
+
const fatchGroup = "/api/galaxy/v2/creator/activity_center/list";
|
|
20691
|
+
const xs = getXhsHotTopic_xsEncrypt.signXsGet(fatchGroup, a1Cookie, "xhs-pc-web", hotTopicParams);
|
|
20692
|
+
const res = await http.api({
|
|
20693
|
+
method: "get",
|
|
20694
|
+
url: "https://creator.xiaohongshu.com/api/galaxy/v2/creator/activity_center/list",
|
|
20695
|
+
params: hotTopicParams,
|
|
20696
|
+
headers: {
|
|
20697
|
+
"x-s": xs,
|
|
20698
|
+
"x-t": xt
|
|
20699
|
+
}
|
|
20700
|
+
});
|
|
20701
|
+
return success(0 === res.code ? res.data.activity_list : [], "热门信息获取" + (0 === res.code ? "成功!" : `失败!原因${res.msg}`));
|
|
20702
|
+
} catch (error) {
|
|
20703
|
+
return success([]);
|
|
20704
|
+
}
|
|
20705
|
+
};
|
|
20706
|
+
const getToutiaoCollection = async (_task, params)=>{
|
|
20707
|
+
const cookies = params.cookies ?? [];
|
|
20708
|
+
const http = new Http({
|
|
20709
|
+
headers: {
|
|
20710
|
+
cookie: cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
20711
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
20712
|
+
}
|
|
20713
|
+
});
|
|
20714
|
+
const res = await http.api({
|
|
20715
|
+
method: "get",
|
|
20716
|
+
url: "https://mp.toutiao.com/mp/fe_api/collection/list",
|
|
20717
|
+
params: {
|
|
20718
|
+
page_num: 0,
|
|
20719
|
+
page_size: 100,
|
|
20720
|
+
need_sub_item_count: true
|
|
20721
|
+
}
|
|
20722
|
+
});
|
|
20723
|
+
return success(0 === res.code ? res.data : [], 0 === res.code ? "获取头条号合集成功!" : "获取头条号合集失败!");
|
|
19249
20724
|
};
|
|
20725
|
+
var package_namespaceObject = JSON.parse('{"i8":"1.2.25-beta.0"}');
|
|
20726
|
+
const BetaFlag = "HuiwenCanary";
|
|
19250
20727
|
class Action {
|
|
19251
20728
|
constructor(task){
|
|
19252
20729
|
this.task = task;
|
|
19253
20730
|
}
|
|
19254
20731
|
async bindTask(func, params) {
|
|
19255
20732
|
let responseData;
|
|
19256
|
-
|
|
19257
|
-
|
|
20733
|
+
this.task.isBeta = this.task?.isFeatOn ? this.task?.isFeatOn(BetaFlag) : false;
|
|
20734
|
+
this.task._timerRecord = {
|
|
20735
|
+
ActionStart: Date.now()
|
|
20736
|
+
};
|
|
20737
|
+
if (this.task?.setArticleId) this.task.setArticleId(params.articleId ?? "");
|
|
20738
|
+
if (this.task?.setSaveType ?? false) this.task.setSaveType(params.saveType ?? "");
|
|
20739
|
+
if (this.task?.isInitializedGB !== void 0) this.task.setGbInitType(this.task.isInitializedGB);
|
|
20740
|
+
if ("object" == typeof params) params.cookies = params?.cookies ?? [];
|
|
19258
20741
|
try {
|
|
19259
20742
|
responseData = await func(this.task, params);
|
|
19260
20743
|
} catch (error) {
|
|
19261
20744
|
responseData = Http.handleApiError(error);
|
|
20745
|
+
} finally{
|
|
20746
|
+
this.task._timerRecord['ActionEnd'] = Date.now();
|
|
19262
20747
|
}
|
|
20748
|
+
if (this.task.isBeta && this.task.setTimeConsuming) this.task.setTimeConsuming(this.task._timerRecord);
|
|
19263
20749
|
if (200 === responseData.code) this.task.logger.info(`${func.name} action params error`, responseData);
|
|
19264
20750
|
else if (0 !== responseData.code) {
|
|
19265
20751
|
this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
|
|
19266
20752
|
this.task.logger.info(`${func.name} action failed`);
|
|
19267
20753
|
} else this.task.logger.info(`${func.name} action success`);
|
|
20754
|
+
if (this.task.debug && this.task._timerRecord['PrePublish']) {
|
|
20755
|
+
console.log("预处理图片耗时:", (this.task._timerRecord['PrePublish'] - this.task._timerRecord['ActionStart']) / 1000, "s");
|
|
20756
|
+
console.log("发文接口耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['PrePublish']) / 1000, "s");
|
|
20757
|
+
}
|
|
20758
|
+
this.task.debug && console.log("Action整体耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['ActionStart']) / 1000, "s");
|
|
19268
20759
|
return responseData;
|
|
19269
20760
|
}
|
|
19270
20761
|
FetchArticles(params) {
|
|
@@ -19300,6 +20791,9 @@ var __webpack_exports__ = {};
|
|
|
19300
20791
|
BjhFansExport(params) {
|
|
19301
20792
|
return this.bindTask(BjhFansExport, params);
|
|
19302
20793
|
}
|
|
20794
|
+
SearchBjhTopicList(params) {
|
|
20795
|
+
return this.bindTask(searchBjhTopicList, params);
|
|
20796
|
+
}
|
|
19303
20797
|
searchToutiaoUserID(params) {
|
|
19304
20798
|
return this.bindTask(searchToutiaoUserInfo, params);
|
|
19305
20799
|
}
|
|
@@ -19309,9 +20803,24 @@ var __webpack_exports__ = {};
|
|
|
19309
20803
|
getToutiaoConfig(params) {
|
|
19310
20804
|
return this.bindTask(getToutiaoConfig, params);
|
|
19311
20805
|
}
|
|
20806
|
+
getToutiaoCollection(params) {
|
|
20807
|
+
return this.bindTask(getToutiaoCollection, params);
|
|
20808
|
+
}
|
|
19312
20809
|
getWeixinConfig(params) {
|
|
19313
20810
|
return this.bindTask(getWeixinConfig, params);
|
|
19314
20811
|
}
|
|
20812
|
+
getWeixinCollection(params) {
|
|
20813
|
+
return this.bindTask(getWeixinCollection, params);
|
|
20814
|
+
}
|
|
20815
|
+
getXhsCollection(params) {
|
|
20816
|
+
return this.bindTask(getXhsCollection, params);
|
|
20817
|
+
}
|
|
20818
|
+
getXhsGroup(params) {
|
|
20819
|
+
return this.bindTask(getXhsGroup, params);
|
|
20820
|
+
}
|
|
20821
|
+
getXhsHotTopic(params) {
|
|
20822
|
+
return this.bindTask(getXhsHotTopic, params);
|
|
20823
|
+
}
|
|
19315
20824
|
getBaijiahaoConfig(params) {
|
|
19316
20825
|
return this.bindTask(getBaijiahaoConfig, params);
|
|
19317
20826
|
}
|