@miguelmorales13/nestkit 0.26.0 → 0.29.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 (289) hide show
  1. package/README.md +69 -0
  2. package/dist/alerts/alert-on-failure.decorator.d.ts +5 -0
  3. package/dist/alerts/alert-sinks.d.ts +29 -0
  4. package/dist/alerts/alerts.module.d.ts +19 -0
  5. package/dist/alerts/alerts.options.d.ts +1 -0
  6. package/dist/alerts/alerts.service.d.ts +28 -0
  7. package/dist/alerts/alerts.types.d.ts +66 -0
  8. package/dist/alerts/index.cjs +276 -0
  9. package/dist/alerts/index.d.ts +10 -0
  10. package/dist/alerts/index.js +276 -0
  11. package/dist/alerts/logger-with-alerts.d.ts +18 -0
  12. package/dist/alerts/process-guards.d.ts +21 -0
  13. package/dist/alerts/runtime.d.ts +4 -0
  14. package/dist/audit/index.cjs +13 -13
  15. package/dist/audit/index.js +2 -2
  16. package/dist/auth/index.cjs +21 -21
  17. package/dist/auth/index.js +3 -3
  18. package/dist/auth/oauth/index.cjs +101 -101
  19. package/dist/auth/oauth/index.js +3 -3
  20. package/dist/bootstrap/apply-defaults.d.ts +9 -0
  21. package/dist/bootstrap/index.cjs +7 -6
  22. package/dist/bootstrap/index.js +6 -5
  23. package/dist/chunk-33KFVAUZ.cjs +151 -0
  24. package/dist/chunk-3TUMVLPJ.js +14 -0
  25. package/dist/{chunk-PA24P76K.js → chunk-45SW7FBE.js} +1 -1
  26. package/dist/{chunk-RF75KC63.cjs → chunk-47IYXZHW.cjs} +2 -2
  27. package/dist/{chunk-TUNDBBQF.js → chunk-4WWOKZIO.js} +4 -4
  28. package/dist/{chunk-2DUEQKOI.js → chunk-5LVGCTJ3.js} +4 -4
  29. package/dist/chunk-A6YGIZCQ.cjs +14 -0
  30. package/dist/chunk-A7FI6HXV.js +40 -0
  31. package/dist/chunk-CU4FUIVJ.cjs +8 -0
  32. package/dist/{chunk-FH5UNWWW.cjs → chunk-D35TBVRO.cjs} +4 -4
  33. package/dist/{chunk-4MGIQFAJ.js → chunk-D3DDJWUD.js} +5 -0
  34. package/dist/chunk-DVGPEBUL.js +8 -0
  35. package/dist/{chunk-VKOPDDCC.js → chunk-ENZ7LQRE.js} +1 -1
  36. package/dist/{chunk-3AUOOEQO.cjs → chunk-F77X4QUN.cjs} +2 -2
  37. package/dist/chunk-FBNV5X6C.js +61 -0
  38. package/dist/{chunk-APUFKA4K.cjs → chunk-FDZQCLLK.cjs} +6 -6
  39. package/dist/{chunk-DYHSOULW.js → chunk-IGSNB5BX.js} +1 -1
  40. package/dist/chunk-IVWPA6QH.cjs +90 -0
  41. package/dist/{chunk-LSDY6ETG.cjs → chunk-JJKGQNGD.cjs} +5 -5
  42. package/dist/{chunk-ALIKVFOV.cjs → chunk-JRFE7NSO.cjs} +12 -4
  43. package/dist/{chunk-HVHYZXBB.cjs → chunk-KNU5RN3O.cjs} +3 -3
  44. package/dist/{chunk-52IOOHNX.cjs → chunk-KQPJCVN3.cjs} +26 -26
  45. package/dist/chunk-LGFHLAY3.cjs +61 -0
  46. package/dist/{chunk-2REOCMUD.cjs → chunk-LRX7AMSS.cjs} +6 -1
  47. package/dist/chunk-LU3HO7B3.js +151 -0
  48. package/dist/{chunk-4PFAKLT3.js → chunk-MUWHGBIB.js} +1 -1
  49. package/dist/{chunk-ZJMLEP5H.js → chunk-NJYLQDB3.js} +1 -1
  50. package/dist/{chunk-IFNYRZP2.js → chunk-OSRH6KYZ.js} +4 -4
  51. package/dist/{chunk-6RAPVLJM.js → chunk-OTE77ONL.js} +1 -1
  52. package/dist/chunk-UDACUMLO.cjs +40 -0
  53. package/dist/{chunk-PFHHLB7B.js → chunk-UGAAJRPO.js} +10 -2
  54. package/dist/{chunk-SPTDXUED.cjs → chunk-URLDTS2Q.cjs} +2 -2
  55. package/dist/{chunk-W2T2VFLC.cjs → chunk-VALDHJOO.cjs} +5 -5
  56. package/dist/chunk-WFCQDOSN.js +90 -0
  57. package/dist/consent/consent.interceptor.d.ts +20 -0
  58. package/dist/consent/consent.module.d.ts +25 -0
  59. package/dist/consent/consent.options.d.ts +30 -0
  60. package/dist/consent/consent.port.d.ts +17 -0
  61. package/dist/consent/consent.service.d.ts +44 -0
  62. package/dist/consent/guard/index.cjs +13 -0
  63. package/dist/consent/guard/index.d.ts +31 -0
  64. package/dist/consent/guard/index.js +13 -0
  65. package/dist/consent/index.cjs +271 -0
  66. package/dist/consent/index.d.ts +13 -0
  67. package/dist/consent/index.js +271 -0
  68. package/dist/consent/memory.store.d.ts +7 -0
  69. package/dist/consent/shared/index.cjs +11 -0
  70. package/dist/consent/shared/index.d.ts +19 -0
  71. package/dist/consent/shared/index.js +11 -0
  72. package/dist/consent/typeorm.store.d.ts +22 -0
  73. package/dist/crud/index.cjs +4 -4
  74. package/dist/crud/index.js +3 -3
  75. package/dist/database/postgres/index.cjs +3 -3
  76. package/dist/database/postgres/index.js +2 -2
  77. package/dist/database/supabase/index.cjs +3 -3
  78. package/dist/database/supabase/index.js +2 -2
  79. package/dist/database/typeorm/index.cjs +2 -2
  80. package/dist/database/typeorm/index.js +1 -1
  81. package/dist/devices/device-check.interceptor.d.ts +20 -0
  82. package/dist/devices/devices.module.d.ts +28 -0
  83. package/dist/devices/devices.options.d.ts +53 -0
  84. package/dist/devices/devices.port.d.ts +62 -0
  85. package/dist/devices/devices.service.d.ts +58 -0
  86. package/dist/devices/index.cjs +327 -0
  87. package/dist/devices/index.d.ts +8 -0
  88. package/dist/devices/index.js +327 -0
  89. package/dist/devices/memory.store.d.ts +12 -0
  90. package/dist/email/index.cjs +2 -2
  91. package/dist/email/index.js +1 -1
  92. package/dist/email/nodemailer/index.cjs +2 -2
  93. package/dist/email/nodemailer/index.js +1 -1
  94. package/dist/email/resend/index.cjs +2 -2
  95. package/dist/email/resend/index.js +1 -1
  96. package/dist/entities/index.cjs +1 -1
  97. package/dist/entities/index.js +1 -1
  98. package/dist/errors/index.cjs +7 -7
  99. package/dist/errors/index.js +7 -7
  100. package/dist/events/buses.d.ts +27 -0
  101. package/dist/events/events.controller.d.ts +15 -0
  102. package/dist/events/events.module.d.ts +29 -0
  103. package/dist/events/events.options.d.ts +50 -0
  104. package/dist/events/events.service.d.ts +49 -0
  105. package/dist/events/events.types.d.ts +77 -0
  106. package/dist/events/index.cjs +557 -0
  107. package/dist/events/index.d.ts +10 -0
  108. package/dist/events/index.js +557 -0
  109. package/dist/events/memory-ticket.store.d.ts +9 -0
  110. package/dist/google-business/google-business-http.d.ts +41 -0
  111. package/dist/google-business/google-business.errors.d.ts +75 -0
  112. package/dist/google-business/google-business.mappers.d.ts +52 -0
  113. package/dist/google-business/google-business.module.d.ts +26 -0
  114. package/dist/google-business/google-business.options.d.ts +40 -0
  115. package/dist/google-business/google-business.ports.d.ts +18 -0
  116. package/dist/google-business/google-business.service.d.ts +120 -0
  117. package/dist/google-business/google-business.types.d.ts +155 -0
  118. package/dist/google-business/index.cjs +1025 -0
  119. package/dist/google-business/index.d.ts +15 -0
  120. package/dist/google-business/index.js +1025 -0
  121. package/dist/google-business/testing/google-simulator.d.ts +61 -0
  122. package/dist/hardening/body-limits.d.ts +24 -0
  123. package/dist/hardening/http.types.d.ts +26 -0
  124. package/dist/hardening/index.cjs +179 -0
  125. package/dist/hardening/index.d.ts +19 -0
  126. package/dist/hardening/index.js +179 -0
  127. package/dist/hardening/memory-rate-limit.store.d.ts +10 -0
  128. package/dist/hardening/origin-secret.d.ts +29 -0
  129. package/dist/hardening/rate-limit.decorator.d.ts +8 -0
  130. package/dist/hardening/rate-limit.guard.d.ts +18 -0
  131. package/dist/hardening/rate-limit.module.d.ts +23 -0
  132. package/dist/hardening/rate-limit.options.d.ts +35 -0
  133. package/dist/hardening/rate-limit.port.d.ts +11 -0
  134. package/dist/hardening/redis-rate-limit.store.d.ts +23 -0
  135. package/dist/hardening/trust-proxy.d.ts +22 -0
  136. package/dist/health/health.controller.d.ts +32 -0
  137. package/dist/health/health.module.d.ts +15 -0
  138. package/dist/health/health.options.d.ts +24 -0
  139. package/dist/health/index.cjs +103 -0
  140. package/dist/health/index.d.ts +5 -0
  141. package/dist/health/index.js +103 -0
  142. package/dist/i18n/index.cjs +3 -3
  143. package/dist/i18n/index.js +2 -2
  144. package/dist/idempotency/idempotency.interceptor.d.ts +1 -0
  145. package/dist/idempotency/idempotency.options.d.ts +15 -0
  146. package/dist/idempotency/index.cjs +214 -7
  147. package/dist/idempotency/index.d.ts +5 -0
  148. package/dist/idempotency/index.js +210 -3
  149. package/dist/idempotency/no-idempotency.decorator.d.ts +8 -0
  150. package/dist/idempotency/postgres.store.d.ts +49 -0
  151. package/dist/idempotency/redis.store.d.ts +59 -0
  152. package/dist/index.cjs +21 -20
  153. package/dist/index.js +33 -32
  154. package/dist/invoicing/index.cjs +2 -2
  155. package/dist/invoicing/index.js +1 -1
  156. package/dist/jobs/defer-job.d.ts +10 -0
  157. package/dist/jobs/index.cjs +318 -0
  158. package/dist/jobs/index.d.ts +8 -0
  159. package/dist/jobs/index.js +318 -0
  160. package/dist/jobs/jobs-admin.controller.d.ts +18 -0
  161. package/dist/jobs/jobs.module.d.ts +33 -0
  162. package/dist/jobs/jobs.options.d.ts +62 -0
  163. package/dist/jobs/jobs.service.d.ts +53 -0
  164. package/dist/jobs/jobs.sql.d.ts +11 -0
  165. package/dist/media/index.cjs +14 -14
  166. package/dist/media/index.js +1 -1
  167. package/dist/meta/index.cjs +3 -3
  168. package/dist/meta/index.js +1 -1
  169. package/dist/notifications/index.cjs +375 -0
  170. package/dist/notifications/index.d.ts +8 -0
  171. package/dist/notifications/index.js +375 -0
  172. package/dist/notifications/memory.stores.d.ts +23 -0
  173. package/dist/notifications/notifications.controller.d.ts +11 -0
  174. package/dist/notifications/notifications.module.d.ts +31 -0
  175. package/dist/notifications/notifications.options.d.ts +33 -0
  176. package/dist/notifications/notifications.port.d.ts +97 -0
  177. package/dist/notifications/notifier.service.d.ts +31 -0
  178. package/dist/payments/connect/credentials-cipher.d.ts +14 -0
  179. package/dist/payments/connect/mercadopago-refund.d.ts +118 -0
  180. package/dist/payments/connect/mercadopago-signature.d.ts +6 -0
  181. package/dist/payments/connect/online-checkout.d.ts +69 -0
  182. package/dist/payments/connect/rejection.d.ts +7 -0
  183. package/dist/payments/connect/status.d.ts +20 -0
  184. package/dist/payments/connect/terminal-connections.d.ts +291 -0
  185. package/dist/payments/index.cjs +908 -10
  186. package/dist/payments/index.d.ts +10 -0
  187. package/dist/payments/index.js +900 -2
  188. package/dist/pinterest/index.cjs +3 -3
  189. package/dist/pinterest/index.js +1 -1
  190. package/dist/privacy/anonymizer.d.ts +14 -0
  191. package/dist/privacy/index.cjs +768 -0
  192. package/dist/privacy/index.d.ts +13 -0
  193. package/dist/privacy/index.js +768 -0
  194. package/dist/privacy/memory.store.d.ts +15 -0
  195. package/dist/privacy/privacy.module.d.ts +30 -0
  196. package/dist/privacy/privacy.options.d.ts +43 -0
  197. package/dist/privacy/privacy.port.d.ts +25 -0
  198. package/dist/privacy/privacy.service.d.ts +69 -0
  199. package/dist/privacy/privacy.types.d.ts +125 -0
  200. package/dist/privacy/sql.d.ts +7 -0
  201. package/dist/privacy/sql.store.d.ts +21 -0
  202. package/dist/privacy/zip.d.ts +23 -0
  203. package/dist/push/index.cjs +13 -13
  204. package/dist/push/index.js +5 -5
  205. package/dist/resilience/alert-channels.d.ts +39 -0
  206. package/dist/resilience/alert-errors.interceptor.d.ts +10 -0
  207. package/dist/resilience/alert-on-failure.decorator.d.ts +10 -0
  208. package/dist/resilience/alert.service.d.ts +77 -0
  209. package/dist/resilience/index.cjs +863 -0
  210. package/dist/resilience/index.d.ts +18 -0
  211. package/dist/resilience/index.js +863 -0
  212. package/dist/resilience/memory-alert-store.d.ts +26 -0
  213. package/dist/resilience/provider-health.controller.d.ts +14 -0
  214. package/dist/resilience/provider-unavailable.exception.d.ts +11 -0
  215. package/dist/resilience/resilience.module.d.ts +34 -0
  216. package/dist/resilience/resilience.options.d.ts +28 -0
  217. package/dist/resilience/resilience.types.d.ts +167 -0
  218. package/dist/resilience/resilient-fetch.d.ts +38 -0
  219. package/dist/resilience/runtime.d.ts +24 -0
  220. package/dist/resilience/typeorm/alert.entity.d.ts +21 -0
  221. package/dist/resilience/typeorm/index.cjs +102 -0
  222. package/dist/resilience/typeorm/index.d.ts +3 -0
  223. package/dist/resilience/typeorm/index.js +102 -0
  224. package/dist/resilience/typeorm/typeorm-alert-store.d.ts +39 -0
  225. package/dist/resilience/validate-destination.d.ts +63 -0
  226. package/dist/response/index.cjs +3 -3
  227. package/dist/response/index.js +2 -2
  228. package/dist/scheduling/cron-lock.service.d.ts +36 -0
  229. package/dist/scheduling/cron-unico.decorator.d.ts +27 -0
  230. package/dist/scheduling/fallback.store.d.ts +34 -0
  231. package/dist/scheduling/index.cjs +392 -0
  232. package/dist/scheduling/index.d.ts +18 -0
  233. package/dist/scheduling/index.js +392 -0
  234. package/dist/scheduling/lock-store.port.d.ts +19 -0
  235. package/dist/scheduling/memory.store.d.ts +15 -0
  236. package/dist/scheduling/redis.module.d.ts +31 -0
  237. package/dist/scheduling/redis.store.d.ts +24 -0
  238. package/dist/scheduling/scheduling.module.d.ts +24 -0
  239. package/dist/scheduling/scheduling.options.d.ts +27 -0
  240. package/dist/scheduling/sql.store.d.ts +26 -0
  241. package/dist/secrets/index.cjs +274 -0
  242. package/dist/secrets/index.d.ts +8 -0
  243. package/dist/secrets/index.js +274 -0
  244. package/dist/secrets/secrets.errors.d.ts +6 -0
  245. package/dist/secrets/secrets.module.d.ts +21 -0
  246. package/dist/secrets/secrets.options.d.ts +32 -0
  247. package/dist/secrets/secrets.service.d.ts +54 -0
  248. package/dist/secrets/secrets.transformer.d.ts +33 -0
  249. package/dist/security/hash.d.ts +8 -0
  250. package/dist/security/index.cjs +27 -35
  251. package/dist/security/index.d.ts +5 -0
  252. package/dist/security/index.js +24 -32
  253. package/dist/security/mask.d.ts +22 -0
  254. package/dist/security/signed-grant.d.ts +30 -0
  255. package/dist/storage/index.cjs +2 -2
  256. package/dist/storage/index.js +1 -1
  257. package/dist/stripe/index.cjs +7 -7
  258. package/dist/stripe/index.js +1 -1
  259. package/dist/telegram/index.cjs +2 -2
  260. package/dist/telegram/index.js +1 -1
  261. package/dist/tenancy/app-role.d.ts +24 -0
  262. package/dist/tenancy/db-helpers.d.ts +12 -0
  263. package/dist/tenancy/index.cjs +205 -0
  264. package/dist/tenancy/index.d.ts +14 -0
  265. package/dist/tenancy/index.js +205 -0
  266. package/dist/tenancy/pg/index.cjs +34 -0
  267. package/dist/tenancy/pg/index.d.ts +2 -0
  268. package/dist/tenancy/pg/index.js +34 -0
  269. package/dist/tenancy/pg/with-tenant.d.ts +23 -0
  270. package/dist/tenancy/request-context.d.ts +18 -0
  271. package/dist/tenancy/rls-guardrail.d.ts +38 -0
  272. package/dist/tenancy/scope.d.ts +5 -0
  273. package/dist/tenancy/tenancy.errors.d.ts +5 -0
  274. package/dist/tenancy/tenancy.middleware.d.ts +8 -0
  275. package/dist/tenancy/tenancy.module.d.ts +37 -0
  276. package/dist/tenancy/tenancy.options.d.ts +34 -0
  277. package/dist/tenancy/typeorm/index.cjs +41 -0
  278. package/dist/tenancy/typeorm/index.d.ts +2 -0
  279. package/dist/tenancy/typeorm/index.js +41 -0
  280. package/dist/tenancy/typeorm/with-tenant.d.ts +23 -0
  281. package/dist/tiktok/index.cjs +3 -3
  282. package/dist/tiktok/index.js +1 -1
  283. package/dist/tracking/index.cjs +3 -3
  284. package/dist/tracking/index.js +2 -2
  285. package/dist/umami/index.cjs +4 -4
  286. package/dist/umami/index.js +1 -1
  287. package/dist/whatsapp/index.cjs +2 -2
  288. package/dist/whatsapp/index.js +1 -1
  289. package/package.json +108 -3
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
3
+ var _chunkLRX7AMSScjs = require('./chunk-LRX7AMSS.cjs');
4
4
 
