fastapi-rtk 0.2.23 → 0.2.25

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.
Files changed (47) hide show
  1. package/dist/.bundled/jsonforms/cjs/_virtual/index10.cjs +2 -2
  2. package/dist/.bundled/jsonforms/cjs/_virtual/index6.cjs +2 -2
  3. package/dist/.bundled/jsonforms/cjs/_virtual/index7.cjs +2 -2
  4. package/dist/.bundled/jsonforms/cjs/_virtual/index8.cjs +2 -2
  5. package/dist/.bundled/jsonforms/cjs/_virtual/index9.cjs +2 -2
  6. package/dist/.bundled/jsonforms/esm/_virtual/index10.mjs +2 -2
  7. package/dist/.bundled/jsonforms/esm/_virtual/index6.mjs +2 -2
  8. package/dist/.bundled/jsonforms/esm/_virtual/index7.mjs +2 -2
  9. package/dist/.bundled/jsonforms/esm/_virtual/index8.mjs +2 -2
  10. package/dist/.bundled/jsonforms/esm/_virtual/index9.mjs +2 -2
  11. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/compile/index.cjs +1 -1
  12. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/runtime/uri.cjs +1 -1
  13. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.cjs +1 -1
  14. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/core/index.cjs +1 -1
  15. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/format/index.cjs +1 -1
  16. package/dist/.external/cjs/ajv@8.17.1/ajv/dist/vocabularies/validation/index.cjs +1 -1
  17. package/dist/.external/cjs/{fast-uri@3.0.6 → fast-uri@3.1.0}/fast-uri/index.cjs +51 -53
  18. package/dist/.external/cjs/fast-uri@3.1.0/fast-uri/lib/schemes.cjs +214 -0
  19. package/dist/.external/cjs/fast-uri@3.1.0/fast-uri/lib/utils.cjs +260 -0
  20. package/dist/.external/esm/ajv@8.17.1/ajv/dist/compile/index.mjs +1 -1
  21. package/dist/.external/esm/ajv@8.17.1/ajv/dist/runtime/uri.mjs +1 -1
  22. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/applicator/index.mjs +1 -1
  23. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/core/index.mjs +1 -1
  24. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/format/index.mjs +1 -1
  25. package/dist/.external/esm/ajv@8.17.1/ajv/dist/vocabularies/validation/index.mjs +1 -1
  26. package/dist/.external/esm/{fast-uri@3.0.6 → fast-uri@3.1.0}/fast-uri/index.mjs +51 -53
  27. package/dist/.external/esm/fast-uri@3.1.0/fast-uri/lib/schemes.mjs +214 -0
  28. package/dist/.external/esm/fast-uri@3.1.0/fast-uri/lib/utils.mjs +260 -0
  29. package/dist/core/cjs/Tables/NextGenDataGrid/NextGenDataGrid.cjs +1 -1
  30. package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/FilterModeDescription.cjs +1 -1
  31. package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useColumns/utils.cjs +8 -2
  32. package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbar/basicToolbars.cjs +1 -1
  33. package/dist/core/cjs/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.cjs +1 -1
  34. package/dist/core/esm/Tables/NextGenDataGrid/NextGenDataGrid.mjs +1 -1
  35. package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/FilterModeDescription.mjs +1 -1
  36. package/dist/core/esm/Tables/NextGenDataGrid/hooks/useColumns/utils.mjs +8 -2
  37. package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbar/basicToolbars.mjs +1 -1
  38. package/dist/core/esm/Tables/NextGenDataGrid/hooks/useToolbarAlertBanner/FASTAPI_RTK_ToolbarAlertBanner.mjs +1 -1
  39. package/package.json +1 -1
  40. package/dist/.external/cjs/fast-uri@3.0.6/fast-uri/lib/schemes.cjs +0 -149
  41. package/dist/.external/cjs/fast-uri@3.0.6/fast-uri/lib/scopedChars.cjs +0 -37
  42. package/dist/.external/cjs/fast-uri@3.0.6/fast-uri/lib/utils.cjs +0 -235
  43. package/dist/.external/esm/fast-uri@3.0.6/fast-uri/lib/schemes.mjs +0 -149
  44. package/dist/.external/esm/fast-uri@3.0.6/fast-uri/lib/scopedChars.mjs +0 -37
  45. package/dist/.external/esm/fast-uri@3.0.6/fast-uri/lib/utils.mjs +0 -235
  46. /package/dist/.external/cjs/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ll5dfnmvjphm4bajaxt6oy7mty → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ug2uc7gqobpur37t5xiwwwh6ay}/mantine-react-table/dist/index.esm.cjs +0 -0
  47. /package/dist/.external/esm/{mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ll5dfnmvjphm4bajaxt6oy7mty → mantine-react-table@2.0.0-beta.9_@mantine_core@7.17.8_@mantine_dates@7.17.8_@mantine_hooks@7._ug2uc7gqobpur37t5xiwwwh6ay}/mantine-react-table/dist/index.esm.mjs +0 -0
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var format = {};
4
- exports.__exports = format;
3
+ var compile = {};
4
+ exports.__exports = compile;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var compile = {};
4
- exports.__exports = compile;
3
+ var core = {};
4
+ exports.__exports = core;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var core = {};
4
- exports.__exports = core;
3
+ var validation = {};
4
+ exports.__exports = validation;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var validation = {};
4
- exports.__exports = validation;
3
+ var applicator = {};
4
+ exports.__exports = applicator;
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- var applicator = {};
4
- exports.__exports = applicator;
3
+ var format = {};
4
+ exports.__exports = format;
@@ -1,4 +1,4 @@
1
- var format = {};
1
+ var compile = {};
2
2
  export {
3
- format as __exports
3
+ compile as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var compile = {};
1
+ var core = {};
2
2
  export {
3
- compile as __exports
3
+ core as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var core = {};
1
+ var validation = {};
2
2
  export {
3
- core as __exports
3
+ validation as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var validation = {};
1
+ var applicator = {};
2
2
  export {
3
- validation as __exports
3
+ applicator as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var applicator = {};
1
+ var format = {};
2
2
  export {
3
- applicator as __exports
3
+ format as __exports
4
4
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../../../.bundled/jsonforms/cjs/_virtual/index6.cjs");
3
+ const index = require("../../../../../../.bundled/jsonforms/cjs/_virtual/index10.cjs");
4
4
  const index$1 = require("./codegen/index.cjs");
5
5
  const validation_error = require("../runtime/validation_error.cjs");
6
6
  const names = require("./names.cjs");
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const uri = require("../../../../../../.bundled/jsonforms/cjs/_virtual/uri.cjs");
4
- const index = require("../../../../fast-uri@3.0.6/fast-uri/index.cjs");
4
+ const index = require("../../../../fast-uri@3.1.0/fast-uri/index.cjs");
5
5
  var hasRequiredUri;
6
6
  function requireUri() {
7
7
  if (hasRequiredUri) return uri.__exports;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index9.cjs");
3
+ const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index8.cjs");
4
4
  const additionalItems = require("./additionalItems.cjs");
5
5
  const prefixItems = require("./prefixItems.cjs");
6
6
  const items = require("./items.cjs");
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index7.cjs");
3
+ const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index6.cjs");
4
4
  const id = require("./id.cjs");
5
5
  const ref = require("./ref.cjs");
6
6
  var hasRequiredCore;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index10.cjs");
3
+ const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index9.cjs");
4
4
  const format = require("./format.cjs");
5
5
  var hasRequiredFormat;
6
6
  function requireFormat() {
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index8.cjs");
3
+ const index = require("../../../../../../../.bundled/jsonforms/cjs/_virtual/index7.cjs");
4
4
  const limitNumber = require("./limitNumber.cjs");
5
5
  const multipleOf = require("./multipleOf.cjs");
6
6
  const limitLength = require("./limitLength.cjs");
@@ -7,22 +7,25 @@ var hasRequiredFastUri;
7
7
  function requireFastUri() {
8
8
  if (hasRequiredFastUri) return index.__module.exports;
9
9
  hasRequiredFastUri = 1;
10
- const { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = utils.__require();
11
- const SCHEMES = schemes.__require();
10
+ const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = utils.__require();
11
+ const { SCHEMES, getSchemeHandler } = schemes.__require();
12
12
  function normalize(uri, options) {
13
13
  if (typeof uri === "string") {
14
- uri = serialize(parse(uri, options), options);
14
+ uri = /** @type {T} */
15
+ serialize(parse(uri, options), options);
15
16
  } else if (typeof uri === "object") {
16
- uri = parse(serialize(uri, options), options);
17
+ uri = /** @type {T} */
18
+ parse(serialize(uri, options), options);
17
19
  }
18
20
  return uri;
19
21
  }
20
22
  function resolve(baseURI, relativeURI, options) {
21
- const schemelessOptions = Object.assign({ scheme: "null" }, options);
22
- const resolved = resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
23
- return serialize(resolved, { ...schemelessOptions, skipEscape: true });
23
+ const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
24
+ const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
25
+ schemelessOptions.skipEscape = true;
26
+ return serialize(resolved, schemelessOptions);
24
27
  }
25
- function resolveComponents(base, relative, options, skipNormalization) {
28
+ function resolveComponent(base, relative, options, skipNormalization) {
26
29
  const target = {};
27
30
  if (!skipNormalization) {
28
31
  base = parse(serialize(base, options), options);
@@ -52,7 +55,7 @@ function requireFastUri() {
52
55
  target.query = base.query;
53
56
  }
54
57
  } else {
55
- if (relative.path.charAt(0) === "/") {
58
+ if (relative.path[0] === "/") {
56
59
  target.path = removeDotSegments(relative.path);
57
60
  } else {
58
61
  if ((base.userinfo !== void 0 || base.host !== void 0 || base.port !== void 0) && !base.path) {
@@ -91,7 +94,7 @@ function requireFastUri() {
91
94
  return uriA.toLowerCase() === uriB.toLowerCase();
92
95
  }
93
96
  function serialize(cmpts, opts) {
94
- const components = {
97
+ const component = {
95
98
  host: cmpts.host,
96
99
  scheme: cmpts.scheme,
97
100
  userinfo: cmpts.userinfo,
@@ -109,60 +112,49 @@ function requireFastUri() {
109
112
  };
110
113
  const options = Object.assign({}, opts);
111
114
  const uriTokens = [];
112
- const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
113
- if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
114
- if (components.path !== void 0) {
115
+ const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
116
+ if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
117
+ if (component.path !== void 0) {
115
118
  if (!options.skipEscape) {
116
- components.path = escape(components.path);
117
- if (components.scheme !== void 0) {
118
- components.path = components.path.split("%3A").join(":");
119
+ component.path = escape(component.path);
120
+ if (component.scheme !== void 0) {
121
+ component.path = component.path.split("%3A").join(":");
119
122
  }
120
123
  } else {
121
- components.path = unescape(components.path);
124
+ component.path = unescape(component.path);
122
125
  }
123
126
  }
124
- if (options.reference !== "suffix" && components.scheme) {
125
- uriTokens.push(components.scheme, ":");
127
+ if (options.reference !== "suffix" && component.scheme) {
128
+ uriTokens.push(component.scheme, ":");
126
129
  }
127
- const authority = recomposeAuthority(components);
130
+ const authority = recomposeAuthority(component);
128
131
  if (authority !== void 0) {
129
132
  if (options.reference !== "suffix") {
130
133
  uriTokens.push("//");
131
134
  }
132
135
  uriTokens.push(authority);
133
- if (components.path && components.path.charAt(0) !== "/") {
136
+ if (component.path && component.path[0] !== "/") {
134
137
  uriTokens.push("/");
135
138
  }
136
139
  }
137
- if (components.path !== void 0) {
138
- let s = components.path;
140
+ if (component.path !== void 0) {
141
+ let s = component.path;
139
142
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
140
143
  s = removeDotSegments(s);
141
144
  }
142
- if (authority === void 0) {
143
- s = s.replace(/^\/\//u, "/%2F");
145
+ if (authority === void 0 && s[0] === "/" && s[1] === "/") {
146
+ s = "/%2F" + s.slice(2);
144
147
  }
145
148
  uriTokens.push(s);
146
149
  }
147
- if (components.query !== void 0) {
148
- uriTokens.push("?", components.query);
150
+ if (component.query !== void 0) {
151
+ uriTokens.push("?", component.query);
149
152
  }
150
- if (components.fragment !== void 0) {
151
- uriTokens.push("#", components.fragment);
153
+ if (component.fragment !== void 0) {
154
+ uriTokens.push("#", component.fragment);
152
155
  }
153
156
  return uriTokens.join("");
154
157
  }
155
- const hexLookUp = Array.from({ length: 127 }, (_v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k)));
156
- function nonSimpleDomain(value) {
157
- let code = 0;
158
- for (let i = 0, len = value.length; i < len; ++i) {
159
- code = value.charCodeAt(i);
160
- if (code > 126 || hexLookUp[code]) {
161
- return true;
162
- }
163
- }
164
- return false;
165
- }
166
158
  const URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
167
159
  function parse(uri, opts) {
168
160
  const options = Object.assign({}, opts);
@@ -175,9 +167,14 @@ function requireFastUri() {
175
167
  query: void 0,
176
168
  fragment: void 0
177
169
  };
178
- const gotEncoding = uri.indexOf("%") !== -1;
179
170
  let isIP = false;
180
- if (options.reference === "suffix") uri = (options.scheme ? options.scheme + ":" : "") + "//" + uri;
171
+ if (options.reference === "suffix") {
172
+ if (options.scheme) {
173
+ uri = options.scheme + ":" + uri;
174
+ } else {
175
+ uri = "//" + uri;
176
+ }
177
+ }
181
178
  const matches = uri.match(URI_PARSE);
182
179
  if (matches) {
183
180
  parsed.scheme = matches[1];
@@ -191,13 +188,12 @@ function requireFastUri() {
191
188
  parsed.port = matches[5];
192
189
  }
193
190
  if (parsed.host) {
194
- const ipv4result = normalizeIPv4(parsed.host);
195
- if (ipv4result.isIPV4 === false) {
196
- const ipv6result = normalizeIPv6(ipv4result.host);
191
+ const ipv4result = isIPv4(parsed.host);
192
+ if (ipv4result === false) {
193
+ const ipv6result = normalizeIPv6(parsed.host);
197
194
  parsed.host = ipv6result.host.toLowerCase();
198
195
  isIP = ipv6result.isIPV6;
199
196
  } else {
200
- parsed.host = ipv4result.host;
201
197
  isIP = true;
202
198
  }
203
199
  }
@@ -213,7 +209,7 @@ function requireFastUri() {
213
209
  if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
214
210
  parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
215
211
  }
216
- const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || "").toLowerCase()];
212
+ const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
217
213
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
218
214
  if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
219
215
  try {
@@ -224,11 +220,13 @@ function requireFastUri() {
224
220
  }
225
221
  }
226
222
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
227
- if (gotEncoding && parsed.scheme !== void 0) {
228
- parsed.scheme = unescape(parsed.scheme);
229
- }
230
- if (gotEncoding && parsed.host !== void 0) {
231
- parsed.host = unescape(parsed.host);
223
+ if (uri.indexOf("%") !== -1) {
224
+ if (parsed.scheme !== void 0) {
225
+ parsed.scheme = unescape(parsed.scheme);
226
+ }
227
+ if (parsed.host !== void 0) {
228
+ parsed.host = unescape(parsed.host);
229
+ }
232
230
  }
233
231
  if (parsed.path) {
234
232
  parsed.path = escape(unescape(parsed.path));
@@ -249,7 +247,7 @@ function requireFastUri() {
249
247
  SCHEMES,
250
248
  normalize,
251
249
  resolve,
252
- resolveComponents,
250
+ resolveComponent,
253
251
  equal,
254
252
  serialize,
255
253
  parse
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const utils = require("./utils.cjs");
4
+ var schemes;
5
+ var hasRequiredSchemes;
6
+ function requireSchemes() {
7
+ if (hasRequiredSchemes) return schemes;
8
+ hasRequiredSchemes = 1;
9
+ const { isUUID } = utils.__require();
10
+ const URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
11
+ const supportedSchemeNames = (
12
+ /** @type {const} */
13
+ [
14
+ "http",
15
+ "https",
16
+ "ws",
17
+ "wss",
18
+ "urn",
19
+ "urn:uuid"
20
+ ]
21
+ );
22
+ function isValidSchemeName(name) {
23
+ return supportedSchemeNames.indexOf(
24
+ /** @type {*} */
25
+ name
26
+ ) !== -1;
27
+ }
28
+ function wsIsSecure(wsComponent) {
29
+ if (wsComponent.secure === true) {
30
+ return true;
31
+ } else if (wsComponent.secure === false) {
32
+ return false;
33
+ } else if (wsComponent.scheme) {
34
+ return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === "w" || wsComponent.scheme[0] === "W") && (wsComponent.scheme[1] === "s" || wsComponent.scheme[1] === "S") && (wsComponent.scheme[2] === "s" || wsComponent.scheme[2] === "S");
35
+ } else {
36
+ return false;
37
+ }
38
+ }
39
+ function httpParse(component) {
40
+ if (!component.host) {
41
+ component.error = component.error || "HTTP URIs must have a host.";
42
+ }
43
+ return component;
44
+ }
45
+ function httpSerialize(component) {
46
+ const secure = String(component.scheme).toLowerCase() === "https";
47
+ if (component.port === (secure ? 443 : 80) || component.port === "") {
48
+ component.port = void 0;
49
+ }
50
+ if (!component.path) {
51
+ component.path = "/";
52
+ }
53
+ return component;
54
+ }
55
+ function wsParse(wsComponent) {
56
+ wsComponent.secure = wsIsSecure(wsComponent);
57
+ wsComponent.resourceName = (wsComponent.path || "/") + (wsComponent.query ? "?" + wsComponent.query : "");
58
+ wsComponent.path = void 0;
59
+ wsComponent.query = void 0;
60
+ return wsComponent;
61
+ }
62
+ function wsSerialize(wsComponent) {
63
+ if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === "") {
64
+ wsComponent.port = void 0;
65
+ }
66
+ if (typeof wsComponent.secure === "boolean") {
67
+ wsComponent.scheme = wsComponent.secure ? "wss" : "ws";
68
+ wsComponent.secure = void 0;
69
+ }
70
+ if (wsComponent.resourceName) {
71
+ const [path, query] = wsComponent.resourceName.split("?");
72
+ wsComponent.path = path && path !== "/" ? path : void 0;
73
+ wsComponent.query = query;
74
+ wsComponent.resourceName = void 0;
75
+ }
76
+ wsComponent.fragment = void 0;
77
+ return wsComponent;
78
+ }
79
+ function urnParse(urnComponent, options) {
80
+ if (!urnComponent.path) {
81
+ urnComponent.error = "URN can not be parsed";
82
+ return urnComponent;
83
+ }
84
+ const matches = urnComponent.path.match(URN_REG);
85
+ if (matches) {
86
+ const scheme = options.scheme || urnComponent.scheme || "urn";
87
+ urnComponent.nid = matches[1].toLowerCase();
88
+ urnComponent.nss = matches[2];
89
+ const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`;
90
+ const schemeHandler = getSchemeHandler(urnScheme);
91
+ urnComponent.path = void 0;
92
+ if (schemeHandler) {
93
+ urnComponent = schemeHandler.parse(urnComponent, options);
94
+ }
95
+ } else {
96
+ urnComponent.error = urnComponent.error || "URN can not be parsed.";
97
+ }
98
+ return urnComponent;
99
+ }
100
+ function urnSerialize(urnComponent, options) {
101
+ if (urnComponent.nid === void 0) {
102
+ throw new Error("URN without nid cannot be serialized");
103
+ }
104
+ const scheme = options.scheme || urnComponent.scheme || "urn";
105
+ const nid = urnComponent.nid.toLowerCase();
106
+ const urnScheme = `${scheme}:${options.nid || nid}`;
107
+ const schemeHandler = getSchemeHandler(urnScheme);
108
+ if (schemeHandler) {
109
+ urnComponent = schemeHandler.serialize(urnComponent, options);
110
+ }
111
+ const uriComponent = urnComponent;
112
+ const nss = urnComponent.nss;
113
+ uriComponent.path = `${nid || options.nid}:${nss}`;
114
+ options.skipEscape = true;
115
+ return uriComponent;
116
+ }
117
+ function urnuuidParse(urnComponent, options) {
118
+ const uuidComponent = urnComponent;
119
+ uuidComponent.uuid = uuidComponent.nss;
120
+ uuidComponent.nss = void 0;
121
+ if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
122
+ uuidComponent.error = uuidComponent.error || "UUID is not valid.";
123
+ }
124
+ return uuidComponent;
125
+ }
126
+ function urnuuidSerialize(uuidComponent) {
127
+ const urnComponent = uuidComponent;
128
+ urnComponent.nss = (uuidComponent.uuid || "").toLowerCase();
129
+ return urnComponent;
130
+ }
131
+ const http = (
132
+ /** @type {SchemeHandler} */
133
+ {
134
+ scheme: "http",
135
+ domainHost: true,
136
+ parse: httpParse,
137
+ serialize: httpSerialize
138
+ }
139
+ );
140
+ const https = (
141
+ /** @type {SchemeHandler} */
142
+ {
143
+ scheme: "https",
144
+ domainHost: http.domainHost,
145
+ parse: httpParse,
146
+ serialize: httpSerialize
147
+ }
148
+ );
149
+ const ws = (
150
+ /** @type {SchemeHandler} */
151
+ {
152
+ scheme: "ws",
153
+ domainHost: true,
154
+ parse: wsParse,
155
+ serialize: wsSerialize
156
+ }
157
+ );
158
+ const wss = (
159
+ /** @type {SchemeHandler} */
160
+ {
161
+ scheme: "wss",
162
+ domainHost: ws.domainHost,
163
+ parse: ws.parse,
164
+ serialize: ws.serialize
165
+ }
166
+ );
167
+ const urn = (
168
+ /** @type {SchemeHandler} */
169
+ {
170
+ scheme: "urn",
171
+ parse: urnParse,
172
+ serialize: urnSerialize,
173
+ skipNormalize: true
174
+ }
175
+ );
176
+ const urnuuid = (
177
+ /** @type {SchemeHandler} */
178
+ {
179
+ scheme: "urn:uuid",
180
+ parse: urnuuidParse,
181
+ serialize: urnuuidSerialize,
182
+ skipNormalize: true
183
+ }
184
+ );
185
+ const SCHEMES = (
186
+ /** @type {Record<SchemeName, SchemeHandler>} */
187
+ {
188
+ http,
189
+ https,
190
+ ws,
191
+ wss,
192
+ urn,
193
+ "urn:uuid": urnuuid
194
+ }
195
+ );
196
+ Object.setPrototypeOf(SCHEMES, null);
197
+ function getSchemeHandler(scheme) {
198
+ return scheme && (SCHEMES[
199
+ /** @type {SchemeName} */
200
+ scheme
201
+ ] || SCHEMES[
202
+ /** @type {SchemeName} */
203
+ scheme.toLowerCase()
204
+ ]) || void 0;
205
+ }
206
+ schemes = {
207
+ wsIsSecure,
208
+ SCHEMES,
209
+ isValidSchemeName,
210
+ getSchemeHandler
211
+ };
212
+ return schemes;
213
+ }
214
+ exports.__require = requireSchemes;