@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/index.mjs
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_assert__ from "assert";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_http__ from "http";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_https__ from "https";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE_net__ from "net";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE_os__ from "os";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tls__ from "tls";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE_tty__ from "tty";
|
|
8
|
+
import * as __WEBPACK_EXTERNAL_MODULE_url__ from "url";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE_util__ from "util";
|
|
1
10
|
import * as __WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__ from "node:fs";
|
|
2
11
|
import * as __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__ from "node:path";
|
|
3
12
|
import * as __WEBPACK_EXTERNAL_MODULE_dom_serializer_aa70940b__ from "dom-serializer";
|
|
@@ -10,6 +19,1055 @@ import * as __WEBPACK_EXTERNAL_MODULE_form_data_cf000082__ from "form-data";
|
|
|
10
19
|
import * as __WEBPACK_EXTERNAL_MODULE_node_buffer_fb286294__ from "node:buffer";
|
|
11
20
|
import * as __WEBPACK_EXTERNAL_MODULE_node_crypto_9ba42079__ from "node:crypto";
|
|
12
21
|
var __webpack_modules__ = {
|
|
22
|
+
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
23
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
24
|
+
if (void 0 === k2) k2 = k;
|
|
25
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
26
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return m[k];
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
Object.defineProperty(o, k2, desc);
|
|
33
|
+
} : function(o, m, k, k2) {
|
|
34
|
+
if (void 0 === k2) k2 = k;
|
|
35
|
+
o[k2] = m[k];
|
|
36
|
+
});
|
|
37
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
38
|
+
Object.defineProperty(o, "default", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
value: v
|
|
41
|
+
});
|
|
42
|
+
} : function(o, v) {
|
|
43
|
+
o["default"] = v;
|
|
44
|
+
});
|
|
45
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
46
|
+
if (mod && mod.__esModule) return mod;
|
|
47
|
+
var result = {};
|
|
48
|
+
if (null != mod) {
|
|
49
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
50
|
+
}
|
|
51
|
+
__setModuleDefault(result, mod);
|
|
52
|
+
return result;
|
|
53
|
+
};
|
|
54
|
+
Object.defineProperty(exports, "__esModule", {
|
|
55
|
+
value: true
|
|
56
|
+
});
|
|
57
|
+
exports.req = exports.json = exports.toBuffer = void 0;
|
|
58
|
+
const http = __importStar(__webpack_require__("http"));
|
|
59
|
+
const https = __importStar(__webpack_require__("https"));
|
|
60
|
+
async function toBuffer(stream) {
|
|
61
|
+
let length = 0;
|
|
62
|
+
const chunks = [];
|
|
63
|
+
for await (const chunk of stream){
|
|
64
|
+
length += chunk.length;
|
|
65
|
+
chunks.push(chunk);
|
|
66
|
+
}
|
|
67
|
+
return Buffer.concat(chunks, length);
|
|
68
|
+
}
|
|
69
|
+
exports.toBuffer = toBuffer;
|
|
70
|
+
async function json(stream) {
|
|
71
|
+
const buf = await toBuffer(stream);
|
|
72
|
+
const str = buf.toString('utf8');
|
|
73
|
+
try {
|
|
74
|
+
return JSON.parse(str);
|
|
75
|
+
} catch (_err) {
|
|
76
|
+
const err = _err;
|
|
77
|
+
err.message += ` (input: ${str})`;
|
|
78
|
+
throw err;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.json = json;
|
|
82
|
+
function req(url, opts = {}) {
|
|
83
|
+
const href = 'string' == typeof url ? url : url.href;
|
|
84
|
+
const req1 = (href.startsWith('https:') ? https : http).request(url, opts);
|
|
85
|
+
const promise = new Promise((resolve, reject)=>{
|
|
86
|
+
req1.once('response', resolve).once('error', reject).end();
|
|
87
|
+
});
|
|
88
|
+
req1.then = promise.then.bind(promise);
|
|
89
|
+
return req1;
|
|
90
|
+
}
|
|
91
|
+
exports.req = req;
|
|
92
|
+
},
|
|
93
|
+
"../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
94
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
95
|
+
if (void 0 === k2) k2 = k;
|
|
96
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
97
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
98
|
+
enumerable: true,
|
|
99
|
+
get: function() {
|
|
100
|
+
return m[k];
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
Object.defineProperty(o, k2, desc);
|
|
104
|
+
} : function(o, m, k, k2) {
|
|
105
|
+
if (void 0 === k2) k2 = k;
|
|
106
|
+
o[k2] = m[k];
|
|
107
|
+
});
|
|
108
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
109
|
+
Object.defineProperty(o, "default", {
|
|
110
|
+
enumerable: true,
|
|
111
|
+
value: v
|
|
112
|
+
});
|
|
113
|
+
} : function(o, v) {
|
|
114
|
+
o["default"] = v;
|
|
115
|
+
});
|
|
116
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
117
|
+
if (mod && mod.__esModule) return mod;
|
|
118
|
+
var result = {};
|
|
119
|
+
if (null != mod) {
|
|
120
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
121
|
+
}
|
|
122
|
+
__setModuleDefault(result, mod);
|
|
123
|
+
return result;
|
|
124
|
+
};
|
|
125
|
+
var __exportStar = this && this.__exportStar || function(m, exports) {
|
|
126
|
+
for(var p in m)if ("default" !== p && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
127
|
+
};
|
|
128
|
+
Object.defineProperty(exports, "__esModule", {
|
|
129
|
+
value: true
|
|
130
|
+
});
|
|
131
|
+
exports.Agent = void 0;
|
|
132
|
+
const net = __importStar(__webpack_require__("net"));
|
|
133
|
+
const http = __importStar(__webpack_require__("http"));
|
|
134
|
+
const https_1 = __webpack_require__("https");
|
|
135
|
+
__exportStar(__webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/helpers.js"), exports);
|
|
136
|
+
const INTERNAL = Symbol('AgentBaseInternalState');
|
|
137
|
+
class Agent extends http.Agent {
|
|
138
|
+
constructor(opts){
|
|
139
|
+
super(opts);
|
|
140
|
+
this[INTERNAL] = {};
|
|
141
|
+
}
|
|
142
|
+
isSecureEndpoint(options) {
|
|
143
|
+
if (options) {
|
|
144
|
+
if ('boolean' == typeof options.secureEndpoint) return options.secureEndpoint;
|
|
145
|
+
if ('string' == typeof options.protocol) return 'https:' === options.protocol;
|
|
146
|
+
}
|
|
147
|
+
const { stack } = new Error();
|
|
148
|
+
if ('string' != typeof stack) return false;
|
|
149
|
+
return stack.split('\n').some((l)=>-1 !== l.indexOf('(https.js:') || -1 !== l.indexOf('node:https:'));
|
|
150
|
+
}
|
|
151
|
+
incrementSockets(name) {
|
|
152
|
+
if (this.maxSockets === 1 / 0 && this.maxTotalSockets === 1 / 0) return null;
|
|
153
|
+
if (!this.sockets[name]) this.sockets[name] = [];
|
|
154
|
+
const fakeSocket = new net.Socket({
|
|
155
|
+
writable: false
|
|
156
|
+
});
|
|
157
|
+
this.sockets[name].push(fakeSocket);
|
|
158
|
+
this.totalSocketCount++;
|
|
159
|
+
return fakeSocket;
|
|
160
|
+
}
|
|
161
|
+
decrementSockets(name, socket) {
|
|
162
|
+
if (!this.sockets[name] || null === socket) return;
|
|
163
|
+
const sockets = this.sockets[name];
|
|
164
|
+
const index = sockets.indexOf(socket);
|
|
165
|
+
if (-1 !== index) {
|
|
166
|
+
sockets.splice(index, 1);
|
|
167
|
+
this.totalSocketCount--;
|
|
168
|
+
if (0 === sockets.length) delete this.sockets[name];
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
getName(options) {
|
|
172
|
+
const secureEndpoint = this.isSecureEndpoint(options);
|
|
173
|
+
if (secureEndpoint) return https_1.Agent.prototype.getName.call(this, options);
|
|
174
|
+
return super.getName(options);
|
|
175
|
+
}
|
|
176
|
+
createSocket(req, options, cb) {
|
|
177
|
+
const connectOpts = {
|
|
178
|
+
...options,
|
|
179
|
+
secureEndpoint: this.isSecureEndpoint(options)
|
|
180
|
+
};
|
|
181
|
+
const name = this.getName(connectOpts);
|
|
182
|
+
const fakeSocket = this.incrementSockets(name);
|
|
183
|
+
Promise.resolve().then(()=>this.connect(req, connectOpts)).then((socket)=>{
|
|
184
|
+
this.decrementSockets(name, fakeSocket);
|
|
185
|
+
if (socket instanceof http.Agent) try {
|
|
186
|
+
return socket.addRequest(req, connectOpts);
|
|
187
|
+
} catch (err) {
|
|
188
|
+
return cb(err);
|
|
189
|
+
}
|
|
190
|
+
this[INTERNAL].currentSocket = socket;
|
|
191
|
+
super.createSocket(req, options, cb);
|
|
192
|
+
}, (err)=>{
|
|
193
|
+
this.decrementSockets(name, fakeSocket);
|
|
194
|
+
cb(err);
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
createConnection() {
|
|
198
|
+
const socket = this[INTERNAL].currentSocket;
|
|
199
|
+
this[INTERNAL].currentSocket = void 0;
|
|
200
|
+
if (!socket) throw new Error('No socket was returned in the `connect()` function');
|
|
201
|
+
return socket;
|
|
202
|
+
}
|
|
203
|
+
get defaultPort() {
|
|
204
|
+
return this[INTERNAL].defaultPort ?? ('https:' === this.protocol ? 443 : 80);
|
|
205
|
+
}
|
|
206
|
+
set defaultPort(v) {
|
|
207
|
+
if (this[INTERNAL]) this[INTERNAL].defaultPort = v;
|
|
208
|
+
}
|
|
209
|
+
get protocol() {
|
|
210
|
+
return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? 'https:' : 'http:');
|
|
211
|
+
}
|
|
212
|
+
set protocol(v) {
|
|
213
|
+
if (this[INTERNAL]) this[INTERNAL].protocol = v;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
exports.Agent = Agent;
|
|
217
|
+
},
|
|
218
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js": function(module, exports, __webpack_require__) {
|
|
219
|
+
exports.formatArgs = formatArgs;
|
|
220
|
+
exports.save = save;
|
|
221
|
+
exports.load = load;
|
|
222
|
+
exports.useColors = useColors;
|
|
223
|
+
exports.storage = localstorage();
|
|
224
|
+
exports.destroy = (()=>{
|
|
225
|
+
let warned = false;
|
|
226
|
+
return ()=>{
|
|
227
|
+
if (!warned) {
|
|
228
|
+
warned = true;
|
|
229
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
})();
|
|
233
|
+
exports.colors = [
|
|
234
|
+
'#0000CC',
|
|
235
|
+
'#0000FF',
|
|
236
|
+
'#0033CC',
|
|
237
|
+
'#0033FF',
|
|
238
|
+
'#0066CC',
|
|
239
|
+
'#0066FF',
|
|
240
|
+
'#0099CC',
|
|
241
|
+
'#0099FF',
|
|
242
|
+
'#00CC00',
|
|
243
|
+
'#00CC33',
|
|
244
|
+
'#00CC66',
|
|
245
|
+
'#00CC99',
|
|
246
|
+
'#00CCCC',
|
|
247
|
+
'#00CCFF',
|
|
248
|
+
'#3300CC',
|
|
249
|
+
'#3300FF',
|
|
250
|
+
'#3333CC',
|
|
251
|
+
'#3333FF',
|
|
252
|
+
'#3366CC',
|
|
253
|
+
'#3366FF',
|
|
254
|
+
'#3399CC',
|
|
255
|
+
'#3399FF',
|
|
256
|
+
'#33CC00',
|
|
257
|
+
'#33CC33',
|
|
258
|
+
'#33CC66',
|
|
259
|
+
'#33CC99',
|
|
260
|
+
'#33CCCC',
|
|
261
|
+
'#33CCFF',
|
|
262
|
+
'#6600CC',
|
|
263
|
+
'#6600FF',
|
|
264
|
+
'#6633CC',
|
|
265
|
+
'#6633FF',
|
|
266
|
+
'#66CC00',
|
|
267
|
+
'#66CC33',
|
|
268
|
+
'#9900CC',
|
|
269
|
+
'#9900FF',
|
|
270
|
+
'#9933CC',
|
|
271
|
+
'#9933FF',
|
|
272
|
+
'#99CC00',
|
|
273
|
+
'#99CC33',
|
|
274
|
+
'#CC0000',
|
|
275
|
+
'#CC0033',
|
|
276
|
+
'#CC0066',
|
|
277
|
+
'#CC0099',
|
|
278
|
+
'#CC00CC',
|
|
279
|
+
'#CC00FF',
|
|
280
|
+
'#CC3300',
|
|
281
|
+
'#CC3333',
|
|
282
|
+
'#CC3366',
|
|
283
|
+
'#CC3399',
|
|
284
|
+
'#CC33CC',
|
|
285
|
+
'#CC33FF',
|
|
286
|
+
'#CC6600',
|
|
287
|
+
'#CC6633',
|
|
288
|
+
'#CC9900',
|
|
289
|
+
'#CC9933',
|
|
290
|
+
'#CCCC00',
|
|
291
|
+
'#CCCC33',
|
|
292
|
+
'#FF0000',
|
|
293
|
+
'#FF0033',
|
|
294
|
+
'#FF0066',
|
|
295
|
+
'#FF0099',
|
|
296
|
+
'#FF00CC',
|
|
297
|
+
'#FF00FF',
|
|
298
|
+
'#FF3300',
|
|
299
|
+
'#FF3333',
|
|
300
|
+
'#FF3366',
|
|
301
|
+
'#FF3399',
|
|
302
|
+
'#FF33CC',
|
|
303
|
+
'#FF33FF',
|
|
304
|
+
'#FF6600',
|
|
305
|
+
'#FF6633',
|
|
306
|
+
'#FF9900',
|
|
307
|
+
'#FF9933',
|
|
308
|
+
'#FFCC00',
|
|
309
|
+
'#FFCC33'
|
|
310
|
+
];
|
|
311
|
+
function useColors() {
|
|
312
|
+
if ('undefined' != typeof window && window.process && ('renderer' === window.process.type || window.process.__nwjs)) return true;
|
|
313
|
+
if ('undefined' != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return false;
|
|
314
|
+
let m;
|
|
315
|
+
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+)/);
|
|
316
|
+
}
|
|
317
|
+
function formatArgs(args) {
|
|
318
|
+
args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
|
319
|
+
if (!this.useColors) return;
|
|
320
|
+
const c = 'color: ' + this.color;
|
|
321
|
+
args.splice(1, 0, c, 'color: inherit');
|
|
322
|
+
let index = 0;
|
|
323
|
+
let lastC = 0;
|
|
324
|
+
args[0].replace(/%[a-zA-Z%]/g, (match)=>{
|
|
325
|
+
if ('%%' === match) return;
|
|
326
|
+
index++;
|
|
327
|
+
if ('%c' === match) lastC = index;
|
|
328
|
+
});
|
|
329
|
+
args.splice(lastC, 0, c);
|
|
330
|
+
}
|
|
331
|
+
exports.log = console.debug || console.log || (()=>{});
|
|
332
|
+
function save(namespaces) {
|
|
333
|
+
try {
|
|
334
|
+
if (namespaces) exports.storage.setItem('debug', namespaces);
|
|
335
|
+
else exports.storage.removeItem('debug');
|
|
336
|
+
} catch (error) {}
|
|
337
|
+
}
|
|
338
|
+
function load() {
|
|
339
|
+
let r;
|
|
340
|
+
try {
|
|
341
|
+
r = exports.storage.getItem('debug');
|
|
342
|
+
} catch (error) {}
|
|
343
|
+
if (!r && 'undefined' != typeof process && 'env' in process) r = process.env.DEBUG;
|
|
344
|
+
return r;
|
|
345
|
+
}
|
|
346
|
+
function localstorage() {
|
|
347
|
+
try {
|
|
348
|
+
return localStorage;
|
|
349
|
+
} catch (error) {}
|
|
350
|
+
}
|
|
351
|
+
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);
|
|
352
|
+
const { formatters } = module.exports;
|
|
353
|
+
formatters.j = function(v) {
|
|
354
|
+
try {
|
|
355
|
+
return JSON.stringify(v);
|
|
356
|
+
} catch (error) {
|
|
357
|
+
return '[UnexpectedJSONParseError]: ' + error.message;
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
},
|
|
361
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
362
|
+
function setup(env) {
|
|
363
|
+
createDebug.debug = createDebug;
|
|
364
|
+
createDebug.default = createDebug;
|
|
365
|
+
createDebug.coerce = coerce;
|
|
366
|
+
createDebug.disable = disable;
|
|
367
|
+
createDebug.enable = enable;
|
|
368
|
+
createDebug.enabled = enabled;
|
|
369
|
+
createDebug.humanize = __webpack_require__("../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js");
|
|
370
|
+
createDebug.destroy = destroy;
|
|
371
|
+
Object.keys(env).forEach((key)=>{
|
|
372
|
+
createDebug[key] = env[key];
|
|
373
|
+
});
|
|
374
|
+
createDebug.names = [];
|
|
375
|
+
createDebug.skips = [];
|
|
376
|
+
createDebug.formatters = {};
|
|
377
|
+
function selectColor(namespace) {
|
|
378
|
+
let hash = 0;
|
|
379
|
+
for(let i = 0; i < namespace.length; i++){
|
|
380
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
381
|
+
hash |= 0;
|
|
382
|
+
}
|
|
383
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
384
|
+
}
|
|
385
|
+
createDebug.selectColor = selectColor;
|
|
386
|
+
function createDebug(namespace) {
|
|
387
|
+
let prevTime;
|
|
388
|
+
let enableOverride = null;
|
|
389
|
+
let namespacesCache;
|
|
390
|
+
let enabledCache;
|
|
391
|
+
function debug(...args) {
|
|
392
|
+
if (!debug.enabled) return;
|
|
393
|
+
const self = debug;
|
|
394
|
+
const curr = Number(new Date());
|
|
395
|
+
const ms = curr - (prevTime || curr);
|
|
396
|
+
self.diff = ms;
|
|
397
|
+
self.prev = prevTime;
|
|
398
|
+
self.curr = curr;
|
|
399
|
+
prevTime = curr;
|
|
400
|
+
args[0] = createDebug.coerce(args[0]);
|
|
401
|
+
if ('string' != typeof args[0]) args.unshift('%O');
|
|
402
|
+
let index = 0;
|
|
403
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format)=>{
|
|
404
|
+
if ('%%' === match) return '%';
|
|
405
|
+
index++;
|
|
406
|
+
const formatter = createDebug.formatters[format];
|
|
407
|
+
if ('function' == typeof formatter) {
|
|
408
|
+
const val = args[index];
|
|
409
|
+
match = formatter.call(self, val);
|
|
410
|
+
args.splice(index, 1);
|
|
411
|
+
index--;
|
|
412
|
+
}
|
|
413
|
+
return match;
|
|
414
|
+
});
|
|
415
|
+
createDebug.formatArgs.call(self, args);
|
|
416
|
+
const logFn = self.log || createDebug.log;
|
|
417
|
+
logFn.apply(self, args);
|
|
418
|
+
}
|
|
419
|
+
debug.namespace = namespace;
|
|
420
|
+
debug.useColors = createDebug.useColors();
|
|
421
|
+
debug.color = createDebug.selectColor(namespace);
|
|
422
|
+
debug.extend = extend;
|
|
423
|
+
debug.destroy = createDebug.destroy;
|
|
424
|
+
Object.defineProperty(debug, 'enabled', {
|
|
425
|
+
enumerable: true,
|
|
426
|
+
configurable: false,
|
|
427
|
+
get: ()=>{
|
|
428
|
+
if (null !== enableOverride) return enableOverride;
|
|
429
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
430
|
+
namespacesCache = createDebug.namespaces;
|
|
431
|
+
enabledCache = createDebug.enabled(namespace);
|
|
432
|
+
}
|
|
433
|
+
return enabledCache;
|
|
434
|
+
},
|
|
435
|
+
set: (v)=>{
|
|
436
|
+
enableOverride = v;
|
|
437
|
+
}
|
|
438
|
+
});
|
|
439
|
+
if ('function' == typeof createDebug.init) createDebug.init(debug);
|
|
440
|
+
return debug;
|
|
441
|
+
}
|
|
442
|
+
function extend(namespace, delimiter) {
|
|
443
|
+
const newDebug = createDebug(this.namespace + (void 0 === delimiter ? ':' : delimiter) + namespace);
|
|
444
|
+
newDebug.log = this.log;
|
|
445
|
+
return newDebug;
|
|
446
|
+
}
|
|
447
|
+
function enable(namespaces) {
|
|
448
|
+
createDebug.save(namespaces);
|
|
449
|
+
createDebug.namespaces = namespaces;
|
|
450
|
+
createDebug.names = [];
|
|
451
|
+
createDebug.skips = [];
|
|
452
|
+
const split = ('string' == typeof namespaces ? namespaces : '').trim().replace(' ', ',').split(',').filter(Boolean);
|
|
453
|
+
for (const ns of split)if ('-' === ns[0]) createDebug.skips.push(ns.slice(1));
|
|
454
|
+
else createDebug.names.push(ns);
|
|
455
|
+
}
|
|
456
|
+
function matchesTemplate(search, template) {
|
|
457
|
+
let searchIndex = 0;
|
|
458
|
+
let templateIndex = 0;
|
|
459
|
+
let starIndex = -1;
|
|
460
|
+
let matchIndex = 0;
|
|
461
|
+
while(searchIndex < search.length)if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || '*' === template[templateIndex])) {
|
|
462
|
+
if ('*' === template[templateIndex]) {
|
|
463
|
+
starIndex = templateIndex;
|
|
464
|
+
matchIndex = searchIndex;
|
|
465
|
+
templateIndex++;
|
|
466
|
+
} else {
|
|
467
|
+
searchIndex++;
|
|
468
|
+
templateIndex++;
|
|
469
|
+
}
|
|
470
|
+
} else {
|
|
471
|
+
if (-1 === starIndex) return false;
|
|
472
|
+
templateIndex = starIndex + 1;
|
|
473
|
+
matchIndex++;
|
|
474
|
+
searchIndex = matchIndex;
|
|
475
|
+
}
|
|
476
|
+
while(templateIndex < template.length && '*' === template[templateIndex])templateIndex++;
|
|
477
|
+
return templateIndex === template.length;
|
|
478
|
+
}
|
|
479
|
+
function disable() {
|
|
480
|
+
const namespaces = [
|
|
481
|
+
...createDebug.names,
|
|
482
|
+
...createDebug.skips.map((namespace)=>'-' + namespace)
|
|
483
|
+
].join(',');
|
|
484
|
+
createDebug.enable('');
|
|
485
|
+
return namespaces;
|
|
486
|
+
}
|
|
487
|
+
function enabled(name) {
|
|
488
|
+
for (const skip of createDebug.skips)if (matchesTemplate(name, skip)) return false;
|
|
489
|
+
for (const ns of createDebug.names)if (matchesTemplate(name, ns)) return true;
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
function coerce(val) {
|
|
493
|
+
if (val instanceof Error) return val.stack || val.message;
|
|
494
|
+
return val;
|
|
495
|
+
}
|
|
496
|
+
function destroy() {
|
|
497
|
+
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
498
|
+
}
|
|
499
|
+
createDebug.enable(createDebug.load());
|
|
500
|
+
return createDebug;
|
|
501
|
+
}
|
|
502
|
+
module.exports = setup;
|
|
503
|
+
},
|
|
504
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
505
|
+
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");
|
|
506
|
+
else module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js");
|
|
507
|
+
},
|
|
508
|
+
"../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js": function(module, exports, __webpack_require__) {
|
|
509
|
+
const tty = __webpack_require__("tty");
|
|
510
|
+
const util = __webpack_require__("util");
|
|
511
|
+
exports.init = init;
|
|
512
|
+
exports.log = log;
|
|
513
|
+
exports.formatArgs = formatArgs;
|
|
514
|
+
exports.save = save;
|
|
515
|
+
exports.load = load;
|
|
516
|
+
exports.useColors = useColors;
|
|
517
|
+
exports.destroy = util.deprecate(()=>{}, 'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
|
|
518
|
+
exports.colors = [
|
|
519
|
+
6,
|
|
520
|
+
2,
|
|
521
|
+
3,
|
|
522
|
+
4,
|
|
523
|
+
5,
|
|
524
|
+
1
|
|
525
|
+
];
|
|
526
|
+
try {
|
|
527
|
+
const supportsColor = __webpack_require__("../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js");
|
|
528
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports.colors = [
|
|
529
|
+
20,
|
|
530
|
+
21,
|
|
531
|
+
26,
|
|
532
|
+
27,
|
|
533
|
+
32,
|
|
534
|
+
33,
|
|
535
|
+
38,
|
|
536
|
+
39,
|
|
537
|
+
40,
|
|
538
|
+
41,
|
|
539
|
+
42,
|
|
540
|
+
43,
|
|
541
|
+
44,
|
|
542
|
+
45,
|
|
543
|
+
56,
|
|
544
|
+
57,
|
|
545
|
+
62,
|
|
546
|
+
63,
|
|
547
|
+
68,
|
|
548
|
+
69,
|
|
549
|
+
74,
|
|
550
|
+
75,
|
|
551
|
+
76,
|
|
552
|
+
77,
|
|
553
|
+
78,
|
|
554
|
+
79,
|
|
555
|
+
80,
|
|
556
|
+
81,
|
|
557
|
+
92,
|
|
558
|
+
93,
|
|
559
|
+
98,
|
|
560
|
+
99,
|
|
561
|
+
112,
|
|
562
|
+
113,
|
|
563
|
+
128,
|
|
564
|
+
129,
|
|
565
|
+
134,
|
|
566
|
+
135,
|
|
567
|
+
148,
|
|
568
|
+
149,
|
|
569
|
+
160,
|
|
570
|
+
161,
|
|
571
|
+
162,
|
|
572
|
+
163,
|
|
573
|
+
164,
|
|
574
|
+
165,
|
|
575
|
+
166,
|
|
576
|
+
167,
|
|
577
|
+
168,
|
|
578
|
+
169,
|
|
579
|
+
170,
|
|
580
|
+
171,
|
|
581
|
+
172,
|
|
582
|
+
173,
|
|
583
|
+
178,
|
|
584
|
+
179,
|
|
585
|
+
184,
|
|
586
|
+
185,
|
|
587
|
+
196,
|
|
588
|
+
197,
|
|
589
|
+
198,
|
|
590
|
+
199,
|
|
591
|
+
200,
|
|
592
|
+
201,
|
|
593
|
+
202,
|
|
594
|
+
203,
|
|
595
|
+
204,
|
|
596
|
+
205,
|
|
597
|
+
206,
|
|
598
|
+
207,
|
|
599
|
+
208,
|
|
600
|
+
209,
|
|
601
|
+
214,
|
|
602
|
+
215,
|
|
603
|
+
220,
|
|
604
|
+
221
|
|
605
|
+
];
|
|
606
|
+
} catch (error) {}
|
|
607
|
+
exports.inspectOpts = Object.keys(process.env).filter((key)=>/^debug_/i.test(key)).reduce((obj, key)=>{
|
|
608
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k)=>k.toUpperCase());
|
|
609
|
+
let val = process.env[key];
|
|
610
|
+
val = /^(yes|on|true|enabled)$/i.test(val) ? true : /^(no|off|false|disabled)$/i.test(val) ? false : 'null' === val ? null : Number(val);
|
|
611
|
+
obj[prop] = val;
|
|
612
|
+
return obj;
|
|
613
|
+
}, {});
|
|
614
|
+
function useColors() {
|
|
615
|
+
return 'colors' in exports.inspectOpts ? Boolean(exports.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
616
|
+
}
|
|
617
|
+
function formatArgs(args) {
|
|
618
|
+
const { namespace: name, useColors } = this;
|
|
619
|
+
if (useColors) {
|
|
620
|
+
const c = this.color;
|
|
621
|
+
const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
|
|
622
|
+
const prefix = ` ${colorCode};1m${name} \u001B[0m`;
|
|
623
|
+
args[0] = prefix + args[0].split('\n').join('\n' + prefix);
|
|
624
|
+
args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
|
|
625
|
+
} else args[0] = getDate() + name + ' ' + args[0];
|
|
626
|
+
}
|
|
627
|
+
function getDate() {
|
|
628
|
+
if (exports.inspectOpts.hideDate) return '';
|
|
629
|
+
return new Date().toISOString() + ' ';
|
|
630
|
+
}
|
|
631
|
+
function log(...args) {
|
|
632
|
+
return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
|
|
633
|
+
}
|
|
634
|
+
function save(namespaces) {
|
|
635
|
+
if (namespaces) process.env.DEBUG = namespaces;
|
|
636
|
+
else delete process.env.DEBUG;
|
|
637
|
+
}
|
|
638
|
+
function load() {
|
|
639
|
+
return process.env.DEBUG;
|
|
640
|
+
}
|
|
641
|
+
function init(debug) {
|
|
642
|
+
debug.inspectOpts = {};
|
|
643
|
+
const keys = Object.keys(exports.inspectOpts);
|
|
644
|
+
for(let i = 0; i < keys.length; i++)debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
|
|
645
|
+
}
|
|
646
|
+
module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports);
|
|
647
|
+
const { formatters } = module.exports;
|
|
648
|
+
formatters.o = function(v) {
|
|
649
|
+
this.inspectOpts.colors = this.useColors;
|
|
650
|
+
return util.inspect(v, this.inspectOpts).split('\n').map((str)=>str.trim()).join(' ');
|
|
651
|
+
};
|
|
652
|
+
formatters.O = function(v) {
|
|
653
|
+
this.inspectOpts.colors = this.useColors;
|
|
654
|
+
return util.inspect(v, this.inspectOpts);
|
|
655
|
+
};
|
|
656
|
+
},
|
|
657
|
+
"../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js": function(module) {
|
|
658
|
+
module.exports = (flag, argv = process.argv)=>{
|
|
659
|
+
const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
|
|
660
|
+
const position = argv.indexOf(prefix + flag);
|
|
661
|
+
const terminatorPosition = argv.indexOf('--');
|
|
662
|
+
return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
|
|
663
|
+
};
|
|
664
|
+
},
|
|
665
|
+
"../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
666
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function(o, m, k, k2) {
|
|
667
|
+
if (void 0 === k2) k2 = k;
|
|
668
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
669
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) desc = {
|
|
670
|
+
enumerable: true,
|
|
671
|
+
get: function() {
|
|
672
|
+
return m[k];
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
Object.defineProperty(o, k2, desc);
|
|
676
|
+
} : function(o, m, k, k2) {
|
|
677
|
+
if (void 0 === k2) k2 = k;
|
|
678
|
+
o[k2] = m[k];
|
|
679
|
+
});
|
|
680
|
+
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function(o, v) {
|
|
681
|
+
Object.defineProperty(o, "default", {
|
|
682
|
+
enumerable: true,
|
|
683
|
+
value: v
|
|
684
|
+
});
|
|
685
|
+
} : function(o, v) {
|
|
686
|
+
o["default"] = v;
|
|
687
|
+
});
|
|
688
|
+
var __importStar = this && this.__importStar || function(mod) {
|
|
689
|
+
if (mod && mod.__esModule) return mod;
|
|
690
|
+
var result = {};
|
|
691
|
+
if (null != mod) {
|
|
692
|
+
for(var k in mod)if ("default" !== k && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
693
|
+
}
|
|
694
|
+
__setModuleDefault(result, mod);
|
|
695
|
+
return result;
|
|
696
|
+
};
|
|
697
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
698
|
+
return mod && mod.__esModule ? mod : {
|
|
699
|
+
default: mod
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
Object.defineProperty(exports, "__esModule", {
|
|
703
|
+
value: true
|
|
704
|
+
});
|
|
705
|
+
exports.HttpsProxyAgent = void 0;
|
|
706
|
+
const net = __importStar(__webpack_require__("net"));
|
|
707
|
+
const tls = __importStar(__webpack_require__("tls"));
|
|
708
|
+
const assert_1 = __importDefault(__webpack_require__("assert"));
|
|
709
|
+
const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
|
|
710
|
+
const agent_base_1 = __webpack_require__("../../node_modules/.pnpm/agent-base@7.1.4/node_modules/agent-base/dist/index.js");
|
|
711
|
+
const url_1 = __webpack_require__("url");
|
|
712
|
+
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");
|
|
713
|
+
const debug = (0, debug_1.default)('https-proxy-agent');
|
|
714
|
+
const setServernameFromNonIpHost = (options)=>{
|
|
715
|
+
if (void 0 === options.servername && options.host && !net.isIP(options.host)) return {
|
|
716
|
+
...options,
|
|
717
|
+
servername: options.host
|
|
718
|
+
};
|
|
719
|
+
return options;
|
|
720
|
+
};
|
|
721
|
+
class HttpsProxyAgent extends agent_base_1.Agent {
|
|
722
|
+
constructor(proxy, opts){
|
|
723
|
+
super(opts);
|
|
724
|
+
this.options = {
|
|
725
|
+
path: void 0
|
|
726
|
+
};
|
|
727
|
+
this.proxy = 'string' == typeof proxy ? new url_1.URL(proxy) : proxy;
|
|
728
|
+
this.proxyHeaders = opts?.headers ?? {};
|
|
729
|
+
debug('Creating new HttpsProxyAgent instance: %o', this.proxy.href);
|
|
730
|
+
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, '');
|
|
731
|
+
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : 'https:' === this.proxy.protocol ? 443 : 80;
|
|
732
|
+
this.connectOpts = {
|
|
733
|
+
ALPNProtocols: [
|
|
734
|
+
'http/1.1'
|
|
735
|
+
],
|
|
736
|
+
...opts ? omit(opts, 'headers') : null,
|
|
737
|
+
host,
|
|
738
|
+
port
|
|
739
|
+
};
|
|
740
|
+
}
|
|
741
|
+
async connect(req, opts) {
|
|
742
|
+
const { proxy } = this;
|
|
743
|
+
if (!opts.host) throw new TypeError('No "host" provided');
|
|
744
|
+
let socket;
|
|
745
|
+
if ('https:' === proxy.protocol) {
|
|
746
|
+
debug('Creating `tls.Socket`: %o', this.connectOpts);
|
|
747
|
+
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
748
|
+
} else {
|
|
749
|
+
debug('Creating `net.Socket`: %o', this.connectOpts);
|
|
750
|
+
socket = net.connect(this.connectOpts);
|
|
751
|
+
}
|
|
752
|
+
const headers = 'function' == typeof this.proxyHeaders ? this.proxyHeaders() : {
|
|
753
|
+
...this.proxyHeaders
|
|
754
|
+
};
|
|
755
|
+
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
756
|
+
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r\n`;
|
|
757
|
+
if (proxy.username || proxy.password) {
|
|
758
|
+
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
|
759
|
+
headers['Proxy-Authorization'] = `Basic ${Buffer.from(auth).toString('base64')}`;
|
|
760
|
+
}
|
|
761
|
+
headers.Host = `${host}:${opts.port}`;
|
|
762
|
+
if (!headers['Proxy-Connection']) headers['Proxy-Connection'] = this.keepAlive ? 'Keep-Alive' : 'close';
|
|
763
|
+
for (const name of Object.keys(headers))payload += `${name}: ${headers[name]}\r\n`;
|
|
764
|
+
const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
|
|
765
|
+
socket.write(`${payload}\r\n`);
|
|
766
|
+
const { connect, buffered } = await proxyResponsePromise;
|
|
767
|
+
req.emit('proxyConnect', connect);
|
|
768
|
+
this.emit('proxyConnect', connect, req);
|
|
769
|
+
if (200 === connect.statusCode) {
|
|
770
|
+
req.once('socket', resume);
|
|
771
|
+
if (opts.secureEndpoint) {
|
|
772
|
+
debug('Upgrading socket connection to TLS');
|
|
773
|
+
return tls.connect({
|
|
774
|
+
...omit(setServernameFromNonIpHost(opts), 'host', 'path', 'port'),
|
|
775
|
+
socket
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
return socket;
|
|
779
|
+
}
|
|
780
|
+
socket.destroy();
|
|
781
|
+
const fakeSocket = new net.Socket({
|
|
782
|
+
writable: false
|
|
783
|
+
});
|
|
784
|
+
fakeSocket.readable = true;
|
|
785
|
+
req.once('socket', (s)=>{
|
|
786
|
+
debug('Replaying proxy buffer for failed request');
|
|
787
|
+
(0, assert_1.default)(s.listenerCount('data') > 0);
|
|
788
|
+
s.push(buffered);
|
|
789
|
+
s.push(null);
|
|
790
|
+
});
|
|
791
|
+
return fakeSocket;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
HttpsProxyAgent.protocols = [
|
|
795
|
+
'http',
|
|
796
|
+
'https'
|
|
797
|
+
];
|
|
798
|
+
exports.HttpsProxyAgent = HttpsProxyAgent;
|
|
799
|
+
function resume(socket) {
|
|
800
|
+
socket.resume();
|
|
801
|
+
}
|
|
802
|
+
function omit(obj, ...keys) {
|
|
803
|
+
const ret = {};
|
|
804
|
+
let key;
|
|
805
|
+
for(key in obj)if (!keys.includes(key)) ret[key] = obj[key];
|
|
806
|
+
return ret;
|
|
807
|
+
}
|
|
808
|
+
},
|
|
809
|
+
"../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/parse-proxy-response.js": function(__unused_webpack_module, exports, __webpack_require__) {
|
|
810
|
+
var __importDefault = this && this.__importDefault || function(mod) {
|
|
811
|
+
return mod && mod.__esModule ? mod : {
|
|
812
|
+
default: mod
|
|
813
|
+
};
|
|
814
|
+
};
|
|
815
|
+
Object.defineProperty(exports, "__esModule", {
|
|
816
|
+
value: true
|
|
817
|
+
});
|
|
818
|
+
exports.parseProxyResponse = void 0;
|
|
819
|
+
const debug_1 = __importDefault(__webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/index.js"));
|
|
820
|
+
const debug = (0, debug_1.default)('https-proxy-agent:parse-proxy-response');
|
|
821
|
+
function parseProxyResponse(socket) {
|
|
822
|
+
return new Promise((resolve, reject)=>{
|
|
823
|
+
let buffersLength = 0;
|
|
824
|
+
const buffers = [];
|
|
825
|
+
function read() {
|
|
826
|
+
const b = socket.read();
|
|
827
|
+
if (b) ondata(b);
|
|
828
|
+
else socket.once('readable', read);
|
|
829
|
+
}
|
|
830
|
+
function cleanup() {
|
|
831
|
+
socket.removeListener('end', onend);
|
|
832
|
+
socket.removeListener('error', onerror);
|
|
833
|
+
socket.removeListener('readable', read);
|
|
834
|
+
}
|
|
835
|
+
function onend() {
|
|
836
|
+
cleanup();
|
|
837
|
+
debug('onend');
|
|
838
|
+
reject(new Error('Proxy connection ended before receiving CONNECT response'));
|
|
839
|
+
}
|
|
840
|
+
function onerror(err) {
|
|
841
|
+
cleanup();
|
|
842
|
+
debug('onerror %o', err);
|
|
843
|
+
reject(err);
|
|
844
|
+
}
|
|
845
|
+
function ondata(b) {
|
|
846
|
+
buffers.push(b);
|
|
847
|
+
buffersLength += b.length;
|
|
848
|
+
const buffered = Buffer.concat(buffers, buffersLength);
|
|
849
|
+
const endOfHeaders = buffered.indexOf('\r\n\r\n');
|
|
850
|
+
if (-1 === endOfHeaders) {
|
|
851
|
+
debug('have not received end of HTTP headers yet...');
|
|
852
|
+
read();
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
const headerParts = buffered.slice(0, endOfHeaders).toString('ascii').split('\r\n');
|
|
856
|
+
const firstLine = headerParts.shift();
|
|
857
|
+
if (!firstLine) {
|
|
858
|
+
socket.destroy();
|
|
859
|
+
return reject(new Error('No header received from proxy CONNECT response'));
|
|
860
|
+
}
|
|
861
|
+
const firstLineParts = firstLine.split(' ');
|
|
862
|
+
const statusCode = +firstLineParts[1];
|
|
863
|
+
const statusText = firstLineParts.slice(2).join(' ');
|
|
864
|
+
const headers = {};
|
|
865
|
+
for (const header of headerParts){
|
|
866
|
+
if (!header) continue;
|
|
867
|
+
const firstColon = header.indexOf(':');
|
|
868
|
+
if (-1 === firstColon) {
|
|
869
|
+
socket.destroy();
|
|
870
|
+
return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
871
|
+
}
|
|
872
|
+
const key = header.slice(0, firstColon).toLowerCase();
|
|
873
|
+
const value = header.slice(firstColon + 1).trimStart();
|
|
874
|
+
const current = headers[key];
|
|
875
|
+
if ('string' == typeof current) headers[key] = [
|
|
876
|
+
current,
|
|
877
|
+
value
|
|
878
|
+
];
|
|
879
|
+
else if (Array.isArray(current)) current.push(value);
|
|
880
|
+
else headers[key] = value;
|
|
881
|
+
}
|
|
882
|
+
debug('got proxy server response: %o %o', firstLine, headers);
|
|
883
|
+
cleanup();
|
|
884
|
+
resolve({
|
|
885
|
+
connect: {
|
|
886
|
+
statusCode,
|
|
887
|
+
statusText,
|
|
888
|
+
headers
|
|
889
|
+
},
|
|
890
|
+
buffered
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
socket.on('error', onerror);
|
|
894
|
+
socket.on('end', onend);
|
|
895
|
+
read();
|
|
896
|
+
});
|
|
897
|
+
}
|
|
898
|
+
exports.parseProxyResponse = parseProxyResponse;
|
|
899
|
+
},
|
|
900
|
+
"../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js": function(module) {
|
|
901
|
+
var s = 1000;
|
|
902
|
+
var m = 60 * s;
|
|
903
|
+
var h = 60 * m;
|
|
904
|
+
var d = 24 * h;
|
|
905
|
+
var w = 7 * d;
|
|
906
|
+
var y = 365.25 * d;
|
|
907
|
+
module.exports = function(val, options) {
|
|
908
|
+
options = options || {};
|
|
909
|
+
var type = typeof val;
|
|
910
|
+
if ('string' === type && val.length > 0) return parse(val);
|
|
911
|
+
if ('number' === type && isFinite(val)) return options.long ? fmtLong(val) : fmtShort(val);
|
|
912
|
+
throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
|
|
913
|
+
};
|
|
914
|
+
function parse(str) {
|
|
915
|
+
str = String(str);
|
|
916
|
+
if (str.length > 100) return;
|
|
917
|
+
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);
|
|
918
|
+
if (!match) return;
|
|
919
|
+
var n = parseFloat(match[1]);
|
|
920
|
+
var type = (match[2] || 'ms').toLowerCase();
|
|
921
|
+
switch(type){
|
|
922
|
+
case 'years':
|
|
923
|
+
case 'year':
|
|
924
|
+
case 'yrs':
|
|
925
|
+
case 'yr':
|
|
926
|
+
case 'y':
|
|
927
|
+
return n * y;
|
|
928
|
+
case 'weeks':
|
|
929
|
+
case 'week':
|
|
930
|
+
case 'w':
|
|
931
|
+
return n * w;
|
|
932
|
+
case 'days':
|
|
933
|
+
case 'day':
|
|
934
|
+
case 'd':
|
|
935
|
+
return n * d;
|
|
936
|
+
case 'hours':
|
|
937
|
+
case 'hour':
|
|
938
|
+
case 'hrs':
|
|
939
|
+
case 'hr':
|
|
940
|
+
case 'h':
|
|
941
|
+
return n * h;
|
|
942
|
+
case 'minutes':
|
|
943
|
+
case 'minute':
|
|
944
|
+
case 'mins':
|
|
945
|
+
case 'min':
|
|
946
|
+
case 'm':
|
|
947
|
+
return n * m;
|
|
948
|
+
case 'seconds':
|
|
949
|
+
case 'second':
|
|
950
|
+
case 'secs':
|
|
951
|
+
case 'sec':
|
|
952
|
+
case 's':
|
|
953
|
+
return n * s;
|
|
954
|
+
case 'milliseconds':
|
|
955
|
+
case 'millisecond':
|
|
956
|
+
case 'msecs':
|
|
957
|
+
case 'msec':
|
|
958
|
+
case 'ms':
|
|
959
|
+
return n;
|
|
960
|
+
default:
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
function fmtShort(ms) {
|
|
965
|
+
var msAbs = Math.abs(ms);
|
|
966
|
+
if (msAbs >= d) return Math.round(ms / d) + 'd';
|
|
967
|
+
if (msAbs >= h) return Math.round(ms / h) + 'h';
|
|
968
|
+
if (msAbs >= m) return Math.round(ms / m) + 'm';
|
|
969
|
+
if (msAbs >= s) return Math.round(ms / s) + 's';
|
|
970
|
+
return ms + 'ms';
|
|
971
|
+
}
|
|
972
|
+
function fmtLong(ms) {
|
|
973
|
+
var msAbs = Math.abs(ms);
|
|
974
|
+
if (msAbs >= d) return plural(ms, msAbs, d, 'day');
|
|
975
|
+
if (msAbs >= h) return plural(ms, msAbs, h, 'hour');
|
|
976
|
+
if (msAbs >= m) return plural(ms, msAbs, m, 'minute');
|
|
977
|
+
if (msAbs >= s) return plural(ms, msAbs, s, 'second');
|
|
978
|
+
return ms + ' ms';
|
|
979
|
+
}
|
|
980
|
+
function plural(ms, msAbs, n, name) {
|
|
981
|
+
var isPlural = msAbs >= 1.5 * n;
|
|
982
|
+
return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|
983
|
+
}
|
|
984
|
+
},
|
|
985
|
+
"../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js": function(module, __unused_webpack_exports, __webpack_require__) {
|
|
986
|
+
const os = __webpack_require__("os");
|
|
987
|
+
const tty = __webpack_require__("tty");
|
|
988
|
+
const hasFlag = __webpack_require__("../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js");
|
|
989
|
+
const { env } = process;
|
|
990
|
+
let flagForceColor;
|
|
991
|
+
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false') || hasFlag('color=never')) flagForceColor = 0;
|
|
992
|
+
else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true') || hasFlag('color=always')) flagForceColor = 1;
|
|
993
|
+
function envForceColor() {
|
|
994
|
+
if ('FORCE_COLOR' in env) {
|
|
995
|
+
if ('true' === env.FORCE_COLOR) return 1;
|
|
996
|
+
if ('false' === env.FORCE_COLOR) return 0;
|
|
997
|
+
return 0 === env.FORCE_COLOR.length ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
function translateLevel(level) {
|
|
1001
|
+
if (0 === level) return false;
|
|
1002
|
+
return {
|
|
1003
|
+
level,
|
|
1004
|
+
hasBasic: true,
|
|
1005
|
+
has256: level >= 2,
|
|
1006
|
+
has16m: level >= 3
|
|
1007
|
+
};
|
|
1008
|
+
}
|
|
1009
|
+
function supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
1010
|
+
const noFlagForceColor = envForceColor();
|
|
1011
|
+
if (void 0 !== noFlagForceColor) flagForceColor = noFlagForceColor;
|
|
1012
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
1013
|
+
if (0 === forceColor) return 0;
|
|
1014
|
+
if (sniffFlags) {
|
|
1015
|
+
if (hasFlag('color=16m') || hasFlag('color=full') || hasFlag('color=truecolor')) return 3;
|
|
1016
|
+
if (hasFlag('color=256')) return 2;
|
|
1017
|
+
}
|
|
1018
|
+
if (haveStream && !streamIsTTY && void 0 === forceColor) return 0;
|
|
1019
|
+
const min = forceColor || 0;
|
|
1020
|
+
if ('dumb' === env.TERM) return min;
|
|
1021
|
+
if ('win32' === process.platform) {
|
|
1022
|
+
const osRelease = os.release().split('.');
|
|
1023
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
1024
|
+
return 1;
|
|
1025
|
+
}
|
|
1026
|
+
if ('CI' in env) {
|
|
1027
|
+
if ([
|
|
1028
|
+
'TRAVIS',
|
|
1029
|
+
'CIRCLECI',
|
|
1030
|
+
'APPVEYOR',
|
|
1031
|
+
'GITLAB_CI',
|
|
1032
|
+
'GITHUB_ACTIONS',
|
|
1033
|
+
'BUILDKITE',
|
|
1034
|
+
'DRONE'
|
|
1035
|
+
].some((sign)=>sign in env) || 'codeship' === env.CI_NAME) return 1;
|
|
1036
|
+
return min;
|
|
1037
|
+
}
|
|
1038
|
+
if ('TEAMCITY_VERSION' in env) return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
1039
|
+
if ('truecolor' === env.COLORTERM) return 3;
|
|
1040
|
+
if ('TERM_PROGRAM' in env) {
|
|
1041
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
1042
|
+
switch(env.TERM_PROGRAM){
|
|
1043
|
+
case 'iTerm.app':
|
|
1044
|
+
return version >= 3 ? 3 : 2;
|
|
1045
|
+
case 'Apple_Terminal':
|
|
1046
|
+
return 2;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
if (/-256(color)?$/i.test(env.TERM)) return 2;
|
|
1050
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) return 1;
|
|
1051
|
+
if ('COLORTERM' in env) return 1;
|
|
1052
|
+
return min;
|
|
1053
|
+
}
|
|
1054
|
+
function getSupportLevel(stream, options = {}) {
|
|
1055
|
+
const level = supportsColor(stream, {
|
|
1056
|
+
streamIsTTY: stream && stream.isTTY,
|
|
1057
|
+
...options
|
|
1058
|
+
});
|
|
1059
|
+
return translateLevel(level);
|
|
1060
|
+
}
|
|
1061
|
+
module.exports = {
|
|
1062
|
+
supportsColor: getSupportLevel,
|
|
1063
|
+
stdout: getSupportLevel({
|
|
1064
|
+
isTTY: tty.isatty(1)
|
|
1065
|
+
}),
|
|
1066
|
+
stderr: getSupportLevel({
|
|
1067
|
+
isTTY: tty.isatty(2)
|
|
1068
|
+
})
|
|
1069
|
+
};
|
|
1070
|
+
},
|
|
13
1071
|
"./src/utils/XhsXsCommonEnc.js": function(module) {
|
|
14
1072
|
var encrypt_lookup = [
|
|
15
1073
|
"Z",
|
|
@@ -1757,6 +2815,33 @@ var __webpack_modules__ = {
|
|
|
1757
2815
|
return Data2A_B(Base2Data(EnvData2CharCode(_0x315138, _0x1c32b3, _0x56536b)));
|
|
1758
2816
|
}
|
|
1759
2817
|
module[a0_0x45db08(0xae)] = GenAB;
|
|
2818
|
+
},
|
|
2819
|
+
assert: function(module) {
|
|
2820
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_assert__;
|
|
2821
|
+
},
|
|
2822
|
+
http: function(module) {
|
|
2823
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_http__;
|
|
2824
|
+
},
|
|
2825
|
+
https: function(module) {
|
|
2826
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_https__;
|
|
2827
|
+
},
|
|
2828
|
+
net: function(module) {
|
|
2829
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_net__;
|
|
2830
|
+
},
|
|
2831
|
+
os: function(module) {
|
|
2832
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_os__;
|
|
2833
|
+
},
|
|
2834
|
+
tls: function(module) {
|
|
2835
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_tls__;
|
|
2836
|
+
},
|
|
2837
|
+
tty: function(module) {
|
|
2838
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_tty__;
|
|
2839
|
+
},
|
|
2840
|
+
url: function(module) {
|
|
2841
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_url__;
|
|
2842
|
+
},
|
|
2843
|
+
util: function(module) {
|
|
2844
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_util__;
|
|
1760
2845
|
}
|
|
1761
2846
|
};
|
|
1762
2847
|
var __webpack_module_cache__ = {};
|
|
@@ -1768,7 +2853,7 @@ function __webpack_require__(moduleId) {
|
|
|
1768
2853
|
loaded: false,
|
|
1769
2854
|
exports: {}
|
|
1770
2855
|
};
|
|
1771
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
2856
|
+
__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
1772
2857
|
module.loaded = true;
|
|
1773
2858
|
return module.exports;
|
|
1774
2859
|
}
|
|
@@ -1779,6 +2864,28 @@ function __webpack_require__(moduleId) {
|
|
|
1779
2864
|
return module;
|
|
1780
2865
|
};
|
|
1781
2866
|
})();
|
|
2867
|
+
var dist = __webpack_require__("../../node_modules/.pnpm/https-proxy-agent@7.0.6/node_modules/https-proxy-agent/dist/index.js");
|
|
2868
|
+
const ProxyData = {
|
|
2869
|
+
api: "202101291430286754",
|
|
2870
|
+
md5akey: "6ec8d333e85044b7",
|
|
2871
|
+
akey: "91709114"
|
|
2872
|
+
};
|
|
2873
|
+
const ProxyAgent = async (adr, huiwenToken)=>{
|
|
2874
|
+
const http = new Http({});
|
|
2875
|
+
let ProxyInfo = await http.api({
|
|
2876
|
+
method: "GET",
|
|
2877
|
+
url: "https://preview.huiwen.top/api/publish/zdy/ip",
|
|
2878
|
+
params: {
|
|
2879
|
+
addr: adr
|
|
2880
|
+
},
|
|
2881
|
+
...huiwenToken ? {
|
|
2882
|
+
headers: {
|
|
2883
|
+
token: huiwenToken
|
|
2884
|
+
}
|
|
2885
|
+
} : null
|
|
2886
|
+
});
|
|
2887
|
+
return 0 === ProxyInfo.code && ProxyInfo.data.length > 0 ? new dist.HttpsProxyAgent(`http://${ProxyData.api}:${ProxyData.akey}@${ProxyInfo.data[0].proxyAddress}`) : null;
|
|
2888
|
+
};
|
|
1782
2889
|
class Http {
|
|
1783
2890
|
static handleApiError(error) {
|
|
1784
2891
|
if (error && "object" == typeof error && "code" in error && "message" in error) return error;
|
|
@@ -1788,10 +2895,12 @@ class Http {
|
|
|
1788
2895
|
data: error
|
|
1789
2896
|
};
|
|
1790
2897
|
}
|
|
1791
|
-
constructor(config){
|
|
2898
|
+
constructor(config, adr, huiwenToken){
|
|
1792
2899
|
this.apiClient = __WEBPACK_EXTERNAL_MODULE_axios__["default"].create({
|
|
1793
2900
|
...config
|
|
1794
2901
|
});
|
|
2902
|
+
this.adr = adr;
|
|
2903
|
+
this.heiwenToken = huiwenToken;
|
|
1795
2904
|
}
|
|
1796
2905
|
addResponseInterceptor(findError) {
|
|
1797
2906
|
this.apiClient.interceptors.response.use((response)=>{
|
|
@@ -1825,7 +2934,19 @@ class Http {
|
|
|
1825
2934
|
}
|
|
1826
2935
|
async api(config) {
|
|
1827
2936
|
try {
|
|
1828
|
-
const
|
|
2937
|
+
const agent = this.adr ? await ProxyAgent(this.adr, this.heiwenToken) : void 0;
|
|
2938
|
+
if (this.adr && null == agent) return Promise.reject({
|
|
2939
|
+
code: 200,
|
|
2940
|
+
message: "当前发文IP地址暂不支持!"
|
|
2941
|
+
});
|
|
2942
|
+
this.proxyInfo = agent?.proxy.host;
|
|
2943
|
+
const response = await this.apiClient({
|
|
2944
|
+
...config,
|
|
2945
|
+
...agent ? {
|
|
2946
|
+
httpAgent: agent,
|
|
2947
|
+
httpsAgent: agent
|
|
2948
|
+
} : {}
|
|
2949
|
+
});
|
|
1829
2950
|
return response.data;
|
|
1830
2951
|
} catch (error) {
|
|
1831
2952
|
return Promise.reject(Http.handleApiError(error));
|
|
@@ -2047,16 +3168,18 @@ const errnoMap = {
|
|
|
2047
3168
|
20040034: "封面图片推荐jpg、png格式,不支持gif格式。",
|
|
2048
3169
|
20040124: "服务器异常,请稍后重试!",
|
|
2049
3170
|
20040001: "当前用户未登录,请登陆后重试!",
|
|
2050
|
-
401100025: "该应用不支持此媒资类型"
|
|
3171
|
+
401100025: "该应用不支持此媒资类型",
|
|
3172
|
+
401100033: "图片宽高不满足要求"
|
|
2051
3173
|
};
|
|
2052
3174
|
const mockAction = async (task, params)=>{
|
|
2053
3175
|
const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
|
|
2054
3176
|
const tmpCachePath = task.getTmpPath();
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
3177
|
+
const headers = {
|
|
3178
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3179
|
+
token: params.token
|
|
3180
|
+
};
|
|
3181
|
+
let http = new Http({
|
|
3182
|
+
headers
|
|
2060
3183
|
});
|
|
2061
3184
|
http.addResponseInterceptor((response)=>{
|
|
2062
3185
|
const msgType = "draft" === params.saveType ? "同步" : "发布";
|
|
@@ -2172,7 +3295,11 @@ const mockAction = async (task, params)=>{
|
|
|
2172
3295
|
};
|
|
2173
3296
|
const isDraft = "draft" === params.saveType;
|
|
2174
3297
|
const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
|
|
2175
|
-
|
|
3298
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3299
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
3300
|
+
headers
|
|
3301
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
3302
|
+
const res = await proxyHttp.api({
|
|
2176
3303
|
method: "post",
|
|
2177
3304
|
url: saveUrl,
|
|
2178
3305
|
data: publishData,
|
|
@@ -2183,7 +3310,7 @@ const mockAction = async (task, params)=>{
|
|
|
2183
3310
|
},
|
|
2184
3311
|
defaultErrorMsg: isDraft ? "文章同步出现异常,请稍后重试。" : "文章发布出现异常,请稍后重试。"
|
|
2185
3312
|
});
|
|
2186
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(res.ret
|
|
3313
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(0 == res.errno ? res?.ret?.article_id || '' : "", 0 == res.errno ? `文章发布成功!` + (proxyHttp.proxyInfo || "") : res.errmsg ?? '文章发布失败,请稍后重试。');
|
|
2187
3314
|
};
|
|
2188
3315
|
const rpaAction = async (task, params)=>{
|
|
2189
3316
|
const tmpCachePath = task.getTmpPath();
|
|
@@ -2309,6 +3436,7 @@ const rpaAction = async (task, params)=>{
|
|
|
2309
3436
|
}
|
|
2310
3437
|
};
|
|
2311
3438
|
page.on("response", handleResponse);
|
|
3439
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
2312
3440
|
const operatorContainer = page.locator(".editor-component-operator");
|
|
2313
3441
|
if ("draft" === params.saveType) await operatorContainer.locator(".op-btn-outter-content").filter({
|
|
2314
3442
|
hasText: "存草稿"
|
|
@@ -3047,12 +4175,13 @@ const get3101DetailError = (errorList, message, saveType)=>{
|
|
|
3047
4175
|
const mock_mockAction = async (task, params)=>{
|
|
3048
4176
|
const { toutiaoSingleCover, toutiaoMultCover, toutiaoCoverType, toutiaoOriginal, toutiaoExclusive, toutiaoClaim } = params.settingInfo;
|
|
3049
4177
|
const tmpCachePath = task.getTmpPath();
|
|
4178
|
+
const headers = {
|
|
4179
|
+
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
4180
|
+
origin: "https://mp.toutiao.com",
|
|
4181
|
+
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
4182
|
+
};
|
|
3050
4183
|
const http = new Http({
|
|
3051
|
-
headers
|
|
3052
|
-
cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
3053
|
-
origin: "https://mp.toutiao.com",
|
|
3054
|
-
referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
|
|
3055
|
-
}
|
|
4184
|
+
headers
|
|
3056
4185
|
});
|
|
3057
4186
|
http.addResponseInterceptor((response)=>{
|
|
3058
4187
|
if (response.data?.code !== 0) {
|
|
@@ -3129,11 +4258,14 @@ const mock_mockAction = async (task, params)=>{
|
|
|
3129
4258
|
device_platform: "mp",
|
|
3130
4259
|
is_message: 0
|
|
3131
4260
|
},
|
|
3132
|
-
tuwen_wtt_trans_flag: "0",
|
|
4261
|
+
tuwen_wtt_trans_flag: params.settingInfo?.toutiaoTransWtt ? "2" : "0",
|
|
3133
4262
|
info_source: sourceData,
|
|
3134
4263
|
...location ? {
|
|
3135
4264
|
city: location.label,
|
|
3136
4265
|
city_code: location.value
|
|
4266
|
+
} : null,
|
|
4267
|
+
...params.settingInfo?.toutiaoCollectionId ? {
|
|
4268
|
+
want_join_collection_id: params.settingInfo.toutiaoCollectionId
|
|
3137
4269
|
} : null
|
|
3138
4270
|
};
|
|
3139
4271
|
const publishData = {
|
|
@@ -3179,6 +4311,7 @@ const mock_mockAction = async (task, params)=>{
|
|
|
3179
4311
|
article_ad_type: getAddTypeValue(params.settingInfo.toutiaoAd),
|
|
3180
4312
|
claim_exclusive: toutiaoExclusive ? toutiaoExclusive : toutiaoOriginal?.includes("exclusive") ? 1 : 0
|
|
3181
4313
|
};
|
|
4314
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3182
4315
|
const msToken = params.cookies.find((it)=>"msToken" === it.name)?.value;
|
|
3183
4316
|
let publishOption = {};
|
|
3184
4317
|
if (msToken) {
|
|
@@ -3210,8 +4343,11 @@ const mock_mockAction = async (task, params)=>{
|
|
|
3210
4343
|
},
|
|
3211
4344
|
defaultErrorMsg: "draft" === params.saveType ? "文章同步异常,请稍后重试。" : "文章发布异常,请稍后重试。"
|
|
3212
4345
|
};
|
|
3213
|
-
const
|
|
3214
|
-
|
|
4346
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
4347
|
+
headers
|
|
4348
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
4349
|
+
const publishResult = await proxyHttp.api(publishOption);
|
|
4350
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data.pgc_id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
3215
4351
|
};
|
|
3216
4352
|
const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
|
|
3217
4353
|
const rpa_rpaAction = async (task, params)=>{
|
|
@@ -3423,6 +4559,7 @@ const rpa_rpaAction = async (task, params)=>{
|
|
|
3423
4559
|
const confirmBtn = page.locator('div.byte-modal-footer button.byte-btn-primary:has-text("确定")');
|
|
3424
4560
|
if (await confirmBtn.isVisible()) await confirmBtn.click();
|
|
3425
4561
|
}
|
|
4562
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
3426
4563
|
if ("publish" === params.saveType) {
|
|
3427
4564
|
await page.locator(".publish-footer button").filter({
|
|
3428
4565
|
hasText: params.settingInfo.timer ? "定时发布" : "确认发布"
|
|
@@ -4163,10 +5300,10 @@ async function handleBaijiahaoData(params) {
|
|
|
4163
5300
|
}
|
|
4164
5301
|
const final = filtered.slice(0, pageSize);
|
|
4165
5302
|
const articleCell = final.map((item)=>({
|
|
4166
|
-
title: item.title,
|
|
4167
|
-
imageUrl: JSON.parse(item.cover_images)[0]
|
|
5303
|
+
title: item?.is_transfer ?? false ? item.content || "" : item.title,
|
|
5304
|
+
imageUrl: JSON.parse(item.cover_images)[0]?.src || "",
|
|
4168
5305
|
createTime: Math.floor(new Date(item.publish_at.replace(/-/g, "/")).getTime() / 1000),
|
|
4169
|
-
redirectUrl: item.url,
|
|
5306
|
+
redirectUrl: item.url || item.share_url,
|
|
4170
5307
|
recommendNum: item.rec_amount | item.forward_num,
|
|
4171
5308
|
collectNum: item.collection_amount,
|
|
4172
5309
|
readNum: item.read_amount | item.read_num,
|
|
@@ -4514,13 +5651,14 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
4514
5651
|
const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
|
|
4515
5652
|
const client_time_diff = +Number("1743488763") - Math.floor(new Date().getTime() / 1000);
|
|
4516
5653
|
const tmpCachePath = task.getTmpPath();
|
|
5654
|
+
const headers = {
|
|
5655
|
+
"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",
|
|
5656
|
+
Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
5657
|
+
origin: "https://mp.weixin.qq.com",
|
|
5658
|
+
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()}`
|
|
5659
|
+
};
|
|
4517
5660
|
const http = new Http({
|
|
4518
|
-
headers
|
|
4519
|
-
"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",
|
|
4520
|
-
Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
|
|
4521
|
-
origin: "https://mp.weixin.qq.com",
|
|
4522
|
-
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()}`
|
|
4523
|
-
}
|
|
5661
|
+
headers
|
|
4524
5662
|
});
|
|
4525
5663
|
http.addResponseInterceptor((response)=>{
|
|
4526
5664
|
const responseData = response.data;
|
|
@@ -4860,6 +5998,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
4860
5998
|
masssend_check: 1,
|
|
4861
5999
|
is_masssend: 1
|
|
4862
6000
|
};
|
|
6001
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
4863
6002
|
const { appMsgId } = await http.api({
|
|
4864
6003
|
method: "post",
|
|
4865
6004
|
url: "https://mp.weixin.qq.com/cgi-bin/operate_appmsg",
|
|
@@ -5085,7 +6224,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
5085
6224
|
responseType: "arraybuffer"
|
|
5086
6225
|
});
|
|
5087
6226
|
const qrcodeBuffer = Buffer.from(qrcodeResult);
|
|
5088
|
-
const qrcodeFilePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath,
|
|
6227
|
+
const qrcodeFilePath = __WEBPACK_EXTERNAL_MODULE_node_path_c5b9b54f__["default"].join(tmpCachePath, `weixin_qrcode_${Date.now()}.jpg`);
|
|
5089
6228
|
__WEBPACK_EXTERNAL_MODULE_node_fs_5ea92f0c__["default"].writeFileSync(qrcodeFilePath, new Uint8Array(qrcodeBuffer));
|
|
5090
6229
|
params.safeQrcodeCallback?.(qrcodeFilePath);
|
|
5091
6230
|
let code = "";
|
|
@@ -5140,7 +6279,10 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
5140
6279
|
uuid
|
|
5141
6280
|
})
|
|
5142
6281
|
});
|
|
5143
|
-
|
|
6282
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
6283
|
+
headers
|
|
6284
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
6285
|
+
await proxyHttp.api({
|
|
5144
6286
|
method: "post",
|
|
5145
6287
|
url: "https://mp.weixin.qq.com/cgi-bin/masssend",
|
|
5146
6288
|
params: {
|
|
@@ -5189,7 +6331,7 @@ const weixinPublish_mock_mockAction = async (task, params)=>{
|
|
|
5189
6331
|
}),
|
|
5190
6332
|
defaultErrorMsg: params.masssend ? "文章群发异常,请尝试关闭群发或稍后重试。" : "文章发布异常,请稍后重试。"
|
|
5191
6333
|
});
|
|
5192
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(appMsgId,
|
|
6334
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(appMsgId, `微信公众号发布完成!` + (proxyHttp.proxyInfo || ""));
|
|
5193
6335
|
};
|
|
5194
6336
|
const waitQrcodeResultMaxTime = 2000 * scanRetryMaxCount;
|
|
5195
6337
|
const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
@@ -5518,6 +6660,7 @@ const weixinPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
5518
6660
|
await poperInstance.locator('.frm_radio_item label[for="not_recomment_0"]').click();
|
|
5519
6661
|
}
|
|
5520
6662
|
await page.waitForTimeout(1000);
|
|
6663
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
5521
6664
|
const articleId = await new Promise(async (resolve)=>{
|
|
5522
6665
|
const handleResponse = async (response)=>{
|
|
5523
6666
|
const url = response.url();
|
|
@@ -6076,7 +7219,11 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
6076
7219
|
const publishXt = Date.now().toString();
|
|
6077
7220
|
const publishXs = mock_xsEncrypt.signXsPost("/web_api/sns/v2/note", a1Cookie, "xhs-pc-web", publishData);
|
|
6078
7221
|
const xscommon = GenXSCommon(a1Cookie, publishXt, publishXs);
|
|
6079
|
-
const
|
|
7222
|
+
const proxyHttp = task?.isBeta ?? false ? new Http({
|
|
7223
|
+
headers
|
|
7224
|
+
}, params.proxyLoc, params.huiwenToken) : http;
|
|
7225
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
7226
|
+
const publishResult = await proxyHttp.api({
|
|
6080
7227
|
method: "post",
|
|
6081
7228
|
url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
|
|
6082
7229
|
data: publishData,
|
|
@@ -6087,7 +7234,7 @@ const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
|
|
|
6087
7234
|
},
|
|
6088
7235
|
defaultErrorMsg: "文章发布异常,请稍后重试。"
|
|
6089
7236
|
});
|
|
6090
|
-
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data?.id);
|
|
7237
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__iflyrpa_share_f7afdc8c__.success)(publishResult.data?.id, `文章发布成功!` + (proxyHttp.proxyInfo || ""));
|
|
6091
7238
|
};
|
|
6092
7239
|
const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
|
|
6093
7240
|
const rpa_xsEncrypt = new Xhshow();
|
|
@@ -6283,6 +7430,7 @@ const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
|
|
|
6283
7430
|
hasText: "仅自己可见"
|
|
6284
7431
|
}).click();
|
|
6285
7432
|
}
|
|
7433
|
+
task._timerRecord['PrePublish'] = Date.now();
|
|
6286
7434
|
const releaseTimeInstance = page.locator("label").filter({
|
|
6287
7435
|
hasText: params.isImmediatelyPublish ? "立即发布" : "定时发布"
|
|
6288
7436
|
});
|
|
@@ -6308,26 +7456,41 @@ const xiaohongshuPublish = async (task, params)=>{
|
|
|
6308
7456
|
return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
|
|
6309
7457
|
};
|
|
6310
7458
|
var package_namespaceObject = {
|
|
6311
|
-
i8: "1.2.
|
|
7459
|
+
i8: "1.2.24"
|
|
6312
7460
|
};
|
|
7461
|
+
const BetaFlag = "HuiwenCanary";
|
|
6313
7462
|
class Action {
|
|
6314
7463
|
constructor(task){
|
|
6315
7464
|
this.task = task;
|
|
6316
7465
|
}
|
|
6317
7466
|
async bindTask(func, params) {
|
|
6318
7467
|
let responseData;
|
|
6319
|
-
|
|
6320
|
-
|
|
7468
|
+
this.task.isBeta = this.task?.isFeatOn ? this.task?.isFeatOn(BetaFlag) : false;
|
|
7469
|
+
this.task._timerRecord = {
|
|
7470
|
+
ActionStart: Date.now()
|
|
7471
|
+
};
|
|
7472
|
+
if (this.task?.setArticleId) this.task.setArticleId(params.articleId ?? "");
|
|
7473
|
+
if (this.task?.setSaveType ?? false) this.task.setSaveType(params.saveType ?? "");
|
|
7474
|
+
if (this.task?.isInitializedGB !== void 0) this.task.setGbInitType(this.task.isInitializedGB);
|
|
7475
|
+
if ("object" == typeof params) params.cookies = params?.cookies ?? [];
|
|
6321
7476
|
try {
|
|
6322
7477
|
responseData = await func(this.task, params);
|
|
6323
7478
|
} catch (error) {
|
|
6324
7479
|
responseData = Http.handleApiError(error);
|
|
7480
|
+
} finally{
|
|
7481
|
+
this.task._timerRecord['ActionEnd'] = Date.now();
|
|
6325
7482
|
}
|
|
7483
|
+
if (this.task.isBeta && this.task.setTimeConsuming) this.task.setTimeConsuming(this.task._timerRecord);
|
|
6326
7484
|
if (200 === responseData.code) this.task.logger.info(`${func.name} action params error`, responseData);
|
|
6327
7485
|
else if (0 !== responseData.code) {
|
|
6328
7486
|
this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
|
|
6329
7487
|
this.task.logger.info(`${func.name} action failed`);
|
|
6330
7488
|
} else this.task.logger.info(`${func.name} action success`);
|
|
7489
|
+
if (this.task.debug && this.task._timerRecord['PrePublish']) {
|
|
7490
|
+
console.log("预处理图片耗时:", (this.task._timerRecord['PrePublish'] - this.task._timerRecord['ActionStart']) / 1000, "s");
|
|
7491
|
+
console.log("发文接口耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['PrePublish']) / 1000, "s");
|
|
7492
|
+
}
|
|
7493
|
+
this.task.debug && console.log("Action整体耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['ActionStart']) / 1000, "s");
|
|
6331
7494
|
return responseData;
|
|
6332
7495
|
}
|
|
6333
7496
|
FetchArticles(params) {
|
|
@@ -6407,6 +7570,6 @@ class Action {
|
|
|
6407
7570
|
}
|
|
6408
7571
|
}
|
|
6409
7572
|
var __webpack_exports__version = package_namespaceObject.i8;
|
|
6410
|
-
export { Action, __webpack_exports__version as version };
|
|
7573
|
+
export { Action, BetaFlag, __webpack_exports__version as version };
|
|
6411
7574
|
|
|
6412
7575
|
//# sourceMappingURL=index.mjs.map
|