@testgorilla/tgo-ui 11.22.0 → 11.22.1

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/mcp/server.mjs CHANGED
@@ -3336,6 +3336,37 @@ var require_utils = __commonJS({
3336
3336
  }
3337
3337
  return output.join("");
3338
3338
  }
3339
+ function removeDotSegmentsRelative(path3) {
3340
+ if (path3 === "" || path3[0] === "/") {
3341
+ return removeDotSegments(path3);
3342
+ }
3343
+ const segments = path3.split("/");
3344
+ const last = segments.length - 1;
3345
+ const output = [];
3346
+ let trailingDirectory = false;
3347
+ for (let i = 0; i <= last; i++) {
3348
+ const segment = segments[i];
3349
+ if (segment === "." || segment === "..") {
3350
+ if (segment === "..") {
3351
+ if (output.length !== 0 && output[output.length - 1] !== "..") {
3352
+ output.pop();
3353
+ } else {
3354
+ output.push("..");
3355
+ }
3356
+ }
3357
+ trailingDirectory = i === last;
3358
+ } else {
3359
+ output.push(segment);
3360
+ }
3361
+ }
3362
+ if (trailingDirectory && output[output.length - 1] !== "..") {
3363
+ output.push("");
3364
+ }
3365
+ if (output.length === 0 || output[0] === "" || output[0].includes(":")) {
3366
+ output.unshift(".");
3367
+ }
3368
+ return output.join("/");
3369
+ }
3339
3370
  var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
