@miguelmorales13/nestkit 0.1.0 → 0.1.1
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/bootstrap/index.cjs +10 -0
- package/dist/bootstrap/index.js +2 -2
- package/dist/chunk-2REOCMUD.cjs +16 -0
- package/dist/chunk-3CLYZC3T.cjs +104 -0
- package/dist/chunk-4IDLJMQA.cjs +81 -0
- package/dist/chunk-AR3EKJBR.cjs +39 -0
- package/dist/chunk-AUA4X3RE.cjs +32 -0
- package/dist/chunk-KVBQBT3D.cjs +1 -0
- package/dist/chunk-M3EL5O6T.cjs +36 -0
- package/dist/chunk-MR2IFCZE.cjs +1 -0
- package/dist/chunk-QS2W5XCQ.cjs +12 -0
- package/dist/chunk-RF75KC63.cjs +50 -0
- package/dist/chunk-SPTDXUED.cjs +39 -0
- package/dist/chunk-TJHRABML.cjs +29 -0
- package/dist/chunk-V2M75FN3.cjs +40 -0
- package/dist/chunk-ZA56XBCK.cjs +20 -0
- package/dist/crud/index.cjs +9 -0
- package/dist/database/mongo/index.cjs +1 -0
- package/dist/database/postgres/index.cjs +11 -0
- package/dist/database/supabase/index.cjs +11 -0
- package/dist/entities/index.cjs +7 -0
- package/dist/errors/index.cjs +22 -0
- package/dist/i18n/index.cjs +9 -0
- package/dist/index.cjs +75 -0
- package/dist/index.js +15 -15
- package/dist/response/index.cjs +9 -0
- package/dist/tracking/index.cjs +15 -0
- package/package.json +23 -12
- package/dist/{chunk-KP7GRCZW.js → chunk-VPS5CLHT.js} +3 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkAUA4X3REcjs = require('../chunk-AUA4X3RE.cjs');
|
|
4
|
+
require('../chunk-4IDLJMQA.cjs');
|
|
5
|
+
require('../chunk-TJHRABML.cjs');
|
|
6
|
+
require('../chunk-ZA56XBCK.cjs');
|
|
7
|
+
require('../chunk-2REOCMUD.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.applyNestKitDefaults = _chunkAUA4X3REcjs.applyNestKitDefaults;
|
package/dist/bootstrap/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
applyNestKitDefaults
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-KDAA6GFF.js";
|
|
3
|
+
} from "../chunk-VPS5CLHT.js";
|
|
5
4
|
import "../chunk-EQXYK6AL.js";
|
|
5
|
+
import "../chunk-KDAA6GFF.js";
|
|
6
6
|
import "../chunk-EBO6UKHL.js";
|
|
7
7
|
import "../chunk-4MGIQFAJ.js";
|
|
8
8
|
export {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
4
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
5
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
6
|
+
if (decorator = decorators[i])
|
|
7
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
8
|
+
if (kind && result) __defProp(target, key, result);
|
|
9
|
+
return result;
|
|
10
|
+
};
|
|
11
|
+
var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.__decorateClass = __decorateClass; exports.__decorateParam = __decorateParam;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
|
|
5
|
+
|
|
6
|
+
// src/crud/crud.service.ts
|
|
7
|
+
var BaseCrudService = class {
|
|
8
|
+
constructor(repository, options = {}) {
|
|
9
|
+
this.repository = repository;
|
|
10
|
+
this.options = options;
|
|
11
|
+
}
|
|
12
|
+
findById(id, tenantId) {
|
|
13
|
+
return this.repository.findById(id, tenantId);
|
|
14
|
+
}
|
|
15
|
+
findAll(filter, tenantId) {
|
|
16
|
+
return this.repository.findAll(filter, tenantId);
|
|
17
|
+
}
|
|
18
|
+
create(data, tenantId) {
|
|
19
|
+
return this.repository.create(data, tenantId);
|
|
20
|
+
}
|
|
21
|
+
update(id, data, tenantId) {
|
|
22
|
+
return this.repository.update(id, data, tenantId);
|
|
23
|
+
}
|
|
24
|
+
async delete(id, tenantId) {
|
|
25
|
+
if (this.options.deleteStrategy === "soft") {
|
|
26
|
+
await this.repository.update(id, { deletedAt: /* @__PURE__ */ new Date() }, tenantId);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
await this.repository.delete(id, tenantId);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/crud/crud.controller.ts
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
var _common = require('@nestjs/common');
|
|
46
|
+
function createCrudController(serviceToken, options = {}) {
|
|
47
|
+
const tenantIdOf = (req) => _optionalChain([options, 'access', _ => _.tenantIdExtractor, 'optionalCall', _2 => _2(req)]);
|
|
48
|
+
let CrudControllerHost = class {
|
|
49
|
+
constructor(service) {
|
|
50
|
+
this.service = service;
|
|
51
|
+
}
|
|
52
|
+
findAll(filter, req) {
|
|
53
|
+
return this.service.findAll(filter, tenantIdOf(req));
|
|
54
|
+
}
|
|
55
|
+
findById(id, req) {
|
|
56
|
+
return this.service.findById(id, tenantIdOf(req));
|
|
57
|
+
}
|
|
58
|
+
create(data, req) {
|
|
59
|
+
return this.service.create(data, tenantIdOf(req));
|
|
60
|
+
}
|
|
61
|
+
update(id, data, req) {
|
|
62
|
+
return this.service.update(id, data, tenantIdOf(req));
|
|
63
|
+
}
|
|
64
|
+
remove(id, req) {
|
|
65
|
+
return this.service.delete(id, tenantIdOf(req));
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
_chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
69
|
+
_common.Get.call(void 0, ),
|
|
70
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Query.call(void 0, )),
|
|
71
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
|
|
72
|
+
], CrudControllerHost.prototype, "findAll", 1);
|
|
73
|
+
_chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
74
|
+
_common.Get.call(void 0, ":id"),
|
|
75
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "id")),
|
|
76
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
|
|
77
|
+
], CrudControllerHost.prototype, "findById", 1);
|
|
78
|
+
_chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
79
|
+
_common.Post.call(void 0, ),
|
|
80
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Body.call(void 0, )),
|
|
81
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
|
|
82
|
+
], CrudControllerHost.prototype, "create", 1);
|
|
83
|
+
_chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
84
|
+
_common.Patch.call(void 0, ":id"),
|
|
85
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "id")),
|
|
86
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Body.call(void 0, )),
|
|
87
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 2, _common.Req.call(void 0, ))
|
|
88
|
+
], CrudControllerHost.prototype, "update", 1);
|
|
89
|
+
_chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
90
|
+
_common.Delete.call(void 0, ":id"),
|
|
91
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "id")),
|
|
92
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
|
|
93
|
+
], CrudControllerHost.prototype, "remove", 1);
|
|
94
|
+
CrudControllerHost = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
95
|
+
_common.Controller.call(void 0, _nullishCoalesce(options.path, () => ( ""))),
|
|
96
|
+
_chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Inject.call(void 0, serviceToken))
|
|
97
|
+
], CrudControllerHost);
|
|
98
|
+
return CrudControllerHost;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
exports.BaseCrudService = BaseCrudService; exports.createCrudController = createCrudController;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunkZA56XBCKcjs = require('./chunk-ZA56XBCK.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
|
|
7
|
+
|
|
8
|
+
// src/errors/app.exception.ts
|
|
9
|
+
var _common = require('@nestjs/common');
|
|
10
|
+
var AppException = class extends _common.HttpException {
|
|
11
|
+
constructor(code, message, status, details) {
|
|
12
|
+
super({ code, message, details }, status);
|
|
13
|
+
this.code = code;
|
|
14
|
+
this.details = details;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/errors/global-exception.filter.ts
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var GlobalExceptionFilter = class {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.logger = new (0, _common.Logger)(GlobalExceptionFilter.name);
|
|
28
|
+
}
|
|
29
|
+
catch(exception, host) {
|
|
30
|
+
const response = host.switchToHttp().getResponse();
|
|
31
|
+
const resolved = this.resolve(exception);
|
|
32
|
+
if (resolved.status >= _common.HttpStatus.INTERNAL_SERVER_ERROR) {
|
|
33
|
+
const stack = exception instanceof Error ? exception.stack : void 0;
|
|
34
|
+
this.logger.error(`Unhandled exception: ${resolved.message}`, stack);
|
|
35
|
+
}
|
|
36
|
+
const body = {
|
|
37
|
+
success: false,
|
|
38
|
+
requestId: _nullishCoalesce(_chunkZA56XBCKcjs.RequestContext.getRequestId(), () => ( "unknown")),
|
|
39
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
40
|
+
error: {
|
|
41
|
+
code: resolved.code,
|
|
42
|
+
message: resolved.message,
|
|
43
|
+
details: resolved.details
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
response.status(resolved.status).send(body);
|
|
47
|
+
}
|
|
48
|
+
resolve(exception) {
|
|
49
|
+
if (exception instanceof AppException) {
|
|
50
|
+
return {
|
|
51
|
+
status: exception.getStatus(),
|
|
52
|
+
code: exception.code,
|
|
53
|
+
message: exception.message,
|
|
54
|
+
details: exception.details
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (exception instanceof _common.HttpException) {
|
|
58
|
+
const status = exception.getStatus();
|
|
59
|
+
const payload = exception.getResponse();
|
|
60
|
+
const rawMessage = typeof payload === "string" ? payload : _nullishCoalesce(payload.message, () => ( exception.message));
|
|
61
|
+
return {
|
|
62
|
+
status,
|
|
63
|
+
code: _nullishCoalesce(_common.HttpStatus[status], () => ( "HTTP_ERROR")),
|
|
64
|
+
message: Array.isArray(rawMessage) ? rawMessage.join(", ") : rawMessage
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
status: _common.HttpStatus.INTERNAL_SERVER_ERROR,
|
|
69
|
+
code: "INTERNAL_ERROR",
|
|
70
|
+
message: "Internal server error"
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
GlobalExceptionFilter = exports.GlobalExceptionFilter = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
75
|
+
_common.Catch.call(void 0, )
|
|
76
|
+
], GlobalExceptionFilter);
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
exports.AppException = AppException; exports.GlobalExceptionFilter = GlobalExceptionFilter;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk4IDLJMQAcjs = require('./chunk-4IDLJMQA.cjs');
|
|
4
|
+
|
|
5
|
+
// src/errors/common.exceptions.ts
|
|
6
|
+
var _common = require('@nestjs/common');
|
|
7
|
+
var NotFoundAppException = class extends _chunk4IDLJMQAcjs.AppException {
|
|
8
|
+
constructor(message = "Resource not found", details, code = "NOT_FOUND") {
|
|
9
|
+
super(code, message, _common.HttpStatus.NOT_FOUND, details);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var ConflictAppException = class extends _chunk4IDLJMQAcjs.AppException {
|
|
13
|
+
constructor(message = "Conflict", details, code = "CONFLICT") {
|
|
14
|
+
super(code, message, _common.HttpStatus.CONFLICT, details);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var ValidationAppException = class extends _chunk4IDLJMQAcjs.AppException {
|
|
18
|
+
constructor(message = "Validation failed", details, code = "VALIDATION_ERROR") {
|
|
19
|
+
super(code, message, _common.HttpStatus.BAD_REQUEST, details);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var UnauthorizedAppException = class extends _chunk4IDLJMQAcjs.AppException {
|
|
23
|
+
constructor(message = "Unauthorized", details, code = "UNAUTHORIZED") {
|
|
24
|
+
super(code, message, _common.HttpStatus.UNAUTHORIZED, details);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var ForbiddenAppException = class extends _chunk4IDLJMQAcjs.AppException {
|
|
28
|
+
constructor(message = "Forbidden", details, code = "FORBIDDEN") {
|
|
29
|
+
super(code, message, _common.HttpStatus.FORBIDDEN, details);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
exports.NotFoundAppException = NotFoundAppException; exports.ConflictAppException = ConflictAppException; exports.ValidationAppException = ValidationAppException; exports.UnauthorizedAppException = UnauthorizedAppException; exports.ForbiddenAppException = ForbiddenAppException;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
|
+
|
|
3
|
+
var _chunk4IDLJMQAcjs = require('./chunk-4IDLJMQA.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkTJHRABMLcjs = require('./chunk-TJHRABML.cjs');
|
|
7
|
+
|
|
8
|
+
// src/bootstrap/apply-defaults.ts
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _common = require('@nestjs/common');
|
|
12
|
+
var _swagger = require('@nestjs/swagger');
|
|
13
|
+
var _helmet = require('helmet'); var _helmet2 = _interopRequireDefault(_helmet);
|
|
14
|
+
function applyNestKitDefaults(app, options = {}) {
|
|
15
|
+
app.use(_helmet2.default.call(void 0, ));
|
|
16
|
+
app.enableCors(_nullishCoalesce(options.cors, () => ( { origin: _nullishCoalesce(_optionalChain([process, 'access', _ => _.env, 'access', _2 => _2.CORS_ORIGIN, 'optionalAccess', _3 => _3.split, 'call', _4 => _4(",")]), () => ( true)) })));
|
|
17
|
+
app.useGlobalPipes(
|
|
18
|
+
new (0, _common.ValidationPipe)({ whitelist: true, transform: true, ...options.validation })
|
|
19
|
+
);
|
|
20
|
+
app.useGlobalFilters(new (0, _chunk4IDLJMQAcjs.GlobalExceptionFilter)());
|
|
21
|
+
app.useGlobalInterceptors(new (0, _chunkTJHRABMLcjs.ResponseInterceptor)());
|
|
22
|
+
if (options.swagger !== false) {
|
|
23
|
+
const swaggerOptions = _nullishCoalesce(options.swagger, () => ( { title: "API" }));
|
|
24
|
+
const config = new (0, _swagger.DocumentBuilder)().setTitle(swaggerOptions.title).build();
|
|
25
|
+
const document = _swagger.SwaggerModule.createDocument(app, config);
|
|
26
|
+
_swagger.SwaggerModule.setup(_nullishCoalesce(swaggerOptions.path, () => ( "docs")), app, document);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
exports.applyNestKitDefaults = applyNestKitDefaults;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
|
|
4
|
+
|
|
5
|
+
// src/i18n/i18n.module.ts
|
|
6
|
+
var _common = require('@nestjs/common');
|
|
7
|
+
var _nestjsi18n = require('nestjs-i18n');
|
|
8
|
+
var I18nModule = class {
|
|
9
|
+
static forRoot(options = {}) {
|
|
10
|
+
return _nestjsi18n.I18nModule.forRoot({
|
|
11
|
+
fallbackLanguage: _nullishCoalesce(options.fallbackLanguage, () => ( "es")),
|
|
12
|
+
loaderOptions: {
|
|
13
|
+
path: _nullishCoalesce(options.path, () => ( "./i18n/")),
|
|
14
|
+
watch: true
|
|
15
|
+
},
|
|
16
|
+
loader: _nestjsi18n.I18nJsonLoader
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
I18nModule = exports.I18nModule = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
21
|
+
_common.Module.call(void 0, {})
|
|
22
|
+
], I18nModule);
|
|
23
|
+
|
|
24
|
+
// src/i18n/translate.helper.ts
|
|
25
|
+
function translateOr(i18n, key, fallback, args) {
|
|
26
|
+
try {
|
|
27
|
+
return i18n.t(key, { args, defaultValue: fallback });
|
|
28
|
+
} catch (e) {
|
|
29
|
+
return fallback;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
exports.I18nModule = I18nModule; exports.translateOr = translateOr;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/entities/base-response.dto.ts
|
|
2
|
+
var BaseResponseDto = class {
|
|
3
|
+
static fromEntity(entity) {
|
|
4
|
+
const dto = new this();
|
|
5
|
+
Object.assign(dto, entity);
|
|
6
|
+
return dto;
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
exports.BaseResponseDto = BaseResponseDto;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
|
|
4
|
+
|
|
5
|
+
// src/database/postgres/postgres.module.ts
|
|
6
|
+
var _common = require('@nestjs/common');
|
|
7
|
+
var _pg = require('pg');
|
|
8
|
+
var PG_POOL = /* @__PURE__ */ Symbol("PG_POOL");
|
|
9
|
+
var PgModule = class {
|
|
10
|
+
};
|
|
11
|
+
PgModule = exports.PgModule = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
12
|
+
_common.Module.call(void 0, {
|
|
13
|
+
providers: [
|
|
14
|
+
{
|
|
15
|
+
provide: PG_POOL,
|
|
16
|
+
useFactory: () => {
|
|
17
|
+
const connectionString = process.env.DATABASE_URL;
|
|
18
|
+
if (!connectionString) {
|
|
19
|
+
throw new Error("PgModule: DATABASE_URL environment variable is not set");
|
|
20
|
+
}
|
|
21
|
+
return new (0, _pg.Pool)({ connectionString });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
exports: [PG_POOL]
|
|
26
|
+
})
|
|
27
|
+
], PgModule);
|
|
28
|
+
|
|
29
|
+
// src/database/postgres/tenant-scope.ts
|
|
30
|
+
async function withTenantScope(pool, authUserId, fn) {
|
|
31
|
+
const client = await pool.connect();
|
|
32
|
+
try {
|
|
33
|
+
await client.query("BEGIN");
|
|
34
|
+
await client.query("SELECT set_config('request.jwt.claim.sub', $1, true)", [authUserId]);
|
|
35
|
+
const result = await fn(client);
|
|
36
|
+
await client.query("COMMIT");
|
|
37
|
+
return result;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
await client.query("ROLLBACK");
|
|
40
|
+
throw error;
|
|
41
|
+
} finally {
|
|
42
|
+
client.release();
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
exports.PG_POOL = PG_POOL; exports.PgModule = PgModule; exports.withTenantScope = withTenantScope;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
|
|
4
|
+
|
|
5
|
+
// src/database/supabase/supabase.module.ts
|
|
6
|
+
var _common = require('@nestjs/common');
|
|
7
|
+
var _supabasejs = require('@supabase/supabase-js');
|
|
8
|
+
var SUPABASE_ANON_CLIENT = /* @__PURE__ */ Symbol("SUPABASE_ANON_CLIENT");
|
|
9
|
+
var SUPABASE_SERVICE_ROLE_CLIENT = /* @__PURE__ */ Symbol("SUPABASE_SERVICE_ROLE_CLIENT");
|
|
10
|
+
function requireEnv(name) {
|
|
11
|
+
const value = process.env[name];
|
|
12
|
+
if (!value) {
|
|
13
|
+
throw new Error(`SupabaseModule: ${name} environment variable is not set`);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
var SupabaseModule = class {
|
|
18
|
+
};
|
|
19
|
+
SupabaseModule = exports.SupabaseModule = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
20
|
+
_common.Module.call(void 0, {
|
|
21
|
+
providers: [
|
|
22
|
+
{
|
|
23
|
+
provide: SUPABASE_ANON_CLIENT,
|
|
24
|
+
useFactory: () => _supabasejs.createClient.call(void 0, requireEnv("SUPABASE_URL"), requireEnv("SUPABASE_ANON_KEY"))
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
provide: SUPABASE_SERVICE_ROLE_CLIENT,
|
|
28
|
+
useFactory: () => _supabasejs.createClient.call(void 0, requireEnv("SUPABASE_URL"), requireEnv("SUPABASE_SERVICE_ROLE_KEY"))
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
exports: [SUPABASE_ANON_CLIENT, SUPABASE_SERVICE_ROLE_CLIENT]
|
|
32
|
+
})
|
|
33
|
+
], SupabaseModule);
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
exports.SUPABASE_ANON_CLIENT = SUPABASE_ANON_CLIENT; exports.SUPABASE_SERVICE_ROLE_CLIENT = SUPABASE_SERVICE_ROLE_CLIENT; exports.SupabaseModule = SupabaseModule;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunkZA56XBCKcjs = require('./chunk-ZA56XBCK.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
|
|
7
|
+
|
|
8
|
+
// src/response/response.interceptor.ts
|
|
9
|
+
var _common = require('@nestjs/common');
|
|
10
|
+
var _operators = require('rxjs/operators');
|
|
11
|
+
var ResponseInterceptor = class {
|
|
12
|
+
intercept(_context, next) {
|
|
13
|
+
return next.handle().pipe(
|
|
14
|
+
_operators.map.call(void 0, (data) => ({
|
|
15
|
+
success: true,
|
|
16
|
+
data,
|
|
17
|
+
requestId: _nullishCoalesce(_chunkZA56XBCKcjs.RequestContext.getRequestId(), () => ( "unknown")),
|
|
18
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
19
|
+
}))
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
ResponseInterceptor = exports.ResponseInterceptor = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
24
|
+
_common.Injectable.call(void 0, )
|
|
25
|
+
], ResponseInterceptor);
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
exports.ResponseInterceptor = ResponseInterceptor;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
|
|
2
|
+
|
|
3
|
+
var _chunkZA56XBCKcjs = require('./chunk-ZA56XBCK.cjs');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
|
|
7
|
+
|
|
8
|
+
// src/tracking/request-id.middleware.ts
|
|
9
|
+
var _crypto = require('crypto');
|
|
10
|
+
var _common = require('@nestjs/common');
|
|
11
|
+
var REQUEST_ID_HEADER = "x-request-id";
|
|
12
|
+
var RequestIdMiddleware = class {
|
|
13
|
+
use(req, res, next) {
|
|
14
|
+
const incoming = req.headers[REQUEST_ID_HEADER];
|
|
15
|
+
const requestId = _nullishCoalesce((Array.isArray(incoming) ? incoming[0] : incoming), () => ( _crypto.randomUUID.call(void 0, )));
|
|
16
|
+
req.requestId = requestId;
|
|
17
|
+
res.setHeader(REQUEST_ID_HEADER, requestId);
|
|
18
|
+
_chunkZA56XBCKcjs.RequestContext.run({ requestId }, () => next());
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
RequestIdMiddleware = exports.RequestIdMiddleware = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
22
|
+
_common.Injectable.call(void 0, )
|
|
23
|
+
], RequestIdMiddleware);
|
|
24
|
+
|
|
25
|
+
// src/tracking/tracking.module.ts
|
|
26
|
+
|
|
27
|
+
var TrackingModule = class {
|
|
28
|
+
configure(consumer) {
|
|
29
|
+
consumer.apply(RequestIdMiddleware).forRoutes("*");
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
TrackingModule = exports.TrackingModule = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
|
|
33
|
+
_common.Module.call(void 0, {})
|
|
34
|
+
], TrackingModule);
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
exports.REQUEST_ID_HEADER = REQUEST_ID_HEADER; exports.RequestIdMiddleware = RequestIdMiddleware; exports.TrackingModule = TrackingModule;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/tracking/request-context.ts
|
|
2
|
+
var _async_hooks = require('async_hooks');
|
|
3
|
+
var RequestContext = class {
|
|
4
|
+
static {
|
|
5
|
+
this.storage = new (0, _async_hooks.AsyncLocalStorage)();
|
|
6
|
+
}
|
|
7
|
+
static run(store, fn) {
|
|
8
|
+
return this.storage.run(store, fn);
|
|
9
|
+
}
|
|
10
|
+
static getStore() {
|
|
11
|
+
return this.storage.getStore();
|
|
12
|
+
}
|
|
13
|
+
static getRequestId() {
|
|
14
|
+
return _optionalChain([this, 'access', _ => _.storage, 'access', _2 => _2.getStore, 'call', _3 => _3(), 'optionalAccess', _4 => _4.requestId]);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
exports.RequestContext = RequestContext;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunk3CLYZC3Tcjs = require('../chunk-3CLYZC3T.cjs');
|
|
5
|
+
require('../chunk-2REOCMUD.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.BaseCrudService = _chunk3CLYZC3Tcjs.BaseCrudService; exports.createCrudController = _chunk3CLYZC3Tcjs.createCrudController;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";require('../../chunk-KVBQBT3D.cjs');
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkRF75KC63cjs = require('../../chunk-RF75KC63.cjs');
|
|
6
|
+
require('../../chunk-2REOCMUD.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.PG_POOL = _chunkRF75KC63cjs.PG_POOL; exports.PgModule = _chunkRF75KC63cjs.PgModule; exports.withTenantScope = _chunkRF75KC63cjs.withTenantScope;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkSPTDXUEDcjs = require('../../chunk-SPTDXUED.cjs');
|
|
6
|
+
require('../../chunk-2REOCMUD.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.SUPABASE_ANON_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_ANON_CLIENT; exports.SUPABASE_SERVICE_ROLE_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_SERVICE_ROLE_CLIENT; exports.SupabaseModule = _chunkSPTDXUEDcjs.SupabaseModule;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkAR3EKJBRcjs = require('../chunk-AR3EKJBR.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunk4IDLJMQAcjs = require('../chunk-4IDLJMQA.cjs');
|
|
12
|
+
require('../chunk-ZA56XBCK.cjs');
|
|
13
|
+
require('../chunk-2REOCMUD.cjs');
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
exports.AppException = _chunk4IDLJMQAcjs.AppException; exports.ConflictAppException = _chunkAR3EKJBRcjs.ConflictAppException; exports.ForbiddenAppException = _chunkAR3EKJBRcjs.ForbiddenAppException; exports.GlobalExceptionFilter = _chunk4IDLJMQAcjs.GlobalExceptionFilter; exports.NotFoundAppException = _chunkAR3EKJBRcjs.NotFoundAppException; exports.UnauthorizedAppException = _chunkAR3EKJBRcjs.UnauthorizedAppException; exports.ValidationAppException = _chunkAR3EKJBRcjs.ValidationAppException;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkM3EL5O6Tcjs = require('../chunk-M3EL5O6T.cjs');
|
|
5
|
+
require('../chunk-2REOCMUD.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.I18nModule = _chunkM3EL5O6Tcjs.I18nModule; exports.translateOr = _chunkM3EL5O6Tcjs.translateOr;
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-KVBQBT3D.cjs');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkRF75KC63cjs = require('./chunk-RF75KC63.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
var _chunkSPTDXUEDcjs = require('./chunk-SPTDXUED.cjs');
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
var _chunkAUA4X3REcjs = require('./chunk-AUA4X3RE.cjs');
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
var _chunk3CLYZC3Tcjs = require('./chunk-3CLYZC3T.cjs');
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
var _chunkAR3EKJBRcjs = require('./chunk-AR3EKJBR.cjs');
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
var _chunk4IDLJMQAcjs = require('./chunk-4IDLJMQA.cjs');
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
var _chunkQS2W5XCQcjs = require('./chunk-QS2W5XCQ.cjs');
|
|
33
|
+
require('./chunk-MR2IFCZE.cjs');
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
var _chunkTJHRABMLcjs = require('./chunk-TJHRABML.cjs');
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
var _chunkV2M75FN3cjs = require('./chunk-V2M75FN3.cjs');
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
var _chunkZA56XBCKcjs = require('./chunk-ZA56XBCK.cjs');
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
var _chunkM3EL5O6Tcjs = require('./chunk-M3EL5O6T.cjs');
|
|
49
|
+
require('./chunk-2REOCMUD.cjs');
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
exports.AppException = _chunk4IDLJMQAcjs.AppException; exports.BaseCrudService = _chunk3CLYZC3Tcjs.BaseCrudService; exports.BaseResponseDto = _chunkQS2W5XCQcjs.BaseResponseDto; exports.ConflictAppException = _chunkAR3EKJBRcjs.ConflictAppException; exports.ForbiddenAppException = _chunkAR3EKJBRcjs.ForbiddenAppException; exports.GlobalExceptionFilter = _chunk4IDLJMQAcjs.GlobalExceptionFilter; exports.I18nModule = _chunkM3EL5O6Tcjs.I18nModule; exports.NotFoundAppException = _chunkAR3EKJBRcjs.NotFoundAppException; exports.PG_POOL = _chunkRF75KC63cjs.PG_POOL; exports.PgModule = _chunkRF75KC63cjs.PgModule; exports.REQUEST_ID_HEADER = _chunkV2M75FN3cjs.REQUEST_ID_HEADER; exports.RequestContext = _chunkZA56XBCKcjs.RequestContext; exports.RequestIdMiddleware = _chunkV2M75FN3cjs.RequestIdMiddleware; exports.ResponseInterceptor = _chunkTJHRABMLcjs.ResponseInterceptor; exports.SUPABASE_ANON_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_ANON_CLIENT; exports.SUPABASE_SERVICE_ROLE_CLIENT = _chunkSPTDXUEDcjs.SUPABASE_SERVICE_ROLE_CLIENT; exports.SupabaseModule = _chunkSPTDXUEDcjs.SupabaseModule; exports.TrackingModule = _chunkV2M75FN3cjs.TrackingModule; exports.UnauthorizedAppException = _chunkAR3EKJBRcjs.UnauthorizedAppException; exports.ValidationAppException = _chunkAR3EKJBRcjs.ValidationAppException; exports.applyNestKitDefaults = _chunkAUA4X3REcjs.applyNestKitDefaults; exports.createCrudController = _chunk3CLYZC3Tcjs.createCrudController; exports.translateOr = _chunkM3EL5O6Tcjs.translateOr; exports.withTenantScope = _chunkRF75KC63cjs.withTenantScope;
|
package/dist/index.js
CHANGED
|
@@ -11,15 +11,22 @@ import {
|
|
|
11
11
|
} from "./chunk-PA24P76K.js";
|
|
12
12
|
import {
|
|
13
13
|
applyNestKitDefaults
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VPS5CLHT.js";
|
|
15
15
|
import {
|
|
16
16
|
BaseCrudService,
|
|
17
17
|
createCrudController
|
|
18
18
|
} from "./chunk-JOVBJDJ2.js";
|
|
19
19
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
ConflictAppException,
|
|
21
|
+
ForbiddenAppException,
|
|
22
|
+
NotFoundAppException,
|
|
23
|
+
UnauthorizedAppException,
|
|
24
|
+
ValidationAppException
|
|
25
|
+
} from "./chunk-HGJX2GPE.js";
|
|
26
|
+
import {
|
|
27
|
+
AppException,
|
|
28
|
+
GlobalExceptionFilter
|
|
29
|
+
} from "./chunk-EQXYK6AL.js";
|
|
23
30
|
import {
|
|
24
31
|
BaseResponseDto
|
|
25
32
|
} from "./chunk-XX2HPTRU.js";
|
|
@@ -32,20 +39,13 @@ import {
|
|
|
32
39
|
RequestIdMiddleware,
|
|
33
40
|
TrackingModule
|
|
34
41
|
} from "./chunk-EYURGACO.js";
|
|
35
|
-
import {
|
|
36
|
-
ConflictAppException,
|
|
37
|
-
ForbiddenAppException,
|
|
38
|
-
NotFoundAppException,
|
|
39
|
-
UnauthorizedAppException,
|
|
40
|
-
ValidationAppException
|
|
41
|
-
} from "./chunk-HGJX2GPE.js";
|
|
42
|
-
import {
|
|
43
|
-
AppException,
|
|
44
|
-
GlobalExceptionFilter
|
|
45
|
-
} from "./chunk-EQXYK6AL.js";
|
|
46
42
|
import {
|
|
47
43
|
RequestContext
|
|
48
44
|
} from "./chunk-EBO6UKHL.js";
|
|
45
|
+
import {
|
|
46
|
+
I18nModule,
|
|
47
|
+
translateOr
|
|
48
|
+
} from "./chunk-IYUUYCP5.js";
|
|
49
49
|
import "./chunk-4MGIQFAJ.js";
|
|
50
50
|
export {
|
|
51
51
|
AppException,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-MR2IFCZE.cjs');
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkTJHRABMLcjs = require('../chunk-TJHRABML.cjs');
|
|
5
|
+
require('../chunk-ZA56XBCK.cjs');
|
|
6
|
+
require('../chunk-2REOCMUD.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.ResponseInterceptor = _chunkTJHRABMLcjs.ResponseInterceptor;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkV2M75FN3cjs = require('../chunk-V2M75FN3.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
var _chunkZA56XBCKcjs = require('../chunk-ZA56XBCK.cjs');
|
|
9
|
+
require('../chunk-2REOCMUD.cjs');
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
exports.REQUEST_ID_HEADER = _chunkV2M75FN3cjs.REQUEST_ID_HEADER; exports.RequestContext = _chunkZA56XBCKcjs.RequestContext; exports.RequestIdMiddleware = _chunkV2M75FN3cjs.RequestIdMiddleware; exports.TrackingModule = _chunkV2M75FN3cjs.TrackingModule;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@miguelmorales13/nestkit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -18,47 +18,58 @@
|
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
20
|
"types": "./dist/index.d.ts",
|
|
21
|
-
"import": "./dist/index.js"
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"require": "./dist/index.cjs"
|
|
22
23
|
},
|
|
23
24
|
"./entities": {
|
|
24
25
|
"types": "./dist/entities/index.d.ts",
|
|
25
|
-
"import": "./dist/entities/index.js"
|
|
26
|
+
"import": "./dist/entities/index.js",
|
|
27
|
+
"require": "./dist/entities/index.cjs"
|
|
26
28
|
},
|
|
27
29
|
"./response": {
|
|
28
30
|
"types": "./dist/response/index.d.ts",
|
|
29
|
-
"import": "./dist/response/index.js"
|
|
31
|
+
"import": "./dist/response/index.js",
|
|
32
|
+
"require": "./dist/response/index.cjs"
|
|
30
33
|
},
|
|
31
34
|
"./errors": {
|
|
32
35
|
"types": "./dist/errors/index.d.ts",
|
|
33
|
-
"import": "./dist/errors/index.js"
|
|
36
|
+
"import": "./dist/errors/index.js",
|
|
37
|
+
"require": "./dist/errors/index.cjs"
|
|
34
38
|
},
|
|
35
39
|
"./tracking": {
|
|
36
40
|
"types": "./dist/tracking/index.d.ts",
|
|
37
|
-
"import": "./dist/tracking/index.js"
|
|
41
|
+
"import": "./dist/tracking/index.js",
|
|
42
|
+
"require": "./dist/tracking/index.cjs"
|
|
38
43
|
},
|
|
39
44
|
"./crud": {
|
|
40
45
|
"types": "./dist/crud/index.d.ts",
|
|
41
|
-
"import": "./dist/crud/index.js"
|
|
46
|
+
"import": "./dist/crud/index.js",
|
|
47
|
+
"require": "./dist/crud/index.cjs"
|
|
42
48
|
},
|
|
43
49
|
"./database/postgres": {
|
|
44
50
|
"types": "./dist/database/postgres/index.d.ts",
|
|
45
|
-
"import": "./dist/database/postgres/index.js"
|
|
51
|
+
"import": "./dist/database/postgres/index.js",
|
|
52
|
+
"require": "./dist/database/postgres/index.cjs"
|
|
46
53
|
},
|
|
47
54
|
"./database/supabase": {
|
|
48
55
|
"types": "./dist/database/supabase/index.d.ts",
|
|
49
|
-
"import": "./dist/database/supabase/index.js"
|
|
56
|
+
"import": "./dist/database/supabase/index.js",
|
|
57
|
+
"require": "./dist/database/supabase/index.cjs"
|
|
50
58
|
},
|
|
51
59
|
"./database/mongo": {
|
|
52
60
|
"types": "./dist/database/mongo/index.d.ts",
|
|
53
|
-
"import": "./dist/database/mongo/index.js"
|
|
61
|
+
"import": "./dist/database/mongo/index.js",
|
|
62
|
+
"require": "./dist/database/mongo/index.cjs"
|
|
54
63
|
},
|
|
55
64
|
"./i18n": {
|
|
56
65
|
"types": "./dist/i18n/index.d.ts",
|
|
57
|
-
"import": "./dist/i18n/index.js"
|
|
66
|
+
"import": "./dist/i18n/index.js",
|
|
67
|
+
"require": "./dist/i18n/index.cjs"
|
|
58
68
|
},
|
|
59
69
|
"./bootstrap": {
|
|
60
70
|
"types": "./dist/bootstrap/index.d.ts",
|
|
61
|
-
"import": "./dist/bootstrap/index.js"
|
|
71
|
+
"import": "./dist/bootstrap/index.js",
|
|
72
|
+
"require": "./dist/bootstrap/index.cjs"
|
|
62
73
|
}
|
|
63
74
|
},
|
|
64
75
|
"scripts": {
|