{"_id":"@bpmromandie/audittrail-service-lib","_rev":"1-d7b8356132e192377326273acb83437b","name":"@bpmromandie/audittrail-service-lib","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.5":{"name":"@bpmromandie/audittrail-service-lib","version":"1.0.5","keywords":[],"author":"","license":"ISC","_id":"@bpmromandie/audittrail-service-lib@1.0.5","maintainers":[{"name":"akliluts","email":"aklilu.tsige.w@gmail.com"},{"name":"carnevluswisscom","email":"luca.carnevale@icloud.com"},{"name":"mfmanca2000","email":"mfmanca2000@hotmail.com"}],"dist":{"shasum":"16bb359f24c0d27d5647bc6b774a94c5ac0e314f","tarball":"https://registry.npmjs.org/@bpmromandie/audittrail-service-lib/-/audittrail-service-lib-1.0.5.tgz","fileCount":32,"integrity":"sha512-2/Fe1Ftwi82iHK2lZkohXfxbAxJfdF7khNBz0GmRJdjmCL+3V/rh1rdh7WrZZNKQm+uA+WVZnXnu0/kXRYDNtw==","signatures":[{"sig":"MEUCICwhAMPuQcRC/gpTtU7fkCHjFN/VkbjH0T2q9A6tLtKkAiEAxOvpxqsMQEd6DsXAkiIyo7P6sbLQc1pCkBAQduXllNA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26051},"main":"./dist/cjs/index.js","types":"./dist/esm/types/index.d.ts","gitHead":"b0c76e5b3046a0755b0e5a883f651aa259de4c4e","scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"npm run clean && npm run build:esm && npm run build:cjs","clean":"rm -rf ./dist","prepack":"npm run build","build:cjs":"tsc -p ./tsconfig.cjs.json","build:esm":"tsc -p ./tsconfig.esm.json && mv dist/esm/index.js dist/esm/index.mjs"},"_npmUser":{"name":"mfmanca2000","email":"mfmanca2000@hotmail.com"},"_npmVersion":"10.8.3","description":"The `audittrail-service-lib` is a TypeScript library designed to facilitate the creation, management, and retrieval of audit logs in microservices architecture. It leverages modern technologies like Axios for HTTP requests and Pino for logging, providing ","directories":{},"_nodeVersion":"20.11.0","dependencies":{"pino":"^9.4.0","axios":"^1.7.7","dotenv":"^16.4.5","pino-pretty":"^11.2.2"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.5.4","@types/node":"^22.5.4"},"_npmOperationalInternal":{"tmp":"tmp/audittrail-service-lib_1.0.5_1726436503084_0.9426506660264606","host":"s3://npm-registry-packages"}},"1.0.6":{"name":"@bpmromandie/audittrail-service-lib","version":"1.0.6","types":"./dist/esm/types/index.d.ts","main":"./dist/cjs/index.js","scripts":{"clean":"rm -rf ./dist","build":"npm run clean && npm run build:esm && npm run build:cjs","build:esm":"tsc -p ./tsconfig.esm.json && mv dist/esm/index.js dist/esm/index.mjs","build:cjs":"tsc -p ./tsconfig.cjs.json","prepack":"npm run build","test":"echo \"Error: no test specified\" && exit 1"},"keywords":[],"author":"","license":"ISC","description":"The `audittrail-service-lib` is a TypeScript library designed to facilitate the creation, management, and retrieval of audit logs in microservices architecture. It leverages modern technologies like Axios for HTTP requests and Pino for logging, providing ","dependencies":{"@bpmromandie/kyc_common_types":"^2.0.12","axios":"^1.7.7","dotenv":"^16.4.5","pino":"^9.4.0","pino-pretty":"^11.2.2"},"devDependencies":{"@types/node":"^22.5.4","typescript":"^5.5.4"},"_id":"@bpmromandie/audittrail-service-lib@1.0.6","gitHead":"b0c76e5b3046a0755b0e5a883f651aa259de4c4e","_nodeVersion":"20.11.0","_npmVersion":"10.8.3","dist":{"integrity":"sha512-GTNxcr39fzWIBiARHqA40qRW7IW50ok/6Tq4qd6lceLE/y2kW78yT4FerFU4fp26kJcDztYXjF+xHsKrVJBqiw==","shasum":"973f5dbdc88423359719ec4a7c1e258cd64d2d90","tarball":"https://registry.npmjs.org/@bpmromandie/audittrail-service-lib/-/audittrail-service-lib-1.0.6.tgz","fileCount":26,"unpackedSize":24348,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC2gGBTFdJ8sQVSLsZkbtz//rLQP6m4ZPC+JKdD07zVpwIgUj6NDvjyyVjFbheRzb8LOhrQSB9lOFrG9AF2UXAl0Q0="}]},"_npmUser":{"name":"mfmanca2000","email":"mfmanca2000@hotmail.com"},"directories":{},"maintainers":[{"name":"akliluts","email":"aklilu.tsige.w@gmail.com"},{"name":"carnevluswisscom","email":"luca.carnevale@icloud.com"},{"name":"mfmanca2000","email":"mfmanca2000@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/audittrail-service-lib_1.0.6_1726489941694_0.3562876396070369"},"_hasShrinkwrap":false}},"time":{"created":"2024-09-15T21:41:42.990Z","modified":"2024-09-16T12:32:22.131Z","1.0.5":"2024-09-15T21:41:43.260Z","1.0.6":"2024-09-16T12:32:21.861Z"},"license":"ISC","keywords":[],"description":"The `audittrail-service-lib` is a TypeScript library designed to facilitate the creation, management, and retrieval of audit logs in microservices architecture. It leverages modern technologies like Axios for HTTP requests and Pino for logging, providing ","maintainers":[{"name":"akliluts","email":"aklilu.tsige.w@gmail.com"},{"name":"carnevluswisscom","email":"luca.carnevale@icloud.com"},{"name":"mfmanca2000","email":"mfmanca2000@hotmail.com"}],"readme":"# AuditTrail Service Library\r\n\r\nThe `audittrail-service-lib` is a TypeScript library designed to facilitate the creation, management, and retrieval of audit logs in microservices architecture. It leverages modern technologies like Axios for HTTP requests and Pino for logging, providing a robust solution for integrating audit trail capabilities into your applications.\r\n\r\n# Publishing with Scripts\r\nThis project includes scripts to facilitate building and publishing the package to a private npm registry. Below are the instructions for using these scripts.\r\n\r\n### Requirements Setup\r\n\r\n- **npm**: Ensure that `npm` is installed and available in your system's PATH.\r\n- **Private npm registry**: If you're using a private npm registry (https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/), make sure to have the necessary authentication set up (e.g., using `.npmrc`).\r\n\r\n\r\n#####  `.npmrc` Configuration for Private NPM Registry\r\n\r\n### Installation\r\n\r\n### `.npmrc` Configuration (Recommended)\r\n\r\nFor the correct registry settings, add the following to your project's `.npmrc` file:\r\n\r\n```ini\r\n# Use the default npm registry for public packages\r\nregistry=https://registry.npmjs.org/\r\n\r\n# Use the private Artifactory registry for @bpmromandie scope\r\n@bpmromandie:registry=https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/\r\n//bin.swisscom.com/artifactory/api/npm/kyc-npm-local/:username=YOUR_USERNAME\r\n//bin.swisscom.com/artifactory/api/npm/kyc-npm-local/:_password=YOUR_BASE64_ENCODED_PASSWORD\r\n//bin.swisscom.com/artifactory/api/npm/kyc-npm-local/:email=YOUR_EMAIL\r\n```\r\nThis ensures that public packages are fetched from the public registry and private packages (under @bpmromandie) are fetched from your Artifactory registry.\r\n\r\n\r\nIf your project uses private npm packages (e.g., `@bpmromandie` scope), you must configure `.npmrc` with the correct registry and credentials. Here's an example `.npmrc` file:\r\n\r\n- Ensure you have npm installed and configured correctly on your system before running these scripts.\r\n- The scripts will check if the necessary configurations (like .npmrc) are set for the private registry before proceeding with the build and publish steps.\r\n- You might need to provide authentication details for accessing the private registry. This can typically be done by modifying the .npmrc file within the script or manually before running the script.\r\n- Replace YOUR_USERNAME, YOUR_BASE64_ENCODED_PASSWORD, and YOUR_EMAIL with your actual credentials.\r\n- Ensure .npmrc is in your project root and will be copied during the Docker build process.\r\n\r\n\r\n#### Using PowerShell Script (Windows)\r\n\r\nThe `publish.ps1` script automates the process of building and publishing the package to a private registry. To use this script:\r\n\r\n1. **Open PowerShell as Administrator.**\r\n2. **Navigate to the project directory where `publish.ps1` is located.**\r\n3. **Run the script:**\r\n   ```powershell\r\n   .\\publish.ps1\r\n\t```\r\n#### Using Shell Script (Unix/Linux/Mac)\r\n\r\nThe `publish.ps1` script serves a similar purpose but is intended for use in Unix-like environments. To use this script:\r\n\r\n1. Open Terminal\r\n2. Navigate to the project directory where publish.sh is located\r\n3. mage the script executable(if not already)\r\n\r\n````bash\r\nchmod +x publish.sh\r\n````\r\n4. Run the script\r\n\r\n```bash\r\n./publish.sh\r\n```\r\n\r\n## Features\r\n\r\n- **Create Log Entries**: Easily log audit events in your service.\r\n- **Fetch Logs**: Retrieve logs based on various criteria.\r\n- **Connection Checks**: Verify service connectivity.\r\n- **Configurable**: Flexible initialization to suit different deployment environments.\r\n\r\n## Installation\r\n\r\nInstall `audittrail-service-lib` using npm:\r\n\r\n```bash\r\nnpm install audittrail-service-lib\r\n````\r\n\r\n\r\n\r\n## Usage\r\n\r\nHere's how to use audittrail-service-lib in your project:\r\n\r\nInitializing the AuditTrailService\r\n\r\n````typescript\r\nimport { AuditTrailService } from 'audittrail-service-lib';\r\n\r\nconst apiUrl = 'http://localhost:6004'; \r\nconst service = new AuditTrailService({baseUrl: apiUrl});\r\n\r\n````\r\n## Creating a Log Entry\r\n\r\n````typescript\r\nconst logEntry = {\r\n  message: 'User login successful',\r\n  level: 'info'\r\n};\r\n\r\nservice.createLog(logEntry)\r\n  .then(() => console.log('Log entry created'))\r\n  .catch(error => console.error('Error creating log entry', error));\r\n\r\n````\r\n## Fetching Logs\r\n````typescript\r\nservice.getLogs()\r\n  .then(logs => console.log('Logs:', logs))\r\n  .catch(error => console.error('Error fetching logs', error));\r\n\r\n````\r\n\r\n## API Reference\r\n\r\n- createLog(logData): Create a new log entry. \r\n- getLogs(): Fetch all logs.\r\n- filterLogs(criteria): Fetch logs that meet specified criteria.\r\n\r\n\r\n\r\n## Quick local setup\r\n- npm config set @bpmromandie:registry https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/\r\n- npm login --scope=@bpmromandie --registry=https://bin.swisscom.com/artifactory/api/npm/kyc-npm-local/\r\n- npm i\r\n- modify the package version in package.json\r\n- npm run build\r\n- npm publish","readmeFilename":"README.md"}