trusty-cms 5.0.6 → 5.0.7

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 (156) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +60 -59
  3. data/app/models/asset.rb +8 -2
  4. data/app/views/admin/assets/_asset_table.html.haml +1 -1
  5. data/app/views/admin/assets/_search.html.haml +1 -1
  6. data/app/views/admin/assets/_search_results.html.haml +2 -2
  7. data/app/views/admin/assets/edit.html.haml +5 -5
  8. data/app/views/admin/assets/index.html.haml +1 -1
  9. data/app/views/admin/configuration/_clipped_show.html.haml +1 -1
  10. data/app/views/admin/pages/_asset_popups.html.haml +5 -5
  11. data/app/views/admin/removed/_assets_bucket.html.haml +2 -2
  12. data/app/views/admin/removed/_assets_container.html.haml +6 -6
  13. data/app/views/admin/removed/_bucket.html.haml +1 -1
  14. data/app/views/admin/removed/_upload_to_page.html.haml +1 -1
  15. data/app/views/admin/sites/_form.haml +2 -2
  16. data/app/views/admin/snippets/edit.html.haml +1 -1
  17. data/app/views/admin/snippets/new.html.haml +1 -1
  18. data/config/database.yml +4 -0
  19. data/coverage/index.html +154 -154
  20. data/lib/generators/extension_controller/templates/view_spec.rb +1 -1
  21. data/lib/generators/generator_base_extension.rb +0 -1
  22. data/lib/generators/instance/instance_generator.rb +1 -1
  23. data/lib/generators/language_extension/language_extension_generator.rb +0 -1
  24. data/lib/generators/language_extension/templates/test_helper.rb +0 -1
  25. data/lib/generators/trusty_cms/trusty_cms_generator.rb +0 -2
  26. data/lib/trusty_cms.rb +1 -1
  27. data/node_modules/ajv/README.md +158 -72
  28. data/node_modules/ajv/dist/ajv.bundle.js +136 -112
  29. data/node_modules/ajv/dist/ajv.min.js +2 -2
  30. data/node_modules/ajv/dist/ajv.min.js.map +1 -1
  31. data/node_modules/ajv/lib/ajv.d.ts +3 -1
  32. data/node_modules/ajv/lib/compile/equal.js +1 -1
  33. data/node_modules/ajv/lib/compile/formats.js +4 -4
  34. data/node_modules/ajv/lib/compile/index.js +1 -1
  35. data/node_modules/ajv/lib/compile/util.js +9 -44
  36. data/node_modules/ajv/lib/data.js +1 -1
  37. data/node_modules/ajv/lib/definition_schema.js +1 -1
  38. data/node_modules/ajv/lib/dot/_limit.jst +9 -0
  39. data/node_modules/ajv/lib/dot/_limitItems.jst +2 -0
  40. data/node_modules/ajv/lib/dot/_limitLength.jst +2 -0
  41. data/node_modules/ajv/lib/dot/_limitProperties.jst +2 -0
  42. data/node_modules/ajv/lib/dot/allOf.jst +0 -2
  43. data/node_modules/ajv/lib/dot/anyOf.jst +0 -2
  44. data/node_modules/ajv/lib/dot/coerce.def +18 -28
  45. data/node_modules/ajv/lib/dot/contains.jst +0 -2
  46. data/node_modules/ajv/lib/dot/definitions.def +9 -7
  47. data/node_modules/ajv/lib/dot/dependencies.jst +1 -2
  48. data/node_modules/ajv/lib/dot/if.jst +0 -2
  49. data/node_modules/ajv/lib/dot/items.jst +0 -2
  50. data/node_modules/ajv/lib/dot/multipleOf.jst +2 -0
  51. data/node_modules/ajv/lib/dot/properties.jst +6 -5
  52. data/node_modules/ajv/lib/dot/propertyNames.jst +0 -2
  53. data/node_modules/ajv/lib/dot/uniqueItems.jst +1 -1
  54. data/node_modules/ajv/lib/dot/validate.jst +3 -9
  55. data/node_modules/ajv/lib/dotjs/_limit.js +6 -0
  56. data/node_modules/ajv/lib/dotjs/_limitItems.js +3 -0
  57. data/node_modules/ajv/lib/dotjs/_limitLength.js +3 -0
  58. data/node_modules/ajv/lib/dotjs/_limitProperties.js +3 -0
  59. data/node_modules/ajv/lib/dotjs/allOf.js +1 -2
  60. data/node_modules/ajv/lib/dotjs/anyOf.js +1 -2
  61. data/node_modules/ajv/lib/dotjs/contains.js +1 -2
  62. data/node_modules/ajv/lib/dotjs/dependencies.js +2 -2
  63. data/node_modules/ajv/lib/dotjs/if.js +2 -3
  64. data/node_modules/ajv/lib/dotjs/items.js +3 -4
  65. data/node_modules/ajv/lib/dotjs/multipleOf.js +3 -0
  66. data/node_modules/ajv/lib/dotjs/not.js +1 -1
  67. data/node_modules/ajv/lib/dotjs/oneOf.js +1 -1
  68. data/node_modules/ajv/lib/dotjs/properties.js +11 -6
  69. data/node_modules/ajv/lib/dotjs/propertyNames.js +1 -2
  70. data/node_modules/ajv/lib/dotjs/required.js +1 -1
  71. data/node_modules/ajv/lib/dotjs/uniqueItems.js +1 -1
  72. data/node_modules/ajv/lib/dotjs/validate.js +13 -25
  73. data/node_modules/ajv/lib/keyword.js +1 -1
  74. data/node_modules/ajv/lib/refs/data.json +1 -1
  75. data/node_modules/ajv/lib/refs/json-schema-secure.json +1 -1
  76. data/node_modules/ajv/package.json +18 -10
  77. data/node_modules/ajv/scripts/info +0 -0
  78. data/node_modules/ajv/scripts/prepare-tests +0 -0
  79. data/node_modules/ajv/scripts/publish-built-version +1 -1
  80. data/node_modules/ajv/scripts/travis-gh-pages +1 -1
  81. data/node_modules/fast-deep-equal/es6/index.d.ts +1 -1
  82. data/node_modules/fast-deep-equal/es6/react.d.ts +1 -1
  83. data/node_modules/fast-deep-equal/package.json +7 -7
  84. data/node_modules/fast-deep-equal/react.d.ts +1 -1
  85. data/node_modules/uri-js/LICENSE +11 -0
  86. data/node_modules/uri-js/README.md +22 -18
  87. data/node_modules/uri-js/dist/es5/uri.all.d.ts +59 -59
  88. data/node_modules/uri-js/dist/es5/uri.all.js +61 -7
  89. data/node_modules/uri-js/dist/es5/uri.all.js.map +1 -1
  90. data/node_modules/uri-js/dist/es5/uri.all.min.d.ts +59 -59
  91. data/node_modules/uri-js/dist/es5/uri.all.min.js +2 -2
  92. data/node_modules/uri-js/dist/es5/uri.all.min.js.map +1 -1
  93. data/node_modules/uri-js/dist/esnext/index.d.ts +1 -1
  94. data/node_modules/uri-js/dist/esnext/index.js +16 -12
  95. data/node_modules/uri-js/dist/esnext/index.js.map +1 -1
  96. data/node_modules/uri-js/dist/esnext/regexps-iri.d.ts +3 -3
  97. data/node_modules/uri-js/dist/esnext/regexps-iri.js +2 -2
  98. data/node_modules/uri-js/dist/esnext/regexps-iri.js.map +0 -0
  99. data/node_modules/uri-js/dist/esnext/regexps-uri.d.ts +4 -4
  100. data/node_modules/uri-js/dist/esnext/regexps-uri.js +41 -41
  101. data/node_modules/uri-js/dist/esnext/regexps-uri.js.map +0 -0
  102. data/node_modules/uri-js/dist/esnext/schemes/http.d.ts +3 -3
  103. data/node_modules/uri-js/dist/esnext/schemes/http.js +27 -26
  104. data/node_modules/uri-js/dist/esnext/schemes/http.js.map +1 -1
  105. data/node_modules/uri-js/dist/esnext/schemes/https.d.ts +3 -3
  106. data/node_modules/uri-js/dist/esnext/schemes/https.js +8 -8
  107. data/node_modules/uri-js/dist/esnext/schemes/https.js.map +0 -0
  108. data/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts +12 -12
  109. data/node_modules/uri-js/dist/esnext/schemes/mailto.js +0 -0
  110. data/node_modules/uri-js/dist/esnext/schemes/mailto.js.map +0 -0
  111. data/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts +7 -7
  112. data/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js +22 -22
  113. data/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map +0 -0
  114. data/node_modules/uri-js/dist/esnext/schemes/urn.d.ts +10 -10
  115. data/node_modules/uri-js/dist/esnext/schemes/urn.js +48 -48
  116. data/node_modules/uri-js/dist/esnext/schemes/urn.js.map +0 -0
  117. data/node_modules/uri-js/dist/esnext/schemes/ws.d.ts +7 -0
  118. data/node_modules/uri-js/dist/esnext/schemes/ws.js +41 -0
  119. data/node_modules/uri-js/dist/esnext/schemes/ws.js.map +1 -0
  120. data/node_modules/uri-js/dist/esnext/schemes/wss.d.ts +3 -0
  121. data/node_modules/uri-js/dist/esnext/schemes/wss.js +9 -0
  122. data/node_modules/uri-js/dist/esnext/schemes/wss.js.map +1 -0
  123. data/node_modules/uri-js/dist/esnext/uri.d.ts +59 -59
  124. data/node_modules/uri-js/dist/esnext/uri.js +2 -2
  125. data/node_modules/uri-js/dist/esnext/uri.js.map +1 -1
  126. data/node_modules/uri-js/dist/esnext/util.d.ts +6 -6
  127. data/node_modules/uri-js/dist/esnext/util.js +35 -35
  128. data/node_modules/uri-js/dist/esnext/util.js.map +0 -0
  129. data/node_modules/uri-js/package.json +19 -7
  130. data/node_modules/uri-js/yarn.lock +1271 -615
  131. data/spec/dummy/log/test.log +635 -0
  132. data/spec/dummy/tmp/cache/747/A70/TrustyCms%3A%3AConfig +0 -0
  133. data/spec/dummy/tmp/cache/85C/FA0/TrustyCms.cache_mtime +1 -0
  134. data/trusty_cms.gemspec +2 -1
  135. data/yarn.lock +9 -9
  136. metadata +48 -57
  137. data/node_modules/uri-js/bower.json +0 -47
  138. data/node_modules/uri-js/rollup.config.js +0 -32
  139. data/node_modules/uri-js/src/index.ts +0 -18
  140. data/node_modules/uri-js/src/punycode.d.ts +0 -24
  141. data/node_modules/uri-js/src/regexps-iri.ts +0 -4
  142. data/node_modules/uri-js/src/regexps-uri.ts +0 -89
  143. data/node_modules/uri-js/src/schemes/http.ts +0 -36
  144. data/node_modules/uri-js/src/schemes/https.ts +0 -11
  145. data/node_modules/uri-js/src/schemes/mailto.ts +0 -182
  146. data/node_modules/uri-js/src/schemes/urn-uuid.ts +0 -36
  147. data/node_modules/uri-js/src/schemes/urn.ts +0 -69
  148. data/node_modules/uri-js/src/uri.ts +0 -556
  149. data/node_modules/uri-js/src/util.ts +0 -40
  150. data/node_modules/uri-js/tests/qunit.css +0 -118
  151. data/node_modules/uri-js/tests/qunit.js +0 -1042
  152. data/node_modules/uri-js/tests/test-es5-min.html +0 -17
  153. data/node_modules/uri-js/tests/test-es5.html +0 -17
  154. data/node_modules/uri-js/tests/tests.js +0 -774
  155. data/node_modules/uri-js/tsconfig.json +0 -20
  156. data/spec/dummy/log/development.log +0 -456
