@gustavo-valsechi/node 1.0.33 → 1.0.35

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.mts CHANGED
@@ -3,8 +3,8 @@ export { apiRouter, mainRouter } from './src/router/index.mjs';
3
3
  export { app, serverInit } from './src/server/index.mjs';
4
4
  export { OPERATORS, converter, existsOperator, moduler, paginate, refactorWhere, responseWrapper } from './src/tools/index.mjs';
5
5
  export { IMiddlewareContract, TenantService } from './src/services/index.mjs';
6
+ export { OptionsSchema } from './src/schemas/index.mjs';
6
7
  import 'typeorm';
7
8
  import 'fastify';
8
9
  import 'http';
9
- import './src/schemas/index.mjs';
10
10
  import 'zod';
package/dist/index.d.ts CHANGED
@@ -3,8 +3,8 @@ export { apiRouter, mainRouter } from './src/router/index.js';
3
3
  export { app, serverInit } from './src/server/index.js';
4
4
  export { OPERATORS, converter, existsOperator, moduler, paginate, refactorWhere, responseWrapper } from './src/tools/index.js';
5
5
  export { IMiddlewareContract, TenantService } from './src/services/index.js';
6
+ export { OptionsSchema } from './src/schemas/index.js';
6
7
  import 'typeorm';
7
8
  import 'fastify';
8
9
  import 'http';
9
- import './src/schemas/index.js';
10
10
  import 'zod';
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
33
  OPERATORS: () => OPERATORS,
34
+ OptionsSchema: () => OptionsSchema,
34
35
  TenantService: () => TenantService,
35
36
  apiRouter: () => apiRouter,
36
37
  app: () => app,
@@ -190,8 +191,8 @@ var parse = (json) => {
190
191
  return json;
191
192
  };