5
5
  // src/database/postgres/postgres.module.ts
6
6
  var _common = require('@nestjs/common');
@@ -8,7 +8,7 @@ var _pg = require('pg');
8
8
  var PG_POOL = /* @__PURE__ */ Symbol("PG_POOL");
9
9
  var PgModule = class {
10
10
  };
11
- PgModule = exports.PgModule = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
11
+ PgModule = exports.PgModule = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
12
12
  _common.Module.call(void 0, {
13
13
  providers: [
14
14
  {
@@ -1,12 +1,12 @@
1
- import {
2
- UnauthorizedAppException
3
- } from "./chunk-ZFIDAX7K.js";
4
1
  import {
5
2
  RequestContext
6
3
  } from "./chunk-ETRUVZTJ.js";
4
+ import {
5
+ UnauthorizedAppException
6
+ } from "./chunk-ZFIDAX7K.js";
7
7
  import {
8
8
  __decorateClass
9
- } from "./chunk-4MGIQFAJ.js";
9
+ } from "./chunk-D3DDJWUD.js";
10
10
 
11
11
  // src/auth/token.service.ts
12
12
  import jwt from "jsonwebtoken";
@@ -1,6 +1,3 @@
1
- import {
2
- AppException
3
- } from "./chunk-M3GQDRWR.js";
4
1
  import {
5
2
  getI18nRuntime,
6
3
  translate,
@@ -9,9 +6,12 @@ import {
9
6
  import {
10
7
  RequestContext
11
8
  } from "./chunk-ETRUVZTJ.js";
9
+ import {
10
+ AppException
11
+ } from "./chunk-M3GQDRWR.js";
12
12
  import {
13
13
  __decorateClass
14
- } from "./chunk-4MGIQFAJ.js";
14
+ } from "./chunk-D3DDJWUD.js";
15
15
 
16
16
  // src/errors/global-exception.filter.ts
17
17
  import {
@@ -0,0 +1,14 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/consent/shared/index.ts
2
+ function compareVersions(a, b) {
3
+ return a === b ? 0 : a < b ? -1 : 1;
4
+ }
5
+ function versionAceptadaVigente(version, minima) {
6
+ return !!version && version >= minima;
7
+ }
8
+ var isAcceptedVersionValid = versionAceptadaVigente;
9
+
10
+
11
+
12
+
13
+
14
+ exports.compareVersions = compareVersions; exports.versionAceptadaVigente = versionAceptadaVigente; exports.isAcceptedVersionValid = isAcceptedVersionValid;
@@ -0,0 +1,40 @@
1
+ import {
2
+ __export
3
+ } from "./chunk-D3DDJWUD.js";
4
+
5
+ // src/consent/guard/index.ts
6
+ var guard_exports = {};
7
+ __export(guard_exports, {
8
+ bundleContains: () => bundleContains,
9
+ checkParity: () => checkParity,
10
+ extractVersion: () => extractVersion,
11
+ verifyRelease: () => verifyRelease
12
+ });
13
+ function extractVersion(source, pattern) {
14
+ return pattern.exec(source)?.[1] ?? null;
15
+ }
16
+ function checkParity(mobile, server) {
17
+ if (!mobile || !server) return { ok: false, message: "No se pudo leer la versi\xF3n m\xEDnima (m\xF3vil o servidor)." };
18
+ return mobile === server ? { ok: true, message: `Paridad correcta: ${server}.` } : { ok: false, message: `La m\xEDnima del m\xF3vil (${mobile}) no coincide con la del servidor (${server}).` };
19
+ }
20
+ function bundleContains(bundleText, minimum) {
21
+ return bundleText.includes(minimum) ? { ok: true, message: `El bundle web trae ${minimum}.` } : { ok: false, message: `El bundle web publicado NO trae ${minimum}: publ\xEDcalo antes de desplegar la API.` };
22
+ }
23
+ function verifyRelease(input) {
24
+ const results = [checkParity(input.mobile, input.server)];
25
+ if (input.webBundle !== void 0 && input.server)
26
+ results.push(bundleContains(input.webBundle, input.server));
27
+ if (input.mobilePublished !== void 0)
28
+ results.push(
29
+ input.mobilePublished === input.server ? { ok: true, message: "M\xF3vil publicado confirmado." } : { ok: false, message: `M\xF3vil publicado (${input.mobilePublished}) distinto de la m\xEDnima (${input.server}).` }
30
+ );
31
+ return { ok: results.every((r) => r.ok), results };
32
+ }
33
+
34
+ export {
35
+ extractVersion,
36
+ checkParity,
37
+ bundleContains,
38
+ verifyRelease,
39
+ guard_exports
40
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/push/push.port.ts
2
+ var PUSH = /* @__PURE__ */ Symbol("PUSH");
3
+ var PUSH_DEVICE_STORE = /* @__PURE__ */ Symbol("PUSH_DEVICE_STORE");
4
+
5
+
6
+
7
+
8
+ exports.PUSH = PUSH; exports.PUSH_DEVICE_STORE = PUSH_DEVICE_STORE;
@@ -1,12 +1,12 @@
1
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
2
 
3
- var _chunkHDFPSA2Vcjs = require('./chunk-HDFPSA2V.cjs');
3
+ var _chunkSDWHKPXIcjs = require('./chunk-SDWHKPXI.cjs');
4
4
 
5
5
 
6
- var _chunkSDWHKPXIcjs = require('./chunk-SDWHKPXI.cjs');
6
+ var _chunkHDFPSA2Vcjs = require('./chunk-HDFPSA2V.cjs');
7
7
 
8
8
 
9
- var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
9
+ var _chunkLRX7AMSScjs = require('./chunk-LRX7AMSS.cjs');
10
10
 
11
11
  // src/auth/token.service.ts
12
12
  var _jsonwebtoken = require('jsonwebtoken'); var _jsonwebtoken2 = _interopRequireDefault(_jsonwebtoken);
@@ -63,7 +63,7 @@ var JwtAuthGuard = class {
63
63
  return true;
64
64
  }
65
65
  };
66
- JwtAuthGuard = exports.JwtAuthGuard = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
66
+ JwtAuthGuard = exports.JwtAuthGuard = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
67
67
  _common.Injectable.call(void 0, )
68
68
  ], JwtAuthGuard);
69
69
 
@@ -1,5 +1,9 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __export = (target, all) => {
4
+ for (var name in all)
5
+ __defProp(target, name, { get: all[name], enumerable: true });
6
+ };
3
7
  var __decorateClass = (decorators, target, key, kind) => {
4
8
  var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
9
  for (var i = decorators.length - 1, decorator; i >= 0; i--)
@@ -11,6 +15,7 @@ var __decorateClass = (decorators, target, key, kind) => {
11
15
  var __decorateParam = (index, decorator) => (target, key) => decorator(target, key, index);
12
16
 
13
17
  export {
18
+ __export,
14
19
  __decorateClass,
15
20
  __decorateParam
16
21
  };
@@ -0,0 +1,8 @@
1
+ // src/push/push.port.ts
2
+ var PUSH = /* @__PURE__ */ Symbol("PUSH");
3
+ var PUSH_DEVICE_STORE = /* @__PURE__ */ Symbol("PUSH_DEVICE_STORE");
4
+
5
+ export {
6
+ PUSH,
7
+ PUSH_DEVICE_STORE
8
+ };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  __decorateClass
3
- } from "./chunk-4MGIQFAJ.js";
3
+ } from "./chunk-D3DDJWUD.js";
4
4
 
5
5
  // src/database/postgres/postgres.module.ts
6
6
  import { Module } from "@nestjs/common";
@@ -6,7 +6,7 @@ var _chunkY72D5L6Icjs = require('./chunk-Y72D5L6I.cjs');
6
6
  var _chunkSDWHKPXIcjs = require('./chunk-SDWHKPXI.cjs');
7
7
 
8
8
 
9
- var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
9
+ var _chunkLRX7AMSScjs = require('./chunk-LRX7AMSS.cjs');
10
10
 
11
11
  // src/response/response.interceptor.ts
12
12
  var _common = require('@nestjs/common');
@@ -25,7 +25,7 @@ var ResponseInterceptor = class {
25
25
  );
26
26
  }
27
27
  };
28
- ResponseInterceptor = exports.ResponseInterceptor = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
28
+ ResponseInterceptor = exports.ResponseInterceptor = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
29
29
  _common.Injectable.call(void 0, )
30
30
  ], ResponseInterceptor);