@@ -1,42 +1,42 @@
1
- import { merge, subexp } from "./util";
2
- export function buildExps(isIRI) {
3
- const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive
4
- LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded
5
- GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters
6
- IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset
7
- 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$$), //relaxed parsing rules
8
- 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$), // 6( h16 ":" ) ls32
9
- IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32
10
- IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32
11
- IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
12
- IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
13
- IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
14
- IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32
15
- IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16
16
- IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::"
17
- IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874
18
- IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874
19
- IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules
20
- IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874
21
- 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$) + "?"), //simplified
22
- PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified
23
- PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified
24
- 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$ + ")") + "?$";
25
- return {
26
- NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
27
- NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
28
- NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
29
- NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
30
- NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
31
- NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
32
- NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
33
- ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
34
- UNRESERVED: new RegExp(UNRESERVED$$, "g"),
35
- OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
36
- PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
37
- IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
38
- IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
39
- };
40
- }
41
- export default buildExps(false);
1
+ import { merge, subexp } from "./util";
2
+ export function buildExps(isIRI) {
3
+ const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive
4
+ LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded
5
+ GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters
6
+ IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset
7
+ 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$$), //relaxed parsing rules
8
+ 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$), // 6( h16 ":" ) ls32
9
+ IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32
10
+ IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32
11
+ IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
12
+ IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
13
+ IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32
14
+ IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32
15
+ IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16
16
+ IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::"
17
+ IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874
18
+ IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874
19
+ IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules
20
+ IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874
21
+ 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$) + "?"), //simplified
22
+ PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified
23
+ PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified
24
+ 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$ + ")") + "?$";
25
+ return {
26
+ NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
27
+ NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
28
+ NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
29
+ NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
30
+ NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
31
+ NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
32
+ NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
33
+ ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
34
+ UNRESERVED: new RegExp(UNRESERVED$$, "g"),
35
+ OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
36
+ PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
37
+ IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
38
+ IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
39
+ };
40
+ }
41
+ export default buildExps(false);
42
42
  //# sourceMappingURL=regexps-uri.js.map
