@sockethub/platform-caldav 1.0.0-alpha.7 → 1.0.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +388 -379
- package/dist/index.js.map +5 -4
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
18
18
|
return cached;
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
22
|
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
23
|
for (let key of __getOwnPropNames(mod))
|
|
24
24
|
if (!__hasOwnProp.call(to, key))
|
|
@@ -201,9 +201,9 @@ var require_scope = __commonJS(function(exports) {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
var UsedValueState;
|
|
204
|
-
(function(
|
|
205
|
-
|
|
206
|
-
|
|
204
|
+
(function(UsedValueState) {
|
|
205
|
+
UsedValueState[UsedValueState["Started"] = 0] = "Started";
|
|
206
|
+
UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
|
|
207
207
|
})(UsedValueState || (exports.UsedValueState = UsedValueState = {}));
|
|
208
208
|
exports.varKinds = {
|
|
209
209
|
const: new code_1.Name("const"),
|
|
@@ -1185,9 +1185,9 @@ var require_util = __commonJS(function(exports) {
|
|
|
1185
1185
|
}
|
|
1186
1186
|
exports.useFunc = useFunc;
|
|
1187
1187
|
var Type;
|
|
1188
|
-
(function(
|
|
1189
|
-
|
|
1190
|
-
|
|
1188
|
+
(function(Type) {
|
|
1189
|
+
Type[Type["Num"] = 0] = "Num";
|
|
1190
|
+
Type[Type["Str"] = 1] = "Str";
|
|
1191
1191
|
})(Type || (exports.Type = Type = {}));
|
|
1192
1192
|
function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
|
|
1193
1193
|
if (dataProp instanceof codegen_1.Name) {
|
|
@@ -1457,9 +1457,9 @@ var require_dataType = __commonJS(function(exports) {
|
|
|
1457
1457
|
var codegen_1 = require_codegen();
|
|
1458
1458
|
var util_1 = require_util();
|
|
1459
1459
|
var DataType;
|
|
1460
|
-
(function(
|
|
1461
|
-
|
|
1462
|
-
|
|
1460
|
+
(function(DataType) {
|
|
1461
|
+
DataType[DataType["Correct"] = 0] = "Correct";
|
|
1462
|
+
DataType[DataType["Wrong"] = 1] = "Wrong";
|
|
1463
1463
|
})(DataType || (exports.DataType = DataType = {}));
|
|
1464
1464
|
function getSchemaTypes(schema) {
|
|
1465
1465
|
const types = getJSONTypes(schema.type);
|
|
@@ -1855,8 +1855,8 @@ var require_keyword = __commonJS(function(exports) {
|
|
|
1855
1855
|
gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
|
|
1856
1856
|
}
|
|
1857
1857
|
function reportErrs(errors) {
|
|
1858
|
-
var
|
|
1859
|
-
gen.if((0, codegen_1.not)((
|
|
1858
|
+
var _a;
|
|
1859
|
+
gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== undefined ? _a : valid), errors);
|
|
1860
1860
|
}
|
|
1861
1861
|
}
|
|
1862
1862
|
exports.funcKeywordCode = funcKeywordCode;
|
|
@@ -5890,9 +5890,9 @@ var require_types = __commonJS(function(exports) {
|
|
|
5890
5890
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5891
5891
|
exports.DiscrError = undefined;
|
|
5892
5892
|
var DiscrError;
|
|
5893
|
-
(function(
|
|
5894
|
-
|
|
5895
|
-
|
|
5893
|
+
(function(DiscrError) {
|
|
5894
|
+
DiscrError["Tag"] = "tag";
|
|
5895
|
+
DiscrError["Mapping"] = "mapping";
|
|
5896
5896
|
})(DiscrError || (exports.DiscrError = DiscrError = {}));
|
|
5897
5897
|
});
|
|
5898
5898
|
|
|
@@ -6529,9 +6529,9 @@ var require_scope2 = __commonJS(function(exports) {
|
|
|
6529
6529
|
}
|
|
6530
6530
|
}
|
|
6531
6531
|
var UsedValueState;
|
|
6532
|
-
(function(
|
|
6533
|
-
|
|
6534
|
-
|
|
6532
|
+
(function(UsedValueState) {
|
|
6533
|
+
UsedValueState[UsedValueState["Started"] = 0] = "Started";
|
|
6534
|
+
UsedValueState[UsedValueState["Completed"] = 1] = "Completed";
|
|
6535
6535
|
})(UsedValueState = exports.UsedValueState || (exports.UsedValueState = {}));
|
|
6536
6536
|
exports.varKinds = {
|
|
6537
6537
|
const: new code_1.Name("const"),
|
|
@@ -7513,9 +7513,9 @@ var require_util2 = __commonJS(function(exports) {
|
|
|
7513
7513
|
}
|
|
7514
7514
|
exports.useFunc = useFunc;
|
|
7515
7515
|
var Type;
|
|
7516
|
-
(function(
|
|
7517
|
-
|
|
7518
|
-
|
|
7516
|
+
(function(Type) {
|
|
7517
|
+
Type[Type["Num"] = 0] = "Num";
|
|
7518
|
+
Type[Type["Str"] = 1] = "Str";
|
|
7519
7519
|
})(Type = exports.Type || (exports.Type = {}));
|
|
7520
7520
|
function getErrorPath(dataProp, dataPropType, jsPropertySyntax) {
|
|
7521
7521
|
if (dataProp instanceof codegen_1.Name) {
|
|
@@ -7785,9 +7785,9 @@ var require_dataType2 = __commonJS(function(exports) {
|
|
|
7785
7785
|
var codegen_1 = require_codegen2();
|
|
7786
7786
|
var util_1 = require_util2();
|
|
7787
7787
|
var DataType;
|
|
7788
|
-
(function(
|
|
7789
|
-
|
|
7790
|
-
|
|
7788
|
+
(function(DataType) {
|
|
7789
|
+
DataType[DataType["Correct"] = 0] = "Correct";
|
|
7790
|
+
DataType[DataType["Wrong"] = 1] = "Wrong";
|
|
7791
7791
|
})(DataType = exports.DataType || (exports.DataType = {}));
|
|
7792
7792
|
function getSchemaTypes(schema) {
|
|
7793
7793
|
const types = getJSONTypes(schema.type);
|
|
@@ -8183,8 +8183,8 @@ var require_keyword2 = __commonJS(function(exports) {
|
|
|
8183
8183
|
gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
|
|
8184
8184
|
}
|
|
8185
8185
|
function reportErrs(errors) {
|
|
8186
|
-
var
|
|
8187
|
-
gen.if((0, codegen_1.not)((
|
|
8186
|
+
var _a;
|
|
8187
|
+
gen.if((0, codegen_1.not)((_a = def.valid) !== null && _a !== undefined ? _a : valid), errors);
|
|
8188
8188
|
}
|
|
8189
8189
|
}
|
|
8190
8190
|
exports.funcKeywordCode = funcKeywordCode;
|
|
@@ -8420,15 +8420,15 @@ var require_resolve2 = __commonJS(function(exports) {
|
|
|
8420
8420
|
if (parentJsonPtr === undefined)
|
|
8421
8421
|
return;
|
|
8422
8422
|
const fullPath = pathPrefix + jsonPtr;
|
|
8423
|
-
let
|
|
8423
|
+
let baseId = baseIds[parentJsonPtr];
|
|
8424
8424
|
if (typeof sch[schemaId] == "string")
|
|
8425
|
-
|
|
8425
|
+
baseId = addRef.call(this, sch[schemaId]);
|
|
8426
8426
|
addAnchor.call(this, sch.$anchor);
|
|
8427
8427
|
addAnchor.call(this, sch.$dynamicAnchor);
|
|
8428
|
-
baseIds[jsonPtr] =
|
|
8428
|
+
baseIds[jsonPtr] = baseId;
|
|
8429
8429
|
function addRef(ref) {
|
|
8430
8430
|
const _resolve = this.opts.uriResolver.resolve;
|
|
8431
|
-
ref = normalizeId(
|
|
8431
|
+
ref = normalizeId(baseId ? _resolve(baseId, ref) : ref);
|
|
8432
8432
|
if (schemaRefs.has(ref))
|
|
8433
8433
|
throw ambiguos(ref);
|
|
8434
8434
|
schemaRefs.add(ref);
|
|
@@ -9281,22 +9281,22 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
9281
9281
|
}
|
|
9282
9282
|
return obj;
|
|
9283
9283
|
}
|
|
9284
|
-
function buildExps(
|
|
9285
|
-
var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$
|
|
9284
|
+
function buildExps(isIRI) {
|
|
9285
|
+
var ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
|
|
9286
9286
|
return {
|
|
9287
9287
|
NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
|
|
9288
|
-
NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED
|
|
9289
|
-
NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED
|
|
9290
|
-
NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED
|
|
9291
|
-
NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED
|
|
9292
|
-
NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED
|
|
9293
|
-
NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED
|
|
9294
|
-
ESCAPE: new RegExp(merge("[^]", UNRESERVED
|
|
9295
|
-
UNRESERVED: new RegExp(UNRESERVED
|
|
9296
|
-
OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED
|
|
9297
|
-
PCT_ENCODED: new RegExp(PCT_ENCODED
|
|
9288
|
+
NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
9289
|
+
NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
9290
|
+
NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
9291
|
+
NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
9292
|
+
NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
|
|
9293
|
+
NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
|
|
9294
|
+
ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
|
|
9295
|
+
UNRESERVED: new RegExp(UNRESERVED$$, "g"),
|
|
9296
|
+
OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
|
|
9297
|
+
PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
|
|
9298
9298
|
IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
|
|
9299
|
-
IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$
|
|
9299
|
+
IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$")
|
|
9300
9300
|
};
|
|
9301
9301
|
}
|
|
9302
9302
|
var URI_PROTOCOL = buildExps(false);
|
|
@@ -9409,10 +9409,10 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
9409
9409
|
}
|
|
9410
9410
|
return output;
|
|
9411
9411
|
}
|
|
9412
|
-
var ucs2encode = function
|
|
9412
|
+
var ucs2encode = function ucs2encode(array) {
|
|
9413
9413
|
return String.fromCodePoint.apply(String, toConsumableArray(array));
|
|
9414
9414
|
};
|
|
9415
|
-
var basicToDigit = function
|
|
9415
|
+
var basicToDigit = function basicToDigit(codePoint) {
|
|
9416
9416
|
if (codePoint - 48 < 10) {
|
|
9417
9417
|
return codePoint - 22;
|
|
9418
9418
|
}
|
|
@@ -9424,10 +9424,10 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
9424
9424
|
}
|
|
9425
9425
|
return base;
|
|
9426
9426
|
};
|
|
9427
|
-
var digitToBasic = function
|
|
9427
|
+
var digitToBasic = function digitToBasic(digit, flag) {
|
|
9428
9428
|
return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
|
|
9429
9429
|
};
|
|
9430
|
-
var adapt = function
|
|
9430
|
+
var adapt = function adapt(delta, numPoints, firstTime) {
|
|
9431
9431
|
var k = 0;
|
|
9432
9432
|
delta = firstTime ? floor(delta / damp) : delta >> 1;
|
|
9433
9433
|
delta += floor(delta / numPoints);
|
|
@@ -9436,7 +9436,7 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
9436
9436
|
}
|
|
9437
9437
|
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
|
|
9438
9438
|
};
|
|
9439
|
-
var decode = function
|
|
9439
|
+
var decode = function decode(input) {
|
|
9440
9440
|
var output = [];
|
|
9441
9441
|
var inputLength = input.length;
|
|
9442
9442
|
var i = 0;
|
|
@@ -9484,7 +9484,7 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
9484
9484
|
}
|
|
9485
9485
|
return String.fromCodePoint.apply(String, output);
|
|
9486
9486
|
};
|
|
9487
|
-
var encode = function
|
|
9487
|
+
var encode = function encode(input) {
|
|
9488
9488
|
var output = [];
|
|
9489
9489
|
input = ucs2decode(input);
|
|
9490
9490
|
var inputLength = input.length;
|
|
@@ -9598,12 +9598,12 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
9598
9598
|
}
|
|
9599
9599
|
return output.join("");
|
|
9600
9600
|
};
|
|
9601
|
-
var toUnicode = function
|
|
9601
|
+
var toUnicode = function toUnicode(input) {
|
|
9602
9602
|
return mapDomain(input, function(string) {
|
|
9603
9603
|
return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
|
|
9604
9604
|
});
|
|
9605
9605
|
};
|
|
9606
|
-
var toASCII = function
|
|
9606
|
+
var toASCII = function toASCII(input) {
|
|
9607
9607
|
return mapDomain(input, function(string) {
|
|
9608
9608
|
return regexNonASCII.test(string) ? "xn--" + encode(string) : string;
|
|
9609
9609
|
});
|
|
@@ -9667,22 +9667,22 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
9667
9667
|
return newStr;
|
|
9668
9668
|
}
|
|
9669
9669
|
function _normalizeComponentEncoding(components, protocol) {
|
|
9670
|
-
function
|
|
9670
|
+
function decodeUnreserved(str) {
|
|
9671
9671
|
var decStr = pctDecChars(str);
|
|
9672
9672
|
return !decStr.match(protocol.UNRESERVED) ? str : decStr;
|
|
9673
9673
|
}
|
|
9674
9674
|
if (components.scheme)
|
|
9675
|
-
components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED,
|
|
9675
|
+
components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
|
|
9676
9676
|
if (components.userinfo !== undefined)
|
|
9677
|
-
components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED,
|
|
9677
|
+
components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
9678
9678
|
if (components.host !== undefined)
|
|
9679
|
-
components.host = String(components.host).replace(protocol.PCT_ENCODED,
|
|
9679
|
+
components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
9680
9680
|
if (components.path !== undefined)
|
|
9681
|
-
components.path = String(components.path).replace(protocol.PCT_ENCODED,
|
|
9681
|
+
components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
9682
9682
|
if (components.query !== undefined)
|
|
9683
|
-
components.query = String(components.query).replace(protocol.PCT_ENCODED,
|
|
9683
|
+
components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
9684
9684
|
if (components.fragment !== undefined)
|
|
9685
|
-
components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED,
|
|
9685
|
+
components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
|
|
9686
9686
|
return components;
|
|
9687
9687
|
}
|
|
9688
9688
|
function _stripLeadingZeros(str) {
|
|
@@ -9911,12 +9911,12 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
9911
9911
|
}
|
|
9912
9912
|
return uriTokens.join("");
|
|
9913
9913
|
}
|
|
9914
|
-
function resolveComponents(
|
|
9914
|
+
function resolveComponents(base, relative) {
|
|
9915
9915
|
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
9916
9916
|
var skipNormalization = arguments[3];
|
|
9917
9917
|
var target = {};
|
|
9918
9918
|
if (!skipNormalization) {
|
|
9919
|
-
|
|
9919
|
+
base = parse(serialize(base, options), options);
|
|
9920
9920
|
relative = parse(serialize(relative, options), options);
|
|
9921
9921
|
}
|
|
9922
9922
|
options = options || {};
|
|
@@ -9936,32 +9936,32 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
9936
9936
|
target.query = relative.query;
|
|
9937
9937
|
} else {
|
|
9938
9938
|
if (!relative.path) {
|
|
9939
|
-
target.path =
|
|
9939
|
+
target.path = base.path;
|
|
9940
9940
|
if (relative.query !== undefined) {
|
|
9941
9941
|
target.query = relative.query;
|
|
9942
9942
|
} else {
|
|
9943
|
-
target.query =
|
|
9943
|
+
target.query = base.query;
|
|
9944
9944
|
}
|
|
9945
9945
|
} else {
|
|
9946
9946
|
if (relative.path.charAt(0) === "/") {
|
|
9947
9947
|
target.path = removeDotSegments(relative.path);
|
|
9948
9948
|
} else {
|
|
9949
|
-
if ((
|
|
9949
|
+
if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
|
|
9950
9950
|
target.path = "/" + relative.path;
|
|
9951
|
-
} else if (!
|
|
9951
|
+
} else if (!base.path) {
|
|
9952
9952
|
target.path = relative.path;
|
|
9953
9953
|
} else {
|
|
9954
|
-
target.path =
|
|
9954
|
+
target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
|
|
9955
9955
|
}
|
|
9956
9956
|
target.path = removeDotSegments(target.path);
|
|
9957
9957
|
}
|
|
9958
9958
|
target.query = relative.query;
|
|
9959
9959
|
}
|
|
9960
|
-
target.userinfo =
|
|
9961
|
-
target.host =
|
|
9962
|
-
target.port =
|
|
9960
|
+
target.userinfo = base.userinfo;
|
|
9961
|
+
target.host = base.host;
|
|
9962
|
+
target.port = base.port;
|
|
9963
9963
|
}
|
|
9964
|
-
target.scheme =
|
|
9964
|
+
target.scheme = base.scheme;
|
|
9965
9965
|
}
|
|
9966
9966
|
target.fragment = relative.fragment;
|
|
9967
9967
|
return target;
|
|
@@ -10000,13 +10000,13 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
10000
10000
|
var handler = {
|
|
10001
10001
|
scheme: "http",
|
|
10002
10002
|
domainHost: true,
|
|
10003
|
-
parse: function
|
|
10003
|
+
parse: function parse(components, options) {
|
|
10004
10004
|
if (!components.host) {
|
|
10005
10005
|
components.error = components.error || "HTTP URIs must have a host.";
|
|
10006
10006
|
}
|
|
10007
10007
|
return components;
|
|
10008
10008
|
},
|
|
10009
|
-
serialize: function
|
|
10009
|
+
serialize: function serialize(components, options) {
|
|
10010
10010
|
var secure = String(components.scheme).toLowerCase() === "https";
|
|
10011
10011
|
if (components.port === (secure ? 443 : 80) || components.port === "") {
|
|
10012
10012
|
components.port = undefined;
|
|
@@ -10029,7 +10029,7 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
10029
10029
|
var handler$2 = {
|
|
10030
10030
|
scheme: "ws",
|
|
10031
10031
|
domainHost: true,
|
|
10032
|
-
parse: function
|
|
10032
|
+
parse: function parse(components, options) {
|
|
10033
10033
|
var wsComponents = components;
|
|
10034
10034
|
wsComponents.secure = isSecure(wsComponents);
|
|
10035
10035
|
wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
|
|
@@ -10037,7 +10037,7 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
10037
10037
|
wsComponents.query = undefined;
|
|
10038
10038
|
return wsComponents;
|
|
10039
10039
|
},
|
|
10040
|
-
serialize: function
|
|
10040
|
+
serialize: function serialize(wsComponents, options) {
|
|
10041
10041
|
if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
|
|
10042
10042
|
wsComponents.port = undefined;
|
|
10043
10043
|
}
|
|
@@ -10205,7 +10205,7 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
10205
10205
|
var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
|
|
10206
10206
|
var handler$6 = {
|
|
10207
10207
|
scheme: "urn:uuid",
|
|
10208
|
-
parse: function
|
|
10208
|
+
parse: function parse(urnComponents, options) {
|
|
10209
10209
|
var uuidComponents = urnComponents;
|
|
10210
10210
|
uuidComponents.uuid = uuidComponents.nss;
|
|
10211
10211
|
uuidComponents.nss = undefined;
|
|
@@ -10214,7 +10214,7 @@ var require_uri_all = __commonJS(function(exports, module) {
|
|
|
10214
10214
|
}
|
|
10215
10215
|
return uuidComponents;
|
|
10216
10216
|
},
|
|
10217
|
-
serialize: function
|
|
10217
|
+
serialize: function serialize(uuidComponents, options) {
|
|
10218
10218
|
var urnComponents = uuidComponents;
|
|
10219
10219
|
urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
|
|
10220
10220
|
return urnComponents;
|
|
@@ -10358,7 +10358,7 @@ var require_core3 = __commonJS(function(exports) {
|
|
|
10358
10358
|
};
|
|
10359
10359
|
}
|
|
10360
10360
|
|
|
10361
|
-
class
|
|
10361
|
+
class Ajv {
|
|
10362
10362
|
constructor(opts = {}) {
|
|
10363
10363
|
this.schemas = {};
|
|
10364
10364
|
this.refs = {};
|
|
@@ -10715,9 +10715,9 @@ var require_core3 = __commonJS(function(exports) {
|
|
|
10715
10715
|
}
|
|
10716
10716
|
}
|
|
10717
10717
|
}
|
|
10718
|
-
exports.default =
|
|
10719
|
-
|
|
10720
|
-
|
|
10718
|
+
exports.default = Ajv;
|
|
10719
|
+
Ajv.ValidationError = validation_error_1.default;
|
|
10720
|
+
Ajv.MissingRefError = ref_error_1.default;
|
|
10721
10721
|
function checkOptions(checkOpts, options, msg, log = "error") {
|
|
10722
10722
|
for (const key in checkOpts) {
|
|
10723
10723
|
const opt = key;
|
|
@@ -12408,9 +12408,9 @@ var require_types2 = __commonJS(function(exports) {
|
|
|
12408
12408
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12409
12409
|
exports.DiscrError = undefined;
|
|
12410
12410
|
var DiscrError;
|
|
12411
|
-
(function(
|
|
12412
|
-
|
|
12413
|
-
|
|
12411
|
+
(function(DiscrError) {
|
|
12412
|
+
DiscrError["Tag"] = "tag";
|
|
12413
|
+
DiscrError["Mapping"] = "mapping";
|
|
12414
12414
|
})(DiscrError = exports.DiscrError || (exports.DiscrError = {}));
|
|
12415
12415
|
});
|
|
12416
12416
|
|
|
@@ -12678,7 +12678,7 @@ var require_ajv2 = __commonJS(function(exports, module) {
|
|
|
12678
12678
|
var META_SUPPORT_DATA = ["/properties"];
|
|
12679
12679
|
var META_SCHEMA_ID = "http://json-schema.org/draft-07/schema";
|
|
12680
12680
|
|
|
12681
|
-
class
|
|
12681
|
+
class Ajv extends core_1.default {
|
|
12682
12682
|
_addVocabularies() {
|
|
12683
12683
|
super._addVocabularies();
|
|
12684
12684
|
draft7_1.default.forEach((v) => this.addVocabulary(v));
|
|
@@ -12697,9 +12697,9 @@ var require_ajv2 = __commonJS(function(exports, module) {
|
|
|
12697
12697
|
return this.opts.defaultMeta = super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined);
|
|
12698
12698
|
}
|
|
12699
12699
|
}
|
|
12700
|
-
module.exports = exports =
|
|
12700
|
+
module.exports = exports = Ajv;
|
|
12701
12701
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12702
|
-
exports.default =
|
|
12702
|
+
exports.default = Ajv;
|
|
12703
12703
|
var validate_1 = require_validate2();
|
|
12704
12704
|
Object.defineProperty(exports, "KeywordCxt", { enumerable: true, get: function() {
|
|
12705
12705
|
return validate_1.KeywordCxt;
|
|
@@ -12795,9 +12795,9 @@ var require_limit = __commonJS(function(exports) {
|
|
|
12795
12795
|
},
|
|
12796
12796
|
dependencies: ["format"]
|
|
12797
12797
|
};
|
|
12798
|
-
var formatLimitPlugin = (
|
|
12799
|
-
|
|
12800
|
-
return
|
|
12798
|
+
var formatLimitPlugin = (ajv) => {
|
|
12799
|
+
ajv.addKeyword(exports.formatLimitDefinition);
|
|
12800
|
+
return ajv;
|
|
12801
12801
|
};
|
|
12802
12802
|
exports.default = formatLimitPlugin;
|
|
12803
12803
|
});
|
|
@@ -12810,17 +12810,17 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
12810
12810
|
var codegen_1 = require_codegen2();
|
|
12811
12811
|
var fullName = new codegen_1.Name("fullFormats");
|
|
12812
12812
|
var fastName = new codegen_1.Name("fastFormats");
|
|
12813
|
-
var formatsPlugin = (
|
|
12813
|
+
var formatsPlugin = (ajv, opts = { keywords: true }) => {
|
|
12814
12814
|
if (Array.isArray(opts)) {
|
|
12815
|
-
addFormats(
|
|
12816
|
-
return
|
|
12815
|
+
addFormats(ajv, opts, formats_1.fullFormats, fullName);
|
|
12816
|
+
return ajv;
|
|
12817
12817
|
}
|
|
12818
12818
|
const [formats, exportName] = opts.mode === "fast" ? [formats_1.fastFormats, fastName] : [formats_1.fullFormats, fullName];
|
|
12819
12819
|
const list = opts.formats || formats_1.formatNames;
|
|
12820
|
-
addFormats(
|
|
12820
|
+
addFormats(ajv, list, formats, exportName);
|
|
12821
12821
|
if (opts.keywords)
|
|
12822
|
-
limit_1.default(
|
|
12823
|
-
return
|
|
12822
|
+
limit_1.default(ajv);
|
|
12823
|
+
return ajv;
|
|
12824
12824
|
};
|
|
12825
12825
|
formatsPlugin.get = (name, mode = "full") => {
|
|
12826
12826
|
const formats = mode === "fast" ? formats_1.fastFormats : formats_1.fullFormats;
|
|
@@ -12829,12 +12829,12 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
12829
12829
|
throw new Error(`Unknown format "${name}"`);
|
|
12830
12830
|
return f;
|
|
12831
12831
|
};
|
|
12832
|
-
function addFormats(
|
|
12832
|
+
function addFormats(ajv, list, fs, exportName) {
|
|
12833
12833
|
var _a;
|
|
12834
12834
|
var _b;
|
|
12835
|
-
(_a = (_b =
|
|
12835
|
+
(_a = (_b = ajv.opts.code).formats) !== null && _a !== undefined || (_b.formats = codegen_1._`require("ajv-formats/dist/formats").${exportName}`);
|
|
12836
12836
|
for (const f of list)
|
|
12837
|
-
|
|
12837
|
+
ajv.addFormat(f, fs[f]);
|
|
12838
12838
|
}
|
|
12839
12839
|
module.exports = exports = formatsPlugin;
|
|
12840
12840
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -13552,13 +13552,13 @@ var require_extend = __commonJS(function(exports, module) {
|
|
|
13552
13552
|
var toStr = Object.prototype.toString;
|
|
13553
13553
|
var defineProperty = Object.defineProperty;
|
|
13554
13554
|
var gOPD = Object.getOwnPropertyDescriptor;
|
|
13555
|
-
var isArray = function
|
|
13555
|
+
var isArray = function isArray(arr) {
|
|
13556
13556
|
if (typeof Array.isArray === "function") {
|
|
13557
13557
|
return Array.isArray(arr);
|
|
13558
13558
|
}
|
|
13559
13559
|
return toStr.call(arr) === "[object Array]";
|
|
13560
13560
|
};
|
|
13561
|
-
var isPlainObject = function
|
|
13561
|
+
var isPlainObject = function isPlainObject(obj) {
|
|
13562
13562
|
if (!obj || toStr.call(obj) !== "[object Object]") {
|
|
13563
13563
|
return false;
|
|
13564
13564
|
}
|
|
@@ -13571,7 +13571,7 @@ var require_extend = __commonJS(function(exports, module) {
|
|
|
13571
13571
|
for (key in obj) {}
|
|
13572
13572
|
return typeof key === "undefined" || hasOwn.call(obj, key);
|
|
13573
13573
|
};
|
|
13574
|
-
var setProperty = function
|
|
13574
|
+
var setProperty = function setProperty(target, options) {
|
|
13575
13575
|
if (defineProperty && options.name === "__proto__") {
|
|
13576
13576
|
defineProperty(target, options.name, {
|
|
13577
13577
|
enumerable: true,
|
|
@@ -13583,7 +13583,7 @@ var require_extend = __commonJS(function(exports, module) {
|
|
|
13583
13583
|
target[options.name] = options.newValue;
|
|
13584
13584
|
}
|
|
13585
13585
|
};
|
|
13586
|
-
var getProperty = function
|
|
13586
|
+
var getProperty = function getProperty(obj, name) {
|
|
13587
13587
|
if (name === "__proto__") {
|
|
13588
13588
|
if (!hasOwn.call(obj, name)) {
|
|
13589
13589
|
return;
|
|
@@ -15745,7 +15745,7 @@ var require_formats2 = __commonJS(function(exports, module) {
|
|
|
15745
15745
|
// ../../node_modules/ajv-formats-draft2019/index.js
|
|
15746
15746
|
var require_ajv_formats_draft2019 = __commonJS(function(exports, module) {
|
|
15747
15747
|
var formats = require_formats2();
|
|
15748
|
-
module.exports = (
|
|
15748
|
+
module.exports = (ajv, options = {}) => {
|
|
15749
15749
|
const allFormats = Object.keys(formats);
|
|
15750
15750
|
let formatsToInstall = allFormats;
|
|
15751
15751
|
if (options.formats) {
|
|
@@ -15754,9 +15754,9 @@ var require_ajv_formats_draft2019 = __commonJS(function(exports, module) {
|
|
|
15754
15754
|
formatsToInstall = options.formats;
|
|
15755
15755
|
}
|
|
15756
15756
|
allFormats.filter((format) => formatsToInstall.includes(format)).forEach((key) => {
|
|
15757
|
-
|
|
15757
|
+
ajv.addFormat(key, formats[key]);
|
|
15758
15758
|
});
|
|
15759
|
-
return
|
|
15759
|
+
return ajv;
|
|
15760
15760
|
};
|
|
15761
15761
|
});
|
|
15762
15762
|
|
|
@@ -16020,7 +16020,7 @@ var ActivityStreamSchema = {
|
|
|
16020
16020
|
var package_default = {
|
|
16021
16021
|
name: "@sockethub/schemas",
|
|
16022
16022
|
description: "JSON schema files for validating Sockethub Activity Streams",
|
|
16023
|
-
version: "3.0.0-alpha.
|
|
16023
|
+
version: "3.0.0-alpha.25",
|
|
16024
16024
|
type: "module",
|
|
16025
16025
|
private: false,
|
|
16026
16026
|
author: "Nick Jennings <nick@silverbucket.net>",
|
|
@@ -16051,11 +16051,20 @@ var package_default = {
|
|
|
16051
16051
|
import: "./dist/examples-config.js",
|
|
16052
16052
|
default: "./dist/examples-config.js"
|
|
16053
16053
|
},
|
|
16054
|
+
"./service-descriptor": {
|
|
16055
|
+
types: "./dist/service-descriptor.d.ts",
|
|
16056
|
+
bun: "./src/service-descriptor.ts",
|
|
16057
|
+
import: "./dist/service-descriptor.js",
|
|
16058
|
+
default: "./dist/service-descriptor.js"
|
|
16059
|
+
},
|
|
16054
16060
|
"./schemas/json/sockethub-config.json": {
|
|
16055
16061
|
default: "./dist/schemas/json/sockethub-config.json"
|
|
16056
16062
|
},
|
|
16057
16063
|
"./schemas/json/examples-config.json": {
|
|
16058
16064
|
default: "./dist/schemas/json/examples-config.json"
|
|
16065
|
+
},
|
|
16066
|
+
"./schemas/json/service-descriptor.json": {
|
|
16067
|
+
default: "./dist/schemas/json/service-descriptor.json"
|
|
16059
16068
|
}
|
|
16060
16069
|
},
|
|
16061
16070
|
files: [
|
|
@@ -16081,7 +16090,7 @@ var package_default = {
|
|
|
16081
16090
|
"@types/bun": "latest"
|
|
16082
16091
|
},
|
|
16083
16092
|
scripts: {
|
|
16084
|
-
build: "bun ./scripts/export-json-schema.ts && bun ./scripts/export-canonical-assets.ts && bun build src/index.ts src/object-types.ts --outdir dist --target node --format esm --sourcemap=external && bun build src/context.ts src/activity-stream-helper.ts src/examples-config.ts --outdir dist --target browser --format esm --sourcemap=external",
|
|
16093
|
+
build: "bun ./scripts/export-json-schema.ts && bun ./scripts/export-canonical-assets.ts && bun build src/index.ts src/object-types.ts --outdir dist --target node --format esm --sourcemap=external && bun build src/context.ts src/activity-stream-helper.ts src/examples-config.ts src/service-descriptor.ts --outdir dist --target browser --format esm --sourcemap=external",
|
|
16085
16094
|
clean: "rm -rf dist",
|
|
16086
16095
|
"clean:deps": "rm -rf node_modules"
|
|
16087
16096
|
},
|
|
@@ -16090,7 +16099,7 @@ var package_default = {
|
|
|
16090
16099
|
"ajv-formats": "^2.1.1",
|
|
16091
16100
|
"ajv-formats-draft2019": "^1.6.1"
|
|
16092
16101
|
},
|
|
16093
|
-
gitHead: "
|
|
16102
|
+
gitHead: "45acaca6570f8e8429d996ec1d3b95979e8c54a9",
|
|
16094
16103
|
types: "./dist/index.d.ts"
|
|
16095
16104
|
};
|
|
16096
16105
|
|
|
@@ -16483,29 +16492,33 @@ var SockethubConfigSchema = {
|
|
|
16483
16492
|
};
|
|
16484
16493
|
var SockethubConfigSchemaId = versionedSchemaId(SockethubConfigSchema.$id, package_default.version);
|
|
16485
16494
|
|
|
16486
|
-
// ../schemas/src/
|
|
16495
|
+
// ../schemas/src/service-descriptor.ts
|
|
16487
16496
|
var import_ajv2 = __toESM(require_ajv(), 1);
|
|
16497
|
+
var ajv2 = new import_ajv2.default({ strictTypes: false, allErrors: true });
|
|
16498
|
+
|
|
16499
|
+
// ../schemas/src/validator.ts
|
|
16500
|
+
var import_ajv3 = __toESM(require_ajv(), 1);
|
|
16488
16501
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
16489
16502
|
var import_ajv_formats_draft2019 = __toESM(require_ajv_formats_draft2019(), 1);
|
|
16490
|
-
var
|
|
16491
|
-
import_ajv_formats.default(
|
|
16492
|
-
import_ajv_formats_draft2019.default(
|
|
16503
|
+
var ajv3 = new import_ajv3.default({ strictTypes: false, allErrors: true });
|
|
16504
|
+
import_ajv_formats.default(ajv3);
|
|
16505
|
+
import_ajv_formats_draft2019.default(ajv3);
|
|
16493
16506
|
var schemaURL = "https://sockethub.org/schemas/v0";
|
|
16494
16507
|
var schemas = {};
|
|
16495
16508
|
var systemContextsRegistered = false;
|
|
16496
16509
|
schemas[`${schemaURL}/activity-stream`] = ActivityStreamSchema;
|
|
16497
16510
|
for (const uri in schemas) {
|
|
16498
|
-
|
|
16511
|
+
ajv3.addSchema(schemas[uri], uri);
|
|
16499
16512
|
}
|
|
16500
16513
|
function registerSystemContext(platformId, contextUrl) {
|
|
16501
16514
|
registerPlatformContext(platformId, contextUrl, `${schemaURL}/context/${platformId}/messages`, `${schemaURL}/context/${platformId}/credentials`);
|
|
16502
16515
|
const messageSchemaRef = `${schemaURL}/context/${platformId}/messages`;
|
|
16503
|
-
if (!
|
|
16504
|
-
|
|
16516
|
+
if (!ajv3.getSchema(messageSchemaRef)) {
|
|
16517
|
+
ajv3.addSchema({}, messageSchemaRef);
|
|
16505
16518
|
}
|
|
16506
16519
|
const credentialsSchemaRef = `${schemaURL}/context/${platformId}/credentials`;
|
|
16507
|
-
if (!
|
|
16508
|
-
|
|
16520
|
+
if (!ajv3.getSchema(credentialsSchemaRef)) {
|
|
16521
|
+
ajv3.addSchema({}, credentialsSchemaRef);
|
|
16509
16522
|
}
|
|
16510
16523
|
}
|
|
16511
16524
|
function registerSystemPlatformContexts() {
|
|
@@ -17479,9 +17492,9 @@ var require_util3 = __commonJS2(function(exports, module) {
|
|
|
17479
17492
|
}
|
|
17480
17493
|
function getHostname(host) {
|
|
17481
17494
|
if (host[0] === "[") {
|
|
17482
|
-
const
|
|
17483
|
-
assert(
|
|
17484
|
-
return host.substring(1,
|
|
17495
|
+
const idx = host.indexOf("]");
|
|
17496
|
+
assert(idx !== -1);
|
|
17497
|
+
return host.substring(1, idx);
|
|
17485
17498
|
}
|
|
17486
17499
|
const idx = host.indexOf(":");
|
|
17487
17500
|
if (idx === -1)
|
|
@@ -17524,22 +17537,22 @@ var require_util3 = __commonJS2(function(exports, module) {
|
|
|
17524
17537
|
function isDestroyed(body) {
|
|
17525
17538
|
return body && !!(body.destroyed || body[kDestroyed] || stream.isDestroyed?.(body));
|
|
17526
17539
|
}
|
|
17527
|
-
function destroy(
|
|
17528
|
-
if (
|
|
17540
|
+
function destroy(stream, err) {
|
|
17541
|
+
if (stream == null || !isStream(stream) || isDestroyed(stream)) {
|
|
17529
17542
|
return;
|
|
17530
17543
|
}
|
|
17531
|
-
if (typeof
|
|
17532
|
-
if (Object.getPrototypeOf(
|
|
17533
|
-
|
|
17544
|
+
if (typeof stream.destroy === "function") {
|
|
17545
|
+
if (Object.getPrototypeOf(stream).constructor === IncomingMessage) {
|
|
17546
|
+
stream.socket = null;
|
|
17534
17547
|
}
|
|
17535
|
-
|
|
17548
|
+
stream.destroy(err);
|
|
17536
17549
|
} else if (err) {
|
|
17537
17550
|
queueMicrotask(() => {
|
|
17538
|
-
|
|
17551
|
+
stream.emit("error", err);
|
|
17539
17552
|
});
|
|
17540
17553
|
}
|
|
17541
|
-
if (
|
|
17542
|
-
|
|
17554
|
+
if (stream.destroyed !== true) {
|
|
17555
|
+
stream[kDestroyed] = true;
|
|
17543
17556
|
}
|
|
17544
17557
|
}
|
|
17545
17558
|
var KEEPALIVE_TIMEOUT_EXPR = /timeout=(\d+)/;
|
|
@@ -18010,8 +18023,8 @@ var require_util3 = __commonJS2(function(exports, module) {
|
|
|
18010
18023
|
try {
|
|
18011
18024
|
request.onError(err);
|
|
18012
18025
|
assert(request.aborted);
|
|
18013
|
-
} catch (
|
|
18014
|
-
client.emit("error",
|
|
18026
|
+
} catch (err) {
|
|
18027
|
+
client.emit("error", err);
|
|
18015
18028
|
}
|
|
18016
18029
|
}
|
|
18017
18030
|
var setupConnectTimeout = process.platform === "win32" ? (socketWeakRef, opts) => {
|
|
@@ -18891,8 +18904,8 @@ var require_dispatcher_base = __commonJS2(function(exports, module) {
|
|
|
18891
18904
|
}
|
|
18892
18905
|
if (callback === undefined) {
|
|
18893
18906
|
return new Promise((resolve, reject) => {
|
|
18894
|
-
this.destroy(err, (
|
|
18895
|
-
return
|
|
18907
|
+
this.destroy(err, (err, data) => {
|
|
18908
|
+
return err ? reject(err) : resolve(data);
|
|
18896
18909
|
});
|
|
18897
18910
|
});
|
|
18898
18911
|
}
|
|
@@ -18989,7 +19002,7 @@ var require_connect = __commonJS2(function(exports, module) {
|
|
|
18989
19002
|
const sessionCache = new SessionCache(maxCachedSessions == null ? 100 : maxCachedSessions);
|
|
18990
19003
|
timeout = timeout == null ? 1e4 : timeout;
|
|
18991
19004
|
allowH2 = allowH2 != null ? allowH2 : false;
|
|
18992
|
-
return function
|
|
19005
|
+
return function connect2({ hostname, host, protocol, port, servername, localAddress, httpSocket }, callback) {
|
|
18993
19006
|
let socket;
|
|
18994
19007
|
if (protocol === "https:") {
|
|
18995
19008
|
if (!tls) {
|
|
@@ -19011,8 +19024,8 @@ var require_connect = __commonJS2(function(exports, module) {
|
|
|
19011
19024
|
port,
|
|
19012
19025
|
host: hostname
|
|
19013
19026
|
});
|
|
19014
|
-
socket.on("session", function(
|
|
19015
|
-
sessionCache.set(sessionKey,
|
|
19027
|
+
socket.on("session", function(session) {
|
|
19028
|
+
sessionCache.set(sessionKey, session);
|
|
19016
19029
|
});
|
|
19017
19030
|
} else {
|
|
19018
19031
|
assert(!httpSocket, "httpSocket can only be sent on TLS update");
|
|
@@ -20277,7 +20290,7 @@ var require_runtime_features = __commonJS2(function(exports, module) {
|
|
|
20277
20290
|
exports.default = instance;
|
|
20278
20291
|
});
|
|
20279
20292
|
var require_webidl = __commonJS2(function(exports, module) {
|
|
20280
|
-
var { types
|
|
20293
|
+
var { types, inspect } = __require2("node:util");
|
|
20281
20294
|
var { runtimeFeatures } = require_runtime_features();
|
|
20282
20295
|
var UNDEFINED = 1;
|
|
20283
20296
|
var BOOLEAN = 2;
|
|
@@ -20478,10 +20491,10 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20478
20491
|
}
|
|
20479
20492
|
};
|
|
20480
20493
|
webidl.util.IsResizableArrayBuffer = function(V) {
|
|
20481
|
-
if (
|
|
20494
|
+
if (types.isArrayBuffer(V)) {
|
|
20482
20495
|
return V.resizable;
|
|
20483
20496
|
}
|
|
20484
|
-
if (
|
|
20497
|
+
if (types.isSharedArrayBuffer(V)) {
|
|
20485
20498
|
return V.growable;
|
|
20486
20499
|
}
|
|
20487
20500
|
throw webidl.errors.exception({
|
|
@@ -20528,9 +20541,9 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20528
20541
|
});
|
|
20529
20542
|
}
|
|
20530
20543
|
const result = {};
|
|
20531
|
-
if (!
|
|
20532
|
-
const
|
|
20533
|
-
for (const key of
|
|
20544
|
+
if (!types.isProxy(O)) {
|
|
20545
|
+
const keys = [...Object.getOwnPropertyNames(O), ...Object.getOwnPropertySymbols(O)];
|
|
20546
|
+
for (const key of keys) {
|
|
20534
20547
|
const keyName = webidl.util.Stringify(key);
|
|
20535
20548
|
const typedKey = keyConverter(key, prefix, `Key ${keyName} in ${argument}`);
|
|
20536
20549
|
const typedValue = valueConverter(O[key], prefix, `${argument}[${keyName}]`);
|
|
@@ -20618,7 +20631,7 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20618
20631
|
webidl.is.AbortSignal = webidl.util.MakeTypeAssertion(AbortSignal);
|
|
20619
20632
|
webidl.is.MessagePort = webidl.util.MakeTypeAssertion(MessagePort);
|
|
20620
20633
|
webidl.is.BufferSource = function(V) {
|
|
20621
|
-
return
|
|
20634
|
+
return types.isArrayBuffer(V) || ArrayBuffer.isView(V) && types.isArrayBuffer(V.buffer);
|
|
20622
20635
|
};
|
|
20623
20636
|
webidl.converters.DOMString = function(V, prefix, argument, flags) {
|
|
20624
20637
|
if (V === null && webidl.util.HasFlag(flags, webidl.attributes.LegacyNullToEmptyString)) {
|
|
@@ -20677,7 +20690,7 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20677
20690
|
return x;
|
|
20678
20691
|
};
|
|
20679
20692
|
webidl.converters.ArrayBuffer = function(V, prefix, argument, flags) {
|
|
20680
|
-
if (webidl.util.Type(V) !== OBJECT || !
|
|
20693
|
+
if (webidl.util.Type(V) !== OBJECT || !types.isArrayBuffer(V)) {
|
|
20681
20694
|
throw webidl.errors.conversionFailed({
|
|
20682
20695
|
prefix,
|
|
20683
20696
|
argument: `${argument} ("${webidl.util.Stringify(V)}")`,
|
|
@@ -20693,7 +20706,7 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20693
20706
|
return V;
|
|
20694
20707
|
};
|
|
20695
20708
|
webidl.converters.SharedArrayBuffer = function(V, prefix, argument, flags) {
|
|
20696
|
-
if (webidl.util.Type(V) !== OBJECT || !
|
|
20709
|
+
if (webidl.util.Type(V) !== OBJECT || !types.isSharedArrayBuffer(V)) {
|
|
20697
20710
|
throw webidl.errors.conversionFailed({
|
|
20698
20711
|
prefix,
|
|
20699
20712
|
argument: `${argument} ("${webidl.util.Stringify(V)}")`,
|
|
@@ -20709,14 +20722,14 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20709
20722
|
return V;
|
|
20710
20723
|
};
|
|
20711
20724
|
webidl.converters.TypedArray = function(V, T, prefix, argument, flags) {
|
|
20712
|
-
if (webidl.util.Type(V) !== OBJECT || !
|
|
20725
|
+
if (webidl.util.Type(V) !== OBJECT || !types.isTypedArray(V) || V.constructor.name !== T.name) {
|
|
20713
20726
|
throw webidl.errors.conversionFailed({
|
|
20714
20727
|
prefix,
|
|
20715
20728
|
argument: `${argument} ("${webidl.util.Stringify(V)}")`,
|
|
20716
20729
|
types: [T.name]
|
|
20717
20730
|
});
|
|
20718
20731
|
}
|
|
20719
|
-
if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) &&
|
|
20732
|
+
if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) && types.isSharedArrayBuffer(V.buffer)) {
|
|
20720
20733
|
throw webidl.errors.exception({
|
|
20721
20734
|
header: prefix,
|
|
20722
20735
|
message: `${argument} cannot be a view on a shared array buffer.`
|
|
@@ -20731,14 +20744,14 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20731
20744
|
return V;
|
|
20732
20745
|
};
|
|
20733
20746
|
webidl.converters.DataView = function(V, prefix, argument, flags) {
|
|
20734
|
-
if (webidl.util.Type(V) !== OBJECT || !
|
|
20747
|
+
if (webidl.util.Type(V) !== OBJECT || !types.isDataView(V)) {
|
|
20735
20748
|
throw webidl.errors.conversionFailed({
|
|
20736
20749
|
prefix,
|
|
20737
20750
|
argument: `${argument} ("${webidl.util.Stringify(V)}")`,
|
|
20738
20751
|
types: ["DataView"]
|
|
20739
20752
|
});
|
|
20740
20753
|
}
|
|
20741
|
-
if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) &&
|
|
20754
|
+
if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) && types.isSharedArrayBuffer(V.buffer)) {
|
|
20742
20755
|
throw webidl.errors.exception({
|
|
20743
20756
|
header: prefix,
|
|
20744
20757
|
message: `${argument} cannot be a view on a shared array buffer.`
|
|
@@ -20753,14 +20766,14 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20753
20766
|
return V;
|
|
20754
20767
|
};
|
|
20755
20768
|
webidl.converters.ArrayBufferView = function(V, prefix, argument, flags) {
|
|
20756
|
-
if (webidl.util.Type(V) !== OBJECT || !
|
|
20769
|
+
if (webidl.util.Type(V) !== OBJECT || !types.isArrayBufferView(V)) {
|
|
20757
20770
|
throw webidl.errors.conversionFailed({
|
|
20758
20771
|
prefix,
|
|
20759
20772
|
argument: `${argument} ("${webidl.util.Stringify(V)}")`,
|
|
20760
20773
|
types: ["ArrayBufferView"]
|
|
20761
20774
|
});
|
|
20762
20775
|
}
|
|
20763
|
-
if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) &&
|
|
20776
|
+
if (!webidl.util.HasFlag(flags, webidl.attributes.AllowShared) && types.isSharedArrayBuffer(V.buffer)) {
|
|
20764
20777
|
throw webidl.errors.exception({
|
|
20765
20778
|
header: prefix,
|
|
20766
20779
|
message: `${argument} cannot be a view on a shared array buffer.`
|
|
@@ -20775,14 +20788,14 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20775
20788
|
return V;
|
|
20776
20789
|
};
|
|
20777
20790
|
webidl.converters.BufferSource = function(V, prefix, argument, flags) {
|
|
20778
|
-
if (
|
|
20791
|
+
if (types.isArrayBuffer(V)) {
|
|
20779
20792
|
return webidl.converters.ArrayBuffer(V, prefix, argument, flags);
|
|
20780
20793
|
}
|
|
20781
|
-
if (
|
|
20794
|
+
if (types.isArrayBufferView(V)) {
|
|
20782
20795
|
flags &= ~webidl.attributes.AllowShared;
|
|
20783
20796
|
return webidl.converters.ArrayBufferView(V, prefix, argument, flags);
|
|
20784
20797
|
}
|
|
20785
|
-
if (
|
|
20798
|
+
if (types.isSharedArrayBuffer(V)) {
|
|
20786
20799
|
throw webidl.errors.exception({
|
|
20787
20800
|
header: prefix,
|
|
20788
20801
|
message: `${argument} cannot be a SharedArrayBuffer.`
|
|
@@ -20795,13 +20808,13 @@ var require_webidl = __commonJS2(function(exports, module) {
|
|
|
20795
20808
|
});
|
|
20796
20809
|
};
|
|
20797
20810
|
webidl.converters.AllowSharedBufferSource = function(V, prefix, argument, flags) {
|
|
20798
|
-
if (
|
|
20811
|
+
if (types.isArrayBuffer(V)) {
|
|
20799
20812
|
return webidl.converters.ArrayBuffer(V, prefix, argument, flags);
|
|
20800
20813
|
}
|
|
20801
|
-
if (
|
|
20814
|
+
if (types.isSharedArrayBuffer(V)) {
|
|
20802
20815
|
return webidl.converters.SharedArrayBuffer(V, prefix, argument, flags);
|
|
20803
20816
|
}
|
|
20804
|
-
if (
|
|
20817
|
+
if (types.isArrayBufferView(V)) {
|
|
20805
20818
|
flags |= webidl.attributes.AllowShared;
|
|
20806
20819
|
return webidl.converters.ArrayBufferView(V, prefix, argument, flags);
|
|
20807
20820
|
}
|
|
@@ -21637,12 +21650,12 @@ var require_formdata = __commonJS2(function(exports, module) {
|
|
|
21637
21650
|
value = webidl.converters.USVString(value);
|
|
21638
21651
|
}
|
|
21639
21652
|
const entry = makeEntry(name, value, filename);
|
|
21640
|
-
const idx = this.#state.findIndex((
|
|
21653
|
+
const idx = this.#state.findIndex((entry) => entry.name === name);
|
|
21641
21654
|
if (idx !== -1) {
|
|
21642
21655
|
this.#state = [
|
|
21643
21656
|
...this.#state.slice(0, idx),
|
|
21644
21657
|
entry,
|
|
21645
|
-
...this.#state.slice(idx + 1).filter((
|
|
21658
|
+
...this.#state.slice(idx + 1).filter((entry) => entry.name !== name)
|
|
21646
21659
|
];
|
|
21647
21660
|
} else {
|
|
21648
21661
|
this.#state.push(entry);
|
|
@@ -22045,20 +22058,20 @@ Content-Disposition: form-data`;
|
|
|
22045
22058
|
let hasUnknownSizeValue = false;
|
|
22046
22059
|
for (const [name, value] of object) {
|
|
22047
22060
|
if (typeof value === "string") {
|
|
22048
|
-
const
|
|
22061
|
+
const chunk = textEncoder.encode(prefix + `; name="${formdataEscape(normalizeLinefeeds(name))}"` + `\r
|
|
22049
22062
|
\r
|
|
22050
22063
|
${normalizeLinefeeds(value)}\r
|
|
22051
22064
|
`);
|
|
22052
|
-
blobParts.push(
|
|
22053
|
-
length +=
|
|
22065
|
+
blobParts.push(chunk);
|
|
22066
|
+
length += chunk.byteLength;
|
|
22054
22067
|
} else {
|
|
22055
|
-
const
|
|
22068
|
+
const chunk = textEncoder.encode(`${prefix}; name="${formdataEscape(normalizeLinefeeds(name))}"` + (value.name ? `; filename="${formdataEscape(value.name)}"` : "") + `\r
|
|
22056
22069
|
` + `Content-Type: ${value.type || "application/octet-stream"}\r
|
|
22057
22070
|
\r
|
|
22058
22071
|
`);
|
|
22059
|
-
blobParts.push(
|
|
22072
|
+
blobParts.push(chunk, value, rn);
|
|
22060
22073
|
if (typeof value.size === "number") {
|
|
22061
|
-
length +=
|
|
22074
|
+
length += chunk.byteLength + value.size + rn.byteLength;
|
|
22062
22075
|
} else {
|
|
22063
22076
|
hasUnknownSizeValue = true;
|
|
22064
22077
|
}
|
|
@@ -22187,8 +22200,8 @@ ${normalizeLinefeeds(value)}\r
|
|
|
22187
22200
|
case "application/x-www-form-urlencoded": {
|
|
22188
22201
|
const entries = new URLSearchParams(value.toString());
|
|
22189
22202
|
const fd = new FormData;
|
|
22190
|
-
for (const [name,
|
|
22191
|
-
fd.append(name,
|
|
22203
|
+
for (const [name, value] of entries) {
|
|
22204
|
+
fd.append(name, value);
|
|
22192
22205
|
}
|
|
22193
22206
|
return fd;
|
|
22194
22207
|
}
|
|
@@ -22919,8 +22932,8 @@ var require_client_h1 = __commonJS2(function(exports, module) {
|
|
|
22919
22932
|
if (body && typeof body.read === "function") {
|
|
22920
22933
|
body.read(0);
|
|
22921
22934
|
}
|
|
22922
|
-
const
|
|
22923
|
-
contentLength =
|
|
22935
|
+
const bodyLength2 = util.bodyLength(body);
|
|
22936
|
+
contentLength = bodyLength2 ?? contentLength;
|
|
22924
22937
|
if (contentLength === null) {
|
|
22925
22938
|
contentLength = request.contentLength;
|
|
22926
22939
|
}
|
|
@@ -23003,7 +23016,7 @@ upgrade: ${upgrade}\r
|
|
|
23003
23016
|
if (channels.sendHeaders.hasSubscribers) {
|
|
23004
23017
|
channels.sendHeaders.publish({ request, headers: header, socket });
|
|
23005
23018
|
}
|
|
23006
|
-
if (!body ||
|
|
23019
|
+
if (!body || bodyLength2 === 0) {
|
|
23007
23020
|
writeBuffer(abort, null, client, request, socket, contentLength, header, expectsPayload);
|
|
23008
23021
|
} else if (util.isBuffer(body)) {
|
|
23009
23022
|
writeBuffer(abort, body, client, request, socket, contentLength, header, expectsPayload);
|
|
@@ -23626,8 +23639,8 @@ var require_client_h2 = __commonJS2(function(exports, module) {
|
|
|
23626
23639
|
}
|
|
23627
23640
|
stream = session.request(headers, { endStream: false, signal });
|
|
23628
23641
|
stream[kHTTP2Stream] = true;
|
|
23629
|
-
stream.once("response", (
|
|
23630
|
-
const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } =
|
|
23642
|
+
stream.once("response", (headers, _flags) => {
|
|
23643
|
+
const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers;
|
|
23631
23644
|
request.onUpgrade(statusCode, parseH2Headers(realHeaders), stream);
|
|
23632
23645
|
++session[kOpenStreams];
|
|
23633
23646
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
@@ -23647,8 +23660,8 @@ var require_client_h2 = __commonJS2(function(exports, module) {
|
|
|
23647
23660
|
}
|
|
23648
23661
|
stream = session.request(headers, { endStream: false, signal });
|
|
23649
23662
|
stream[kHTTP2Stream] = true;
|
|
23650
|
-
stream.on("response", (
|
|
23651
|
-
const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } =
|
|
23663
|
+
stream.on("response", (headers) => {
|
|
23664
|
+
const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers;
|
|
23652
23665
|
request.onUpgrade(statusCode, parseH2Headers(realHeaders), stream);
|
|
23653
23666
|
++session[kOpenStreams];
|
|
23654
23667
|
client[kQueue][client[kRunningIdx]++] = null;
|
|
@@ -23717,8 +23730,8 @@ var require_client_h2 = __commonJS2(function(exports, module) {
|
|
|
23717
23730
|
}
|
|
23718
23731
|
++session[kOpenStreams];
|
|
23719
23732
|
stream.setTimeout(requestTimeout);
|
|
23720
|
-
stream.once("response", (
|
|
23721
|
-
const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } =
|
|
23733
|
+
stream.once("response", (headers) => {
|
|
23734
|
+
const { [HTTP2_HEADER_STATUS]: statusCode, ...realHeaders } = headers;
|
|
23722
23735
|
request.onResponseStarted();
|
|
23723
23736
|
if (request.aborted) {
|
|
23724
23737
|
stream.removeAllListeners("data");
|
|
@@ -23997,7 +24010,7 @@ var require_client = __commonJS2(function(exports, module) {
|
|
|
23997
24010
|
tls,
|
|
23998
24011
|
strictContentLength,
|
|
23999
24012
|
maxCachedSessions,
|
|
24000
|
-
connect
|
|
24013
|
+
connect,
|
|
24001
24014
|
maxRequestsPerClient,
|
|
24002
24015
|
localAddress,
|
|
24003
24016
|
maxResponseSize,
|
|
@@ -24052,7 +24065,7 @@ var require_client = __commonJS2(function(exports, module) {
|
|
|
24052
24065
|
if (bodyTimeout != null && (!Number.isInteger(bodyTimeout) || bodyTimeout < 0)) {
|
|
24053
24066
|
throw new InvalidArgumentError("bodyTimeout must be a positive integer or zero");
|
|
24054
24067
|
}
|
|
24055
|
-
if (
|
|
24068
|
+
if (connect != null && typeof connect !== "function" && typeof connect !== "object") {
|
|
24056
24069
|
throw new InvalidArgumentError("connect must be a function or an object");
|
|
24057
24070
|
}
|
|
24058
24071
|
if (maxRequestsPerClient != null && (!Number.isInteger(maxRequestsPerClient) || maxRequestsPerClient < 0)) {
|
|
@@ -24083,8 +24096,8 @@ var require_client = __commonJS2(function(exports, module) {
|
|
|
24083
24096
|
throw new InvalidArgumentError("connectionWindowSize must be a positive integer, greater than 0");
|
|
24084
24097
|
}
|
|
24085
24098
|
super();
|
|
24086
|
-
if (typeof
|
|
24087
|
-
|
|
24099
|
+
if (typeof connect !== "function") {
|
|
24100
|
+
connect = buildConnector({
|
|
24088
24101
|
...tls,
|
|
24089
24102
|
maxCachedSessions,
|
|
24090
24103
|
allowH2,
|
|
@@ -24092,11 +24105,11 @@ var require_client = __commonJS2(function(exports, module) {
|
|
|
24092
24105
|
socketPath,
|
|
24093
24106
|
timeout: connectTimeout,
|
|
24094
24107
|
...typeof autoSelectFamily === "boolean" ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : undefined,
|
|
24095
|
-
...
|
|
24108
|
+
...connect
|
|
24096
24109
|
});
|
|
24097
24110
|
}
|
|
24098
24111
|
this[kUrl] = util.parseOrigin(url);
|
|
24099
|
-
this[kConnector] =
|
|
24112
|
+
this[kConnector] = connect;
|
|
24100
24113
|
this[kPipelining] = pipelining != null ? pipelining : 1;
|
|
24101
24114
|
this[kMaxHeadersSize] = maxHeaderSize;
|
|
24102
24115
|
this[kKeepAliveDefaultTimeout] = keepAliveTimeout == null ? 4000 : keepAliveTimeout;
|
|
@@ -24259,9 +24272,9 @@ var require_client = __commonJS2(function(exports, module) {
|
|
|
24259
24272
|
assert(socket);
|
|
24260
24273
|
try {
|
|
24261
24274
|
client[kHTTPContext] = socket.alpnProtocol === "h2" ? connectH2(client, socket) : connectH1(client, socket);
|
|
24262
|
-
} catch (
|
|
24275
|
+
} catch (err) {
|
|
24263
24276
|
socket.destroy().on("error", noop);
|
|
24264
|
-
handleConnectError(client,
|
|
24277
|
+
handleConnectError(client, err, { host, hostname, protocol, port });
|
|
24265
24278
|
client[kResume]();
|
|
24266
24279
|
return;
|
|
24267
24280
|
}
|
|
@@ -24684,14 +24697,14 @@ var require_pool = __commonJS2(function(exports, module) {
|
|
|
24684
24697
|
this[kOptions] = { ...util.deepClone(options), connect, allowH2, clientTtl };
|
|
24685
24698
|
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : undefined;
|
|
24686
24699
|
this[kFactory] = factory;
|
|
24687
|
-
this.on("connect", (
|
|
24700
|
+
this.on("connect", (origin, targets) => {
|
|
24688
24701
|
if (clientTtl != null && clientTtl > 0) {
|
|
24689
24702
|
for (const target of targets) {
|
|
24690
24703
|
Object.assign(target, { ttl: Date.now() });
|
|
24691
24704
|
}
|
|
24692
24705
|
}
|
|
24693
24706
|
});
|
|
24694
|
-
this.on("connectionError", (
|
|
24707
|
+
this.on("connectionError", (origin, targets, error) => {
|
|
24695
24708
|
for (const target of targets) {
|
|
24696
24709
|
const idx = this[kClients].indexOf(target);
|
|
24697
24710
|
if (idx !== -1) {
|
|
@@ -24778,7 +24791,7 @@ var require_balanced_pool = __commonJS2(function(exports, module) {
|
|
|
24778
24791
|
}
|
|
24779
24792
|
addUpstream(upstream) {
|
|
24780
24793
|
const upstreamOrigin = parseOrigin(upstream).origin;
|
|
24781
|
-
if (this[kClients].find((
|
|
24794
|
+
if (this[kClients].find((pool) => pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true)) {
|
|
24782
24795
|
return this;
|
|
24783
24796
|
}
|
|
24784
24797
|
const pool = this[kFactory](upstreamOrigin, Object.assign({}, this[kOptions]));
|
|
@@ -24812,7 +24825,7 @@ var require_balanced_pool = __commonJS2(function(exports, module) {
|
|
|
24812
24825
|
}
|
|
24813
24826
|
removeUpstream(upstream) {
|
|
24814
24827
|
const upstreamOrigin = parseOrigin(upstream).origin;
|
|
24815
|
-
const pool = this[kClients].find((
|
|
24828
|
+
const pool = this[kClients].find((pool) => pool[kUrl].origin === upstreamOrigin && pool.closed !== true && pool.destroyed !== true);
|
|
24816
24829
|
if (pool) {
|
|
24817
24830
|
this[kRemoveClient](pool);
|
|
24818
24831
|
}
|
|
@@ -24829,7 +24842,7 @@ var require_balanced_pool = __commonJS2(function(exports, module) {
|
|
|
24829
24842
|
if (this[kClients].length === 0) {
|
|
24830
24843
|
throw new BalancedPoolMissingUpstreamError;
|
|
24831
24844
|
}
|
|
24832
|
-
const dispatcher = this[kClients].find((
|
|
24845
|
+
const dispatcher = this[kClients].find((dispatcher) => !dispatcher[kNeedDrain] && dispatcher.closed !== true && dispatcher.destroyed !== true);
|
|
24833
24846
|
if (!dispatcher) {
|
|
24834
24847
|
return;
|
|
24835
24848
|
}
|
|
@@ -24928,14 +24941,14 @@ var require_round_robin_pool = __commonJS2(function(exports, module) {
|
|
|
24928
24941
|
this[kOptions].interceptors = options.interceptors ? { ...options.interceptors } : undefined;
|
|
24929
24942
|
this[kFactory] = factory;
|
|
24930
24943
|
this[kIndex] = -1;
|
|
24931
|
-
this.on("connect", (
|
|
24944
|
+
this.on("connect", (origin, targets) => {
|
|
24932
24945
|
if (clientTtl != null && clientTtl > 0) {
|
|
24933
24946
|
for (const target of targets) {
|
|
24934
24947
|
Object.assign(target, { ttl: Date.now() });
|
|
24935
24948
|
}
|
|
24936
24949
|
}
|
|
24937
24950
|
});
|
|
24938
|
-
this.on("connectionError", (
|
|
24951
|
+
this.on("connectionError", (origin, targets, error) => {
|
|
24939
24952
|
for (const target of targets) {
|
|
24940
24953
|
const idx = this[kClients].indexOf(target);
|
|
24941
24954
|
if (idx !== -1) {
|
|
@@ -25046,21 +25059,21 @@ var require_agent = __commonJS2(function(exports, module) {
|
|
|
25046
25059
|
let dispatcher = result && result.dispatcher;
|
|
25047
25060
|
if (!dispatcher) {
|
|
25048
25061
|
const closeClientIfUnused = (connected) => {
|
|
25049
|
-
const
|
|
25050
|
-
if (
|
|
25062
|
+
const result = this[kClients].get(key);
|
|
25063
|
+
if (result) {
|
|
25051
25064
|
if (connected)
|
|
25052
|
-
|
|
25053
|
-
if (
|
|
25065
|
+
result.count -= 1;
|
|
25066
|
+
if (result.count <= 0) {
|
|
25054
25067
|
this[kClients].delete(key);
|
|
25055
|
-
|
|
25068
|
+
result.dispatcher.close();
|
|
25056
25069
|
}
|
|
25057
25070
|
this[kOrigins].delete(key);
|
|
25058
25071
|
}
|
|
25059
25072
|
};
|
|
25060
25073
|
dispatcher = this[kFactory](opts.origin, this[kOptions]).on("drain", this[kOnDrain]).on("connect", (origin, targets) => {
|
|
25061
|
-
const
|
|
25062
|
-
if (
|
|
25063
|
-
|
|
25074
|
+
const result = this[kClients].get(key);
|
|
25075
|
+
if (result) {
|
|
25076
|
+
result.count += 1;
|
|
25064
25077
|
}
|
|
25065
25078
|
this[kOnConnect](origin, targets);
|
|
25066
25079
|
}).on("disconnect", (origin, targets, err) => {
|
|
@@ -25210,36 +25223,36 @@ var require_proxy_agent = __commonJS2(function(exports, module) {
|
|
|
25210
25223
|
const connect = buildConnector({ ...opts.proxyTls });
|
|
25211
25224
|
this[kConnectEndpoint] = buildConnector({ ...opts.requestTls });
|
|
25212
25225
|
const agentFactory = opts.factory || defaultAgentFactory;
|
|
25213
|
-
const factory = (
|
|
25214
|
-
const { protocol
|
|
25215
|
-
if (!this[kTunnelProxy] &&
|
|
25226
|
+
const factory = (origin, options) => {
|
|
25227
|
+
const { protocol } = new URL(origin);
|
|
25228
|
+
if (!this[kTunnelProxy] && protocol === "http:" && this[kProxy].protocol === "http:") {
|
|
25216
25229
|
return new Http1ProxyWrapper(this[kProxy].uri, {
|
|
25217
25230
|
headers: this[kProxyHeaders],
|
|
25218
25231
|
connect,
|
|
25219
25232
|
factory: agentFactory
|
|
25220
25233
|
});
|
|
25221
25234
|
}
|
|
25222
|
-
return agentFactory(
|
|
25235
|
+
return agentFactory(origin, options);
|
|
25223
25236
|
};
|
|
25224
25237
|
this[kClient] = clientFactory(url, { connect });
|
|
25225
25238
|
this[kAgent] = new Agent({
|
|
25226
25239
|
...opts,
|
|
25227
25240
|
factory,
|
|
25228
|
-
connect: async (
|
|
25229
|
-
let requestedPath =
|
|
25230
|
-
if (!
|
|
25231
|
-
requestedPath += `:${defaultProtocolPort(
|
|
25241
|
+
connect: async (opts, callback) => {
|
|
25242
|
+
let requestedPath = opts.host;
|
|
25243
|
+
if (!opts.port) {
|
|
25244
|
+
requestedPath += `:${defaultProtocolPort(opts.protocol)}`;
|
|
25232
25245
|
}
|
|
25233
25246
|
try {
|
|
25234
25247
|
const connectParams = {
|
|
25235
25248
|
origin,
|
|
25236
25249
|
port,
|
|
25237
25250
|
path: requestedPath,
|
|
25238
|
-
signal:
|
|
25251
|
+
signal: opts.signal,
|
|
25239
25252
|
headers: {
|
|
25240
25253
|
...this[kProxyHeaders],
|
|
25241
|
-
host:
|
|
25242
|
-
...
|
|
25254
|
+
host: opts.host,
|
|
25255
|
+
...opts.connections == null || opts.connections > 0 ? { "proxy-connection": "keep-alive" } : {}
|
|
25243
25256
|
},
|
|
25244
25257
|
servername: this[kProxyTls]?.servername || proxyHostname
|
|
25245
25258
|
};
|
|
@@ -25255,7 +25268,7 @@ var require_proxy_agent = __commonJS2(function(exports, module) {
|
|
|
25255
25268
|
connectParams
|
|
25256
25269
|
});
|
|
25257
25270
|
}
|
|
25258
|
-
if (
|
|
25271
|
+
if (opts.protocol !== "https:") {
|
|
25259
25272
|
callback(null, socket);
|
|
25260
25273
|
return;
|
|
25261
25274
|
}
|
|
@@ -25263,9 +25276,9 @@ var require_proxy_agent = __commonJS2(function(exports, module) {
|
|
|
25263
25276
|
if (this[kRequestTls]) {
|
|
25264
25277
|
servername = this[kRequestTls].servername;
|
|
25265
25278
|
} else {
|
|
25266
|
-
servername =
|
|
25279
|
+
servername = opts.servername;
|
|
25267
25280
|
}
|
|
25268
|
-
this[kConnectEndpoint]({ ...
|
|
25281
|
+
this[kConnectEndpoint]({ ...opts, servername, httpSocket: socket }, callback);
|
|
25269
25282
|
} catch (err) {
|
|
25270
25283
|
if (err.code === "ERR_TLS_CERT_ALTNAME_INVALID") {
|
|
25271
25284
|
callback(new SecureProxyConnectionError(err));
|
|
@@ -25988,31 +26001,31 @@ var require_readable = __commonJS2(function(exports, module) {
|
|
|
25988
26001
|
}
|
|
25989
26002
|
});
|
|
25990
26003
|
}
|
|
25991
|
-
function consumeStart(
|
|
25992
|
-
if (
|
|
26004
|
+
function consumeStart(consume) {
|
|
26005
|
+
if (consume.body === null) {
|
|
25993
26006
|
return;
|
|
25994
26007
|
}
|
|
25995
|
-
const { _readableState: state } =
|
|
26008
|
+
const { _readableState: state } = consume.stream;
|
|
25996
26009
|
if (state.bufferIndex) {
|
|
25997
26010
|
const start = state.bufferIndex;
|
|
25998
26011
|
const end = state.buffer.length;
|
|
25999
26012
|
for (let n = start;n < end; n++) {
|
|
26000
|
-
consumePush(
|
|
26013
|
+
consumePush(consume, state.buffer[n]);
|
|
26001
26014
|
}
|
|
26002
26015
|
} else {
|
|
26003
26016
|
for (const chunk of state.buffer) {
|
|
26004
|
-
consumePush(
|
|
26017
|
+
consumePush(consume, chunk);
|
|
26005
26018
|
}
|
|
26006
26019
|
}
|
|
26007
26020
|
if (state.endEmitted) {
|
|
26008
26021
|
consumeEnd(this[kConsume], this._readableState.encoding);
|
|
26009
26022
|
} else {
|
|
26010
|
-
|
|
26023
|
+
consume.stream.on("end", function() {
|
|
26011
26024
|
consumeEnd(this[kConsume], this._readableState.encoding);
|
|
26012
26025
|
});
|
|
26013
26026
|
}
|
|
26014
|
-
|
|
26015
|
-
while (
|
|
26027
|
+
consume.stream.resume();
|
|
26028
|
+
while (consume.stream.read() != null) {}
|
|
26016
26029
|
}
|
|
26017
26030
|
function chunksDecode(chunks, length, encoding) {
|
|
26018
26031
|
if (chunks.length === 0 || length === 0) {
|
|
@@ -26043,8 +26056,8 @@ var require_readable = __commonJS2(function(exports, module) {
|
|
|
26043
26056
|
}
|
|
26044
26057
|
return buffer;
|
|
26045
26058
|
}
|
|
26046
|
-
function consumeEnd(
|
|
26047
|
-
const { type, body, resolve, stream, length } =
|
|
26059
|
+
function consumeEnd(consume, encoding) {
|
|
26060
|
+
const { type, body, resolve, stream, length } = consume;
|
|
26048
26061
|
try {
|
|
26049
26062
|
if (type === "text") {
|
|
26050
26063
|
resolve(chunksDecode(body, length, encoding));
|
|
@@ -26057,30 +26070,30 @@ var require_readable = __commonJS2(function(exports, module) {
|
|
|
26057
26070
|
} else if (type === "bytes") {
|
|
26058
26071
|
resolve(chunksConcat(body, length));
|
|
26059
26072
|
}
|
|
26060
|
-
consumeFinish(
|
|
26073
|
+
consumeFinish(consume);
|
|
26061
26074
|
} catch (err) {
|
|
26062
26075
|
stream.destroy(err);
|
|
26063
26076
|
}
|
|
26064
26077
|
}
|
|
26065
|
-
function consumePush(
|
|
26066
|
-
|
|
26067
|
-
|
|
26078
|
+
function consumePush(consume, chunk) {
|
|
26079
|
+
consume.length += chunk.length;
|
|
26080
|
+
consume.body.push(chunk);
|
|
26068
26081
|
}
|
|
26069
|
-
function consumeFinish(
|
|
26070
|
-
if (
|
|
26082
|
+
function consumeFinish(consume, err) {
|
|
26083
|
+
if (consume.body === null) {
|
|
26071
26084
|
return;
|
|
26072
26085
|
}
|
|
26073
26086
|
if (err) {
|
|
26074
|
-
|
|
26087
|
+
consume.reject(err);
|
|
26075
26088
|
} else {
|
|
26076
|
-
|
|
26089
|
+
consume.resolve();
|
|
26077
26090
|
}
|
|
26078
|
-
|
|
26079
|
-
|
|
26080
|
-
|
|
26081
|
-
|
|
26082
|
-
|
|
26083
|
-
|
|
26091
|
+
consume.type = null;
|
|
26092
|
+
consume.stream = null;
|
|
26093
|
+
consume.resolve = null;
|
|
26094
|
+
consume.reject = null;
|
|
26095
|
+
consume.length = 0;
|
|
26096
|
+
consume.body = null;
|
|
26084
26097
|
}
|
|
26085
26098
|
module.exports = {
|
|
26086
26099
|
Readable: BodyReadable,
|
|
@@ -26393,13 +26406,13 @@ var require_api_stream = __commonJS2(function(exports, module) {
|
|
|
26393
26406
|
throw new InvalidReturnValueError("expected Writable");
|
|
26394
26407
|
}
|
|
26395
26408
|
finished(res, { readable: false }, (err) => {
|
|
26396
|
-
const { callback, res
|
|
26409
|
+
const { callback, res, opaque, trailers, abort } = this;
|
|
26397
26410
|
this.res = null;
|
|
26398
|
-
if (err || !
|
|
26399
|
-
util.destroy(
|
|
26411
|
+
if (err || !res?.readable) {
|
|
26412
|
+
util.destroy(res, err);
|
|
26400
26413
|
}
|
|
26401
26414
|
this.callback = null;
|
|
26402
|
-
this.runInAsyncScope(callback, null, err || null, { opaque
|
|
26415
|
+
this.runInAsyncScope(callback, null, err || null, { opaque, trailers });
|
|
26403
26416
|
if (err) {
|
|
26404
26417
|
abort();
|
|
26405
26418
|
}
|
|
@@ -26617,9 +26630,9 @@ var require_api_pipeline = __commonJS2(function(exports, module) {
|
|
|
26617
26630
|
throw new InvalidReturnValueError("expected Readable");
|
|
26618
26631
|
}
|
|
26619
26632
|
body.on("data", (chunk) => {
|
|
26620
|
-
const { ret, body
|
|
26621
|
-
if (!ret.push(chunk) &&
|
|
26622
|
-
|
|
26633
|
+
const { ret, body } = this;
|
|
26634
|
+
if (!ret.push(chunk) && body.pause) {
|
|
26635
|
+
body.pause();
|
|
26623
26636
|
}
|
|
26624
26637
|
}).on("error", (err) => {
|
|
26625
26638
|
const { ret } = this;
|
|
@@ -26953,20 +26966,20 @@ var require_mock_utils = __commonJS2(function(exports, module) {
|
|
|
26953
26966
|
}
|
|
26954
26967
|
return Object.fromEntries(entries);
|
|
26955
26968
|
}
|
|
26956
|
-
function matchHeaders(
|
|
26957
|
-
if (typeof
|
|
26969
|
+
function matchHeaders(mockDispatch, headers) {
|
|
26970
|
+
if (typeof mockDispatch.headers === "function") {
|
|
26958
26971
|
if (Array.isArray(headers)) {
|
|
26959
26972
|
headers = buildHeadersFromArray(headers);
|
|
26960
26973
|
}
|
|
26961
|
-
return
|
|
26974
|
+
return mockDispatch.headers(headers ? lowerCaseEntries(headers) : {});
|
|
26962
26975
|
}
|
|
26963
|
-
if (typeof
|
|
26976
|
+
if (typeof mockDispatch.headers === "undefined") {
|
|
26964
26977
|
return true;
|
|
26965
26978
|
}
|
|
26966
|
-
if (typeof headers !== "object" || typeof
|
|
26979
|
+
if (typeof headers !== "object" || typeof mockDispatch.headers !== "object") {
|
|
26967
26980
|
return false;
|
|
26968
26981
|
}
|
|
26969
|
-
for (const [matchHeaderName, matchHeaderValue] of Object.entries(
|
|
26982
|
+
for (const [matchHeaderName, matchHeaderValue] of Object.entries(mockDispatch.headers)) {
|
|
26970
26983
|
const headerValue = getHeaderByName(headers, matchHeaderName);
|
|
26971
26984
|
if (!matchValue(matchHeaderValue, headerValue)) {
|
|
26972
26985
|
return false;
|
|
@@ -27010,11 +27023,11 @@ var require_mock_utils = __commonJS2(function(exports, module) {
|
|
|
27010
27023
|
qp.sort();
|
|
27011
27024
|
return [...pathSegments, qp.toString()].join("?");
|
|
27012
27025
|
}
|
|
27013
|
-
function matchKey(
|
|
27014
|
-
const pathMatch = matchValue(
|
|
27015
|
-
const methodMatch = matchValue(
|
|
27016
|
-
const bodyMatch = typeof
|
|
27017
|
-
const headersMatch = matchHeaders(
|
|
27026
|
+
function matchKey(mockDispatch, { path, method, body, headers }) {
|
|
27027
|
+
const pathMatch = matchValue(mockDispatch.path, path);
|
|
27028
|
+
const methodMatch = matchValue(mockDispatch.method, method);
|
|
27029
|
+
const bodyMatch = typeof mockDispatch.body !== "undefined" ? matchValue(mockDispatch.body, body) : true;
|
|
27030
|
+
const headersMatch = matchHeaders(mockDispatch, headers);
|
|
27018
27031
|
return pathMatch && methodMatch && bodyMatch && headersMatch;
|
|
27019
27032
|
}
|
|
27020
27033
|
function getResponseData(data) {
|
|
@@ -27050,7 +27063,7 @@ var require_mock_utils = __commonJS2(function(exports, module) {
|
|
|
27050
27063
|
if (matchedMockDispatches.length === 0) {
|
|
27051
27064
|
throw new MockNotMatchedError(`Mock dispatch not matched for body '${key.body}' on path '${resolvedPath}'`);
|
|
27052
27065
|
}
|
|
27053
|
-
matchedMockDispatches = matchedMockDispatches.filter((
|
|
27066
|
+
matchedMockDispatches = matchedMockDispatches.filter((mockDispatch) => matchHeaders(mockDispatch, key.headers));
|
|
27054
27067
|
if (matchedMockDispatches.length === 0) {
|
|
27055
27068
|
const headers = typeof key.headers === "object" ? JSON.stringify(key.headers) : key.headers;
|
|
27056
27069
|
throw new MockNotMatchedError(`Mock dispatch not matched for headers '${headers}' on path '${resolvedPath}'`);
|
|
@@ -27123,15 +27136,15 @@ var require_mock_utils = __commonJS2(function(exports, module) {
|
|
|
27123
27136
|
}
|
|
27124
27137
|
function mockDispatch(opts, handler) {
|
|
27125
27138
|
const key = buildKey(opts);
|
|
27126
|
-
const
|
|
27127
|
-
|
|
27128
|
-
if (
|
|
27129
|
-
|
|
27130
|
-
}
|
|
27131
|
-
const { data: { statusCode, data, headers, trailers, error }, delay, persist } =
|
|
27132
|
-
const { timesInvoked, times } =
|
|
27133
|
-
|
|
27134
|
-
|
|
27139
|
+
const mockDispatch = getMockDispatch(this[kDispatches], key);
|
|
27140
|
+
mockDispatch.timesInvoked++;
|
|
27141
|
+
if (mockDispatch.data.callback) {
|
|
27142
|
+
mockDispatch.data = { ...mockDispatch.data, ...mockDispatch.data.callback(opts) };
|
|
27143
|
+
}
|
|
27144
|
+
const { data: { statusCode, data, headers, trailers, error }, delay, persist } = mockDispatch;
|
|
27145
|
+
const { timesInvoked, times } = mockDispatch;
|
|
27146
|
+
mockDispatch.consumed = !persist && timesInvoked >= times;
|
|
27147
|
+
mockDispatch.pending = timesInvoked < times;
|
|
27135
27148
|
if (error !== null) {
|
|
27136
27149
|
deleteMockDispatch(this[kDispatches], key);
|
|
27137
27150
|
handler.onError(error);
|
|
@@ -27330,14 +27343,14 @@ var require_mock_interceptor = __commonJS2(function(exports, module) {
|
|
|
27330
27343
|
if (typeof resolvedData !== "object" || resolvedData === null) {
|
|
27331
27344
|
throw new InvalidArgumentError("reply options callback must return an object");
|
|
27332
27345
|
}
|
|
27333
|
-
const
|
|
27334
|
-
this.validateReplyParameters(
|
|
27346
|
+
const replyParameters = { data: "", responseOptions: {}, ...resolvedData };
|
|
27347
|
+
this.validateReplyParameters(replyParameters);
|
|
27335
27348
|
return {
|
|
27336
|
-
...this.createMockScopeDispatchData(
|
|
27349
|
+
...this.createMockScopeDispatchData(replyParameters)
|
|
27337
27350
|
};
|
|
27338
27351
|
};
|
|
27339
|
-
const
|
|
27340
|
-
return new MockScope(
|
|
27352
|
+
const newMockDispatch = addMockDispatch(this[kDispatches], this[kDispatchKey], wrappedDefaultsCallback, { ignoreTrailingSlash: this[kIgnoreTrailingSlash] });
|
|
27353
|
+
return new MockScope(newMockDispatch);
|
|
27341
27354
|
}
|
|
27342
27355
|
const replyParameters = {
|
|
27343
27356
|
statusCode: replyOptionsCallbackOrStatusCode,
|
|
@@ -27855,11 +27868,11 @@ var require_mock_agent = __commonJS2(function(exports, module) {
|
|
|
27855
27868
|
this[kMockAgentSet](origin, dispatcher);
|
|
27856
27869
|
return dispatcher;
|
|
27857
27870
|
}
|
|
27858
|
-
for (const [keyMatcher,
|
|
27859
|
-
if (
|
|
27871
|
+
for (const [keyMatcher, result] of Array.from(this[kClients])) {
|
|
27872
|
+
if (result && typeof keyMatcher !== "string" && matchValue(keyMatcher, origin)) {
|
|
27860
27873
|
const dispatcher = this[kFactory](origin);
|
|
27861
27874
|
this[kMockAgentSet](origin, dispatcher);
|
|
27862
|
-
dispatcher[kDispatches] =
|
|
27875
|
+
dispatcher[kDispatches] = result.dispatcher[kDispatches];
|
|
27863
27876
|
return dispatcher;
|
|
27864
27877
|
}
|
|
27865
27878
|
}
|
|
@@ -28881,7 +28894,7 @@ var require_dump = __commonJS2(function(exports, module) {
|
|
|
28881
28894
|
module.exports = createDumpInterceptor;
|
|
28882
28895
|
});
|
|
28883
28896
|
var require_dns = __commonJS2(function(exports, module) {
|
|
28884
|
-
var { isIP
|
|
28897
|
+
var { isIP } = __require2("node:net");
|
|
28885
28898
|
var { lookup } = __require2("node:dns");
|
|
28886
28899
|
var DecoratorHandler = require_decorator_handler();
|
|
28887
28900
|
var { InvalidArgumentError, InformationalError } = require_errors3();
|
|
@@ -29188,7 +29201,7 @@ var require_dns = __commonJS2(function(exports, module) {
|
|
|
29188
29201
|
return (dispatch) => {
|
|
29189
29202
|
return function dnsInterceptor(origDispatchOpts, handler) {
|
|
29190
29203
|
const origin = origDispatchOpts.origin.constructor === URL ? origDispatchOpts.origin : new URL(origDispatchOpts.origin);
|
|
29191
|
-
if (
|
|
29204
|
+
if (isIP(origin.hostname) !== 0) {
|
|
29192
29205
|
return dispatch(origDispatchOpts, handler);
|
|
29193
29206
|
}
|
|
29194
29207
|
instance.runLookup(origin, origDispatchOpts, (err, newOrigin) => {
|
|
@@ -30373,13 +30386,13 @@ var require_memory_cache_store = __commonJS2(function(exports, module) {
|
|
|
30373
30386
|
});
|
|
30374
30387
|
store.#hasEmittedMaxSizeEvent = true;
|
|
30375
30388
|
}
|
|
30376
|
-
for (const [
|
|
30377
|
-
for (const
|
|
30378
|
-
store.#size -=
|
|
30389
|
+
for (const [key, entries] of store.#entries) {
|
|
30390
|
+
for (const entry of entries.splice(0, entries.length / 2)) {
|
|
30391
|
+
store.#size -= entry.size;
|
|
30379
30392
|
store.#count -= 1;
|
|
30380
30393
|
}
|
|
30381
|
-
if (
|
|
30382
|
-
store.#entries.delete(
|
|
30394
|
+
if (entries.length === 0) {
|
|
30395
|
+
store.#entries.delete(key);
|
|
30383
30396
|
}
|
|
30384
30397
|
}
|
|
30385
30398
|
if (store.#size < store.#maxSize && store.#count < store.#maxCount) {
|
|
@@ -30566,7 +30579,7 @@ var require_cache2 = __commonJS2(function(exports, module) {
|
|
|
30566
30579
|
}
|
|
30567
30580
|
return dispatch(opts, new CacheHandler(globalOpts, cacheKey, handler));
|
|
30568
30581
|
}
|
|
30569
|
-
function sendCachedValue(handler, opts, result, age, context,
|
|
30582
|
+
function sendCachedValue(handler, opts, result, age, context, isStale) {
|
|
30570
30583
|
const stream = util.isStream(result.body) ? result.body : Readable.from(result.body ?? []);
|
|
30571
30584
|
assert(!stream.destroyed, "stream should not be destroyed");
|
|
30572
30585
|
assert(!stream.readableDidRead, "stream should not be readableDidRead");
|
|
@@ -30608,7 +30621,7 @@ var require_cache2 = __commonJS2(function(exports, module) {
|
|
|
30608
30621
|
return;
|
|
30609
30622
|
}
|
|
30610
30623
|
const headers = { ...result.headers, age: String(age) };
|
|
30611
|
-
if (
|
|
30624
|
+
if (isStale) {
|
|
30612
30625
|
headers.warning = '110 - "response is stale"';
|
|
30613
30626
|
}
|
|
30614
30627
|
handler.onResponseStart?.(controller, result.statusCode, headers, result.statusMessage);
|
|
@@ -30641,22 +30654,22 @@ var require_cache2 = __commonJS2(function(exports, module) {
|
|
|
30641
30654
|
if (!revalidate && withinStaleWhileRevalidateWindow(result)) {
|
|
30642
30655
|
sendCachedValue(handler, opts, result, age, null, true);
|
|
30643
30656
|
queueMicrotask(() => {
|
|
30644
|
-
let
|
|
30657
|
+
let headers = {
|
|
30645
30658
|
...opts.headers,
|
|
30646
30659
|
"if-modified-since": new Date(result.cachedAt).toUTCString()
|
|
30647
30660
|
};
|
|
30648
30661
|
if (result.etag) {
|
|
30649
|
-
|
|
30662
|
+
headers["if-none-match"] = result.etag;
|
|
30650
30663
|
}
|
|
30651
30664
|
if (result.vary) {
|
|
30652
|
-
|
|
30653
|
-
...
|
|
30665
|
+
headers = {
|
|
30666
|
+
...headers,
|
|
30654
30667
|
...result.vary
|
|
30655
30668
|
};
|
|
30656
30669
|
}
|
|
30657
30670
|
dispatch({
|
|
30658
30671
|
...opts,
|
|
30659
|
-
headers
|
|
30672
|
+
headers
|
|
30660
30673
|
}, new CacheHandler(globalOpts, cacheKey, {
|
|
30661
30674
|
onRequestStart() {},
|
|
30662
30675
|
onRequestUpgrade() {},
|
|
@@ -30730,12 +30743,12 @@ var require_cache2 = __commonJS2(function(exports, module) {
|
|
|
30730
30743
|
};
|
|
30731
30744
|
const safeMethodsToNotCache = util.safeHTTPMethods.filter((method) => methods.includes(method) === false);
|
|
30732
30745
|
return (dispatch) => {
|
|
30733
|
-
return (
|
|
30734
|
-
if (!
|
|
30735
|
-
return dispatch(
|
|
30746
|
+
return (opts, handler) => {
|
|
30747
|
+
if (!opts.origin || safeMethodsToNotCache.includes(opts.method)) {
|
|
30748
|
+
return dispatch(opts, handler);
|
|
30736
30749
|
}
|
|
30737
30750
|
if (origins !== undefined) {
|
|
30738
|
-
const requestOrigin =
|
|
30751
|
+
const requestOrigin = opts.origin.toString().toLowerCase();
|
|
30739
30752
|
let isAllowed = false;
|
|
30740
30753
|
for (let i = 0;i < origins.length; i++) {
|
|
30741
30754
|
const allowed = origins[i];
|
|
@@ -30750,23 +30763,23 @@ var require_cache2 = __commonJS2(function(exports, module) {
|
|
|
30750
30763
|
}
|
|
30751
30764
|
}
|
|
30752
30765
|
if (!isAllowed) {
|
|
30753
|
-
return dispatch(
|
|
30766
|
+
return dispatch(opts, handler);
|
|
30754
30767
|
}
|
|
30755
30768
|
}
|
|
30756
|
-
|
|
30757
|
-
...
|
|
30758
|
-
headers: normalizeHeaders(
|
|
30769
|
+
opts = {
|
|
30770
|
+
...opts,
|
|
30771
|
+
headers: normalizeHeaders(opts)
|
|
30759
30772
|
};
|
|
30760
|
-
const reqCacheControl =
|
|
30773
|
+
const reqCacheControl = opts.headers?.["cache-control"] ? parseCacheControlHeader(opts.headers["cache-control"]) : undefined;
|
|
30761
30774
|
if (reqCacheControl?.["no-store"]) {
|
|
30762
|
-
return dispatch(
|
|
30775
|
+
return dispatch(opts, handler);
|
|
30763
30776
|
}
|
|
30764
|
-
const cacheKey = makeCacheKey(
|
|
30777
|
+
const cacheKey = makeCacheKey(opts);
|
|
30765
30778
|
const result = store.get(cacheKey);
|
|
30766
30779
|
if (result && typeof result.then === "function") {
|
|
30767
|
-
return result.then((
|
|
30780
|
+
return result.then((result) => handleResult(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl, result));
|
|
30768
30781
|
} else {
|
|
30769
|
-
return handleResult(dispatch, globalOpts, cacheKey, handler,
|
|
30782
|
+
return handleResult(dispatch, globalOpts, cacheKey, handler, opts, reqCacheControl, result);
|
|
30770
30783
|
}
|
|
30771
30784
|
};
|
|
30772
30785
|
};
|
|
@@ -31064,22 +31077,22 @@ var require_deduplicate = __commonJS2(function(exports, module) {
|
|
|
31064
31077
|
const safeMethodsToNotDeduplicate = util.safeHTTPMethods.filter((method) => methods.includes(method) === false);
|
|
31065
31078
|
const pendingRequests = new Map;
|
|
31066
31079
|
return (dispatch) => {
|
|
31067
|
-
return (
|
|
31068
|
-
if (!
|
|
31069
|
-
return dispatch(
|
|
31080
|
+
return (opts, handler) => {
|
|
31081
|
+
if (!opts.origin || safeMethodsToNotDeduplicate.includes(opts.method)) {
|
|
31082
|
+
return dispatch(opts, handler);
|
|
31070
31083
|
}
|
|
31071
|
-
|
|
31072
|
-
...
|
|
31073
|
-
headers: normalizeHeaders(
|
|
31084
|
+
opts = {
|
|
31085
|
+
...opts,
|
|
31086
|
+
headers: normalizeHeaders(opts)
|
|
31074
31087
|
};
|
|
31075
31088
|
if (skipHeaderNamesSet.size > 0) {
|
|
31076
|
-
for (const headerName of Object.keys(
|
|
31089
|
+
for (const headerName of Object.keys(opts.headers)) {
|
|
31077
31090
|
if (skipHeaderNamesSet.has(headerName.toLowerCase())) {
|
|
31078
|
-
return dispatch(
|
|
31091
|
+
return dispatch(opts, handler);
|
|
31079
31092
|
}
|
|
31080
31093
|
}
|
|
31081
31094
|
}
|
|
31082
|
-
const cacheKey = makeCacheKey(
|
|
31095
|
+
const cacheKey = makeCacheKey(opts);
|
|
31083
31096
|
const dedupeKey = makeDeduplicationKey(cacheKey, excludeHeaderNamesSet);
|
|
31084
31097
|
const pendingHandler = pendingRequests.get(dedupeKey);
|
|
31085
31098
|
if (pendingHandler) {
|
|
@@ -31096,7 +31109,7 @@ var require_deduplicate = __commonJS2(function(exports, module) {
|
|
|
31096
31109
|
if (pendingRequestsChannel.hasSubscribers) {
|
|
31097
31110
|
pendingRequestsChannel.publish({ size: pendingRequests.size, key: dedupeKey, type: "added" });
|
|
31098
31111
|
}
|
|
31099
|
-
return dispatch(
|
|
31112
|
+
return dispatch(opts, deduplicationHandler);
|
|
31100
31113
|
};
|
|
31101
31114
|
};
|
|
31102
31115
|
};
|
|
@@ -32869,11 +32882,11 @@ var require_subresource_integrity = __commonJS2(function(exports, module) {
|
|
|
32869
32882
|
if (algorithmAndValue[1]) {
|
|
32870
32883
|
base64Value = algorithmAndValue[1];
|
|
32871
32884
|
}
|
|
32872
|
-
const
|
|
32885
|
+
const metadata = {
|
|
32873
32886
|
alg: algorithm,
|
|
32874
32887
|
val: base64Value
|
|
32875
32888
|
};
|
|
32876
|
-
result.push(
|
|
32889
|
+
result.push(metadata);
|
|
32877
32890
|
}
|
|
32878
32891
|
return result;
|
|
32879
32892
|
}
|
|
@@ -34263,8 +34276,8 @@ var require_cache3 = __commonJS2(function(exports, module) {
|
|
|
34263
34276
|
}
|
|
34264
34277
|
queueMicrotask(() => {
|
|
34265
34278
|
const requestList = [];
|
|
34266
|
-
for (const
|
|
34267
|
-
const requestObject = fromInnerRequest(
|
|
34279
|
+
for (const request of requests) {
|
|
34280
|
+
const requestObject = fromInnerRequest(request, undefined, new AbortController().signal, "immutable");
|
|
34268
34281
|
requestList.push(requestObject);
|
|
34269
34282
|
}
|
|
34270
34283
|
promise.resolve(Object.freeze(requestList));
|
|
@@ -34511,8 +34524,8 @@ var require_cachestorage = __commonJS2(function(exports, module) {
|
|
|
34511
34524
|
webidl.argumentLengthCheck(arguments, 1, prefix);
|
|
34512
34525
|
cacheName = webidl.converters.DOMString(cacheName, prefix, "cacheName");
|
|
34513
34526
|
if (this.#caches.has(cacheName)) {
|
|
34514
|
-
const
|
|
34515
|
-
return new Cache(kConstruct,
|
|
34527
|
+
const cache = this.#caches.get(cacheName);
|
|
34528
|
+
return new Cache(kConstruct, cache);
|
|
34516
34529
|
}
|
|
34517
34530
|
const cache = [];
|
|
34518
34531
|
this.#caches.set(cacheName, cache);
|
|
@@ -35410,11 +35423,11 @@ var require_frame = __commonJS2(function(exports, module) {
|
|
|
35410
35423
|
var BUFFER_SIZE = 8 * 1024;
|
|
35411
35424
|
var buffer = null;
|
|
35412
35425
|
var bufIdx = BUFFER_SIZE;
|
|
35413
|
-
var randomFillSync = runtimeFeatures.has("crypto") ? __require2("node:crypto").randomFillSync : function
|
|
35414
|
-
for (let i = 0;i <
|
|
35415
|
-
|
|
35426
|
+
var randomFillSync = runtimeFeatures.has("crypto") ? __require2("node:crypto").randomFillSync : function randomFillSync(buffer, _offset, _size) {
|
|
35427
|
+
for (let i = 0;i < buffer.length; ++i) {
|
|
35428
|
+
buffer[i] = Math.random() * 255 | 0;
|
|
35416
35429
|
}
|
|
35417
|
-
return
|
|
35430
|
+
return buffer;
|
|
35418
35431
|
};
|
|
35419
35432
|
function generateMask() {
|
|
35420
35433
|
if (bufIdx === BUFFER_SIZE) {
|
|
@@ -35441,33 +35454,33 @@ var require_frame = __commonJS2(function(exports, module) {
|
|
|
35441
35454
|
offset += 2;
|
|
35442
35455
|
payloadLength = 126;
|
|
35443
35456
|
}
|
|
35444
|
-
const
|
|
35445
|
-
|
|
35446
|
-
|
|
35447
|
-
|
|
35457
|
+
const buffer = Buffer.allocUnsafe(bodyLength + offset);
|
|
35458
|
+
buffer[0] = buffer[1] = 0;
|
|
35459
|
+
buffer[0] |= 128;
|
|
35460
|
+
buffer[0] = (buffer[0] & 240) + opcode;
|
|
35448
35461
|
/*! ws. MIT License. Einar Otto Stangvik <einaros@gmail.com> */
|
|
35449
|
-
|
|
35450
|
-
|
|
35451
|
-
|
|
35452
|
-
|
|
35453
|
-
|
|
35462
|
+
buffer[offset - 4] = maskKey[0];
|
|
35463
|
+
buffer[offset - 3] = maskKey[1];
|
|
35464
|
+
buffer[offset - 2] = maskKey[2];
|
|
35465
|
+
buffer[offset - 1] = maskKey[3];
|
|
35466
|
+
buffer[1] = payloadLength;
|
|
35454
35467
|
if (payloadLength === 126) {
|
|
35455
|
-
|
|
35468
|
+
buffer.writeUInt16BE(bodyLength, 2);
|
|
35456
35469
|
} else if (payloadLength === 127) {
|
|
35457
|
-
|
|
35458
|
-
|
|
35470
|
+
buffer[2] = buffer[3] = 0;
|
|
35471
|
+
buffer.writeUIntBE(bodyLength, 4, 6);
|
|
35459
35472
|
}
|
|
35460
|
-
|
|
35473
|
+
buffer[1] |= 128;
|
|
35461
35474
|
for (let i = 0;i < bodyLength; ++i) {
|
|
35462
|
-
|
|
35475
|
+
buffer[offset + i] = frameData[i] ^ maskKey[i & 3];
|
|
35463
35476
|
}
|
|
35464
|
-
return
|
|
35477
|
+
return buffer;
|
|
35465
35478
|
}
|
|
35466
|
-
static createFastTextFrame(
|
|
35479
|
+
static createFastTextFrame(buffer) {
|
|
35467
35480
|
const maskKey = generateMask();
|
|
35468
|
-
const bodyLength =
|
|
35481
|
+
const bodyLength = buffer.length;
|
|
35469
35482
|
for (let i = 0;i < bodyLength; ++i) {
|
|
35470
|
-
|
|
35483
|
+
buffer[i] ^= maskKey[i & 3];
|
|
35471
35484
|
}
|
|
35472
35485
|
let payloadLength = bodyLength;
|
|
35473
35486
|
let offset = 6;
|
|
@@ -35491,7 +35504,7 @@ var require_frame = __commonJS2(function(exports, module) {
|
|
|
35491
35504
|
head[2] = head[3] = 0;
|
|
35492
35505
|
head.writeUIntBE(bodyLength, 4, 6);
|
|
35493
35506
|
}
|
|
35494
|
-
return [head,
|
|
35507
|
+
return [head, buffer];
|
|
35495
35508
|
}
|
|
35496
35509
|
}
|
|
35497
35510
|
module.exports = {
|
|
@@ -35957,12 +35970,12 @@ var require_receiver = __commonJS2(function(exports, module) {
|
|
|
35957
35970
|
return false;
|
|
35958
35971
|
}
|
|
35959
35972
|
if (!this.#handler.closeState.has(sentCloseFrameState.SENT) && !this.#handler.closeState.has(sentCloseFrameState.RECEIVED)) {
|
|
35960
|
-
let
|
|
35973
|
+
let body = emptyBuffer;
|
|
35961
35974
|
if (this.#info.closeInfo.code) {
|
|
35962
|
-
|
|
35963
|
-
|
|
35975
|
+
body = Buffer.allocUnsafe(2);
|
|
35976
|
+
body.writeUInt16BE(this.#info.closeInfo.code, 0);
|
|
35964
35977
|
}
|
|
35965
|
-
const closeFrame = new WebsocketFrameSend(
|
|
35978
|
+
const closeFrame = new WebsocketFrameSend(body);
|
|
35966
35979
|
this.#handler.socket.write(closeFrame.createFrame(opcodes.CLOSE));
|
|
35967
35980
|
this.#handler.closeState.add(sentCloseFrameState.SENT);
|
|
35968
35981
|
}
|
|
@@ -36013,12 +36026,12 @@ var require_sender = __commonJS2(function(exports, module) {
|
|
|
36013
36026
|
this.#socket.write(createFrame(item, hint), cb);
|
|
36014
36027
|
}
|
|
36015
36028
|
} else {
|
|
36016
|
-
const
|
|
36029
|
+
const node = {
|
|
36017
36030
|
promise: null,
|
|
36018
36031
|
callback: cb,
|
|
36019
36032
|
frame: createFrame(item, hint)
|
|
36020
36033
|
};
|
|
36021
|
-
this.#queue.push(
|
|
36034
|
+
this.#queue.push(node);
|
|
36022
36035
|
}
|
|
36023
36036
|
return;
|
|
36024
36037
|
}
|
|
@@ -37374,10 +37387,6 @@ var $cacheStores = {
|
|
|
37374
37387
|
var SqliteCacheStore = require_sqlite_cache_store();
|
|
37375
37388
|
$cacheStores.SqliteCacheStore = SqliteCacheStore;
|
|
37376
37389
|
var $buildConnector = buildConnector;
|
|
37377
|
-
var $util = {
|
|
37378
|
-
parseHeaders: util.parseHeaders,
|
|
37379
|
-
headerNameToString: util.headerNameToString
|
|
37380
|
-
};
|
|
37381
37390
|
function makeDispatcher(fn) {
|
|
37382
37391
|
return (url, opts, handler) => {
|
|
37383
37392
|
if (typeof opts === "function") {
|
|
@@ -38595,11 +38604,11 @@ class DocTypeReader {
|
|
|
38595
38604
|
i += 2;
|
|
38596
38605
|
else if (xmlData[i] === "(") {
|
|
38597
38606
|
i++;
|
|
38598
|
-
const
|
|
38607
|
+
const startIndex = i;
|
|
38599
38608
|
while (i < xmlData.length && xmlData[i] !== ")") {
|
|
38600
38609
|
i++;
|
|
38601
38610
|
}
|
|
38602
|
-
contentModel = xmlData.substring(
|
|
38611
|
+
contentModel = xmlData.substring(startIndex, i);
|
|
38603
38612
|
if (xmlData[i] !== ")") {
|
|
38604
38613
|
throw new Error("Unterminated content model");
|
|
38605
38614
|
}
|
|
@@ -38641,11 +38650,11 @@ class DocTypeReader {
|
|
|
38641
38650
|
i++;
|
|
38642
38651
|
let allowedNotations = [];
|
|
38643
38652
|
while (i < xmlData.length && xmlData[i] !== ")") {
|
|
38644
|
-
const
|
|
38653
|
+
const startIndex = i;
|
|
38645
38654
|
while (i < xmlData.length && xmlData[i] !== "|" && xmlData[i] !== ")") {
|
|
38646
38655
|
i++;
|
|
38647
38656
|
}
|
|
38648
|
-
let notation = xmlData.substring(
|
|
38657
|
+
let notation = xmlData.substring(startIndex, i);
|
|
38649
38658
|
notation = notation.trim();
|
|
38650
38659
|
if (!validateEntityName2(notation, { xmlVersion: this.xmlVersion })) {
|
|
38651
38660
|
throw new Error(`Invalid notation name: "${notation}"`);
|
|
@@ -38662,11 +38671,11 @@ class DocTypeReader {
|
|
|
38662
38671
|
i++;
|
|
38663
38672
|
attributeType += " (" + allowedNotations.join("|") + ")";
|
|
38664
38673
|
} else {
|
|
38665
|
-
const
|
|
38674
|
+
const startIndex = i;
|
|
38666
38675
|
while (i < xmlData.length && !/\s/.test(xmlData[i])) {
|
|
38667
38676
|
i++;
|
|
38668
38677
|
}
|
|
38669
|
-
attributeType += xmlData.substring(
|
|
38678
|
+
attributeType += xmlData.substring(startIndex, i);
|
|
38670
38679
|
const validTypes = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
|
|
38671
38680
|
if (!this.suppressValidationErr && !validTypes.includes(attributeType.toUpperCase())) {
|
|
38672
38681
|
throw new Error(`Invalid attribute type: "${attributeType}"`);
|
|
@@ -38851,9 +38860,9 @@ function anynum(str) {
|
|
|
38851
38860
|
const low = str.charCodeAt(i + 1);
|
|
38852
38861
|
if (low >= 56320 && low <= 57343) {
|
|
38853
38862
|
const cp = 65536 + (cc - 55296 << 10) + (low - 56320);
|
|
38854
|
-
const
|
|
38855
|
-
if (
|
|
38856
|
-
chars.push(String.fromCharCode(
|
|
38863
|
+
const d = HIGH_MAP.get(cp);
|
|
38864
|
+
if (d !== undefined) {
|
|
38865
|
+
chars.push(String.fromCharCode(d + 48));
|
|
38857
38866
|
i++;
|
|
38858
38867
|
continue;
|
|
38859
38868
|
}
|
|
@@ -39180,12 +39189,12 @@ class ExpressionSet {
|
|
|
39180
39189
|
return this;
|
|
39181
39190
|
this._patterns.add(expression.pattern);
|
|
39182
39191
|
if (expression.hasDeepWildcard()) {
|
|
39183
|
-
const
|
|
39184
|
-
if (
|
|
39185
|
-
const
|
|
39186
|
-
if (!this._deepByTerminalTag.has(
|
|
39187
|
-
this._deepByTerminalTag.set(
|
|
39188
|
-
this._deepByTerminalTag.get(
|
|
39192
|
+
const lastSeg = expression.segments[expression.segments.length - 1];
|
|
39193
|
+
if (lastSeg && lastSeg.type !== "deep-wildcard" && lastSeg.tag !== "*") {
|
|
39194
|
+
const tag = lastSeg.tag;
|
|
39195
|
+
if (!this._deepByTerminalTag.has(tag))
|
|
39196
|
+
this._deepByTerminalTag.set(tag, []);
|
|
39197
|
+
this._deepByTerminalTag.get(tag).push(expression);
|
|
39189
39198
|
} else {
|
|
39190
39199
|
this._deepWildcards.push(expression);
|
|
39191
39200
|
}
|
|
@@ -40593,11 +40602,11 @@ var parseXml = function(xmlData) {
|
|
|
40593
40602
|
} else if (options.unpairedTagsSet.has(tagName)) {
|
|
40594
40603
|
i = result.closeIndex;
|
|
40595
40604
|
} else {
|
|
40596
|
-
const
|
|
40597
|
-
if (!
|
|
40605
|
+
const result = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);
|
|
40606
|
+
if (!result)
|
|
40598
40607
|
throw new Error(`Unexpected end of ${rawTagName}`);
|
|
40599
|
-
i =
|
|
40600
|
-
tagContent =
|
|
40608
|
+
i = result.i;
|
|
40609
|
+
tagContent = result.tagContent;
|
|
40601
40610
|
}
|
|
40602
40611
|
const childNode = new XmlNode(tagName);
|
|
40603
40612
|
if (prefixedAttrs) {
|
|
@@ -41894,9 +41903,9 @@ class CalDavClient extends DavClient {
|
|
|
41894
41903
|
};
|
|
41895
41904
|
}
|
|
41896
41905
|
async query(calendar, query = {}) {
|
|
41897
|
-
const
|
|
41906
|
+
const types = query.type ? [query.type] : calendar.components;
|
|
41898
41907
|
const items = [];
|
|
41899
|
-
for (const type of
|
|
41908
|
+
for (const type of types) {
|
|
41900
41909
|
const response = await this.request(new URL(calendar.id), {
|
|
41901
41910
|
method: "REPORT",
|
|
41902
41911
|
headers: {
|
|
@@ -41986,7 +41995,7 @@ class CalDavClient extends DavClient {
|
|
|
41986
41995
|
var package_default2 = {
|
|
41987
41996
|
name: "@sockethub/platform-caldav",
|
|
41988
41997
|
description: "A Sockethub platform for synchronizing CalDAV calendars, events, and tasks",
|
|
41989
|
-
version: "1.0.0-alpha.
|
|
41998
|
+
version: "1.0.0-alpha.9",
|
|
41990
41999
|
type: "module",
|
|
41991
42000
|
private: false,
|
|
41992
42001
|
license: "LGPL-3.0+",
|
|
@@ -42020,16 +42029,16 @@ var package_default2 = {
|
|
|
42020
42029
|
test: "bun test src/"
|
|
42021
42030
|
},
|
|
42022
42031
|
dependencies: {
|
|
42023
|
-
"@sockethub/dav": "^1.0.0-alpha.
|
|
42024
|
-
"@sockethub/schemas": "^3.0.0-alpha.
|
|
42025
|
-
"@sockethub/util": "^1.0.0-alpha.
|
|
42032
|
+
"@sockethub/dav": "^1.0.0-alpha.6",
|
|
42033
|
+
"@sockethub/schemas": "^3.0.0-alpha.25",
|
|
42034
|
+
"@sockethub/util": "^1.0.0-alpha.13"
|
|
42026
42035
|
},
|
|
42027
42036
|
devDependencies: {
|
|
42028
42037
|
"@types/bun": "latest",
|
|
42029
42038
|
undici: "^7.19.0"
|
|
42030
42039
|
},
|
|
42031
42040
|
peerDependencies: {
|
|
42032
|
-
"@sockethub/server": "^5.0.0-alpha.
|
|
42041
|
+
"@sockethub/server": "^5.0.0-alpha.25"
|
|
42033
42042
|
},
|
|
42034
42043
|
peerDependenciesMeta: {
|
|
42035
42044
|
"@sockethub/server": {
|
|
@@ -42037,7 +42046,7 @@ var package_default2 = {
|
|
|
42037
42046
|
}
|
|
42038
42047
|
},
|
|
42039
42048
|
types: "./dist/index.d.ts",
|
|
42040
|
-
gitHead: "
|
|
42049
|
+
gitHead: "45acaca6570f8e8429d996ec1d3b95979e8c54a9"
|
|
42041
42050
|
};
|
|
42042
42051
|
|
|
42043
42052
|
// src/schema.ts
|
|
@@ -42491,12 +42500,12 @@ class CalDav {
|
|
|
42491
42500
|
create(job, credentials, done) {
|
|
42492
42501
|
const client = this.client(credentials);
|
|
42493
42502
|
const input = job.object;
|
|
42494
|
-
this.calendar(client, job.target?.id ?? "").then(async (
|
|
42495
|
-
if (!
|
|
42503
|
+
this.calendar(client, job.target?.id ?? "").then(async (target) => {
|
|
42504
|
+
if (!target.components.includes(input.type)) {
|
|
42496
42505
|
throw new CalDavFailure("caldav:unsupported-component");
|
|
42497
42506
|
}
|
|
42498
42507
|
const calendarData = buildICalendar(input);
|
|
42499
|
-
const created = await client.create(
|
|
42508
|
+
const created = await client.create(target, calendarData.uid, calendarData.body);
|
|
42500
42509
|
done(null, {
|
|
42501
42510
|
"@context": CONTEXT,
|
|
42502
42511
|
...job.id ? { id: job.id } : {},
|
|
@@ -42594,4 +42603,4 @@ export {
|
|
|
42594
42603
|
foldLine
|
|
42595
42604
|
};
|
|
42596
42605
|
|
|
42597
|
-
//# debugId=
|
|
42606
|
+
//# debugId=E04041CF66531E6964756E2164756E21
|