31
31
 
@@ -0,0 +1,61 @@
1
+ // src/tenancy/tenancy.options.ts
2
+ var TENANCY_OPTIONS = /* @__PURE__ */ Symbol("TENANCY_OPTIONS");
3
+ var DEFAULT_GUCS = { tenant: "app.tenant_id", actor: "app.actor_id" };
4
+
5
+ // src/tenancy/request-context.ts
6
+ import { AsyncLocalStorage } from "async_hooks";
7
+ var storage = new AsyncLocalStorage();
8
+ var TenancyContext = {
9
+ run(fn, initial = {}) {
10
+ return storage.run({ ...initial }, fn);
11
+ },
12
+ setTenant(tenantId) {
13
+ const s = storage.getStore();
14
+ if (s) s.tenantId = tenantId;
15
+ },
16
+ setActor(actorId) {
17
+ const s = storage.getStore();
18
+ if (s) s.actorId = actorId;
19
+ },
20
+ tenantId() {
21
+ return storage.getStore()?.tenantId;
22
+ },
23
+ actorId() {
24
+ return storage.getStore()?.actorId;
25
+ }
26
+ };
27
+
28
+ // src/tenancy/tenancy.errors.ts
29
+ var TenantRequiredError = class extends Error {
30
+ constructor(message = "No tenant in scope: refusing to run a tenant query without one.") {
31
+ super(message);
32
+ this.code = "TENANT_REQUIRED";
33
+ this.name = "TenantRequiredError";
34
+ }
35
+ };
36
+
37
+ // src/tenancy/scope.ts
38
+ var GUC_NAME = /^[a-zA-Z_][\w]*(\.[\w-]+)+$/;
39
+ async function applyScope(query, scope, options = {}) {
40
+ const gucs = options.gucs ?? DEFAULT_GUCS;
41
+ const tenantId = scope.tenantId ?? TenancyContext.tenantId();
42
+ const actorId = scope.actorId ?? TenancyContext.actorId();
43
+ if (!tenantId && options.failClosed !== false) throw new TenantRequiredError();
44
+ const pairs = [];
45
+ if (tenantId) pairs.push([gucs.tenant, tenantId]);
46
+ if (gucs.actor && actorId) pairs.push([gucs.actor, actorId]);
47
+ for (const [name] of pairs) {
48
+ if (!GUC_NAME.test(name)) throw new Error(`Invalid GUC name: ${name}`);
49
+ }
50
+ for (const [name, value] of pairs) {
51
+ await query("SELECT set_config($1, $2, true)", [name, value]);
52
+ }
53
+ }
54
+
55
+ export {
56
+ TENANCY_OPTIONS,
57
+ DEFAULT_GUCS,
58
+ TenancyContext,
59
+ TenantRequiredError,
60
+ applyScope
61
+ };
@@ -9,7 +9,7 @@ var _chunkSDWHKPXIcjs = require('./chunk-SDWHKPXI.cjs');
9
9
 
