@buka/nestjs-kit 4.4.6 → 4.4.8
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/CHANGELOG.md +14 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1280,7 +1280,7 @@ const NextCursorPageSchema = {
|
|
|
1280
1280
|
after: { type: "string" },
|
|
1281
1281
|
first: { type: "number" }
|
|
1282
1282
|
},
|
|
1283
|
-
required: ["
|
|
1283
|
+
required: ["first"],
|
|
1284
1284
|
additionalProperties: false
|
|
1285
1285
|
};
|
|
1286
1286
|
//#endregion
|
|
@@ -1291,7 +1291,7 @@ const PreviousCursorPageSchema = {
|
|
|
1291
1291
|
before: { type: "string" },
|
|
1292
1292
|
last: { type: "number" }
|
|
1293
1293
|
},
|
|
1294
|
-
required: ["
|
|
1294
|
+
required: ["last"],
|
|
1295
1295
|
additionalProperties: false
|
|
1296
1296
|
};
|
|
1297
1297
|
//#endregion
|
|
@@ -1335,9 +1335,9 @@ let BukaPageQueryValidationPipe = class BukaPageQueryValidationPipe {
|
|
|
1335
1335
|
if ("after" in value.page || "first" in value.page) {
|
|
1336
1336
|
if ("limit" in value.page || "offset" in value.page) throw new BadRequestException(mixedOffsetAndCursorError);
|
|
1337
1337
|
if ("before" in value.page || "last" in value.page) throw new BadRequestException(mixedNextAndLastCursorError);
|
|
1338
|
-
const after = value.page.after;
|
|
1338
|
+
const after = value.page.after ?? "";
|
|
1339
1339
|
const first = parseInt(value.page.first, 10);
|
|
1340
|
-
if (typeof after !== "string") throw new BadRequestException("Invalid page query: after must be a string.");
|
|
1340
|
+
if (value.page.after !== void 0 && typeof value.page.after !== "string") throw new BadRequestException("Invalid page query: after must be a string.");
|
|
1341
1341
|
if (isNaN(first) || first <= 0) throw new BadRequestException("Invalid page query: first must be a positive integer.");
|
|
1342
1342
|
return { page: {
|
|
1343
1343
|
after,
|
|
@@ -1347,9 +1347,9 @@ let BukaPageQueryValidationPipe = class BukaPageQueryValidationPipe {
|
|
|
1347
1347
|
if ("before" in value.page || "last" in value.page) {
|
|
1348
1348
|
if ("limit" in value.page || "offset" in value.page) throw new BadRequestException(mixedOffsetAndCursorError);
|
|
1349
1349
|
if ("after" in value.page || "first" in value.page) throw new BadRequestException(mixedNextAndLastCursorError);
|
|
1350
|
-
const before = value.page.before;
|
|
1350
|
+
const before = value.page.before ?? "";
|
|
1351
1351
|
const last = parseInt(value.page.last, 10);
|
|
1352
|
-
if (typeof before !== "string") throw new BadRequestException("Invalid page query: before must be a string.");
|
|
1352
|
+
if (value.page.before !== void 0 && typeof value.page.before !== "string") throw new BadRequestException("Invalid page query: before must be a string.");
|
|
1353
1353
|
if (isNaN(last) || last <= 0) throw new BadRequestException("Invalid page query: last must be a positive integer.");
|
|
1354
1354
|
return { page: {
|
|
1355
1355
|
before,
|