{"_id":"@bnmap/molecular-swagger-ui","_rev":"6-de2cf4fdc58f82a99c965703ab94408f","name":"@bnmap/molecular-swagger-ui","dist-tags":{"latest":"1.2.2"},"versions":{"1.0.0":{"name":"@bnmap/molecular-swagger-ui","version":"1.0.0","keywords":["swagger","swagger-ui","moleculer","openapi","middleware"],"author":{"name":"itlabrealty"},"license":"MIT","_id":"@bnmap/molecular-swagger-ui@1.0.0","maintainers":[{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"}],"dist":{"shasum":"62fe8f84743015a09b76d8f7de566cd45eccc3da","tarball":"https://registry.npmjs.org/@bnmap/molecular-swagger-ui/-/molecular-swagger-ui-1.0.0.tgz","fileCount":14,"integrity":"sha512-W4wH+jSmyC3sw852uusWZvLFBU8kwgHWdvusb9NNuTaW4PgwE9Gw7CufVad5ax2bnjGkwqrizLec+g027HiEXw==","signatures":[{"sig":"MEUCIQCesC2SmSm0OR+qHMpuu8oBbWBpFXBYVrQpEQLTCjGsjwIgARUBwftzGsRPTpvUfXXueA9k/jy7lSzbhvONoWlPYmI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30395},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"1b23b9068d77617a181b231ae35e7122063a3cdb","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"},"repository":{"url":"https://gitlab.itlabrealty.ru/redisign/molecular-swagger-ui.git","type":"git"},"_npmVersion":"10.9.2","description":"Moleculer mixin for serving Swagger UI from a static OpenAPI spec file","directories":{},"_nodeVersion":"22.15.0","dependencies":{"swagger-ui-dist":"^5.9.0"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.0.0","@types/node":"^20.0.0"},"peerDependencies":{"moleculer-web":">=0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/molecular-swagger-ui_1.0.0_1772189093029_0.41190856112717245","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@bnmap/molecular-swagger-ui","version":"1.1.0","keywords":["swagger","swagger-ui","moleculer","openapi","middleware"],"author":{"name":"itlabrealty"},"license":"MIT","_id":"@bnmap/molecular-swagger-ui@1.1.0","maintainers":[{"name":"i.pershin.itlabrealty","email":"i.pershin@itlabrealty.ru"},{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"}],"dist":{"shasum":"b02b3bbbed538ffbf9de018a5abebc955b844fdd","tarball":"https://registry.npmjs.org/@bnmap/molecular-swagger-ui/-/molecular-swagger-ui-1.1.0.tgz","fileCount":14,"integrity":"sha512-POkqMThkGQoW3Fl7g7NxnwiwdsExccXPxatMiktnnGQlDvk96QjxBY93mp5bo5fRx/jxjPqnYSHqlJ1zVq7iDg==","signatures":[{"sig":"MEUCIFMW6MmaLnum6uwNu0I+yb+Y4UEngamFSRrGd4rwiqUUAiEAm+cXKayxZOFOC+O2/35dKdvjuF/6/jhTmRUcRKvcboc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIF79ljNXtHyKBliaeZCi+hpvbnt08NFjYLXrLROyueJZAiEAzzn8atyoOYI8dJzOGHiFIKA1Yhe8LJKO5PK+CreylOQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31218},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"88e0e5e49dbf9d87c84aae49295c9ef250dc9795","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"},"repository":{"url":"https://gitlab.itlabrealty.ru/redisign/molecular-swagger-ui.git","type":"git"},"_npmVersion":"10.8.2","description":"Moleculer mixin for serving Swagger UI from a static OpenAPI spec file","directories":{},"_nodeVersion":"20.17.0","dependencies":{"swagger-ui-dist":"^5.9.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.12","typescript":"^5.0.0","@types/jest":"^29.5.14","@types/node":"^20.0.0"},"peerDependencies":{"moleculer-web":">=0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/molecular-swagger-ui_1.1.0_1790088965097_0.5338527729818334","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"@bnmap/molecular-swagger-ui","version":"1.2.0","keywords":["swagger","swagger-ui","moleculer","openapi","middleware"],"author":{"name":"itlabrealty"},"license":"MIT","_id":"@bnmap/molecular-swagger-ui@1.2.0","maintainers":[{"name":"i.pershin.itlabrealty","email":"i.pershin@itlabrealty.ru"},{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"}],"dist":{"shasum":"df70138d0d5a22122550c11620f7366a2dd658ad","tarball":"https://registry.npmjs.org/@bnmap/molecular-swagger-ui/-/molecular-swagger-ui-1.2.0.tgz","fileCount":14,"integrity":"sha512-b2s/xGiS6r19BSxJa1AaKoo4dLO75vQZAE1dN8Q8sZN10aAtc1DwXkqQ1wJuM5t6QIrImNP9cEZfg9hwHiKqTA==","signatures":[{"sig":"MEQCIDsiyMG9ISdVIUMqAWJp+x+Mr8gR82oLkHKnusJBWMIwAiBeJ5Z9h/p66wXYIf7OpjSJTuvqmNroViwUBxFToHFpZQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCYQRZum3G3KonxOG5fAdYsdzQ4ZvwLwqXv1LwXIo1oSwIgVVs8jE5P524Lmx96/tLOTKvZzl+NcMZ4rtN2gHry/g0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37176},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"41c1896a78199d3399bbc42901f48f6ba0dc1025","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"},"repository":{"url":"https://gitlab.itlabrealty.ru/redisign/molecular-swagger-ui.git","type":"git"},"_npmVersion":"10.8.2","description":"Moleculer mixin for serving Swagger UI from a static OpenAPI spec file","directories":{},"_nodeVersion":"20.17.0","dependencies":{"swagger-ui-dist":"^5.9.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.12","typescript":"^5.0.0","@types/jest":"^29.5.14","@types/node":"^20.0.0"},"peerDependencies":{"moleculer-web":">=0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/molecular-swagger-ui_1.2.0_1790092164097_0.7339599023956549","host":"s3://npm-registry-packages-npm-production"}},"1.2.1":{"name":"@bnmap/molecular-swagger-ui","version":"1.2.1","keywords":["swagger","swagger-ui","moleculer","openapi","middleware"],"author":{"name":"itlabrealty"},"license":"MIT","_id":"@bnmap/molecular-swagger-ui@1.2.1","maintainers":[{"name":"i.pershin.itlabrealty","email":"i.pershin@itlabrealty.ru"},{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"}],"dist":{"shasum":"120d192e32baa479e4f4159c1ef292ba9b111041","tarball":"https://registry.npmjs.org/@bnmap/molecular-swagger-ui/-/molecular-swagger-ui-1.2.1.tgz","fileCount":14,"integrity":"sha512-4ZgwH2Mp37R3mXudLrnuuLlvyrDQ5/n14U/LPQj0O9H9dBVX9OFe1qApyNjyiOg7lG2sPcCA8nYGQK26g2/49A==","signatures":[{"sig":"MEUCIQDednz8kjHSNo7HbDUGWW+VwlyBbLREgIoiiczojWcxGgIgRihws6eszd20TKjgcNcxSC9S6ubnkhnrghq0lmtHxHM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIFIdQ3BgfRr2h35DV1bl6U1wrugUP4q/+9tIX3HZOK0FAiEA0Vy6qZkSFTJeZxD/deDjqBNJtO1tZfvcWdWVRjbFmWQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":37497},"main":"dist/index.js","types":"dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"c02a64621f24beb0d9a98395340afcab325540a8","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"_npmUser":{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"},"repository":{"url":"https://gitlab.itlabrealty.ru/redisign/molecular-swagger-ui.git","type":"git"},"_npmVersion":"10.8.2","description":"Moleculer mixin for serving Swagger UI from a static OpenAPI spec file","directories":{},"_nodeVersion":"20.17.0","dependencies":{"swagger-ui-dist":"^5.9.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.12","typescript":"^5.0.0","@types/jest":"^29.5.14","@types/node":"^20.0.0"},"peerDependencies":{"moleculer-web":">=0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/molecular-swagger-ui_1.2.1_1790092601203_0.060940849625755744","host":"s3://npm-registry-packages-npm-production"}},"1.2.2":{"_id":"@bnmap/molecular-swagger-ui@1.2.2","dist":{"shasum":"c119875693f515044e0e13eb77a5af6e511517b5","tarball":"https://registry.npmjs.org/@bnmap/molecular-swagger-ui/-/molecular-swagger-ui-1.2.2.tgz","fileCount":14,"integrity":"sha512-EsnYFWVtTTg1KatvtjYEyLJS00gK2Mb6hyZ35hhKC2TgZtVY4CEBCgN1eBEJultEXDJn2ikunXG1bZSkobTDKQ==","signatures":[{"sig":"MEQCIE3DGRWJsGquJycUnRjJ3TJmJy/mqiNXNpxWgXdbhQX3AiBjcacLvldOTfUS5g360/5GG8etb6FnPhLcSXWIRTnHVg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIGglm/llk8pXQpa+sgLZ6/IHXc3VM4d3ZVhiK3hwuzHlAiAPi+kp0ILsWdj550g+3eO/4Q7ylQsU0HgldPsOZnUERg=="}],"unpackedSize":35820},"main":"dist/index.js","name":"@bnmap/molecular-swagger-ui","types":"dist/index.d.ts","author":{"name":"itlabrealty"},"engines":{"node":">=18.0.0"},"gitHead":"be3aa4e61f7e699a6e099366cb6d34dfc41e1048","license":"MIT","scripts":{"test":"jest","build":"tsc","prepublishOnly":"npm run build"},"version":"1.2.2","_npmUser":{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"},"keywords":["swagger","swagger-ui","moleculer","openapi","middleware"],"repository":{"url":"https://gitlab.itlabrealty.ru/redisign/molecular-swagger-ui.git","type":"git"},"_npmVersion":"10.8.2","description":"Moleculer mixin for serving Swagger UI from a static OpenAPI spec file","directories":{},"maintainers":[{"name":"i.pershin.itlabrealty","email":"i.pershin@itlabrealty.ru"},{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"}],"_nodeVersion":"20.17.0","dependencies":{"swagger-ui-dist":"^5.9.0"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.4.12","typescript":"^5.0.0","@types/jest":"^29.5.14","@types/node":"^20.0.0"},"peerDependencies":{"moleculer-web":">=0.10.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/molecular-swagger-ui_1.2.2_1790111704926_0.41756388050763604"}}},"time":{"created":"2026-02-27T10:44:52.954Z","modified":"2026-09-22T21:15:05.248Z","1.0.0":"2026-02-27T10:44:53.182Z","1.1.0":"2026-09-22T14:56:05.179Z","1.2.0":"2026-09-22T15:49:24.188Z","1.2.1":"2026-09-22T15:56:41.297Z","1.2.2":"2026-09-22T21:15:05.027Z"},"author":{"name":"itlabrealty"},"license":"MIT","keywords":["swagger","swagger-ui","moleculer","openapi","middleware"],"repository":{"url":"https://gitlab.itlabrealty.ru/redisign/molecular-swagger-ui.git","type":"git"},"description":"Moleculer mixin for serving Swagger UI from a static OpenAPI spec file","maintainers":[{"name":"i.pershin.itlabrealty","email":"i.pershin@itlabrealty.ru"},{"name":"egor4geev","email":"e.ageev@itlabrealty.ru"}],"readme":"# @bnmap/molecular-swagger-ui\n\nMoleculer mixin for serving Swagger UI from a static OpenAPI spec file.\n\nDoes **not** perform any spec generation -- it only serves a pre-built `openapi.json` and the Swagger UI interface.\n\n## Installation\n\n```bash\nnpm install @bnmap/molecular-swagger-ui\n```\n\nPeer dependencies (must be installed in your project):\n- `moleculer-web` >= 0.10.0\n\n## Usage\n\n```ts\nimport ApiGateway from 'moleculer-web';\nimport SwaggerUIMixin from '@bnmap/molecular-swagger-ui';\nimport path from 'path';\n\nexport default {\n  name: 'gateway',\n  mixins: [\n    ApiGateway,\n    SwaggerUIMixin({\n      routeOptions: { path: '/docs' },\n      specPath: path.join(process.cwd(), 'openapi.json'),\n      basicAuth: {\n        enabled: true,\n        username: process.env.SWAGGER_USERNAME || 'admin',\n        password: process.env.SWAGGER_PASSWORD || 'admin',\n      },\n    }),\n  ],\n  settings: {\n    routes: [],\n  },\n};\n```\n\n## Options\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `routeOptions.path` | `string` | `/docs` | Route path for Swagger UI |\n| `specPath` | `string` | `./openapi.json` | Absolute path to the OpenAPI spec file |\n| `basicAuth.enabled` | `boolean` | `true` | Enable Basic Auth protection for the whole route, spec file included |\n| `basicAuth.username` | `string` | `admin` / `SWAGGER_USERNAME` | Basic Auth username |\n| `basicAuth.password` | `string` | `admin` / `SWAGGER_PASSWORD` | Basic Auth password |\n\n## Environment Variables\n\n| Variable | Description |\n|---|---|\n| `SWAGGER_USERNAME` | Override default Basic Auth username |\n| `SWAGGER_PASSWORD` | Override default Basic Auth password |\n\nBoth default to `admin`, which exists so a local gateway comes up without\nconfiguration and is a one-guess password anywhere else. When the route starts\non those defaults the mixin says so with a `warn`, because a variable that was\nnever set otherwise looks exactly like one that was.\n\n## Routes\n\nThe mixin registers these routes under the configured path:\n\n- `GET /docs` -- Swagger UI interface\n- `GET /docs/openapi.json` -- OpenAPI spec (read from `specPath`)\n- `GET /docs/logout` -- Logout page (clears Basic Auth)\n\nWith `basicAuth.enabled` (the default), all three require credentials. The spec\ndescribes the entire API surface, so serving it anonymously would defeat the\npassword on the page in front of it. Browsers replay the credentials they were\ngiven for the page, so the UI loads the spec without asking twice.\n\nThe guard is always the first middleware on the route: a `routeOptions.use` of\nyour own is inserted after it, never in place of it.\n\nStatic assets are served only from Swagger UI's own directory — a request that\nresolves outside it is passed on rather than read.\n\n## Generating the OpenAPI Spec\n\nTo generate the spec, use [@bnmap/molecular-openapi-gen](https://www.npmjs.com/package/@bnmap/molecular-openapi-gen):\n\n```bash\nnpm install --save-dev @bnmap/molecular-openapi-gen\nnpx molecular-openapi-gen --services ./dist/services --output ./openapi.json\n```\n\n## TypeScript\n\nAll exports are fully typed. Type definitions are included in the package (`dist/*.d.ts`).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}