10
10
 
11
11
 
12
- var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
12
+ var _chunkLRX7AMSScjs = require('./chunk-LRX7AMSS.cjs');
13
13
 
14
14
  // src/i18n/i18n.module.ts
15
15
 
@@ -36,7 +36,7 @@ var I18nInterceptor = class {
36
36
  return next.handle().pipe(_operators.map.call(void 0, (data) => _chunkAXMW5JF7cjs.translateDeep.call(void 0, data, lang)));
37
37
  }
38
38
  };
39
- I18nInterceptor = exports.I18nInterceptor = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
39
+ I18nInterceptor = exports.I18nInterceptor = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
40
40
  _common.Injectable.call(void 0, )
41
41
  ], I18nInterceptor);
42
42
 
@@ -181,11 +181,11 @@ var I18nModule = class {
181
181
  return this.i18n;
182
182
  }
183
183
  };
184
- I18nModule = exports.I18nModule = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
184
+ I18nModule = exports.I18nModule = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
185
185
  _common.Module.call(void 0, {}),
186
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Inject.call(void 0, NESTKIT_I18N_OPTIONS)),
187
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Optional.call(void 0, )),
188
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Inject.call(void 0, _nestjsi18n.I18nService))
186
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Inject.call(void 0, NESTKIT_I18N_OPTIONS)),
187
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Optional.call(void 0, )),
188
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Inject.call(void 0, _nestjsi18n.I18nService))
189
189
  ], I18nModule);