File without changes
@@ -1,3 +1,3 @@
1
- import { URISchemeHandler } from "../uri";
2
- declare const handler: URISchemeHandler;
3
- export default handler;
1
+ import { URISchemeHandler } from "../uri";
2
+ declare const handler: URISchemeHandler;
3
+ export default handler;
@@ -1,27 +1,28 @@
1
- const handler = {
2
- scheme: "http",
3
- domainHost: true,
4
- parse: function (components, options) {
5
- //report missing host
6
- if (!components.host) {
7
- components.error = components.error || "HTTP URIs must have a host.";
8
- }
9
- return components;
10
- },
11
- serialize: function (components, options) {
12
- //normalize the default port
13
- if (components.port === (String(components.scheme).toLowerCase() !== "https" ? 80 : 443) || components.port === "") {
14
- components.port = undefined;
15
- }
16
- //normalize the empty path
17
- if (!components.path) {
18
- components.path = "/";
19
- }
20
- //NOTE: We do not parse query strings for HTTP URIs
21
- //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
22
- //and not the HTTP spec.
23
- return components;
24
- }
25
- };
26
- export default handler;
1
+ const handler = {
2
+ scheme: "http",
3
+ domainHost: true,
4
+ parse: function (components, options) {
5
+ //report missing host
6
+ if (!components.host) {
7
+ components.error = components.error || "HTTP URIs must have a host.";
8
+ }
9
+ return components;
10
+ },
11
+ serialize: function (components, options) {
12
+ const secure = String(components.scheme).toLowerCase() === "https";
13
+ //normalize the default port
14
+ if (components.port === (secure ? 443 : 80) || components.port === "") {
15
+ components.port = undefined;
16
+ }
17
+ //normalize the empty path
18
+ if (!components.path) {
19
+ components.path = "/";
20
+ }
21
+ //NOTE: We do not parse query strings for HTTP URIs
22
+ //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
23
+ //and not the HTTP spec.
24
+ return components;
25
+ }
26
+ };
27
+ export default handler;
27
28
  //# sourceMappingURL=http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACnH,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAEnE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACtE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -1,3 +1,3 @@
