@iflyrpa/actions 1.2.24 → 1.2.25
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 +2 -0
- package/dist/actions/toutiaoPublish/index.d.ts +4 -0
- package/dist/actions/weixinPublish/index.d.ts +2 -0
- package/dist/actions/xiaohongshuPublish/index.d.ts +2 -0
- package/dist/bundle.js +1111 -65
- package/dist/bundle.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1206 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1200 -37
- package/dist/index.mjs.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/utils/http.d.ts +5 -2
- 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,12 @@ 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
15634
|
...config
|
|
14645
15635
|
});
|
|
15636
|
+
this.adr = adr;
|
|
15637
|
+
this.heiwenToken = huiwenToken;
|
|
14646
15638
|
}
|
|
14647
15639
|
addResponseInterceptor(findError) {
|
|
14648
15640
|
this.apiClient.interceptors.response.use((response)=>{
|
|
@@ -14676,7 +15668,19 @@ var __webpack_exports__ = {};
|
|
|
14676
15668
|
}
|
|
14677
15669
|
async api(config) {
|
|
14678
15670
|
try {
|
|
14679
|
-
const
|
|
15671
|
+
const agent = this.adr ? await ProxyAgent(this.adr, this.heiwenToken) : void 0;
|
|
15672
|
+
if (this.adr && null == agent) return Promise.reject({
|
|
15673
|
+
code: 200,
|
|
15674
|
+
message: "当前发文IP地址暂不支持!"
|
|
15675
|
+
});
|
|
15676
|
+
this.proxyInfo = agent?.proxy.host;
|
|
15677
|
+
const response = await this.apiClient({
|
|
15678
|
+
...config,
|
|
15679
|
+
...agent ? {
|
|
15680
|
+
httpAgent: agent,
|
|
15681
|
+
httpsAgent: agent
|
|
15682
|
+
} : {}
|
|
15683
|
+
});
|
|
14680
15684
|
return response.data;
|
|
14681
15685
|
} catch (error) {
|
|
14682
15686
|
return Promise.reject(Http.handleApiError(error));
|
|
@@ -14981,16 +15985,18 @@ var __webpack_exports__ = {};
|
|
|
14981
15985
|
20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
|
|
14982
15986
|
20040124: "服务器异常,请稍后重试!",
|
|
14983
15987
|
20040001: "当前用户未登录,请登陆后重试!",
|
|
14984
|
-
401100025: "该应用不支持此媒资类型"
|
|
15988
|
+
401100025: "该应用不支持此媒资类型",
|
|
15989
|
+
401100033: "图片宽高不满足要求"
|
|
14985
15990
|
};
|
|
14986
15991
|
const mockAction = async (task, params)=>{
|
|
14987
15992
|
const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
|
|
14988
15993
|
const tmpCachePath = task.getTmpPath();
|
|
14989
|
-
const
|
|
14990
|
-
|
|
14991
|
-
|
|
14992
|
-
|
|
14993
|
-
|
|
15994
|
+
const headers = {
|
|
15995
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
15996
|
+
token: params.token
|
|
15997
|
+
};
|
|
15998
|
+
let http = new Http({
|
|
15999
|
+
headers
|
|
14994
16000
|
});
|
|
14995
16001
|
http.addResponseInterceptor((response)=>{
|
|
14996
16002
|
const msgType = "draft" === params.saveType ? "同步" : "发布";
|
|
@@ -15106,7 +16112,11 @@ var __webpack_exports__ = {};
|
|
|
15106
16112
|
};
|
|
15107
16113
|
const isDraft = "draft" === params.saveType;
|
|
15108
16114
|
const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
|
|
15109
|
-
|
|
16115
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
16116
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
16117
|
+
headers
|
|
16118
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
16119
|
+
const res = await proxyHttp.api({
|
|
15110
16120
|
method: "post",
|
|
15111
16121
|
url: saveUrl,
|
|
15112
16122
|
data: publishData,
|
|
@@ -15117,7 +16127,7 @@ var __webpack_exports__ = {};
|
|
|
15117
16127
|
},
|
|
15118
16128
|
defaultErrorMsg: isDraft ? "文章同步出现异常,请稍后重试。" : "文章发布出现异常,请稍后重试。"
|
|
15119
16129
|
});
|
|
15120
|
-
return success(res.ret
|
|
16130
|
+
return success(0 == res.errno ? res?.ret?.article_id || '' : "", 0 == res.errno ? `文章发布成功!` + (proxyHttp.proxyInfo || "") : res.errmsg ?? '文章发布失败,请稍后重试。');
|
|
15121
16131
|
};
|
|
15122
16132
|
const rpaAction = async (task, params)=>{
|
|
15123
16133
|
const tmpCachePath = task.getTmpPath();
|
|
@@ -15243,6 +16253,7 @@ var __webpack_exports__ = {};
|
|
|
15243
16253
|
}
|
|
15244
16254
|
};
|
|
15245
16255
|
page.on("response", handleResponse);
|
|
16256
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
15246
16257
|
const operatorContainer = page.locator(".editor-component-operator");
|
|
15247
16258
|
if ("draft" === params.saveType) await operatorContainer.locator(".op-btn-outter-content").filter({
|
|
15248
16259
|
hasText: "存草稿"
|
|
@@ -15984,12 +16995,13 @@ var __webpack_exports__ = {};
|
|
|
15984
16995
|
const mock_mockAction = async (task, params)=>{
|
|
15985
16996
|
const { toutiaoSingleCover, toutiaoMultCover, toutiaoCoverType, toutiaoOriginal, toutiaoExclusive, toutiaoClaim } = params.settingInfo;
|
|
15986
16997
|
const tmpCachePath = task.getTmpPath();
|
|
16998
|
+
const headers = {
|
|
16999
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
17000
|
+
origin: "https://mp.toutiao.com",
|
|
17001
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
17002
|
+
};
|
|
15987
17003
|
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
|
-
}
|
|
17004
|
+
headers
|
|
15993
17005
|
});
|
|
15994
17006
|
http.addResponseInterceptor((response)=>{
|
|
15995
17007
|
if (response.data?.code !== 0) {
|
|
@@ -16066,11 +17078,14 @@ var __webpack_exports__ = {};
|
|
|
16066
17078
|
device_platform: "mp",
|
|
16067
17079
|
is_message: 0
|
|
16068
17080
|
},
|
|
16069
|
-
tuwen_wtt_trans_flag: "0",
|
|
17081
|
+
tuwen_wtt_trans_flag: params.settingInfo?.toutiaoTransWtt ? "2" : "0",
|
|
16070
17082
|
info_source: sourceData,
|
|
16071
17083
|
...location ? {
|
|
16072
17084
|
city: location.label,
|
|
16073
17085
|
city_code: location.value
|
|
17086
|
+
} : null,
|
|
17087
|
+
...params.settingInfo?.toutiaoCollectionId ? {
|
|
17088
|
+
want_join_collection_id: params.settingInfo.toutiaoCollectionId
|
|
16074
17089
|
} : null
|
|
16075
17090
|
};
|
|
16076
17091
|
const publishData = {
|
|
@@ -16116,6 +17131,7 @@ var __webpack_exports__ = {};
|
|
|
16116
17131
|
article_ad_type: getAddTypeValue(params.settingInfo.toutiaoAd),
|
|
16117
17132
|
claim_exclusive: toutiaoExclusive ? toutiaoExclusive : toutiaoOriginal?.includes("exclusive") ? 1 : 0
|
|
16118
17133
|
};
|
|
17134
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
16119
17135
|
const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
|
|
16120
17136
|
let publishOption = {};
|
|
16121
17137
|
if (msToken) {
|
|
@@ -16147,8 +17163,11 @@ var __webpack_exports__ = {};
|
|
|
16147
17163
|
},
|
|
16148
17164
|
defaultErrorMsg: "draft" === params.saveType ? "文章同步异常,请稍后重试。" : "文章发布异常,请稍后重试。"
|
|
16149
17165
|
};
|
|
16150
|
-
const
|
|
16151
|
-
|
|
17166
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
17167
|
+
headers
|
|
17168
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
17169
|
+
const publishResult = await proxyHttp.api(publishOption);
|
|
17170
|
+
return success(publishResult.data.pgc_id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
16152
17171
|
};
|
|
16153
17172
|
const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
|
|
16154
17173
|
const rpa_rpaAction = async (task, params)=>{
|
|
@@ -16360,6 +17379,7 @@ var __webpack_exports__ = {};
|
|
|
16360
17379
|
const confirmBtn = page.locator('div.byte-modal-footer button.byte-btn-primary:has-text("确定")');
|
|
16361
17380
|
if (await confirmBtn.isVisible()) await confirmBtn.click();
|
|
16362
17381
|
}
|
|
17382
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
16363
17383
|
if ("publish" === params.saveType) {
|
|
16364
17384
|
await page.locator(".publish-footer button").filter({
|
|
16365
17385
|
hasText: params.settingInfo.timer ? "定时发布" : "确认发布"
|
|
@@ -17100,10 +18120,10 @@ var __webpack_exports__ = {};
|
|
|
17100
18120
|
}
|
|
17101
18121
|
const final = filtered.slice(0, pageSize);
|
|
17102
18122
|
const articleCell = final.map((item)=>({
|
|
17103
|
-
title: item.title,
|
|
17104
|
-
imageUrl: JSON.parse(item.cover_images)[0]
|
|
18123
|
+
title: item?.is_transfer ?? false ? item.content || "" : item.title,
|
|
18124
|
+
imageUrl: JSON.parse(item.cover_images)[0]?.src || "",
|
|
17105
18125
|
createTime: Math.floor(new Date(item.publish_at.replace(/-/g, "/")).getTime() / 1000),
|
|
17106
|
-
redirectUrl: item.url,
|
|
18126
|
+
redirectUrl: item.url || item.share_url,
|
|
17107
18127
|
recommendNum: item.rec_amount | item.forward_num,
|
|
17108
18128
|
collectNum: item.collection_amount,
|
|
17109
18129
|
readNum: item.read_amount | item.read_num,
|
|
@@ -17451,13 +18471,14 @@ var __webpack_exports__ = {};
|
|
|
17451
18471
|
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
17452
18472
|
const client_time_diff = +Number("1743488763") - Math.floor(new Date().getTime() / 1000);
|
|
17453
18473
|
const tmpCachePath = task.getTmpPath();
|
|
18474
|
+
const headers = {
|
|
18475
|
+
"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",
|
|
18476
|
+
Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
18477
|
+
origin: "https://mp.weixin.qq.com",
|
|
18478
|
+
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()}`
|
|
18479
|
+
};
|
|
17454
18480
|
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
|
-
}
|
|
18481
|
+
headers
|
|
17461
18482
|
});
|
|
17462
18483
|
http.addResponseInterceptor((response)=>{
|
|
17463
18484
|
const responseData = response.data;
|
|
@@ -17797,6 +18818,7 @@ var __webpack_exports__ = {};
|
|
|
17797
18818
|
masssend_check: 1,
|
|
17798
18819
|
is_masssend: 1
|
|
17799
18820
|
};
|
|
18821
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
17800
18822
|
const { appMsgId } = await http.api({
|
|
17801
18823
|
method: "post",
|
|
17802
18824
|
url: "https://mp.weixin.qq.com/cgi-bin/operate_appmsg",
|
|
@@ -18022,7 +19044,7 @@ var __webpack_exports__ = {};
|
|
|
18022
19044
|
responseType: "arraybuffer"
|
|
18023
19045
|
});
|
|
18024
19046
|
const qrcodeBuffer = Buffer.from(qrcodeResult);
|
|
18025
|
-
const qrcodeFilePath = external_node_path_default().join(tmpCachePath,
|
|
19047
|
+
const qrcodeFilePath = external_node_path_default().join(tmpCachePath, `weixin_qrcode_${Date.now()}.jpg`);
|
|
18026
19048
|
external_node_fs_default().writeFileSync(qrcodeFilePath, new Uint8Array(qrcodeBuffer));
|
|
18027
19049
|
params.safeQrcodeCallback?.(qrcodeFilePath);
|
|
18028
19050
|
let code = "";
|
|
@@ -18077,7 +19099,10 @@ var __webpack_exports__ = {};
|
|
|
18077
19099
|
uuid
|
|
18078
19100
|
})
|
|
18079
19101
|
});
|
|
18080
|
-
|
|
19102
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
19103
|
+
headers
|
|
19104
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
19105
|
+
await proxyHttp.api({
|
|
18081
19106
|
method: "post",
|
|
18082
19107
|
url: "https://mp.weixin.qq.com/cgi-bin/masssend",
|
|
18083
19108
|
params: {
|
|
@@ -18126,7 +19151,7 @@ var __webpack_exports__ = {};
|
|
|
18126
19151
|
}),
|
|
18127
19152
|
defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
|
|
18128
19153
|
});
|
|
18129
|
-
return success(appMsgId,
|
|
19154
|
+
return success(appMsgId, `微信公众号发布完成!` + (proxyHttp.proxyInfo || ""));
|
|
18130
19155
|
};
|
|
18131
19156
|
const waitQrcodeResultMaxTime = 2000 * scanRetryMaxCount;
|
|
18132
19157
|
const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
@@ -18455,6 +19480,7 @@ var __webpack_exports__ = {};
|
|
|
18455
19480
|
await poperInstance.locator('.frm_radio_item label[for="not_recomment_0"]').click();
|
|
18456
19481
|
}
|
|
18457
19482
|
await page.waitForTimeout(1000);
|
|
19483
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
18458
19484
|
const articleId = await new Promise(async (resolve)=>{
|
|
18459
19485
|
const handleResponse = async (response)=>{
|
|
18460
19486
|
const url = response.url();
|
|
@@ -19013,7 +20039,11 @@ var __webpack_exports__ = {};
|
|
|
19013
20039
|
const publishXt = Date.now().toString();
|
|
19014
20040
|
const publishXs = mock_xsEncrypt.signXsPost("/web_api/sns/v2/note", a1Cookie, "xhs-pc-web", publishData);
|
|
19015
20041
|
const xscommon = GenXSCommon(a1Cookie, publishXt, publishXs);
|
|
19016
|
-
const
|
|
20042
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
20043
|
+
headers
|
|
20044
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
20045
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
20046
|
+
const publishResult = await proxyHttp.api({
|
|
19017
20047
|
method: "post",
|
|
19018
20048
|
url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
|
|
19019
20049
|
data: publishData,
|
|
@@ -19024,7 +20054,7 @@ var __webpack_exports__ = {};
|
|
|
19024
20054
|
},
|
|
19025
20055
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
19026
20056
|
});
|
|
19027
|
-
return success(publishResult.data?.id);
|
|
20057
|
+
return success(publishResult.data?.id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
19028
20058
|
};
|
|
19029
20059
|
const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
|
|
19030
20060
|
const rpa_xsEncrypt = new Xhshow();
|
|
@@ -19220,6 +20250,7 @@ var __webpack_exports__ = {};
|
|
|
19220
20250
|
hasText: "仅自己可见"
|
|
19221
20251
|
}).click();
|
|
19222
20252
|
}
|
|
20253
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
19223
20254
|
const releaseTimeInstance = page.locator("label").filter({
|
|
19224
20255
|
hasText: params.isImmediatelyPublish ? "立即发布" : "定时发布"
|
|
19225
20256
|
});
|
|
@@ -19245,26 +20276,41 @@ var __webpack_exports__ = {};
|
|
|
19245
20276
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
19246
20277
|
};
|
|
19247
20278
|
var package_namespaceObject = {
|
|
19248
|
-
i8: "1.2.
|
|
20279
|
+
i8: "1.2.24"
|
|
19249
20280
|
};
|
|
20281
|
+
const BetaFlag = "HuiwenCanary";
|
|
19250
20282
|
class Action {
|
|
19251
20283
|
constructor(task){
|
|
19252
20284
|
this.task = task;
|
|
19253
20285
|
}
|
|
19254
20286
|
async bindTask(func, params) {
|
|
19255
20287
|
let responseData;
|
|
19256
|
-
|
|
19257
|
-
|
|
20288
|
+
this.task.isBeta = this.task?.isFeatOn ? this.task?.isFeatOn(BetaFlag) : false;
|
|
20289
|
+
this.task._timerRecord = {
|
|
20290
|
+
ActionStart: Date.now()
|
|
20291
|
+
};
|
|
20292
|
+
if (this.task?.setArticleId) this.task.setArticleId(params.articleId ?? "");
|
|
20293
|
+
if (this.task?.setSaveType ?? false) this.task.setSaveType(params.saveType ?? "");
|
|
20294
|
+
if (this.task?.isInitializedGB !== void 0) this.task.setGbInitType(this.task.isInitializedGB);
|
|
20295
|
+
if ("object" == typeof params) params.cookies = params?.cookies ?? [];
|
|
19258
20296
|
try {
|
|
19259
20297
|
responseData = await func(this.task, params);
|
|
19260
20298
|
} catch (error) {
|
|
19261
20299
|
responseData = Http.handleApiError(error);
|
|
20300
|
+
} finally{
|
|
20301
|
+
this.task._timerRecord['ActionEnd'] = Date.now();
|
|
19262
20302
|
}
|
|
20303
|
+
if (this.task.isBeta && this.task.setTimeConsuming) this.task.setTimeConsuming(this.task._timerRecord);
|
|
19263
20304
|
if (200 === responseData.code) this.task.logger.info(`${func.name} action params error`, responseData);
|
|
19264
20305
|
else if (0 !== responseData.code) {
|
|
19265
20306
|
this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
|
|
19266
20307
|
this.task.logger.info(`${func.name} action failed`);
|
|
19267
20308
|
} else this.task.logger.info(`${func.name} action success`);
|
|
20309
|
+
if (this.task.debug && this.task._timerRecord['PrePublish']) {
|
|
20310
|
+
console.log("预处理图片耗时:", (this.task._timerRecord['PrePublish'] - this.task._timerRecord['ActionStart']) / 1000, "s");
|
|
20311
|
+
console.log("发文接口耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['PrePublish']) / 1000, "s");
|
|
20312
|
+
}
|
|
20313
|
+
this.task.debug && console.log("Action整体耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['ActionStart']) / 1000, "s");
|
|
19268
20314
|
return responseData;
|
|
19269
20315
|
}
|
|
19270
20316
|
FetchArticles(params) {
|