3340
3371
  var HOST_DELIM_RE = /[@/?#:]/g;
3341
3372
  var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
@@ -3596,6 +3627,7 @@ var require_utils = __commonJS({
3596
3627
  encodeFragment,
3597
3628
  escapePreservingEscapes,
3598
3629
  removeDotSegments,
3630
+ removeDotSegmentsRelative,
3599
3631
  isIPv4,
3600
3632
  isUUID,
3601
3633
  normalizeIPv6,
@@ -3819,16 +3851,18 @@ var require_schemes = __commonJS({
3819
3851
  var require_fast_uri = __commonJS({
3820
3852
  "node_modules/fast-uri/index.js"(exports, module) {
3821
3853
  "use strict";
3822
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3854
+ var { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
3823
3855
  var { SCHEMES, getSchemeHandler } = require_schemes();
3824
3856
  var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
3825
3857
  var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
3826
- function decodeValidScheme(scheme) {
3827
- const decodedScheme = unescape(String(scheme));
3828
- if (!VALID_SCHEME.test(decodedScheme)) {
3858
+ var MALFORMED_HOST_ERROR = "URI host is malformed.";
3859
+ var FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u;
3860
+ function validateScheme(scheme) {
3861
+ const stringScheme = String(scheme);
3862
+ if (!VALID_SCHEME.test(stringScheme)) {
3829
3863
  throw new TypeError(MALFORMED_SCHEME_ERROR);
3830
3864
  }
3831
- return decodedScheme;
3865
+ return stringScheme;
3832
3866
  }
3833
3867
  function normalize2(uri, options) {
3834
3868
  if (typeof uri === "string") {
@@ -3865,6 +3899,9 @@ var require_fast_uri = __commonJS({
3865
3899
  const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
3866
3900
  const resolvedHost = resolved.host;
3867
3901
  const resolvedHostIsIP = resolvedHost !== void 0 && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
3902
+ if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {
3903
+ throw new Error(MALFORMED_HOST_ERROR);
3904
+ }
3868
3905
  canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
3869
3906
  const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !new RegExp("\\P{ASCII}", "u").test(resolvedHost);
3870
3907
  if (resolved.error && !encodedASCIIHost) {
@@ -3906,14 +3943,15 @@ var require_fast_uri = __commonJS({
3906
3943
  if (relative.path[0] === "/") {
3907
3944
  target.path = removeDotSegments(relative.path);
3908
3945
  } else {
3909
- if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
3946
+ const baseHasAuthority = base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0;
3947
+ if (baseHasAuthority && !base.path) {
3910
3948
  target.path = "/" + relative.path;
3911
3949
  } else if (!base.path) {
3912
3950
  target.path = relative.path;
3913
3951
  } else {
3914
3952
  target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
3915
3953
  }
3916
- target.path = removeDotSegments(target.path);
3954
+ target.path = base.scheme === void 0 && !baseHasAuthority && target.path[0] !== "/" ? removeDotSegmentsRelative(target.path) : removeDotSegments(target.path);
3917
3955
  }
3918
3956
  target.query = relative.query;
3919
3957
  }
@@ -3951,12 +3989,13 @@ var require_fast_uri = __commonJS({
3951
3989
  const options = Object.assign({}, opts);
3952
3990
  const uriTokens = [];
3953
3991
  if (component.scheme) {
3954
- component.scheme = decodeValidScheme(component.scheme);
3992
+ component.scheme = validateScheme(component.scheme);
3955
3993
  }
3956
3994
  const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
3957
3995
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
3958
3996
  const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
3959
- const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
3997
+ const schemelessReference = (component.scheme === void 0 || options.reference === "suffix") && !hasAuthority;
3998
+ const pathNoScheme = !options.skipEscape && schemelessReference;
3960
3999
  if (component.path !== void 0) {
3961
4000
  if (!options.skipEscape) {
3962
4001
  component.path = serializePathEncoding(component.path, pathNoScheme);
@@ -3965,7 +4004,7 @@ var require_fast_uri = __commonJS({
3965
4004
  }
3966
4005
  }
3967
4006
  if (options.reference !== "suffix" && component.scheme) {
3968
- component.scheme = decodeValidScheme(component.scheme);
4007
+ component.scheme = validateScheme(component.scheme);
3969
4008
  uriTokens.push(component.scheme, ":");
3970
4009
  }
3971
4010
  const authority = recomposeAuthority(component);
@@ -3981,9 +4020,9 @@ var require_fast_uri = __commonJS({
3981
4020
  if (component.path !== void 0) {
3982
4021
  let s = component.path;
3983
4022
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
3984
- s = removeDotSegments(s);
4023
+ s = schemelessReference && s[0] !== "/" ? removeDotSegmentsRelative(s) : removeDotSegments(s);
3985
4024
  }
3986
- if (pathNoScheme) {
4025
+ if (schemelessReference) {
3987
4026
  s = serializePathEncoding(s, true);
3988
4027
  }
3989
4028
  if (authority === void 0 && s[0] === "/" && s[1] === "/") {
@@ -4030,16 +4069,34 @@ var require_fast_uri = __commonJS({
4030
4069
  return hasMalformedPercentEncoding(matches[3]) || host !== void 0 && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
4031
4070
  }
4032
4071
  function canonicalizeHost(parsed, options, schemeHandler, isIP) {
4072
+ if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {
4073
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
4074
+ return true;
4075
+ }
4033
4076
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
4077
+ let url;
4034
4078
  try {
4035
- parsed.host = new URL("http://" + parsed.host).hostname;
4079
+ url = new URL("http://" + parsed.host);
4036
4080
  } catch (e) {
4037
4081
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
4038
4082
  return true;
4039
4083
  }
4084
+ if (!isHostOnlyURL(url)) {
4085
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
4086
+ return true;
4087
+ }
4088
+ parsed.host = url.hostname;
4040
4089
  }
4041
4090
  return false;
4042
4091
  }
4092
+ function hasForbiddenDomainHost(parsed, options, schemeHandler, isIP) {
4093
+ return Boolean(
4094
+ parsed.host && isIP === false && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host)
4095
+ );
4096
+ }
4097
+ function isHostOnlyURL(url) {
4098
+ return url.username === "" && url.password === "" && url.port === "" && url.pathname === "/" && url.search === "" && url.hash === "" && url.hostname !== "";
4099
+ }
4043
4100
  function parseWithStatus(uri, opts) {
4044
4101
  const options = Object.assign({}, opts);
4045
4102
  const parsed = {
@@ -4094,9 +4151,8 @@ var require_fast_uri = __commonJS({
4094
4151
  parsed.query = matches[7];
4095
4152
  parsed.fragment = matches[8];
4096
4153
  if (parsed.scheme !== void 0) {
4097
- const decodedScheme = unescape(parsed.scheme);
4098
- if (VALID_SCHEME.test(decodedScheme)) {
4099
- parsed.scheme = decodedScheme.toLowerCase();
4154
+ if (VALID_SCHEME.test(parsed.scheme)) {
4155
+ parsed.scheme = parsed.scheme.toLowerCase();
4100
4156
  } else {
4101
4157
  parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
4102
4158
  malformedScheme = true;
@@ -4124,7 +4180,7 @@ var require_fast_uri = __commonJS({
4124
4180
  malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
4125
4181
  parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
4126
4182
  if (malformedIPLiteral) {
4127
- parsed.error = parsed.error || "URI host is malformed.";
4183
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR;
4128
4184
  malformedAuthorityOrPort = true;
4129
4185
  }
4130
4186
  } else {
@@ -4152,7 +4208,7 @@ var require_fast_uri = __commonJS({
4152
4208
  if (!isIP) {
4153
4209
  host = normalizePercentEncoding(host.toLowerCase());
4154
4210
  }
4155
- parsed.host = reescapeHostDelimiters(host, isIP);
4211
+ parsed.host = isIP || options.scheme !== "null" ? reescapeHostDelimiters(host, isIP) : host;
4156
4212
  }
4157
4213
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
4158
4214
  if (parsed.path) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@testgorilla/tgo-ui",
3
- "version": "11.22.0",
3
+ "version": "11.22.1",
4
4
  "license": "proprietary-license",
5
5
  "lint-staged": {
6
6
  "{projects,components}/**/*.ts": [
@@ -62,7 +62,7 @@
62
62
  "postcss": "^8.5.18"
63
63
  },
64
64
  "@angular/build": {
65
- "undici": "^7.29.0",
65
+ "undici": "^7.30.1",
66
66
  "vite": "~7.3.7"
67
67
  },
68
68
  "ng-packagr": {
@@ -74,7 +74,9 @@
74
74
  },
75
75
  "less": "^4.8.1",
76
76
  "webpack-dev-middleware": "^7.4.6",
77
- "piscina": "^5.3.2"
77
+ "piscina": "^5.3.2",
78
+ "undici@7": "^7.30.1",
79
+ "undici@6": "^6.29.1"
78
80
  },
79
81
  "module": "fesm2022/testgorilla-tgo-ui.mjs",
80
82
  "typings": "types/testgorilla-tgo-ui.d.ts",