1
- import { URISchemeHandler } from "../uri";
2
- declare const handler: URISchemeHandler;
3
- export default handler;
1
+ import { URISchemeHandler } from "../uri";
2
+ declare const handler: URISchemeHandler;
3
+ export default handler;
@@ -1,9 +1,9 @@
1
- import http from "./http";
2
- const handler = {
3
- scheme: "https",
4
- domainHost: http.domainHost,
5
- parse: http.parse,
6
- serialize: http.serialize
7
- };
8
- export default handler;
1
+ import http from "./http";
2
+ const handler = {
3
+ scheme: "https",
4
+ domainHost: http.domainHost,
5
+ parse: http.parse,
6
+ serialize: http.serialize
7
+ };
8
+ export default handler;
9
9
  //# sourceMappingURL=https.js.map
File without changes
@@ -1,12 +1,12 @@
1
- import { URISchemeHandler, URIComponents } from "../uri";
2
- export interface MailtoHeaders {
3
- [hfname: string]: string;
4
- }
5
- export interface MailtoComponents extends URIComponents {
6
- to: Array<string>;
7
- headers?: MailtoHeaders;
8
- subject?: string;
9
- body?: string;
10
- }
11
- declare const handler: URISchemeHandler<MailtoComponents>;
12
- export default handler;
1
+ import { URISchemeHandler, URIComponents } from "../uri";
2
+ export interface MailtoHeaders {
3
+ [hfname: string]: string;
4
+ }
5
+ export interface MailtoComponents extends URIComponents {
6
+ to: Array<string>;
7
+ headers?: MailtoHeaders;
8
+ subject?: string;
9
+ body?: string;
10
+ }
11
+ declare const handler: URISchemeHandler<MailtoComponents>;
12
+ export default handler;
File without changes
@@ -1,7 +1,7 @@
1
- import { URISchemeHandler, URIOptions } from "../uri";
2
- import { URNComponents } from "./urn";
3
- export interface UUIDComponents extends URNComponents {
4
- uuid?: string;
5
- }
6
- declare const handler: URISchemeHandler<UUIDComponents, URIOptions, URNComponents>;
7
- export default handler;
1
+ import { URISchemeHandler, URIOptions } from "../uri";
2
+ import { URNComponents } from "./urn";
3
+ export interface UUIDComponents extends URNComponents {
4
+ uuid?: string;
5
+ }
6
+ declare const handler: URISchemeHandler<UUIDComponents, URIOptions, URNComponents>;
7
+ export default handler;
@@ -1,23 +1,23 @@
1
- const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
2
- const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/;
3
- //RFC 4122
4
- const handler = {
5
- scheme: "urn:uuid",
6
- parse: function (urnComponents, options) {
7
- const uuidComponents = urnComponents;
8
- uuidComponents.uuid = uuidComponents.nss;
9
- uuidComponents.nss = undefined;
10
- if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
11
- uuidComponents.error = uuidComponents.error || "UUID is not valid.";
12
- }
13
- return uuidComponents;
14
- },
15
- serialize: function (uuidComponents, options) {
16
- const urnComponents = uuidComponents;
17
- //normalize UUID
18
- urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
19
- return urnComponents;
20
- },
21
- };
22
- export default handler;
1
+ const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
2
+ const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/;
3
+ //RFC 4122
4
+ const handler = {
5
+ scheme: "urn:uuid",
6
+ parse: function (urnComponents, options) {
7
+ const uuidComponents = urnComponents;
8
+ uuidComponents.uuid = uuidComponents.nss;
9
+ uuidComponents.nss = undefined;
10
+ if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
11
+ uuidComponents.error = uuidComponents.error || "UUID is not valid.";
12
+ }
13
+ return uuidComponents;
14
+ },
15
+ serialize: function (uuidComponents, options) {
16
+ const urnComponents = uuidComponents;
17
+ //normalize UUID
18
+ urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
19
+ return urnComponents;
20
+ },
21
+ };
22
+ export default handler;
23
23
  //# sourceMappingURL=urn-uuid.js.map
