@gustavo-valsechi/node 1.0.4 → 1.0.5
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -0
- package/dist/index.mjs +22 -0
- package/dist/src/tools/index.d.mts +3 -1
- package/dist/src/tools/index.d.ts +3 -1
- package/dist/src/tools/index.js +16 -0
- package/dist/src/tools/index.mjs +22 -0
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { databaseInit } from './src/database/index.mjs';
|
|
2
2
|
export { apiRouter, mainRouter } from './src/router/index.mjs';
|
|
3
3
|
export { app, serverInit } from './src/server/index.mjs';
|
|
4
|
-
export { OPERATORS, converter, existsOperator, paginate, refactorWhere, responseWrapper } from './src/tools/index.mjs';
|
|
4
|
+
export { OPERATORS, converter, existsOperator, moduler, paginate, refactorWhere, responseWrapper } from './src/tools/index.mjs';
|
|
5
5
|
import 'typeorm';
|
|
6
6
|
import 'fastify';
|
|
7
7
|
import 'http';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { databaseInit } from './src/database/index.js';
|
|
2
2
|
export { apiRouter, mainRouter } from './src/router/index.js';
|
|
3
3
|
export { app, serverInit } from './src/server/index.js';
|
|
4
|
-
export { OPERATORS, converter, existsOperator, paginate, refactorWhere, responseWrapper } from './src/tools/index.js';
|
|
4
|
+
export { OPERATORS, converter, existsOperator, moduler, paginate, refactorWhere, responseWrapper } from './src/tools/index.js';
|
|
5
5
|
import 'typeorm';
|
|
6
6
|
import 'fastify';
|
|
7
7
|
import 'http';
|
package/dist/index.js
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
databaseInit: () => databaseInit,
|
|
38
38
|
existsOperator: () => existsOperator,
|
|
39
39
|
mainRouter: () => mainRouter,
|
|
40
|
+
moduler: () => moduler,
|
|
40
41
|
paginate: () => paginate,
|
|
41
42
|
refactorWhere: () => refactorWhere,
|
|
42
43
|
responseWrapper: () => responseWrapper,
|
|
@@ -196,6 +197,20 @@ var paginate = async (repository, options) => {
|
|
|
196
197
|
};
|
|
197
198
|
};
|
|
198
199
|
|
|
200
|
+
// src/tools/moduler.ts
|
|
201
|
+
var import_path = __toESM(require("path"));
|
|
202
|
+
var import_fs = __toESM(require("fs"));
|
|
203
|
+
var moduler = () => {
|
|
204
|
+
let content = {};
|
|
205
|
+
import_fs.default.readdirSync(__dirname).forEach((file) => {
|
|
206
|
+
if (file === "index.ts" || !file.endsWith(".ts")) return;
|
|
207
|
+
const filePath = import_path.default.join(__dirname, file);
|
|
208
|
+
const module2 = require(filePath);
|
|
209
|
+
content = { ...content, ...module2 };
|
|
210
|
+
});
|
|
211
|
+
return content;
|
|
212
|
+
};
|
|
213
|
+
|
|
199
214
|
// src/router/health.ts
|
|
200
215
|
var healthRouter = (router, options, done) => {
|
|
201
216
|
router.get("/", async (req, res) => {
|
|
@@ -276,6 +291,7 @@ var mainRouter = (router, options, done) => {
|
|
|
276
291
|
databaseInit,
|
|
277
292
|
existsOperator,
|
|
278
293
|
mainRouter,
|
|
294
|
+
moduler,
|
|
279
295
|
paginate,
|
|
280
296
|
refactorWhere,
|
|
281
297
|
responseWrapper,
|
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
1
8
|
// src/database/index.ts
|
|
2
9
|
import "dotenv/config";
|
|
3
10
|
import { hostname } from "os";
|
|
@@ -161,6 +168,20 @@ var paginate = async (repository, options) => {
|
|
|
161
168
|
};
|
|
162
169
|
};
|
|
163
170
|
|
|
171
|
+
// src/tools/moduler.ts
|
|
172
|
+
import path from "path";
|
|
173
|
+
import fs from "fs";
|
|
174
|
+
var moduler = () => {
|
|
175
|
+
let content = {};
|
|
176
|
+
fs.readdirSync(__dirname).forEach((file) => {
|
|
177
|
+
if (file === "index.ts" || !file.endsWith(".ts")) return;
|
|
178
|
+
const filePath = path.join(__dirname, file);
|
|
179
|
+
const module = __require(filePath);
|
|
180
|
+
content = { ...content, ...module };
|
|
181
|
+
});
|
|
182
|
+
return content;
|
|
183
|
+
};
|
|
184
|
+
|
|
164
185
|
// src/router/health.ts
|
|
165
186
|
var healthRouter = (router, options, done) => {
|
|
166
187
|
router.get("/", async (req, res) => {
|
|
@@ -240,6 +261,7 @@ export {
|
|
|
240
261
|
databaseInit,
|
|
241
262
|
existsOperator,
|
|
242
263
|
mainRouter,
|
|
264
|
+
moduler,
|
|
243
265
|
paginate,
|
|
244
266
|
refactorWhere,
|
|
245
267
|
responseWrapper,
|
|
@@ -24,4 +24,6 @@ declare const paginate: (repository: any, options: {
|
|
|
24
24
|
content: any;
|
|
25
25
|
}>;
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
declare const moduler: () => Record<string, any>;
|
|
28
|
+
|
|
29
|
+
export { OPERATORS, converter, existsOperator, moduler, paginate, refactorWhere, responseWrapper };
|
|
@@ -24,4 +24,6 @@ declare const paginate: (repository: any, options: {
|
|
|
24
24
|
content: any;
|
|
25
25
|
}>;
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
declare const moduler: () => Record<string, any>;
|
|
28
|
+
|
|
29
|
+
export { OPERATORS, converter, existsOperator, moduler, paginate, refactorWhere, responseWrapper };
|
package/dist/src/tools/index.js
CHANGED
|
@@ -33,6 +33,7 @@ __export(tools_exports, {
|
|
|
33
33
|
OPERATORS: () => OPERATORS,
|
|
34
34
|
converter: () => converter,
|
|
35
35
|
existsOperator: () => existsOperator,
|
|
36
|
+
moduler: () => moduler,
|
|
36
37
|
paginate: () => paginate,
|
|
37
38
|
refactorWhere: () => refactorWhere,
|
|
38
39
|
responseWrapper: () => responseWrapper
|
|
@@ -155,11 +156,26 @@ var paginate = async (repository, options) => {
|
|
|
155
156
|
content: data
|
|
156
157
|
};
|
|
157
158
|
};
|
|
159
|
+
|
|
160
|
+
// src/tools/moduler.ts
|
|
161
|
+
var import_path = __toESM(require("path"));
|
|
162
|
+
var import_fs = __toESM(require("fs"));
|
|
163
|
+
var moduler = () => {
|
|
164
|
+
let content = {};
|
|
165
|
+
import_fs.default.readdirSync(__dirname).forEach((file) => {
|
|
166
|
+
if (file === "index.ts" || !file.endsWith(".ts")) return;
|
|
167
|
+
const filePath = import_path.default.join(__dirname, file);
|
|
168
|
+
const module2 = require(filePath);
|
|
169
|
+
content = { ...content, ...module2 };
|
|
170
|
+
});
|
|
171
|
+
return content;
|
|
172
|
+
};
|
|
158
173
|
// Annotate the CommonJS export names for ESM import in node:
|
|
159
174
|
0 && (module.exports = {
|
|
160
175
|
OPERATORS,
|
|
161
176
|
converter,
|
|
162
177
|
existsOperator,
|
|
178
|
+
moduler,
|
|
163
179
|
paginate,
|
|
164
180
|
refactorWhere,
|
|
165
181
|
responseWrapper
|
package/dist/src/tools/index.mjs
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
1
8
|
// src/tools/response.ts
|
|
2
9
|
var responseWrapper = async (res, promise) => {
|
|
3
10
|
return promise.then((data) => {
|
|
@@ -125,10 +132,25 @@ var paginate = async (repository, options) => {
|
|
|
125
132
|
content: data
|
|
126
133
|
};
|
|
127
134
|
};
|
|
135
|
+
|
|
136
|
+
// src/tools/moduler.ts
|
|
137
|
+
import path from "path";
|
|
138
|
+
import fs from "fs";
|
|
139
|
+
var moduler = () => {
|
|
140
|
+
let content = {};
|
|
141
|
+
fs.readdirSync(__dirname).forEach((file) => {
|
|
142
|
+
if (file === "index.ts" || !file.endsWith(".ts")) return;
|
|
143
|
+
const filePath = path.join(__dirname, file);
|
|
144
|
+
const module = __require(filePath);
|
|
145
|
+
content = { ...content, ...module };
|
|
146
|
+
});
|
|
147
|
+
return content;
|
|
148
|
+
};
|
|
128
149
|
export {
|
|
129
150
|
OPERATORS,
|
|
130
151
|
converter,
|
|
131
152
|
existsOperator,
|
|
153
|
+
moduler,
|
|
132
154
|
paginate,
|
|
133
155
|
refactorWhere,
|
|
134
156
|
responseWrapper
|