190
190
  var RuntimeResolver = class {
191
191
  resolve(context) {
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-ETRUVZTJ.js";
7
7
  import {
8
8
  __decorateClass
9
- } from "./chunk-4MGIQFAJ.js";
9
+ } from "./chunk-D3DDJWUD.js";
10
10
 
11
11
  // src/response/response.interceptor.ts
12
12
  import { Injectable } from "@nestjs/common";
@@ -0,0 +1,90 @@
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; }// src/hardening/http.types.ts
2
+ function pathOf(req) {
3
+ const raw = _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(req.path, () => ( req.originalUrl)), () => ( req.url)), () => ( ""));
4
+ const q = raw.indexOf("?");
5
+ return q === -1 ? raw : raw.slice(0, q);
6
+ }
7
+ function headerOf(req, name) {
8
+ const v = _optionalChain([req, 'access', _ => _.headers, 'optionalAccess', _2 => _2[name.toLowerCase()]]);
9
+ return Array.isArray(v) ? v[0] : v;
10
+ }
11
+ function matchesPath(rule, path) {
12
+ if (rule instanceof RegExp) return rule.test(path);
13
+ if (rule.endsWith("*")) return path.startsWith(rule.slice(0, -1));
14
+ return path === rule;
15
+ }
16
+
17
+ // src/hardening/body-limits.ts
18
+ var _module = require('module');
19
+ var _path = require('path');
20
+ var DEFAULT_BODY_LIMIT = "1mb";
21
+ var expressJson = (limit) => {
22
+ const req = _module.createRequire.call(void 0, _path.join.call(void 0, process.cwd(), "noop.js"));
23
+ return req("express").json({ limit });
24
+ };
25
+ function applyBodyLimits(app, options, factory = expressJson) {
26
+ const routes = _nullishCoalesce(options.routes, () => ( []));
27
+ if (routes.length) {
28
+ const parsers = /* @__PURE__ */ new Map();
29
+ const parserFor = (limit) => {
30
+ let p = parsers.get(limit);
31
+ if (!p) parsers.set(limit, p = factory(limit));
32
+ return p;
33
+ };
34
+ app.use((req, res, next) => {
35
+ const path = pathOf(req);
36
+ const rule = routes.find((r) => matchesPath(r.match, path));
37
+ return rule ? parserFor(rule.limit)(req, res, next) : next();
38
+ });
39
+ }
40
+ _optionalChain([app, 'access', _3 => _3.useBodyParser, 'optionalCall', _4 => _4("json", { limit: _nullishCoalesce(options.default, () => ( DEFAULT_BODY_LIMIT)) })]);
41
+ }
42
+
43
+ // src/hardening/origin-secret.ts
44
+ var _crypto = require('crypto');
45
+ var digest = (v) => _crypto.createHash.call(void 0, "sha256").update(v).digest();
46
+ function sameSecret(received, expected) {
47
+ return typeof received === "string" && _crypto.timingSafeEqual.call(void 0, digest(received), expected);
48
+ }
49
+ function originSecretMiddleware(options) {
50
+ const expected = options.value ? digest(options.value) : null;
51
+ const scoped = (_nullishCoalesce(options.scoped, () => ( []))).filter((s) => s.value).map((s) => ({ header: s.header, paths: s.paths, expected: digest(s.value) }));
52
+ const exclude = _nullishCoalesce(options.exclude, () => ( []));
53
+ return (req, res, next) => {
54
+ if (!expected) return next();
55
+ const path = pathOf(req);
56
+ if (exclude.some((r) => matchesPath(r, path))) return next();
57
+ if (sameSecret(headerOf(req, options.header), expected)) return next();
58
+ if (scoped.some(
59
+ (s) => s.paths.some((r) => matchesPath(r, path)) && sameSecret(headerOf(req, s.header), s.expected)
60
+ ))
61
+ return next();
62
+ res.status(_nullishCoalesce(options.status, () => ( 403))).json({
63
+ success: false,
64
+ error: { code: _nullishCoalesce(options.code, () => ( "UNTRUSTED_ORIGIN")), message: _nullishCoalesce(options.message, () => ( "Access not allowed.")) }
65
+ });
66
+ };
67
+ }
68
+
69
+ // src/hardening/trust-proxy.ts
70
+ function trustedIp(req, options = {}) {
71
+ for (const name of _nullishCoalesce(options.trustedHeaders, () => ( []))) {
72
+ const v = headerOf(req, name);
73
+ if (v) return v;
74
+ }
75
+ return _optionalChain([req, 'access', _5 => _5.ips, 'optionalAccess', _6 => _6.length]) ? req.ips[0] : _nullishCoalesce(req.ip, () => ( ""));
76
+ }
77
+ function applyTrustProxy(app, value) {
78
+ const instance = app.getHttpAdapter().getInstance();
79
+ _optionalChain([instance, 'access', _7 => _7.set, 'optionalCall', _8 => _8("trust proxy", value)]);
80
+ }
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+ exports.pathOf = pathOf; exports.matchesPath = matchesPath; exports.DEFAULT_BODY_LIMIT = DEFAULT_BODY_LIMIT; exports.applyBodyLimits = applyBodyLimits; exports.originSecretMiddleware = originSecretMiddleware; exports.trustedIp = trustedIp; exports.applyTrustProxy = applyTrustProxy;
@@ -1,8 +1,5 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
- var _chunkQ5Y33L7Bcjs = require('./chunk-Q5Y33L7B.cjs');
4
-
5
-
6
3
 
