@miguelmorales13/nestkit 0.11.0 → 0.16.0

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.
Files changed (90) hide show
  1. package/README.md +469 -9
  2. package/dist/audit/audit.module.d.ts +23 -0
  3. package/dist/audit/audit.options.d.ts +16 -0
  4. package/dist/audit/audit.port.d.ts +37 -0
  5. package/dist/audit/audit.service.d.ts +29 -0
  6. package/dist/audit/index.cjs +72 -0
  7. package/dist/audit/index.d.ts +7 -0
  8. package/dist/audit/index.js +72 -0
  9. package/dist/audit/sinks.d.ts +18 -0
  10. package/dist/auth/index.cjs +4 -3
  11. package/dist/auth/index.js +2 -1
  12. package/dist/auth/oauth/index.cjs +6 -5
  13. package/dist/auth/oauth/index.js +2 -1
  14. package/dist/bootstrap/index.cjs +6 -5
  15. package/dist/bootstrap/index.js +5 -4
  16. package/dist/chunk-47FXU74G.cjs +205 -0
  17. package/dist/{chunk-54ZXIB5T.cjs → chunk-4GT66KQS.cjs} +4 -4
  18. package/dist/{chunk-J7TURDAL.cjs → chunk-67B7IYAV.cjs} +2 -2
  19. package/dist/{chunk-NVCI3CQI.cjs → chunk-C5DV4RAX.cjs} +6 -1
  20. package/dist/{chunk-KDAA6GFF.js → chunk-DABTRWA6.js} +12 -7
  21. package/dist/{chunk-ZA56XBCK.cjs → chunk-EBPEMVZU.cjs} +15 -0
  22. package/dist/{chunk-EYURGACO.js → chunk-JV4EAOF2.js} +1 -1
  23. package/dist/chunk-KP2ZHJSR.js +35 -0
  24. package/dist/{chunk-7I2Y7V52.js → chunk-KRC47OX6.js} +1 -1
  25. package/dist/chunk-LK3OINS7.js +205 -0
  26. package/dist/{chunk-A3B2EY4V.js → chunk-MLOQDUBN.js} +6 -1
  27. package/dist/chunk-TCAMLNUZ.js +27 -0
  28. package/dist/{chunk-V2M75FN3.cjs → chunk-U7QK24HL.cjs} +2 -2
  29. package/dist/{chunk-AOCF5QCZ.js → chunk-UIVBPNH4.js} +4 -4
  30. package/dist/{chunk-TJHRABML.cjs → chunk-UWDHAZVE.cjs} +12 -7
  31. package/dist/chunk-XHW4CTBS.js +57 -0
  32. package/dist/chunk-XX5ROVSC.cjs +57 -0
  33. package/dist/chunk-Y72D5L6I.cjs +27 -0
  34. package/dist/crud/crud.controller.d.ts +3 -1
  35. package/dist/crud/crud.service.d.ts +63 -4
  36. package/dist/crud/index.cjs +7 -2
  37. package/dist/crud/index.d.ts +2 -1
  38. package/dist/crud/index.js +6 -1
  39. package/dist/crud/list-query.dto.d.ts +23 -0
  40. package/dist/crud/repository.port.d.ts +33 -1
  41. package/dist/errors/index.cjs +4 -4
  42. package/dist/errors/index.js +4 -4
  43. package/dist/idempotency/idempotency.interceptor.d.ts +35 -0
  44. package/dist/idempotency/idempotency.module.d.ts +27 -0
  45. package/dist/idempotency/idempotency.options.d.ts +29 -0
  46. package/dist/idempotency/idempotency.port.d.ts +43 -0
  47. package/dist/idempotency/index.cjs +206 -0
  48. package/dist/idempotency/index.d.ts +7 -0
  49. package/dist/idempotency/index.js +206 -0
  50. package/dist/idempotency/memory.store.d.ts +24 -0
  51. package/dist/index.cjs +26 -15
  52. package/dist/index.js +27 -16
  53. package/dist/invoicing/adapters/facturama.invoicing.d.ts +50 -0
  54. package/dist/invoicing/adapters/facturapi.invoicing.d.ts +35 -0
  55. package/dist/invoicing/amounts.d.ts +52 -0
  56. package/dist/invoicing/index.cjs +577 -0
  57. package/dist/invoicing/index.d.ts +11 -0
  58. package/dist/invoicing/index.js +577 -0
  59. package/dist/invoicing/invoicing.module.d.ts +42 -0
  60. package/dist/invoicing/invoicing.options.d.ts +51 -0
  61. package/dist/invoicing/invoicing.port.d.ts +156 -0
  62. package/dist/invoicing/lines.d.ts +21 -0
  63. package/dist/invoicing/provider-http.d.ts +21 -0
  64. package/dist/payments/adapters/clip.terminal.d.ts +101 -0
  65. package/dist/payments/adapters/mercadopago.terminal.d.ts +74 -0
  66. package/dist/payments/index.cjs +795 -0
  67. package/dist/payments/index.d.ts +12 -0
  68. package/dist/payments/index.js +795 -0
  69. package/dist/payments/money.d.ts +20 -0
  70. package/dist/payments/payments-webhook.controller.d.ts +30 -0
  71. package/dist/payments/payments.module.d.ts +45 -0
  72. package/dist/payments/payments.options.d.ts +84 -0
  73. package/dist/payments/payments.port.d.ts +174 -0
  74. package/dist/payments/provider-http.d.ts +26 -0
  75. package/dist/response/api-response.d.ts +7 -0
  76. package/dist/response/index.cjs +12 -4
  77. package/dist/response/index.d.ts +2 -0
  78. package/dist/response/index.js +12 -4
  79. package/dist/response/paginated.d.ts +25 -0
  80. package/dist/response/response.interceptor.d.ts +4 -0
  81. package/dist/tracking/index.cjs +3 -3
  82. package/dist/tracking/index.d.ts +1 -1
  83. package/dist/tracking/index.js +2 -2
  84. package/dist/tracking/request-context.d.ts +22 -0
  85. package/package.json +25 -3
  86. package/dist/chunk-3CLYZC3T.cjs +0 -104
  87. package/dist/chunk-EBO6UKHL.js +0 -20
  88. package/dist/chunk-JOVBJDJ2.js +0 -104
  89. /package/dist/{chunk-MR2IFCZE.cjs → chunk-H2EHN366.cjs} +0 -0
  90. /package/dist/{chunk-NAK4WDKS.js → chunk-ODPSIFOB.js} +0 -0
