@bluealba/pae-service-nestjs-sdk
v2.0.0-develop-1173
Published
NestJS PAE Library
Readme
PAE NestJS SDK Library
A simple and reusable NestJS SDK that provides a collection of common utilities and services.
Features
✅ API Docs (Swagger)
Easily add Swagger API documentation to your NestJS application using a clean injectable service.
Example Usage
In your main.ts:
import packageJSON from '../package.json';
import { ApiDocsService } from '@pae-service-nestjs-sdk';
async bootstrap() {
const app = await NestFactory.create(AppModule);
const apiDocs = app.get(ApiDocsService);
apiDocs.setup(app, {
title: 'Authorization API',
description: 'Platform Authorization API',
version: packageJSON.version,
tags: ['Authorization'],
});
await app.listen(PORT);
}
bootstrap();
In your module:
import { Module, NestModule } from '@nestjs/common';
import { ApiDocsModule } from '@pae-service-nestjs-sdk';
@Module({
imports: [ApiDocsModule],
providers: [],
})
export class AppModule implements NestModule {}✅ PAE Service Endpoints
This module provides three default endpoints for platform diagnostics:
| Endpoint | Method | Description |
| ------------ | ------ | ------------------------------------ |
| /health | GET | Returns service health status |
| /version | GET | Reads version info from package.json |
| /changelog | GET | Reads content from CHANGELOG.md |
Example Usage
import { Module, NestModule } from '@nestjs/common';
import { PAEServiceModule } from '@pae-service-nestjs-sdk';
@Module({
imports: [PAEServiceModule],
providers: [],
})
export class AppModule implements NestModule {}No additional configuration is required. Ensure that your package.json and CHANGELOG.md files exist at the root of your project.
This works seamlessly with using changesets tool recommended by turbo repo which automatically generates/updates the CHANGELOG.md.
Providing this endpoint allows the platform Admin UI to include this information to the user
