update tsconfig

This commit is contained in:
Philipp Kunz 2024-04-14 17:52:36 +02:00
parent 77d86ba7d5
commit 7e8c5e23ef
4 changed files with 135 additions and 31 deletions

View File

@ -9,12 +9,22 @@
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartlog-destination-receiver",
"description": "a smartlog destination for smartlog-receiver",
"description": "A package providing a destination handler for smartlog logging packages",
"npmPackagename": "@push.rocks/smartlog-destination-receiver",
"license": "MIT"
"license": "MIT",
"keywords": [
"logging",
"smartlog",
"destination",
"receiver",
"typescript",
"logs",
"smartlog-interfaces",
"nodejs"
]
}
},
"tsdocs": {
"tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
}
}

View File

@ -2,7 +2,7 @@
"name": "@push.rocks/smartlog-destination-receiver",
"version": "2.0.4",
"private": false,
"description": "a smartlog destination for smartlog-receiver",
"description": "A package providing a destination handler for smartlog logging packages",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"author": "Lossless GmbH",
@ -42,5 +42,15 @@
"type": "module",
"browserslist": [
"last 1 chrome versions"
],
"keywords": [
"logging",
"smartlog",
"destination",
"receiver",
"typescript",
"logs",
"smartlog-interfaces",
"nodejs"
]
}

1
readme.hints.md Normal file
View File

@ -0,0 +1 @@

137
readme.md
View File

@ -1,39 +1,122 @@
# @pushrocks/smartlog-destination-receiver
# @push.rocks/smartlog-destination-receiver
a smartlog destination for smartlog-receiver
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartlog-destination-receiver)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartlog-destination-receiver)
* [github.com (source mirror)](https://github.com/pushrocks/smartlog-destination-receiver)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartlog-destination-receiver/)
## Install
## Status for master
To include `@push.rocks/smartlog-destination-receiver` in your project, add it as a dependency by running:
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/pushrocks/smartlog-destination-receiver/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/pushrocks/smartlog-destination-receiver/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@pushrocks/smartlog-destination-receiver)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/pushrocks/smartlog-destination-receiver)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@pushrocks/smartlog-destination-receiver)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@pushrocks/smartlog-destination-receiver)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@pushrocks/smartlog-destination-receiver)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
```bash
npm install @push.rocks/smartlog-destination-receiver --save
```
This command will download and add the package to your project's `package.json` file.
## Usage
Use TypeScript for best in class intellisense.
This module offers a modern TypeScript approach to interact with logging destinations, particularly designed for use with `smartlog-receiver`. Below are outlined scenarios to effectively utilize the module, showcasing its functionalities.
## Contribution
### Prerequisites
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
Ensure that you have TypeScript and the necessary types included in your project. Include the module in your TypeScript file with ESM syntax:
For further information read the linked docs at the top of this readme.
```typescript
import { SmartlogDestinationReceiver } from '@push.rocks/smartlog-destination-receiver';
```
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
### Basic Setup
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
To get started, you need to instantiate `SmartlogDestinationReceiver` with the required configuration. This configuration primarily includes the `passphrase` for authentication and the `receiverEndpoint` where the logs will be sent.
```typescript
import { SmartlogDestinationReceiver } from '@push.rocks/smartlog-destination-receiver';
// Initialize with options
const logReceiver = new SmartlogDestinationReceiver({
passphrase: 'your_passphrase', // Provide the passphrase for authentication
receiverEndpoint: 'https://your.log.receiver.endpoint' // Endpoint to send logs to
});
```
### Sending Logs
With `SmartlogDestinationReceiver`, sending logs is crafted to be straightforward. Below is an example demonstrating how to send a basic log message.
```typescript
import { SmartlogDestinationReceiver } from '@push.rocks/smartlog-destination-receiver';
// Instantiate the log receiver
const logReceiver = new SmartlogDestinationReceiver({
passphrase: 'your_passphrase', // Authentication
receiverEndpoint: 'https://your.log.receiver.endpoint'
});
// Prepare a log message
const logMessage = {
timestamp: Date.now(),
context: {
company: 'Your Company',
companyunit: 'Your Unit',
containerName: 'your-service-name',
environment: 'production',
runtime: 'node',
zone: 'your-zone'
},
type: 'log',
level: 'info',
correlation: {
id: 'unique-correlation-id',
type: 'SpecificCorrelationType'
},
message: 'This is a test log message'
};
// Send the log message
await logReceiver.handleLog(logMessage);
```
This setup will securely send your log message to the configured endpoint. Ensure that the endpoint is prepared to receive and process messages in the structure provided.
### Error Handling
It's practical to implement error handling to manage any issues that might arise during the log transmission process. `SmartlogDestinationReceiver` internally catches errors related to the sending process, but you can also wrap calls in try-catch blocks for more comprehensive control.
```typescript
try {
await logReceiver.handleLog(logMessage);
} catch (error) {
console.error('Failed to send log:', error);
}
```
This approach lets you handle any unexpected errors gracefully, ensuring your application's stability.
### Advanced Usage
The `SmartlogDestinationReceiver` can be easily integrated into larger logging systems or services that handle various log destinations. Its simple, promise-based API allows for integration with async/await syntax, facilitating complex logging operations and workflows.
Remember, this module is designed to work seamlessly within the `smartlog` ecosystem, enabling highly configurable, scalable, and secure logging solutions across microservices, applications, and infrastructure.
### Conclusion
The `@push.rocks/smartlog-destination-receiver` module provides a robust and flexible way to send logs to a designated receiver. By seamlessly integrating with TypeScript projects and offering straightforward configuration and usage patterns, it empowers developers to maintain high-quality logging practices with minimal overhead.
For comprehensive details on further configurations and advanced features, refer to the module documentation and API references. Always aim to understand the full capabilities of the logging solutions you implement, ensuring they align with your applications needs and compliance requirements.
## License and Legal Information
This repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository.
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
### Trademarks
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.
### Company Information
Task Venture Capital GmbH
Registered at District court Bremen HRB 35230 HB, Germany
For any legal inquiries or if you require further information, please contact us via email at hello@task.vc.
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.