192
193
  var OptionsSchema = import_zod2.z.object({
193
- take: import_zod2.z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
194
- page: import_zod2.z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
194
+ take: import_zod2.z.number().max(200).default(20),
195
+ page: import_zod2.z.number().default(0),
195
196
  select: import_zod2.z.array(import_zod2.z.string()).optional(),
196
197
  relations: import_zod2.z.array(import_zod2.z.string()).optional(),
197
198
  where: import_zod2.z.any().transform((value) => refactorWhere(parse(value))).optional(),
@@ -353,6 +354,7 @@ var TenantService = class {
353
354
  // Annotate the CommonJS export names for ESM import in node:
354
355
  0 && (module.exports = {
355
356
  OPERATORS,
357
+ OptionsSchema,
356
358
  TenantService,
357
359
  apiRouter,
358
360
  app,
package/dist/index.mjs CHANGED
@@ -160,8 +160,8 @@ var parse = (json) => {
160
160
  return json;
161
161
  };
162
162
  var OptionsSchema = z.object({
163
- take: z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
164
- page: z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
163
+ take: z.number().max(200).default(20),
164
+ page: z.number().default(0),
165
165
  select: z.array(z.string()).optional(),
166
166
  relations: z.array(z.string()).optional(),
167
167
  where: z.any().transform((value) => refactorWhere(parse(value))).optional(),
@@ -322,6 +322,7 @@ var TenantService = class {
322
322
  };
323
323
  export {
324
324
  OPERATORS,
325
+ OptionsSchema,
325
326
  TenantService,
326
327
  apiRouter,
327
328
  app,
@@ -144,8 +144,8 @@ var parse = (json) => {
144
144
  return json;
145
145
  };
146
146
  var OptionsSchema = import_zod2.z.object({
147
- take: import_zod2.z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
148
- page: import_zod2.z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
147
+ take: import_zod2.z.number().max(200).default(20),
148
+ page: import_zod2.z.number().default(0),
149
149
  select: import_zod2.z.array(import_zod2.z.string()).optional(),
150
150
  relations: import_zod2.z.array(import_zod2.z.string()).optional(),
151
151
  where: import_zod2.z.any().transform((value) => refactorWhere(parse(value))).optional(),
@@ -118,8 +118,8 @@ var parse = (json) => {
118
118
  return json;
119
119
  };
120
120
  var OptionsSchema = z.object({
121
- take: z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
122
- page: z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
121
+ take: z.number().max(200).default(20),
122
+ page: z.number().default(0),
123
123
  select: z.array(z.string()).optional(),
124
124
  relations: z.array(z.string()).optional(),
125
125
  where: z.any().transform((value) => refactorWhere(parse(value))).optional(),
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  declare const OptionsSchema: z.ZodObject<{
4
- take: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<number | undefined, string>>;
5
- page: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<number, string>>;
4
+ take: z.ZodDefault<z.ZodNumber>;
5
+ page: z.ZodDefault<z.ZodNumber>;
6
6
  select: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
7
  relations: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
8
  where: z.ZodOptional<z.ZodPipe<z.ZodAny, z.ZodTransform<any, any>>>;
@@ -1,8 +1,8 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  declare const OptionsSchema: z.ZodObject<{
4
- take: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<number | undefined, string>>;
5
- page: z.ZodPipe<z.ZodDefault<z.ZodString>, z.ZodTransform<number, string>>;
4
+ take: z.ZodDefault<z.ZodNumber>;
5
+ page: z.ZodDefault<z.ZodNumber>;
6
6
  select: z.ZodOptional<z.ZodArray<z.ZodString>>;
7
7
  relations: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
8
  where: z.ZodOptional<z.ZodPipe<z.ZodAny, z.ZodTransform<any, any>>>;
@@ -121,8 +121,8 @@ var parse = (json) => {
121
121
  return json;
122
122
  };
123
123
  var OptionsSchema = import_zod.z.object({
124
- take: import_zod.z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
125
- page: import_zod.z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
124
+ take: import_zod.z.number().max(200).default(20),
125
+ page: import_zod.z.number().default(0),
126
126
  select: import_zod.z.array(import_zod.z.string()).optional(),
127
127
  relations: import_zod.z.array(import_zod.z.string()).optional(),
128
128
  where: import_zod.z.any().transform((value) => refactorWhere(parse(value))).optional(),
@@ -96,8 +96,8 @@ var parse = (json) => {
96
96
  return json;
97
97
  };
98
98
  var OptionsSchema = z.object({
99
- take: z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
100
- page: z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
99
+ take: z.number().max(200).default(20),
100
+ page: z.number().default(0),
101
101
  select: z.array(z.string()).optional(),
102
102
  relations: z.array(z.string()).optional(),
103
103
  where: z.any().transform((value) => refactorWhere(parse(value))).optional(),
@@ -145,8 +145,8 @@ var parse = (json) => {
145
145
  return json;
146
146
  };
147
147
  var OptionsSchema = import_zod2.z.object({
148
- take: import_zod2.z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
149
- page: import_zod2.z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
148
+ take: import_zod2.z.number().max(200).default(20),
149
+ page: import_zod2.z.number().default(0),
150
150
  select: import_zod2.z.array(import_zod2.z.string()).optional(),
151
151
  relations: import_zod2.z.array(import_zod2.z.string()).optional(),
152
152
  where: import_zod2.z.any().transform((value) => refactorWhere(parse(value))).optional(),
@@ -121,8 +121,8 @@ var parse = (json) => {
121
121
  return json;
122
122
  };
123
123
  var OptionsSchema = z.object({
124
- take: z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
125
- page: z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
124
+ take: z.number().max(200).default(20),
125
+ page: z.number().default(0),
126
126
  select: z.array(z.string()).optional(),
127
127
  relations: z.array(z.string()).optional(),
128
128
  where: z.any().transform((value) => refactorWhere(parse(value))).optional(),
@@ -149,8 +149,8 @@ var parse = (json) => {
149
149
  return json;
150
150
  };
151
151
  var OptionsSchema = import_zod2.z.object({
152
- take: import_zod2.z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
153
- page: import_zod2.z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
152
+ take: import_zod2.z.number().max(200).default(20),
153
+ page: import_zod2.z.number().default(0),
154
154
  select: import_zod2.z.array(import_zod2.z.string()).optional(),
155
155
  relations: import_zod2.z.array(import_zod2.z.string()).optional(),
156
156
  where: import_zod2.z.any().transform((value) => refactorWhere(parse(value))).optional(),
@@ -125,8 +125,8 @@ var parse = (json) => {
125
125
  return json;
126
126
  };
127
127
  var OptionsSchema = z.object({
128
- take: z.string().default("20").transform((value) => Number(value) ? Number(value) : value === "infinity" ? void 0 : 20),
129
- page: z.string().default("0").transform((value) => Number(value) ? Number(value) : 0),
128
+ take: z.number().max(200).default(20),
129
+ page: z.number().default(0),
130
130
  select: z.array(z.string()).optional(),
131
131
  relations: z.array(z.string()).optional(),
132
132
  where: z.any().transform((value) => refactorWhere(parse(value))).optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/node",
3
- "version": "1.0.33",
3
+ "version": "1.0.35",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",