@umbraco-cms/mcp-dev 17.6.9 → 17.6.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/{chunk-H6OBIRHB.js → chunk-3ZYNR47J.js} +1789 -1084
- package/dist/chunk-3ZYNR47J.js.map +1 -0
- package/dist/{chunk-4MRMRMFC.cjs → chunk-WAZSHKMB.cjs} +797 -92
- package/dist/chunk-WAZSHKMB.cjs.map +1 -0
- package/dist/collections.cjs +2 -2
- package/dist/collections.js +1 -1
- package/dist/index.cjs +591 -294
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +443 -146
- package/dist/index.js.map +1 -1
- package/dist/tool-types.d.ts +310 -6
- package/package.json +4 -4
- package/dist/chunk-4MRMRMFC.cjs.map +0 -1
- package/dist/chunk-H6OBIRHB.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
availableCollections,
|
|
10
10
|
setAllowFilePathUploads,
|
|
11
11
|
setUmbracoVersion
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3ZYNR47J.js";
|
|
13
13
|
|
|
14
14
|
// node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/codegen/code.js
|
|
15
15
|
var require_code = __commonJS({
|
|
@@ -3087,9 +3087,28 @@ var require_utils = __commonJS({
|
|
|
3087
3087
|
"use strict";
|
|
3088
3088
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
3089
3089
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
3090
|
+
var isPort = RegExp.prototype.test.bind(/^\d*$/u);
|
|
3090
3091
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
3091
3092
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
3092
|
-
var isPathCharacter = RegExp.prototype.test.bind(/^[
|
|
3093
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
|
|
3094
|
+
var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
|
|
3095
|
+
var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
|
|
3096
|
+
var BYTE_HEX = new Array(256);
|
|
3097
|
+
{
|
|
3098
|
+
const HEX_DIGITS = "0123456789ABCDEF";
|
|
3099
|
+
for (let i = 0; i < 256; i++) {
|
|
3100
|
+
BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
|
|
3101
|
+
}
|
|
3102
|
+
}
|
|
3103
|
+
function percentEncodeNonAscii(cp) {
|
|
3104
|
+
if (cp < 2048) {
|
|
3105
|
+
return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
|
|
3106
|
+
}
|
|
3107
|
+
if (cp < 65536) {
|
|
3108
|
+
return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
3109
|
+
}
|
|
3110
|
+
return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
3111
|
+
}
|
|
3093
3112
|
function stringArrayToHexStripped(input) {
|
|
3094
3113
|
let acc = "";
|
|
3095
3114
|
let code = 0;
|
|
@@ -3114,91 +3133,105 @@ var require_utils = __commonJS({
|
|
|
3114
3133
|
}
|
|
3115
3134
|
return acc;
|
|
3116
3135
|
}
|
|
3136
|
+
var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
|
|
3137
|
+
var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
|
|
3138
|
+
var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
|
|
3117
3139
|
var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
3118
|
-
function
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
if (hex !== "") {
|
|
3126
|
-
address.push(hex);
|
|
3127
|
-
} else {
|
|
3128
|
-
output.error = true;
|
|
3129
|
-
return false;
|
|
3140
|
+
function isZoneIdentifier(zone) {
|
|
3141
|
+
if (zone.length === 0) return false;
|
|
3142
|
+
for (let i = 0; i < zone.length; i++) {
|
|
3143
|
+
if (isZoneCharacter(zone[i])) continue;
|
|
3144
|
+
if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {
|
|
3145
|
+
i += 2;
|
|
3146
|
+
continue;
|
|
3130
3147
|
}
|
|
3131
|
-
|
|
3148
|
+
return false;
|
|
3132
3149
|
}
|
|
3133
3150
|
return true;
|
|
3134
3151
|
}
|
|
3135
|
-
function
|
|
3136
|
-
let
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
let
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
}
|
|
3148
|
-
if (cursor === ":") {
|
|
3149
|
-
if (endipv6Encountered === true) {
|
|
3150
|
-
endIpv6 = true;
|
|
3151
|
-
}
|
|
3152
|
-
if (!consume(buffer, address, output)) {
|
|
3153
|
-
break;
|
|
3154
|
-
}
|
|
3155
|
-
if (++tokenCount > 7) {
|
|
3156
|
-
output.error = true;
|
|
3157
|
-
break;
|
|
3152
|
+
function compressIPv6ZeroRun(hextets) {
|
|
3153
|
+
let bestStart = -1;
|
|
3154
|
+
let bestLength = 0;
|
|
3155
|
+
let runStart = -1;
|
|
3156
|
+
let runLength = 0;
|
|
3157
|
+
for (let i = 0; i < hextets.length; i++) {
|
|
3158
|
+
if (hextets[i] === "0") {
|
|
3159
|
+
if (runStart === -1) runStart = i;
|
|
3160
|
+
runLength++;
|
|
3161
|
+
if (runLength > bestLength) {
|
|
3162
|
+
bestLength = runLength;
|
|
3163
|
+
bestStart = runStart;
|
|
3158
3164
|
}
|
|
3159
|
-
if (i > 0 && input[i - 1] === ":") {
|
|
3160
|
-
endipv6Encountered = true;
|
|
3161
|
-
}
|
|
3162
|
-
address.push(":");
|
|
3163
|
-
continue;
|
|
3164
|
-
} else if (cursor === "%") {
|
|
3165
|
-
if (!consume(buffer, address, output)) {
|
|
3166
|
-
break;
|
|
3167
|
-
}
|
|
3168
|
-
consume = consumeIsZone;
|
|
3169
3165
|
} else {
|
|
3170
|
-
|
|
3166
|
+
runStart = -1;
|
|
3167
|
+
runLength = 0;
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
if (bestLength < 2) return hextets.join(":");
|
|
3171
|
+
const head = hextets.slice(0, bestStart).join(":");
|
|
3172
|
+
const tail = hextets.slice(bestStart + bestLength).join(":");
|
|
3173
|
+
return head + "::" + tail;
|
|
3174
|
+
}
|
|
3175
|
+
function normalizeIPv6Address(input) {
|
|
3176
|
+
const compression = input.indexOf("::");
|
|
3177
|
+
if (compression !== -1 && input.indexOf("::", compression + 1) !== -1) return void 0;
|
|
3178
|
+
const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
|
|
3179
|
+
const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
|
|
3180
|
+
if (compression !== -1) {
|
|
3181
|
+
if (left.length === 1 && left[0] === "") left.length = 0;
|
|
3182
|
+
if (right.length === 1 && right[0] === "") right.length = 0;
|
|
3183
|
+
}
|
|
3184
|
+
const parts = left.concat(right);
|
|
3185
|
+
let hextetCount = 0;
|
|
3186
|
+
for (let i = 0; i < parts.length; i++) {
|
|
3187
|
+
const part = parts[i];
|
|
3188
|
+
if (part === "") return void 0;
|
|
3189
|
+
if (part.indexOf(".") !== -1) {
|
|
3190
|
+
if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part)) return void 0;
|
|
3191
|
+
hextetCount += 2;
|
|
3171
3192
|
continue;
|
|
3172
3193
|
}
|
|
3194
|
+
if (!isHextet(part)) return void 0;
|
|
3195
|
+
parts[i] = parseInt(part, 16).toString(16);
|
|
3196
|
+
hextetCount++;
|
|
3173
3197
|
}
|
|
3174
|
-
if (
|
|
3175
|
-
if (
|
|
3176
|
-
|
|
3177
|
-
} else if (endIpv6) {
|
|
3178
|
-
address.push(buffer.join(""));
|
|
3179
|
-
} else {
|
|
3180
|
-
address.push(stringArrayToHexStripped(buffer));
|
|
3181
|
-
}
|
|
3198
|
+
if (compression === -1) {
|
|
3199
|
+
if (hextetCount !== 8) return void 0;
|
|
3200
|
+
return compressIPv6ZeroRun(parts);
|
|
3182
3201
|
}
|
|
3183
|
-
|
|
3184
|
-
|
|
3202
|
+
if (hextetCount >= 8) return void 0;
|
|
3203
|
+
const expanded = parts.slice(0, left.length);
|
|
3204
|
+
for (let i = hextetCount; i < 8; i++) expanded.push("0");
|
|
3205
|
+
for (let i = left.length; i < parts.length; i++) expanded.push(parts[i]);
|
|
3206
|
+
return compressIPv6ZeroRun(expanded);
|
|
3185
3207
|
}
|
|
3186
3208
|
function normalizeIPv6(host) {
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
}
|
|
3190
|
-
|
|
3191
|
-
if (
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
3196
|
-
|
|
3197
|
-
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3209
|
+
const bracketed = host[0] === "[" && host[host.length - 1] === "]";
|
|
3210
|
+
const hasBracket = host[0] === "[" || host[host.length - 1] === "]";
|
|
3211
|
+
if (hasBracket && !bracketed) return { host, isIPV6: false, error: true };
|
|
3212
|
+
let input = bracketed ? host.slice(1, -1) : host;
|
|
3213
|
+
if (bracketed && isIPvFuture(input)) {
|
|
3214
|
+
input = input.toLowerCase();
|
|
3215
|
+
return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true };
|
|
3216
|
+
}
|
|
3217
|
+
if (findToken(input, ":") < 2) {
|
|
3218
|
+
return { host, isIPV6: false, error: bracketed };
|
|
3219
|
+
}
|
|
3220
|
+
let zoneIdentifier = "";
|
|
3221
|
+
const zoneSeparator = input.indexOf("%");
|
|
3222
|
+
if (zoneSeparator !== -1) {
|
|
3223
|
+
const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
|
|
3224
|
+
zoneIdentifier = input.slice(zoneSeparator + separatorLength);
|
|
3225
|
+
if (!isZoneIdentifier(zoneIdentifier)) return { host, isIPV6: false, error: true };
|
|
3226
|
+
input = input.slice(0, zoneSeparator);
|
|
3227
|
+
}
|
|
3228
|
+
const address = normalizeIPv6Address(input);
|
|
3229
|
+
if (address === void 0) return { host, isIPV6: false, error: true };
|
|
3230
|
+
return {
|
|
3231
|
+
host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
|
|
3232
|
+
escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
|
|
3233
|
+
isIPV6: true
|
|
3234
|
+
};
|
|
3202
3235
|
}
|
|
3203
3236
|
function findToken(str, token) {
|
|
3204
3237
|
let ind = 0;
|
|
@@ -3317,7 +3350,8 @@ var require_utils = __commonJS({
|
|
|
3317
3350
|
function normalizePathEncoding(input) {
|
|
3318
3351
|
let output = "";
|
|
3319
3352
|
for (let i = 0; i < input.length; i++) {
|
|
3320
|
-
|
|
3353
|
+
const ch = input[i];
|
|
3354
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
3321
3355
|
const hex = input.slice(i + 1, i + 3);
|
|
3322
3356
|
if (isHexPair(hex)) {
|
|
3323
3357
|
const normalizedHex = hex.toUpperCase();
|
|
@@ -3331,10 +3365,152 @@ var require_utils = __commonJS({
|
|
|
3331
3365
|
continue;
|
|
3332
3366
|
}
|
|
3333
3367
|
}
|
|
3334
|
-
if (isPathCharacter(
|
|
3335
|
-
output +=
|
|
3368
|
+
if (isPathCharacter(ch)) {
|
|
3369
|
+
output += ch;
|
|
3370
|
+
} else {
|
|
3371
|
+
const code = input.charCodeAt(i);
|
|
3372
|
+
if (code < 128) {
|
|
3373
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
3374
|
+
} else if (code < 55296 || code > 57343) {
|
|
3375
|
+
output += percentEncodeNonAscii(code);
|
|
3376
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
3377
|
+
const low = input.charCodeAt(i + 1);
|
|
3378
|
+
if (low >= 56320 && low <= 57343) {
|
|
3379
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
3380
|
+
i++;
|
|
3381
|
+
} else {
|
|
3382
|
+
output += percentEncodeNonAscii(65533);
|
|
3383
|
+
}
|
|
3384
|
+
} else {
|
|
3385
|
+
output += percentEncodeNonAscii(65533);
|
|
3386
|
+
}
|
|
3387
|
+
}
|
|
3388
|
+
}
|
|
3389
|
+
return output;
|
|
3390
|
+
}
|
|
3391
|
+
function serializePathEncoding(input, pathNoScheme = false) {
|
|
3392
|
+
let output = "";
|
|
3393
|
+
let firstSegment = pathNoScheme && input[0] !== "/";
|
|
3394
|
+
for (let i = 0; i < input.length; i++) {
|
|
3395
|
+
const ch = input[i];
|
|
3396
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
3397
|
+
const hex = input.slice(i + 1, i + 3);
|
|
3398
|
+
if (isHexPair(hex)) {
|
|
3399
|
+
output += "%" + hex.toUpperCase();
|
|
3400
|
+
i += 2;
|
|
3401
|
+
continue;
|
|
3402
|
+
}
|
|
3403
|
+
}
|
|
3404
|
+
if (ch === "/") {
|
|
3405
|
+
firstSegment = false;
|
|
3406
|
+
}
|
|
3407
|
+
if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) {
|
|
3408
|
+
output += ch;
|
|
3409
|
+
} else {
|
|
3410
|
+
const code = input.charCodeAt(i);
|
|
3411
|
+
if (code < 128) {
|
|
3412
|
+
output += BYTE_HEX[code];
|
|
3413
|
+
} else if (code < 55296 || code > 57343) {
|
|
3414
|
+
output += percentEncodeNonAscii(code);
|
|
3415
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
3416
|
+
const low = input.charCodeAt(i + 1);
|
|
3417
|
+
if (low >= 56320 && low <= 57343) {
|
|
3418
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
3419
|
+
i++;
|
|
3420
|
+
} else {
|
|
3421
|
+
output += percentEncodeNonAscii(65533);
|
|
3422
|
+
}
|
|
3423
|
+
} else {
|
|
3424
|
+
output += percentEncodeNonAscii(65533);
|
|
3425
|
+
}
|
|
3426
|
+
}
|
|
3427
|
+
}
|
|
3428
|
+
return output;
|
|
3429
|
+
}
|
|
3430
|
+
function encodeComponent(input, isAllowed) {
|
|
3431
|
+
let output = "";
|
|
3432
|
+
for (let i = 0; i < input.length; i++) {
|
|
3433
|
+
const ch = input[i];
|
|
3434
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
3435
|
+
const hex = input.slice(i + 1, i + 3);
|
|
3436
|
+
if (isHexPair(hex)) {
|
|
3437
|
+
output += "%" + hex.toUpperCase();
|
|
3438
|
+
i += 2;
|
|
3439
|
+
continue;
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
if (isAllowed(ch)) {
|
|
3443
|
+
output += ch;
|
|
3336
3444
|
} else {
|
|
3337
|
-
|
|
3445
|
+
const code = input.charCodeAt(i);
|
|
3446
|
+
if (code < 128) {
|
|
3447
|
+
output += BYTE_HEX[code];
|
|
3448
|
+
} else if (code < 55296 || code > 57343) {
|
|
3449
|
+
output += percentEncodeNonAscii(code);
|
|
3450
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
3451
|
+
const low = input.charCodeAt(i + 1);
|
|
3452
|
+
if (low >= 56320 && low <= 57343) {
|
|
3453
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
3454
|
+
i++;
|
|
3455
|
+
} else {
|
|
3456
|
+
output += percentEncodeNonAscii(65533);
|
|
3457
|
+
}
|
|
3458
|
+
} else {
|
|
3459
|
+
output += percentEncodeNonAscii(65533);
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3463
|
+
return output;
|
|
3464
|
+
}
|
|
3465
|
+
function encodeUserinfo(input) {
|
|
3466
|
+
return encodeComponent(input, isUserinfoCharacter);
|
|
3467
|
+
}
|
|
3468
|
+
function encodeQuery(input) {
|
|
3469
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
3470
|
+
}
|
|
3471
|
+
function encodeFragment(input) {
|
|
3472
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
3473
|
+
}
|
|
3474
|
+
function isEscapeSafe(cp) {
|
|
3475
|
+
return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95;
|
|
3476
|
+
}
|
|
3477
|
+
function normalizeQueryFragmentEncoding(input) {
|
|
3478
|
+
let output = "";
|
|
3479
|
+
for (let i = 0; i < input.length; i++) {
|
|
3480
|
+
const ch = input[i];
|
|
3481
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
3482
|
+
const hex = input.slice(i + 1, i + 3);
|
|
3483
|
+
if (isHexPair(hex)) {
|
|
3484
|
+
const normalizedHex = hex.toUpperCase();
|
|
3485
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
3486
|
+
if (isUnreserved(decoded)) {
|
|
3487
|
+
output += decoded;
|
|
3488
|
+
} else {
|
|
3489
|
+
output += "%" + normalizedHex;
|
|
3490
|
+
}
|
|
3491
|
+
i += 2;
|
|
3492
|
+
continue;
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
if (isQueryFragmentCharacter(ch)) {
|
|
3496
|
+
output += ch;
|
|
3497
|
+
} else {
|
|
3498
|
+
const code = input.charCodeAt(i);
|
|
3499
|
+
if (code < 128) {
|
|
3500
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
3501
|
+
} else if (code < 55296 || code > 57343) {
|
|
3502
|
+
output += percentEncodeNonAscii(code);
|
|
3503
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
3504
|
+
const low = input.charCodeAt(i + 1);
|
|
3505
|
+
if (low >= 56320 && low <= 57343) {
|
|
3506
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
3507
|
+
i++;
|
|
3508
|
+
} else {
|
|
3509
|
+
output += percentEncodeNonAscii(65533);
|
|
3510
|
+
}
|
|
3511
|
+
} else {
|
|
3512
|
+
output += percentEncodeNonAscii(65533);
|
|
3513
|
+
}
|
|
3338
3514
|
}
|
|
3339
3515
|
}
|
|
3340
3516
|
return output;
|
|
@@ -3357,14 +3533,18 @@ var require_utils = __commonJS({
|
|
|
3357
3533
|
function recomposeAuthority(component) {
|
|
3358
3534
|
const uriTokens = [];
|
|
3359
3535
|
if (component.userinfo !== void 0) {
|
|
3360
|
-
uriTokens.push(component.userinfo);
|
|
3536
|
+
uriTokens.push(encodeUserinfo(component.userinfo));
|
|
3361
3537
|
uriTokens.push("@");
|
|
3362
3538
|
}
|
|
3363
3539
|
if (component.host !== void 0) {
|
|
3364
|
-
let host =
|
|
3540
|
+
let host = component.host;
|
|
3365
3541
|
if (!isIPv4(host)) {
|
|
3366
|
-
|
|
3367
|
-
if (ipV6res.isIPV6
|
|
3542
|
+
let ipV6res = normalizeIPv6(host);
|
|
3543
|
+
if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
|
|
3544
|
+
host = normalizePercentEncoding(host, true);
|
|
3545
|
+
ipV6res = normalizeIPv6(host);
|
|
3546
|
+
}
|
|
3547
|
+
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
|
|
3368
3548
|
host = `[${ipV6res.escapedHost}]`;
|
|
3369
3549
|
} else {
|
|
3370
3550
|
host = reescapeHostDelimiters(host, false);
|
|
@@ -3373,8 +3553,12 @@ var require_utils = __commonJS({
|
|
|
3373
3553
|
uriTokens.push(host);
|
|
3374
3554
|
}
|
|
3375
3555
|
if (typeof component.port === "number" || typeof component.port === "string") {
|
|
3556
|
+
const port = String(component.port);
|
|
3557
|
+
if (!isPort(port)) {
|
|
3558
|
+
throw new TypeError("URI port is malformed.");
|
|
3559
|
+
}
|
|
3376
3560
|
uriTokens.push(":");
|
|
3377
|
-
uriTokens.push(
|
|
3561
|
+
uriTokens.push(port);
|
|
3378
3562
|
}
|
|
3379
3563
|
return uriTokens.length ? uriTokens.join("") : void 0;
|
|
3380
3564
|
}
|
|
@@ -3384,6 +3568,11 @@ var require_utils = __commonJS({
|
|
|
3384
3568
|
reescapeHostDelimiters,
|
|
3385
3569
|
normalizePercentEncoding,
|
|
3386
3570
|
normalizePathEncoding,
|
|
3571
|
+
serializePathEncoding,
|
|
3572
|
+
normalizeQueryFragmentEncoding,
|
|
3573
|
+
encodeUserinfo,
|
|
3574
|
+
encodeQuery,
|
|
3575
|
+
encodeFragment,
|
|
3387
3576
|
escapePreservingEscapes,
|
|
3388
3577
|
removeDotSegments,
|
|
3389
3578
|
isIPv4,
|
|
@@ -3399,7 +3588,7 @@ var require_schemes = __commonJS({
|
|
|
3399
3588
|
"node_modules/fast-uri/lib/schemes.js"(exports, module) {
|
|
3400
3589
|
"use strict";
|
|
3401
3590
|
var { isUUID } = require_utils();
|
|
3402
|
-
var URN_REG =
|
|
3591
|
+
var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
|
|
3403
3592
|
var supportedSchemeNames = (
|
|
3404
3593
|
/** @type {const} */
|
|
3405
3594
|
[
|
|
@@ -3460,9 +3649,10 @@ var require_schemes = __commonJS({
|
|
|
3460
3649
|
wsComponent.secure = void 0;
|
|
3461
3650
|
}
|
|
3462
3651
|
if (wsComponent.resourceName) {
|
|
3463
|
-
const
|
|
3652
|
+
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
3653
|
+
const path = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
3464
3654
|
wsComponent.path = path && path !== "/" ? path : void 0;
|
|
3465
|
-
wsComponent.query =
|
|
3655
|
+
wsComponent.query = queryIndex === -1 ? void 0 : wsComponent.resourceName.slice(queryIndex + 1);
|
|
3466
3656
|
wsComponent.resourceName = void 0;
|
|
3467
3657
|
}
|
|
3468
3658
|
wsComponent.fragment = void 0;
|
|
@@ -3474,7 +3664,7 @@ var require_schemes = __commonJS({
|
|
|
3474
3664
|
return urnComponent;
|
|
3475
3665
|
}
|
|
3476
3666
|
const matches = urnComponent.path.match(URN_REG);
|
|
3477
|
-
if (matches) {
|
|
3667
|
+
if (matches && matches[0] === urnComponent.path) {
|
|
3478
3668
|
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
3479
3669
|
urnComponent.nid = matches[1].toLowerCase();
|
|
3480
3670
|
urnComponent.nss = matches[2];
|
|
@@ -3608,8 +3798,17 @@ var require_schemes = __commonJS({
|
|
|
3608
3798
|
var require_fast_uri = __commonJS({
|
|
3609
3799
|
"node_modules/fast-uri/index.js"(exports, module) {
|
|
3610
3800
|
"use strict";
|
|
3611
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding,
|
|
3801
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3612
3802
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
3803
|
+
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
3804
|
+
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
3805
|
+
function decodeValidScheme(scheme) {
|
|
3806
|
+
const decodedScheme = unescape(String(scheme));
|
|
3807
|
+
if (!VALID_SCHEME.test(decodedScheme)) {
|
|
3808
|
+
throw new TypeError(MALFORMED_SCHEME_ERROR);
|
|
3809
|
+
}
|
|
3810
|
+
return decodedScheme;
|
|
3811
|
+
}
|
|
3613
3812
|
function normalize(uri, options) {
|
|
3614
3813
|
if (typeof uri === "string") {
|
|
3615
3814
|
uri = /** @type {T} */
|
|
@@ -3622,12 +3821,34 @@ var require_fast_uri = __commonJS({
|
|
|
3622
3821
|
}
|
|
3623
3822
|
function resolve(baseURI, relativeURI, options) {
|
|
3624
3823
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
3625
|
-
const {
|
|
3626
|
-
|
|
3627
|
-
|
|
3824
|
+
const {
|
|
3825
|
+
parsed: baseParsed,
|
|
3826
|
+
malformedAuthorityOrPort: baseMalformed,
|
|
3827
|
+
malformedPercentEncoding: baseMalformedPercentEncoding,
|
|
3828
|
+
malformedSchemeSpecific: baseMalformedSchemeSpecific,
|
|
3829
|
+
malformedHost: baseMalformedHost,
|
|
3830
|
+
malformedScheme: baseMalformedScheme
|
|
3831
|
+
} = parseWithStatus(baseURI, schemelessOptions);
|
|
3832
|
+
const {
|
|
3833
|
+
parsed: relativeParsed,
|
|
3834
|
+
malformedAuthorityOrPort: relativeMalformed,
|
|
3835
|
+
malformedPercentEncoding: relativeMalformedPercentEncoding,
|
|
3836
|
+
malformedSchemeSpecific: relativeMalformedSchemeSpecific,
|
|
3837
|
+
malformedHost: relativeMalformedHost,
|
|
3838
|
+
malformedScheme: relativeMalformedScheme
|
|
3839
|
+
} = parseWithStatus(relativeURI, schemelessOptions);
|
|
3840
|
+
if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
|
|
3628
3841
|
throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
|
|
3629
3842
|
}
|
|
3630
3843
|
const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
|
|
3844
|
+
const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
|
|
3845
|
+
const resolvedHost = resolved.host;
|
|
3846
|
+
const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
|
|
3847
|
+
canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
|
|
3848
|
+
const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !new RegExp("\\P{ASCII}", "u").test(resolvedHost);
|
|
3849
|
+
if (resolved.error && !encodedASCIIHost) {
|
|
3850
|
+
throw new Error(resolved.error);
|
|
3851
|
+
}
|
|
3631
3852
|
schemelessOptions.skipEscape = true;
|
|
3632
3853
|
return serialize(resolved, schemelessOptions);
|
|
3633
3854
|
}
|
|
@@ -3687,7 +3908,7 @@ var require_fast_uri = __commonJS({
|
|
|
3687
3908
|
function equal(uriA, uriB, options) {
|
|
3688
3909
|
const normalizedA = normalizeComparableURI(uriA, options);
|
|
3689
3910
|
const normalizedB = normalizeComparableURI(uriB, options);
|
|
3690
|
-
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA
|
|
3911
|
+
return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA === normalizedB;
|
|
3691
3912
|
}
|
|
3692
3913
|
function serialize(cmpts, opts) {
|
|
3693
3914
|
const component = {
|
|
@@ -3708,19 +3929,22 @@ var require_fast_uri = __commonJS({
|
|
|
3708
3929
|
};
|
|
3709
3930
|
const options = Object.assign({}, opts);
|
|
3710
3931
|
const uriTokens = [];
|
|
3932
|
+
if (component.scheme) {
|
|
3933
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
3934
|
+
}
|
|
3711
3935
|
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
3712
3936
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
3937
|
+
const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
|
|
3938
|
+
const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
|
|
3713
3939
|
if (component.path !== void 0) {
|
|
3714
3940
|
if (!options.skipEscape) {
|
|
3715
|
-
component.path =
|
|
3716
|
-
if (component.scheme !== void 0) {
|
|
3717
|
-
component.path = component.path.split("%3A").join(":");
|
|
3718
|
-
}
|
|
3941
|
+
component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
3719
3942
|
} else {
|
|
3720
3943
|
component.path = normalizePercentEncoding(component.path);
|
|
3721
3944
|
}
|
|
3722
3945
|
}
|
|
3723
3946
|
if (options.reference !== "suffix" && component.scheme) {
|
|
3947
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
3724
3948
|
uriTokens.push(component.scheme, ":");
|
|
3725
3949
|
}
|
|
3726
3950
|
const authority = recomposeAuthority(component);
|
|
@@ -3738,16 +3962,19 @@ var require_fast_uri = __commonJS({
|
|
|
3738
3962
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
3739
3963
|
s = removeDotSegments(s);
|
|
3740
3964
|
}
|
|
3965
|
+
if (pathNoScheme) {
|
|
3966
|
+
s = serializePathEncoding(s, true);
|
|
3967
|
+
}
|
|
3741
3968
|
if (authority === void 0 && s[0] === "/" && s[1] === "/") {
|
|
3742
3969
|
s = "/%2F" + s.slice(2);
|
|
3743
3970
|
}
|
|
3744
3971
|
uriTokens.push(s);
|
|
3745
3972
|
}
|
|
3746
3973
|
if (component.query !== void 0) {
|
|
3747
|
-
uriTokens.push("?", component.query);
|
|
3974
|
+
uriTokens.push("?", encodeQuery(component.query));
|
|
3748
3975
|
}
|
|
3749
3976
|
if (component.fragment !== void 0) {
|
|
3750
|
-
uriTokens.push("#", component.fragment);
|
|
3977
|
+
uriTokens.push("#", encodeFragment(component.fragment));
|
|
3751
3978
|
}
|
|
3752
3979
|
return uriTokens.join("");
|
|
3753
3980
|
}
|
|
@@ -3763,6 +3990,35 @@ var require_fast_uri = __commonJS({
|
|
|
3763
3990
|
}
|
|
3764
3991
|
return void 0;
|
|
3765
3992
|
}
|
|
3993
|
+
function hasMalformedPercentEncoding(component) {
|
|
3994
|
+
if (component === void 0) return false;
|
|
3995
|
+
let percent = component.indexOf("%");
|
|
3996
|
+
while (percent !== -1) {
|
|
3997
|
+
if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {
|
|
3998
|
+
return true;
|
|
3999
|
+
}
|
|
4000
|
+
percent = component.indexOf("%", percent + 3);
|
|
4001
|
+
}
|
|
4002
|
+
return false;
|
|
4003
|
+
}
|
|
4004
|
+
function isIPLiteral(host) {
|
|
4005
|
+
return host[0] === "[" && host[host.length - 1] === "]";
|
|
4006
|
+
}
|
|
4007
|
+
function hasMalformedComponentPercentEncoding(matches) {
|
|
4008
|
+
const host = matches[4];
|
|
4009
|
+
return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
|
|
4010
|
+
}
|
|
4011
|
+
function canonicalizeHost(parsed, options, schemeHandler, isIP) {
|
|
4012
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
4013
|
+
try {
|
|
4014
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
4015
|
+
} catch (e) {
|
|
4016
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
4017
|
+
return true;
|
|
4018
|
+
}
|
|
4019
|
+
}
|
|
4020
|
+
return false;
|
|
4021
|
+
}
|
|
3766
4022
|
function parseWithStatus(uri, opts) {
|
|
3767
4023
|
const options = Object.assign({}, opts);
|
|
3768
4024
|
const parsed = {
|
|
@@ -3775,6 +4031,11 @@ var require_fast_uri = __commonJS({
|
|
|
3775
4031
|
fragment: void 0
|
|
3776
4032
|
};
|
|
3777
4033
|
let malformedAuthorityOrPort = false;
|
|
4034
|
+
let malformedPercentEncoding = false;
|
|
4035
|
+
let malformedSchemeSpecific = false;
|
|
4036
|
+
let malformedHost = false;
|
|
4037
|
+
let malformedIPLiteral = false;
|
|
4038
|
+
let malformedScheme = false;
|
|
3778
4039
|
let isIP = false;
|
|
3779
4040
|
if (options.reference === "suffix") {
|
|
3780
4041
|
if (options.scheme) {
|
|
@@ -3811,6 +4072,19 @@ var require_fast_uri = __commonJS({
|
|
|
3811
4072
|
parsed.path = matches[6] || "";
|
|
3812
4073
|
parsed.query = matches[7];
|
|
3813
4074
|
parsed.fragment = matches[8];
|
|
4075
|
+
if (parsed.scheme !== void 0) {
|
|
4076
|
+
const decodedScheme = unescape(parsed.scheme);
|
|
4077
|
+
if (VALID_SCHEME.test(decodedScheme)) {
|
|
4078
|
+
parsed.scheme = decodedScheme.toLowerCase();
|
|
4079
|
+
} else {
|
|
4080
|
+
parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
|
|
4081
|
+
malformedScheme = true;
|
|
4082
|
+
}
|
|
4083
|
+
}
|
|
4084
|
+
malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
|
|
4085
|
+
if (malformedPercentEncoding) {
|
|
4086
|
+
parsed.error = parsed.error || "URI contains malformed percent-encoding.";
|
|
4087
|
+
}
|
|
3814
4088
|
if (isNaN(parsed.port)) {
|
|
3815
4089
|
parsed.port = matches[5];
|
|
3816
4090
|
}
|
|
@@ -3822,9 +4096,16 @@ var require_fast_uri = __commonJS({
|
|
|
3822
4096
|
if (parsed.host) {
|
|
3823
4097
|
const ipv4result = isIPv4(parsed.host);
|
|
3824
4098
|
if (ipv4result === false) {
|
|
4099
|
+
const bracketedIPLiteral = isIPLiteral(parsed.host);
|
|
4100
|
+
const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
|
|
3825
4101
|
const ipv6result = normalizeIPv6(parsed.host);
|
|
3826
|
-
|
|
3827
|
-
|
|
4102
|
+
isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
|
|
4103
|
+
malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
|
|
4104
|
+
parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
4105
|
+
if (malformedIPLiteral) {
|
|
4106
|
+
parsed.error = parsed.error || "URI host is malformed.";
|
|
4107
|
+
malformedAuthorityOrPort = true;
|
|
4108
|
+
}
|
|
3828
4109
|
} else {
|
|
3829
4110
|
isIP = true;
|
|
3830
4111
|
}
|
|
@@ -3842,42 +4123,37 @@ var require_fast_uri = __commonJS({
|
|
|
3842
4123
|
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
3843
4124
|
}
|
|
3844
4125
|
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
3845
|
-
if (!
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
4126
|
+
if (!malformedIPLiteral) {
|
|
4127
|
+
malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
|
|
4128
|
+
}
|
|
4129
|
+
if (uri.indexOf("%") !== -1 && parsed.host !== void 0 && !malformedIPLiteral) {
|
|
4130
|
+
let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
4131
|
+
if (!isIP) {
|
|
4132
|
+
host = normalizePercentEncoding(host.toLowerCase());
|
|
3852
4133
|
}
|
|
4134
|
+
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
3853
4135
|
}
|
|
3854
4136
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
3855
|
-
if (uri.indexOf("%") !== -1) {
|
|
3856
|
-
if (parsed.scheme !== void 0) {
|
|
3857
|
-
parsed.scheme = unescape(parsed.scheme);
|
|
3858
|
-
}
|
|
3859
|
-
if (parsed.host !== void 0) {
|
|
3860
|
-
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
3861
|
-
}
|
|
3862
|
-
}
|
|
3863
4137
|
if (parsed.path) {
|
|
3864
4138
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
3865
4139
|
}
|
|
4140
|
+
if (parsed.query) {
|
|
4141
|
+
parsed.query = normalizeQueryFragmentEncoding(parsed.query);
|
|
4142
|
+
}
|
|
3866
4143
|
if (parsed.fragment) {
|
|
3867
|
-
|
|
3868
|
-
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
3869
|
-
} catch {
|
|
3870
|
-
parsed.error = parsed.error || "URI malformed";
|
|
3871
|
-
}
|
|
4144
|
+
parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
|
|
3872
4145
|
}
|
|
3873
4146
|
}
|
|
3874
4147
|
if (schemeHandler && schemeHandler.parse) {
|
|
3875
4148
|
schemeHandler.parse(parsed, options);
|
|
4149
|
+
if (schemeHandler === SCHEMES.urn && parsed.nid === void 0) {
|
|
4150
|
+
malformedSchemeSpecific = true;
|
|
4151
|
+
}
|
|
3876
4152
|
}
|
|
3877
4153
|
} else {
|
|
3878
4154
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
3879
4155
|
}
|
|
3880
|
-
return { parsed, malformedAuthorityOrPort };
|
|
4156
|
+
return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
|
|
3881
4157
|
}
|
|
3882
4158
|
function parse(uri, opts) {
|
|
3883
4159
|
return parseWithStatus(uri, opts).parsed;
|
|
@@ -3886,20 +4162,28 @@ var require_fast_uri = __commonJS({
|
|
|
3886
4162
|
return normalizeStringWithStatus(uri, opts).normalized;
|
|
3887
4163
|
}
|
|
3888
4164
|
function normalizeStringWithStatus(uri, opts) {
|
|
3889
|
-
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
4165
|
+
const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
|
|
3890
4166
|
return {
|
|
3891
|
-
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
3892
|
-
malformedAuthorityOrPort
|
|
4167
|
+
normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
|
|
4168
|
+
malformedAuthorityOrPort,
|
|
4169
|
+
malformedPercentEncoding,
|
|
4170
|
+
malformedSchemeSpecific,
|
|
4171
|
+
malformedHost,
|
|
4172
|
+
malformedScheme
|
|
3893
4173
|
};
|
|
3894
4174
|
}
|
|
3895
4175
|
function normalizeComparableURI(uri, opts) {
|
|
3896
|
-
if (typeof uri
|
|
3897
|
-
|
|
3898
|
-
return malformedAuthorityOrPort ? void 0 : normalized;
|
|
4176
|
+
if (typeof uri !== "string" && typeof uri !== "object") {
|
|
4177
|
+
return void 0;
|
|
3899
4178
|
}
|
|
3900
|
-
|
|
3901
|
-
|
|
4179
|
+
let value;
|
|
4180
|
+
try {
|
|
4181
|
+
value = typeof uri === "string" ? uri : serialize(uri, opts);
|
|
4182
|
+
} catch {
|
|
4183
|
+
return void 0;
|
|
3902
4184
|
}
|
|
4185
|
+
const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
|
|
4186
|
+
return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? void 0 : normalized;
|
|
3903
4187
|
}
|
|
3904
4188
|
var fastUri = {
|
|
3905
4189
|
SCHEMES,
|
|
@@ -18317,7 +18601,7 @@ var StdioServerTransport = class {
|
|
|
18317
18601
|
// package.json
|
|
18318
18602
|
var package_default = {
|
|
18319
18603
|
name: "@umbraco-cms/mcp-dev",
|
|
18320
|
-
version: "17.6.
|
|
18604
|
+
version: "17.6.11",
|
|
18321
18605
|
type: "module",
|
|
18322
18606
|
description: "A model context protocol (MCP) server for Umbraco CMS",
|
|
18323
18607
|
main: "dist/index.js",
|
|
@@ -18360,7 +18644,7 @@ var package_default = {
|
|
|
18360
18644
|
"dev:hosted": "wrangler dev"
|
|
18361
18645
|
},
|
|
18362
18646
|
engines: {
|
|
18363
|
-
node: ">=22.
|
|
18647
|
+
node: ">=22.3.0"
|
|
18364
18648
|
},
|
|
18365
18649
|
files: [
|
|
18366
18650
|
"dist",
|
|
@@ -18388,8 +18672,8 @@ var package_default = {
|
|
|
18388
18672
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
18389
18673
|
"@types/uuid": "^10.0.0",
|
|
18390
18674
|
"@types/yargs": "^17.0.33",
|
|
18391
|
-
"@umbraco-cms/mcp-hosted": "^1.0.0-beta.
|
|
18392
|
-
"@umbraco-cms/mcp-server-sdk": "^1.0.0-beta.
|
|
18675
|
+
"@umbraco-cms/mcp-hosted": "^1.0.0-beta.46",
|
|
18676
|
+
"@umbraco-cms/mcp-server-sdk": "^1.0.0-beta.46",
|
|
18393
18677
|
dotenv: "^16.5.0",
|
|
18394
18678
|
"form-data": "^4.0.4",
|
|
18395
18679
|
"mime-types": "^3.0.1",
|
|
@@ -18604,6 +18888,31 @@ var main = async () => {
|
|
|
18604
18888
|
configureApiClient(() => UmbracoManagementClient.getClient());
|
|
18605
18889
|
const client = UmbracoManagementClient.getClient();
|
|
18606
18890
|
const user = await client.getUserCurrent();
|
|
18891
|
+
let serverInfo;
|
|
18892
|
+
let serverInfoError;
|
|
18893
|
+
try {
|
|
18894
|
+
serverInfo = await client.getServerInformation();
|
|
18895
|
+
} catch (error) {
|
|
18896
|
+
serverInfoError = error;
|
|
18897
|
+
}
|
|
18898
|
+
if (serverInfo) {
|
|
18899
|
+
setUmbracoVersion(serverInfo.version);
|
|
18900
|
+
}
|
|
18901
|
+
await checkUmbracoVersion({
|
|
18902
|
+
mcpVersion: package_default.version,
|
|
18903
|
+
// UMBRACO_TARGET_MAJOR is stamped into src/config/umbraco-target.generated.ts
|
|
18904
|
+
// by the orval target-major transformer, from the Umbraco instance the API
|
|
18905
|
+
// client was generated against. Override to point at a different major.
|
|
18906
|
+
// (`?.trim() ||`, not `??`: an env var set to an empty string must still
|
|
18907
|
+
// fall back, or the check silently no-ops with no log output at all.)
|
|
18908
|
+
expectedUmbracoMajor: process.env.UMBRACO_EXPECTED_MAJOR?.trim() || UMBRACO_TARGET_MAJOR,
|
|
18909
|
+
client: {
|
|
18910
|
+
getServerInformation: async () => {
|
|
18911
|
+
if (serverInfo) return serverInfo;
|
|
18912
|
+
throw serverInfoError ?? new Error("Unable to fetch Umbraco server information");
|
|
18913
|
+
}
|
|
18914
|
+
}
|
|
18915
|
+
});
|
|
18607
18916
|
const rawConfig = await getServerConfig2(true);
|
|
18608
18917
|
const configLoader2 = createCollectionConfigLoader2({
|
|
18609
18918
|
modeRegistry: allModes,
|
|
@@ -18611,7 +18920,7 @@ var main = async () => {
|
|
|
18611
18920
|
allSliceNames
|
|
18612
18921
|
});
|
|
18613
18922
|
const filterConfig = configLoader2.loadFromConfig(config);
|
|
18614
|
-
handleCliCommands(availableCollections, {
|
|
18923
|
+
await handleCliCommands(availableCollections, {
|
|
18615
18924
|
cliFlags: rawConfig.cliFlags,
|
|
18616
18925
|
serverName: "Umbraco CMS Developer MCP Server",
|
|
18617
18926
|
serverVersion: package_default.version,
|
|
@@ -18619,18 +18928,6 @@ var main = async () => {
|
|
|
18619
18928
|
filterConfig,
|
|
18620
18929
|
serverConfig: config
|
|
18621
18930
|
});
|
|
18622
|
-
const serverInfo = await client.getServerInformation();
|
|
18623
|
-
setUmbracoVersion(serverInfo.version);
|
|
18624
|
-
await checkUmbracoVersion({
|
|
18625
|
-
mcpVersion: package_default.version,
|
|
18626
|
-
// UMBRACO_TARGET_MAJOR is stamped into src/config/umbraco-target.generated.ts
|
|
18627
|
-
// by the orval target-major transformer, from the Umbraco instance the API
|
|
18628
|
-
// client was generated against. Override to point at a different major.
|
|
18629
|
-
// (`?.trim() ||`, not `??`: an env var set to an empty string must still
|
|
18630
|
-
// fall back, or the check silently no-ops with no log output at all.)
|
|
18631
|
-
expectedUmbracoMajor: process.env.UMBRACO_EXPECTED_MAJOR?.trim() || UMBRACO_TARGET_MAJOR,
|
|
18632
|
-
client: { getServerInformation: async () => serverInfo }
|
|
18633
|
-
});
|
|
18634
18931
|
configureVersionCheckHook();
|
|
18635
18932
|
const versionCheckMessage = getVersionCheckMessage();
|
|
18636
18933
|
const server = new McpServer(
|