7
4
 
8
5
  var _chunkAXMW5JF7cjs = require('./chunk-AXMW5JF7.cjs');
@@ -11,7 +8,10 @@ var _chunkAXMW5JF7cjs = require('./chunk-AXMW5JF7.cjs');
11
8
  var _chunkSDWHKPXIcjs = require('./chunk-SDWHKPXI.cjs');
12
9
 
13
10
 
14
- var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
11
+ var _chunkQ5Y33L7Bcjs = require('./chunk-Q5Y33L7B.cjs');
12
+
13
+
14
+ var _chunkLRX7AMSScjs = require('./chunk-LRX7AMSS.cjs');
15
15
 
16
16
  // src/errors/global-exception.filter.ts
17
17
 
@@ -87,7 +87,7 @@ var GlobalExceptionFilter = class {
87
87
  };
88
88
  }
89
89
  };
90
- GlobalExceptionFilter = exports.GlobalExceptionFilter = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
90
+ GlobalExceptionFilter = exports.GlobalExceptionFilter = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
91
91
  _common.Catch.call(void 0, )
92
92
  ], GlobalExceptionFilter);
93
93
 
@@ -1,9 +1,14 @@
1
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
2
 
3
- var _chunk3AUOOEQOcjs = require('./chunk-3AUOOEQO.cjs');
3
+ var _chunkF77X4QUNcjs = require('./chunk-F77X4QUN.cjs');
4
4
 
