fix(core): update

This commit is contained in:
Philipp Kunz 2024-05-11 12:33:14 +02:00
parent 0bb9c5e1e5
commit 97cbe6e398
5 changed files with 169 additions and 30 deletions

View File

@ -5,10 +5,32 @@
"githost": "gitlab.com",
"gitscope": "serve.zone",
"gitrepo": "platformservice",
"description": "contains the platformservice container with mail, sms, letter, ai services.",
"description": "A multifaceted platform service handling mail, SMS, letter delivery, and AI services.",
"npmPackagename": "@serve.zone/platformservice",
"license": "MIT",
"projectDomain": "serve.zone"
"projectDomain": "serve.zone",
"keywords": [
"mail service",
"SMS",
"letter delivery",
"AI services",
"SMTP server",
"mail parsing",
"DKIM",
"platform service",
"mailgun integration",
"letterXpress",
"OpenAI",
"Anthropic AI",
"DKIM signing",
"mail forwarding",
"SMTP TLS",
"domain management",
"email templating",
"rule management",
"SMTP STARTTLS",
"DNS management"
]
}
},
"npmci": {

View File

@ -2,7 +2,7 @@
"name": "@serve.zone/platformservice",
"private": true,
"version": "1.0.10",
"description": "contains the platformservice container with mail, sms, letter, ai services.",
"description": "A multifaceted platform service handling mail, SMS, letter delivery, and AI services.",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
@ -45,5 +45,27 @@
"mailparser": "^3.6.9",
"openai": "^4.29.2",
"uuid": "^9.0.1"
}
}
},
"keywords": [
"mail service",
"SMS",
"letter delivery",
"AI services",
"SMTP server",
"mail parsing",
"DKIM",
"platform service",
"mailgun integration",
"letterXpress",
"OpenAI",
"Anthropic AI",
"DKIM signing",
"mail forwarding",
"SMTP TLS",
"domain management",
"email templating",
"rule management",
"SMTP STARTTLS",
"DNS management"
]
}

0
readme.hints.md Normal file
View File

141
readme.md
View File

@ -1,31 +1,126 @@
# @serve.zone/platformservice
contains the platformservice container with mail, sms, letter, ai services.
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@serve.zone/platformservice)
* [gitlab.com (source)](https://gitlab.com/serve.zone/platformservice)
* [github.com (source mirror)](https://github.com/serve.zone/platformservice)
* [docs (typedoc)](https://serve.zone.gitlab.io/platformservice/)
## Install
## Status for master
To install `@serve.zone/platformservice`, run the following command:
Status Category | Status Badge
-- | --
GitLab Pipelines | [![pipeline status](https://gitlab.com/serve.zone/platformservice/badges/master/pipeline.svg)](https://lossless.cloud)
GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/serve.zone/platformservice/badges/master/coverage.svg)](https://lossless.cloud)
npm | [![npm downloads per month](https://badgen.net/npm/dy/@serve.zone/platformservice)](https://lossless.cloud)
Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/serve.zone/platformservice)](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/@serve.zone/platformservice)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@serve.zone/platformservice)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@serve.zone/platformservice)](https://lossless.cloud)
```sh
npm install @serve.zone/platformservice --save
```
Make sure you have Node.js and npm installed on your system to use this package.
## Usage
Use TypeScript for best in class intellisense.
For further information read the linked docs at the top of this readme.
## Legal
> MIT licensed | **©** [Task Venture Capital GmbH](https://task.vc)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
This document provides extensive usage scenarios for the `@serve.zone/platformservice`, a comprehensive ESM module written in TypeScript offering a wide range of services such as mail, SMS, letter, and artificial intelligence (AI) functionalities. This service is an exemplar of a modular design, allowing users to leverage various communication methods and AI services efficiently. Key features provided by this platform include sending and receiving emails, managing SMS services, letter dispatching, and utilizing AI for diverse purposes.
### Prerequisites
Before diving into the examples, ensure you have the platform service installed and configured correctly. The package leverages environment variables for configuration, so you must set up the necessary variables, including service endpoints, authentication tokens, and database connections.
### Initialization
First, initialize the platform service, ensuring all dependencies are correctly loaded and configured:
```ts
import { SzPlatformService } from '@serve.zone/platformservice';
async function initService() {
const platformService = new SzPlatformService();
await platformService.start();
console.log('Platform service initialized successfully.');
}
initService();
```
### Sending Emails
One of the primary services offered is email management. Here's how to send an email using the platform service:
```ts
import { EmailService, IEmailOptions } from '@serve.zone/platformservice';
async function sendEmail() {
const emailOptions: IEmailOptions = {
from: 'no-reply@example.com',
to: 'recipient@example.com',
subject: 'Test Email',
body: '<h1>This is a test email</h1>',
};
const emailService = new EmailService('MAILGUN_API_KEY'); // Replace with your real API key
await emailService.sendEmail(emailOptions);
console.log('Email sent successfully.');
}
sendEmail();
```
### Managing SMS
Similar to email, the platform also facilitates SMS sending:
```ts
import { SmsService, ISmsConstructorOptions } from '@serve.zone/platformservice';
async function sendSms() {
const smsOptions: ISmsConstructorOptions = {
apiGatewayApiToken: 'SMS_API_TOKEN', // Replace with your real token
};
const smsService = new SmsService(smsOptions);
await smsService.sendSms(1234567890, 'SENDER_NAME', 'This is a test SMS.');
console.log('SMS sent successfully.');
}
sendSms();
```
### Dispatching Letters
For physical mail correspondence, the platform provides a letter service:
```ts
import { LetterService, ILetterConstructorOptions } from '@serve.zone/platformservice';
async function sendLetter() {
const letterOptions: ILetterConstructorOptions = {
letterxpressUser: 'USER',
letterxpressToken: 'TOKEN',
};
const letterService = new LetterService(letterOptions);
await letterService.sendLetter('This is a test letter body.', {address: 'Recipient Address', name: 'Recipient Name'});
console.log('Letter dispatched successfully.');
}
sendLetter();
```
### Leveraging AI Services
The platform also integrates AI functionalities, allowing for innovative use cases like generating content, analyzing text, or automating responses:
```ts
import { AiService } from '@serve.zone/platformservice';
async function useAiService() {
const aiService = new AiService('OPENAI_API_KEY'); // Replace with your real API key
const response = await aiService.generateText('Prompt for the AI service.');
console.log(`AI response: ${response}`);
}
useAiService();
```
### Conclusion
The `@serve.zone/platformservice` offers a robust set of features for modern application requirements, including but not limited to communication and AI services. By following the examples above, developers can integrate these services into their applications, harnessing the power of email, SMS, letters, and artificial intelligence seamlessly.
undefined

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@serve.zone/platformservice',
version: '1.0.10',
description: 'contains the platformservice container with mail, sms, letter, ai services.'
version: '1.0.11',
description: 'A multifaceted platform service handling mail, SMS, letter delivery, and AI services.'
}