@kalutskii/foundation 0.6.12 → 0.6.13
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/dist/index.d.ts +4 -4
- package/dist/index.js +10 -12
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -280,8 +280,8 @@ declare class ZodJWTService<TPayloadOrSchema> {
|
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
declare const zodPaginationSchema: z.ZodObject<{
|
|
283
|
-
offset: z.ZodOptional<z.
|
|
284
|
-
limit: z.ZodOptional<z.
|
|
283
|
+
offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
284
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
285
285
|
}, z.core.$strip>;
|
|
286
286
|
/**
|
|
287
287
|
* Reusable pagination fields for flat query schemas, allowing for
|
|
@@ -291,8 +291,8 @@ declare const zodPaginationSchema: z.ZodObject<{
|
|
|
291
291
|
* or use `zodPaginationSchema.extend(...)` when building directly from the schema.
|
|
292
292
|
*/
|
|
293
293
|
declare const zodPaginationShape: {
|
|
294
|
-
offset: z.ZodOptional<z.
|
|
295
|
-
limit: z.ZodOptional<z.
|
|
294
|
+
offset: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
295
|
+
limit: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
296
296
|
};
|
|
297
297
|
/**
|
|
298
298
|
* TypeScript type representing the pagination options validated by the `zodPaginationSchema`.
|
package/dist/index.js
CHANGED
|
@@ -215,10 +215,17 @@ var refinePagination = (options) => ({
|
|
|
215
215
|
});
|
|
216
216
|
|
|
217
217
|
// src/zod-pagination/zod-pagination.schemas.ts
|
|
218
|
-
import
|
|
218
|
+
import z from "zod";
|
|
219
|
+
var zodPaginationSchema = z.object({
|
|
220
|
+
/** Integer representing the starting point for pagination. */
|
|
221
|
+
offset: z.coerce.number().int().nonnegative().optional(),
|
|
222
|
+
/** Integer representing the maximum number of items to return. */
|
|
223
|
+
limit: z.coerce.number().int().positive().optional()
|
|
224
|
+
});
|
|
225
|
+
var zodPaginationShape = zodPaginationSchema.shape;
|
|
219
226
|
|
|
220
227
|
// src/zod-validation/zod-validation.refiners.ts
|
|
221
|
-
import
|
|
228
|
+
import z2 from "zod";
|
|
222
229
|
|
|
223
230
|
// src/zod-validation/zod-validation.utilities.ts
|
|
224
231
|
var isPlainObject = (value) => {
|
|
@@ -245,16 +252,7 @@ var parseQueryValue = (value) => {
|
|
|
245
252
|
return Number(normalized);
|
|
246
253
|
return value;
|
|
247
254
|
};
|
|
248
|
-
var asQuery = (schema) =>
|
|
249
|
-
|
|
250
|
-
// src/zod-pagination/zod-pagination.schemas.ts
|
|
251
|
-
var zodPaginationSchema = z2.object({
|
|
252
|
-
/** Integer representing the starting point for pagination. */
|
|
253
|
-
offset: asQuery(z2.number().int().nonnegative()).optional(),
|
|
254
|
-
/** Integer representing the maximum number of items to return. */
|
|
255
|
-
limit: asQuery(z2.number().int().positive()).optional()
|
|
256
|
-
});
|
|
257
|
-
var zodPaginationShape = zodPaginationSchema.shape;
|
|
255
|
+
var asQuery = (schema) => z2.preprocess(parseQueryValue, schema);
|
|
258
256
|
export {
|
|
259
257
|
EXCEPTION_STATUS_CODES,
|
|
260
258
|
SUCCESS_STATUS_CODES,
|