diff --git a/apps/api-gateway/src/main.ts b/apps/api-gateway/src/main.ts index 47fa61094..9af07ecb5 100644 --- a/apps/api-gateway/src/main.ts +++ b/apps/api-gateway/src/main.ts @@ -17,6 +17,11 @@ import { NatsInterceptor } from '@credebl/common'; import { UpdatableValidationPipe } from '@credebl/common/custom-overrideable-validation-pipe'; dotenv.config(); +/** + * Bootstraps and starts the NestJS API Gateway application with microservice integration, middleware, API documentation, security, and global configuration. + * + * Initializes the application, connects to a NATS microservice, sets up middleware for request parsing and URL validation, configures Swagger API documentation, applies global exception filters, enables CORS based on environment configuration, serves static files, applies a custom global validation pipe, enables security middleware, and starts listening on the configured host and port. + */ async function bootstrap(): Promise { const app = await NestFactory.create(AppModule); diff --git a/libs/common/src/custom-overrideable-validation-pipe.ts b/libs/common/src/custom-overrideable-validation-pipe.ts index 2955af90a..bcd502bae 100644 --- a/libs/common/src/custom-overrideable-validation-pipe.ts +++ b/libs/common/src/custom-overrideable-validation-pipe.ts @@ -18,7 +18,13 @@ import { Reflector } from '@nestjs/core'; export const REWRITE_VALIDATION_OPTIONS = 'rewrite_validation_options'; -// eslint-disable-next-line @typescript-eslint/explicit-function-return-type +/** + * Decorator that overrides global validation options for a specific route handler or controller. + * + * Attaches custom {@link ValidatorOptions} metadata, allowing selective adjustment of validation behavior such as whitelisting or property checks on a per-handler or per-class basis. + * + * @param options - The validation options to apply for the decorated handler or class. + */ export function RewriteValidationOptions(options: ValidatorOptions) { return SetMetadata(REWRITE_VALIDATION_OPTIONS, options); } diff --git a/libs/prisma-service/prisma/scripts/update_client_credential_data.sh b/libs/prisma-service/prisma/scripts/update_client_credential_data.sh old mode 100755 new mode 100644 index 1c62ffa4a..8efafd652 --- a/libs/prisma-service/prisma/scripts/update_client_credential_data.sh +++ b/libs/prisma-service/prisma/scripts/update_client_credential_data.sh @@ -5,7 +5,20 @@ DB_URL=$1 CLIENT_ID=$2 CLIENT_SECRET=$3 -# Function to update clientId and clientSecret +# Updates the clientId and clientSecret fields in the "user" table where both are NULL. +# +# Globals: +# DB_URL: The database connection URL. +# CLIENT_ID: The new clientId value to set. +# CLIENT_SECRET: The new clientSecret value to set. +# +# Outputs: +# Prints the result of the SQL update operation to STDOUT, including success or failure messages. +# +# Example: +# +# update_client_credentials +# # Updates all users with NULL clientId and clientSecret, setting them to the provided values. update_client_credentials() { local update_query="UPDATE \"user\" SET \"clientId\" = '${CLIENT_ID}', \"clientSecret\" = '${CLIENT_SECRET}' WHERE \"clientId\" IS NULL AND \"clientSecret\" IS NULL;"