{"_id":"@diamir/nestjs-maintenance","_rev":"4-c6c636e0053da05e4a848140b54f43bd","name":"@diamir/nestjs-maintenance","dist-tags":{"latest":"11.0.3"},"versions":{"11.0.0":{"name":"@diamir/nestjs-maintenance","version":"11.0.0","keywords":[],"author":{"name":"Backend","email":"backend@diamir.io"},"license":"ISC","_id":"@diamir/nestjs-maintenance@11.0.0","maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"dist":{"shasum":"cfed0ceab8fe5dc92039be94f99b4edd483eddfe","tarball":"https://registry.npmjs.org/@diamir/nestjs-maintenance/-/nestjs-maintenance-11.0.0.tgz","fileCount":21,"integrity":"sha512-BclFQdoA7fWD+q4BeuV1Gt4NRexmnjVSJNK0BY5TGjyRtfJGR1gy4UPD4tp4PLm6AwXaXlER4z0u6Qt5L4ZCCg==","signatures":[{"sig":"MEYCIQD7t60b0R1AUeLYAkmGOarztGUH8uTa7BGxPDNKsaL4DwIhAJbM8EZrqan/LTOtI4zG5U6EaqFw2DvPOto8RZWODqAQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16351},"main":"./src/index.js","type":"commonjs","_from":"file:diamir-nestjs-maintenance-11.0.0.tgz","types":"./src/index.d.ts","engines":{"node":">= 20"},"_npmUser":{"name":"ws-admin","email":"backend@webundsoehne.com"},"_resolved":"/tmp/824ac290c79701b32637e39be70e3b96/diamir-nestjs-maintenance-11.0.0.tgz","_integrity":"sha512-BclFQdoA7fWD+q4BeuV1Gt4NRexmnjVSJNK0BY5TGjyRtfJGR1gy4UPD4tp4PLm6AwXaXlER4z0u6Qt5L4ZCCg==","repository":{"url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git","type":"git"},"_npmVersion":"10.9.2","description":"<p align=\"center\">   <a href=\"https://webundsoehne.com\" target=\"blank\">     <img src=\"https://webundsoehne.com/wp-content/uploads/webundsoehne-logo.png\" width=\"320\" alt=\"Web und Söhne - Logo\" />   </a> </p> Web & Söhne is Austria's leading expert in progr","directories":{},"_nodeVersion":"22.13.1","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@nestjs/common":">= 11.0.0"},"peerDependenciesMeta":{},"_npmOperationalInternal":{"tmp":"tmp/nestjs-maintenance_11.0.0_1778592796537_0.4563697130734432","host":"s3://npm-registry-packages-npm-production"}},"11.0.1":{"name":"@diamir/nestjs-maintenance","version":"11.0.1","keywords":["diamir","nestjs","middleware","maintenance","lock"],"author":{"name":"Backend","email":"backend@diamir.io"},"license":"ISC","_id":"@diamir/nestjs-maintenance@11.0.1","maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"dist":{"shasum":"201ade0444dfb285138e9b410be07c02aad5207b","tarball":"https://registry.npmjs.org/@diamir/nestjs-maintenance/-/nestjs-maintenance-11.0.1.tgz","fileCount":21,"integrity":"sha512-XW4OlmwlbhkEDm4Am+GX8JRHCFif92506LBcuosyexBWVSRwKJuveMmFXcE1BS9PbgGn9v7JXGrRWN+b4jBrQQ==","signatures":[{"sig":"MEQCIGD8Jzy+1lRiWIzzXoli88m6QnIkR8PIdr5gNgZs1bkQAiBCNtYEiIyxEQppy/R4EpPStFcdgfBZSTjo8BhjCXLJVA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16246},"main":"./src/index.js","type":"commonjs","_from":"file:diamir-nestjs-maintenance-11.0.1.tgz","types":"./src/index.d.ts","engines":{"node":">= 20"},"_npmUser":{"name":"ws-admin","email":"backend@webundsoehne.com"},"_resolved":"/tmp/d2f94f28475e8d46e486beff8c6198bd/diamir-nestjs-maintenance-11.0.1.tgz","_integrity":"sha512-XW4OlmwlbhkEDm4Am+GX8JRHCFif92506LBcuosyexBWVSRwKJuveMmFXcE1BS9PbgGn9v7JXGrRWN+b4jBrQQ==","repository":{"url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git","type":"git"},"_npmVersion":"10.9.8","description":"Nestjs maintenance middleware and lock","directories":{},"_nodeVersion":"22.22.3","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@nestjs/common":">= 11.0.0"},"peerDependenciesMeta":{},"_npmOperationalInternal":{"tmp":"tmp/nestjs-maintenance_11.0.1_1778851692732_0.7022698372605096","host":"s3://npm-registry-packages-npm-production"}},"11.0.2":{"name":"@diamir/nestjs-maintenance","version":"11.0.2","keywords":["diamir","nestjs","middleware","maintenance","lock"],"author":{"name":"Backend","email":"backend@diamir.io"},"license":"ISC","_id":"@diamir/nestjs-maintenance@11.0.2","maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"dist":{"shasum":"6051274dc9dc85618bf8f4c7530db55ab93f9933","tarball":"https://registry.npmjs.org/@diamir/nestjs-maintenance/-/nestjs-maintenance-11.0.2.tgz","fileCount":21,"integrity":"sha512-LHGnR3PdcUuxj9/DB50FmNf15+4sbo+Wnvb6LU7G/hQbXjhVc1t894rbYpRS35GFmtTLXowpyqw7hCa94Kcxng==","signatures":[{"sig":"MEUCIHwFZT8NVSYFnf9VrveBwbeJZB//h0xGxHblYw6MAejrAiEA1/ZyMqOuIDa3Cgv7a2k5APwLX3p+espAl+kfKScZJD4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16246},"main":"./src/index.js","type":"commonjs","_from":"file:diamir-nestjs-maintenance-11.0.2.tgz","types":"./src/index.d.ts","engines":{"node":">= 20"},"_npmUser":{"name":"ws-admin","email":"backend@webundsoehne.com"},"_resolved":"/tmp/29f9eb43d12965baf03848ee14efdbc9/diamir-nestjs-maintenance-11.0.2.tgz","_integrity":"sha512-LHGnR3PdcUuxj9/DB50FmNf15+4sbo+Wnvb6LU7G/hQbXjhVc1t894rbYpRS35GFmtTLXowpyqw7hCa94Kcxng==","repository":{"url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git","type":"git"},"_npmVersion":"10.9.8","description":"Nestjs maintenance middleware and lock","directories":{},"_nodeVersion":"22.22.3","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"@nestjs/common":">= 11.0.0"},"peerDependenciesMeta":{},"_npmOperationalInternal":{"tmp":"tmp/nestjs-maintenance_11.0.2_1779200941123_0.4190782636847903","host":"s3://npm-registry-packages-npm-production"}},"11.0.3":{"name":"@diamir/nestjs-maintenance","version":"11.0.3","description":"Nestjs maintenance middleware and lock","author":{"name":"Backend","email":"backend@diamir.io"},"repository":{"type":"git","url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git"},"license":"ISC","publishConfig":{"access":"public"},"keywords":["diamir","nestjs","middleware","maintenance","lock"],"main":"./src/index.js","dependencies":{},"peerDependencies":{"@nestjs/common":">= 11.0.0"},"peerDependenciesMeta":{},"engines":{"node":">= 20"},"types":"./src/index.d.ts","type":"commonjs","_id":"@diamir/nestjs-maintenance@11.0.3","bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","_integrity":"sha512-Hqgb9OKiIN9GEb9kCO6zcE6CcChu3OuOyJ0ad/PKNUjCgBRq2TCUUKiqwt2cyA/xmUcFH5jo0CaHoH4x8U2vYA==","_resolved":"/tmp/50cf59cb79ea5367961f40026da5e29b/diamir-nestjs-maintenance-11.0.3.tgz","_from":"file:diamir-nestjs-maintenance-11.0.3.tgz","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-Hqgb9OKiIN9GEb9kCO6zcE6CcChu3OuOyJ0ad/PKNUjCgBRq2TCUUKiqwt2cyA/xmUcFH5jo0CaHoH4x8U2vYA==","shasum":"7eee4a020824fa5c10ae0922aaecadadf8deb1dc","tarball":"https://registry.npmjs.org/@diamir/nestjs-maintenance/-/nestjs-maintenance-11.0.3.tgz","fileCount":21,"unpackedSize":15961,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDKdLGbH3LXW8YkW4UURVoJeB0K5DxCVvpSGT/KcfjL7AIgECqY7ZpiM+K2qYuAK2xuUjfnrGLVbM/N0L2QVPcVD6I="}]},"_npmUser":{"name":"ws-admin","email":"backend@webundsoehne.com"},"directories":{},"maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/nestjs-maintenance_11.0.3_1781091025278_0.3172862090877946"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-12T13:33:16.415Z","modified":"2026-06-10T11:30:25.691Z","11.0.0":"2026-05-12T13:33:16.690Z","11.0.1":"2026-05-15T13:28:12.926Z","11.0.2":"2026-05-19T14:29:01.265Z","11.0.3":"2026-06-10T11:30:25.436Z"},"bugs":{"url":"https://github.com/tailoredmedia/backend-nx-skeleton/issues"},"author":{"name":"Backend","email":"backend@diamir.io"},"license":"ISC","homepage":"https://github.com/tailoredmedia/backend-nx-skeleton#readme","keywords":["diamir","nestjs","middleware","maintenance","lock"],"repository":{"type":"git","url":"git+https://github.com/tailoredmedia/backend-nx-skeleton.git"},"description":"Nestjs maintenance middleware and lock","maintainers":[{"name":"ws-admin","email":"backend@webundsoehne.com"},{"name":"dabls","email":"stephan.schmid@diamir.io"}],"readme":"# nestjs-maintenance\n\n## Description\n\nThe maintenance module gives you the possibility to generate and remove a lock file,\nas well as checking if the lock file exists and throwing a preconfigured `ServiceUnavailableException` error.\n\nYou may use the maintenance module anywhere in your project, e.g. for database migrations. (But make sure to access the same lock-file in each module)\n\n---\n\n<!-- TOC -->\n* [nestjs-maintenance](#nestjs-maintenance)\n  * [Description](#description)\n  * [Usage](#usage)\n    * [MaintenanceService](#maintenanceservice)\n    * [Decorator](#decorator)\n* [Migration](#migration)\n* [Links](#links)\n<!-- TOC -->\n\n---\n\n## Usage\n\nSet up the `MaintenanceModule` and `MaintenanceMiddleware` in the server/application module.\n\n```typescript\nimport { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common'\nimport { MaintenanceMiddleware, MaintenanceModule } from '@diamir/nestjs-maintenance'\n\n@Module({\n  imports: [\n    MaintenanceModule.forRoot({\n      application: ConfigService.get('url.basePath'), // default: Application\n      lockfilePath: ConfigService.get('misc.lockfile') // default: maintenance.lock\n    })\n  ]\n})\nclass ServerModule implements NestModule {\n  async configure(consumer: MiddlewareConsumer): Promise<any> {\n    consumer.apply(MaintenanceMiddleware).forRoutes({ path: '*', method: RequestMethod.ALL })\n  }\n}\n```\n\nNow if a lockfile is present at the `lockfilePath`, the `ServiceUnavailableException` will be thrown.\n\n### MaintenanceService\n\nTo create and remove the lockfile, use the `MaintenanceService` in any module.\n\n| Name           | Return  | Description                           |\n|----------------|---------|---------------------------------------|\n| enable         | void    | Create the configured lock file       |\n| disable        | void    | Remove the generated lock file        |\n| isEnabled      | Boolean | Check if there is already a lock file |\n| throwException | void    | Throw the preconfigured exception     |\n\n### Decorator\n\nApply the `@UseMaintenanceLocker()` decorator on a method to wrap the original function inside a maintenance-lock\n1. enable lock\n2. execute method\n3. disable lock\n\n# Migration\n\nTo migrate from the old `@webundsoehne/nestjs-util` to `@diamir/nestjs-maintenance`:\n- replace the imports\n- change the `MaintenanceModule` imports to use the `.forRoot` method\n\n# Links\n- [Diamir](https://diamir.io/)\n- [nestjs](https://nestjs.com/)\n","readmeFilename":"README.md"}