5
5
 
6
- var _chunkLSDY6ETGcjs = require('./chunk-LSDY6ETG.cjs');
6
+ var _chunkJJKGQNGDcjs = require('./chunk-JJKGQNGD.cjs');
7
+
8
+
9
+
10
+
11
+ var _chunkIVWPA6QHcjs = require('./chunk-IVWPA6QH.cjs');
7
12
 
8
13
  // src/bootstrap/apply-defaults.ts
9
14
 
@@ -12,13 +17,16 @@ var _common = require('@nestjs/common');
12
17
  var _swagger = require('@nestjs/swagger');
13
18
  var _helmet = require('helmet'); var _helmet2 = _interopRequireDefault(_helmet);
14
19
  function applyNestKitDefaults(app, options = {}) {
20
+ if (options.trustProxy !== void 0) _chunkIVWPA6QHcjs.applyTrustProxy.call(void 0, app, options.trustProxy);
21
+ if (options.originSecret) app.use(_chunkIVWPA6QHcjs.originSecretMiddleware.call(void 0, options.originSecret));
22
+ if (options.bodyLimits) _chunkIVWPA6QHcjs.applyBodyLimits.call(void 0, app, options.bodyLimits);
15
23
  app.use(_helmet2.default.call(void 0, ));
16
24
  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
25
  app.useGlobalPipes(
18
26
  new (0, _common.ValidationPipe)({ whitelist: true, transform: true, ...options.validation })
19
27
  );
20
- app.useGlobalFilters(new (0, _chunkLSDY6ETGcjs.GlobalExceptionFilter)());
21
- app.useGlobalInterceptors(new (0, _chunk3AUOOEQOcjs.ResponseInterceptor)());
28
+ app.useGlobalFilters(new (0, _chunkJJKGQNGDcjs.GlobalExceptionFilter)());
29
+ app.useGlobalInterceptors(new (0, _chunkF77X4QUNcjs.ResponseInterceptor)());
22
30
  if (options.swagger !== false) {
23
31
  const swaggerOptions = _nullishCoalesce(options.swagger, () => ( { title: "API" }));
24
32
  const config = new (0, _swagger.DocumentBuilder)().setTitle(swaggerOptions.title).build();
@@ -3,7 +3,7 @@
3
3
  var _chunkSDWHKPXIcjs = require('./chunk-SDWHKPXI.cjs');
4
4
 
5
5
 
6
- var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
6
+ var _chunkLRX7AMSScjs = require('./chunk-LRX7AMSS.cjs');
7
7
 
8
8
  // src/tracking/request-id.middleware.ts
9
9
  var _crypto = require('crypto');
@@ -18,7 +18,7 @@ var RequestIdMiddleware = class {
18
18
  _chunkSDWHKPXIcjs.RequestContext.run({ requestId }, () => next());
19
19
  }
20
20
  };
21
- RequestIdMiddleware = exports.RequestIdMiddleware = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
21
+ RequestIdMiddleware = exports.RequestIdMiddleware = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
22
22
  _common.Injectable.call(void 0, )
23
23
  ], RequestIdMiddleware);
