@nhtio/lucid-resourceful 0.1.0-master-29dd5a13 → 0.1.0-master-641df8fc
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/adonis-env.d.ts +17 -0
- package/bundled_liqe.d.ts +6 -5
- package/bundled_xml_js.d.ts +5 -4
- package/definitions.d.ts +1 -1
- package/encoding.d.ts +6 -6
- package/errors.d.ts +23 -8
- package/{index-Bsyx9Sty.js → index-B-5JiNqG.js} +76 -221
- package/index-B-5JiNqG.js.map +1 -0
- package/{index-B6dIMDux.cjs → index-BrGbuAtt.cjs} +76 -221
- package/index-BrGbuAtt.cjs.map +1 -0
- package/index-C9zyi90j.js.map +1 -1
- package/{index-CpyTnwZV.cjs → index-CQApAM0M.cjs} +298 -353
- package/index-CQApAM0M.cjs.map +1 -0
- package/index-CxRBayw6.cjs.map +1 -1
- package/{index-C8mGEf4P.js → index-DLVvkVxI.js} +295 -350
- package/index-DLVvkVxI.js.map +1 -0
- package/index-DsojAcQ4.js.map +1 -1
- package/index-DuzIXu31.cjs.map +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +7 -7
- package/index.mjs +1 -1
- package/integration/middlewares/odata_error.cjs +1 -1
- package/integration/middlewares/odata_error.d.ts +1 -1
- package/integration/middlewares/odata_error.mjs +1 -1
- package/integration/middlewares/resourceful_encoded_request.cjs +100 -12
- package/integration/middlewares/resourceful_encoded_request.cjs.map +1 -1
- package/integration/middlewares/resourceful_encoded_request.d.ts +1 -1
- package/integration/middlewares/resourceful_encoded_request.mjs +98 -10
- package/integration/middlewares/resourceful_encoded_request.mjs.map +1 -1
- package/integration/middlewares/resourceful_error.cjs +1 -1
- package/integration/middlewares/resourceful_error.d.ts +1 -1
- package/integration/middlewares/resourceful_error.mjs +1 -1
- package/integration/provider.cjs +1 -1
- package/integration/provider.mjs +1 -1
- package/joi.d.ts +1 -1
- package/{manager-OLS5T3G7-CJHhMwR7.cjs → manager-OLS5T3G7-BPVI59Zw.cjs} +2 -2
- package/{manager-OLS5T3G7-CJHhMwR7.cjs.map → manager-OLS5T3G7-BPVI59Zw.cjs.map} +1 -1
- package/{manager-OLS5T3G7-C-NS6lhx.js → manager-OLS5T3G7-DzVckqOB.js} +2 -2
- package/{manager-OLS5T3G7-C-NS6lhx.js.map → manager-OLS5T3G7-DzVckqOB.js.map} +1 -1
- package/odata/context.d.ts +1 -1
- package/odata/macro.d.ts +1 -1
- package/{odata_error_middleware-BWfOpQZV.cjs → odata_error_middleware-DhLzccN7.cjs} +4 -4
- package/{odata_error_middleware-BWfOpQZV.cjs.map → odata_error_middleware-DhLzccN7.cjs.map} +1 -1
- package/{odata_error_middleware-CWYqZMez.js → odata_error_middleware-Dspi8bct.js} +4 -4
- package/{odata_error_middleware-CWYqZMez.js.map → odata_error_middleware-Dspi8bct.js.map} +1 -1
- package/package.json +1 -1
- package/private/data_type_schemas.d.ts +12 -12
- package/private/data_types.d.ts +1 -1
- package/private/decorator_schemas.d.ts +1 -1
- package/private/decorator_utils.d.ts +1 -1
- package/private/decorators.d.ts +14 -11
- package/private/encoding.d.ts +3 -3
- package/private/joi/index.d.ts +3 -3
- package/private/lucene_to_lucid_translator.d.ts +1 -1
- package/private/mixin.d.ts +25 -8
- package/private/odata_macro/controllers/resourceful_model_controller.d.ts +4 -4
- package/private/odata_macro/index.d.ts +1 -1
- package/private/odata_macro/middlewares/odata_error_middleware.d.ts +22 -10
- package/private/odata_macro/services/odata_context_service.d.ts +1 -1
- package/private/odata_macro/services/odata_metadata_service.d.ts +3 -3
- package/private/odata_macro/utils/odata.d.ts +2 -2
- package/private/odata_to_lucid_translator.d.ts +1 -1
- package/private/open_api_schema_service.d.ts +3 -3
- package/private/router_macro/controllers/resourceful_model_controller.d.ts +5 -5
- package/private/router_macro/index.d.ts +3 -3
- package/private/router_macro/middlewares/resourceful_error_middleware.d.ts +22 -10
- package/private/router_macro/services/resourceful_router_choices_service.d.ts +3 -3
- package/private/router_macro/services/resourceful_router_context_service.d.ts +1 -1
- package/private/router_macro/services/resourceful_router_model_options_service.d.ts +1 -1
- package/private/router_macro/services/resourceful_router_model_resolver_service.d.ts +3 -3
- package/private/router_macro/services/resourceful_router_openapi_document_service.d.ts +4 -4
- package/private/router_macro/services/resourceful_router_options_service.d.ts +3 -3
- package/private/router_macro/types.d.ts +15 -8
- package/private/router_macro/utils/errors.d.ts +1 -1
- package/private/router_macro/utils/http.d.ts +1 -1
- package/private/router_macro/utils/openapi_validation_schemas.d.ts +2 -2
- package/private/router_macro/utils/relationships.d.ts +1 -1
- package/private/router_macro/utils/type_guards.d.ts +1 -1
- package/private/schema_types.d.ts +1 -1
- package/private/type_guards.d.ts +5 -5
- package/private/types.d.ts +5 -5
- package/private/utils/casters.d.ts +1 -1
- package/private/utils/consumers.d.ts +1 -1
- package/private/utils/preparers.d.ts +1 -1
- package/private/utils.d.ts +1 -1
- package/{resourceful_error_middleware-CMSZGdoG.js → resourceful_error_middleware-Cb_eTzST.js} +4 -4
- package/{resourceful_error_middleware-CMSZGdoG.js.map → resourceful_error_middleware-Cb_eTzST.js.map} +1 -1
- package/{resourceful_error_middleware-lXgefPIC.cjs → resourceful_error_middleware-CnjbNoev.cjs} +4 -4
- package/{resourceful_error_middleware-lXgefPIC.cjs.map → resourceful_error_middleware-CnjbNoev.cjs.map} +1 -1
- package/router/context.d.ts +1 -1
- package/router/utils.cjs +1 -1
- package/router/utils.d.ts +1 -1
- package/router/utils.mjs +1 -1
- package/router.cjs +1 -1
- package/router.d.ts +2 -2
- package/router.mjs +1 -1
- package/types.d.ts +13 -13
- package/utils.d.ts +4 -4
- package/vite-env.d.ts +3 -0
- package/index-B6dIMDux.cjs.map +0 -1
- package/index-Bsyx9Sty.js.map +0 -1
- package/index-C8mGEf4P.js.map +0 -1
- package/index-CpIq4gOr.js +0 -93
- package/index-CpIq4gOr.js.map +0 -1
- package/index-CpyTnwZV.cjs.map +0 -1
- package/index-DqbJXpcT.cjs +0 -92
- package/index-DqbJXpcT.cjs.map +0 -1
- package/private/controller_factory.d.ts +0 -1
- package/private/utils/function_serializer.d.ts +0 -32
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Resourceful encoding utility.
|
|
4
4
|
* @module @nhtio/lucid-resourceful/integration/middlewares/resourceful_encoded_request
|
|
5
5
|
*/
|
|
6
|
-
import { ResourcefulEncodedRequestMiddleware } from
|
|
6
|
+
import { ResourcefulEncodedRequestMiddleware } from "../../private/router_macro/middlewares/resourceful_encoded_request";
|
|
7
7
|
export default ResourcefulEncodedRequestMiddleware;
|
|
@@ -2,11 +2,99 @@ import { decode } from "../../encoding.mjs";
|
|
|
2
2
|
import { r as requireInherits, o as commonjsGlobal, n as getDefaultExportFromCjs, p as E_ENCODED_BODY_PARSING_FAILED } from "../../errors-b4tqg-tH.js";
|
|
3
3
|
import { p as process$1 } from "../../index-C9zyi90j.js";
|
|
4
4
|
import { B as Buffer } from "../../index-DsojAcQ4.js";
|
|
5
|
-
import { r as requireBytes } from "../../index-CpIq4gOr.js";
|
|
6
5
|
import require$$0$2 from "path";
|
|
7
6
|
import require$$0$3 from "buffer";
|
|
8
7
|
import { r as requireString_decoder } from "../../string_decoder-BY7OVkQb.js";
|
|
9
8
|
import require$$3$1 from "zlib";
|
|
9
|
+
var bytes = { exports: {} };
|
|
10
|
+
var hasRequiredBytes;
|
|
11
|
+
function requireBytes() {
|
|
12
|
+
if (hasRequiredBytes) return bytes.exports;
|
|
13
|
+
hasRequiredBytes = 1;
|
|
14
|
+
bytes.exports = bytes$1;
|
|
15
|
+
bytes.exports.format = format;
|
|
16
|
+
bytes.exports.parse = parse;
|
|
17
|
+
var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
|
|
18
|
+
var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
|
|
19
|
+
var map = {
|
|
20
|
+
b: 1,
|
|
21
|
+
kb: 1 << 10,
|
|
22
|
+
mb: 1 << 20,
|
|
23
|
+
gb: 1 << 30,
|
|
24
|
+
tb: Math.pow(1024, 4),
|
|
25
|
+
pb: Math.pow(1024, 5)
|
|
26
|
+
};
|
|
27
|
+
var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;
|
|
28
|
+
function bytes$1(value, options) {
|
|
29
|
+
if (typeof value === "string") {
|
|
30
|
+
return parse(value);
|
|
31
|
+
}
|
|
32
|
+
if (typeof value === "number") {
|
|
33
|
+
return format(value, options);
|
|
34
|
+
}
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
function format(value, options) {
|
|
38
|
+
if (!Number.isFinite(value)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
var mag = Math.abs(value);
|
|
42
|
+
var thousandsSeparator = options && options.thousandsSeparator || "";
|
|
43
|
+
var unitSeparator = options && options.unitSeparator || "";
|
|
44
|
+
var decimalPlaces = options && options.decimalPlaces !== void 0 ? options.decimalPlaces : 2;
|
|
45
|
+
var fixedDecimals = Boolean(options && options.fixedDecimals);
|
|
46
|
+
var unit = options && options.unit || "";
|
|
47
|
+
if (!unit || !map[unit.toLowerCase()]) {
|
|
48
|
+
if (mag >= map.pb) {
|
|
49
|
+
unit = "PB";
|
|
50
|
+
} else if (mag >= map.tb) {
|
|
51
|
+
unit = "TB";
|
|
52
|
+
} else if (mag >= map.gb) {
|
|
53
|
+
unit = "GB";
|
|
54
|
+
} else if (mag >= map.mb) {
|
|
55
|
+
unit = "MB";
|
|
56
|
+
} else if (mag >= map.kb) {
|
|
57
|
+
unit = "KB";
|
|
58
|
+
} else {
|
|
59
|
+
unit = "B";
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
var val = value / map[unit.toLowerCase()];
|
|
63
|
+
var str = val.toFixed(decimalPlaces);
|
|
64
|
+
if (!fixedDecimals) {
|
|
65
|
+
str = str.replace(formatDecimalsRegExp, "$1");
|
|
66
|
+
}
|
|
67
|
+
if (thousandsSeparator) {
|
|
68
|
+
str = str.split(".").map(function(s, i) {
|
|
69
|
+
return i === 0 ? s.replace(formatThousandsRegExp, thousandsSeparator) : s;
|
|
70
|
+
}).join(".");
|
|
71
|
+
}
|
|
72
|
+
return str + unitSeparator + unit;
|
|
73
|
+
}
|
|
74
|
+
function parse(val) {
|
|
75
|
+
if (typeof val === "number" && !isNaN(val)) {
|
|
76
|
+
return val;
|
|
77
|
+
}
|
|
78
|
+
if (typeof val !== "string") {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
var results = parseRegExp.exec(val);
|
|
82
|
+
var floatValue;
|
|
83
|
+
var unit = "b";
|
|
84
|
+
if (!results) {
|
|
85
|
+
floatValue = parseInt(val, 10);
|
|
86
|
+
unit = "b";
|
|
87
|
+
} else {
|
|
88
|
+
floatValue = parseFloat(results[1]);
|
|
89
|
+
unit = results[4].toLowerCase();
|
|
90
|
+
}
|
|
91
|
+
if (isNaN(floatValue)) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
return Math.floor(map[unit] * floatValue);
|
|
95
|
+
}
|
|
96
|
+
return bytes.exports;
|
|
97
|
+
}
|
|
10
98
|
var httpErrors = { exports: {} };
|
|
11
99
|
var depd_1;
|
|
12
100
|
var hasRequiredDepd;
|
|
@@ -2319,18 +2407,18 @@ function requireDbcsCodec() {
|
|
|
2319
2407
|
DBCSCodec.prototype.encoder = DBCSEncoder;
|
|
2320
2408
|
DBCSCodec.prototype.decoder = DBCSDecoder;
|
|
2321
2409
|
DBCSCodec.prototype._getDecodeTrieNode = function(addr) {
|
|
2322
|
-
var
|
|
2410
|
+
var bytes2 = [];
|
|
2323
2411
|
for (; addr > 0; addr >>>= 8) {
|
|
2324
|
-
|
|
2412
|
+
bytes2.push(addr & 255);
|
|
2325
2413
|
}
|
|
2326
|
-
if (
|
|
2327
|
-
|
|
2414
|
+
if (bytes2.length == 0) {
|
|
2415
|
+
bytes2.push(0);
|
|
2328
2416
|
}
|
|
2329
2417
|
var node = this.decodeTables[0];
|
|
2330
|
-
for (var i2 =
|
|
2331
|
-
var val = node[
|
|
2418
|
+
for (var i2 = bytes2.length - 1; i2 > 0; i2--) {
|
|
2419
|
+
var val = node[bytes2[i2]];
|
|
2332
2420
|
if (val == UNASSIGNED) {
|
|
2333
|
-
node[
|
|
2421
|
+
node[bytes2[i2]] = NODE_START - this.decodeTables.length;
|
|
2334
2422
|
this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));
|
|
2335
2423
|
} else if (val <= NODE_START) {
|
|
2336
2424
|
node = this.decodeTables[NODE_START - val];
|
|
@@ -4545,7 +4633,7 @@ function requireRawBody() {
|
|
|
4545
4633
|
if (hasRequiredRawBody) return rawBody;
|
|
4546
4634
|
hasRequiredRawBody = 1;
|
|
4547
4635
|
var asyncHooks = tryRequireAsyncHooks();
|
|
4548
|
-
var
|
|
4636
|
+
var bytes2 = requireBytes();
|
|
4549
4637
|
var createError = requireHttpErrors();
|
|
4550
4638
|
var iconv = requireLib();
|
|
4551
4639
|
var unpipe = requireUnpipe();
|
|
@@ -4587,7 +4675,7 @@ function requireRawBody() {
|
|
|
4587
4675
|
throw new TypeError("argument callback is required");
|
|
4588
4676
|
}
|
|
4589
4677
|
var encoding = opts.encoding !== true ? opts.encoding : "utf-8";
|
|
4590
|
-
var limit =
|
|
4678
|
+
var limit = bytes2.parse(opts.limit);
|
|
4591
4679
|
var length = opts.length != null && !isNaN(opts.length) ? parseInt(opts.length, 10) : null;
|
|
4592
4680
|
if (done) {
|
|
4593
4681
|
return readStream(stream, encoding, length, limit, wrap(done));
|