@@ -1,104 +0,0 @@
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;
@@ -1,20 +0,0 @@
1
- // src/tracking/request-context.ts
2
- import { AsyncLocalStorage } from "async_hooks";
3
- var RequestContext = class {
4
- static {
5
- this.storage = new 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 this.storage.getStore()?.requestId;
15
- }
16
- };
17
-
18
- export {
19
- RequestContext
20
- };
@@ -1,104 +0,0 @@
1
- import {
2
- __decorateClass,
3
- __decorateParam
4
- } from "./chunk-4MGIQFAJ.js";
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
- import {
35
- Body,
36
- Controller,
37
- Delete,
38
- Get,
39
- Inject,
40
- Param,
41
- Patch,
42
- Post,
43
- Query,
44
- Req
45
- } from "@nestjs/common";
46
- function createCrudController(serviceToken, options = {}) {
47
- const tenantIdOf = (req) => options.tenantIdExtractor?.(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
- __decorateClass([
69
- Get(),
70
- __decorateParam(0, Query()),
71
- __decorateParam(1, Req())
72
- ], CrudControllerHost.prototype, "findAll", 1);
73
- __decorateClass([
74
- Get(":id"),
75
- __decorateParam(0, Param("id")),
76
- __decorateParam(1, Req())
77
- ], CrudControllerHost.prototype, "findById", 1);
78
- __decorateClass([
79
- Post(),
80
- __decorateParam(0, Body()),
81
- __decorateParam(1, Req())
82
- ], CrudControllerHost.prototype, "create", 1);
83
- __decorateClass([
84
- Patch(":id"),
85
- __decorateParam(0, Param("id")),
86
- __decorateParam(1, Body()),
87
- __decorateParam(2, Req())
88
- ], CrudControllerHost.prototype, "update", 1);
89
- __decorateClass([
90
- Delete(":id"),
91
- __decorateParam(0, Param("id")),
92
- __decorateParam(1, Req())
93
- ], CrudControllerHost.prototype, "remove", 1);
94
- CrudControllerHost = __decorateClass([
95
- Controller(options.path ?? ""),
96
- __decorateParam(0, Inject(serviceToken))
97
- ], CrudControllerHost);
98
- return CrudControllerHost;
99
- }
100
-
101
- export {
102
- BaseCrudService,
103
- createCrudController
104
- };
File without changes
File without changes