24
24
 
@@ -29,7 +29,7 @@ var TrackingModule = class {
29
29
  consumer.apply(RequestIdMiddleware).forRoutes("*");
30
30
  }
31
31
  };
32
- TrackingModule = exports.TrackingModule = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
32
+ TrackingModule = exports.TrackingModule = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
33
33
  _common.Module.call(void 0, {})
34
34
  ], TrackingModule);
35
35
 
@@ -1,38 +1,38 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } async function _asyncNullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return await 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
2
 
3
- var _chunkW2T2VFLCcjs = require('./chunk-W2T2VFLC.cjs');
4
3
 
4
+ var _chunkY72D5L6Icjs = require('./chunk-Y72D5L6I.cjs');
5
5
 
6
6
 
7
- var _chunkY72D5L6Icjs = require('./chunk-Y72D5L6I.cjs');
7
+ var _chunkVALDHJOOcjs = require('./chunk-VALDHJOO.cjs');
8
8
 
9
9
 
10
10
 
11
- var _chunk2REOCMUDcjs = require('./chunk-2REOCMUD.cjs');
11
+ var _chunkLRX7AMSScjs = require('./chunk-LRX7AMSS.cjs');
12
12
 
13
13
  // src/crud/list-query.dto.ts
14
14
  var _classtransformer = require('class-transformer');
15
15
  var _classvalidator = require('class-validator');
16
16
  var ListQuery = class {
17
17
  };
18
- _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
18
+ _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
19
19
  _classvalidator.IsOptional.call(void 0, ),
20
20
  _classtransformer.Type.call(void 0, () => Number),
21
21
  _classvalidator.IsInt.call(void 0, ),
22
22
  _classvalidator.Min.call(void 0, 1)
23
23
  ], ListQuery.prototype, "page", 2);
24
- _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
24
+ _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
25
25
  _classvalidator.IsOptional.call(void 0, ),
26
26
  _classtransformer.Type.call(void 0, () => Number),
27
27
  _classvalidator.IsInt.call(void 0, ),
28
28
  _classvalidator.Min.call(void 0, 1),
29
29
  _classvalidator.Max.call(void 0, 200)
30
30
  ], ListQuery.prototype, "limit", 2);
31
- _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
31
+ _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
32
32
  _classvalidator.IsOptional.call(void 0, ),
33
33
  _classvalidator.IsString.call(void 0, )
34
34
  ], ListQuery.prototype, "sortBy", 2);
35
- _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
35
+ _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
36
36
  _classvalidator.IsOptional.call(void 0, ),
37
37
  _classvalidator.IsIn.call(void 0, ["asc", "desc"])
38
38
  ], ListQuery.prototype, "sortOrder", 2);
@@ -117,7 +117,7 @@ var BaseCrudService = class {
117
117
  const audit = this.options.audit;
118
118
  if (!audit) return;
119
119
  await audit.recorder.record(
120
- _chunkW2T2VFLCcjs.withRequestContext.call(void 0, {
120
+ _chunkVALDHJOOcjs.withRequestContext.call(void 0, {
121
121
  action,
122
122
  resource: audit.resource,
123
123
  resourceId,
@@ -165,35 +165,35 @@ function createCrudController(serviceToken, options = {}) {
165
165
  return this.service.delete(id, tenantIdOf(req));
166
166
  }
167
167
  };
168
- _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
168
+ _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
169
169
  _common.Get.call(void 0, ),
170
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Query.call(void 0, )),
171
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
170
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Query.call(void 0, )),
171
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
172
172
  ], CrudControllerHost.prototype, "findAll", 1);
173
- _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
173
+ _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
174
174
  _common.Get.call(void 0, ":id"),
175
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "id")),
176
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
175
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "id")),
176
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
177
177
  ], CrudControllerHost.prototype, "findById", 1);
178
- _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
178
+ _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
179
179
  _common.Post.call(void 0, ),
180
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Body.call(void 0, )),
181
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
180
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Body.call(void 0, )),
181
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
182
182
  ], CrudControllerHost.prototype, "create", 1);
183
- _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
183
+ _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
184
184
  _common.Patch.call(void 0, ":id"),
185
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "id")),
186
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Body.call(void 0, )),
187
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 2, _common.Req.call(void 0, ))
185
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "id")),
186
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Body.call(void 0, )),
187
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 2, _common.Req.call(void 0, ))
188
188
  ], CrudControllerHost.prototype, "update", 1);
189
- _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
189
+ _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
190
190
  _common.Delete.call(void 0, ":id"),
191
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "id")),
192
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
191
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Param.call(void 0, "id")),
192
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 1, _common.Req.call(void 0, ))
193
193
  ], CrudControllerHost.prototype, "remove", 1);
194
- CrudControllerHost = _chunk2REOCMUDcjs.__decorateClass.call(void 0, [
194
+ CrudControllerHost = _chunkLRX7AMSScjs.__decorateClass.call(void 0, [
195
195
  _common.Controller.call(void 0, _nullishCoalesce(options.path, () => ( ""))),
196
- _chunk2REOCMUDcjs.__decorateParam.call(void 0, 0, _common.Inject.call(void 0, serviceToken))
196
+ _chunkLRX7AMSScjs.__decorateParam.call(void 0, 0, _common.Inject.call(void 0, serviceToken))
197
197
  ], CrudControllerHost);
198
198
  return CrudControllerHost;
199
199
  }