@@ -1,10 +1,10 @@
1
- import { URISchemeHandler, URIComponents, URIOptions } from "../uri";
2
- export interface URNComponents extends URIComponents {
3
- nid?: string;
4
- nss?: string;
5
- }
6
- export interface URNOptions extends URIOptions {
7
- nid?: string;
8
- }
9
- declare const handler: URISchemeHandler<URNComponents, URNOptions>;
10
- export default handler;
1
+ import { URISchemeHandler, URIComponents, URIOptions } from "../uri";
2
+ export interface URNComponents extends URIComponents {
3
+ nid?: string;
4
+ nss?: string;
5
+ }
6
+ export interface URNOptions extends URIOptions {
7
+ nid?: string;
8
+ }
9
+ declare const handler: URISchemeHandler<URNComponents, URNOptions>;
10
+ export default handler;
@@ -1,49 +1,49 @@
1
- import { SCHEMES } from "../uri";
2
- const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})";
3
- const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})";
4
- const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]";
5
- const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)";
6
- const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$");
7
- const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$");
8
- const URN_PARSE = /^([^\:]+)\:(.*)/;
9
- const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g;
10
- //RFC 2141
11
- const handler = {
12
- scheme: "urn",
13
- parse: function (components, options) {
14
- const matches = components.path && components.path.match(URN_PARSE);
15
- let urnComponents = components;
16
- if (matches) {
17
- const scheme = options.scheme || urnComponents.scheme || "urn";
18
- const nid = matches[1].toLowerCase();
19
- const nss = matches[2];
20
- const urnScheme = `${scheme}:${options.nid || nid}`;
21
- const schemeHandler = SCHEMES[urnScheme];
22
- urnComponents.nid = nid;
23
- urnComponents.nss = nss;
24
- urnComponents.path = undefined;
25
- if (schemeHandler) {
26
- urnComponents = schemeHandler.parse(urnComponents, options);
27
- }
28
- }
29
- else {
30
- urnComponents.error = urnComponents.error || "URN can not be parsed.";
31
- }
32
- return urnComponents;
33
- },
34
- serialize: function (urnComponents, options) {
35
- const scheme = options.scheme || urnComponents.scheme || "urn";
36
- const nid = urnComponents.nid;
37
- const urnScheme = `${scheme}:${options.nid || nid}`;
38
- const schemeHandler = SCHEMES[urnScheme];
39
- if (schemeHandler) {
40
- urnComponents = schemeHandler.serialize(urnComponents, options);
41
- }
42
- const uriComponents = urnComponents;
43
- const nss = urnComponents.nss;
44
- uriComponents.path = `${nid || options.nid}:${nss}`;
45
- return uriComponents;
46
- },
47
- };
48
- export default handler;
1
+ import { SCHEMES } from "../uri";
2
+ const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})";
3
+ const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})";
4
+ const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]";
5
+ const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)";
6
+ const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$");
7
+ const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$");
8
+ const URN_PARSE = /^([^\:]+)\:(.*)/;
9
+ const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g;
10
+ //RFC 2141
11
+ const handler = {
12
+ scheme: "urn",
13
+ parse: function (components, options) {
14
+ const matches = components.path && components.path.match(URN_PARSE);
15
+ let urnComponents = components;
16
+ if (matches) {
17
+ const scheme = options.scheme || urnComponents.scheme || "urn";
18
+ const nid = matches[1].toLowerCase();
19
+ const nss = matches[2];
20
+ const urnScheme = `${scheme}:${options.nid || nid}`;
21
+ const schemeHandler = SCHEMES[urnScheme];
22
+ urnComponents.nid = nid;
23
+ urnComponents.nss = nss;
24
+ urnComponents.path = undefined;
25
+ if (schemeHandler) {
26
+ urnComponents = schemeHandler.parse(urnComponents, options);
27
+ }
28
+ }
29
+ else {
30
+ urnComponents.error = urnComponents.error || "URN can not be parsed.";
31
+ }
32
+ return urnComponents;
33
+ },
34
+ serialize: function (urnComponents, options) {
35
+ const scheme = options.scheme || urnComponents.scheme || "urn";
36
+ const nid = urnComponents.nid;
37
+ const urnScheme = `${scheme}:${options.nid || nid}`;
38
+ const schemeHandler = SCHEMES[urnScheme];
39
+ if (schemeHandler) {
40
+ urnComponents = schemeHandler.serialize(urnComponents, options);
41
+ }
42
+ const uriComponents = urnComponents;
43
+ const nss = urnComponents.nss;
44
+ uriComponents.path = `${nid || options.nid}:${nss}`;
45
+ return uriComponents;
46
+ },
47
+ };
48
+ export default handler;
49
49
  //# sourceMappingURL=urn.js.map
