@iflyrpa/actions 1.2.22 → 1.2.24-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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"),
@@ -724,6 +922,445 @@ var __webpack_modules__ = {
724
922
  return util.inspect(v, this.inspectOpts);
725
923
  };
726
924
  },
925
+ "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/browser.js": function(module, exports1, __webpack_require__) {
926
+ exports1.formatArgs = formatArgs;
927
+ exports1.save = save;
928
+ exports1.load = load;
929
+ exports1.useColors = useColors;
930
+ exports1.storage = localstorage();
931
+ exports1.destroy = (()=>{
932
+ let warned = false;
933
+ return ()=>{
934
+ if (!warned) {
935
+ warned = true;
936
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
937
+ }
938
+ };
939
+ })();
940
+ exports1.colors = [
941
+ '#0000CC',
942
+ '#0000FF',
943
+ '#0033CC',
944
+ '#0033FF',
945
+ '#0066CC',
946
+ '#0066FF',
947
+ '#0099CC',
948
+ '#0099FF',
949
+ '#00CC00',
950
+ '#00CC33',
951
+ '#00CC66',
952
+ '#00CC99',
953
+ '#00CCCC',
954
+ '#00CCFF',
955
+ '#3300CC',
956
+ '#3300FF',
957
+ '#3333CC',
958
+ '#3333FF',
959
+ '#3366CC',
960
+ '#3366FF',
961
+ '#3399CC',
962
+ '#3399FF',
963
+ '#33CC00',
964
+ '#33CC33',
965
+ '#33CC66',
966
+ '#33CC99',
967
+ '#33CCCC',
968
+ '#33CCFF',
969
+ '#6600CC',
970
+ '#6600FF',
971
+ '#6633CC',
972
+ '#6633FF',
973
+ '#66CC00',
974
+ '#66CC33',
975
+ '#9900CC',
976
+ '#9900FF',
977
+ '#9933CC',
978
+ '#9933FF',
979
+ '#99CC00',
980
+ '#99CC33',
981
+ '#CC0000',
982
+ '#CC0033',
983
+ '#CC0066',
984
+ '#CC0099',
985
+ '#CC00CC',
986
+ '#CC00FF',
987
+ '#CC3300',
988
+ '#CC3333',
989
+ '#CC3366',
990
+ '#CC3399',
991
+ '#CC33CC',
992
+ '#CC33FF',
993
+ '#CC6600',
994
+ '#CC6633',
995
+ '#CC9900',
996
+ '#CC9933',
997
+ '#CCCC00',
998
+ '#CCCC33',
999
+ '#FF0000',
1000
+ '#FF0033',
1001
+ '#FF0066',
1002
+ '#FF0099',
1003
+ '#FF00CC',
1004
+ '#FF00FF',
1005
+ '#FF3300',
1006
+ '#FF3333',
1007
+ '#FF3366',
1008
+ '#FF3399',
1009
+ '#FF33CC',
1010
+ '#FF33FF',
1011
+ '#FF6600',
1012
+ '#FF6633',
1013
+ '#FF9900',
1014
+ '#FF9933',
1015
+ '#FFCC00',
1016
+ '#FFCC33'
1017
+ ];
1018
+ function useColors() {
1019
+ if ('undefined' != typeof window && window.process && ('renderer' === window.process.type || window.process.__nwjs)) return true;
1020
+ if ('undefined' != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return false;
1021
+ let m;
1022
+ 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+)/);
1023
+ }
1024
+ function formatArgs(args) {
1025
+ args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
1026
+ if (!this.useColors) return;
1027
+ const c = 'color: ' + this.color;
1028
+ args.splice(1, 0, c, 'color: inherit');
1029
+ let index = 0;
1030
+ let lastC = 0;
1031
+ args[0].replace(/%[a-zA-Z%]/g, (match)=>{
1032
+ if ('%%' === match) return;
1033
+ index++;
1034
+ if ('%c' === match) lastC = index;
1035
+ });
1036
+ args.splice(lastC, 0, c);
1037
+ }
1038
+ exports1.log = console.debug || console.log || (()=>{});
1039
+ function save(namespaces) {
1040
+ try {
1041
+ if (namespaces) exports1.storage.setItem('debug', namespaces);
1042
+ else exports1.storage.removeItem('debug');
1043
+ } catch (error) {}
1044
+ }
1045
+ function load() {
1046
+ let r;
1047
+ try {
1048
+ r = exports1.storage.getItem('debug');
1049
+ } catch (error) {}
1050
+ if (!r && 'undefined' != typeof process && 'env' in process) r = process.env.DEBUG;
1051
+ return r;
1052
+ }
1053
+ function localstorage() {
1054
+ try {
1055
+ return localStorage;
1056
+ } catch (error) {}
1057
+ }
1058
+ module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports1);
1059
+ const { formatters } = module.exports;
1060
+ formatters.j = function(v) {
1061
+ try {
1062
+ return JSON.stringify(v);
1063
+ } catch (error) {
1064
+ return '[UnexpectedJSONParseError]: ' + error.message;
1065
+ }
1066
+ };
1067
+ },
1068
+ "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js": function(module, __unused_webpack_exports, __webpack_require__) {
1069
+ function setup(env) {
1070
+ createDebug.debug = createDebug;
1071
+ createDebug.default = createDebug;
1072
+ createDebug.coerce = coerce;
1073
+ createDebug.disable = disable;
1074
+ createDebug.enable = enable;
1075
+ createDebug.enabled = enabled;
1076
+ createDebug.humanize = __webpack_require__("../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js");
1077
+ createDebug.destroy = destroy;
1078
+ Object.keys(env).forEach((key)=>{
1079
+ createDebug[key] = env[key];
1080
+ });
1081
+ createDebug.names = [];
1082
+ createDebug.skips = [];
1083
+ createDebug.formatters = {};
1084
+ function selectColor(namespace) {
1085
+ let hash = 0;
1086
+ for(let i = 0; i < namespace.length; i++){
1087
+ hash = (hash << 5) - hash + namespace.charCodeAt(i);
1088
+ hash |= 0;
1089
+ }
1090
+ return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
1091
+ }
1092
+ createDebug.selectColor = selectColor;
1093
+ function createDebug(namespace) {
1094
+ let prevTime;
1095
+ let enableOverride = null;
1096
+ let namespacesCache;
1097
+ let enabledCache;
1098
+ function debug(...args) {
1099
+ if (!debug.enabled) return;
1100
+ const self1 = debug;
1101
+ const curr = Number(new Date());
1102
+ const ms = curr - (prevTime || curr);
1103
+ self1.diff = ms;
1104
+ self1.prev = prevTime;
1105
+ self1.curr = curr;
1106
+ prevTime = curr;
1107
+ args[0] = createDebug.coerce(args[0]);
1108
+ if ('string' != typeof args[0]) args.unshift('%O');
1109
+ let index = 0;
1110
+ args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format)=>{
1111
+ if ('%%' === match) return '%';
1112
+ index++;
1113
+ const formatter = createDebug.formatters[format];
1114
+ if ('function' == typeof formatter) {
1115
+ const val = args[index];
1116
+ match = formatter.call(self1, val);
1117
+ args.splice(index, 1);
1118
+ index--;
1119
+ }
1120
+ return match;
1121
+ });
1122
+ createDebug.formatArgs.call(self1, args);
1123
+ const logFn = self1.log || createDebug.log;
1124
+ logFn.apply(self1, args);
1125
+ }
1126
+ debug.namespace = namespace;
1127
+ debug.useColors = createDebug.useColors();
1128
+ debug.color = createDebug.selectColor(namespace);
1129
+ debug.extend = extend;
1130
+ debug.destroy = createDebug.destroy;
1131
+ Object.defineProperty(debug, 'enabled', {
1132
+ enumerable: true,
1133
+ configurable: false,
1134
+ get: ()=>{
1135
+ if (null !== enableOverride) return enableOverride;
1136
+ if (namespacesCache !== createDebug.namespaces) {
1137
+ namespacesCache = createDebug.namespaces;
1138
+ enabledCache = createDebug.enabled(namespace);
1139
+ }
1140
+ return enabledCache;
1141
+ },
1142
+ set: (v)=>{
1143
+ enableOverride = v;
1144
+ }
1145
+ });
1146
+ if ('function' == typeof createDebug.init) createDebug.init(debug);
1147
+ return debug;
1148
+ }
1149
+ function extend(namespace, delimiter) {
1150
+ const newDebug = createDebug(this.namespace + (void 0 === delimiter ? ':' : delimiter) + namespace);
1151
+ newDebug.log = this.log;
1152
+ return newDebug;
1153
+ }
1154
+ function enable(namespaces) {
1155
+ createDebug.save(namespaces);
1156
+ createDebug.namespaces = namespaces;
1157
+ createDebug.names = [];
1158
+ createDebug.skips = [];
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;
1182
+ }
1183
+ while(templateIndex < template.length && '*' === template[templateIndex])templateIndex++;
1184
+ return templateIndex === template.length;
1185
+ }
1186
+ function disable() {
1187
+ const namespaces = [
1188
+ ...createDebug.names,
1189
+ ...createDebug.skips.map((namespace)=>'-' + namespace)
1190
+ ].join(',');
1191
+ createDebug.enable('');
1192
+ return namespaces;
1193
+ }
1194
+ function enabled(name) {
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;
1197
+ return false;
1198
+ }
1199
+ function coerce(val) {
1200
+ if (val instanceof Error) return val.stack || val.message;
1201
+ return val;
1202
+ }
1203
+ function destroy() {
1204
+ console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
1205
+ }
1206
+ createDebug.enable(createDebug.load());
1207
+ return createDebug;
1208
+ }
1209
+ module.exports = setup;
1210
+ },
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");
1214
+ },
1215
+ "../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/node.js": function(module, exports1, __webpack_require__) {
1216
+ const tty = __webpack_require__("tty");
1217
+ const util = __webpack_require__("util");
1218
+ exports1.init = init;
1219
+ exports1.log = log;
1220
+ exports1.formatArgs = formatArgs;
1221
+ exports1.save = save;
1222
+ exports1.load = load;
1223
+ exports1.useColors = useColors;
1224
+ 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`.');
1225
+ exports1.colors = [
1226
+ 6,
1227
+ 2,
1228
+ 3,
1229
+ 4,
1230
+ 5,
1231
+ 1
1232
+ ];
1233
+ try {
1234
+ const supportsColor = __webpack_require__("../../node_modules/.pnpm/supports-color@8.1.1/node_modules/supports-color/index.js");
1235
+ if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) exports1.colors = [
1236
+ 20,
1237
+ 21,
1238
+ 26,
1239
+ 27,
1240
+ 32,
1241
+ 33,
1242
+ 38,
1243
+ 39,
1244
+ 40,
1245
+ 41,
1246
+ 42,
1247
+ 43,
1248
+ 44,
1249
+ 45,
1250
+ 56,
1251
+ 57,
1252
+ 62,
1253
+ 63,
1254
+ 68,
1255
+ 69,
1256
+ 74,
1257
+ 75,
1258
+ 76,
1259
+ 77,
1260
+ 78,
1261
+ 79,
1262
+ 80,
1263
+ 81,
1264
+ 92,
1265
+ 93,
1266
+ 98,
1267
+ 99,
1268
+ 112,
1269
+ 113,
1270
+ 128,
1271
+ 129,
1272
+ 134,
1273
+ 135,
1274
+ 148,
1275
+ 149,
1276
+ 160,
1277
+ 161,
1278
+ 162,
1279
+ 163,
1280
+ 164,
1281
+ 165,
1282
+ 166,
1283
+ 167,
1284
+ 168,
1285
+ 169,
1286
+ 170,
1287
+ 171,
1288
+ 172,
1289
+ 173,
1290
+ 178,
1291
+ 179,
1292
+ 184,
1293
+ 185,
1294
+ 196,
1295
+ 197,
1296
+ 198,
1297
+ 199,
1298
+ 200,
1299
+ 201,
1300
+ 202,
1301
+ 203,
1302
+ 204,
1303
+ 205,
1304
+ 206,
1305
+ 207,
1306
+ 208,
1307
+ 209,
1308
+ 214,
1309
+ 215,
1310
+ 220,
1311
+ 221
1312
+ ];
1313
+ } catch (error) {}
1314
+ exports1.inspectOpts = Object.keys(process.env).filter((key)=>/^debug_/i.test(key)).reduce((obj, key)=>{
1315
+ const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k)=>k.toUpperCase());
1316
+ let val = process.env[key];
1317
+ val = /^(yes|on|true|enabled)$/i.test(val) ? true : /^(no|off|false|disabled)$/i.test(val) ? false : 'null' === val ? null : Number(val);
1318
+ obj[prop] = val;
1319
+ return obj;
1320
+ }, {});
1321
+ function useColors() {
1322
+ return 'colors' in exports1.inspectOpts ? Boolean(exports1.inspectOpts.colors) : tty.isatty(process.stderr.fd);
1323
+ }
1324
+ function formatArgs(args) {
1325
+ const { namespace: name, useColors } = this;
1326
+ if (useColors) {
1327
+ const c = this.color;
1328
+ const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
1329
+ const prefix = ` ${colorCode};1m${name} \u001B[0m`;
1330
+ args[0] = prefix + args[0].split('\n').join('\n' + prefix);
1331
+ args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
1332
+ } else args[0] = getDate() + name + ' ' + args[0];
1333
+ }
1334
+ function getDate() {
1335
+ if (exports1.inspectOpts.hideDate) return '';
1336
+ return new Date().toISOString() + ' ';
1337
+ }
1338
+ function log(...args) {
1339
+ return process.stderr.write(util.formatWithOptions(exports1.inspectOpts, ...args) + '\n');
1340
+ }
1341
+ function save(namespaces) {
1342
+ if (namespaces) process.env.DEBUG = namespaces;
1343
+ else delete process.env.DEBUG;
1344
+ }
1345
+ function load() {
1346
+ return process.env.DEBUG;
1347
+ }
1348
+ function init(debug) {
1349
+ debug.inspectOpts = {};
1350
+ const keys = Object.keys(exports1.inspectOpts);
1351
+ for(let i = 0; i < keys.length; i++)debug.inspectOpts[keys[i]] = exports1.inspectOpts[keys[i]];
1352
+ }
1353
+ module.exports = __webpack_require__("../../node_modules/.pnpm/debug@4.4.0/node_modules/debug/src/common.js")(exports1);
1354
+ const { formatters } = module.exports;
1355
+ formatters.o = function(v) {
1356
+ this.inspectOpts.colors = this.useColors;
1357
+ return util.inspect(v, this.inspectOpts).split('\n').map((str)=>str.trim()).join(' ');
1358
+ };
1359
+ formatters.O = function(v) {
1360
+ this.inspectOpts.colors = this.useColors;
1361
+ return util.inspect(v, this.inspectOpts);
1362
+ };
1363
+ },
727
1364
  "../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js": function(module, __unused_webpack_exports, __webpack_require__) {
728
1365
  var Stream = __webpack_require__("stream").Stream;
729
1366
  var util = __webpack_require__("util");
@@ -1483,36 +2120,273 @@ var __webpack_modules__ = {
1483
2120
  request.on('error', callback);
1484
2121
  request.on('response', onResponse);
1485
2122
  }
1486
- }).bind(this));
1487
- return request;
1488
- };
1489
- FormData1.prototype._error = function(err) {
1490
- if (!this.error) {
1491
- this.error = err;
1492
- this.pause();
1493
- this.emit('error', err);
2123
+ }).bind(this));
2124
+ return request;
2125
+ };
2126
+ FormData1.prototype._error = function(err) {
2127
+ if (!this.error) {
2128
+ this.error = err;
2129
+ this.pause();
2130
+ this.emit('error', err);
2131
+ }
2132
+ };
2133
+ FormData1.prototype.toString = function() {
2134
+ return '[object FormData]';
2135
+ };
2136
+ },
2137
+ "../../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/populate.js": function(module) {
2138
+ module.exports = function(dst, src) {
2139
+ Object.keys(src).forEach(function(prop) {
2140
+ dst[prop] = dst[prop] || src[prop];
2141
+ });
2142
+ return dst;
2143
+ };
2144
+ },
2145
+ "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js": function(module) {
2146
+ "use strict";
2147
+ module.exports = (flag, argv = process.argv)=>{
2148
+ const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
2149
+ const position = argv.indexOf(prefix + flag);
2150
+ const terminatorPosition = argv.indexOf('--');
2151
+ return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
2152
+ };
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;
1494
2282
  }
1495
- };
1496
- FormData1.prototype.toString = function() {
1497
- return '[object FormData]';
1498
- };
1499
- },
1500
- "../../node_modules/.pnpm/form-data@4.0.1/node_modules/form-data/lib/populate.js": function(module) {
1501
- module.exports = function(dst, src) {
1502
- Object.keys(src).forEach(function(prop) {
1503
- dst[prop] = dst[prop] || src[prop];
1504
- });
1505
- return dst;
1506
- };
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
+ }
1507
2298
  },
1508
- "../../node_modules/.pnpm/has-flag@4.0.0/node_modules/has-flag/index.js": function(module) {
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__) {
1509
2300
  "use strict";
1510
- module.exports = (flag, argv = process.argv)=>{
1511
- const prefix = flag.startsWith('-') ? '' : 1 === flag.length ? '-' : '--';
1512
- const position = argv.indexOf(prefix + flag);
1513
- const terminatorPosition = argv.indexOf('--');
1514
- return -1 !== position && (-1 === terminatorPosition || position < terminatorPosition);
2301
+ var __importDefault = this && this.__importDefault || function(mod) {
2302
+ return mod && mod.__esModule ? mod : {
2303
+ default: mod
2304
+ };
1515
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;
1516
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
  /*!
@@ -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
  }
@@ -14631,6 +15598,23 @@ var __webpack_exports__ = {};
14631
15598
  axios.HttpStatusCode = helpers_HttpStatusCode;
14632
15599
  axios.default = axios;
14633
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)=>{
15608
+ const http = new Http({});
15609
+ let ProxyInfo = await http.api({
15610
+ method: "GET",
15611
+ url: "https://fetdev.iflysec.com/api/publish/zdy/ip",
15612
+ params: {
15613
+ addr: adr
15614
+ }
15615
+ });
15616
+ return 0 === ProxyInfo.code && ProxyInfo.data.length > 0 ? new dist.HttpsProxyAgent(`http://${ProxyData.api}:${ProxyData.akey}@${ProxyInfo.data[0].proxyAddress}`) : null;
15617
+ };
14634
15618
  class Http {
14635
15619
  static handleApiError(error) {
14636
15620
  if (error && "object" == typeof error && "code" in error && "message" in error) return error;
@@ -14640,10 +15624,11 @@ var __webpack_exports__ = {};
14640
15624
  data: error
14641
15625
  };
14642
15626
  }
14643
- constructor(config){
15627
+ constructor(config, adr){
14644
15628
  this.apiClient = lib_axios.create({
14645
15629
  ...config
14646
15630
  });
15631
+ this.adr = adr;
14647
15632
  }
14648
15633
  addResponseInterceptor(findError) {
14649
15634
  this.apiClient.interceptors.response.use((response)=>{
@@ -14677,7 +15662,14 @@ var __webpack_exports__ = {};
14677
15662
  }
14678
15663
  async api(config) {
14679
15664
  try {
14680
- const response = await this.apiClient(config);
15665
+ const agent = this.adr ? await ProxyAgent(this.adr) : void 0;
15666
+ const response = await this.apiClient({
15667
+ ...config,
15668
+ ...agent ? {
15669
+ httpAgent: agent,
15670
+ httpsAgent: agent
15671
+ } : {}
15672
+ });
14681
15673
  return response.data;
14682
15674
  } catch (error) {
14683
15675
  return Promise.reject(Http.handleApiError(error));
@@ -14988,11 +15980,12 @@ var __webpack_exports__ = {};
14988
15980
  const mockAction = async (task, params)=>{
14989
15981
  const { baijiahaoSingleCover, baijiahaoMultCover, baijiahaoCoverType } = params.settingInfo;
14990
15982
  const tmpCachePath = task.getTmpPath();
14991
- const http = new Http({
14992
- headers: {
14993
- cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
14994
- token: params.token
14995
- }
15983
+ const headers = {
15984
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
15985
+ token: params.token
15986
+ };
15987
+ let http = new Http({
15988
+ headers
14996
15989
  });
14997
15990
  http.addResponseInterceptor((response)=>{
14998
15991
  const msgType = "draft" === params.saveType ? "同步" : "发布";
@@ -15109,7 +16102,10 @@ var __webpack_exports__ = {};
15109
16102
  const isDraft = "draft" === params.saveType;
15110
16103
  const saveUrl = isDraft ? "https://baijiahao.baidu.com/pcui/article/save?callback=bjhdraft" : "https://baijiahao.baidu.com/pcui/article/publish?callback=bjhpublish";
15111
16104
  task._timerRecord['PrePublish'] = Date.now();
15112
- const res = await http.api({
16105
+ const proxyHttp = new Http({
16106
+ headers
16107
+ }, params.proxyLoc);
16108
+ const res = await proxyHttp.api({
15113
16109
  method: "post",
15114
16110
  url: saveUrl,
15115
16111
  data: publishData,
@@ -15551,57 +16547,366 @@ var __webpack_exports__ = {};
15551
16547
  const external_node_buffer_namespaceObject = require("node:buffer");
15552
16548
  const external_node_crypto_namespaceObject = require("node:crypto");
15553
16549
  var external_node_crypto_default = /*#__PURE__*/ __webpack_require__.n(external_node_crypto_namespaceObject);
15554
- class XsEncrypt {
15555
- async encryptMD5(url) {
15556
- return external_node_crypto_default().createHash("md5").update(url, "utf8").digest("hex");
15557
- }
15558
- async encryptText(text) {
15559
- const textEncoded = external_node_buffer_namespaceObject.Buffer.from(text).toString("base64");
15560
- const cipher = external_node_crypto_default().createCipheriv("aes-128-cbc", new Uint8Array(this.keyBytes), new Uint8Array(this.iv));
15561
- const ciphertext = cipher.update(textEncoded, "utf8", "base64");
15562
- return ciphertext + cipher.final("base64");
15563
- }
15564
- async base64ToHex(encodedData) {
15565
- const decodedData = external_node_buffer_namespaceObject.Buffer.from(encodedData, "base64");
15566
- return decodedData.toString("hex");
15567
- }
15568
- async encryptPayload(payload, platform) {
15569
- const hexPayload = await this.base64ToHex(payload);
15570
- const obj = {
15571
- signSvn: "56",
15572
- signType: "x2",
15573
- appID: platform,
15574
- signVersion: "1",
15575
- payload: hexPayload
16550
+ class CryptoConfig {
16551
+ static{
16552
+ this.MAX_32BIT = 0xFFFFFFFF;
16553
+ }
16554
+ static{
16555
+ this.MAX_SIGNED_32BIT = 0x7FFFFFFF;
16556
+ }
16557
+ static{
16558
+ this.BASE58_ALPHABET = "NOPQRStuvwxWXYZabcyz012DEFTKLMdefghijkl4563GHIJBC7mnop89+/AUVqrsOPQefghijkABCDEFGuvwz0123456789xy";
16559
+ }
16560
+ static{
16561
+ this.STANDARD_BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
16562
+ }
16563
+ static{
16564
+ this.CUSTOM_BASE64_ALPHABET = "ZmserbBoHQtNP+wOcza/LpngG8yJq42KWYj0DSfdikx3VT16IlUAFM97hECvuRX5";
16565
+ }
16566
+ static{
16567
+ this.BASE58_BASE = 58;
16568
+ }
16569
+ static{
16570
+ this.BYTE_SIZE = 256;
16571
+ }
16572
+ static{
16573
+ this.HEX_KEY = "af572b95ca65b2d9ec76bb5d2e97cb653299cc663399cc663399cce673399cce6733190c06030100000000008040209048241289c4e271381c0e0703018040a05028148ac56231180c0683c16030984c2693c964b259ac56abd5eaf5fafd7e3f9f4f279349a4d2e9743a9d4e279349a4d2e9f47a3d1e8f47239148a4d269341a8d4623110884422190c86432994ca6d3e974baddee773b1d8e47a35128148ac5623198cce6f3f97c3e1f8f47a3d168b45aad562b158ac5e2f1f87c3e9f4f279349a4d269b45aad56";
16574
+ }
16575
+ static{
16576
+ this.TIMESTAMP_BYTES_COUNT = 16;
16577
+ }
16578
+ static{
16579
+ this.TIMESTAMP_XOR_KEY = 41;
16580
+ }
16581
+ static{
16582
+ this.STARTUP_TIME_OFFSET_MIN = 1000;
16583
+ }
16584
+ static{
16585
+ this.STARTUP_TIME_OFFSET_MAX = 4000;
16586
+ }
16587
+ static{
16588
+ this.EXPECTED_HEX_LENGTH = 32;
16589
+ }
16590
+ static{
16591
+ this.OUTPUT_BYTE_COUNT = 8;
16592
+ }
16593
+ static{
16594
+ this.HEX_CHUNK_SIZE = 2;
16595
+ }
16596
+ static{
16597
+ this.VERSION_BYTES = [
16598
+ 119,
16599
+ 104,
16600
+ 96,
16601
+ 41
16602
+ ];
16603
+ }
16604
+ static{
16605
+ this.FIXED_SEPARATOR_BYTES = [
16606
+ 16,
16607
+ 0,
16608
+ 0,
16609
+ 0,
16610
+ 15,
16611
+ 5,
16612
+ 0,
16613
+ 0,
16614
+ 47,
16615
+ 1,
16616
+ 0,
16617
+ 0
16618
+ ];
16619
+ }
16620
+ static{
16621
+ this.RANDOM_BYTE_COUNT = 4;
16622
+ }
16623
+ static{
16624
+ this.FIXED_INT_VALUE_1 = 15;
16625
+ }
16626
+ static{
16627
+ this.FIXED_INT_VALUE_2 = 1291;
16628
+ }
16629
+ static{
16630
+ this.ENV_STATIC_BYTES = [
16631
+ 1,
16632
+ 249,
16633
+ 83,
16634
+ 102,
16635
+ 103,
16636
+ 201,
16637
+ 181,
16638
+ 131,
16639
+ 99,
16640
+ 94,
16641
+ 7,
16642
+ 68,
16643
+ 250,
16644
+ 132,
16645
+ 21
16646
+ ];
16647
+ }
16648
+ static{
16649
+ this.SIGNATURE_DATA_TEMPLATE = {
16650
+ x0: "4.2.2",
16651
+ x1: "xhs-pc-web",
16652
+ x2: "Windows",
16653
+ x3: "",
16654
+ x4: "object"
15576
16655
  };
15577
- const jsonString = JSON.stringify(obj, null, 0);
15578
- return external_node_buffer_namespaceObject.Buffer.from(jsonString).toString("base64");
15579
16656
  }
15580
- async encryptXs(url, a1, ts, platform = "xhs-pc-web") {
15581
- const text = `x1=${await this.encryptMD5(`url=${url}`)};x2=0|0|0|1|0|0|1|0|0|0|1|0|0|0|0|1|0|0|0;x3=${a1};x4=${ts};`;
15582
- return `XYW_${await this.encryptPayload(await this.encryptText(text), platform)}`;
16657
+ static{
16658
+ this.X3_PREFIX = "mns0101_";
15583
16659
  }
15584
- dumps(...rest) {
15585
- const [data, replacer = null, space = 0] = rest;
15586
- return JSON.stringify(data, replacer, space).replace(/\n/g, "").replace(/":\s+"/g, '":"');
16660
+ static{
16661
+ this.XYS_PREFIX = "XYS_";
15587
16662
  }
16663
+ }
16664
+ class RandomGenerator {
16665
+ generateRandomBytes(byteCount) {
16666
+ return Array.from({
16667
+ length: byteCount
16668
+ }, ()=>Math.floor(Math.random() * CryptoConfig.BYTE_SIZE));
16669
+ }
16670
+ generateRandomByteInRange(minVal, maxVal) {
16671
+ return Math.floor(Math.random() * (maxVal - minVal + 1)) + minVal;
16672
+ }
16673
+ generateRandomInt() {
16674
+ return Math.floor(Math.random() * (CryptoConfig.MAX_32BIT + 1));
16675
+ }
16676
+ }
16677
+ class HexProcessor {
16678
+ hexStringToBytes(hexString) {
16679
+ const byteValues = [];
16680
+ for(let i = 0; i < hexString.length; i += CryptoConfig.HEX_CHUNK_SIZE){
16681
+ const hexChunk = hexString.substr(i, CryptoConfig.HEX_CHUNK_SIZE);
16682
+ byteValues.push(parseInt(hexChunk, 16));
16683
+ }
16684
+ return byteValues;
16685
+ }
16686
+ processHexParameter(hexString, xorKey) {
16687
+ if (hexString.length !== CryptoConfig.EXPECTED_HEX_LENGTH) throw new Error(`hex parameter must be ${CryptoConfig.EXPECTED_HEX_LENGTH} characters`);
16688
+ const byteValues = this.hexStringToBytes(hexString);
16689
+ return byteValues.map((byteVal)=>byteVal ^ xorKey).slice(0, CryptoConfig.OUTPUT_BYTE_COUNT);
16690
+ }
16691
+ }
16692
+ class BitOperations {
16693
+ normalizeTo32bit(value) {
16694
+ return value & CryptoConfig.MAX_32BIT;
16695
+ }
16696
+ toSigned32bit(unsignedValue) {
16697
+ if (unsignedValue > CryptoConfig.MAX_SIGNED_32BIT) return unsignedValue - 0x100000000;
16698
+ return unsignedValue;
16699
+ }
16700
+ computeSeedValue(seed32bit) {
16701
+ const normalizedSeed = this.normalizeTo32bit(seed32bit);
16702
+ const shift15Bits = normalizedSeed >> 15;
16703
+ const shift13Bits = normalizedSeed >> 13;
16704
+ const shift12Bits = normalizedSeed >> 12;
16705
+ const shift10Bits = normalizedSeed >> 10;
16706
+ const xorMaskedResult = shift15Bits & ~shift13Bits | shift13Bits & ~shift15Bits;
16707
+ const shiftedResult = (xorMaskedResult ^ shift12Bits ^ shift10Bits) << 31 & CryptoConfig.MAX_32BIT;
16708
+ return this.toSigned32bit(shiftedResult);
16709
+ }
16710
+ xorTransformArray(sourceIntegers) {
16711
+ const resultBytes = new Uint8Array(sourceIntegers.length);
16712
+ const hexKeyBytes = external_node_buffer_namespaceObject.Buffer.from(CryptoConfig.HEX_KEY, 'hex');
16713
+ for(let index = 0; index < sourceIntegers.length; index++)resultBytes[index] = (sourceIntegers[index] ^ hexKeyBytes[index]) & 0xFF;
16714
+ return resultBytes;
16715
+ }
16716
+ }
16717
+ class Base58Encoder {
16718
+ encodeToB58(inputBytes) {
16719
+ const bytesArray = Array.isArray(inputBytes) ? inputBytes : Array.from(inputBytes);
16720
+ const numberAccumulator = this.bytesToNumber(bytesArray);
16721
+ const leadingZerosCount = this.countLeadingZeros(bytesArray);
16722
+ const encodedCharacters = this.numberToBase58Chars(numberAccumulator);
16723
+ encodedCharacters.push(...Array(leadingZerosCount).fill(CryptoConfig.BASE58_ALPHABET[0]));
16724
+ return encodedCharacters.reverse().join('');
16725
+ }
16726
+ bytesToNumber(inputBytes) {
16727
+ const bytesArray = Array.isArray(inputBytes) ? inputBytes : Array.from(inputBytes);
16728
+ let result = 0n;
16729
+ const BYTE_SIZE = 256n;
16730
+ for (const byteValue of bytesArray)result = result * BYTE_SIZE + BigInt(byteValue);
16731
+ return result;
16732
+ }
16733
+ countLeadingZeros(inputBytes) {
16734
+ let count = 0;
16735
+ for (const byteValue of inputBytes)if (0 === byteValue) count++;
16736
+ else break;
16737
+ return count;
16738
+ }
16739
+ numberToBase58Chars(number) {
16740
+ const characters = [];
16741
+ const base = BigInt(CryptoConfig.BASE58_BASE);
16742
+ while(number > 0n){
16743
+ const remainder = number % base;
16744
+ characters.push(CryptoConfig.BASE58_ALPHABET[Number(remainder)]);
16745
+ number /= base;
16746
+ }
16747
+ return characters;
16748
+ }
16749
+ }
16750
+ class Base64Encoder {
16751
+ encodeToB64(dataToEncode) {
16752
+ const dataBytes = external_node_buffer_namespaceObject.Buffer.from(dataToEncode, 'utf-8');
16753
+ const standardEncodedString = dataBytes.toString('base64');
16754
+ let result = '';
16755
+ for (const char of standardEncodedString){
16756
+ const index = CryptoConfig.STANDARD_BASE64_ALPHABET.indexOf(char);
16757
+ if (-1 !== index) result += CryptoConfig.CUSTOM_BASE64_ALPHABET[index];
16758
+ else result += char;
16759
+ }
16760
+ return result;
16761
+ }
16762
+ }
16763
+ class RequestSignatureValidator {
16764
+ static validateMethod(method) {
16765
+ if ('string' != typeof method) throw new TypeError(`method must be string, got ${typeof method}`);
16766
+ const upperMethod = method.trim().toUpperCase();
16767
+ if ('GET' !== upperMethod && 'POST' !== upperMethod) throw new Error(`method must be 'GET' or 'POST', got '${upperMethod}'`);
16768
+ return upperMethod;
16769
+ }
16770
+ static validateUri(uri) {
16771
+ if ('string' != typeof uri) throw new TypeError(`uri must be string, got ${typeof uri}`);
16772
+ if (!uri.trim()) throw new Error('uri cannot be empty');
16773
+ return uri.trim();
16774
+ }
16775
+ static validateA1Value(a1Value) {
16776
+ if ('string' != typeof a1Value) throw new TypeError(`a1_value must be string, got ${typeof a1Value}`);
16777
+ if (!a1Value.trim()) throw new Error('a1_value cannot be empty');
16778
+ return a1Value.trim();
16779
+ }
16780
+ static validateXsecAppid(xsecAppid) {
16781
+ if ('string' != typeof xsecAppid) throw new TypeError(`xsec_appid must be string, got ${typeof xsecAppid}`);
16782
+ if (!xsecAppid.trim()) throw new Error('xsec_appid cannot be empty');
16783
+ return xsecAppid.trim();
16784
+ }
16785
+ static validatePayload(payload) {
16786
+ if (null !== payload && 'object' != typeof payload) throw new TypeError(`payload must be object or null, got ${typeof payload}`);
16787
+ if (null != payload) {
16788
+ for(const key in payload)if ('string' != typeof key) throw new TypeError(`payload keys must be string, got ${typeof key} for key '${key}'`);
16789
+ }
16790
+ return payload;
16791
+ }
16792
+ }
16793
+ class CryptoProcessor {
15588
16794
  constructor(){
15589
- this.words = [
15590
- 929260340,
15591
- 1633971297,
15592
- 895580464,
15593
- 925905270
16795
+ this.bitOps = new BitOperations();
16796
+ this.b58encoder = new Base58Encoder();
16797
+ this.b64encoder = new Base64Encoder();
16798
+ this.hexProcessor = new HexProcessor();
16799
+ this.randomGen = new RandomGenerator();
16800
+ }
16801
+ encodeTimestamp(ts, randomizeFirst = true) {
16802
+ const key = Array(8).fill(CryptoConfig.TIMESTAMP_XOR_KEY);
16803
+ const arr = this.intToLeBytes(ts, 8);
16804
+ const encoded = arr.map((a, i)=>a ^ key[i]);
16805
+ if (randomizeFirst) encoded[0] = this.randomGen.generateRandomByteInRange(0, 255);
16806
+ return encoded;
16807
+ }
16808
+ intToLeBytes(val, length = 4) {
16809
+ const arr = [];
16810
+ for(let i = 0; i < length; i++){
16811
+ arr.push(0xFF & val);
16812
+ val >>>= 8;
16813
+ }
16814
+ return arr;
16815
+ }
16816
+ strToLenPrefixedBytes(s) {
16817
+ const buf = external_node_buffer_namespaceObject.Buffer.from(s, 'utf-8');
16818
+ return [
16819
+ buf.length,
16820
+ ...Array.from(buf)
16821
+ ];
16822
+ }
16823
+ buildEnvironmentBytes() {
16824
+ return [
16825
+ CryptoConfig.ENV_STATIC_BYTES[0],
16826
+ this.randomGen.generateRandomByteInRange(10, 254),
16827
+ ...CryptoConfig.ENV_STATIC_BYTES.slice(1)
15594
16828
  ];
15595
- this.keyBytes = external_node_buffer_namespaceObject.Buffer.concat(this.words.map((word)=>new Uint8Array(external_node_buffer_namespaceObject.Buffer.from([
15596
- word >> 24 & 0xff,
15597
- word >> 16 & 0xff,
15598
- word >> 8 & 0xff,
15599
- 0xff & word
15600
- ]))));
15601
- this.iv = external_node_buffer_namespaceObject.Buffer.from("4uzjr7mbsibcaldp", "utf8");
16829
+ }
16830
+ buildPayloadArray(hexParameter, a1Value, appIdentifier = "xhs-pc-web", stringParam = "") {
16831
+ const randNum = this.randomGen.generateRandomInt();
16832
+ const ts = Date.now();
16833
+ const startupTs = ts - (CryptoConfig.STARTUP_TIME_OFFSET_MIN + this.randomGen.generateRandomByteInRange(0, CryptoConfig.STARTUP_TIME_OFFSET_MAX - CryptoConfig.STARTUP_TIME_OFFSET_MIN));
16834
+ const arr = [];
16835
+ arr.push(...CryptoConfig.VERSION_BYTES);
16836
+ const randBytes = this.intToLeBytes(randNum, 4);
16837
+ arr.push(...randBytes);
16838
+ const xorKey = randBytes[0];
16839
+ arr.push(...this.encodeTimestamp(ts, true));
16840
+ arr.push(...this.intToLeBytes(startupTs, 8));
16841
+ arr.push(...this.intToLeBytes(CryptoConfig.FIXED_INT_VALUE_1));
16842
+ arr.push(...this.intToLeBytes(CryptoConfig.FIXED_INT_VALUE_2));
16843
+ const stringParamLength = external_node_buffer_namespaceObject.Buffer.from(stringParam, 'utf-8').length;
16844
+ arr.push(...this.intToLeBytes(stringParamLength));
16845
+ const md5Bytes = external_node_buffer_namespaceObject.Buffer.from(hexParameter, 'hex');
16846
+ const xorMd5Bytes = Array.from(md5Bytes).map((b)=>b ^ xorKey);
16847
+ arr.push(...xorMd5Bytes.slice(0, 8));
16848
+ arr.push(...this.strToLenPrefixedBytes(a1Value));
16849
+ arr.push(...this.strToLenPrefixedBytes(appIdentifier));
16850
+ arr.push(CryptoConfig.ENV_STATIC_BYTES[0], this.randomGen.generateRandomByteInRange(0, 255), ...CryptoConfig.ENV_STATIC_BYTES.slice(1));
16851
+ return arr;
16852
+ }
16853
+ }
16854
+ class Xhshow {
16855
+ constructor(){
16856
+ this.cryptoProcessor = new CryptoProcessor();
16857
+ }
16858
+ buildContentString(method, uri, payload) {
16859
+ payload = payload || {};
16860
+ if ("POST" === method.toUpperCase()) return uri + JSON.stringify(payload);
16861
+ if (!payload || 0 === Object.keys(payload).length) return uri;
16862
+ {
16863
+ const params = Object.entries(payload).map(([key, value])=>{
16864
+ let valueStr = '';
16865
+ if (Array.isArray(value)) valueStr = value.map((v)=>String(v)).join(',');
16866
+ else if (null != value) valueStr = String(value);
16867
+ return `${key}=${valueStr}`;
16868
+ });
16869
+ return `${uri}?${params.join('&')}`;
16870
+ }
16871
+ }
16872
+ generateDValue(content) {
16873
+ return external_node_crypto_default().createHash('md5').update(content, 'utf-8').digest('hex');
16874
+ }
16875
+ buildSignature(dValue, a1Value, xsecAppid = "xhs-pc-web", stringParam = "") {
16876
+ const payloadArray = this.cryptoProcessor.buildPayloadArray(dValue, a1Value, xsecAppid, stringParam);
16877
+ const xorResult = this.cryptoProcessor.bitOps.xorTransformArray(payloadArray);
16878
+ return this.cryptoProcessor.b58encoder.encodeToB58(xorResult);
16879
+ }
16880
+ signXs(method, uri, a1Value, xsecAppid = "xhs-pc-web", payload) {
16881
+ const validatedMethod = RequestSignatureValidator.validateMethod(method);
16882
+ const validatedUri = RequestSignatureValidator.validateUri(uri);
16883
+ const validatedA1Value = RequestSignatureValidator.validateA1Value(a1Value);
16884
+ const validatedXsecAppid = RequestSignatureValidator.validateXsecAppid(xsecAppid);
16885
+ const validatedPayload = RequestSignatureValidator.validatePayload(payload);
16886
+ const signatureData = {
16887
+ ...CryptoConfig.SIGNATURE_DATA_TEMPLATE
16888
+ };
16889
+ const contentString = this.buildContentString(validatedMethod, validatedUri, validatedPayload);
16890
+ const dValue = this.generateDValue(contentString);
16891
+ signatureData.x3 = CryptoConfig.X3_PREFIX + this.buildSignature(dValue, validatedA1Value, validatedXsecAppid, contentString);
16892
+ return CryptoConfig.XYS_PREFIX + this.cryptoProcessor.b64encoder.encodeToB64(JSON.stringify(signatureData));
16893
+ }
16894
+ signXsGet(uri, a1Value, xsecAppid = "xhs-pc-web", params) {
16895
+ const validatedUri = RequestSignatureValidator.validateUri(uri);
16896
+ const validatedA1Value = RequestSignatureValidator.validateA1Value(a1Value);
16897
+ const validatedXsecAppid = RequestSignatureValidator.validateXsecAppid(xsecAppid);
16898
+ const validatedParams = RequestSignatureValidator.validatePayload(params);
16899
+ return this.signXs("GET", validatedUri, validatedA1Value, validatedXsecAppid, validatedParams);
16900
+ }
16901
+ signXsPost(uri, a1Value, xsecAppid = "xhs-pc-web", payload) {
16902
+ const validatedUri = RequestSignatureValidator.validateUri(uri);
16903
+ const validatedA1Value = RequestSignatureValidator.validateA1Value(a1Value);
16904
+ const validatedXsecAppid = RequestSignatureValidator.validateXsecAppid(xsecAppid);
16905
+ const validatedPayload = RequestSignatureValidator.validatePayload(payload);
16906
+ return this.signXs("POST", validatedUri, validatedA1Value, validatedXsecAppid, validatedPayload);
15602
16907
  }
15603
16908
  }
15604
- const searchXiaohongshuTopicList_xsEncrypt = new XsEncrypt();
16909
+ const searchXiaohongshuTopicList_xsEncrypt = new Xhshow();
15605
16910
  const searchXiaohongshuTopicList = async (_task, params)=>{
15606
16911
  const http = new Http({
15607
16912
  headers: {
@@ -15629,9 +16934,8 @@ var __webpack_exports__ = {};
15629
16934
  page: 1
15630
16935
  }
15631
16936
  };
15632
- const topicDataStr = searchXiaohongshuTopicList_xsEncrypt.dumps(topicData);
15633
- const fatchTopic = `/web_api/sns/v1/search/topic${topicDataStr}`;
15634
- const xs = await searchXiaohongshuTopicList_xsEncrypt.encryptXs(fatchTopic, a1Cookie, xt);
16937
+ const fatchTopic = "/web_api/sns/v1/search/topic";
16938
+ const xs = searchXiaohongshuTopicList_xsEncrypt.signXsPost(fatchTopic, a1Cookie, "xhs-pc-web", topicData);
15635
16939
  const result = await http.api({
15636
16940
  method: "post",
15637
16941
  url: "https://edith.xiaohongshu.com/web_api/sns/v1/search/topic",
@@ -15680,12 +16984,13 @@ var __webpack_exports__ = {};
15680
16984
  const mock_mockAction = async (task, params)=>{
15681
16985
  const { toutiaoSingleCover, toutiaoMultCover, toutiaoCoverType, toutiaoOriginal, toutiaoExclusive, toutiaoClaim } = params.settingInfo;
15682
16986
  const tmpCachePath = task.getTmpPath();
16987
+ const headers = {
16988
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
16989
+ origin: "https://mp.toutiao.com",
16990
+ referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
16991
+ };
15683
16992
  const http = new Http({
15684
- headers: {
15685
- cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
15686
- origin: "https://mp.toutiao.com",
15687
- referer: "https://mp.toutiao.com/profile_v4/graphic/publish"
15688
- }
16993
+ headers
15689
16994
  });
15690
16995
  http.addResponseInterceptor((response)=>{
15691
16996
  if (response.data?.code !== 0) {
@@ -15844,7 +17149,10 @@ var __webpack_exports__ = {};
15844
17149
  },
15845
17150
  defaultErrorMsg: "draft" === params.saveType ? "文章同步异常,请稍后重试。" : "文章发布异常,请稍后重试。"
15846
17151
  };
15847
- const publishResult = await http.api(publishOption);
17152
+ const proxyHttp = new Http({
17153
+ headers
17154
+ }, params.proxyLoc);
17155
+ const publishResult = await proxyHttp.api(publishOption);
15848
17156
  return success(publishResult.data.pgc_id);
15849
17157
  };
15850
17158
  const rpa_GenAB = __webpack_require__("./src/utils/ttABEncrypt.js");
@@ -16465,10 +17773,10 @@ var __webpack_exports__ = {};
16465
17773
  origin: "https://creator.xiaohongshu.com"
16466
17774
  }
16467
17775
  });
16468
- const xsEncrypt = new XsEncrypt();
17776
+ const xsEncrypt = new Xhshow();
16469
17777
  const xt = Date.now().toString();
16470
17778
  const sevenDataUrl = "/api/galaxy/v2/creator/datacenter/account/base";
16471
- const xs = await xsEncrypt.encryptXs(sevenDataUrl, a1Cookie, xt);
17779
+ const xs = xsEncrypt.signXsGet(sevenDataUrl, a1Cookie, "xhs-pc-web", null);
16472
17780
  const [overAllData, sevenData] = await Promise.all([
16473
17781
  http.api({
16474
17782
  method: "get",
@@ -16829,7 +18137,7 @@ var __webpack_exports__ = {};
16829
18137
  async function handleXiaohongshuData(params) {
16830
18138
  try {
16831
18139
  const { cookies, pageNum = 1, pageSize = 10, showOriginalData = false, onlySuccess = false } = params;
16832
- const xsEncrypt = new XsEncrypt();
18140
+ const xsEncrypt = new Xhshow();
16833
18141
  const a1Cookie = cookies.find((it)=>"a1" === it.name)?.value;
16834
18142
  if (!a1Cookie) return {
16835
18143
  code: 200,
@@ -16850,8 +18158,12 @@ var __webpack_exports__ = {};
16850
18158
  });
16851
18159
  async function fetchArticles(pageNum, a1Cookie, onlySuccess = false) {
16852
18160
  const xt = Date.now().toString();
16853
- const serveUrl = `/web_api/sns/v5/creator/note/user/posted?tab=${onlySuccess ? 1 : 0}&page=${pageNum - 1}`;
16854
- const xs = await xsEncrypt.encryptXs(serveUrl, a1Cookie, xt);
18161
+ const serveUrl = "/web_api/sns/v5/creator/note/user/posted";
18162
+ const serveParams = {
18163
+ tab: onlySuccess ? 1 : 0,
18164
+ page: pageNum - 1
18165
+ };
18166
+ const xs = xsEncrypt.signXsGet(serveUrl, a1Cookie, "xhs-pc-web", serveParams);
16855
18167
  return await http.api({
16856
18168
  method: "get",
16857
18169
  baseURL: "https://edith.xiaohongshu.com",
@@ -16859,7 +18171,8 @@ var __webpack_exports__ = {};
16859
18171
  headers: {
16860
18172
  "x-s": xs,
16861
18173
  "x-t": xt
16862
- }
18174
+ },
18175
+ params: serveParams
16863
18176
  });
16864
18177
  }
16865
18178
  const articleInfo = await fetchArticles(pageNum, a1Cookie, onlySuccess);
@@ -17144,13 +18457,14 @@ var __webpack_exports__ = {};
17144
18457
  const fingerprint = "4695500bc93ab4ce8fb2692da6564e04";
17145
18458
  const client_time_diff = +Number("1743488763") - Math.floor(new Date().getTime() / 1000);
17146
18459
  const tmpCachePath = task.getTmpPath();
18460
+ const headers = {
18461
+ "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",
18462
+ Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
18463
+ origin: "https://mp.weixin.qq.com",
18464
+ 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&timestamp=${Date.now()}`
18465
+ };
17147
18466
  const http = new Http({
17148
- headers: {
17149
- "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",
17150
- Cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
17151
- origin: "https://mp.weixin.qq.com",
17152
- 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&timestamp=${Date.now()}`
17153
- }
18467
+ headers
17154
18468
  });
17155
18469
  http.addResponseInterceptor((response)=>{
17156
18470
  const responseData = response.data;
@@ -17697,6 +19011,9 @@ var __webpack_exports__ = {};
17697
19011
  };
17698
19012
  const uuid = getUuidResult.uuid;
17699
19013
  await sleep(1000);
19014
+ new Http({
19015
+ headers
19016
+ }, params.proxyLoc);
17700
19017
  const qrcodeResult = await http.api({
17701
19018
  method: "get",
17702
19019
  url: "https://mp.weixin.qq.com/safe/safeqrcode",
@@ -17716,7 +19033,7 @@ var __webpack_exports__ = {};
17716
19033
  responseType: "arraybuffer"
17717
19034
  });
17718
19035
  const qrcodeBuffer = Buffer.from(qrcodeResult);
17719
- const qrcodeFilePath = external_node_path_default().join(tmpCachePath, "weixin_qrcode.jpg");
19036
+ const qrcodeFilePath = external_node_path_default().join(tmpCachePath, `weixin_qrcode_${Date.now()}.jpg`);
17720
19037
  external_node_fs_default().writeFileSync(qrcodeFilePath, new Uint8Array(qrcodeBuffer));
17721
19038
  params.safeQrcodeCallback?.(qrcodeFilePath);
17722
19039
  let code = "";
@@ -18483,7 +19800,7 @@ var __webpack_exports__ = {};
18483
19800
  902: "登录已过期,请重新登录!",
18484
19801
  906: "账号存在风险,请重新登录"
18485
19802
  };
18486
- const mock_xsEncrypt = new XsEncrypt();
19803
+ const mock_xsEncrypt = new Xhshow();
18487
19804
  const xiaohongshuPublish_mock_mockAction = async (task, params)=>{
18488
19805
  const tmpCachePath = task.getTmpPath();
18489
19806
  const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
@@ -18492,13 +19809,14 @@ var __webpack_exports__ = {};
18492
19809
  message: "账号数据异常,请重新绑定账号后重试。",
18493
19810
  data: ""
18494
19811
  };
19812
+ const headers = {
19813
+ cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
19814
+ origin: "https://creator.xiaohongshu.com",
19815
+ referer: "https://creator.xiaohongshu.com/",
19816
+ "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
19817
+ };
18495
19818
  const http = new Http({
18496
- headers: {
18497
- cookie: params.cookies.map((it)=>`${it.name}=${it.value}`).join(";"),
18498
- origin: "https://creator.xiaohongshu.com",
18499
- referer: "https://creator.xiaohongshu.com/",
18500
- "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
18501
- }
19819
+ headers
18502
19820
  });
18503
19821
  http.addResponseInterceptor((response)=>{
18504
19822
  const responseData = response.data;
@@ -18511,9 +19829,16 @@ var __webpack_exports__ = {};
18511
19829
  };
18512
19830
  }
18513
19831
  });
18514
- const fetchCoverUrl = `/api/media/v1/upload/creator/permit?biz_name=spectrum&scene=image&file_count=${params.banners.length}&version=1&source=web`;
19832
+ const fetchCoverUrl = "/api/media/v1/upload/creator/permit";
19833
+ const fetchCoverParams = {
19834
+ biz_name: "spectrum",
19835
+ scene: "image",
19836
+ file_count: params.banners.length,
19837
+ version: 1,
19838
+ source: "web"
19839
+ };
18515
19840
  const xt = Date.now().toString();
18516
- const xs = await mock_xsEncrypt.encryptXs(fetchCoverUrl, a1Cookie, xt);
19841
+ const xs = mock_xsEncrypt.signXsGet(fetchCoverUrl, a1Cookie, "xhs-pc-web", fetchCoverParams);
18517
19842
  const coverIdInfo = await http.api({
18518
19843
  method: "get",
18519
19844
  baseURL: "https://creator.xiaohongshu.com",
@@ -18522,7 +19847,8 @@ var __webpack_exports__ = {};
18522
19847
  headers: {
18523
19848
  "x-s": xs,
18524
19849
  "x-t": xt
18525
- }
19850
+ },
19851
+ params: fetchCoverParams
18526
19852
  });
18527
19853
  let uploadInfos = [];
18528
19854
  coverIdInfo.data.uploadTempPermits.forEach((item)=>{
@@ -18596,9 +19922,8 @@ var __webpack_exports__ = {};
18596
19922
  const topicData = {
18597
19923
  topic_names: topic["name"]
18598
19924
  };
18599
- const topicDataStr = mock_xsEncrypt.dumps(topicData);
18600
19925
  const publishXt = Date.now().toString();
18601
- const publishXs = await mock_xsEncrypt.encryptXs(`/web_api/sns/capa/postgw/topic/batch_customized${topicDataStr}`, a1Cookie, publishXt);
19926
+ const publishXs = mock_xsEncrypt.signXsPost("/web_api/sns/capa/postgw/topic/batch_customized", a1Cookie, "xhs-pc-web", topicData);
18602
19927
  let createTopic = await http.api({
18603
19928
  method: "POST",
18604
19929
  url: "https://edith.xiaohongshu.com/web_api/sns/capa/postgw/topic/batch_customized",
@@ -18681,7 +20006,6 @@ var __webpack_exports__ = {};
18681
20006
  };
18682
20007
  }
18683
20008
  }
18684
- task._timerRecord['PrePublish'] = Date.now();
18685
20009
  const business_binds = {
18686
20010
  version: 1,
18687
20011
  bizType: "",
@@ -18698,11 +20022,14 @@ var __webpack_exports__ = {};
18698
20022
  } : {}
18699
20023
  };
18700
20024
  publishData.common.business_binds = JSON.stringify(business_binds);
18701
- const publishDataStr = mock_xsEncrypt.dumps(publishData);
18702
20025
  const publishXt = Date.now().toString();
18703
- const publishXs = await mock_xsEncrypt.encryptXs(`/web_api/sns/v2/note${publishDataStr}`, a1Cookie, publishXt);
20026
+ const publishXs = mock_xsEncrypt.signXsPost("/web_api/sns/v2/note", a1Cookie, "xhs-pc-web", publishData);
18704
20027
  const xscommon = GenXSCommon(a1Cookie, publishXt, publishXs);
18705
- const publishResult = await http.api({
20028
+ const proxyHttp = new Http({
20029
+ headers
20030
+ }, params.proxyLoc);
20031
+ task._timerRecord['PrePublish'] = Date.now();
20032
+ const publishResult = await proxyHttp.api({
18706
20033
  method: "post",
18707
20034
  url: "https://edith.xiaohongshu.com/web_api/sns/v2/note",
18708
20035
  data: publishData,
@@ -18716,7 +20043,7 @@ var __webpack_exports__ = {};
18716
20043
  return success(publishResult.data?.id);
18717
20044
  };
18718
20045
  const rpa_GenXSCommon = __webpack_require__("./src/utils/XhsXsCommonEnc.js");
18719
- const rpa_xsEncrypt = new XsEncrypt();
20046
+ const rpa_xsEncrypt = new Xhshow();
18720
20047
  const xiaohongshuPublish_rpa_rpaAction = async (task, params)=>{
18721
20048
  const commonCookies = {
18722
20049
  path: "/",
@@ -18747,7 +20074,8 @@ var __webpack_exports__ = {};
18747
20074
  const url = request.url();
18748
20075
  if (interceptUrls.some((pattern)=>url.includes(pattern))) {
18749
20076
  const urlObj = new URL(url);
18750
- const fetchCoverUrl = urlObj.pathname + urlObj.search;
20077
+ urlObj.pathname, urlObj.search;
20078
+ const fetchCoverParams = Object.fromEntries(new URLSearchParams(urlObj.search));
18751
20079
  const xt = Date.now().toString();
18752
20080
  const a1Cookie = params.cookies.find((it)=>"a1" === it.name)?.value;
18753
20081
  if (!a1Cookie) {
@@ -18765,9 +20093,8 @@ var __webpack_exports__ = {};
18765
20093
  const isNoteRequest = urlObj.pathname.includes(interceptUrls[5]);
18766
20094
  const xs = await (isNoteRequest ? (async ()=>{
18767
20095
  const publishData = JSON.parse(request.postData() || "");
18768
- const publishDataStr = rpa_xsEncrypt.dumps(publishData);
18769
- return rpa_xsEncrypt.encryptXs(interceptUrls[5] + publishDataStr, a1Cookie, xt);
18770
- })() : rpa_xsEncrypt.encryptXs(fetchCoverUrl, a1Cookie, xt));
20096
+ return rpa_xsEncrypt.signXsPost(interceptUrls[5], a1Cookie, "xhs-pc-web", publishData);
20097
+ })() : rpa_xsEncrypt.signXsGet(urlObj.pathname, a1Cookie, "xhs-pc-web", fetchCoverParams));
18771
20098
  const xscommon = rpa_GenXSCommon(a1Cookie, xt, xs);
18772
20099
  const newHeaders = {
18773
20100
  ...request.headers(),
@@ -18935,7 +20262,7 @@ var __webpack_exports__ = {};
18935
20262
  return executeAction(xiaohongshuPublish_mock_mockAction, xiaohongshuPublish_rpa_rpaAction)(task, params);
18936
20263
  };
18937
20264
  var package_namespaceObject = {
18938
- i8: "1.2.21"
20265
+ i8: "1.2.23"
18939
20266
  };
18940
20267
  const BetaFlag = "HuiwenCanary";
18941
20268
  class Action {
@@ -18944,7 +20271,7 @@ var __webpack_exports__ = {};
18944
20271
  }
18945
20272
  async bindTask(func, params) {
18946
20273
  let responseData;
18947
- this.task.isBeta = this.task?.isFeatOn(BetaFlag) ?? false;
20274
+ this.task.isBeta = this.task.isFeatOn(BetaFlag);
18948
20275
  this.task._timerRecord = {
18949
20276
  ActionStart: Date.now()
18950
20277
  };
@@ -18965,6 +20292,11 @@ var __webpack_exports__ = {};
18965
20292
  this.task.logger.error(responseData.message || `${func.name} 执行失败`, stringifyError(responseData.data), responseData.extra);
18966
20293
  this.task.logger.info(`${func.name} action failed`);
18967
20294
  } else this.task.logger.info(`${func.name} action success`);
20295
+ if (this.task.debug && this.task._timerRecord['PrePublish']) {
20296
+ console.log("预处理图片耗时:", (this.task._timerRecord['PrePublish'] - this.task._timerRecord['ActionStart']) / 1000, "s");
20297
+ console.log("发文接口耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['PrePublish']) / 1000, "s");
20298
+ }
20299
+ this.task.debug && console.log("Action整体耗时:", (this.task._timerRecord['ActionEnd'] - this.task._timerRecord['ActionStart']) / 1000, "s");
18968
20300
  return responseData;
18969
20301
  }
18970
20302
  FetchArticles(params) {