@jwn-js/common 2.1.14 → 2.1.16

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 (97) hide show
  1. package/ApiError.d.ts +1 -29
  2. package/ApiError.js +1 -39
  3. package/ApiError.mjs +1 -0
  4. package/Jwt-7tQL-rwa.js +1 -0
  5. package/Jwt-CDdbxwvH.js +1 -0
  6. package/Jwt.js +1 -44
  7. package/Jwt.mjs +1 -0
  8. package/Memcached.js +9 -124
  9. package/Memcached.mjs +9 -0
  10. package/Server.d.ts +5 -4
  11. package/Server.js +1 -239
  12. package/Server.mjs +1 -0
  13. package/cookieParse.js +1 -27
  14. package/cookieParse.mjs +1 -0
  15. package/cookieString.js +1 -24
  16. package/cookieString.mjs +1 -0
  17. package/docs/assets/highlight.css +19 -5
  18. package/docs/assets/main.js +59 -52
  19. package/docs/assets/navigation.js +1 -0
  20. package/docs/assets/search.js +1 -1
  21. package/docs/assets/style.css +826 -826
  22. package/docs/classes/ApiError.html +22 -17
  23. package/docs/classes/AsyncJwt.html +16 -17
  24. package/docs/classes/Controller.html +42 -24
  25. package/docs/classes/Jwt.html +16 -17
  26. package/docs/classes/Memcached.html +31 -38
  27. package/docs/classes/Model.html +24 -7
  28. package/docs/classes/Server.html +25 -25
  29. package/docs/classes/Ssr.html +13 -11
  30. package/docs/classes/Web.html +10 -3
  31. package/docs/functions/action.html +2 -0
  32. package/docs/functions/body.html +2 -0
  33. package/docs/functions/codeToStatus.html +2 -0
  34. package/docs/functions/config.html +2 -0
  35. package/docs/functions/connection.html +2 -0
  36. package/docs/functions/context.html +2 -0
  37. package/docs/functions/controller-1.html +2 -0
  38. package/docs/functions/cookies.html +2 -0
  39. package/docs/functions/db.html +2 -0
  40. package/docs/functions/headers.html +2 -0
  41. package/docs/functions/home.html +2 -0
  42. package/docs/functions/hostname.html +2 -0
  43. package/docs/functions/http.html +4 -0
  44. package/docs/functions/init.html +2 -0
  45. package/docs/functions/json.html +3 -0
  46. package/docs/functions/logerror.html +3 -0
  47. package/docs/functions/method.html +2 -0
  48. package/docs/functions/mixin.html +5 -0
  49. package/docs/functions/mount.html +2 -0
  50. package/docs/functions/pool.html +2 -0
  51. package/docs/functions/protocol.html +2 -0
  52. package/docs/functions/request.html +2 -0
  53. package/docs/functions/selectControllersSchema.html +1 -0
  54. package/docs/functions/stream.html +2 -0
  55. package/docs/functions/subaction.html +2 -0
  56. package/docs/functions/url.html +2 -0
  57. package/docs/functions/xml.html +3 -0
  58. package/docs/index.html +8 -16
  59. package/docs/interfaces/ApiErrorMessage.html +6 -1
  60. package/docs/interfaces/ContextSsr.html +22 -19
  61. package/docs/interfaces/ContextWeb.html +7 -1
  62. package/docs/interfaces/OptionsSsr.html +3 -1
  63. package/docs/interfaces/OptionsWeb.html +6 -1
  64. package/docs/interfaces/ResponseOptions.html +4 -1
  65. package/docs/interfaces/Route.html +4 -1
  66. package/docs/interfaces/Schema.html +3 -1
  67. package/docs/interfaces/ServerHandler.html +4 -1
  68. package/docs/interfaces/ServerOptions.html +8 -1
  69. package/docs/interfaces/ServerWebsocket.html +4 -1
  70. package/docs/modules.html +50 -85
  71. package/docs/types/ServerRoutes.html +1 -0
  72. package/docs/variables/helpers.html +31 -0
  73. package/index.d.ts +33 -111
  74. package/index.js +4 -1965
  75. package/index.mjs +57 -0
  76. package/jsonBody.js +1 -27
  77. package/jsonBody.mjs +1 -0
  78. package/multipartBody.d.ts +1 -1
  79. package/multipartBody.js +1 -48
  80. package/multipartBody.mjs +1 -0
  81. package/package.json +14 -20
  82. package/readConfig.js +1 -17
  83. package/readConfig.mjs +1 -0
  84. package/readConfigSync.js +1 -18
  85. package/readConfigSync.mjs +1 -0
  86. package/staticBody.js +1 -207
  87. package/staticBody.mjs +1 -0
  88. package/urlencodedBody.js +1 -32
  89. package/urlencodedBody.mjs +1 -0
  90. package/ApiError-b517f53a.js +0 -37
  91. package/cookieParse-49f1da46.js +0 -25
  92. package/decoders-ee9f4396.js +0 -18
  93. package/docs/assets/icons.css +0 -1043
  94. package/docs/assets/icons.png +0 -0
  95. package/docs/assets/icons@2x.png +0 -0
  96. package/docs/assets/widgets.png +0 -0
  97. package/docs/assets/widgets@2x.png +0 -0
@@ -1,25 +0,0 @@
1
- 'use strict';
2
-
3
- const cookieParse = (str) => {
4
- if (!str) {
5
- return {};
6
- }
7
- return str.split(/; */).reduce((obj, str2) => {
8
- if (str2 === "") {
9
- return obj;
10
- }
11
- const eq = str2.indexOf("=");
12
- const key = eq > 0 ? str2.slice(0, eq) : str2;
13
- let val = eq > 0 ? str2.slice(eq + 1) : null;
14
- if (val != null) {
15
- try {
16
- val = decodeURIComponent(val);
17
- } catch (ex) {
18
- }
19
- }
20
- obj[key] = val;
21
- return obj;
22
- }, {});
23
- };
24
-
25
- exports.cookieParse = cookieParse;
@@ -1,18 +0,0 @@
1
- 'use strict';
2
-
3
- const urlEncode = (str) => {
4
- return str.replace(/\+/ig, "-").replace(/\//ig, "_").replace(/=+$/, "");
5
- };
6
- const urlDecode = (str) => {
7
- return str.replace(/-/ig, "+").replace(/_/ig, "/");
8
- };
9
- const toBase64url = (params) => {
10
- return urlEncode(Buffer.from(JSON.stringify(params)).toString("base64"));
11
- };
12
- const fromBase64url = (str) => {
13
- return JSON.parse(Buffer.from(urlDecode(str), "base64").toString());
14
- };
15
-
16
- exports.fromBase64url = fromBase64url;
17
- exports.toBase64url = toBase64url;
18
- exports.urlEncode = urlEncode;