File without changes
@@ -0,0 +1,7 @@
1
+ import { URISchemeHandler, URIComponents } from "../uri";
2
+ export interface WSComponents extends URIComponents {
3
+ resourceName?: string;
4
+ secure?: boolean;
5
+ }
6
+ declare const handler: URISchemeHandler;
7
+ export default handler;
@@ -0,0 +1,41 @@
1
+ function isSecure(wsComponents) {
2
+ return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
3
+ }
4
+ //RFC 6455
5
+ const handler = {
6
+ scheme: "ws",
7
+ domainHost: true,
8
+ parse: function (components, options) {
9
+ const wsComponents = components;
10
+ //indicate if the secure flag is set
11
+ wsComponents.secure = isSecure(wsComponents);
12
+ //construct resouce name
13
+ wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
14
+ wsComponents.path = undefined;
15
+ wsComponents.query = undefined;
16
+ return wsComponents;
17
+ },
18
+ serialize: function (wsComponents, options) {
19
+ //normalize the default port
20
+ if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
21
+ wsComponents.port = undefined;
22
+ }
23
+ //ensure scheme matches secure flag
24
+ if (typeof wsComponents.secure === 'boolean') {
25
+ wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');
26
+ wsComponents.secure = undefined;
27
+ }
28
+ //reconstruct path from resource name
29
+ if (wsComponents.resourceName) {
30
+ const [path, query] = wsComponents.resourceName.split('?');
31
+ wsComponents.path = (path && path !== '/' ? path : undefined);
32
+ wsComponents.query = query;
33
+ wsComponents.resourceName = undefined;
34
+ }
35
+ //forbid fragment component
36
+ wsComponents.fragment = undefined;
37
+ return wsComponents;
38
+ }
39
+ };
40
+ export default handler;
41
+ //# sourceMappingURL=ws.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ws.js","sourceRoot":"","sources":["../../../src/schemes/ws.ts"],"names":[],"mappings":"AAOA,kBAAkB,YAAyB;IAC1C,OAAO,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AAC7H,CAAC;AAED,UAAU;AACV,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,IAAI;IAEb,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,YAAY,GAAG,UAA0B,CAAC;QAEhD,oCAAoC;QACpC,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE7C,wBAAwB;QACxB,YAAY,CAAC,YAAY,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9G,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;QAC9B,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC;QAE/B,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,SAAS,EAAG,UAAU,YAAyB,EAAE,OAAkB;QAClE,4BAA4B;QAC5B,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,KAAK,EAAE,EAAE;YAC1F,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;SAC9B;QAED,mCAAmC;QACnC,IAAI,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,EAAE;YAC7C,YAAY,CAAC,MAAM,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3D,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC;SAChC;QAED,qCAAqC;QACrC,IAAI,YAAY,CAAC,YAAY,EAAE;YAC9B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,YAAY,CAAC,YAAY,GAAG,SAAS,CAAC;SACtC;QAED,2BAA2B;QAC3B,YAAY,CAAC,QAAQ,GAAG,SAAS,CAAC;QAElC,OAAO,YAAY,CAAC;IACrB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { URISchemeHandler } from "../uri";
2
+ declare const handler: URISchemeHandler;
3
+ export default handler;
@@ -0,0 +1,9 @@
1
+ import ws from "./ws";
2
+ const handler = {
3
+ scheme: "wss",
4
+ domainHost: ws.domainHost,
5
+ parse: ws.parse,
6
+ serialize: ws.serialize
7
+ };
8
+ export default handler;
9
+ //# sourceMappingURL=wss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"}