linkque-cli-v2 1.6.23 → 1.6.25-alpha.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/dev/worker.js +21 -78
- package/linkquejs.js +17776 -18677
- package/package.json +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-GAYNLDWK.js → chunk-6POVPTQH.js} +6011 -2626
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/chunk-EAODRPW4.js +518 -0
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-NOCU2PBJ.js → chunk-EXYGBKWJ.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-XUFLSZM4.js → chunk-GTEZTRCK.js} +35 -190
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-2QJITP7G.js → chunk-LTZQZY5N.js} +26 -83
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-FC7MJHC3.js → chunk-Q5VTO4BZ.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-55VHSCSE.js → chunk-VBVOUDAY.js} +6884 -3755
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-FB6H4CGZ.js → chunk-XYAYDSKW.js} +12 -11
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{dist-6U5W3RLM.js → dist-JRQ7GIV4.js} +31 -46
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-generative-ai-RT2OOQDJ.js → google-generative-ai-WBIK2BRB.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{google-vertex-HVFMVQVY.js → google-vertex-2TMP5HDA.js} +1 -1
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{mistral-conversations-KIOTOF73.js → mistral-conversations-X6KT35XW.js} +4 -4
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{multipart-parser-TAD6XL3Q.js → multipart-parser-HCLTR6CW.js} +2 -2
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{otel-LQR5KPZ3.js → otel-3OUODIOB.js} +268 -580
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/chat.js +14415 -6836
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/handler/clientCapability.js +5 -4
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/runtime/protocol.js +5 -4
- package/vendor/linkque-agent-appwrite-integrate/dist/esm/{src-JSJTYJV5.js → src-MFXPXO5F.js} +25 -25
- package/worker.js +39691 -25271
package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-XUFLSZM4.js → chunk-GTEZTRCK.js}
RENAMED
|
@@ -1,3 +1,37 @@
|
|
|
1
|
+
// ../../node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
2
|
+
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
3
|
+
var defaultOptions = {
|
|
4
|
+
name: void 0,
|
|
5
|
+
$refStrategy: "root",
|
|
6
|
+
basePath: ["#"],
|
|
7
|
+
effectStrategy: "input",
|
|
8
|
+
pipeStrategy: "all",
|
|
9
|
+
dateStrategy: "format:date-time",
|
|
10
|
+
mapStrategy: "entries",
|
|
11
|
+
removeAdditionalStrategy: "passthrough",
|
|
12
|
+
allowedAdditionalProperties: true,
|
|
13
|
+
rejectedAdditionalProperties: false,
|
|
14
|
+
definitionPath: "definitions",
|
|
15
|
+
target: "jsonSchema7",
|
|
16
|
+
strictUnions: false,
|
|
17
|
+
definitions: {},
|
|
18
|
+
errorMessages: false,
|
|
19
|
+
markdownDescription: false,
|
|
20
|
+
patternStrategy: "escape",
|
|
21
|
+
applyRegexFlags: false,
|
|
22
|
+
emailStrategy: "format:email",
|
|
23
|
+
base64Strategy: "contentEncoding:base64",
|
|
24
|
+
nameStrategy: "ref",
|
|
25
|
+
openAiAnyTypeName: "OpenAiAnyType"
|
|
26
|
+
};
|
|
27
|
+
var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
28
|
+
...defaultOptions,
|
|
29
|
+
name: options
|
|
30
|
+
} : {
|
|
31
|
+
...defaultOptions,
|
|
32
|
+
...options
|
|
33
|
+
};
|
|
34
|
+
|
|
1
35
|
// ../../node_modules/zod/v3/helpers/util.js
|
|
2
36
|
var util;
|
|
3
37
|
(function(util2) {
|
|
@@ -151,10 +185,6 @@ var ZodIssueCode = util.arrayToEnum([
|
|
|
151
185
|
"not_multiple_of",
|
|
152
186
|
"not_finite"
|
|
153
187
|
]);
|
|
154
|
-
var quotelessJson = (obj) => {
|
|
155
|
-
const json = JSON.stringify(obj, null, 2);
|
|
156
|
-
return json.replace(/"([^"]+)":/g, "$1:");
|
|
157
|
-
};
|
|
158
188
|
var ZodError = class _ZodError extends Error {
|
|
159
189
|
get errors() {
|
|
160
190
|
return this.issues;
|
|
@@ -228,7 +258,7 @@ var ZodError = class _ZodError extends Error {
|
|
|
228
258
|
return this.issues.length === 0;
|
|
229
259
|
}
|
|
230
260
|
flatten(mapper = (issue) => issue.message) {
|
|
231
|
-
const fieldErrors =
|
|
261
|
+
const fieldErrors = /* @__PURE__ */ Object.create(null);
|
|
232
262
|
const formErrors = [];
|
|
233
263
|
for (const sub of this.issues) {
|
|
234
264
|
if (sub.path.length > 0) {
|
|
@@ -355,9 +385,6 @@ var en_default = errorMap;
|
|
|
355
385
|
|
|
356
386
|
// ../../node_modules/zod/v3/errors.js
|
|
357
387
|
var overrideErrorMap = en_default;
|
|
358
|
-
function setErrorMap(map) {
|
|
359
|
-
overrideErrorMap = map;
|
|
360
|
-
}
|
|
361
388
|
function getErrorMap() {
|
|
362
389
|
return overrideErrorMap;
|
|
363
390
|
}
|
|
@@ -388,7 +415,6 @@ var makeIssue = (params) => {
|
|
|
388
415
|
message: errorMessage
|
|
389
416
|
};
|
|
390
417
|
};
|
|
391
|
-
var EMPTY_PATH = [];
|
|
392
418
|
function addIssueToContext(ctx, issueData) {
|
|
393
419
|
const overrideMap = getErrorMap();
|
|
394
420
|
const issue = makeIssue({
|
|
@@ -3806,33 +3832,6 @@ ZodReadonly.create = (type, params) => {
|
|
|
3806
3832
|
...processCreateParams(params)
|
|
3807
3833
|
});
|
|
3808
3834
|
};
|
|
3809
|
-
function cleanParams(params, data) {
|
|
3810
|
-
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
3811
|
-
const p2 = typeof p === "string" ? { message: p } : p;
|
|
3812
|
-
return p2;
|
|
3813
|
-
}
|
|
3814
|
-
function custom(check, _params = {}, fatal) {
|
|
3815
|
-
if (check)
|
|
3816
|
-
return ZodAny.create().superRefine((data, ctx) => {
|
|
3817
|
-
const r = check(data);
|
|
3818
|
-
if (r instanceof Promise) {
|
|
3819
|
-
return r.then((r2) => {
|
|
3820
|
-
if (!r2) {
|
|
3821
|
-
const params = cleanParams(_params, data);
|
|
3822
|
-
const _fatal = params.fatal ?? fatal ?? true;
|
|
3823
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
3824
|
-
}
|
|
3825
|
-
});
|
|
3826
|
-
}
|
|
3827
|
-
if (!r) {
|
|
3828
|
-
const params = cleanParams(_params, data);
|
|
3829
|
-
const _fatal = params.fatal ?? fatal ?? true;
|
|
3830
|
-
ctx.addIssue({ code: "custom", ...params, fatal: _fatal });
|
|
3831
|
-
}
|
|
3832
|
-
return;
|
|
3833
|
-
});
|
|
3834
|
-
return ZodAny.create();
|
|
3835
|
-
}
|
|
3836
3835
|
var late = {
|
|
3837
3836
|
object: ZodObject.lazycreate
|
|
3838
3837
|
};
|
|
@@ -3875,9 +3874,6 @@ var ZodFirstPartyTypeKind;
|
|
|
3875
3874
|
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
|
3876
3875
|
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
|
3877
3876
|
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
3878
|
-
var instanceOfType = (cls, params = {
|
|
3879
|
-
message: `Input not instance of ${cls.name}`
|
|
3880
|
-
}) => custom((data) => data instanceof cls, params);
|
|
3881
3877
|
var stringType = ZodString.create;
|
|
3882
3878
|
var numberType = ZodNumber.create;
|
|
3883
3879
|
var nanType = ZodNaN.create;
|
|
@@ -3912,54 +3908,6 @@ var optionalType = ZodOptional.create;
|
|
|
3912
3908
|
var nullableType = ZodNullable.create;
|
|
3913
3909
|
var preprocessType = ZodEffects.createWithPreprocess;
|
|
3914
3910
|
var pipelineType = ZodPipeline.create;
|
|
3915
|
-
var ostring = () => stringType().optional();
|
|
3916
|
-
var onumber = () => numberType().optional();
|
|
3917
|
-
var oboolean = () => booleanType().optional();
|
|
3918
|
-
var coerce = {
|
|
3919
|
-
string: (arg) => ZodString.create({ ...arg, coerce: true }),
|
|
3920
|
-
number: (arg) => ZodNumber.create({ ...arg, coerce: true }),
|
|
3921
|
-
boolean: (arg) => ZodBoolean.create({
|
|
3922
|
-
...arg,
|
|
3923
|
-
coerce: true
|
|
3924
|
-
}),
|
|
3925
|
-
bigint: (arg) => ZodBigInt.create({ ...arg, coerce: true }),
|
|
3926
|
-
date: (arg) => ZodDate.create({ ...arg, coerce: true })
|
|
3927
|
-
};
|
|
3928
|
-
var NEVER = INVALID;
|
|
3929
|
-
|
|
3930
|
-
// ../../node_modules/zod-to-json-schema/dist/esm/Options.js
|
|
3931
|
-
var ignoreOverride = Symbol("Let zodToJsonSchema decide on which parser to use");
|
|
3932
|
-
var defaultOptions = {
|
|
3933
|
-
name: void 0,
|
|
3934
|
-
$refStrategy: "root",
|
|
3935
|
-
basePath: ["#"],
|
|
3936
|
-
effectStrategy: "input",
|
|
3937
|
-
pipeStrategy: "all",
|
|
3938
|
-
dateStrategy: "format:date-time",
|
|
3939
|
-
mapStrategy: "entries",
|
|
3940
|
-
removeAdditionalStrategy: "passthrough",
|
|
3941
|
-
allowedAdditionalProperties: true,
|
|
3942
|
-
rejectedAdditionalProperties: false,
|
|
3943
|
-
definitionPath: "definitions",
|
|
3944
|
-
target: "jsonSchema7",
|
|
3945
|
-
strictUnions: false,
|
|
3946
|
-
definitions: {},
|
|
3947
|
-
errorMessages: false,
|
|
3948
|
-
markdownDescription: false,
|
|
3949
|
-
patternStrategy: "escape",
|
|
3950
|
-
applyRegexFlags: false,
|
|
3951
|
-
emailStrategy: "format:email",
|
|
3952
|
-
base64Strategy: "contentEncoding:base64",
|
|
3953
|
-
nameStrategy: "ref",
|
|
3954
|
-
openAiAnyTypeName: "OpenAiAnyType"
|
|
3955
|
-
};
|
|
3956
|
-
var getDefaultOptions = (options) => typeof options === "string" ? {
|
|
3957
|
-
...defaultOptions,
|
|
3958
|
-
name: options
|
|
3959
|
-
} : {
|
|
3960
|
-
...defaultOptions,
|
|
3961
|
-
...options
|
|
3962
|
-
};
|
|
3963
3911
|
|
|
3964
3912
|
// ../../node_modules/zod-to-json-schema/dist/esm/getRelativePath.js
|
|
3965
3913
|
var getRelativePath = (pathA, pathB) => {
|
|
@@ -5212,108 +5160,5 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
5212
5160
|
};
|
|
5213
5161
|
|
|
5214
5162
|
export {
|
|
5215
|
-
util,
|
|
5216
|
-
objectUtil,
|
|
5217
|
-
ZodParsedType,
|
|
5218
|
-
getParsedType,
|
|
5219
|
-
ZodIssueCode,
|
|
5220
|
-
quotelessJson,
|
|
5221
|
-
ZodError,
|
|
5222
|
-
en_default,
|
|
5223
|
-
setErrorMap,
|
|
5224
|
-
getErrorMap,
|
|
5225
|
-
makeIssue,
|
|
5226
|
-
EMPTY_PATH,
|
|
5227
|
-
addIssueToContext,
|
|
5228
|
-
ParseStatus,
|
|
5229
|
-
INVALID,
|
|
5230
|
-
DIRTY,
|
|
5231
|
-
OK,
|
|
5232
|
-
isAborted,
|
|
5233
|
-
isDirty,
|
|
5234
|
-
isValid,
|
|
5235
|
-
isAsync,
|
|
5236
|
-
ZodType,
|
|
5237
|
-
datetimeRegex,
|
|
5238
|
-
ZodString,
|
|
5239
|
-
ZodNumber,
|
|
5240
|
-
ZodBigInt,
|
|
5241
|
-
ZodBoolean,
|
|
5242
|
-
ZodDate,
|
|
5243
|
-
ZodSymbol,
|
|
5244
|
-
ZodUndefined,
|
|
5245
|
-
ZodNull,
|
|
5246
|
-
ZodAny,
|
|
5247
|
-
ZodUnknown,
|
|
5248
|
-
ZodNever,
|
|
5249
|
-
ZodVoid,
|
|
5250
|
-
ZodArray,
|
|
5251
|
-
ZodObject,
|
|
5252
|
-
ZodUnion,
|
|
5253
|
-
ZodDiscriminatedUnion,
|
|
5254
|
-
ZodIntersection,
|
|
5255
|
-
ZodTuple,
|
|
5256
|
-
ZodRecord,
|
|
5257
|
-
ZodMap,
|
|
5258
|
-
ZodSet,
|
|
5259
|
-
ZodFunction,
|
|
5260
|
-
ZodLazy,
|
|
5261
|
-
ZodLiteral,
|
|
5262
|
-
ZodEnum,
|
|
5263
|
-
ZodNativeEnum,
|
|
5264
|
-
ZodPromise,
|
|
5265
|
-
ZodEffects,
|
|
5266
|
-
ZodOptional,
|
|
5267
|
-
ZodNullable,
|
|
5268
|
-
ZodDefault,
|
|
5269
|
-
ZodCatch,
|
|
5270
|
-
ZodNaN,
|
|
5271
|
-
BRAND,
|
|
5272
|
-
ZodBranded,
|
|
5273
|
-
ZodPipeline,
|
|
5274
|
-
ZodReadonly,
|
|
5275
|
-
custom,
|
|
5276
|
-
late,
|
|
5277
|
-
ZodFirstPartyTypeKind,
|
|
5278
|
-
instanceOfType,
|
|
5279
|
-
stringType,
|
|
5280
|
-
numberType,
|
|
5281
|
-
nanType,
|
|
5282
|
-
bigIntType,
|
|
5283
|
-
booleanType,
|
|
5284
|
-
dateType,
|
|
5285
|
-
symbolType,
|
|
5286
|
-
undefinedType,
|
|
5287
|
-
nullType,
|
|
5288
|
-
anyType,
|
|
5289
|
-
unknownType,
|
|
5290
|
-
neverType,
|
|
5291
|
-
voidType,
|
|
5292
|
-
arrayType,
|
|
5293
|
-
objectType,
|
|
5294
|
-
strictObjectType,
|
|
5295
|
-
unionType,
|
|
5296
|
-
discriminatedUnionType,
|
|
5297
|
-
intersectionType,
|
|
5298
|
-
tupleType,
|
|
5299
|
-
recordType,
|
|
5300
|
-
mapType,
|
|
5301
|
-
setType,
|
|
5302
|
-
functionType,
|
|
5303
|
-
lazyType,
|
|
5304
|
-
literalType,
|
|
5305
|
-
enumType,
|
|
5306
|
-
nativeEnumType,
|
|
5307
|
-
promiseType,
|
|
5308
|
-
effectsType,
|
|
5309
|
-
optionalType,
|
|
5310
|
-
nullableType,
|
|
5311
|
-
preprocessType,
|
|
5312
|
-
pipelineType,
|
|
5313
|
-
ostring,
|
|
5314
|
-
onumber,
|
|
5315
|
-
oboolean,
|
|
5316
|
-
coerce,
|
|
5317
|
-
NEVER,
|
|
5318
5163
|
zodToJsonSchema
|
|
5319
5164
|
};
|
package/vendor/linkque-agent-appwrite-integrate/dist/esm/{chunk-2QJITP7G.js → chunk-LTZQZY5N.js}
RENAMED
|
@@ -416,7 +416,7 @@ var require_package = __commonJS({
|
|
|
416
416
|
"../../node_modules/gaxios/package.json"(exports, module) {
|
|
417
417
|
module.exports = {
|
|
418
418
|
name: "gaxios",
|
|
419
|
-
version: "7.3.
|
|
419
|
+
version: "7.3.0",
|
|
420
420
|
description: "A simple common HTTP client specifically for Google APIs and services.",
|
|
421
421
|
main: "build/cjs/src/index.js",
|
|
422
422
|
types: "build/cjs/src/index.d.ts",
|
|
@@ -494,7 +494,7 @@ var require_package = __commonJS({
|
|
|
494
494
|
"karma-mocha": "^2.0.0",
|
|
495
495
|
"karma-remap-coverage": "^0.1.5",
|
|
496
496
|
"karma-sourcemap-loader": "^0.4.0",
|
|
497
|
-
"karma-webpack": "^5.0.
|
|
497
|
+
"karma-webpack": "^5.0.1",
|
|
498
498
|
mocha: "^11.1.0",
|
|
499
499
|
multiparty: "^4.2.1",
|
|
500
500
|
mv: "^2.1.1",
|
|
@@ -505,7 +505,7 @@ var require_package = __commonJS({
|
|
|
505
505
|
puppeteer: "^24.0.0",
|
|
506
506
|
sinon: "21.0.3",
|
|
507
507
|
"stream-browserify": "^3.0.0",
|
|
508
|
-
tmp: "0.2.
|
|
508
|
+
tmp: "0.2.6",
|
|
509
509
|
"ts-loader": "^9.5.2",
|
|
510
510
|
typescript: "5.8.3",
|
|
511
511
|
"undici-types": "^7.24.1",
|
|
@@ -1324,12 +1324,12 @@ Content-Type: ${partContentType}\r
|
|
|
1324
1324
|
* @returns A proxy agent
|
|
1325
1325
|
*/
|
|
1326
1326
|
static async #getProxyAgent() {
|
|
1327
|
-
this.#proxyAgent ||= (await import("./dist-
|
|
1327
|
+
this.#proxyAgent ||= (await import("./dist-JRQ7GIV4.js")).HttpsProxyAgent;
|
|
1328
1328
|
return this.#proxyAgent;
|
|
1329
1329
|
}
|
|
1330
1330
|
static async #getFetch() {
|
|
1331
1331
|
const hasWindow = typeof window !== "undefined" && !!window;
|
|
1332
|
-
this.#fetch ||= hasWindow ? window.fetch : (await import("./src-
|
|
1332
|
+
this.#fetch ||= hasWindow ? window.fetch : (await import("./src-MFXPXO5F.js")).default;
|
|
1333
1333
|
return this.#fetch;
|
|
1334
1334
|
}
|
|
1335
1335
|
/**
|
|
@@ -9350,7 +9350,6 @@ var require_constants = __commonJS({
|
|
|
9350
9350
|
var require_buffer_util = __commonJS({
|
|
9351
9351
|
"../../node_modules/ws/lib/buffer-util.js"(exports, module) {
|
|
9352
9352
|
"use strict";
|
|
9353
|
-
var { websocketMask, websocketUnmask } = __require("http");
|
|
9354
9353
|
var { EMPTY_BUFFER } = require_constants();
|
|
9355
9354
|
var FastBuffer = Buffer[Symbol.species];
|
|
9356
9355
|
function concat(list, totalLength) {
|
|
@@ -9405,16 +9404,7 @@ var require_buffer_util = __commonJS({
|
|
|
9405
9404
|
toBuffer,
|
|
9406
9405
|
unmask: _unmask
|
|
9407
9406
|
};
|
|
9408
|
-
if (
|
|
9409
|
-
module.exports.mask = function(source, mask, output, offset, length) {
|
|
9410
|
-
if (length < 24) _mask(source, mask, output, offset, length);
|
|
9411
|
-
else websocketMask(source, mask, output, offset, length);
|
|
9412
|
-
};
|
|
9413
|
-
module.exports.unmask = function(buffer, mask) {
|
|
9414
|
-
if (buffer.length < 24) _unmask(buffer, mask);
|
|
9415
|
-
else websocketUnmask(buffer, mask);
|
|
9416
|
-
};
|
|
9417
|
-
} else if (!process.env.WS_NO_BUFFER_UTIL) {
|
|
9407
|
+
if (!process.env.WS_NO_BUFFER_UTIL) {
|
|
9418
9408
|
try {
|
|
9419
9409
|
const bufferUtil = __require("bufferutil");
|
|
9420
9410
|
module.exports.mask = function(source, mask, output, offset, length) {
|
|
@@ -9610,7 +9600,7 @@ var require_permessage_deflate = __commonJS({
|
|
|
9610
9600
|
acceptAsServer(offers) {
|
|
9611
9601
|
const opts = this._options;
|
|
9612
9602
|
const accepted = offers.find((params) => {
|
|
9613
|
-
if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" &&
|
|
9603
|
+
if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && !params.client_max_window_bits) {
|
|
9614
9604
|
return false;
|
|
9615
9605
|
}
|
|
9616
9606
|
return true;
|
|
@@ -10477,7 +10467,6 @@ var require_receiver = __commonJS({
|
|
|
10477
10467
|
unmask(data, this._mask);
|
|
10478
10468
|
}
|
|
10479
10469
|
}
|
|
10480
|
-
this._mask = void 0;
|
|
10481
10470
|
if (this._opcode > 7) {
|
|
10482
10471
|
this.controlMessage(data, cb);
|
|
10483
10472
|
return;
|
|
@@ -10810,15 +10799,12 @@ var require_sender = __commonJS({
|
|
|
10810
10799
|
target[2] = target[3] = 0;
|
|
10811
10800
|
target.writeUIntBE(dataLength, 4, 6);
|
|
10812
10801
|
}
|
|
10813
|
-
if (!options.mask)
|
|
10814
|
-
return dataLength ? [target, data] : [target];
|
|
10815
|
-
}
|
|
10802
|
+
if (!options.mask) return [target, data];
|
|
10816
10803
|
target[1] |= 128;
|
|
10817
10804
|
target[offset - 4] = mask[0];
|
|
10818
10805
|
target[offset - 3] = mask[1];
|
|
10819
10806
|
target[offset - 2] = mask[2];
|
|
10820
10807
|
target[offset - 1] = mask[3];
|
|
10821
|
-
if (!dataLength) return [target];
|
|
10822
10808
|
if (skipMasking) return [target, data];
|
|
10823
10809
|
if (merge) {
|
|
10824
10810
|
applyMask(data, mask, target, offset, dataLength);
|
|
@@ -11575,7 +11561,6 @@ var require_websocket = __commonJS({
|
|
|
11575
11561
|
var https = __require("https");
|
|
11576
11562
|
var http = __require("http");
|
|
11577
11563
|
var net = __require("net");
|
|
11578
|
-
var querystring = __require("querystring");
|
|
11579
11564
|
var tls = __require("tls");
|
|
11580
11565
|
var { randomBytes, createHash } = __require("crypto");
|
|
11581
11566
|
var { Duplex, Readable: Readable2 } = __require("stream");
|
|
@@ -11633,38 +11618,21 @@ var require_websocket = __commonJS({
|
|
|
11633
11618
|
this._isServer = false;
|
|
11634
11619
|
this._redirects = 0;
|
|
11635
11620
|
if (protocols === void 0) {
|
|
11636
|
-
|
|
11637
|
-
protocols = [];
|
|
11638
|
-
} else if (Array.isArray(options.protocols)) {
|
|
11639
|
-
protocols = options.protocols;
|
|
11640
|
-
} else {
|
|
11641
|
-
protocols = [options.protocols];
|
|
11642
|
-
}
|
|
11621
|
+
protocols = [];
|
|
11643
11622
|
} else if (!Array.isArray(protocols)) {
|
|
11644
11623
|
if (typeof protocols === "object" && protocols !== null) {
|
|
11645
11624
|
options = protocols;
|
|
11646
|
-
|
|
11647
|
-
protocols = [];
|
|
11648
|
-
} else if (Array.isArray(options.protocols)) {
|
|
11649
|
-
protocols = options.protocols;
|
|
11650
|
-
} else {
|
|
11651
|
-
protocols = [options.protocols];
|
|
11652
|
-
}
|
|
11625
|
+
protocols = [];
|
|
11653
11626
|
} else {
|
|
11654
11627
|
protocols = [protocols];
|
|
11655
11628
|
}
|
|
11656
11629
|
}
|
|
11657
|
-
|
|
11630
|
+
initAsClient(this, address, protocols, options);
|
|
11658
11631
|
} else {
|
|
11632
|
+
this._autoPong = options.autoPong;
|
|
11633
|
+
this._closeTimeout = options.closeTimeout;
|
|
11659
11634
|
this._isServer = true;
|
|
11660
11635
|
}
|
|
11661
|
-
if (options.autoPong) {
|
|
11662
|
-
this._autoPong = true;
|
|
11663
|
-
this._autoPongComplete = () => autoPongComplete(this);
|
|
11664
|
-
this._pendingAutoPongs = 0;
|
|
11665
|
-
this._maxPendingAutoPongs = options.maxPendingAutoPongs | 0;
|
|
11666
|
-
}
|
|
11667
|
-
this._closeTimeout = options.closeTimeout;
|
|
11668
11636
|
}
|
|
11669
11637
|
/**
|
|
11670
11638
|
* For historical reasons, the custom "nodebuffer" type is used by the default
|
|
@@ -11851,6 +11819,7 @@ var require_websocket = __commonJS({
|
|
|
11851
11819
|
}
|
|
11852
11820
|
return;
|
|
11853
11821
|
}
|
|
11822
|
+
this._readyState = _WebSocket.CLOSING;
|
|
11854
11823
|
this._sender.close(code, data, !this._isServer, (err) => {
|
|
11855
11824
|
if (err) return;
|
|
11856
11825
|
this._closeFrameSent = true;
|
|
@@ -11858,7 +11827,6 @@ var require_websocket = __commonJS({
|
|
|
11858
11827
|
this._socket.end();
|
|
11859
11828
|
}
|
|
11860
11829
|
});
|
|
11861
|
-
this._readyState = _WebSocket.CLOSING;
|
|
11862
11830
|
setCloseTimer(this);
|
|
11863
11831
|
}
|
|
11864
11832
|
/**
|
|
@@ -12075,7 +12043,6 @@ var require_websocket = __commonJS({
|
|
|
12075
12043
|
maxBufferedChunks: 256 * 1024,
|
|
12076
12044
|
maxFragments: 16 * 1024,
|
|
12077
12045
|
maxPayload: 100 * 1024 * 1024,
|
|
12078
|
-
maxPendingAutoPongs: 60,
|
|
12079
12046
|
skipUTF8Validation: false,
|
|
12080
12047
|
perMessageDeflate: true,
|
|
12081
12048
|
followRedirects: false,
|
|
@@ -12084,13 +12051,14 @@ var require_websocket = __commonJS({
|
|
|
12084
12051
|
socketPath: void 0,
|
|
12085
12052
|
hostname: void 0,
|
|
12086
12053
|
protocol: void 0,
|
|
12087
|
-
protocols: void 0,
|
|
12088
12054
|
timeout: void 0,
|
|
12089
12055
|
method: "GET",
|
|
12090
12056
|
host: void 0,
|
|
12091
12057
|
path: void 0,
|
|
12092
12058
|
port: void 0
|
|
12093
12059
|
};
|
|
12060
|
+
websocket._autoPong = opts.autoPong;
|
|
12061
|
+
websocket._closeTimeout = opts.closeTimeout;
|
|
12094
12062
|
if (!protocolVersions.includes(opts.protocolVersion)) {
|
|
12095
12063
|
throw new RangeError(
|
|
12096
12064
|
`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`
|
|
@@ -12106,9 +12074,10 @@ var require_websocket = __commonJS({
|
|
|
12106
12074
|
throw new SyntaxError(`Invalid URL: ${address}`);
|
|
12107
12075
|
}
|
|
12108
12076
|
}
|
|
12109
|
-
if (parsedUrl.protocol === "http:"
|
|
12110
|
-
parsedUrl =
|
|
12111
|
-
|
|
12077
|
+
if (parsedUrl.protocol === "http:") {
|
|
12078
|
+
parsedUrl.protocol = "ws:";
|
|
12079
|
+
} else if (parsedUrl.protocol === "https:") {
|
|
12080
|
+
parsedUrl.protocol = "wss:";
|
|
12112
12081
|
}
|
|
12113
12082
|
websocket._url = parsedUrl.href;
|
|
12114
12083
|
const isSecure = parsedUrl.protocol === "wss:";
|
|
@@ -12177,19 +12146,12 @@ var require_websocket = __commonJS({
|
|
|
12177
12146
|
}
|
|
12178
12147
|
}
|
|
12179
12148
|
if (parsedUrl.username || parsedUrl.password) {
|
|
12180
|
-
|
|
12181
|
-
const password = querystring.unescape(parsedUrl.password);
|
|
12182
|
-
opts.auth = `${username}:${password}`;
|
|
12149
|
+
opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
|
|
12183
12150
|
}
|
|
12184
12151
|
if (isIpcUrl) {
|
|
12185
|
-
const
|
|
12186
|
-
|
|
12187
|
-
|
|
12188
|
-
opts.path = "";
|
|
12189
|
-
} else {
|
|
12190
|
-
opts.socketPath = opts.path.slice(0, i);
|
|
12191
|
-
opts.path = opts.path.slice(i + 1);
|
|
12192
|
-
}
|
|
12152
|
+
const parts = opts.path.split(":");
|
|
12153
|
+
opts.socketPath = parts[0];
|
|
12154
|
+
opts.path = parts[1];
|
|
12193
12155
|
}
|
|
12194
12156
|
let req;
|
|
12195
12157
|
if (opts.followRedirects) {
|
|
@@ -12333,7 +12295,6 @@ var require_websocket = __commonJS({
|
|
|
12333
12295
|
} else {
|
|
12334
12296
|
req.end();
|
|
12335
12297
|
}
|
|
12336
|
-
return opts;
|
|
12337
12298
|
}
|
|
12338
12299
|
function emitErrorAndClose(websocket, err) {
|
|
12339
12300
|
websocket._readyState = WebSocket2.CLOSING;
|
|
@@ -12385,13 +12346,8 @@ var require_websocket = __commonJS({
|
|
|
12385
12346
|
function receiverOnConclude(code, reason) {
|
|
12386
12347
|
const websocket = this[kWebSocket];
|
|
12387
12348
|
websocket._closeFrameReceived = true;
|
|
12349
|
+
websocket._closeMessage = reason;
|
|
12388
12350
|
websocket._closeCode = code;
|
|
12389
|
-
if (reason.length === 0) {
|
|
12390
|
-
websocket._closeMessage = EMPTY_BUFFER;
|
|
12391
|
-
} else {
|
|
12392
|
-
websocket._closeMessage = Buffer.allocUnsafeSlow(reason.length);
|
|
12393
|
-
websocket._closeMessage.set(reason);
|
|
12394
|
-
}
|
|
12395
12351
|
if (websocket._socket[kWebSocket] === void 0) return;
|
|
12396
12352
|
websocket._socket.removeListener("data", socketOnData);
|
|
12397
12353
|
process.nextTick(resume, websocket._socket);
|
|
@@ -12422,19 +12378,9 @@ var require_websocket = __commonJS({
|
|
|
12422
12378
|
}
|
|
12423
12379
|
function receiverOnPing(data) {
|
|
12424
12380
|
const websocket = this[kWebSocket];
|
|
12425
|
-
if (websocket._autoPong
|
|
12426
|
-
if (websocket._maxPendingAutoPongs > 0 && websocket._pendingAutoPongs >= websocket._maxPendingAutoPongs) {
|
|
12427
|
-
websocket.terminate();
|
|
12428
|
-
} else {
|
|
12429
|
-
websocket._pendingAutoPongs++;
|
|
12430
|
-
websocket.pong(data, !this._isServer, websocket._autoPongComplete);
|
|
12431
|
-
}
|
|
12432
|
-
}
|
|
12381
|
+
if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
|
|
12433
12382
|
websocket.emit("ping", data);
|
|
12434
12383
|
}
|
|
12435
|
-
function autoPongComplete(websocket) {
|
|
12436
|
-
websocket._pendingAutoPongs--;
|
|
12437
|
-
}
|
|
12438
12384
|
function receiverOnPong(data) {
|
|
12439
12385
|
this[kWebSocket].emit("pong", data);
|
|
12440
12386
|
}
|
|
@@ -12688,8 +12634,6 @@ var require_websocket_server = __commonJS({
|
|
|
12688
12634
|
* fragments
|
|
12689
12635
|
* @param {Number} [options.maxPayload=104857600] The maximum allowed message
|
|
12690
12636
|
* size
|
|
12691
|
-
* @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
|
|
12692
|
-
* pending automatic pongs
|
|
12693
12637
|
* @param {Boolean} [options.noServer=false] Enable no server mode
|
|
12694
12638
|
* @param {String} [options.path] Accept only connections matching this path
|
|
12695
12639
|
* @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
|
|
@@ -12712,7 +12656,6 @@ var require_websocket_server = __commonJS({
|
|
|
12712
12656
|
maxBufferedChunks: 256 * 1024,
|
|
12713
12657
|
maxFragments: 16 * 1024,
|
|
12714
12658
|
maxPayload: 100 * 1024 * 1024,
|
|
12715
|
-
maxPendingAutoPongs: 60,
|
|
12716
12659
|
skipUTF8Validation: false,
|
|
12717
12660
|
perMessageDeflate: false,
|
|
12718
12661
|
handleProtocols: null,
|