data-masking-customization-lib
v1.0.0
Published
Standard Solution App Customization Hook NPM Lib for Data Masking
Readme
Data Masking Customization Library
This is a standard Solution App Customization Hook NPM library for data masking, built according to the Solution Platform Adoption SOP.
Features
- Endpoint:
/custom/mask(exposed via Solution Platform) - Functionality: Masks card numbers showing first 4 and last 4 digits
- Input:
{"cardnumber": "81928371827428127"} - Output:
{"cardnumber": "8192****8127"}
Structure
data-masking-customization-lib/
├── src/
│ ├── index.ts # Exports factory and types
│ ├── SolutionAppFactory.ts # Factory for creating solution app instances
│ ├── SolutionAppImpl.ts # Implementation of ISolutionApp interface
│ └── types.ts # Type definitions
├── sample-masking-logic.js # Example implementation (auto-generated by SPMS)
├── package.json # NPM package configuration
├── tsconfig.json # TypeScript configuration
└── README.md # This fileInstallation
npm install data-masking-customization-libUsage
This library is designed to be used with the Solution Platform Management System (SPMS). The actual masking logic is auto-generated by SPMS based on the customization template.
Example Request
{
"cardnumber": "81928371827428127"
}Example Response
{
"cardnumber": "8192****8127"
}API Documentation
This library includes comprehensive Swagger/OpenAPI documentation for all endpoints.
POST /custom/mask
Masks sensitive card number data by showing only the first 4 and last 4 digits.
Request Body:
{
"cardnumber": "string"
}Response:
{
"cardnumber": "string"
}Swagger Documentation Included:
- Complete OpenAPI 3.0 specification
- Request/response schemas with examples
- Error response documentation (400, 500)
- Interactive API documentation via Solution Platform
Example Swagger Response Codes:
200: Card number masked successfully400: Invalid request - missing or invalid card number500: Internal server error
Build
npm run buildThis will compile TypeScript files to JavaScript in the lib/ directory.
Compliance
This library follows the Solution Platform Adoption SOP specifications:
- ✅ Uses
@gs/solution-libraryas peer dependency - ✅ Implements
ISolutionAppinterface - ✅ Exports only factory and types as specified
- ✅ Uses standard customization framework contract
- ✅ Single endpoint implementation
- ✅ Health check implementation
License
MIT
