@tiktool/live 2.7.1 → 2.9.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/README.md +505 -235
- package/dist/index.d.mts +93 -4
- package/dist/index.d.ts +93 -4
- package/dist/index.js +1541 -44
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1549 -44
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -3
package/dist/index.js
CHANGED
|
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
8
11
|
var __export = (target, all) => {
|
|
9
12
|
for (var name in all)
|
|
10
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -27,6 +30,1246 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
30
|
));
|
|
28
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
32
|
|
|
33
|
+
// ../../../node_modules/ms/index.js
|
|
34
|
+
var require_ms = __commonJS({
|
|
35
|
+
"../../../node_modules/ms/index.js"(exports2, module2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
var s = 1e3;
|
|
38
|
+
var m = s * 60;
|
|
39
|
+
var h = m * 60;
|
|
40
|
+
var d = h * 24;
|
|
41
|
+
var w = d * 7;
|
|
42
|
+
var y = d * 365.25;
|
|
43
|
+
module2.exports = function(val, options) {
|
|
44
|
+
options = options || {};
|
|
45
|
+
var type = typeof val;
|
|
46
|
+
if (type === "string" && val.length > 0) {
|
|
47
|
+
return parse(val);
|
|
48
|
+
} else if (type === "number" && isFinite(val)) {
|
|
49
|
+
return options.long ? fmtLong(val) : fmtShort(val);
|
|
50
|
+
}
|
|
51
|
+
throw new Error(
|
|
52
|
+
"val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
|
|
53
|
+
);
|
|
54
|
+
};
|
|
55
|
+
function parse(str) {
|
|
56
|
+
str = String(str);
|
|
57
|
+
if (str.length > 100) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
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(
|
|
61
|
+
str
|
|
62
|
+
);
|
|
63
|
+
if (!match) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
var n = parseFloat(match[1]);
|
|
67
|
+
var type = (match[2] || "ms").toLowerCase();
|
|
68
|
+
switch (type) {
|
|
69
|
+
case "years":
|
|
70
|
+
case "year":
|
|
71
|
+
case "yrs":
|
|
72
|
+
case "yr":
|
|
73
|
+
case "y":
|
|
74
|
+
return n * y;
|
|
75
|
+
case "weeks":
|
|
76
|
+
case "week":
|
|
77
|
+
case "w":
|
|
78
|
+
return n * w;
|
|
79
|
+
case "days":
|
|
80
|
+
case "day":
|
|
81
|
+
case "d":
|
|
82
|
+
return n * d;
|
|
83
|
+
case "hours":
|
|
84
|
+
case "hour":
|
|
85
|
+
case "hrs":
|
|
86
|
+
case "hr":
|
|
87
|
+
case "h":
|
|
88
|
+
return n * h;
|
|
89
|
+
case "minutes":
|
|
90
|
+
case "minute":
|
|
91
|
+
case "mins":
|
|
92
|
+
case "min":
|
|
93
|
+
case "m":
|
|
94
|
+
return n * m;
|
|
95
|
+
case "seconds":
|
|
96
|
+
case "second":
|
|
97
|
+
case "secs":
|
|
98
|
+
case "sec":
|
|
99
|
+
case "s":
|
|
100
|
+
return n * s;
|
|
101
|
+
case "milliseconds":
|
|
102
|
+
case "millisecond":
|
|
103
|
+
case "msecs":
|
|
104
|
+
case "msec":
|
|
105
|
+
case "ms":
|
|
106
|
+
return n;
|
|
107
|
+
default:
|
|
108
|
+
return void 0;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function fmtShort(ms) {
|
|
112
|
+
var msAbs = Math.abs(ms);
|
|
113
|
+
if (msAbs >= d) {
|
|
114
|
+
return Math.round(ms / d) + "d";
|
|
115
|
+
}
|
|
116
|
+
if (msAbs >= h) {
|
|
117
|
+
return Math.round(ms / h) + "h";
|
|
118
|
+
}
|
|
119
|
+
if (msAbs >= m) {
|
|
120
|
+
return Math.round(ms / m) + "m";
|
|
121
|
+
}
|
|
122
|
+
if (msAbs >= s) {
|
|
123
|
+
return Math.round(ms / s) + "s";
|
|
124
|
+
}
|
|
125
|
+
return ms + "ms";
|
|
126
|
+
}
|
|
127
|
+
function fmtLong(ms) {
|
|
128
|
+
var msAbs = Math.abs(ms);
|
|
129
|
+
if (msAbs >= d) {
|
|
130
|
+
return plural(ms, msAbs, d, "day");
|
|
131
|
+
}
|
|
132
|
+
if (msAbs >= h) {
|
|
133
|
+
return plural(ms, msAbs, h, "hour");
|
|
134
|
+
}
|
|
135
|
+
if (msAbs >= m) {
|
|
136
|
+
return plural(ms, msAbs, m, "minute");
|
|
137
|
+
}
|
|
138
|
+
if (msAbs >= s) {
|
|
139
|
+
return plural(ms, msAbs, s, "second");
|
|
140
|
+
}
|
|
141
|
+
return ms + " ms";
|
|
142
|
+
}
|
|
143
|
+
function plural(ms, msAbs, n, name) {
|
|
144
|
+
var isPlural = msAbs >= n * 1.5;
|
|
145
|
+
return Math.round(ms / n) + " " + name + (isPlural ? "s" : "");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
// ../../../node_modules/debug/src/common.js
|
|
151
|
+
var require_common = __commonJS({
|
|
152
|
+
"../../../node_modules/debug/src/common.js"(exports2, module2) {
|
|
153
|
+
"use strict";
|
|
154
|
+
function setup(env) {
|
|
155
|
+
createDebug.debug = createDebug;
|
|
156
|
+
createDebug.default = createDebug;
|
|
157
|
+
createDebug.coerce = coerce;
|
|
158
|
+
createDebug.disable = disable;
|
|
159
|
+
createDebug.enable = enable;
|
|
160
|
+
createDebug.enabled = enabled;
|
|
161
|
+
createDebug.humanize = require_ms();
|
|
162
|
+
createDebug.destroy = destroy;
|
|
163
|
+
Object.keys(env).forEach((key) => {
|
|
164
|
+
createDebug[key] = env[key];
|
|
165
|
+
});
|
|
166
|
+
createDebug.names = [];
|
|
167
|
+
createDebug.skips = [];
|
|
168
|
+
createDebug.formatters = {};
|
|
169
|
+
function selectColor(namespace) {
|
|
170
|
+
let hash = 0;
|
|
171
|
+
for (let i = 0; i < namespace.length; i++) {
|
|
172
|
+
hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|
173
|
+
hash |= 0;
|
|
174
|
+
}
|
|
175
|
+
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|
176
|
+
}
|
|
177
|
+
createDebug.selectColor = selectColor;
|
|
178
|
+
function createDebug(namespace) {
|
|
179
|
+
let prevTime;
|
|
180
|
+
let enableOverride = null;
|
|
181
|
+
let namespacesCache;
|
|
182
|
+
let enabledCache;
|
|
183
|
+
function debug(...args) {
|
|
184
|
+
if (!debug.enabled) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
const self = debug;
|
|
188
|
+
const curr = Number(/* @__PURE__ */ new Date());
|
|
189
|
+
const ms = curr - (prevTime || curr);
|
|
190
|
+
self.diff = ms;
|
|
191
|
+
self.prev = prevTime;
|
|
192
|
+
self.curr = curr;
|
|
193
|
+
prevTime = curr;
|
|
194
|
+
args[0] = createDebug.coerce(args[0]);
|
|
195
|
+
if (typeof args[0] !== "string") {
|
|
196
|
+
args.unshift("%O");
|
|
197
|
+
}
|
|
198
|
+
let index = 0;
|
|
199
|
+
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
|
|
200
|
+
if (match === "%%") {
|
|
201
|
+
return "%";
|
|
202
|
+
}
|
|
203
|
+
index++;
|
|
204
|
+
const formatter = createDebug.formatters[format];
|
|
205
|
+
if (typeof formatter === "function") {
|
|
206
|
+
const val = args[index];
|
|
207
|
+
match = formatter.call(self, val);
|
|
208
|
+
args.splice(index, 1);
|
|
209
|
+
index--;
|
|
210
|
+
}
|
|
211
|
+
return match;
|
|
212
|
+
});
|
|
213
|
+
createDebug.formatArgs.call(self, args);
|
|
214
|
+
const logFn = self.log || createDebug.log;
|
|
215
|
+
logFn.apply(self, args);
|
|
216
|
+
}
|
|
217
|
+
debug.namespace = namespace;
|
|
218
|
+
debug.useColors = createDebug.useColors();
|
|
219
|
+
debug.color = createDebug.selectColor(namespace);
|
|
220
|
+
debug.extend = extend;
|
|
221
|
+
debug.destroy = createDebug.destroy;
|
|
222
|
+
Object.defineProperty(debug, "enabled", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
configurable: false,
|
|
225
|
+
get: () => {
|
|
226
|
+
if (enableOverride !== null) {
|
|
227
|
+
return enableOverride;
|
|
228
|
+
}
|
|
229
|
+
if (namespacesCache !== createDebug.namespaces) {
|
|
230
|
+
namespacesCache = createDebug.namespaces;
|
|
231
|
+
enabledCache = createDebug.enabled(namespace);
|
|
232
|
+
}
|
|
233
|
+
return enabledCache;
|
|
234
|
+
},
|
|
235
|
+
set: (v) => {
|
|
236
|
+
enableOverride = v;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
if (typeof createDebug.init === "function") {
|
|
240
|
+
createDebug.init(debug);
|
|
241
|
+
}
|
|
242
|
+
return debug;
|
|
243
|
+
}
|
|
244
|
+
function extend(namespace, delimiter) {
|
|
245
|
+
const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
|
|
246
|
+
newDebug.log = this.log;
|
|
247
|
+
return newDebug;
|
|
248
|
+
}
|
|
249
|
+
function enable(namespaces) {
|
|
250
|
+
createDebug.save(namespaces);
|
|
251
|
+
createDebug.namespaces = namespaces;
|
|
252
|
+
createDebug.names = [];
|
|
253
|
+
createDebug.skips = [];
|
|
254
|
+
const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
255
|
+
for (const ns of split) {
|
|
256
|
+
if (ns[0] === "-") {
|
|
257
|
+
createDebug.skips.push(ns.slice(1));
|
|
258
|
+
} else {
|
|
259
|
+
createDebug.names.push(ns);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function matchesTemplate(search, template) {
|
|
264
|
+
let searchIndex = 0;
|
|
265
|
+
let templateIndex = 0;
|
|
266
|
+
let starIndex = -1;
|
|
267
|
+
let matchIndex = 0;
|
|
268
|
+
while (searchIndex < search.length) {
|
|
269
|
+
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
|
|
270
|
+
if (template[templateIndex] === "*") {
|
|
271
|
+
starIndex = templateIndex;
|
|
272
|
+
matchIndex = searchIndex;
|
|
273
|
+
templateIndex++;
|
|
274
|
+
} else {
|
|
275
|
+
searchIndex++;
|
|
276
|
+
templateIndex++;
|
|
277
|
+
}
|
|
278
|
+
} else if (starIndex !== -1) {
|
|
279
|
+
templateIndex = starIndex + 1;
|
|
280
|
+
matchIndex++;
|
|
281
|
+
searchIndex = matchIndex;
|
|
282
|
+
} else {
|
|
283
|
+
return false;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
while (templateIndex < template.length && template[templateIndex] === "*") {
|
|
287
|
+
templateIndex++;
|
|
288
|
+
}
|
|
289
|
+
return templateIndex === template.length;
|
|
290
|
+
}
|
|
291
|
+
function disable() {
|
|
292
|
+
const namespaces = [
|
|
293
|
+
...createDebug.names,
|
|
294
|
+
...createDebug.skips.map((namespace) => "-" + namespace)
|
|
295
|
+
].join(",");
|
|
296
|
+
createDebug.enable("");
|
|
297
|
+
return namespaces;
|
|
298
|
+
}
|
|
299
|
+
function enabled(name) {
|
|
300
|
+
for (const skip of createDebug.skips) {
|
|
301
|
+
if (matchesTemplate(name, skip)) {
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
for (const ns of createDebug.names) {
|
|
306
|
+
if (matchesTemplate(name, ns)) {
|
|
307
|
+
return true;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return false;
|
|
311
|
+
}
|
|
312
|
+
function coerce(val) {
|
|
313
|
+
if (val instanceof Error) {
|
|
314
|
+
return val.stack || val.message;
|
|
315
|
+
}
|
|
316
|
+
return val;
|
|
317
|
+
}
|
|
318
|
+
function destroy() {
|
|
319
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
320
|
+
}
|
|
321
|
+
createDebug.enable(createDebug.load());
|
|
322
|
+
return createDebug;
|
|
323
|
+
}
|
|
324
|
+
module2.exports = setup;
|
|
325
|
+
}
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
// ../../../node_modules/debug/src/browser.js
|
|
329
|
+
var require_browser = __commonJS({
|
|
330
|
+
"../../../node_modules/debug/src/browser.js"(exports2, module2) {
|
|
331
|
+
"use strict";
|
|
332
|
+
exports2.formatArgs = formatArgs;
|
|
333
|
+
exports2.save = save;
|
|
334
|
+
exports2.load = load;
|
|
335
|
+
exports2.useColors = useColors;
|
|
336
|
+
exports2.storage = localstorage();
|
|
337
|
+
exports2.destroy = /* @__PURE__ */ (() => {
|
|
338
|
+
let warned = false;
|
|
339
|
+
return () => {
|
|
340
|
+
if (!warned) {
|
|
341
|
+
warned = true;
|
|
342
|
+
console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
})();
|
|
346
|
+
exports2.colors = [
|
|
347
|
+
"#0000CC",
|
|
348
|
+
"#0000FF",
|
|
349
|
+
"#0033CC",
|
|
350
|
+
"#0033FF",
|
|
351
|
+
"#0066CC",
|
|
352
|
+
"#0066FF",
|
|
353
|
+
"#0099CC",
|
|
354
|
+
"#0099FF",
|
|
355
|
+
"#00CC00",
|
|
356
|
+
"#00CC33",
|
|
357
|
+
"#00CC66",
|
|
358
|
+
"#00CC99",
|
|
359
|
+
"#00CCCC",
|
|
360
|
+
"#00CCFF",
|
|
361
|
+
"#3300CC",
|
|
362
|
+
"#3300FF",
|
|
363
|
+
"#3333CC",
|
|
364
|
+
"#3333FF",
|
|
365
|
+
"#3366CC",
|
|
366
|
+
"#3366FF",
|
|
367
|
+
"#3399CC",
|
|
368
|
+
"#3399FF",
|
|
369
|
+
"#33CC00",
|
|
370
|
+
"#33CC33",
|
|
371
|
+
"#33CC66",
|
|
372
|
+
"#33CC99",
|
|
373
|
+
"#33CCCC",
|
|
374
|
+
"#33CCFF",
|
|
375
|
+
"#6600CC",
|
|
376
|
+
"#6600FF",
|
|
377
|
+
"#6633CC",
|
|
378
|
+
"#6633FF",
|
|
379
|
+
"#66CC00",
|
|
380
|
+
"#66CC33",
|
|
381
|
+
"#9900CC",
|
|
382
|
+
"#9900FF",
|
|
383
|
+
"#9933CC",
|
|
384
|
+
"#9933FF",
|
|
385
|
+
"#99CC00",
|
|
386
|
+
"#99CC33",
|
|
387
|
+
"#CC0000",
|
|
388
|
+
"#CC0033",
|
|
389
|
+
"#CC0066",
|
|
390
|
+
"#CC0099",
|
|
391
|
+
"#CC00CC",
|
|
392
|
+
"#CC00FF",
|
|
393
|
+
"#CC3300",
|
|
394
|
+
"#CC3333",
|
|
395
|
+
"#CC3366",
|
|
396
|
+
"#CC3399",
|
|
397
|
+
"#CC33CC",
|
|
398
|
+
"#CC33FF",
|
|
399
|
+
"#CC6600",
|
|
400
|
+
"#CC6633",
|
|
401
|
+
"#CC9900",
|
|
402
|
+
"#CC9933",
|
|
403
|
+
"#CCCC00",
|
|
404
|
+
"#CCCC33",
|
|
405
|
+
"#FF0000",
|
|
406
|
+
"#FF0033",
|
|
407
|
+
"#FF0066",
|
|
408
|
+
"#FF0099",
|
|
409
|
+
"#FF00CC",
|
|
410
|
+
"#FF00FF",
|
|
411
|
+
"#FF3300",
|
|
412
|
+
"#FF3333",
|
|
413
|
+
"#FF3366",
|
|
414
|
+
"#FF3399",
|
|
415
|
+
"#FF33CC",
|
|
416
|
+
"#FF33FF",
|
|
417
|
+
"#FF6600",
|
|
418
|
+
"#FF6633",
|
|
419
|
+
"#FF9900",
|
|
420
|
+
"#FF9933",
|
|
421
|
+
"#FFCC00",
|
|
422
|
+
"#FFCC33"
|
|
423
|
+
];
|
|
424
|
+
function useColors() {
|
|
425
|
+
if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|
429
|
+
return false;
|
|
430
|
+
}
|
|
431
|
+
let m;
|
|
432
|
+
return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
|
|
433
|
+
typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
|
|
434
|
+
// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|
435
|
+
typeof navigator !== "undefined" && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
|
|
436
|
+
typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|
437
|
+
}
|
|
438
|
+
function formatArgs(args) {
|
|
439
|
+
args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module2.exports.humanize(this.diff);
|
|
440
|
+
if (!this.useColors) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
const c = "color: " + this.color;
|
|
444
|
+
args.splice(1, 0, c, "color: inherit");
|
|
445
|
+
let index = 0;
|
|
446
|
+
let lastC = 0;
|
|
447
|
+
args[0].replace(/%[a-zA-Z%]/g, (match) => {
|
|
448
|
+
if (match === "%%") {
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
index++;
|
|
452
|
+
if (match === "%c") {
|
|
453
|
+
lastC = index;
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
args.splice(lastC, 0, c);
|
|
457
|
+
}
|
|
458
|
+
exports2.log = console.debug || console.log || (() => {
|
|
459
|
+
});
|
|
460
|
+
function save(namespaces) {
|
|
461
|
+
try {
|
|
462
|
+
if (namespaces) {
|
|
463
|
+
exports2.storage.setItem("debug", namespaces);
|
|
464
|
+
} else {
|
|
465
|
+
exports2.storage.removeItem("debug");
|
|
466
|
+
}
|
|
467
|
+
} catch (error) {
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
function load() {
|
|
471
|
+
let r;
|
|
472
|
+
try {
|
|
473
|
+
r = exports2.storage.getItem("debug") || exports2.storage.getItem("DEBUG");
|
|
474
|
+
} catch (error) {
|
|
475
|
+
}
|
|
476
|
+
if (!r && typeof process !== "undefined" && "env" in process) {
|
|
477
|
+
r = process.env.DEBUG;
|
|
478
|
+
}
|
|
479
|
+
return r;
|
|
480
|
+
}
|
|
481
|
+
function localstorage() {
|
|
482
|
+
try {
|
|
483
|
+
return localStorage;
|
|
484
|
+
} catch (error) {
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
module2.exports = require_common()(exports2);
|
|
488
|
+
var { formatters } = module2.exports;
|
|
489
|
+
formatters.j = function(v) {
|
|
490
|
+
try {
|
|
491
|
+
return JSON.stringify(v);
|
|
492
|
+
} catch (error) {
|
|
493
|
+
return "[UnexpectedJSONParseError]: " + error.message;
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
// ../../../../node_modules/has-flag/index.js
|
|
500
|
+
var require_has_flag = __commonJS({
|
|
501
|
+
"../../../../node_modules/has-flag/index.js"(exports2, module2) {
|
|
502
|
+
"use strict";
|
|
503
|
+
module2.exports = (flag, argv = process.argv) => {
|
|
504
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
505
|
+
const position = argv.indexOf(prefix + flag);
|
|
506
|
+
const terminatorPosition = argv.indexOf("--");
|
|
507
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
508
|
+
};
|
|
509
|
+
}
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
// ../../../../node_modules/supports-color/index.js
|
|
513
|
+
var require_supports_color = __commonJS({
|
|
514
|
+
"../../../../node_modules/supports-color/index.js"(exports2, module2) {
|
|
515
|
+
"use strict";
|
|
516
|
+
var os = require("os");
|
|
517
|
+
var tty = require("tty");
|
|
518
|
+
var hasFlag = require_has_flag();
|
|
519
|
+
var { env } = process;
|
|
520
|
+
var forceColor;
|
|
521
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
522
|
+
forceColor = 0;
|
|
523
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
524
|
+
forceColor = 1;
|
|
525
|
+
}
|
|
526
|
+
if ("FORCE_COLOR" in env) {
|
|
527
|
+
if (env.FORCE_COLOR === "true") {
|
|
528
|
+
forceColor = 1;
|
|
529
|
+
} else if (env.FORCE_COLOR === "false") {
|
|
530
|
+
forceColor = 0;
|
|
531
|
+
} else {
|
|
532
|
+
forceColor = env.FORCE_COLOR.length === 0 ? 1 : Math.min(parseInt(env.FORCE_COLOR, 10), 3);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
function translateLevel(level) {
|
|
536
|
+
if (level === 0) {
|
|
537
|
+
return false;
|
|
538
|
+
}
|
|
539
|
+
return {
|
|
540
|
+
level,
|
|
541
|
+
hasBasic: true,
|
|
542
|
+
has256: level >= 2,
|
|
543
|
+
has16m: level >= 3
|
|
544
|
+
};
|
|
545
|
+
}
|
|
546
|
+
function supportsColor(haveStream, streamIsTTY) {
|
|
547
|
+
if (forceColor === 0) {
|
|
548
|
+
return 0;
|
|
549
|
+
}
|
|
550
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
551
|
+
return 3;
|
|
552
|
+
}
|
|
553
|
+
if (hasFlag("color=256")) {
|
|
554
|
+
return 2;
|
|
555
|
+
}
|
|
556
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
557
|
+
return 0;
|
|
558
|
+
}
|
|
559
|
+
const min = forceColor || 0;
|
|
560
|
+
if (env.TERM === "dumb") {
|
|
561
|
+
return min;
|
|
562
|
+
}
|
|
563
|
+
if (process.platform === "win32") {
|
|
564
|
+
const osRelease = os.release().split(".");
|
|
565
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
566
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
567
|
+
}
|
|
568
|
+
return 1;
|
|
569
|
+
}
|
|
570
|
+
if ("CI" in env) {
|
|
571
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "GITHUB_ACTIONS", "BUILDKITE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
572
|
+
return 1;
|
|
573
|
+
}
|
|
574
|
+
return min;
|
|
575
|
+
}
|
|
576
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
577
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
578
|
+
}
|
|
579
|
+
if (env.COLORTERM === "truecolor") {
|
|
580
|
+
return 3;
|
|
581
|
+
}
|
|
582
|
+
if ("TERM_PROGRAM" in env) {
|
|
583
|
+
const version = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
584
|
+
switch (env.TERM_PROGRAM) {
|
|
585
|
+
case "iTerm.app":
|
|
586
|
+
return version >= 3 ? 3 : 2;
|
|
587
|
+
case "Apple_Terminal":
|
|
588
|
+
return 2;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
592
|
+
return 2;
|
|
593
|
+
}
|
|
594
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
595
|
+
return 1;
|
|
596
|
+
}
|
|
597
|
+
if ("COLORTERM" in env) {
|
|
598
|
+
return 1;
|
|
599
|
+
}
|
|
600
|
+
return min;
|
|
601
|
+
}
|
|
602
|
+
function getSupportLevel(stream) {
|
|
603
|
+
const level = supportsColor(stream, stream && stream.isTTY);
|
|
604
|
+
return translateLevel(level);
|
|
605
|
+
}
|
|
606
|
+
module2.exports = {
|
|
607
|
+
supportsColor: getSupportLevel,
|
|
608
|
+
stdout: translateLevel(supportsColor(true, tty.isatty(1))),
|
|
609
|
+
stderr: translateLevel(supportsColor(true, tty.isatty(2)))
|
|
610
|
+
};
|
|
611
|
+
}
|
|
612
|
+
});
|
|
613
|
+
|
|
614
|
+
// ../../../node_modules/debug/src/node.js
|
|
615
|
+
var require_node = __commonJS({
|
|
616
|
+
"../../../node_modules/debug/src/node.js"(exports2, module2) {
|
|
617
|
+
"use strict";
|
|
618
|
+
var tty = require("tty");
|
|
619
|
+
var util = require("util");
|
|
620
|
+
exports2.init = init;
|
|
621
|
+
exports2.log = log;
|
|
622
|
+
exports2.formatArgs = formatArgs;
|
|
623
|
+
exports2.save = save;
|
|
624
|
+
exports2.load = load;
|
|
625
|
+
exports2.useColors = useColors;
|
|
626
|
+
exports2.destroy = util.deprecate(
|
|
627
|
+
() => {
|
|
628
|
+
},
|
|
629
|
+
"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
|
|
630
|
+
);
|
|
631
|
+
exports2.colors = [6, 2, 3, 4, 5, 1];
|
|
632
|
+
try {
|
|
633
|
+
const supportsColor = require_supports_color();
|
|
634
|
+
if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
|
|
635
|
+
exports2.colors = [
|
|
636
|
+
20,
|
|
637
|
+
21,
|
|
638
|
+
26,
|
|
639
|
+
27,
|
|
640
|
+
32,
|
|
641
|
+
33,
|
|
642
|
+
38,
|
|
643
|
+
39,
|
|
644
|
+
40,
|
|
645
|
+
41,
|
|
646
|
+
42,
|
|
647
|
+
43,
|
|
648
|
+
44,
|
|
649
|
+
45,
|
|
650
|
+
56,
|
|
651
|
+
57,
|
|
652
|
+
62,
|
|
653
|
+
63,
|
|
654
|
+
68,
|
|
655
|
+
69,
|
|
656
|
+
74,
|
|
657
|
+
75,
|
|
658
|
+
76,
|
|
659
|
+
77,
|
|
660
|
+
78,
|
|
661
|
+
79,
|
|
662
|
+
80,
|
|
663
|
+
81,
|
|
664
|
+
92,
|
|
665
|
+
93,
|
|
666
|
+
98,
|
|
667
|
+
99,
|
|
668
|
+
112,
|
|
669
|
+
113,
|
|
670
|
+
128,
|
|
671
|
+
129,
|
|
672
|
+
134,
|
|
673
|
+
135,
|
|
674
|
+
148,
|
|
675
|
+
149,
|
|
676
|
+
160,
|
|
677
|
+
161,
|
|
678
|
+
162,
|
|
679
|
+
163,
|
|
680
|
+
164,
|
|
681
|
+
165,
|
|
682
|
+
166,
|
|
683
|
+
167,
|
|
684
|
+
168,
|
|
685
|
+
169,
|
|
686
|
+
170,
|
|
687
|
+
171,
|
|
688
|
+
172,
|
|
689
|
+
173,
|
|
690
|
+
178,
|
|
691
|
+
179,
|
|
692
|
+
184,
|
|
693
|
+
185,
|
|
694
|
+
196,
|
|
695
|
+
197,
|
|
696
|
+
198,
|
|
697
|
+
199,
|
|
698
|
+
200,
|
|
699
|
+
201,
|
|
700
|
+
202,
|
|
701
|
+
203,
|
|
702
|
+
204,
|
|
703
|
+
205,
|
|
704
|
+
206,
|
|
705
|
+
207,
|
|
706
|
+
208,
|
|
707
|
+
209,
|
|
708
|
+
214,
|
|
709
|
+
215,
|
|
710
|
+
220,
|
|
711
|
+
221
|
|
712
|
+
];
|
|
713
|
+
}
|
|
714
|
+
} catch (error) {
|
|
715
|
+
}
|
|
716
|
+
exports2.inspectOpts = Object.keys(process.env).filter((key) => {
|
|
717
|
+
return /^debug_/i.test(key);
|
|
718
|
+
}).reduce((obj, key) => {
|
|
719
|
+
const prop = key.substring(6).toLowerCase().replace(/_([a-z])/g, (_, k) => {
|
|
720
|
+
return k.toUpperCase();
|
|
721
|
+
});
|
|
722
|
+
let val = process.env[key];
|
|
723
|
+
if (/^(yes|on|true|enabled)$/i.test(val)) {
|
|
724
|
+
val = true;
|
|
725
|
+
} else if (/^(no|off|false|disabled)$/i.test(val)) {
|
|
726
|
+
val = false;
|
|
727
|
+
} else if (val === "null") {
|
|
728
|
+
val = null;
|
|
729
|
+
} else {
|
|
730
|
+
val = Number(val);
|
|
731
|
+
}
|
|
732
|
+
obj[prop] = val;
|
|
733
|
+
return obj;
|
|
734
|
+
}, {});
|
|
735
|
+
function useColors() {
|
|
736
|
+
return "colors" in exports2.inspectOpts ? Boolean(exports2.inspectOpts.colors) : tty.isatty(process.stderr.fd);
|
|
737
|
+
}
|
|
738
|
+
function formatArgs(args) {
|
|
739
|
+
const { namespace: name, useColors: useColors2 } = this;
|
|
740
|
+
if (useColors2) {
|
|
741
|
+
const c = this.color;
|
|
742
|
+
const colorCode = "\x1B[3" + (c < 8 ? c : "8;5;" + c);
|
|
743
|
+
const prefix = ` ${colorCode};1m${name} \x1B[0m`;
|
|
744
|
+
args[0] = prefix + args[0].split("\n").join("\n" + prefix);
|
|
745
|
+
args.push(colorCode + "m+" + module2.exports.humanize(this.diff) + "\x1B[0m");
|
|
746
|
+
} else {
|
|
747
|
+
args[0] = getDate() + name + " " + args[0];
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
function getDate() {
|
|
751
|
+
if (exports2.inspectOpts.hideDate) {
|
|
752
|
+
return "";
|
|
753
|
+
}
|
|
754
|
+
return (/* @__PURE__ */ new Date()).toISOString() + " ";
|
|
755
|
+
}
|
|
756
|
+
function log(...args) {
|
|
757
|
+
return process.stderr.write(util.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
|
|
758
|
+
}
|
|
759
|
+
function save(namespaces) {
|
|
760
|
+
if (namespaces) {
|
|
761
|
+
process.env.DEBUG = namespaces;
|
|
762
|
+
} else {
|
|
763
|
+
delete process.env.DEBUG;
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
function load() {
|
|
767
|
+
return process.env.DEBUG;
|
|
768
|
+
}
|
|
769
|
+
function init(debug) {
|
|
770
|
+
debug.inspectOpts = {};
|
|
771
|
+
const keys = Object.keys(exports2.inspectOpts);
|
|
772
|
+
for (let i = 0; i < keys.length; i++) {
|
|
773
|
+
debug.inspectOpts[keys[i]] = exports2.inspectOpts[keys[i]];
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
module2.exports = require_common()(exports2);
|
|
777
|
+
var { formatters } = module2.exports;
|
|
778
|
+
formatters.o = function(v) {
|
|
779
|
+
this.inspectOpts.colors = this.useColors;
|
|
780
|
+
return util.inspect(v, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
|
|
781
|
+
};
|
|
782
|
+
formatters.O = function(v) {
|
|
783
|
+
this.inspectOpts.colors = this.useColors;
|
|
784
|
+
return util.inspect(v, this.inspectOpts);
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
});
|
|
788
|
+
|
|
789
|
+
// ../../../node_modules/debug/src/index.js
|
|
790
|
+
var require_src = __commonJS({
|
|
791
|
+
"../../../node_modules/debug/src/index.js"(exports2, module2) {
|
|
792
|
+
"use strict";
|
|
793
|
+
if (typeof process === "undefined" || process.type === "renderer" || process.browser === true || process.__nwjs) {
|
|
794
|
+
module2.exports = require_browser();
|
|
795
|
+
} else {
|
|
796
|
+
module2.exports = require_node();
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
});
|
|
800
|
+
|
|
801
|
+
// ../../../node_modules/agent-base/dist/helpers.js
|
|
802
|
+
var require_helpers = __commonJS({
|
|
803
|
+
"../../../node_modules/agent-base/dist/helpers.js"(exports2) {
|
|
804
|
+
"use strict";
|
|
805
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
806
|
+
if (k2 === void 0) k2 = k;
|
|
807
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
808
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
809
|
+
desc = { enumerable: true, get: function() {
|
|
810
|
+
return m[k];
|
|
811
|
+
} };
|
|
812
|
+
}
|
|
813
|
+
Object.defineProperty(o, k2, desc);
|
|
814
|
+
}) : (function(o, m, k, k2) {
|
|
815
|
+
if (k2 === void 0) k2 = k;
|
|
816
|
+
o[k2] = m[k];
|
|
817
|
+
}));
|
|
818
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
819
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
820
|
+
}) : function(o, v) {
|
|
821
|
+
o["default"] = v;
|
|
822
|
+
});
|
|
823
|
+
var __importStar = exports2 && exports2.__importStar || function(mod) {
|
|
824
|
+
if (mod && mod.__esModule) return mod;
|
|
825
|
+
var result = {};
|
|
826
|
+
if (mod != null) {
|
|
827
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
828
|
+
}
|
|
829
|
+
__setModuleDefault(result, mod);
|
|
830
|
+
return result;
|
|
831
|
+
};
|
|
832
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
833
|
+
exports2.req = exports2.json = exports2.toBuffer = void 0;
|
|
834
|
+
var http2 = __importStar(require("http"));
|
|
835
|
+
var https2 = __importStar(require("https"));
|
|
836
|
+
async function toBuffer(stream) {
|
|
837
|
+
let length = 0;
|
|
838
|
+
const chunks = [];
|
|
839
|
+
for await (const chunk of stream) {
|
|
840
|
+
length += chunk.length;
|
|
841
|
+
chunks.push(chunk);
|
|
842
|
+
}
|
|
843
|
+
return Buffer.concat(chunks, length);
|
|
844
|
+
}
|
|
845
|
+
exports2.toBuffer = toBuffer;
|
|
846
|
+
async function json(stream) {
|
|
847
|
+
const buf = await toBuffer(stream);
|
|
848
|
+
const str = buf.toString("utf8");
|
|
849
|
+
try {
|
|
850
|
+
return JSON.parse(str);
|
|
851
|
+
} catch (_err) {
|
|
852
|
+
const err = _err;
|
|
853
|
+
err.message += ` (input: ${str})`;
|
|
854
|
+
throw err;
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
exports2.json = json;
|
|
858
|
+
function req(url, opts = {}) {
|
|
859
|
+
const href = typeof url === "string" ? url : url.href;
|
|
860
|
+
const req2 = (href.startsWith("https:") ? https2 : http2).request(url, opts);
|
|
861
|
+
const promise = new Promise((resolve, reject) => {
|
|
862
|
+
req2.once("response", resolve).once("error", reject).end();
|
|
863
|
+
});
|
|
864
|
+
req2.then = promise.then.bind(promise);
|
|
865
|
+
return req2;
|
|
866
|
+
}
|
|
867
|
+
exports2.req = req;
|
|
868
|
+
}
|
|
869
|
+
});
|
|
870
|
+
|
|
871
|
+
// ../../../node_modules/agent-base/dist/index.js
|
|
872
|
+
var require_dist = __commonJS({
|
|
873
|
+
"../../../node_modules/agent-base/dist/index.js"(exports2) {
|
|
874
|
+
"use strict";
|
|
875
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
876
|
+
if (k2 === void 0) k2 = k;
|
|
877
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
878
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
879
|
+
desc = { enumerable: true, get: function() {
|
|
880
|
+
return m[k];
|
|
881
|
+
} };
|
|
882
|
+
}
|
|
883
|
+
Object.defineProperty(o, k2, desc);
|
|
884
|
+
}) : (function(o, m, k, k2) {
|
|
885
|
+
if (k2 === void 0) k2 = k;
|
|
886
|
+
o[k2] = m[k];
|
|
887
|
+
}));
|
|
888
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
889
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
890
|
+
}) : function(o, v) {
|
|
891
|
+
o["default"] = v;
|
|
892
|
+
});
|
|
893
|
+
var __importStar = exports2 && exports2.__importStar || function(mod) {
|
|
894
|
+
if (mod && mod.__esModule) return mod;
|
|
895
|
+
var result = {};
|
|
896
|
+
if (mod != null) {
|
|
897
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
898
|
+
}
|
|
899
|
+
__setModuleDefault(result, mod);
|
|
900
|
+
return result;
|
|
901
|
+
};
|
|
902
|
+
var __exportStar = exports2 && exports2.__exportStar || function(m, exports3) {
|
|
903
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
904
|
+
};
|
|
905
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
906
|
+
exports2.Agent = void 0;
|
|
907
|
+
var net = __importStar(require("net"));
|
|
908
|
+
var http2 = __importStar(require("http"));
|
|
909
|
+
var https_1 = require("https");
|
|
910
|
+
__exportStar(require_helpers(), exports2);
|
|
911
|
+
var INTERNAL = /* @__PURE__ */ Symbol("AgentBaseInternalState");
|
|
912
|
+
var Agent = class extends http2.Agent {
|
|
913
|
+
constructor(opts) {
|
|
914
|
+
super(opts);
|
|
915
|
+
this[INTERNAL] = {};
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Determine whether this is an `http` or `https` request.
|
|
919
|
+
*/
|
|
920
|
+
isSecureEndpoint(options) {
|
|
921
|
+
if (options) {
|
|
922
|
+
if (typeof options.secureEndpoint === "boolean") {
|
|
923
|
+
return options.secureEndpoint;
|
|
924
|
+
}
|
|
925
|
+
if (typeof options.protocol === "string") {
|
|
926
|
+
return options.protocol === "https:";
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
const { stack } = new Error();
|
|
930
|
+
if (typeof stack !== "string")
|
|
931
|
+
return false;
|
|
932
|
+
return stack.split("\n").some((l) => l.indexOf("(https.js:") !== -1 || l.indexOf("node:https:") !== -1);
|
|
933
|
+
}
|
|
934
|
+
// In order to support async signatures in `connect()` and Node's native
|
|
935
|
+
// connection pooling in `http.Agent`, the array of sockets for each origin
|
|
936
|
+
// has to be updated synchronously. This is so the length of the array is
|
|
937
|
+
// accurate when `addRequest()` is next called. We achieve this by creating a
|
|
938
|
+
// fake socket and adding it to `sockets[origin]` and incrementing
|
|
939
|
+
// `totalSocketCount`.
|
|
940
|
+
incrementSockets(name) {
|
|
941
|
+
if (this.maxSockets === Infinity && this.maxTotalSockets === Infinity) {
|
|
942
|
+
return null;
|
|
943
|
+
}
|
|
944
|
+
if (!this.sockets[name]) {
|
|
945
|
+
this.sockets[name] = [];
|
|
946
|
+
}
|
|
947
|
+
const fakeSocket = new net.Socket({ writable: false });
|
|
948
|
+
this.sockets[name].push(fakeSocket);
|
|
949
|
+
this.totalSocketCount++;
|
|
950
|
+
return fakeSocket;
|
|
951
|
+
}
|
|
952
|
+
decrementSockets(name, socket) {
|
|
953
|
+
if (!this.sockets[name] || socket === null) {
|
|
954
|
+
return;
|
|
955
|
+
}
|
|
956
|
+
const sockets = this.sockets[name];
|
|
957
|
+
const index = sockets.indexOf(socket);
|
|
958
|
+
if (index !== -1) {
|
|
959
|
+
sockets.splice(index, 1);
|
|
960
|
+
this.totalSocketCount--;
|
|
961
|
+
if (sockets.length === 0) {
|
|
962
|
+
delete this.sockets[name];
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
// In order to properly update the socket pool, we need to call `getName()` on
|
|
967
|
+
// the core `https.Agent` if it is a secureEndpoint.
|
|
968
|
+
getName(options) {
|
|
969
|
+
const secureEndpoint = this.isSecureEndpoint(options);
|
|
970
|
+
if (secureEndpoint) {
|
|
971
|
+
return https_1.Agent.prototype.getName.call(this, options);
|
|
972
|
+
}
|
|
973
|
+
return super.getName(options);
|
|
974
|
+
}
|
|
975
|
+
createSocket(req, options, cb) {
|
|
976
|
+
const connectOpts = {
|
|
977
|
+
...options,
|
|
978
|
+
secureEndpoint: this.isSecureEndpoint(options)
|
|
979
|
+
};
|
|
980
|
+
const name = this.getName(connectOpts);
|
|
981
|
+
const fakeSocket = this.incrementSockets(name);
|
|
982
|
+
Promise.resolve().then(() => this.connect(req, connectOpts)).then((socket) => {
|
|
983
|
+
this.decrementSockets(name, fakeSocket);
|
|
984
|
+
if (socket instanceof http2.Agent) {
|
|
985
|
+
try {
|
|
986
|
+
return socket.addRequest(req, connectOpts);
|
|
987
|
+
} catch (err) {
|
|
988
|
+
return cb(err);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
this[INTERNAL].currentSocket = socket;
|
|
992
|
+
super.createSocket(req, options, cb);
|
|
993
|
+
}, (err) => {
|
|
994
|
+
this.decrementSockets(name, fakeSocket);
|
|
995
|
+
cb(err);
|
|
996
|
+
});
|
|
997
|
+
}
|
|
998
|
+
createConnection() {
|
|
999
|
+
const socket = this[INTERNAL].currentSocket;
|
|
1000
|
+
this[INTERNAL].currentSocket = void 0;
|
|
1001
|
+
if (!socket) {
|
|
1002
|
+
throw new Error("No socket was returned in the `connect()` function");
|
|
1003
|
+
}
|
|
1004
|
+
return socket;
|
|
1005
|
+
}
|
|
1006
|
+
get defaultPort() {
|
|
1007
|
+
return this[INTERNAL].defaultPort ?? (this.protocol === "https:" ? 443 : 80);
|
|
1008
|
+
}
|
|
1009
|
+
set defaultPort(v) {
|
|
1010
|
+
if (this[INTERNAL]) {
|
|
1011
|
+
this[INTERNAL].defaultPort = v;
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
get protocol() {
|
|
1015
|
+
return this[INTERNAL].protocol ?? (this.isSecureEndpoint() ? "https:" : "http:");
|
|
1016
|
+
}
|
|
1017
|
+
set protocol(v) {
|
|
1018
|
+
if (this[INTERNAL]) {
|
|
1019
|
+
this[INTERNAL].protocol = v;
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
};
|
|
1023
|
+
exports2.Agent = Agent;
|
|
1024
|
+
}
|
|
1025
|
+
});
|
|
1026
|
+
|
|
1027
|
+
// ../../../node_modules/https-proxy-agent/dist/parse-proxy-response.js
|
|
1028
|
+
var require_parse_proxy_response = __commonJS({
|
|
1029
|
+
"../../../node_modules/https-proxy-agent/dist/parse-proxy-response.js"(exports2) {
|
|
1030
|
+
"use strict";
|
|
1031
|
+
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
1032
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1033
|
+
};
|
|
1034
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1035
|
+
exports2.parseProxyResponse = void 0;
|
|
1036
|
+
var debug_1 = __importDefault(require_src());
|
|
1037
|
+
var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
|
|
1038
|
+
function parseProxyResponse(socket) {
|
|
1039
|
+
return new Promise((resolve, reject) => {
|
|
1040
|
+
let buffersLength = 0;
|
|
1041
|
+
const buffers = [];
|
|
1042
|
+
function read() {
|
|
1043
|
+
const b = socket.read();
|
|
1044
|
+
if (b)
|
|
1045
|
+
ondata(b);
|
|
1046
|
+
else
|
|
1047
|
+
socket.once("readable", read);
|
|
1048
|
+
}
|
|
1049
|
+
function cleanup() {
|
|
1050
|
+
socket.removeListener("end", onend);
|
|
1051
|
+
socket.removeListener("error", onerror);
|
|
1052
|
+
socket.removeListener("readable", read);
|
|
1053
|
+
}
|
|
1054
|
+
function onend() {
|
|
1055
|
+
cleanup();
|
|
1056
|
+
debug("onend");
|
|
1057
|
+
reject(new Error("Proxy connection ended before receiving CONNECT response"));
|
|
1058
|
+
}
|
|
1059
|
+
function onerror(err) {
|
|
1060
|
+
cleanup();
|
|
1061
|
+
debug("onerror %o", err);
|
|
1062
|
+
reject(err);
|
|
1063
|
+
}
|
|
1064
|
+
function ondata(b) {
|
|
1065
|
+
buffers.push(b);
|
|
1066
|
+
buffersLength += b.length;
|
|
1067
|
+
const buffered = Buffer.concat(buffers, buffersLength);
|
|
1068
|
+
const endOfHeaders = buffered.indexOf("\r\n\r\n");
|
|
1069
|
+
if (endOfHeaders === -1) {
|
|
1070
|
+
debug("have not received end of HTTP headers yet...");
|
|
1071
|
+
read();
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
const headerParts = buffered.slice(0, endOfHeaders).toString("ascii").split("\r\n");
|
|
1075
|
+
const firstLine = headerParts.shift();
|
|
1076
|
+
if (!firstLine) {
|
|
1077
|
+
socket.destroy();
|
|
1078
|
+
return reject(new Error("No header received from proxy CONNECT response"));
|
|
1079
|
+
}
|
|
1080
|
+
const firstLineParts = firstLine.split(" ");
|
|
1081
|
+
const statusCode = +firstLineParts[1];
|
|
1082
|
+
const statusText = firstLineParts.slice(2).join(" ");
|
|
1083
|
+
const headers = {};
|
|
1084
|
+
for (const header of headerParts) {
|
|
1085
|
+
if (!header)
|
|
1086
|
+
continue;
|
|
1087
|
+
const firstColon = header.indexOf(":");
|
|
1088
|
+
if (firstColon === -1) {
|
|
1089
|
+
socket.destroy();
|
|
1090
|
+
return reject(new Error(`Invalid header from proxy CONNECT response: "${header}"`));
|
|
1091
|
+
}
|
|
1092
|
+
const key = header.slice(0, firstColon).toLowerCase();
|
|
1093
|
+
const value = header.slice(firstColon + 1).trimStart();
|
|
1094
|
+
const current = headers[key];
|
|
1095
|
+
if (typeof current === "string") {
|
|
1096
|
+
headers[key] = [current, value];
|
|
1097
|
+
} else if (Array.isArray(current)) {
|
|
1098
|
+
current.push(value);
|
|
1099
|
+
} else {
|
|
1100
|
+
headers[key] = value;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
debug("got proxy server response: %o %o", firstLine, headers);
|
|
1104
|
+
cleanup();
|
|
1105
|
+
resolve({
|
|
1106
|
+
connect: {
|
|
1107
|
+
statusCode,
|
|
1108
|
+
statusText,
|
|
1109
|
+
headers
|
|
1110
|
+
},
|
|
1111
|
+
buffered
|
|
1112
|
+
});
|
|
1113
|
+
}
|
|
1114
|
+
socket.on("error", onerror);
|
|
1115
|
+
socket.on("end", onend);
|
|
1116
|
+
read();
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
exports2.parseProxyResponse = parseProxyResponse;
|
|
1120
|
+
}
|
|
1121
|
+
});
|
|
1122
|
+
|
|
1123
|
+
// ../../../node_modules/https-proxy-agent/dist/index.js
|
|
1124
|
+
var require_dist2 = __commonJS({
|
|
1125
|
+
"../../../node_modules/https-proxy-agent/dist/index.js"(exports2) {
|
|
1126
|
+
"use strict";
|
|
1127
|
+
var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
|
|
1128
|
+
if (k2 === void 0) k2 = k;
|
|
1129
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1130
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1131
|
+
desc = { enumerable: true, get: function() {
|
|
1132
|
+
return m[k];
|
|
1133
|
+
} };
|
|
1134
|
+
}
|
|
1135
|
+
Object.defineProperty(o, k2, desc);
|
|
1136
|
+
}) : (function(o, m, k, k2) {
|
|
1137
|
+
if (k2 === void 0) k2 = k;
|
|
1138
|
+
o[k2] = m[k];
|
|
1139
|
+
}));
|
|
1140
|
+
var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
|
|
1141
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
1142
|
+
}) : function(o, v) {
|
|
1143
|
+
o["default"] = v;
|
|
1144
|
+
});
|
|
1145
|
+
var __importStar = exports2 && exports2.__importStar || function(mod) {
|
|
1146
|
+
if (mod && mod.__esModule) return mod;
|
|
1147
|
+
var result = {};
|
|
1148
|
+
if (mod != null) {
|
|
1149
|
+
for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
1150
|
+
}
|
|
1151
|
+
__setModuleDefault(result, mod);
|
|
1152
|
+
return result;
|
|
1153
|
+
};
|
|
1154
|
+
var __importDefault = exports2 && exports2.__importDefault || function(mod) {
|
|
1155
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
1156
|
+
};
|
|
1157
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
1158
|
+
exports2.HttpsProxyAgent = void 0;
|
|
1159
|
+
var net = __importStar(require("net"));
|
|
1160
|
+
var tls = __importStar(require("tls"));
|
|
1161
|
+
var assert_1 = __importDefault(require("assert"));
|
|
1162
|
+
var debug_1 = __importDefault(require_src());
|
|
1163
|
+
var agent_base_1 = require_dist();
|
|
1164
|
+
var url_1 = require("url");
|
|
1165
|
+
var parse_proxy_response_1 = require_parse_proxy_response();
|
|
1166
|
+
var debug = (0, debug_1.default)("https-proxy-agent");
|
|
1167
|
+
var setServernameFromNonIpHost = (options) => {
|
|
1168
|
+
if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
|
|
1169
|
+
return {
|
|
1170
|
+
...options,
|
|
1171
|
+
servername: options.host
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
return options;
|
|
1175
|
+
};
|
|
1176
|
+
var HttpsProxyAgent = class extends agent_base_1.Agent {
|
|
1177
|
+
constructor(proxy, opts) {
|
|
1178
|
+
super(opts);
|
|
1179
|
+
this.options = { path: void 0 };
|
|
1180
|
+
this.proxy = typeof proxy === "string" ? new url_1.URL(proxy) : proxy;
|
|
1181
|
+
this.proxyHeaders = opts?.headers ?? {};
|
|
1182
|
+
debug("Creating new HttpsProxyAgent instance: %o", this.proxy.href);
|
|
1183
|
+
const host = (this.proxy.hostname || this.proxy.host).replace(/^\[|\]$/g, "");
|
|
1184
|
+
const port = this.proxy.port ? parseInt(this.proxy.port, 10) : this.proxy.protocol === "https:" ? 443 : 80;
|
|
1185
|
+
this.connectOpts = {
|
|
1186
|
+
// Attempt to negotiate http/1.1 for proxy servers that support http/2
|
|
1187
|
+
ALPNProtocols: ["http/1.1"],
|
|
1188
|
+
...opts ? omit(opts, "headers") : null,
|
|
1189
|
+
host,
|
|
1190
|
+
port
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Called when the node-core HTTP client library is creating a
|
|
1195
|
+
* new HTTP request.
|
|
1196
|
+
*/
|
|
1197
|
+
async connect(req, opts) {
|
|
1198
|
+
const { proxy } = this;
|
|
1199
|
+
if (!opts.host) {
|
|
1200
|
+
throw new TypeError('No "host" provided');
|
|
1201
|
+
}
|
|
1202
|
+
let socket;
|
|
1203
|
+
if (proxy.protocol === "https:") {
|
|
1204
|
+
debug("Creating `tls.Socket`: %o", this.connectOpts);
|
|
1205
|
+
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
1206
|
+
} else {
|
|
1207
|
+
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
1208
|
+
socket = net.connect(this.connectOpts);
|
|
1209
|
+
}
|
|
1210
|
+
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
1211
|
+
const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
1212
|
+
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
|
|
1213
|
+
`;
|
|
1214
|
+
if (proxy.username || proxy.password) {
|
|
1215
|
+
const auth = `${decodeURIComponent(proxy.username)}:${decodeURIComponent(proxy.password)}`;
|
|
1216
|
+
headers["Proxy-Authorization"] = `Basic ${Buffer.from(auth).toString("base64")}`;
|
|
1217
|
+
}
|
|
1218
|
+
headers.Host = `${host}:${opts.port}`;
|
|
1219
|
+
if (!headers["Proxy-Connection"]) {
|
|
1220
|
+
headers["Proxy-Connection"] = this.keepAlive ? "Keep-Alive" : "close";
|
|
1221
|
+
}
|
|
1222
|
+
for (const name of Object.keys(headers)) {
|
|
1223
|
+
payload += `${name}: ${headers[name]}\r
|
|
1224
|
+
`;
|
|
1225
|
+
}
|
|
1226
|
+
const proxyResponsePromise = (0, parse_proxy_response_1.parseProxyResponse)(socket);
|
|
1227
|
+
socket.write(`${payload}\r
|
|
1228
|
+
`);
|
|
1229
|
+
const { connect, buffered } = await proxyResponsePromise;
|
|
1230
|
+
req.emit("proxyConnect", connect);
|
|
1231
|
+
this.emit("proxyConnect", connect, req);
|
|
1232
|
+
if (connect.statusCode === 200) {
|
|
1233
|
+
req.once("socket", resume);
|
|
1234
|
+
if (opts.secureEndpoint) {
|
|
1235
|
+
debug("Upgrading socket connection to TLS");
|
|
1236
|
+
return tls.connect({
|
|
1237
|
+
...omit(setServernameFromNonIpHost(opts), "host", "path", "port"),
|
|
1238
|
+
socket
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
return socket;
|
|
1242
|
+
}
|
|
1243
|
+
socket.destroy();
|
|
1244
|
+
const fakeSocket = new net.Socket({ writable: false });
|
|
1245
|
+
fakeSocket.readable = true;
|
|
1246
|
+
req.once("socket", (s) => {
|
|
1247
|
+
debug("Replaying proxy buffer for failed request");
|
|
1248
|
+
(0, assert_1.default)(s.listenerCount("data") > 0);
|
|
1249
|
+
s.push(buffered);
|
|
1250
|
+
s.push(null);
|
|
1251
|
+
});
|
|
1252
|
+
return fakeSocket;
|
|
1253
|
+
}
|
|
1254
|
+
};
|
|
1255
|
+
HttpsProxyAgent.protocols = ["http", "https"];
|
|
1256
|
+
exports2.HttpsProxyAgent = HttpsProxyAgent;
|
|
1257
|
+
function resume(socket) {
|
|
1258
|
+
socket.resume();
|
|
1259
|
+
}
|
|
1260
|
+
function omit(obj, ...keys) {
|
|
1261
|
+
const ret = {};
|
|
1262
|
+
let key;
|
|
1263
|
+
for (key in obj) {
|
|
1264
|
+
if (!keys.includes(key)) {
|
|
1265
|
+
ret[key] = obj[key];
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
return ret;
|
|
1269
|
+
}
|
|
1270
|
+
}
|
|
1271
|
+
});
|
|
1272
|
+
|
|
30
1273
|
// src/index.ts
|
|
31
1274
|
var index_exports = {};
|
|
32
1275
|
__export(index_exports, {
|
|
@@ -432,27 +1675,41 @@ function parseWebcastMessage(method, payload) {
|
|
|
432
1675
|
// Proto: WebcastLinkMicBattle { repeated WebcastLinkMicBattleItems battleUsers=10 }
|
|
433
1676
|
// battleUsers → { battleGroup=2 → { LinkUser user=1 } }
|
|
434
1677
|
case "WebcastLinkMicBattle": {
|
|
435
|
-
const battleId = String(getInt(f, 1) || "");
|
|
436
|
-
|
|
1678
|
+
const battleId = String(getInt(f, 4) || getInt(f, 1) || "");
|
|
1679
|
+
let status = getInt(f, 7);
|
|
1680
|
+
if (!status) {
|
|
1681
|
+
const fallback = getInt(f, 2);
|
|
1682
|
+
status = fallback > 0 && fallback < 100 ? fallback : 1;
|
|
1683
|
+
}
|
|
437
1684
|
const battleDuration = getInt(f, 3);
|
|
438
1685
|
const teams = [];
|
|
439
|
-
const
|
|
440
|
-
for (const
|
|
1686
|
+
const hostBufs = getAllBytes(f, 14);
|
|
1687
|
+
for (const hb of hostBufs) {
|
|
441
1688
|
try {
|
|
442
|
-
const
|
|
443
|
-
const
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
1689
|
+
const hf = decodeProto(hb);
|
|
1690
|
+
const hostUserId = String(getInt(hf, 1) || "");
|
|
1691
|
+
const teamTotalScore = getInt(hf, 3);
|
|
1692
|
+
const users = [];
|
|
1693
|
+
const containerBuf = getBytes(hf, 4);
|
|
1694
|
+
if (containerBuf) {
|
|
1695
|
+
const cf = decodeProto(containerBuf);
|
|
1696
|
+
const userBufs = getAllBytes(cf, 1);
|
|
1697
|
+
for (const ub of userBufs) {
|
|
1698
|
+
try {
|
|
1699
|
+
const uf = decodeProto(ub);
|
|
1700
|
+
users.push({
|
|
1701
|
+
user: {
|
|
1702
|
+
id: String(getInt(uf, 1) || ""),
|
|
1703
|
+
nickname: getStr(uf, 3) || "",
|
|
1704
|
+
uniqueId: getStr(uf, 3) || ""
|
|
1705
|
+
},
|
|
1706
|
+
score: getInt(uf, 2)
|
|
1707
|
+
});
|
|
1708
|
+
} catch {
|
|
1709
|
+
}
|
|
454
1710
|
}
|
|
455
1711
|
}
|
|
1712
|
+
teams.push({ hostUserId, score: teamTotalScore, users });
|
|
456
1713
|
} catch {
|
|
457
1714
|
}
|
|
458
1715
|
}
|
|
@@ -465,15 +1722,42 @@ function parseWebcastMessage(method, payload) {
|
|
|
465
1722
|
}
|
|
466
1723
|
}
|
|
467
1724
|
}
|
|
1725
|
+
if (teams.length === 0) {
|
|
1726
|
+
const battleUserBufs = getAllBytes(f, 10);
|
|
1727
|
+
for (const bub of battleUserBufs) {
|
|
1728
|
+
try {
|
|
1729
|
+
const bf = decodeProto(bub);
|
|
1730
|
+
const groupBuf = getBytes(bf, 2);
|
|
1731
|
+
if (groupBuf) {
|
|
1732
|
+
const gf = decodeProto(groupBuf);
|
|
1733
|
+
const linkUserBuf = getBytes(gf, 1);
|
|
1734
|
+
if (linkUserBuf) {
|
|
1735
|
+
const user = parseUser(linkUserBuf);
|
|
1736
|
+
teams.push({
|
|
1737
|
+
hostUserId: user.id,
|
|
1738
|
+
score: 0,
|
|
1739
|
+
users: [{ user, score: 0 }]
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
}
|
|
1743
|
+
} catch {
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
}
|
|
468
1747
|
return { ...base, type: "battle", battleId, status, battleDuration, teams };
|
|
469
1748
|
}
|
|
470
|
-
// Proto: WebcastLinkMicArmies { msg_header=1,
|
|
471
|
-
//
|
|
472
|
-
//
|
|
473
|
-
//
|
|
1749
|
+
// Proto: WebcastLinkMicArmies { msg_header=1, matchId=2, session_id=4, startedAtMs=5,
|
|
1750
|
+
// serverTsMs=6, repeated battleItems=3, status=7, sessionTag=17,
|
|
1751
|
+
// battle_config=18 { session_id=1, start_time_ms=2, duration_s=3 },
|
|
1752
|
+
// repeated hosts=14 { hostUserId=1, teamTotalScore=3, teamIdx=5,
|
|
1753
|
+
// userContainer=4 { repeated users=1 { userId=1, score=2, nickname=3 } } }
|
|
474
1754
|
case "WebcastLinkMicArmies": {
|
|
475
|
-
const
|
|
1755
|
+
const sessionTag = getStr(f, 17);
|
|
1756
|
+
const matchId = getIntStr(f, 2);
|
|
1757
|
+
const sessionId = getIntStr(f, 4);
|
|
1758
|
+
const battleId = sessionTag || matchId;
|
|
476
1759
|
const battleStatus = getInt(f, 7);
|
|
1760
|
+
const serverTsMs = getInt(f, 6);
|
|
477
1761
|
const teams = [];
|
|
478
1762
|
const itemBufs = getAllBytes(f, 3);
|
|
479
1763
|
for (const ib of itemBufs) {
|
|
@@ -493,6 +1777,10 @@ function parseWebcastMessage(method, payload) {
|
|
|
493
1777
|
} catch {
|
|
494
1778
|
}
|
|
495
1779
|
}
|
|
1780
|
+
let secsRemaining = 0;
|
|
1781
|
+
if (battleStartMs > 0 && battleDurationSeconds > 0 && serverTsMs > 0) {
|
|
1782
|
+
secsRemaining = Math.max(0, battleDurationSeconds - Math.floor((serverTsMs - battleStartMs) / 1e3));
|
|
1783
|
+
}
|
|
496
1784
|
let endTimeMs = 0;
|
|
497
1785
|
let timeLeftSeconds = 0;
|
|
498
1786
|
if (battleStartMs > 0 && battleDurationSeconds > 0) {
|
|
@@ -500,6 +1788,36 @@ function parseWebcastMessage(method, payload) {
|
|
|
500
1788
|
const elapsedMs = Date.now() - battleStartMs;
|
|
501
1789
|
timeLeftSeconds = Math.max(0, battleDurationSeconds - Math.floor(elapsedMs / 1e3));
|
|
502
1790
|
}
|
|
1791
|
+
const hosts = [];
|
|
1792
|
+
const hostBufs = getAllBytes(f, 14);
|
|
1793
|
+
for (const hb of hostBufs) {
|
|
1794
|
+
try {
|
|
1795
|
+
const hf = decodeProto(hb);
|
|
1796
|
+
const hostUserId = getIntStr(hf, 1);
|
|
1797
|
+
const teamTotalScore = getInt(hf, 3);
|
|
1798
|
+
const teamIdx = getInt(hf, 5);
|
|
1799
|
+
const contributors = [];
|
|
1800
|
+
const containerBuf = getBytes(hf, 4);
|
|
1801
|
+
if (containerBuf) {
|
|
1802
|
+
const cf = decodeProto(containerBuf);
|
|
1803
|
+
const userBufs = getAllBytes(cf, 1);
|
|
1804
|
+
for (const ub of userBufs) {
|
|
1805
|
+
try {
|
|
1806
|
+
const uf = decodeProto(ub);
|
|
1807
|
+
contributors.push({
|
|
1808
|
+
userId: getIntStr(uf, 1),
|
|
1809
|
+
score: getInt(uf, 2),
|
|
1810
|
+
nickname: getStr(uf, 3) || ""
|
|
1811
|
+
});
|
|
1812
|
+
} catch {
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
contributors.sort((a, b) => b.score - a.score);
|
|
1816
|
+
}
|
|
1817
|
+
hosts.push({ hostUserId, teamTotalScore, teamIdx, contributors });
|
|
1818
|
+
} catch {
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
503
1821
|
return {
|
|
504
1822
|
...base,
|
|
505
1823
|
type: "battleArmies",
|
|
@@ -509,7 +1827,162 @@ function parseWebcastMessage(method, payload) {
|
|
|
509
1827
|
battleStartMs,
|
|
510
1828
|
battleDurationSeconds,
|
|
511
1829
|
timeLeftSeconds,
|
|
512
|
-
endTimeMs
|
|
1830
|
+
endTimeMs,
|
|
1831
|
+
matchId,
|
|
1832
|
+
sessionId,
|
|
1833
|
+
serverTsMs,
|
|
1834
|
+
sessionTag,
|
|
1835
|
+
durationSec: battleDurationSeconds,
|
|
1836
|
+
secsRemaining,
|
|
1837
|
+
hosts
|
|
1838
|
+
};
|
|
1839
|
+
}
|
|
1840
|
+
// Proto: WebcastLinkMicBattleItemCard
|
|
1841
|
+
// #2 battleId
|
|
1842
|
+
// #3 cardType (2=gloves/crit, 3=mist, 4=match_guide, 10=x2?, 11=x3, ...)
|
|
1843
|
+
// #5/#6/#7/#14 inner (location varies with cardType — scan numerically):
|
|
1844
|
+
// #1.{
|
|
1845
|
+
// #1 effectKey
|
|
1846
|
+
// #2 icon block { #1 repeated CDN urls, #2 iconKey, #5 accentColor }
|
|
1847
|
+
// #3 activatedAtSec (unix seconds)
|
|
1848
|
+
// #4 sender block: #1 sub { #1 userId, #2 nickname, #3 avatar block, #4 uniqueId }
|
|
1849
|
+
// #5 durationSec
|
|
1850
|
+
// #8 senderUserId (new boosters)
|
|
1851
|
+
// #11 endsAtSec
|
|
1852
|
+
// #12 senderUserId (old gloves/mist)
|
|
1853
|
+
// }
|
|
1854
|
+
// #3 comment template msg → #2 commentText
|
|
1855
|
+
case "WebcastLinkMicBattleItemCard": {
|
|
1856
|
+
const battleId = getIntStr(f, 2);
|
|
1857
|
+
const cardType = getInt(f, 3);
|
|
1858
|
+
let inner = null;
|
|
1859
|
+
for (const fn of [5, 6, 7, 14, 15, 16, 8, 9, 10, 11, 12, 13]) {
|
|
1860
|
+
const buf = getBytes(f, fn);
|
|
1861
|
+
if (buf) {
|
|
1862
|
+
inner = decodeProto(buf);
|
|
1863
|
+
break;
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
let effectKey = "";
|
|
1867
|
+
let effect = "unknown";
|
|
1868
|
+
let multiplier = 0;
|
|
1869
|
+
let activatedAtSec = 0;
|
|
1870
|
+
let durationSec = 0;
|
|
1871
|
+
let endsAtSec = 0;
|
|
1872
|
+
let senderUserId = "";
|
|
1873
|
+
let senderNickname = "";
|
|
1874
|
+
let senderUniqueId = "";
|
|
1875
|
+
let senderAvatarUrl = "";
|
|
1876
|
+
let commentTemplate = "";
|
|
1877
|
+
let iconUrl = "";
|
|
1878
|
+
let iconKey = "";
|
|
1879
|
+
let accentColor = "";
|
|
1880
|
+
if (inner) {
|
|
1881
|
+
let nameBuf = getBytes(inner, 1);
|
|
1882
|
+
let nf = nameBuf ? decodeProto(nameBuf) : [];
|
|
1883
|
+
let probedKey = nf.length ? getStr(nf, 1) || "" : "";
|
|
1884
|
+
if (!probedKey) {
|
|
1885
|
+
const altBuf = getBytes(inner, 3);
|
|
1886
|
+
if (altBuf) {
|
|
1887
|
+
const altFields = decodeProto(altBuf);
|
|
1888
|
+
const altKey = getStr(altFields, 1) || "";
|
|
1889
|
+
if (altKey) {
|
|
1890
|
+
nameBuf = altBuf;
|
|
1891
|
+
nf = altFields;
|
|
1892
|
+
probedKey = altKey;
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
}
|
|
1896
|
+
if (nameBuf && nf.length) {
|
|
1897
|
+
effectKey = probedKey;
|
|
1898
|
+
if (effectKey === "pm_mt_boost_crit_name") effect = "hammer";
|
|
1899
|
+
else if (effectKey === "pm_mt_boost_glove_name" || effectKey === "pm_mt_boost_gloves_name") effect = "gloves";
|
|
1900
|
+
else if (effectKey === "pm_mt_boost_mist_name") effect = "mist";
|
|
1901
|
+
else if (effectKey === "pm_mt_match_guide_gotPowerUps") effect = "match_guide";
|
|
1902
|
+
else if (effectKey.includes("userSentBooster_no2") || effectKey.includes("gotPowerUp_panel_no2")) {
|
|
1903
|
+
effect = "booster_x2";
|
|
1904
|
+
multiplier = 2;
|
|
1905
|
+
} else if (effectKey.includes("userSentBooster_no3") || effectKey.includes("gotPowerUp_panel_no3")) {
|
|
1906
|
+
effect = "booster_x3";
|
|
1907
|
+
multiplier = 3;
|
|
1908
|
+
} else if (effectKey.includes("thunder")) effect = "thunder";
|
|
1909
|
+
else if (effectKey.includes("extra_time") || effectKey.includes("extra_round")) effect = "extra_time";
|
|
1910
|
+
else if (effectKey) effect = effectKey;
|
|
1911
|
+
activatedAtSec = getInt(nf, 3);
|
|
1912
|
+
durationSec = getInt(nf, 5);
|
|
1913
|
+
endsAtSec = getInt(nf, 11) || getInt(nf, 7);
|
|
1914
|
+
senderUserId = getIntStr(nf, 12);
|
|
1915
|
+
if (senderUserId === "0") senderUserId = getIntStr(nf, 8);
|
|
1916
|
+
if (senderUserId === "0") senderUserId = getStr(nf, 13) || getStr(nf, 9) || "";
|
|
1917
|
+
const iconBuf = getBytes(nf, 2);
|
|
1918
|
+
if (iconBuf) {
|
|
1919
|
+
const icf = decodeProto(iconBuf);
|
|
1920
|
+
const urlBufs = getAllBytes(icf, 1);
|
|
1921
|
+
for (const ub of urlBufs) {
|
|
1922
|
+
const candidate = ub.toString("utf-8");
|
|
1923
|
+
if (candidate.includes("://")) {
|
|
1924
|
+
iconUrl = candidate;
|
|
1925
|
+
break;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
iconKey = getStr(icf, 2) || "";
|
|
1929
|
+
accentColor = getStr(icf, 5) || "";
|
|
1930
|
+
}
|
|
1931
|
+
const senderOuter = getBytes(nf, 4);
|
|
1932
|
+
if (senderOuter) {
|
|
1933
|
+
const sf = decodeProto(senderOuter);
|
|
1934
|
+
const sub = getBytes(sf, 1);
|
|
1935
|
+
if (sub) {
|
|
1936
|
+
const su = decodeProto(sub);
|
|
1937
|
+
const nickBuf = getBytes(su, 2);
|
|
1938
|
+
if (nickBuf) {
|
|
1939
|
+
try {
|
|
1940
|
+
senderNickname = nickBuf.toString("utf-8");
|
|
1941
|
+
} catch {
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
senderUniqueId = getStr(su, 4) || "";
|
|
1945
|
+
if (!senderUserId || senderUserId === "0") senderUserId = getIntStr(su, 1);
|
|
1946
|
+
const avBuf = getBytes(su, 3);
|
|
1947
|
+
if (avBuf) {
|
|
1948
|
+
const af = decodeProto(avBuf);
|
|
1949
|
+
const urlBufs = getAllBytes(af, 1);
|
|
1950
|
+
for (const ub of urlBufs) {
|
|
1951
|
+
const candidate = ub.toString("utf-8");
|
|
1952
|
+
if (candidate.includes("://")) {
|
|
1953
|
+
senderAvatarUrl = candidate;
|
|
1954
|
+
break;
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
const commentBuf = getBytes(inner, 3);
|
|
1962
|
+
if (commentBuf) {
|
|
1963
|
+
const cf = decodeProto(commentBuf);
|
|
1964
|
+
commentTemplate = getStr(cf, 2) || "";
|
|
1965
|
+
}
|
|
1966
|
+
}
|
|
1967
|
+
return {
|
|
1968
|
+
...base,
|
|
1969
|
+
type: "battleItemCard",
|
|
1970
|
+
battleId,
|
|
1971
|
+
cardType,
|
|
1972
|
+
effect,
|
|
1973
|
+
effectKey,
|
|
1974
|
+
multiplier,
|
|
1975
|
+
senderUserId,
|
|
1976
|
+
senderNickname,
|
|
1977
|
+
senderUniqueId,
|
|
1978
|
+
senderAvatarUrl,
|
|
1979
|
+
activatedAtSec,
|
|
1980
|
+
durationSec,
|
|
1981
|
+
endsAtSec,
|
|
1982
|
+
commentTemplate,
|
|
1983
|
+
iconUrl,
|
|
1984
|
+
iconKey,
|
|
1985
|
+
accentColor
|
|
513
1986
|
};
|
|
514
1987
|
}
|
|
515
1988
|
// Proto: WebcastSubNotifyMessage { User user=2, ... subMonth=3 }
|
|
@@ -618,10 +2091,12 @@ function parseWebcastResponse(payload) {
|
|
|
618
2091
|
// src/client.ts
|
|
619
2092
|
var DEFAULT_UA = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36";
|
|
620
2093
|
var DEFAULT_SIGN_SERVER = "https://api.tik.tools";
|
|
621
|
-
function httpGet(url, headers) {
|
|
2094
|
+
function httpGet(url, headers, agent) {
|
|
622
2095
|
return new Promise((resolve, reject) => {
|
|
623
2096
|
const mod = url.startsWith("https") ? https : http;
|
|
624
|
-
const
|
|
2097
|
+
const opts = { headers };
|
|
2098
|
+
if (agent) opts.agent = agent;
|
|
2099
|
+
const req = mod.get(url, opts, (res) => {
|
|
625
2100
|
const chunks = [];
|
|
626
2101
|
const enc = res.headers["content-encoding"];
|
|
627
2102
|
const stream = enc === "gzip" || enc === "br" ? res.pipe(enc === "br" ? zlib.createBrotliDecompress() : zlib.createGunzip()) : res;
|
|
@@ -671,6 +2146,7 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
671
2146
|
debug;
|
|
672
2147
|
_presetRoomId;
|
|
673
2148
|
_presetSessionId;
|
|
2149
|
+
proxyUrl;
|
|
674
2150
|
constructor(options) {
|
|
675
2151
|
super();
|
|
676
2152
|
this.setMaxListeners(20);
|
|
@@ -684,6 +2160,22 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
684
2160
|
this.debug = options.debug ?? false;
|
|
685
2161
|
this._presetRoomId = options.roomId || "";
|
|
686
2162
|
this._presetSessionId = options.sessionId || "";
|
|
2163
|
+
this.proxyUrl = options.proxy || "";
|
|
2164
|
+
}
|
|
2165
|
+
/**
|
|
2166
|
+
* Build an HttpsProxyAgent when `proxy` option is set, else undefined.
|
|
2167
|
+
* Lazy-required so users without proxy don't pay the dependency cost.
|
|
2168
|
+
*/
|
|
2169
|
+
getProxyAgent() {
|
|
2170
|
+
if (!this.proxyUrl) return void 0;
|
|
2171
|
+
try {
|
|
2172
|
+
const { HttpsProxyAgent } = require_dist2();
|
|
2173
|
+
return new HttpsProxyAgent(this.proxyUrl);
|
|
2174
|
+
} catch (e) {
|
|
2175
|
+
throw new Error(
|
|
2176
|
+
`proxy option requires 'https-proxy-agent' package. Install it: npm i https-proxy-agent`
|
|
2177
|
+
);
|
|
2178
|
+
}
|
|
687
2179
|
}
|
|
688
2180
|
async connect() {
|
|
689
2181
|
if (this._destroyed) throw new Error("Client has been destroyed. Create a new instance.");
|
|
@@ -712,13 +2204,13 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
712
2204
|
preSignedCookies = credData.data.cookies || "";
|
|
713
2205
|
preSignedUA = credData.data.user_agent || DEFAULT_UA;
|
|
714
2206
|
ttwid = "__presigned__";
|
|
715
|
-
console.log(`[TikTokLive] \
|
|
2207
|
+
console.log(`[TikTokLive] \xE2\u0153\u2026 Got pre-signed URL from sign server`);
|
|
716
2208
|
} else {
|
|
717
|
-
console.log(`[TikTokLive] \
|
|
2209
|
+
console.log(`[TikTokLive] \xE2\u0161\xA0\xEF\xB8\x8F ws_credentials bad response: ${JSON.stringify(credData).substring(0, 120)}`);
|
|
718
2210
|
}
|
|
719
2211
|
}
|
|
720
2212
|
} catch (e) {
|
|
721
|
-
console.log(`[TikTokLive] \
|
|
2213
|
+
console.log(`[TikTokLive] \xE2\x9D\u0152 ws_credentials failed: ${e.message}`);
|
|
722
2214
|
}
|
|
723
2215
|
if (!ttwid) {
|
|
724
2216
|
console.log(`[TikTokLive] Fallback: direct TikTok fetch for ttwid...`);
|
|
@@ -726,16 +2218,16 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
726
2218
|
const resp = await httpGet(`https://www.tiktok.com/@${this.uniqueId}/live`, {
|
|
727
2219
|
"User-Agent": DEFAULT_UA,
|
|
728
2220
|
"Accept": "text/html"
|
|
729
|
-
});
|
|
2221
|
+
}, this.getProxyAgent());
|
|
730
2222
|
for (const sc of [resp.headers["set-cookie"] || []].flat()) {
|
|
731
2223
|
if (typeof sc === "string" && sc.startsWith("ttwid=")) {
|
|
732
2224
|
ttwid = sc.split(";")[0].split("=").slice(1).join("=");
|
|
733
2225
|
break;
|
|
734
2226
|
}
|
|
735
2227
|
}
|
|
736
|
-
console.log(`[TikTokLive] Direct fetch ttwid: ${ttwid ? "\
|
|
2228
|
+
console.log(`[TikTokLive] Direct fetch ttwid: ${ttwid ? "\xE2\u0153\u2026" : "\xE2\x9D\u0152 none"}`);
|
|
737
2229
|
} catch (e) {
|
|
738
|
-
console.log(`[TikTokLive] \
|
|
2230
|
+
console.log(`[TikTokLive] \xE2\x9D\u0152 Direct TikTok fetch failed: ${e.message}`);
|
|
739
2231
|
}
|
|
740
2232
|
}
|
|
741
2233
|
} else {
|
|
@@ -751,13 +2243,13 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
751
2243
|
const roomData = await roomResp.json();
|
|
752
2244
|
if (roomData.status_code === 0 && roomData.data?.room_id) {
|
|
753
2245
|
roomId = roomData.data.room_id;
|
|
754
|
-
console.log(`[TikTokLive] \
|
|
2246
|
+
console.log(`[TikTokLive] \xE2\u0153\u2026 Got roomId from sign server: ${roomId}`);
|
|
755
2247
|
} else {
|
|
756
|
-
console.log(`[TikTokLive] \
|
|
2248
|
+
console.log(`[TikTokLive] \xE2\u0161\xA0\xEF\xB8\x8F room_id response: ${JSON.stringify(roomData).substring(0, 120)}`);
|
|
757
2249
|
}
|
|
758
2250
|
}
|
|
759
2251
|
} catch (e) {
|
|
760
|
-
console.log(`[TikTokLive] \
|
|
2252
|
+
console.log(`[TikTokLive] \xE2\x9D\u0152 room_id request failed: ${e.message}`);
|
|
761
2253
|
}
|
|
762
2254
|
if (roomId) {
|
|
763
2255
|
try {
|
|
@@ -773,14 +2265,14 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
773
2265
|
const m = credData.data.cookies.match(/ttwid=([^;]+)/);
|
|
774
2266
|
if (m) {
|
|
775
2267
|
ttwid = m[1];
|
|
776
|
-
console.log(`[TikTokLive] \
|
|
777
|
-
} else console.log(`[TikTokLive] \
|
|
2268
|
+
console.log(`[TikTokLive] \xE2\u0153\u2026 Got ttwid from sign server`);
|
|
2269
|
+
} else console.log(`[TikTokLive] \xE2\u0161\xA0\xEF\xB8\x8F No ttwid in cookies: ${credData.data.cookies.substring(0, 60)}`);
|
|
778
2270
|
} else {
|
|
779
|
-
console.log(`[TikTokLive] \
|
|
2271
|
+
console.log(`[TikTokLive] \xE2\u0161\xA0\xEF\xB8\x8F No cookies in ws_credentials: ${JSON.stringify(credData).substring(0, 120)}`);
|
|
780
2272
|
}
|
|
781
2273
|
}
|
|
782
2274
|
} catch (e) {
|
|
783
|
-
console.log(`[TikTokLive] \
|
|
2275
|
+
console.log(`[TikTokLive] \xE2\x9D\u0152 ws_credentials failed: ${e.message}`);
|
|
784
2276
|
}
|
|
785
2277
|
}
|
|
786
2278
|
if (!roomId || !ttwid) {
|
|
@@ -791,7 +2283,7 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
791
2283
|
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
|
|
792
2284
|
"Accept-Encoding": "gzip, deflate, br",
|
|
793
2285
|
"Accept-Language": "en-US,en;q=0.9"
|
|
794
|
-
});
|
|
2286
|
+
}, this.getProxyAgent());
|
|
795
2287
|
if (!ttwid) {
|
|
796
2288
|
for (const sc of [resp.headers["set-cookie"] || []].flat()) {
|
|
797
2289
|
if (typeof sc === "string" && sc.startsWith("ttwid=")) {
|
|
@@ -817,7 +2309,7 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
817
2309
|
}
|
|
818
2310
|
console.log(`[TikTokLive] Direct fetch result: roomId=${roomId || "none"}, ttwid=${ttwid ? "yes" : "none"}`);
|
|
819
2311
|
} catch (e) {
|
|
820
|
-
console.log(`[TikTokLive] \
|
|
2312
|
+
console.log(`[TikTokLive] \xE2\x9D\u0152 Direct TikTok fetch failed: ${e.message}`);
|
|
821
2313
|
}
|
|
822
2314
|
}
|
|
823
2315
|
}
|
|
@@ -880,8 +2372,10 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
880
2372
|
const finalWsUrl = preSignedUrl ? preSignedUrl.replace(/^https:\/\//, "wss://") : wsUrl;
|
|
881
2373
|
const finalHeaders = preSignedUrl ? { "User-Agent": preSignedUA, "Cookie": preSignedCookies, "Origin": "https://www.tiktok.com" } : { "User-Agent": DEFAULT_UA, "Cookie": `ttwid=${ttwid}`, "Origin": "https://www.tiktok.com" };
|
|
882
2374
|
console.log(`[TikTokLive] Connecting WS: ${preSignedUrl ? "pre-signed URL" : "self-built URL"}`);
|
|
2375
|
+
const proxyAgent = this.getProxyAgent();
|
|
883
2376
|
this.ws = new import_ws.default(finalWsUrl, {
|
|
884
|
-
headers: finalHeaders
|
|
2377
|
+
headers: finalHeaders,
|
|
2378
|
+
...proxyAgent ? { agent: proxyAgent } : {}
|
|
885
2379
|
});
|
|
886
2380
|
this.ws.on("open", () => {
|
|
887
2381
|
this._connected = true;
|
|
@@ -903,18 +2397,21 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
903
2397
|
this.handleFrame(Buffer.from(rawData));
|
|
904
2398
|
});
|
|
905
2399
|
this.ws.on("close", (code, reason) => {
|
|
2400
|
+
const wasConnected = this._connected;
|
|
906
2401
|
this._connected = false;
|
|
907
2402
|
this.stopHeartbeat();
|
|
908
2403
|
const reasonStr = reason?.toString() || "";
|
|
909
2404
|
this.emit("disconnected", code, reasonStr);
|
|
910
|
-
if (!this.intentionalClose && this.autoReconnect && this.reconnectAttempts < this.maxReconnectAttempts) {
|
|
2405
|
+
if (wasConnected && !this.intentionalClose && this.autoReconnect && this.reconnectAttempts < this.maxReconnectAttempts) {
|
|
911
2406
|
this.reconnectAttempts++;
|
|
912
2407
|
const delay = Math.min(1e3 * Math.pow(2, this.reconnectAttempts - 1), 3e4);
|
|
913
2408
|
setTimeout(() => this.connect().catch((e) => this.emit("error", e)), delay);
|
|
914
2409
|
}
|
|
915
2410
|
});
|
|
916
2411
|
this.ws.on("error", (err) => {
|
|
917
|
-
this.
|
|
2412
|
+
if (this._connected) {
|
|
2413
|
+
this.emit("error", err);
|
|
2414
|
+
}
|
|
918
2415
|
if (!this._connected) reject(err);
|
|
919
2416
|
});
|
|
920
2417
|
});
|
|
@@ -931,7 +2428,7 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
931
2428
|
}
|
|
932
2429
|
/**
|
|
933
2430
|
* Fully destroy the client, releasing all resources and listeners.
|
|
934
|
-
* After calling destroy(), the instance cannot be reused
|
|
2431
|
+
* After calling destroy(), the instance cannot be reused — create a new one.
|
|
935
2432
|
*/
|
|
936
2433
|
destroy() {
|
|
937
2434
|
this.disconnect();
|
|
@@ -956,7 +2453,7 @@ var TikTokLive = class _TikTokLive extends import_events.EventEmitter {
|
|
|
956
2453
|
/**
|
|
957
2454
|
* Get live stream video URLs for a TikTok user.
|
|
958
2455
|
* Returns FLV & HLS URLs segmented by quality (FULL_HD1, HD1, SD1, SD2).
|
|
959
|
-
* This is a standalone method
|
|
2456
|
+
* This is a standalone method — no WebSocket connection required.
|
|
960
2457
|
*
|
|
961
2458
|
* @example
|
|
962
2459
|
* ```ts
|