@pattern-stack/codegen 0.15.1 → 0.15.3
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/CHANGELOG.md +85 -0
- package/dist/chunk-27ETSJ2X.js +84 -0
- package/dist/chunk-27ETSJ2X.js.map +1 -0
- package/dist/chunk-2E224ZSN.js +20 -0
- package/dist/chunk-2E224ZSN.js.map +1 -0
- package/dist/chunk-2FTZLDBP.js +179 -0
- package/dist/chunk-2FTZLDBP.js.map +1 -0
- package/dist/chunk-2N4UG4VD.js +20 -0
- package/dist/chunk-2N4UG4VD.js.map +1 -0
- package/dist/chunk-2TVVBC53.js +92 -0
- package/dist/chunk-2TVVBC53.js.map +1 -0
- package/dist/chunk-2VHZ7EKC.js +37 -0
- package/dist/chunk-2VHZ7EKC.js.map +1 -0
- package/dist/chunk-32BMMV4H.js +109 -0
- package/dist/chunk-32BMMV4H.js.map +1 -0
- package/dist/chunk-32DOFN3T.js +4042 -0
- package/dist/chunk-32DOFN3T.js.map +1 -0
- package/dist/chunk-36U5UGIO.js +107 -0
- package/dist/chunk-36U5UGIO.js.map +1 -0
- package/dist/chunk-3CJFPU6Q.js +14 -0
- package/dist/chunk-3CJFPU6Q.js.map +1 -0
- package/dist/chunk-3NMCDN7L.js +90 -0
- package/dist/chunk-3NMCDN7L.js.map +1 -0
- package/dist/chunk-3SZFUTXE.js +62 -0
- package/dist/chunk-3SZFUTXE.js.map +1 -0
- package/dist/chunk-4DOJBQTP.js +117 -0
- package/dist/chunk-4DOJBQTP.js.map +1 -0
- package/dist/chunk-4H3PETLM.js +290 -0
- package/dist/chunk-4H3PETLM.js.map +1 -0
- package/dist/chunk-4JLJYWJC.js +308 -0
- package/dist/chunk-4JLJYWJC.js.map +1 -0
- package/dist/chunk-4KNXX6TI.js +29 -0
- package/dist/chunk-4KNXX6TI.js.map +1 -0
- package/dist/chunk-4LH67P4U.js +17 -0
- package/dist/chunk-4LH67P4U.js.map +1 -0
- package/dist/chunk-4MF3HKJA.js +94 -0
- package/dist/chunk-4MF3HKJA.js.map +1 -0
- package/dist/chunk-4MVGAMUA.js +40 -0
- package/dist/chunk-4MVGAMUA.js.map +1 -0
- package/dist/chunk-4RFHUZXU.js +635 -0
- package/dist/chunk-4RFHUZXU.js.map +1 -0
- package/dist/chunk-5A432NZJ.js +7 -0
- package/dist/chunk-5A432NZJ.js.map +1 -0
- package/dist/chunk-5Y7W3XR6.js +356 -0
- package/dist/chunk-5Y7W3XR6.js.map +1 -0
- package/dist/chunk-6DWFJNIK.js +15 -0
- package/dist/chunk-6DWFJNIK.js.map +1 -0
- package/dist/chunk-6I7ULIN6.js +15 -0
- package/dist/chunk-6I7ULIN6.js.map +1 -0
- package/dist/chunk-6XY6ZMMD.js +25 -0
- package/dist/chunk-6XY6ZMMD.js.map +1 -0
- package/dist/chunk-7B3RYX45.js +63 -0
- package/dist/chunk-7B3RYX45.js.map +1 -0
- package/dist/chunk-7C3FOSDI.js +1 -0
- package/dist/chunk-7C3FOSDI.js.map +1 -0
- package/dist/chunk-7KOW6PU6.js +59 -0
- package/dist/chunk-7KOW6PU6.js.map +1 -0
- package/dist/chunk-7RELQJIN.js +22 -0
- package/dist/chunk-7RELQJIN.js.map +1 -0
- package/dist/chunk-7YGORYZD.js +112 -0
- package/dist/chunk-7YGORYZD.js.map +1 -0
- package/dist/chunk-AHV4GDYM.js +63 -0
- package/dist/chunk-AHV4GDYM.js.map +1 -0
- package/dist/chunk-AQFQ4BYM.js +81 -0
- package/dist/chunk-AQFQ4BYM.js.map +1 -0
- package/dist/chunk-AS3NAZB6.js +14 -0
- package/dist/chunk-AS3NAZB6.js.map +1 -0
- package/dist/chunk-BGULBWKJ.js +88 -0
- package/dist/chunk-BGULBWKJ.js.map +1 -0
- package/dist/chunk-BIO6F7YI.js +17 -0
- package/dist/chunk-BIO6F7YI.js.map +1 -0
- package/dist/chunk-BOPZWRJK.js +36 -0
- package/dist/chunk-BOPZWRJK.js.map +1 -0
- package/dist/chunk-BPARRK6F.js +14 -0
- package/dist/chunk-BPARRK6F.js.map +1 -0
- package/dist/chunk-CO6LUM72.js +59 -0
- package/dist/chunk-CO6LUM72.js.map +1 -0
- package/dist/chunk-DCCZB4UC.js +100 -0
- package/dist/chunk-DCCZB4UC.js.map +1 -0
- package/dist/chunk-DV4RV2DC.js +59 -0
- package/dist/chunk-DV4RV2DC.js.map +1 -0
- package/dist/chunk-EDKJU5BO.js +11 -0
- package/dist/chunk-EDKJU5BO.js.map +1 -0
- package/dist/chunk-EO2QPOKH.js +116 -0
- package/dist/chunk-EO2QPOKH.js.map +1 -0
- package/dist/chunk-EOLLMEAH.js +155 -0
- package/dist/chunk-EOLLMEAH.js.map +1 -0
- package/dist/chunk-EWYCWP4H.js +14 -0
- package/dist/chunk-EWYCWP4H.js.map +1 -0
- package/dist/chunk-EXVDJMIY.js +33 -0
- package/dist/chunk-EXVDJMIY.js.map +1 -0
- package/dist/chunk-FASRXRX5.js +19 -0
- package/dist/chunk-FASRXRX5.js.map +1 -0
- package/dist/chunk-FBGHYQIZ.js +201 -0
- package/dist/chunk-FBGHYQIZ.js.map +1 -0
- package/dist/chunk-FI34KYZ5.js +1 -0
- package/dist/chunk-FI34KYZ5.js.map +1 -0
- package/dist/chunk-FN2PYDPP.js +1 -0
- package/dist/chunk-FN2PYDPP.js.map +1 -0
- package/dist/chunk-GCYKMF22.js +81 -0
- package/dist/chunk-GCYKMF22.js.map +1 -0
- package/dist/chunk-GM3RMJIJ.js +92 -0
- package/dist/chunk-GM3RMJIJ.js.map +1 -0
- package/dist/chunk-GYGNEQSC.js +9 -0
- package/dist/chunk-GYGNEQSC.js.map +1 -0
- package/dist/chunk-H5NH7KPE.js +21 -0
- package/dist/chunk-H5NH7KPE.js.map +1 -0
- package/dist/chunk-HNWZFNKP.js +168 -0
- package/dist/chunk-HNWZFNKP.js.map +1 -0
- package/dist/chunk-HUH73XGI.js +1 -0
- package/dist/chunk-HUH73XGI.js.map +1 -0
- package/dist/chunk-I6MVCB5A.js +39 -0
- package/dist/chunk-I6MVCB5A.js.map +1 -0
- package/dist/chunk-IBGER4YK.js +12 -0
- package/dist/chunk-IBGER4YK.js.map +1 -0
- package/dist/chunk-IF5I3DAA.js +92 -0
- package/dist/chunk-IF5I3DAA.js.map +1 -0
- package/dist/chunk-IP4OO26U.js +54 -0
- package/dist/chunk-IP4OO26U.js.map +1 -0
- package/dist/chunk-IWAOY6KC.js +1 -0
- package/dist/chunk-IWAOY6KC.js.map +1 -0
- package/dist/chunk-IYNSRIGR.js +122 -0
- package/dist/chunk-IYNSRIGR.js.map +1 -0
- package/dist/chunk-J37YWU7Y.js +19 -0
- package/dist/chunk-J37YWU7Y.js.map +1 -0
- package/dist/chunk-J6KZS54B.js +269 -0
- package/dist/chunk-J6KZS54B.js.map +1 -0
- package/dist/chunk-J6MN42LG.js +19 -0
- package/dist/chunk-J6MN42LG.js.map +1 -0
- package/dist/chunk-J7JMVS2B.js +53 -0
- package/dist/chunk-J7JMVS2B.js.map +1 -0
- package/dist/chunk-JRQO2IOF.js +65 -0
- package/dist/chunk-JRQO2IOF.js.map +1 -0
- package/dist/chunk-JWNHNUYL.js +96 -0
- package/dist/chunk-JWNHNUYL.js.map +1 -0
- package/dist/chunk-K2I6XIK5.js +122 -0
- package/dist/chunk-K2I6XIK5.js.map +1 -0
- package/dist/chunk-KVOWSC5S.js +1 -0
- package/dist/chunk-KVOWSC5S.js.map +1 -0
- package/dist/chunk-KYR3B3OW.js +79 -0
- package/dist/chunk-KYR3B3OW.js.map +1 -0
- package/dist/chunk-L3LZWWSX.js +61 -0
- package/dist/chunk-L3LZWWSX.js.map +1 -0
- package/dist/chunk-L4SDDEEU.js +1 -0
- package/dist/chunk-L4SDDEEU.js.map +1 -0
- package/dist/chunk-L6FTY45T.js +13 -0
- package/dist/chunk-L6FTY45T.js.map +1 -0
- package/dist/chunk-L7BNNRGI.js +134 -0
- package/dist/chunk-L7BNNRGI.js.map +1 -0
- package/dist/chunk-LG57S2SC.js +150 -0
- package/dist/chunk-LG57S2SC.js.map +1 -0
- package/dist/chunk-M6QLSLPO.js +97 -0
- package/dist/chunk-M6QLSLPO.js.map +1 -0
- package/dist/chunk-MZ6GV4YF.js +21 -0
- package/dist/chunk-MZ6GV4YF.js.map +1 -0
- package/dist/chunk-N5OTOWTP.js +55 -0
- package/dist/chunk-N5OTOWTP.js.map +1 -0
- package/dist/chunk-NN7XZEGF.js +14 -0
- package/dist/chunk-NN7XZEGF.js.map +1 -0
- package/dist/chunk-NPFPZ2HO.js +13 -0
- package/dist/chunk-NPFPZ2HO.js.map +1 -0
- package/dist/chunk-NXXDZ6ZF.js +42 -0
- package/dist/chunk-NXXDZ6ZF.js.map +1 -0
- package/dist/chunk-NYBCQZC7.js +11 -0
- package/dist/chunk-NYBCQZC7.js.map +1 -0
- package/dist/chunk-O37C3YE6.js +111 -0
- package/dist/chunk-O37C3YE6.js.map +1 -0
- package/dist/chunk-OFRRBC7M.js +78 -0
- package/dist/chunk-OFRRBC7M.js.map +1 -0
- package/dist/chunk-OGIZXGPY.js +222 -0
- package/dist/chunk-OGIZXGPY.js.map +1 -0
- package/dist/chunk-OKXZ63IA.js +168 -0
- package/dist/chunk-OKXZ63IA.js.map +1 -0
- package/dist/chunk-OSQRXVG2.js +58 -0
- package/dist/chunk-OSQRXVG2.js.map +1 -0
- package/dist/chunk-OTDN3OUQ.js +215 -0
- package/dist/chunk-OTDN3OUQ.js.map +1 -0
- package/dist/chunk-PNZSGAB2.js +114 -0
- package/dist/chunk-PNZSGAB2.js.map +1 -0
- package/dist/chunk-PRWIX6UW.js +21 -0
- package/dist/chunk-PRWIX6UW.js.map +1 -0
- package/dist/chunk-PSXUNOVU.js +7 -0
- package/dist/chunk-PSXUNOVU.js.map +1 -0
- package/dist/chunk-QLTJSCE6.js +44 -0
- package/dist/chunk-QLTJSCE6.js.map +1 -0
- package/dist/chunk-RC23QROE.js +447 -0
- package/dist/chunk-RC23QROE.js.map +1 -0
- package/dist/chunk-RDVTWIYY.js +212 -0
- package/dist/chunk-RDVTWIYY.js.map +1 -0
- package/dist/chunk-RFH7N6EP.js +36 -0
- package/dist/chunk-RFH7N6EP.js.map +1 -0
- package/dist/chunk-RHVN6NA7.js +134 -0
- package/dist/chunk-RHVN6NA7.js.map +1 -0
- package/dist/chunk-S7C6TIIF.js +21 -0
- package/dist/chunk-S7C6TIIF.js.map +1 -0
- package/dist/chunk-SNQ3TOWP.js +20 -0
- package/dist/chunk-SNQ3TOWP.js.map +1 -0
- package/dist/chunk-SOVM2VEK.js +14 -0
- package/dist/chunk-SOVM2VEK.js.map +1 -0
- package/dist/chunk-SQDOBLBP.js +13 -0
- package/dist/chunk-SQDOBLBP.js.map +1 -0
- package/dist/chunk-SR7F3TJY.js +130 -0
- package/dist/chunk-SR7F3TJY.js.map +1 -0
- package/dist/chunk-SZVPIHWE.js +129 -0
- package/dist/chunk-SZVPIHWE.js.map +1 -0
- package/dist/chunk-T4BIIU5E.js +89 -0
- package/dist/chunk-T4BIIU5E.js.map +1 -0
- package/dist/chunk-T6SCOJF4.js +92 -0
- package/dist/chunk-T6SCOJF4.js.map +1 -0
- package/dist/chunk-TNXH7BJS.js +48 -0
- package/dist/chunk-TNXH7BJS.js.map +1 -0
- package/dist/chunk-U64T4YZE.js +9 -0
- package/dist/chunk-U64T4YZE.js.map +1 -0
- package/dist/chunk-UQ5EHOH2.js +39 -0
- package/dist/chunk-UQ5EHOH2.js.map +1 -0
- package/dist/chunk-UTN4GBPQ.js +1 -0
- package/dist/chunk-UTN4GBPQ.js.map +1 -0
- package/dist/chunk-V4AF6DI4.js +16 -0
- package/dist/chunk-V4AF6DI4.js.map +1 -0
- package/dist/chunk-W72PRNJY.js +126 -0
- package/dist/chunk-W72PRNJY.js.map +1 -0
- package/dist/chunk-WL67FZGF.js +21 -0
- package/dist/chunk-WL67FZGF.js.map +1 -0
- package/dist/chunk-WWGYCIJX.js +29 -0
- package/dist/chunk-WWGYCIJX.js.map +1 -0
- package/dist/chunk-X2GMTYPA.js +50 -0
- package/dist/chunk-X2GMTYPA.js.map +1 -0
- package/dist/chunk-XCEI7NUH.js +41 -0
- package/dist/chunk-XCEI7NUH.js.map +1 -0
- package/dist/chunk-Y7GDG744.js +88 -0
- package/dist/chunk-Y7GDG744.js.map +1 -0
- package/dist/chunk-Y7RRSEOC.js +9 -0
- package/dist/chunk-Y7RRSEOC.js.map +1 -0
- package/dist/chunk-YLPAPPLW.js +75 -0
- package/dist/chunk-YLPAPPLW.js.map +1 -0
- package/dist/chunk-YPWODKD5.js +184 -0
- package/dist/chunk-YPWODKD5.js.map +1 -0
- package/dist/chunk-YSLTTQLC.js +25 -0
- package/dist/chunk-YSLTTQLC.js.map +1 -0
- package/dist/chunk-YTN6BKWA.js +121 -0
- package/dist/chunk-YTN6BKWA.js.map +1 -0
- package/dist/chunk-Z7PQCAVK.js +200 -0
- package/dist/chunk-Z7PQCAVK.js.map +1 -0
- package/dist/chunk-ZUKFQL6E.js +47 -0
- package/dist/chunk-ZUKFQL6E.js.map +1 -0
- package/dist/chunk-ZUMULSEQ.js +1 -0
- package/dist/chunk-ZUMULSEQ.js.map +1 -0
- package/dist/runtime/analytics/index.js +8 -41
- package/dist/runtime/analytics/index.js.map +1 -1
- package/dist/runtime/analytics/types.js +8 -41
- package/dist/runtime/analytics/types.js.map +1 -1
- package/dist/runtime/base-classes/activity-entity-repository.js +6 -312
- package/dist/runtime/base-classes/activity-entity-repository.js.map +1 -1
- package/dist/runtime/base-classes/activity-entity-service.js +6 -212
- package/dist/runtime/base-classes/activity-entity-service.js.map +1 -1
- package/dist/runtime/base-classes/base-read-use-cases.js +5 -27
- package/dist/runtime/base-classes/base-read-use-cases.js.map +1 -1
- package/dist/runtime/base-classes/base-repository.js +5 -277
- package/dist/runtime/base-classes/base-repository.js.map +1 -1
- package/dist/runtime/base-classes/base-service.js +5 -184
- package/dist/runtime/base-classes/base-service.js.map +1 -1
- package/dist/runtime/base-classes/index.js +59 -1076
- package/dist/runtime/base-classes/index.js.map +1 -1
- package/dist/runtime/base-classes/integrated-entity-repository.js +6 -486
- package/dist/runtime/base-classes/integrated-entity-repository.js.map +1 -1
- package/dist/runtime/base-classes/integrated-entity-service.js +6 -213
- package/dist/runtime/base-classes/integrated-entity-service.js.map +1 -1
- package/dist/runtime/base-classes/junction-integration-repository.js +8 -448
- package/dist/runtime/base-classes/junction-integration-repository.js.map +1 -1
- package/dist/runtime/base-classes/knowledge-entity-repository.js +6 -283
- package/dist/runtime/base-classes/knowledge-entity-repository.js.map +1 -1
- package/dist/runtime/base-classes/knowledge-entity-service.js +6 -190
- package/dist/runtime/base-classes/knowledge-entity-service.js.map +1 -1
- package/dist/runtime/base-classes/lifecycle-events.js +8 -70
- package/dist/runtime/base-classes/lifecycle-events.js.map +1 -1
- package/dist/runtime/base-classes/metadata-entity-repository.js +6 -330
- package/dist/runtime/base-classes/metadata-entity-repository.js.map +1 -1
- package/dist/runtime/base-classes/metadata-entity-service.js +6 -212
- package/dist/runtime/base-classes/metadata-entity-service.js.map +1 -1
- package/dist/runtime/base-classes/tenant-context.js +10 -36
- package/dist/runtime/base-classes/tenant-context.js.map +1 -1
- package/dist/runtime/base-classes/with-analytics.js +4 -7
- package/dist/runtime/base-classes/with-analytics.js.map +1 -1
- package/dist/runtime/constants/tokens.js +5 -3
- package/dist/runtime/constants/tokens.js.map +1 -1
- package/dist/runtime/eav-helpers.js +2 -0
- package/dist/runtime/eav-helpers.js.map +1 -1
- package/dist/runtime/pipes/zod-validation.pipe.js +3 -10
- package/dist/runtime/pipes/zod-validation.pipe.js.map +1 -1
- package/dist/runtime/shared/openapi/error-response.dto.js +5 -8
- package/dist/runtime/shared/openapi/error-response.dto.js.map +1 -1
- package/dist/runtime/shared/openapi/errors.js +5 -19
- package/dist/runtime/shared/openapi/errors.js.map +1 -1
- package/dist/runtime/shared/openapi/index.js +15 -106
- package/dist/runtime/shared/openapi/index.js.map +1 -1
- package/dist/runtime/shared/openapi/registry.js +6 -103
- package/dist/runtime/shared/openapi/registry.js.map +1 -1
- package/dist/runtime/shared/openapi/registry.tokens.js +4 -2
- package/dist/runtime/shared/openapi/registry.tokens.js.map +1 -1
- package/dist/runtime/subsystems/analytics/analytics.module.js +8 -117
- package/dist/runtime/subsystems/analytics/analytics.module.js.map +1 -1
- package/dist/runtime/subsystems/analytics/analytics.tokens.js +7 -8
- package/dist/runtime/subsystems/analytics/analytics.tokens.js.map +1 -1
- package/dist/runtime/subsystems/analytics/cube-backend.js +6 -71
- package/dist/runtime/subsystems/analytics/cube-backend.js.map +1 -1
- package/dist/runtime/subsystems/analytics/index.js +16 -117
- package/dist/runtime/subsystems/analytics/index.js.map +1 -1
- package/dist/runtime/subsystems/analytics/noop-backend.js +4 -21
- package/dist/runtime/subsystems/analytics/noop-backend.js.map +1 -1
- package/dist/runtime/subsystems/auth/auth-oauth-state.schema.js +4 -8
- package/dist/runtime/subsystems/auth/auth-oauth-state.schema.js.map +1 -1
- package/dist/runtime/subsystems/auth/auth.module.js +12 -359
- package/dist/runtime/subsystems/auth/auth.module.js.map +1 -1
- package/dist/runtime/subsystems/auth/auth.tokens.js +12 -13
- package/dist/runtime/subsystems/auth/auth.tokens.js.map +1 -1
- package/dist/runtime/subsystems/auth/backends/encryption-key/env.js +4 -49
- package/dist/runtime/subsystems/auth/backends/encryption-key/env.js.map +1 -1
- package/dist/runtime/subsystems/auth/backends/state-store.drizzle-backend.js +6 -64
- package/dist/runtime/subsystems/auth/backends/state-store.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/auth/backends/state-store.memory-backend.js +5 -47
- package/dist/runtime/subsystems/auth/backends/state-store.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/auth/controllers/auth.controller.js +5 -139
- package/dist/runtime/subsystems/auth/controllers/auth.controller.js.map +1 -1
- package/dist/runtime/subsystems/auth/index.js +53 -542
- package/dist/runtime/subsystems/auth/index.js.map +1 -1
- package/dist/runtime/subsystems/auth/middleware/requester-context.js +9 -65
- package/dist/runtime/subsystems/auth/middleware/requester-context.js.map +1 -1
- package/dist/runtime/subsystems/auth/protocols/oauth-state-store.js +4 -9
- package/dist/runtime/subsystems/auth/protocols/oauth-state-store.js.map +1 -1
- package/dist/runtime/subsystems/auth/runtime/connection-broken.error.js +4 -15
- package/dist/runtime/subsystems/auth/runtime/connection-broken.error.js.map +1 -1
- package/dist/runtime/subsystems/auth/runtime/oauth2-refresh.strategy.js +5 -104
- package/dist/runtime/subsystems/auth/runtime/oauth2-refresh.strategy.js.map +1 -1
- package/dist/runtime/subsystems/auth/runtime/session-expired.error.js +5 -16
- package/dist/runtime/subsystems/auth/runtime/session-expired.error.js.map +1 -1
- package/dist/runtime/subsystems/auth/runtime/with-auth-retry.js +5 -29
- package/dist/runtime/subsystems/auth/runtime/with-auth-retry.js.map +1 -1
- package/dist/runtime/subsystems/bridge/assert-tenant-id.js +5 -18
- package/dist/runtime/subsystems/bridge/assert-tenant-id.js.map +1 -1
- package/dist/runtime/subsystems/bridge/bridge-delivery-handler.js +12 -184
- package/dist/runtime/subsystems/bridge/bridge-delivery-handler.js.map +1 -1
- package/dist/runtime/subsystems/bridge/bridge-delivery.drizzle-backend.js +10 -448
- package/dist/runtime/subsystems/bridge/bridge-delivery.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/bridge/bridge-delivery.memory-backend.js +5 -126
- package/dist/runtime/subsystems/bridge/bridge-delivery.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/bridge/bridge-delivery.schema.js +6 -308
- package/dist/runtime/subsystems/bridge/bridge-delivery.schema.js.map +1 -1
- package/dist/runtime/subsystems/bridge/bridge-errors.js +6 -35
- package/dist/runtime/subsystems/bridge/bridge-errors.js.map +1 -1
- package/dist/runtime/subsystems/bridge/bridge-outbox-drain-hook.js +14 -606
- package/dist/runtime/subsystems/bridge/bridge-outbox-drain-hook.js.map +1 -1
- package/dist/runtime/subsystems/bridge/bridge.module.js +35 -3476
- package/dist/runtime/subsystems/bridge/bridge.module.js.map +1 -1
- package/dist/runtime/subsystems/bridge/bridge.tokens.js +9 -7
- package/dist/runtime/subsystems/bridge/bridge.tokens.js.map +1 -1
- package/dist/runtime/subsystems/bridge/event-flow.service.js +11 -137
- package/dist/runtime/subsystems/bridge/event-flow.service.js.map +1 -1
- package/dist/runtime/subsystems/bridge/generated/registry.js +4 -2
- package/dist/runtime/subsystems/bridge/generated/registry.js.map +1 -1
- package/dist/runtime/subsystems/bridge/index.js +60 -3470
- package/dist/runtime/subsystems/bridge/index.js.map +1 -1
- package/dist/runtime/subsystems/bridge/reserved-pools.js +4 -6
- package/dist/runtime/subsystems/bridge/reserved-pools.js.map +1 -1
- package/dist/runtime/subsystems/cache/cache.drizzle-backend.js +10 -133
- package/dist/runtime/subsystems/cache/cache.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/cache/cache.memory-backend.js +6 -101
- package/dist/runtime/subsystems/cache/cache.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/cache/cache.module.js +10 -278
- package/dist/runtime/subsystems/cache/cache.module.js.map +1 -1
- package/dist/runtime/subsystems/cache/cache.schema.js +4 -14
- package/dist/runtime/subsystems/cache/cache.schema.js.map +1 -1
- package/dist/runtime/subsystems/cache/cache.tokens.js +6 -7
- package/dist/runtime/subsystems/cache/cache.tokens.js.map +1 -1
- package/dist/runtime/subsystems/cache/index.js +20 -278
- package/dist/runtime/subsystems/cache/index.js.map +1 -1
- package/dist/runtime/subsystems/events/domain-events.schema.js +3 -72
- package/dist/runtime/subsystems/events/domain-events.schema.js.map +1 -1
- package/dist/runtime/subsystems/events/event-bus.drizzle-backend.js +9 -413
- package/dist/runtime/subsystems/events/event-bus.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/events/event-bus.memory-backend.js +7 -235
- package/dist/runtime/subsystems/events/event-bus.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/events/event-bus.redis-backend.js +8 -20
- package/dist/runtime/subsystems/events/event-bus.redis-backend.js.map +1 -1
- package/dist/runtime/subsystems/events/event-keyset-cursor.js +8 -30
- package/dist/runtime/subsystems/events/event-keyset-cursor.js.map +1 -1
- package/dist/runtime/subsystems/events/event-read.protocol.js +2 -0
- package/dist/runtime/subsystems/events/event-read.protocol.js.map +1 -1
- package/dist/runtime/subsystems/events/events-errors.js +4 -11
- package/dist/runtime/subsystems/events/events-errors.js.map +1 -1
- package/dist/runtime/subsystems/events/events.module.js +15 -949
- package/dist/runtime/subsystems/events/events.module.js.map +1 -1
- package/dist/runtime/subsystems/events/events.tokens.js +10 -11
- package/dist/runtime/subsystems/events/events.tokens.js.map +1 -1
- package/dist/runtime/subsystems/events/generated/bus.js +9 -240
- package/dist/runtime/subsystems/events/generated/bus.js.map +1 -1
- package/dist/runtime/subsystems/events/generated/index.js +23 -240
- package/dist/runtime/subsystems/events/generated/index.js.map +1 -1
- package/dist/runtime/subsystems/events/generated/registry.js +5 -82
- package/dist/runtime/subsystems/events/generated/registry.js.map +1 -1
- package/dist/runtime/subsystems/events/generated/schemas.js +12 -52
- package/dist/runtime/subsystems/events/generated/schemas.js.map +1 -1
- package/dist/runtime/subsystems/events/generated/types.js +1 -0
- package/dist/runtime/subsystems/events/index.js +32 -949
- package/dist/runtime/subsystems/events/index.js.map +1 -1
- package/dist/runtime/subsystems/index.d.ts +5 -1
- package/dist/runtime/subsystems/index.js +182 -5912
- package/dist/runtime/subsystems/index.js.map +1 -1
- package/dist/runtime/subsystems/integration/build-change-source.js +6 -178
- package/dist/runtime/subsystems/integration/build-change-source.js.map +1 -1
- package/dist/runtime/subsystems/integration/deep-equal.differ.js +4 -109
- package/dist/runtime/subsystems/integration/deep-equal.differ.js.map +1 -1
- package/dist/runtime/subsystems/integration/detection-config.schema.js +11 -78
- package/dist/runtime/subsystems/integration/detection-config.schema.js.map +1 -1
- package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.js +5 -30
- package/dist/runtime/subsystems/integration/entity-change-source-registry.memory.js.map +1 -1
- package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.js +4 -9
- package/dist/runtime/subsystems/integration/entity-change-source-registry.protocol.js.map +1 -1
- package/dist/runtime/subsystems/integration/execute-integration.use-case.js +6 -239
- package/dist/runtime/subsystems/integration/execute-integration.use-case.js.map +1 -1
- package/dist/runtime/subsystems/integration/incremental-read.js +5 -144
- package/dist/runtime/subsystems/integration/incremental-read.js.map +1 -1
- package/dist/runtime/subsystems/integration/index.js +83 -1352
- package/dist/runtime/subsystems/integration/index.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration-audit.schema.js +10 -155
- package/dist/runtime/subsystems/integration/integration-audit.schema.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration-cursor-store.drizzle-backend.js +7 -270
- package/dist/runtime/subsystems/integration/integration-cursor-store.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration-cursor-store.memory-backend.js +4 -65
- package/dist/runtime/subsystems/integration/integration-cursor-store.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration-errors.js +5 -15
- package/dist/runtime/subsystems/integration/integration-errors.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration-field-diff.protocol.js +5 -7
- package/dist/runtime/subsystems/integration/integration-field-diff.protocol.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration-run-recorder.drizzle-backend.js +8 -303
- package/dist/runtime/subsystems/integration/integration-run-recorder.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration-run-recorder.memory-backend.js +5 -125
- package/dist/runtime/subsystems/integration/integration-run-recorder.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration.module.js +13 -700
- package/dist/runtime/subsystems/integration/integration.module.js.map +1 -1
- package/dist/runtime/subsystems/integration/integration.tokens.js +11 -9
- package/dist/runtime/subsystems/integration/integration.tokens.js.map +1 -1
- package/dist/runtime/subsystems/integration/loopback.middleware.js +4 -16
- package/dist/runtime/subsystems/integration/loopback.middleware.js.map +1 -1
- package/dist/runtime/subsystems/integration/poll-change-source.d.ts +1 -1
- package/dist/runtime/subsystems/integration/poll-change-source.js +4 -89
- package/dist/runtime/subsystems/integration/poll-change-source.js.map +1 -1
- package/dist/runtime/subsystems/integration/webhook-change-source.d.ts +4 -3
- package/dist/runtime/subsystems/integration/webhook-change-source.js +4 -70
- package/dist/runtime/subsystems/integration/webhook-change-source.js.map +1 -1
- package/dist/runtime/subsystems/jobs/bullmq.config.js +9 -140
- package/dist/runtime/subsystems/jobs/bullmq.config.js.map +1 -1
- package/dist/runtime/subsystems/jobs/index.js +88 -2691
- package/dist/runtime/subsystems/jobs/index.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-handler.base.js +10 -49
- package/dist/runtime/subsystems/jobs/job-handler.base.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-orchestration.schema.js +13 -152
- package/dist/runtime/subsystems/jobs/job-orchestration.schema.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-orchestrator.bullmq-backend.js +36 -699
- package/dist/runtime/subsystems/jobs/job-orchestrator.bullmq-backend.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-orchestrator.drizzle-backend.js +10 -564
- package/dist/runtime/subsystems/jobs/job-orchestrator.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-orchestrator.memory-backend.js +10 -824
- package/dist/runtime/subsystems/jobs/job-orchestrator.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-run-keyset-cursor.js +9 -51
- package/dist/runtime/subsystems/jobs/job-run-keyset-cursor.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-run-service.drizzle-backend.js +9 -416
- package/dist/runtime/subsystems/jobs/job-run-service.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-run-service.memory-backend.js +9 -290
- package/dist/runtime/subsystems/jobs/job-run-service.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-step-service.drizzle-backend.js +5 -213
- package/dist/runtime/subsystems/jobs/job-step-service.drizzle-backend.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-step-service.memory-backend.js +5 -131
- package/dist/runtime/subsystems/jobs/job-step-service.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-worker.bullmq-backend.js +9 -175
- package/dist/runtime/subsystems/jobs/job-worker.bullmq-backend.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-worker.js +14 -613
- package/dist/runtime/subsystems/jobs/job-worker.js.map +1 -1
- package/dist/runtime/subsystems/jobs/job-worker.module.js +23 -2647
- package/dist/runtime/subsystems/jobs/job-worker.module.js.map +1 -1
- package/dist/runtime/subsystems/jobs/jobs-domain.module.js +19 -1897
- package/dist/runtime/subsystems/jobs/jobs-domain.module.js.map +1 -1
- package/dist/runtime/subsystems/jobs/jobs-domain.tokens.js +8 -9
- package/dist/runtime/subsystems/jobs/jobs-domain.tokens.js.map +1 -1
- package/dist/runtime/subsystems/jobs/jobs-errors.js +10 -78
- package/dist/runtime/subsystems/jobs/jobs-errors.js.map +1 -1
- package/dist/runtime/subsystems/jobs/memory-job-store.js +4 -15
- package/dist/runtime/subsystems/jobs/memory-job-store.js.map +1 -1
- package/dist/runtime/subsystems/jobs/pool-config.loader.js +9 -124
- package/dist/runtime/subsystems/jobs/pool-config.loader.js.map +1 -1
- package/dist/runtime/subsystems/observability/index.js +21 -310
- package/dist/runtime/subsystems/observability/index.js.map +1 -1
- package/dist/runtime/subsystems/observability/observability-errors.js +4 -9
- package/dist/runtime/subsystems/observability/observability-errors.js.map +1 -1
- package/dist/runtime/subsystems/observability/observability.module.js +11 -300
- package/dist/runtime/subsystems/observability/observability.module.js.map +1 -1
- package/dist/runtime/subsystems/observability/observability.service.js +9 -197
- package/dist/runtime/subsystems/observability/observability.service.js.map +1 -1
- package/dist/runtime/subsystems/observability/observability.tokens.js +5 -3
- package/dist/runtime/subsystems/observability/observability.tokens.js.map +1 -1
- package/dist/runtime/subsystems/observability/reporters/bridge-metrics.reporter.js +4 -84
- package/dist/runtime/subsystems/observability/reporters/bridge-metrics.reporter.js.map +1 -1
- package/dist/runtime/subsystems/observability/reporters/index.js +5 -84
- package/dist/runtime/subsystems/observability/reporters/index.js.map +1 -1
- package/dist/runtime/subsystems/storage/index.js +15 -200
- package/dist/runtime/subsystems/storage/index.js.map +1 -1
- package/dist/runtime/subsystems/storage/storage.local-backend.js +4 -103
- package/dist/runtime/subsystems/storage/storage.local-backend.js.map +1 -1
- package/dist/runtime/subsystems/storage/storage.memory-backend.js +5 -68
- package/dist/runtime/subsystems/storage/storage.memory-backend.js.map +1 -1
- package/dist/runtime/subsystems/storage/storage.module.js +8 -200
- package/dist/runtime/subsystems/storage/storage.module.js.map +1 -1
- package/dist/runtime/subsystems/storage/storage.tokens.js +5 -6
- package/dist/runtime/subsystems/storage/storage.tokens.js.map +1 -1
- package/dist/runtime/subsystems/storage/storage.utils.js +4 -14
- package/dist/runtime/subsystems/storage/storage.utils.js.map +1 -1
- package/dist/runtime/subsystems/token-key.js +5 -3
- package/dist/runtime/subsystems/token-key.js.map +1 -1
- package/dist/src/cli/index.js +637 -5454
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/index.js +68 -4170
- package/dist/src/index.js.map +1 -1
- package/package.json +1 -1
- package/runtime/subsystems/bridge/bridge-outbox-drain-hook.ts +44 -21
- package/runtime/subsystems/index.ts +27 -0
- package/runtime/subsystems/integration/poll-change-source.ts +10 -7
- package/runtime/subsystems/integration/webhook-change-source.ts +12 -8
- package/runtime/subsystems/jobs/job-worker.ts +17 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../runtime/base-classes/lifecycle-events.ts","../../../runtime/base-classes/base-service.ts","../../../runtime/base-classes/metadata-entity-service.ts"],"sourcesContent":["/**\n * Lifecycle event emission for BaseService.\n *\n * Ported from pattern-stack/atoms/patterns/services/base.py — the Python\n * BaseService emits LIFECYCLE and CHANGE events on every CRUD operation.\n * This module provides the same capability for the TypeScript codegen stack.\n *\n * Design:\n * - Fire-and-forget: event emission never fails the CRUD operation.\n * - IEventBus is optional: if no EVENT_BUS is injected, emission is silently\n * skipped. This means base classes work in projects that haven't installed\n * the events subsystem.\n * - LIFECYCLE events carry an entity snapshot in payload.\n * - CHANGE events carry per-field old/new diffs.\n * - Controlled per-entity via `emitLifecycleEvents` flag (default: true).\n *\n * @deprecated EVT-7 — Lifecycle events are untyped and emit outside of the\n * CRUD transaction. New work should declare an `emits:` block on the entity\n * and publish typed domain events from use-cases via TYPED_EVENT_BUS inside\n * the same Drizzle transaction. See `docs/specs/EVT-7.md`. This helper is\n * retained for BaseService backward compatibility until all entities have\n * migrated to typed emits.\n */\n\nimport { randomUUID } from 'crypto';\nimport type { IEventBus, DomainEvent } from '../subsystems/events/event-bus.protocol';\n\n// ============================================================================\n// Event categories (subset of pattern-stack's EventCategory)\n// ============================================================================\n\nexport type EventCategory = 'lifecycle' | 'change';\n\n// ============================================================================\n// Helpers\n// ============================================================================\n\n/** System fields excluded from entity snapshots and change diffs. */\nconst SYSTEM_FIELDS = new Set([\n\t'id',\n\t'createdAt',\n\t'updatedAt',\n\t'deletedAt',\n]);\n\n/**\n * Snapshot an entity's field values, excluding system fields.\n * Mirrors pattern-stack's `_get_entity_snapshot()`.\n */\nexport function entitySnapshot(entity: Record<string, unknown>): Record<string, unknown> {\n\tconst snap: Record<string, unknown> = {};\n\tfor (const [key, value] of Object.entries(entity)) {\n\t\tif (!SYSTEM_FIELDS.has(key)) {\n\t\t\tsnap[key] = value;\n\t\t}\n\t}\n\treturn snap;\n}\n\n/**\n * Diff two entity snapshots, returning per-field old/new pairs.\n * Only includes fields that actually changed.\n */\nexport function diffSnapshots(\n\tbefore: Record<string, unknown>,\n\tafter: Record<string, unknown>,\n): Array<{ field: string; oldValue: unknown; newValue: unknown }> {\n\tconst changes: Array<{ field: string; oldValue: unknown; newValue: unknown }> = [];\n\tconst allKeys = new Set([...Object.keys(before), ...Object.keys(after)]);\n\n\tfor (const key of allKeys) {\n\t\tif (SYSTEM_FIELDS.has(key)) continue;\n\t\tconst oldVal = before[key];\n\t\tconst newVal = after[key];\n\t\t// Simple equality — good enough for primitives and nulls.\n\t\t// For deep objects, JSON.stringify comparison.\n\t\tif (oldVal !== newVal && JSON.stringify(oldVal) !== JSON.stringify(newVal)) {\n\t\t\tchanges.push({ field: key, oldValue: oldVal, newValue: newVal });\n\t\t}\n\t}\n\n\treturn changes;\n}\n\n// ============================================================================\n// Event builders\n// ============================================================================\n\nexport function buildLifecycleEvent(\n\tentityName: string,\n\taction: 'created' | 'updated' | 'deleted',\n\tentityId: string,\n\tsnapshot?: Record<string, unknown>,\n): DomainEvent {\n\treturn {\n\t\tid: randomUUID(),\n\t\ttype: `${entityName}.${action}`,\n\t\taggregateId: entityId,\n\t\taggregateType: entityName,\n\t\tpayload: snapshot ? { snapshot } : {},\n\t\toccurredAt: new Date(),\n\t\tmetadata: { category: 'lifecycle' as EventCategory },\n\t};\n}\n\nexport function buildChangeEvents(\n\tentityName: string,\n\tentityId: string,\n\tchanges: Array<{ field: string; oldValue: unknown; newValue: unknown }>,\n): DomainEvent[] {\n\treturn changes.map((c) => ({\n\t\tid: randomUUID(),\n\t\ttype: `${entityName}.field_changed`,\n\t\taggregateId: entityId,\n\t\taggregateType: entityName,\n\t\tpayload: {\n\t\t\tfieldName: c.field,\n\t\t\toldValue: c.oldValue,\n\t\t\tnewValue: c.newValue,\n\t\t},\n\t\toccurredAt: new Date(),\n\t\tmetadata: { category: 'change' as EventCategory },\n\t}));\n}\n\n// ============================================================================\n// Emission helper (fire-and-forget)\n// ============================================================================\n\n/**\n * Emit events to the bus, swallowing errors.\n * Mirrors pattern-stack's `_emit_lifecycle_event()` try/except.\n */\nexport async function emitSafely(\n\teventBus: IEventBus | undefined,\n\tevents: DomainEvent[],\n): Promise<void> {\n\tif (!eventBus || events.length === 0) return;\n\ttry {\n\t\tif (events.length === 1) {\n\t\t\tconst only = events[0];\n\t\t\tif (!only) return;\n\t\t\tawait eventBus.publish(only);\n\t\t} else {\n\t\t\tawait eventBus.publishMany(events);\n\t\t}\n\t} catch {\n\t\t// Log but never fail the CRUD operation.\n\t\t// In production, this would use a structured logger.\n\t\tconsole.warn(`[lifecycle-events] failed to emit ${events.length} event(s)`);\n\t}\n}\n","/**\n * BaseService<TRepo, TEntity>\n *\n * Abstract base class providing 8 CRUD pass-through methods delegating to\n * an injected repository. Every generated service extends this class.\n *\n * Lifecycle event emission (LIFECYCLE + CHANGE categories) is built into\n * create/update/delete — matching pattern-stack's BaseService. Events are\n * fire-and-forget: emission never fails the CRUD operation. If no IEventBus\n * is injected (eventBus is undefined), emission is silently skipped.\n *\n * Generated services set `entityName` and optionally inject `eventBus` via\n * NestJS property injection (@Inject(EVENT_BUS) @Optional()).\n *\n * Note: @Injectable() is applied on concrete services (not here) so that\n * NestJS DI metadata is emitted at the concrete class level. This matches\n * the pattern established by BaseRepository.\n */\n\nimport type { IEventBus } from '../subsystems/events/event-bus.protocol';\nimport {\n entitySnapshot,\n diffSnapshots,\n buildLifecycleEvent,\n buildChangeEvents,\n emitSafely,\n} from './lifecycle-events';\n\n// ============================================================================\n// IBaseRepository interface\n// ============================================================================\n\n/**\n * Structural interface that BaseRepository satisfies.\n * Use this as the TRepo constraint so BaseService is not coupled to the\n * concrete Drizzle-backed BaseRepository.\n */\nexport interface IBaseRepository<TEntity> {\n findById(id: string): Promise<TEntity | null>;\n findByIds(ids: string[]): Promise<TEntity[]>;\n list(options?: unknown): Promise<TEntity[]>;\n count(where?: unknown): Promise<number>;\n exists(id: string): Promise<boolean>;\n create(input: Partial<TEntity>, tx?: unknown): Promise<TEntity>;\n update(id: string, input: Partial<TEntity>, tx?: unknown): Promise<TEntity>;\n delete(id: string, tx?: unknown): Promise<void>;\n}\n\n// ============================================================================\n// BaseService\n// ============================================================================\n\nexport abstract class BaseService<TRepo extends IBaseRepository<TEntity>, TEntity> {\n /**\n * Entity name for event types (e.g., 'account' → 'account.created').\n * Set by generated services. If empty, lifecycle events are skipped.\n */\n protected entityName?: string;\n\n /**\n * Event bus for lifecycle/change event emission.\n * Injected via @Inject(EVENT_BUS) @Optional() on generated services.\n * If undefined (no events subsystem installed), emission is silently skipped.\n */\n protected eventBus?: IEventBus;\n\n /**\n * Whether to emit lifecycle events. Default: true.\n * Override to false in entity YAML via behaviors or in the service class.\n */\n protected emitLifecycleEvents = true;\n\n constructor(protected readonly repository: TRepo) {}\n\n /**\n * Find a single entity by its primary key.\n * Returns null if not found.\n */\n findById(id: string): Promise<TEntity | null> {\n return this.repository.findById(id);\n }\n\n /**\n * Find multiple entities by their primary keys.\n */\n findByIds(ids: string[]): Promise<TEntity[]> {\n return this.repository.findByIds(ids);\n }\n\n /**\n * List entities with optional filtering/pagination options.\n */\n list(options?: unknown): Promise<TEntity[]> {\n return this.repository.list(options);\n }\n\n /**\n * Count entities matching an optional filter.\n */\n count(where?: unknown): Promise<number> {\n return this.repository.count(where);\n }\n\n /**\n * Check whether an entity with the given id exists.\n */\n exists(id: string): Promise<boolean> {\n return this.repository.exists(id);\n }\n\n /**\n * Insert a new entity.\n * Emits a LIFECYCLE 'created' event with entity snapshot.\n */\n async create(input: Partial<TEntity>, tx?: unknown): Promise<TEntity> {\n const result = await this.repository.create(input, tx);\n\n if (this._shouldEmit()) {\n const snap = entitySnapshot(result as Record<string, unknown>);\n const id = (result as Record<string, unknown>).id as string;\n const event = buildLifecycleEvent(this.entityName!, 'created', id, snap);\n void emitSafely(this.eventBus, [event]);\n }\n\n return result;\n }\n\n /**\n * Update an existing entity by id.\n * Emits a LIFECYCLE 'updated' event + CHANGE events for each modified field.\n */\n async update(id: string, input: Partial<TEntity>, tx?: unknown): Promise<TEntity> {\n // Snapshot before for change diffing\n let before: Record<string, unknown> | undefined;\n if (this._shouldEmit()) {\n const existing = await this.repository.findById(id);\n if (existing) {\n before = entitySnapshot(existing as Record<string, unknown>);\n }\n }\n\n const result = await this.repository.update(id, input, tx);\n\n if (this._shouldEmit()) {\n const after = entitySnapshot(result as Record<string, unknown>);\n const events = [\n buildLifecycleEvent(this.entityName!, 'updated', id, after),\n ];\n // Append per-field CHANGE events\n if (before) {\n const changes = diffSnapshots(before, after);\n if (changes.length > 0) {\n events.push(...buildChangeEvents(this.entityName!, id, changes));\n }\n }\n void emitSafely(this.eventBus, events);\n }\n\n return result;\n }\n\n /**\n * Delete an entity by id.\n * Emits a LIFECYCLE 'deleted' event.\n */\n async delete(id: string, tx?: unknown): Promise<void> {\n await this.repository.delete(id, tx);\n\n if (this._shouldEmit()) {\n const event = buildLifecycleEvent(this.entityName!, 'deleted', id);\n void emitSafely(this.eventBus, [event]);\n }\n }\n\n /** Check whether lifecycle event emission is active. */\n private _shouldEmit(): boolean {\n return Boolean(\n this.emitLifecycleEvents &&\n this.entityName &&\n this.eventBus,\n );\n }\n}\n","/**\n * MetadataEntityService<TRepo, TEntity>\n *\n * Family-specific base service for metadata entities.\n * Delegates to a metadata repository that provides entity-scoped\n * lookups, history, and bulk upsert.\n */\nimport { BaseService, type IBaseRepository } from './base-service';\n\nexport interface IMetadataEntityRepository<TEntity> extends IBaseRepository<TEntity> {\n findByEntityIdAndType(entityId: string, entityType: string): Promise<TEntity[]>;\n listByEntityId(entityId: string): Promise<TEntity[]>;\n listHistoryByEntityId(entityId: string): Promise<TEntity[]>;\n upsertMany(inputs: Array<Partial<TEntity>>, tx?: unknown, options?: { conflictTarget?: string }): Promise<TEntity[]>;\n}\n\nexport abstract class MetadataEntityService<\n TRepo extends IMetadataEntityRepository<TEntity>,\n TEntity,\n> extends BaseService<TRepo, TEntity> {\n /**\n * Find metadata records by entity ID and entity type (EAV polymorphic lookup).\n */\n findByEntityIdAndType(entityId: string, entityType: string): Promise<TEntity[]> {\n return this.repository.findByEntityIdAndType(entityId, entityType);\n }\n\n /**\n * List all metadata records for an entity.\n */\n listByEntity(entityId: string): Promise<TEntity[]> {\n return this.repository.listByEntityId(entityId);\n }\n\n /**\n * List metadata history for an entity, ordered by validFrom desc.\n */\n listHistory(entityId: string): Promise<TEntity[]> {\n return this.repository.listHistoryByEntityId(entityId);\n }\n\n /**\n * Bulk upsert metadata values.\n */\n upsertValues(inputs: Array<Partial<TEntity>>, conflictTarget: string, tx?: unknown): Promise<TEntity[]> {\n return this.repository.upsertMany(inputs, tx, { conflictTarget });\n }\n}\n"],"mappings":";AAwBA,SAAS,kBAAkB;AAc3B,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACD,CAAC;AAMM,SAAS,eAAe,QAA0D;AACxF,QAAM,OAAgC,CAAC;AACvC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AAClD,QAAI,CAAC,cAAc,IAAI,GAAG,GAAG;AAC5B,WAAK,GAAG,IAAI;AAAA,IACb;AAAA,EACD;AACA,SAAO;AACR;AAMO,SAAS,cACf,QACA,OACiE;AACjE,QAAM,UAA0E,CAAC;AACjF,QAAM,UAAU,oBAAI,IAAI,CAAC,GAAG,OAAO,KAAK,MAAM,GAAG,GAAG,OAAO,KAAK,KAAK,CAAC,CAAC;AAEvE,aAAW,OAAO,SAAS;AAC1B,QAAI,cAAc,IAAI,GAAG,EAAG;AAC5B,UAAM,SAAS,OAAO,GAAG;AACzB,UAAM,SAAS,MAAM,GAAG;AAGxB,QAAI,WAAW,UAAU,KAAK,UAAU,MAAM,MAAM,KAAK,UAAU,MAAM,GAAG;AAC3E,cAAQ,KAAK,EAAE,OAAO,KAAK,UAAU,QAAQ,UAAU,OAAO,CAAC;AAAA,IAChE;AAAA,EACD;AAEA,SAAO;AACR;AAMO,SAAS,oBACf,YACA,QACA,UACA,UACc;AACd,SAAO;AAAA,IACN,IAAI,WAAW;AAAA,IACf,MAAM,GAAG,UAAU,IAAI,MAAM;AAAA,IAC7B,aAAa;AAAA,IACb,eAAe;AAAA,IACf,SAAS,WAAW,EAAE,SAAS,IAAI,CAAC;AAAA,IACpC,YAAY,oBAAI,KAAK;AAAA,IACrB,UAAU,EAAE,UAAU,YAA6B;AAAA,EACpD;AACD;AAEO,SAAS,kBACf,YACA,UACA,SACgB;AAChB,SAAO,QAAQ,IAAI,CAAC,OAAO;AAAA,IAC1B,IAAI,WAAW;AAAA,IACf,MAAM,GAAG,UAAU;AAAA,IACnB,aAAa;AAAA,IACb,eAAe;AAAA,IACf,SAAS;AAAA,MACR,WAAW,EAAE;AAAA,MACb,UAAU,EAAE;AAAA,MACZ,UAAU,EAAE;AAAA,IACb;AAAA,IACA,YAAY,oBAAI,KAAK;AAAA,IACrB,UAAU,EAAE,UAAU,SAA0B;AAAA,EACjD,EAAE;AACH;AAUA,eAAsB,WACrB,UACA,QACgB;AAChB,MAAI,CAAC,YAAY,OAAO,WAAW,EAAG;AACtC,MAAI;AACH,QAAI,OAAO,WAAW,GAAG;AACxB,YAAM,OAAO,OAAO,CAAC;AACrB,UAAI,CAAC,KAAM;AACX,YAAM,SAAS,QAAQ,IAAI;AAAA,IAC5B,OAAO;AACN,YAAM,SAAS,YAAY,MAAM;AAAA,IAClC;AAAA,EACD,QAAQ;AAGP,YAAQ,KAAK,qCAAqC,OAAO,MAAM,WAAW;AAAA,EAC3E;AACD;;;ACnGO,IAAe,cAAf,MAA4E;AAAA,EAoBjF,YAA+B,YAAmB;AAAnB;AAAA,EAAoB;AAAA,EAApB;AAAA;AAAA;AAAA;AAAA;AAAA,EAfrB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,sBAAsB;AAAA;AAAA;AAAA;AAAA;AAAA,EAQhC,SAAS,IAAqC;AAC5C,WAAO,KAAK,WAAW,SAAS,EAAE;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA,EAKA,UAAU,KAAmC;AAC3C,WAAO,KAAK,WAAW,UAAU,GAAG;AAAA,EACtC;AAAA;AAAA;AAAA;AAAA,EAKA,KAAK,SAAuC;AAC1C,WAAO,KAAK,WAAW,KAAK,OAAO;AAAA,EACrC;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM,OAAkC;AACtC,WAAO,KAAK,WAAW,MAAM,KAAK;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA,EAKA,OAAO,IAA8B;AACnC,WAAO,KAAK,WAAW,OAAO,EAAE;AAAA,EAClC;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,OAAO,OAAyB,IAAgC;AACpE,UAAM,SAAS,MAAM,KAAK,WAAW,OAAO,OAAO,EAAE;AAErD,QAAI,KAAK,YAAY,GAAG;AACtB,YAAM,OAAO,eAAe,MAAiC;AAC7D,YAAM,KAAM,OAAmC;AAC/C,YAAM,QAAQ,oBAAoB,KAAK,YAAa,WAAW,IAAI,IAAI;AACvE,WAAK,WAAW,KAAK,UAAU,CAAC,KAAK,CAAC;AAAA,IACxC;AAEA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,OAAO,IAAY,OAAyB,IAAgC;AAEhF,QAAI;AACJ,QAAI,KAAK,YAAY,GAAG;AACtB,YAAM,WAAW,MAAM,KAAK,WAAW,SAAS,EAAE;AAClD,UAAI,UAAU;AACZ,iBAAS,eAAe,QAAmC;AAAA,MAC7D;AAAA,IACF;AAEA,UAAM,SAAS,MAAM,KAAK,WAAW,OAAO,IAAI,OAAO,EAAE;AAEzD,QAAI,KAAK,YAAY,GAAG;AACtB,YAAM,QAAQ,eAAe,MAAiC;AAC9D,YAAM,SAAS;AAAA,QACb,oBAAoB,KAAK,YAAa,WAAW,IAAI,KAAK;AAAA,MAC5D;AAEA,UAAI,QAAQ;AACV,cAAM,UAAU,cAAc,QAAQ,KAAK;AAC3C,YAAI,QAAQ,SAAS,GAAG;AACtB,iBAAO,KAAK,GAAG,kBAAkB,KAAK,YAAa,IAAI,OAAO,CAAC;AAAA,QACjE;AAAA,MACF;AACA,WAAK,WAAW,KAAK,UAAU,MAAM;AAAA,IACvC;AAEA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,MAAM,OAAO,IAAY,IAA6B;AACpD,UAAM,KAAK,WAAW,OAAO,IAAI,EAAE;AAEnC,QAAI,KAAK,YAAY,GAAG;AACtB,YAAM,QAAQ,oBAAoB,KAAK,YAAa,WAAW,EAAE;AACjE,WAAK,WAAW,KAAK,UAAU,CAAC,KAAK,CAAC;AAAA,IACxC;AAAA,EACF;AAAA;AAAA,EAGQ,cAAuB;AAC7B,WAAO;AAAA,MACL,KAAK,uBACL,KAAK,cACL,KAAK;AAAA,IACP;AAAA,EACF;AACF;;;ACtKO,IAAe,wBAAf,cAGG,YAA4B;AAAA;AAAA;AAAA;AAAA,EAIpC,sBAAsB,UAAkB,YAAwC;AAC9E,WAAO,KAAK,WAAW,sBAAsB,UAAU,UAAU;AAAA,EACnE;AAAA;AAAA;AAAA;AAAA,EAKA,aAAa,UAAsC;AACjD,WAAO,KAAK,WAAW,eAAe,QAAQ;AAAA,EAChD;AAAA;AAAA;AAAA;AAAA,EAKA,YAAY,UAAsC;AAChD,WAAO,KAAK,WAAW,sBAAsB,QAAQ;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA,EAKA,aAAa,QAAiC,gBAAwB,IAAkC;AACtG,WAAO,KAAK,WAAW,WAAW,QAAQ,IAAI,EAAE,eAAe,CAAC;AAAA,EAClE;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,39 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"No requester context active. Wrap the entry point in withRequester({ userId, organizationId }, fn). See tenant-context.ts."
|
|
12
|
-
);
|
|
13
|
-
}
|
|
14
|
-
return ctx;
|
|
15
|
-
}
|
|
16
|
-
function tryGetRequester() {
|
|
17
|
-
return als.getStore();
|
|
18
|
-
}
|
|
19
|
-
function requireRequesterScope() {
|
|
20
|
-
return requireRequester().scope ?? "user";
|
|
21
|
-
}
|
|
22
|
-
function withUserScope(userId, organizationId, fn) {
|
|
23
|
-
return withRequester({ userId, organizationId, scope: "user" }, fn);
|
|
24
|
-
}
|
|
25
|
-
function withOrgScope(userId, organizationId, orgUserIds, fn) {
|
|
26
|
-
return withRequester(
|
|
27
|
-
{ userId, organizationId, scope: "org", orgUserIds },
|
|
28
|
-
fn
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
function withSuperuserScope(userId, fn) {
|
|
32
|
-
return withRequester(
|
|
33
|
-
{ userId, organizationId: null, scope: "superuser" },
|
|
34
|
-
fn
|
|
35
|
-
);
|
|
36
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
requireRequester,
|
|
3
|
+
requireRequesterScope,
|
|
4
|
+
tryGetRequester,
|
|
5
|
+
withOrgScope,
|
|
6
|
+
withRequester,
|
|
7
|
+
withSuperuserScope,
|
|
8
|
+
withUserScope
|
|
9
|
+
} from "../../chunk-ZUKFQL6E.js";
|
|
10
|
+
import "../../chunk-2E224ZSN.js";
|
|
37
11
|
export {
|
|
38
12
|
requireRequester,
|
|
39
13
|
requireRequesterScope,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
}
|
|
6
|
-
return WithAnalyticsMixin;
|
|
7
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
WithAnalytics
|
|
3
|
+
} from "../../chunk-IBGER4YK.js";
|
|
4
|
+
import "../../chunk-2E224ZSN.js";
|
|
8
5
|
export {
|
|
9
6
|
WithAnalytics
|
|
10
7
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../runtime/eav-helpers.ts"],"sourcesContent":["/**\n * EAV helpers\n *\n * Small, pure utilities used by services that dual-write to the EAV value\n * table alongside their own table.\n *\n * - `toEavRows` builds value-table insert rows from a flat `{ key: value }`\n * bag, resolving the `fieldDefinitionId` via a caller-supplied map.\n * Callers own the field-definitions lookup / cache.\n * - `mergeEavRows` inverts: given value-table rows + a definition `id -> key`\n * map, collapses them into a flat `{ key: value }` bag.\n *\n * Both are sync + allocation-light. They do not touch the DB.\n */\n\n/**\n * Map of field key -> field_definitions.id, scoped to a single entityType.\n */\nexport type FieldDefinitionIdMap = ReadonlyMap<string, string>;\n\n/**\n * Minimal shape of a value-table row accepted by toEavRows output. Consumers\n * pass their entity's `Insert` type; these are the columns the helper sets.\n */\nexport interface EavInsertShape {\n entityId: string;\n entityType: string;\n userId: string;\n fieldDefinitionId: string;\n value: unknown;\n}\n\n/**\n * Build value-table insert rows from a flat field bag. Keys present in\n * `fields` but missing from `fieldDefIds` are skipped — caller is expected\n * to ensure the definitions exist (first-cut; auto-create is a later step).\n */\nexport function toEavRows(\n entityId: string,\n entityType: string,\n userId: string,\n fields: Record<string, unknown>,\n fieldDefIds: FieldDefinitionIdMap,\n): EavInsertShape[] {\n const rows: EavInsertShape[] = [];\n for (const [key, value] of Object.entries(fields)) {\n const fieldDefinitionId = fieldDefIds.get(key);\n if (!fieldDefinitionId) continue;\n rows.push({ entityId, entityType, userId, fieldDefinitionId, value });\n }\n return rows;\n}\n\n/**\n * Collapse EAV rows back into a flat `{ key: value }` bag.\n *\n * Accepts bare value-table rows plus a separate `id -> { key }` map. Later\n * rows win if the same key appears more than once. Call with temporal\n * filtering already applied (e.g. validTo IS NULL) — this function does not\n * interpret validFrom / validTo.\n */\nexport function mergeEavRows(\n rows: Array<{ fieldDefinitionId: string | null; value: unknown }>,\n defsById: ReadonlyMap<string, { key: string }>,\n): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const row of rows) {\n if (!row.fieldDefinitionId) continue;\n const def = defsById.get(row.fieldDefinitionId);\n if (!def) continue;\n out[def.key] = row.value;\n }\n return out;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../runtime/eav-helpers.ts"],"sourcesContent":["/**\n * EAV helpers\n *\n * Small, pure utilities used by services that dual-write to the EAV value\n * table alongside their own table.\n *\n * - `toEavRows` builds value-table insert rows from a flat `{ key: value }`\n * bag, resolving the `fieldDefinitionId` via a caller-supplied map.\n * Callers own the field-definitions lookup / cache.\n * - `mergeEavRows` inverts: given value-table rows + a definition `id -> key`\n * map, collapses them into a flat `{ key: value }` bag.\n *\n * Both are sync + allocation-light. They do not touch the DB.\n */\n\n/**\n * Map of field key -> field_definitions.id, scoped to a single entityType.\n */\nexport type FieldDefinitionIdMap = ReadonlyMap<string, string>;\n\n/**\n * Minimal shape of a value-table row accepted by toEavRows output. Consumers\n * pass their entity's `Insert` type; these are the columns the helper sets.\n */\nexport interface EavInsertShape {\n entityId: string;\n entityType: string;\n userId: string;\n fieldDefinitionId: string;\n value: unknown;\n}\n\n/**\n * Build value-table insert rows from a flat field bag. Keys present in\n * `fields` but missing from `fieldDefIds` are skipped — caller is expected\n * to ensure the definitions exist (first-cut; auto-create is a later step).\n */\nexport function toEavRows(\n entityId: string,\n entityType: string,\n userId: string,\n fields: Record<string, unknown>,\n fieldDefIds: FieldDefinitionIdMap,\n): EavInsertShape[] {\n const rows: EavInsertShape[] = [];\n for (const [key, value] of Object.entries(fields)) {\n const fieldDefinitionId = fieldDefIds.get(key);\n if (!fieldDefinitionId) continue;\n rows.push({ entityId, entityType, userId, fieldDefinitionId, value });\n }\n return rows;\n}\n\n/**\n * Collapse EAV rows back into a flat `{ key: value }` bag.\n *\n * Accepts bare value-table rows plus a separate `id -> { key }` map. Later\n * rows win if the same key appears more than once. Call with temporal\n * filtering already applied (e.g. validTo IS NULL) — this function does not\n * interpret validFrom / validTo.\n */\nexport function mergeEavRows(\n rows: Array<{ fieldDefinitionId: string | null; value: unknown }>,\n defsById: ReadonlyMap<string, { key: string }>,\n): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const row of rows) {\n if (!row.fieldDefinitionId) continue;\n const def = defsById.get(row.fieldDefinitionId);\n if (!def) continue;\n out[def.key] = row.value;\n }\n return out;\n}\n"],"mappings":";;;AAqCO,SAAS,UACd,UACA,YACA,QACA,QACA,aACkB;AAClB,QAAM,OAAyB,CAAC;AAChC,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,UAAM,oBAAoB,YAAY,IAAI,GAAG;AAC7C,QAAI,CAAC,kBAAmB;AACxB,SAAK,KAAK,EAAE,UAAU,YAAY,QAAQ,mBAAmB,MAAM,CAAC;AAAA,EACtE;AACA,SAAO;AACT;AAUO,SAAS,aACd,MACA,UACyB;AACzB,QAAM,MAA+B,CAAC;AACtC,aAAW,OAAO,MAAM;AACtB,QAAI,CAAC,IAAI,kBAAmB;AAC5B,UAAM,MAAM,SAAS,IAAI,IAAI,iBAAiB;AAC9C,QAAI,CAAC,IAAK;AACV,QAAI,IAAI,GAAG,IAAI,IAAI;AAAA,EACrB;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
__decorateClass
|
|
3
|
+
} from "../../chunk-2E224ZSN.js";
|
|
11
4
|
|
|
12
5
|
// runtime/pipes/zod-validation.pipe.ts
|
|
13
6
|
import {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../runtime/pipes/zod-validation.pipe.ts"],"sourcesContent":["/**\n * ZodValidationPipe\n *\n * Validates an incoming request body (or any decorated value) against a\n * Zod schema at the controller boundary. Intended for use with Nest's\n * `@Body(new ZodValidationPipe(MySchema))` pattern so generated\n * controllers get runtime validation without relying on a global pipe\n * that every consumer would have to opt into.\n *\n * Why a pipe (vs. validating inside the use case): validation is a\n * presentation-layer concern (ADR-003). The use case should receive a\n * type-safe, already-validated DTO; surfacing a `ZodError` at the pipe\n * stage produces the standard 400 BadRequest response shape that HTTP\n * clients expect.\n *\n * On success: returns parsed, coerced data.\n * On failure: throws BadRequestException with a structured `issues` array\n * (path / code / message) — richer than `.flatten()` for API consumers.\n *\n * One pipe instance per route (cheap — instantiated at module load). Keeps\n * validation explicit in the generated code; no metadata/reflection magic.\n *\n * Vendored into consumer projects at `src/shared/pipes/zod-validation.pipe.ts`\n * via `codegen project init` (see init-scaffold's VENDORED_RUNTIME_FILES).\n */\nimport {\n BadRequestException,\n Injectable,\n PipeTransform,\n type ArgumentMetadata,\n} from '@nestjs/common';\nimport type { ZodIssue, ZodSchema } from 'zod';\n\n@Injectable()\nexport class ZodValidationPipe<TSchema extends ZodSchema = ZodSchema>\n implements PipeTransform\n{\n constructor(private readonly schema: TSchema) {}\n\n transform(value: unknown, _metadata: ArgumentMetadata): unknown {\n const result = this.schema.safeParse(value);\n if (result.success) {\n return result.data;\n }\n throw new BadRequestException({\n statusCode: 400,\n error: 'Bad Request',\n message: 'Validation failed',\n issues: formatIssues(result.error.issues),\n });\n }\n}\n\nfunction formatIssues(issues: readonly ZodIssue[]): Array<{\n path: string;\n code: string;\n message: string;\n}> {\n return issues.map((issue) => ({\n path: issue.path.join('.'),\n code: issue.code,\n message: issue.message,\n }));\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../runtime/pipes/zod-validation.pipe.ts"],"sourcesContent":["/**\n * ZodValidationPipe\n *\n * Validates an incoming request body (or any decorated value) against a\n * Zod schema at the controller boundary. Intended for use with Nest's\n * `@Body(new ZodValidationPipe(MySchema))` pattern so generated\n * controllers get runtime validation without relying on a global pipe\n * that every consumer would have to opt into.\n *\n * Why a pipe (vs. validating inside the use case): validation is a\n * presentation-layer concern (ADR-003). The use case should receive a\n * type-safe, already-validated DTO; surfacing a `ZodError` at the pipe\n * stage produces the standard 400 BadRequest response shape that HTTP\n * clients expect.\n *\n * On success: returns parsed, coerced data.\n * On failure: throws BadRequestException with a structured `issues` array\n * (path / code / message) — richer than `.flatten()` for API consumers.\n *\n * One pipe instance per route (cheap — instantiated at module load). Keeps\n * validation explicit in the generated code; no metadata/reflection magic.\n *\n * Vendored into consumer projects at `src/shared/pipes/zod-validation.pipe.ts`\n * via `codegen project init` (see init-scaffold's VENDORED_RUNTIME_FILES).\n */\nimport {\n BadRequestException,\n Injectable,\n PipeTransform,\n type ArgumentMetadata,\n} from '@nestjs/common';\nimport type { ZodIssue, ZodSchema } from 'zod';\n\n@Injectable()\nexport class ZodValidationPipe<TSchema extends ZodSchema = ZodSchema>\n implements PipeTransform\n{\n constructor(private readonly schema: TSchema) {}\n\n transform(value: unknown, _metadata: ArgumentMetadata): unknown {\n const result = this.schema.safeParse(value);\n if (result.success) {\n return result.data;\n }\n throw new BadRequestException({\n statusCode: 400,\n error: 'Bad Request',\n message: 'Validation failed',\n issues: formatIssues(result.error.issues),\n });\n }\n}\n\nfunction formatIssues(issues: readonly ZodIssue[]): Array<{\n path: string;\n code: string;\n message: string;\n}> {\n return issues.map((issue) => ({\n path: issue.path.join('.'),\n code: issue.code,\n message: issue.message,\n }));\n}\n"],"mappings":";;;;;AAyBA;AAAA,EACE;AAAA,EACA;AAAA,OAGK;AAIA,IAAM,oBAAN,MAEP;AAAA,EACE,YAA6B,QAAiB;AAAjB;AAAA,EAAkB;AAAA,EAAlB;AAAA,EAE7B,UAAU,OAAgB,WAAsC;AAC9D,UAAM,SAAS,KAAK,OAAO,UAAU,KAAK;AAC1C,QAAI,OAAO,SAAS;AAClB,aAAO,OAAO;AAAA,IAChB;AACA,UAAM,IAAI,oBAAoB;AAAA,MAC5B,YAAY;AAAA,MACZ,OAAO;AAAA,MACP,SAAS;AAAA,MACT,QAAQ,aAAa,OAAO,MAAM,MAAM;AAAA,IAC1C,CAAC;AAAA,EACH;AACF;AAjBa,oBAAN;AAAA,EADN,WAAW;AAAA,GACC;AAmBb,SAAS,aAAa,QAInB;AACD,SAAO,OAAO,IAAI,CAAC,WAAW;AAAA,IAC5B,MAAM,MAAM,KAAK,KAAK,GAAG;AAAA,IACzB,MAAM,MAAM;AAAA,IACZ,SAAS,MAAM;AAAA,EACjB,EAAE;AACJ;","names":[]}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
error: z.string().optional()
|
|
7
|
-
});
|
|
8
|
-
var ERROR_RESPONSE_SCHEMA_NAME = "ErrorResponseDto";
|
|
1
|
+
import {
|
|
2
|
+
ERROR_RESPONSE_SCHEMA_NAME,
|
|
3
|
+
errorResponseSchema
|
|
4
|
+
} from "../../../chunk-SOVM2VEK.js";
|
|
5
|
+
import "../../../chunk-2E224ZSN.js";
|
|
9
6
|
export {
|
|
10
7
|
ERROR_RESPONSE_SCHEMA_NAME,
|
|
11
8
|
errorResponseSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
message ?? "OpenApiRegistry requires @anatine/zod-openapi. Install it: bun add @anatine/zod-openapi"
|
|
7
|
-
);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
var DuplicateSchemaError = class extends Error {
|
|
11
|
-
constructor(schemaName) {
|
|
12
|
-
super(
|
|
13
|
-
`DuplicateSchemaError: schema '${schemaName}' is already registered. Each schema name must be unique within the OpenApiRegistry.`
|
|
14
|
-
);
|
|
15
|
-
this.schemaName = schemaName;
|
|
16
|
-
}
|
|
17
|
-
schemaName;
|
|
18
|
-
name = "DuplicateSchemaError";
|
|
19
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
DuplicateSchemaError,
|
|
3
|
+
OpenApiPeerDepMissingError
|
|
4
|
+
} from "../../../chunk-YSLTTQLC.js";
|
|
5
|
+
import "../../../chunk-2E224ZSN.js";
|
|
20
6
|
export {
|
|
21
7
|
DuplicateSchemaError,
|
|
22
8
|
OpenApiPeerDepMissingError
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,109 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
var DuplicateSchemaError = class extends Error {
|
|
20
|
-
constructor(schemaName) {
|
|
21
|
-
super(
|
|
22
|
-
`DuplicateSchemaError: schema '${schemaName}' is already registered. Each schema name must be unique within the OpenApiRegistry.`
|
|
23
|
-
);
|
|
24
|
-
this.schemaName = schemaName;
|
|
25
|
-
}
|
|
26
|
-
schemaName;
|
|
27
|
-
name = "DuplicateSchemaError";
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// runtime/shared/openapi/registry.ts
|
|
31
|
-
var OpenApiRegistry = class {
|
|
32
|
-
zodSchemas = /* @__PURE__ */ new Map();
|
|
33
|
-
pathEntries = /* @__PURE__ */ new Map();
|
|
34
|
-
peer = null;
|
|
35
|
-
constructor() {
|
|
36
|
-
this.zodSchemas.set(ERROR_RESPONSE_SCHEMA_NAME, errorResponseSchema);
|
|
37
|
-
}
|
|
38
|
-
registerSchema(name, schema) {
|
|
39
|
-
if (this.zodSchemas.has(name)) {
|
|
40
|
-
throw new DuplicateSchemaError(name);
|
|
41
|
-
}
|
|
42
|
-
this.zodSchemas.set(name, schema);
|
|
43
|
-
}
|
|
44
|
-
registerPath(path, method, spec) {
|
|
45
|
-
let methods = this.pathEntries.get(path);
|
|
46
|
-
if (!methods) {
|
|
47
|
-
methods = /* @__PURE__ */ new Map();
|
|
48
|
-
this.pathEntries.set(path, methods);
|
|
49
|
-
}
|
|
50
|
-
methods.set(method, spec);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Emit the full OpenAPI document. Lazy-imports `@anatine/zod-openapi`
|
|
54
|
-
* on first call; failure to resolve raises `OpenApiPeerDepMissingError`
|
|
55
|
-
* (matches the `CubeAnalyticsBackend.onModuleInit` precedent).
|
|
56
|
-
*
|
|
57
|
-
* OpenAPI version is pinned to `3.0.3` — Swagger UI tooling is most
|
|
58
|
-
* stable on 3.0.x (see OPENAPI-PHASE-1-PLAN §Four locked decisions).
|
|
59
|
-
*/
|
|
60
|
-
async build(info) {
|
|
61
|
-
const peer = await this.loadPeer();
|
|
62
|
-
const schemas = {};
|
|
63
|
-
for (const [name, zodSchema] of this.zodSchemas) {
|
|
64
|
-
schemas[name] = peer.generateSchema(zodSchema, false, "3.0");
|
|
65
|
-
}
|
|
66
|
-
const paths = {};
|
|
67
|
-
for (const [path, methods] of this.pathEntries) {
|
|
68
|
-
const methodMap = {};
|
|
69
|
-
for (const [method, spec] of methods) {
|
|
70
|
-
methodMap[method] = spec;
|
|
71
|
-
}
|
|
72
|
-
paths[path] = methodMap;
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
openapi: "3.0.3",
|
|
76
|
-
info,
|
|
77
|
-
paths,
|
|
78
|
-
components: { schemas }
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Test helper — clears registered schemas and paths, then re-seeds the
|
|
83
|
-
* core `ErrorResponseDto` entry so post-reset state matches the
|
|
84
|
-
* invariant established in the constructor.
|
|
85
|
-
*/
|
|
86
|
-
reset() {
|
|
87
|
-
this.zodSchemas.clear();
|
|
88
|
-
this.pathEntries.clear();
|
|
89
|
-
this.peer = null;
|
|
90
|
-
this.zodSchemas.set(ERROR_RESPONSE_SCHEMA_NAME, errorResponseSchema);
|
|
91
|
-
}
|
|
92
|
-
async loadPeer() {
|
|
93
|
-
if (this.peer) return this.peer;
|
|
94
|
-
try {
|
|
95
|
-
const specifier = "@anatine/zod-openapi";
|
|
96
|
-
const mod = await import(specifier);
|
|
97
|
-
this.peer = mod;
|
|
98
|
-
return mod;
|
|
99
|
-
} catch {
|
|
100
|
-
throw new OpenApiPeerDepMissingError();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
// runtime/shared/openapi/registry.tokens.ts
|
|
106
|
-
var OPENAPI_REGISTRY = "OPENAPI_REGISTRY";
|
|
1
|
+
import {
|
|
2
|
+
OPENAPI_REGISTRY
|
|
3
|
+
} from "../../../chunk-PSXUNOVU.js";
|
|
4
|
+
import {
|
|
5
|
+
OpenApiRegistry
|
|
6
|
+
} from "../../../chunk-Y7GDG744.js";
|
|
7
|
+
import {
|
|
8
|
+
ERROR_RESPONSE_SCHEMA_NAME,
|
|
9
|
+
errorResponseSchema
|
|
10
|
+
} from "../../../chunk-SOVM2VEK.js";
|
|
11
|
+
import {
|
|
12
|
+
DuplicateSchemaError,
|
|
13
|
+
OpenApiPeerDepMissingError
|
|
14
|
+
} from "../../../chunk-YSLTTQLC.js";
|
|
15
|
+
import "../../../chunk-2E224ZSN.js";
|
|
107
16
|
export {
|
|
108
17
|
DuplicateSchemaError,
|
|
109
18
|
ERROR_RESPONSE_SCHEMA_NAME,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../runtime/shared/openapi/error-response.dto.ts","../../../../runtime/shared/openapi/errors.ts","../../../../runtime/shared/openapi/registry.ts","../../../../runtime/shared/openapi/registry.tokens.ts"],"sourcesContent":["/**\n * Shared error response schema (OPENAPI-3).\n *\n * Generated controllers `@ApiResponse(...)` decorators reference this\n * schema by `$ref` (name `ErrorResponseDto`) for non-success status codes\n * (400, 401, 404, etc.). Shape matches NestJS's default `HttpException`\n * JSON body — see `packages/common/src/exceptions/http.exception.ts`.\n *\n * The registry auto-registers this schema on construction so every\n * consumer project exposes `components.schemas.ErrorResponseDto` on\n * `/docs-json` without per-entity duplication.\n */\nimport { z } from 'zod';\n\nexport const errorResponseSchema = z.object({\n statusCode: z.number().int(),\n message: z.union([z.string(), z.array(z.string())]),\n error: z.string().optional(),\n});\n\nexport type ErrorResponseDto = z.infer<typeof errorResponseSchema>;\n\n/** Canonical name used across `$ref` URIs in generated controllers. */\nexport const ERROR_RESPONSE_SCHEMA_NAME = 'ErrorResponseDto';\n","/**\n * Typed errors for the OpenAPI registry (OPENAPI-1).\n *\n * Same shape as `runtime/subsystems/bridge/bridge-errors.ts` so consumers\n * can catch them with the same exception-filter pattern used elsewhere.\n */\n\n/**\n * Thrown by `OpenApiRegistry.build()` when `@anatine/zod-openapi` is not\n * resolvable. The peer is declared optional (`peerDependenciesMeta`) so\n * consumer apps that don't care about OpenAPI still boot; the cost is a\n * deferred failure here on first `build()`.\n */\nexport class OpenApiPeerDepMissingError extends Error {\n override readonly name = 'OpenApiPeerDepMissingError';\n constructor(message?: string) {\n super(\n message ??\n 'OpenApiRegistry requires @anatine/zod-openapi. Install it: bun add @anatine/zod-openapi',\n );\n }\n}\n\n/**\n * Thrown by `OpenApiRegistry.registerSchema(name, ...)` when `name` is\n * already registered. Silent overwrite would make debugging\n * double-registration bugs (e.g. two entity pipelines both emitting a\n * `User` DTO) painful; loud failure lets the mismatch surface at module\n * init where the stack trace is clear.\n */\nexport class DuplicateSchemaError extends Error {\n override readonly name = 'DuplicateSchemaError';\n constructor(public readonly schemaName: string) {\n super(\n `DuplicateSchemaError: schema '${schemaName}' is already registered. ` +\n `Each schema name must be unique within the OpenApiRegistry.`,\n );\n }\n}\n","/**\n * OpenApiRegistry — collects Zod schemas and path specs, emits a\n * complete `OpenAPIObject` on `build()` (OPENAPI-1).\n *\n * Wraps `@anatine/zod-openapi` as an **optional peer dependency** using\n * the lazy-import pattern from `runtime/subsystems/analytics/cube-backend.ts`\n * — consumer apps that never call `build()` still boot even if\n * `@anatine/zod-openapi` isn't installed.\n *\n * The registry is the single source of truth consumed by OPENAPI-2\n * (generated DTOs register their Zod schemas at module init), OPENAPI-3\n * (controller decorators reference those schemas), and OPENAPI-4\n * (Swagger UI bootstrap calls `build()` once at startup).\n */\nimport type { z } from 'zod';\n\nimport { ERROR_RESPONSE_SCHEMA_NAME, errorResponseSchema } from './error-response.dto';\nimport { OpenApiPeerDepMissingError, DuplicateSchemaError } from './errors';\n\nexport type HttpMethod = 'get' | 'post' | 'patch' | 'delete' | 'put';\n\n/**\n * OpenAPI path spec. Structurally compatible with `openapi3-ts`'s\n * `OperationObject` but typed loosely here because the peer type package\n * isn't installed as a direct dep — consumers supply whatever their\n * codegen emits.\n */\nexport interface PathSpec {\n summary?: string;\n description?: string;\n operationId?: string;\n tags?: string[];\n parameters?: unknown[];\n requestBody?: unknown;\n responses?: Record<string, unknown>;\n security?: unknown[];\n [key: string]: unknown;\n}\n\nexport interface OpenAPIInfo {\n title: string;\n version: string;\n description?: string;\n}\n\n/**\n * Minimal OpenAPIObject shape. We redeclare rather than pull\n * `openapi3-ts` types through the peer — the peer's `generateSchema`\n * returns a `SchemaObject`, but the final document assembly is ours.\n */\nexport interface OpenAPIObject {\n openapi: string;\n info: OpenAPIInfo;\n paths: Record<string, Record<string, PathSpec>>;\n components: {\n schemas: Record<string, unknown>;\n };\n}\n\ninterface PeerModule {\n generateSchema: (zodRef: unknown, useOutput?: boolean, version?: '3.0' | '3.1') => unknown;\n}\n\nexport class OpenApiRegistry {\n private zodSchemas = new Map<string, z.ZodType>();\n private pathEntries = new Map<string, Map<HttpMethod, PathSpec>>();\n private peer: PeerModule | null = null;\n\n constructor() {\n // Auto-register the shared error response schema so controllers that\n // reference `#/components/schemas/ErrorResponseDto` always resolve\n // (OPENAPI-3). Consumers can `reset()` + re-register in tests.\n this.zodSchemas.set(ERROR_RESPONSE_SCHEMA_NAME, errorResponseSchema);\n }\n\n registerSchema(name: string, schema: z.ZodType): void {\n if (this.zodSchemas.has(name)) {\n throw new DuplicateSchemaError(name);\n }\n this.zodSchemas.set(name, schema);\n }\n\n registerPath(path: string, method: HttpMethod, spec: PathSpec): void {\n let methods = this.pathEntries.get(path);\n if (!methods) {\n methods = new Map();\n this.pathEntries.set(path, methods);\n }\n methods.set(method, spec);\n }\n\n /**\n * Emit the full OpenAPI document. Lazy-imports `@anatine/zod-openapi`\n * on first call; failure to resolve raises `OpenApiPeerDepMissingError`\n * (matches the `CubeAnalyticsBackend.onModuleInit` precedent).\n *\n * OpenAPI version is pinned to `3.0.3` — Swagger UI tooling is most\n * stable on 3.0.x (see OPENAPI-PHASE-1-PLAN §Four locked decisions).\n */\n async build(info: OpenAPIInfo): Promise<OpenAPIObject> {\n const peer = await this.loadPeer();\n\n const schemas: Record<string, unknown> = {};\n for (const [name, zodSchema] of this.zodSchemas) {\n schemas[name] = peer.generateSchema(zodSchema, false, '3.0');\n }\n\n const paths: Record<string, Record<string, PathSpec>> = {};\n for (const [path, methods] of this.pathEntries) {\n const methodMap: Record<string, PathSpec> = {};\n for (const [method, spec] of methods) {\n methodMap[method] = spec;\n }\n paths[path] = methodMap;\n }\n\n return {\n openapi: '3.0.3',\n info,\n paths,\n components: { schemas },\n };\n }\n\n /**\n * Test helper — clears registered schemas and paths, then re-seeds the\n * core `ErrorResponseDto` entry so post-reset state matches the\n * invariant established in the constructor.\n */\n reset(): void {\n this.zodSchemas.clear();\n this.pathEntries.clear();\n this.peer = null;\n this.zodSchemas.set(ERROR_RESPONSE_SCHEMA_NAME, errorResponseSchema);\n }\n\n protected async loadPeer(): Promise<PeerModule> {\n if (this.peer) return this.peer;\n try {\n // Computed specifier: prevents tsc from resolving this import at\n // typecheck time. Consumers vendor this file but may not install\n // @anatine/zod-openapi (optional peer).\n const specifier: string = '@anatine/zod-openapi';\n const mod = (await import(specifier)) as PeerModule;\n this.peer = mod;\n return mod;\n } catch {\n throw new OpenApiPeerDepMissingError();\n }\n }\n}\n","/**\n * Injection token for the OpenAPI registry (OPENAPI-1).\n *\n * String constant (not a Symbol) so it matches by value across import\n * boundaries — same convention as `ANALYTICS_QUERY` in analytics and\n * `EVENT_BUS` / `BRIDGE_DELIVERY_REPO` in events / bridge. The OPENAPI-1\n * spec sketched a Symbol, but the repo-wide convention wins — codebase\n * consistency matters more than the spec's initial guess.\n *\n * Consumed by generated DTO providers (OPENAPI-2), controllers\n * (OPENAPI-3), and the Swagger bootstrap (OPENAPI-4).\n */\nexport const OPENAPI_REGISTRY = 'OPENAPI_REGISTRY' as const;\n"],"mappings":";AAYA,SAAS,SAAS;AAEX,IAAM,sBAAsB,EAAE,OAAO;AAAA,EAC1C,YAAY,EAAE,OAAO,EAAE,IAAI;AAAA,EAC3B,SAAS,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAAA,EAClD,OAAO,EAAE,OAAO,EAAE,SAAS;AAC7B,CAAC;AAKM,IAAM,6BAA6B;;;ACVnC,IAAM,6BAAN,cAAyC,MAAM;AAAA,EAClC,OAAO;AAAA,EACzB,YAAY,SAAkB;AAC5B;AAAA,MACE,WACE;AAAA,IACJ;AAAA,EACF;AACF;AASO,IAAM,uBAAN,cAAmC,MAAM;AAAA,EAE9C,YAA4B,YAAoB;AAC9C;AAAA,MACE,iCAAiC,UAAU;AAAA,IAE7C;AAJ0B;AAAA,EAK5B;AAAA,EAL4B;AAAA,EADV,OAAO;AAO3B;;;ACyBO,IAAM,kBAAN,MAAsB;AAAA,EACnB,aAAa,oBAAI,IAAuB;AAAA,EACxC,cAAc,oBAAI,IAAuC;AAAA,EACzD,OAA0B;AAAA,EAElC,cAAc;AAIZ,SAAK,WAAW,IAAI,4BAA4B,mBAAmB;AAAA,EACrE;AAAA,EAEA,eAAe,MAAc,QAAyB;AACpD,QAAI,KAAK,WAAW,IAAI,IAAI,GAAG;AAC7B,YAAM,IAAI,qBAAqB,IAAI;AAAA,IACrC;AACA,SAAK,WAAW,IAAI,MAAM,MAAM;AAAA,EAClC;AAAA,EAEA,aAAa,MAAc,QAAoB,MAAsB;AACnE,QAAI,UAAU,KAAK,YAAY,IAAI,IAAI;AACvC,QAAI,CAAC,SAAS;AACZ,gBAAU,oBAAI,IAAI;AAClB,WAAK,YAAY,IAAI,MAAM,OAAO;AAAA,IACpC;AACA,YAAQ,IAAI,QAAQ,IAAI;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,MAAM,MAAM,MAA2C;AACrD,UAAM,OAAO,MAAM,KAAK,SAAS;AAEjC,UAAM,UAAmC,CAAC;AAC1C,eAAW,CAAC,MAAM,SAAS,KAAK,KAAK,YAAY;AAC/C,cAAQ,IAAI,IAAI,KAAK,eAAe,WAAW,OAAO,KAAK;AAAA,IAC7D;AAEA,UAAM,QAAkD,CAAC;AACzD,eAAW,CAAC,MAAM,OAAO,KAAK,KAAK,aAAa;AAC9C,YAAM,YAAsC,CAAC;AAC7C,iBAAW,CAAC,QAAQ,IAAI,KAAK,SAAS;AACpC,kBAAU,MAAM,IAAI;AAAA,MACtB;AACA,YAAM,IAAI,IAAI;AAAA,IAChB;AAEA,WAAO;AAAA,MACL,SAAS;AAAA,MACT;AAAA,MACA;AAAA,MACA,YAAY,EAAE,QAAQ;AAAA,IACxB;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,QAAc;AACZ,SAAK,WAAW,MAAM;AACtB,SAAK,YAAY,MAAM;AACvB,SAAK,OAAO;AACZ,SAAK,WAAW,IAAI,4BAA4B,mBAAmB;AAAA,EACrE;AAAA,EAEA,MAAgB,WAAgC;AAC9C,QAAI,KAAK,KAAM,QAAO,KAAK;AAC3B,QAAI;AAIF,YAAM,YAAoB;AAC1B,YAAM,MAAO,MAAM,OAAO;AAC1B,WAAK,OAAO;AACZ,aAAO;AAAA,IACT,QAAQ;AACN,YAAM,IAAI,2BAA2B;AAAA,IACvC;AAAA,EACF;AACF;;;AC1IO,IAAM,mBAAmB;","names":[]}
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1,106 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
var ERROR_RESPONSE_SCHEMA_NAME = "ErrorResponseDto";
|
|
9
|
-
|
|
10
|
-
// runtime/shared/openapi/errors.ts
|
|
11
|
-
var OpenApiPeerDepMissingError = class extends Error {
|
|
12
|
-
name = "OpenApiPeerDepMissingError";
|
|
13
|
-
constructor(message) {
|
|
14
|
-
super(
|
|
15
|
-
message ?? "OpenApiRegistry requires @anatine/zod-openapi. Install it: bun add @anatine/zod-openapi"
|
|
16
|
-
);
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
var DuplicateSchemaError = class extends Error {
|
|
20
|
-
constructor(schemaName) {
|
|
21
|
-
super(
|
|
22
|
-
`DuplicateSchemaError: schema '${schemaName}' is already registered. Each schema name must be unique within the OpenApiRegistry.`
|
|
23
|
-
);
|
|
24
|
-
this.schemaName = schemaName;
|
|
25
|
-
}
|
|
26
|
-
schemaName;
|
|
27
|
-
name = "DuplicateSchemaError";
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// runtime/shared/openapi/registry.ts
|
|
31
|
-
var OpenApiRegistry = class {
|
|
32
|
-
zodSchemas = /* @__PURE__ */ new Map();
|
|
33
|
-
pathEntries = /* @__PURE__ */ new Map();
|
|
34
|
-
peer = null;
|
|
35
|
-
constructor() {
|
|
36
|
-
this.zodSchemas.set(ERROR_RESPONSE_SCHEMA_NAME, errorResponseSchema);
|
|
37
|
-
}
|
|
38
|
-
registerSchema(name, schema) {
|
|
39
|
-
if (this.zodSchemas.has(name)) {
|
|
40
|
-
throw new DuplicateSchemaError(name);
|
|
41
|
-
}
|
|
42
|
-
this.zodSchemas.set(name, schema);
|
|
43
|
-
}
|
|
44
|
-
registerPath(path, method, spec) {
|
|
45
|
-
let methods = this.pathEntries.get(path);
|
|
46
|
-
if (!methods) {
|
|
47
|
-
methods = /* @__PURE__ */ new Map();
|
|
48
|
-
this.pathEntries.set(path, methods);
|
|
49
|
-
}
|
|
50
|
-
methods.set(method, spec);
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Emit the full OpenAPI document. Lazy-imports `@anatine/zod-openapi`
|
|
54
|
-
* on first call; failure to resolve raises `OpenApiPeerDepMissingError`
|
|
55
|
-
* (matches the `CubeAnalyticsBackend.onModuleInit` precedent).
|
|
56
|
-
*
|
|
57
|
-
* OpenAPI version is pinned to `3.0.3` — Swagger UI tooling is most
|
|
58
|
-
* stable on 3.0.x (see OPENAPI-PHASE-1-PLAN §Four locked decisions).
|
|
59
|
-
*/
|
|
60
|
-
async build(info) {
|
|
61
|
-
const peer = await this.loadPeer();
|
|
62
|
-
const schemas = {};
|
|
63
|
-
for (const [name, zodSchema] of this.zodSchemas) {
|
|
64
|
-
schemas[name] = peer.generateSchema(zodSchema, false, "3.0");
|
|
65
|
-
}
|
|
66
|
-
const paths = {};
|
|
67
|
-
for (const [path, methods] of this.pathEntries) {
|
|
68
|
-
const methodMap = {};
|
|
69
|
-
for (const [method, spec] of methods) {
|
|
70
|
-
methodMap[method] = spec;
|
|
71
|
-
}
|
|
72
|
-
paths[path] = methodMap;
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
openapi: "3.0.3",
|
|
76
|
-
info,
|
|
77
|
-
paths,
|
|
78
|
-
components: { schemas }
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Test helper — clears registered schemas and paths, then re-seeds the
|
|
83
|
-
* core `ErrorResponseDto` entry so post-reset state matches the
|
|
84
|
-
* invariant established in the constructor.
|
|
85
|
-
*/
|
|
86
|
-
reset() {
|
|
87
|
-
this.zodSchemas.clear();
|
|
88
|
-
this.pathEntries.clear();
|
|
89
|
-
this.peer = null;
|
|
90
|
-
this.zodSchemas.set(ERROR_RESPONSE_SCHEMA_NAME, errorResponseSchema);
|
|
91
|
-
}
|
|
92
|
-
async loadPeer() {
|
|
93
|
-
if (this.peer) return this.peer;
|
|
94
|
-
try {
|
|
95
|
-
const specifier = "@anatine/zod-openapi";
|
|
96
|
-
const mod = await import(specifier);
|
|
97
|
-
this.peer = mod;
|
|
98
|
-
return mod;
|
|
99
|
-
} catch {
|
|
100
|
-
throw new OpenApiPeerDepMissingError();
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
};
|
|
1
|
+
import {
|
|
2
|
+
OpenApiRegistry
|
|
3
|
+
} from "../../../chunk-Y7GDG744.js";
|
|
4
|
+
import "../../../chunk-SOVM2VEK.js";
|
|
5
|
+
import "../../../chunk-YSLTTQLC.js";
|
|
6
|
+
import "../../../chunk-2E224ZSN.js";
|
|
104
7
|
export {
|
|
105
8
|
OpenApiRegistry
|
|
106
9
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|