Compare commits
No commits in common. "master" and "v2.0.0" have entirely different histories.
28
changelog.md
28
changelog.md
@ -1,33 +1,5 @@
|
||||
# Changelog
|
||||
|
||||
## 2025-03-15 - 2.3.0 - feat(platformservice)
|
||||
Add AIBridge module and refactor service file paths for improved module organization
|
||||
|
||||
- Added new AIBridge class in ts/aibridge/classes.aibridge.ts.
|
||||
- Renamed letter service file from ts/letter/letterservice.ts to ts/letter/classes.letterservice.ts and updated its index.
|
||||
- Updated platformservice.ts to import letter and SMS services from new paths.
|
||||
- Renamed SMS service file from ts/sms/smsservice.ts to ts/sms/classes.smsservice.ts and updated its index accordingly.
|
||||
|
||||
## 2025-03-15 - 2.2.1 - fix(platformservice)
|
||||
Refactor module structure to update import paths and file organization
|
||||
|
||||
- Removed obsolete file 'ts/classes.platformservice.ts' and updated references to use 'ts/platformservice.ts'.
|
||||
- Updated import paths in PlatformServiceDb, EmailService, and other modules to use new file structure.
|
||||
- Renamed and moved files in the email, mta, letter, and sms directories to align with new module layout.
|
||||
- Fixed references to external modules (e.g. '@serve.zone/interfaces', '@push.rocks/*', etc.) to reflect the updated paths.
|
||||
|
||||
## 2025-03-15 - 2.2.0 - feat(plugins)
|
||||
Add smartproxy support by including the @push.rocks/smartproxy dependency and exporting it in the plugins module.
|
||||
|
||||
- Added '@push.rocks/smartproxy' dependency version '^4.1.0' to package.json
|
||||
- Updated ts/plugins.ts to export the smartproxy module alongside other push.rocks modules
|
||||
|
||||
## 2025-03-15 - 2.1.0 - feat(MTA)
|
||||
Update readme with detailed Mail Transfer Agent usage and examples
|
||||
|
||||
- Added a comprehensive MTA section with usage examples including SMTP server setup, DKIM signing/verification, SPF/DMARC support, and API integration
|
||||
- Expanded the conclusion to highlight MTA capabilities alongside email, SMS, letter, and AI services
|
||||
|
||||
## 2025-03-15 - 2.0.0 - BREAKING CHANGE(platformservice)
|
||||
Remove deprecated AIBridge module and update email service to use the MTA connector; update dependency versions and adjust build scripts in package.json.
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@serve.zone/platformservice",
|
||||
"private": true,
|
||||
"version": "2.3.0",
|
||||
"version": "2.0.0",
|
||||
"description": "A multifaceted platform service handling mail, SMS, letter delivery, and AI services.",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
@ -36,7 +36,6 @@
|
||||
"@push.rocks/smartmail": "^1.0.24",
|
||||
"@push.rocks/smartpath": "^5.0.5",
|
||||
"@push.rocks/smartpromise": "^4.0.3",
|
||||
"@push.rocks/smartproxy": "^4.1.0",
|
||||
"@push.rocks/smartrequest": "^2.0.21",
|
||||
"@push.rocks/smartrule": "^2.0.1",
|
||||
"@push.rocks/smartrx": "^3.0.7",
|
||||
|
188
pnpm-lock.yaml
generated
188
pnpm-lock.yaml
generated
@ -47,9 +47,6 @@ importers:
|
||||
'@push.rocks/smartpromise':
|
||||
specifier: ^4.0.3
|
||||
version: 4.2.3
|
||||
'@push.rocks/smartproxy':
|
||||
specifier: ^4.1.0
|
||||
version: 4.1.0
|
||||
'@push.rocks/smartrequest':
|
||||
specifier: ^2.0.21
|
||||
version: 2.0.23
|
||||
@ -754,48 +751,15 @@ packages:
|
||||
'@pdf-lib/upng@1.0.1':
|
||||
resolution: {integrity: sha512-dQK2FUMQtowVP00mtIksrlZhdFXQZPC+taih1q4CvPZ5vqdxR/LKBaFg0oAfzd1GlHZXXSPdQfzQnt+ViGvEIQ==}
|
||||
|
||||
'@peculiar/asn1-cms@2.3.15':
|
||||
resolution: {integrity: sha512-B+DoudF+TCrxoJSTjjcY8Mmu+lbv8e7pXGWrhNp2/EGJp9EEcpzjBCar7puU57sGifyzaRVM03oD5L7t7PghQg==}
|
||||
|
||||
'@peculiar/asn1-csr@2.3.15':
|
||||
resolution: {integrity: sha512-caxAOrvw2hUZpxzhz8Kp8iBYKsHbGXZPl2KYRMIPvAfFateRebS3136+orUpcVwHRmpXWX2kzpb6COlIrqCumA==}
|
||||
|
||||
'@peculiar/asn1-ecc@2.3.15':
|
||||
resolution: {integrity: sha512-/HtR91dvgog7z/WhCVdxZJ/jitJuIu8iTqiyWVgRE9Ac5imt2sT/E4obqIVGKQw7PIy+X6i8lVBoT6wC73XUgA==}
|
||||
|
||||
'@peculiar/asn1-pfx@2.3.15':
|
||||
resolution: {integrity: sha512-E3kzQe3J2xV9DP6SJS4X6/N1e4cYa2xOAK46VtvpaRk8jlheNri8v0rBezKFVPB1rz/jW8npO+u1xOvpATFMWg==}
|
||||
|
||||
'@peculiar/asn1-pkcs8@2.3.15':
|
||||
resolution: {integrity: sha512-/PuQj2BIAw1/v76DV1LUOA6YOqh/UvptKLJHtec/DQwruXOCFlUo7k6llegn8N5BTeZTWMwz5EXruBw0Q10TMg==}
|
||||
|
||||
'@peculiar/asn1-pkcs9@2.3.15':
|
||||
resolution: {integrity: sha512-yiZo/1EGvU1KiQUrbcnaPGWc0C7ElMMskWn7+kHsCFm+/9fU0+V1D/3a5oG0Jpy96iaXggQpA9tzdhnYDgjyFg==}
|
||||
|
||||
'@peculiar/asn1-rsa@2.3.15':
|
||||
resolution: {integrity: sha512-p6hsanvPhexRtYSOHihLvUUgrJ8y0FtOM97N5UEpC+VifFYyZa0iZ5cXjTkZoDwxJ/TTJ1IJo3HVTB2JJTpXvg==}
|
||||
|
||||
'@peculiar/asn1-schema@2.3.13':
|
||||
resolution: {integrity: sha512-3Xq3a01WkHRZL8X04Zsfg//mGaA21xlL4tlVn4v2xGT0JStiztATRkMwa5b+f/HXmY2smsiLXYK46Gwgzvfg3g==}
|
||||
|
||||
'@peculiar/asn1-schema@2.3.15':
|
||||
resolution: {integrity: sha512-QPeD8UA8axQREpgR5UTAfu2mqQmm97oUqahDtNdBcfj3qAnoXzFdQW+aNf/tD2WVXF8Fhmftxoj0eMIT++gX2w==}
|
||||
|
||||
'@peculiar/asn1-x509-attr@2.3.15':
|
||||
resolution: {integrity: sha512-TWJVJhqc+IS4MTEML3l6W1b0sMowVqdsnI4dnojg96LvTuP8dga9f76fjP07MUuss60uSyT2ckoti/2qHXA10A==}
|
||||
|
||||
'@peculiar/asn1-x509-logotype@2.3.13':
|
||||
resolution: {integrity: sha512-+atb0ws0Svr5wtuLyPvb4K/4fZKOv3Di2Zxl3wREqfeEvMQ/n+iQKWYplfZG9gcw5CuHVJjmfY6tHkIEryHCPQ==}
|
||||
|
||||
'@peculiar/asn1-x509@2.3.13':
|
||||
resolution: {integrity: sha512-PfeLQl2skXmxX2/AFFCVaWU8U6FKW1Db43mgBhShCOFS1bVxqtvusq1hVjfuEcuSQGedrLdCSvTgabluwN/M9A==}
|
||||
|
||||
'@peculiar/asn1-x509@2.3.15':
|
||||
resolution: {integrity: sha512-0dK5xqTqSLaxv1FHXIcd4Q/BZNuopg+u1l23hT9rOmQ1g4dNtw0g/RnEi+TboB0gOwGtrWn269v27cMgchFIIg==}
|
||||
|
||||
'@peculiar/x509@1.12.3':
|
||||
resolution: {integrity: sha512-+Mzq+W7cNEKfkNZzyLl6A6ffqc3r21HGZUezgfKxpZrkORfOqgRXnS80Zu0IV6a9Ue9QBJeKD7kN0iWfc3bhRQ==}
|
||||
|
||||
'@pkgjs/parseargs@0.11.0':
|
||||
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
|
||||
engines: {node: '>=14'}
|
||||
@ -970,9 +934,6 @@ packages:
|
||||
'@push.rocks/smartpromise@4.2.3':
|
||||
resolution: {integrity: sha512-Ycg/TJR+tMt+S3wSFurOpEoW6nXv12QBtKXgBcjMZ4RsdO28geN46U09osPn9N9WuwQy1PkmTV5J/V4F9U8qEw==}
|
||||
|
||||
'@push.rocks/smartproxy@4.1.0':
|
||||
resolution: {integrity: sha512-yNTS+9mbBsO09+RXY7o9SUact9xXqwFFvQfLDz2QK4L/2L5RjFMEnqElmBdHx/vU2Vbv1JexiJiM73aa9XzwCQ==}
|
||||
|
||||
'@push.rocks/smartpuppeteer@2.0.5':
|
||||
resolution: {integrity: sha512-yK/qSeWVHIGWRp3c8S5tfdGP6WCKllZC4DR8d8CQlEjszOSBmHtlTdyyqOMBZ/BA4kd+eU5f3A1r4K2tGYty1g==}
|
||||
|
||||
@ -1727,10 +1688,6 @@ packages:
|
||||
resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==}
|
||||
engines: {node: '>= 0.6'}
|
||||
|
||||
acme-client@5.4.0:
|
||||
resolution: {integrity: sha512-mORqg60S8iML6XSmVjqjGHJkINrCGLMj2QvDmFzI9vIlv1RGlyjmw3nrzaINJjkNsYXC41XhhD5pfy7CtuGcbA==}
|
||||
engines: {node: '>= 16'}
|
||||
|
||||
agent-base@6.0.2:
|
||||
resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==}
|
||||
engines: {node: '>= 6.0.0'}
|
||||
@ -1817,9 +1774,6 @@ packages:
|
||||
resolution: {integrity: sha512-Xm7bpRXnDSX2YE2YFfBk2FnF0ep6tmG7xPh8iHee8MIcrgq762Nkce856dYtJYLkuIoYZvGfTs/PbZhideTcEg==}
|
||||
engines: {node: '>=4'}
|
||||
|
||||
axios@1.8.3:
|
||||
resolution: {integrity: sha512-iP4DebzoNlP/YN2dpwCgb8zoCmhtkajzS48JvwmkSkXvPI3DHc7m+XYL5tGnSlJtR6nImXZmdCuN5aP8dh1d8A==}
|
||||
|
||||
b4a@1.6.7:
|
||||
resolution: {integrity: sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==}
|
||||
|
||||
@ -3910,9 +3864,6 @@ packages:
|
||||
resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==}
|
||||
engines: {node: '>= 14.18.0'}
|
||||
|
||||
reflect-metadata@0.2.2:
|
||||
resolution: {integrity: sha512-urBwgfrvVP/eAyXx4hluJivBKzuEbSQs9rKWCrCkbSxNv8mxPcUZKeuoF3Uy4mJl3Lwprp6yy5/39VWigZ4K6Q==}
|
||||
|
||||
regenerator-runtime@0.14.1:
|
||||
resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==}
|
||||
|
||||
@ -4328,10 +4279,6 @@ packages:
|
||||
engines: {node: '>=18.0.0'}
|
||||
hasBin: true
|
||||
|
||||
tsyringe@4.8.0:
|
||||
resolution: {integrity: sha512-YB1FG+axdxADa3ncEtRnQCFq/M0lALGLxSZeVNbTU8NqhOVc51nnv2CISTcvc1kyv6EGPtXVr0v6lWeDxiijOA==}
|
||||
engines: {node: '>= 6.0.0'}
|
||||
|
||||
turndown-plugin-gfm@1.0.2:
|
||||
resolution: {integrity: sha512-vwz9tfvF7XN/jE0dGoBei3FXWuvll78ohzCZQuOb+ZjWrs3a0XhQVomJEb2Qh4VHTPNRO4GPZh0V7VRbiWwkRg==}
|
||||
|
||||
@ -5616,8 +5563,10 @@ snapshots:
|
||||
'@push.rocks/taskbuffer': 3.1.7
|
||||
transitivePeerDependencies:
|
||||
- '@nuxt/kit'
|
||||
- bufferutil
|
||||
- react
|
||||
- supports-color
|
||||
- utf-8-validate
|
||||
- vue
|
||||
|
||||
'@hapi/bourne@3.0.0': {}
|
||||
@ -5754,81 +5703,12 @@ snapshots:
|
||||
dependencies:
|
||||
pako: 1.0.11
|
||||
|
||||
'@peculiar/asn1-cms@2.3.15':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/asn1-x509': 2.3.15
|
||||
'@peculiar/asn1-x509-attr': 2.3.15
|
||||
asn1js: 3.0.5
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-csr@2.3.15':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/asn1-x509': 2.3.15
|
||||
asn1js: 3.0.5
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-ecc@2.3.15':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/asn1-x509': 2.3.15
|
||||
asn1js: 3.0.5
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-pfx@2.3.15':
|
||||
dependencies:
|
||||
'@peculiar/asn1-cms': 2.3.15
|
||||
'@peculiar/asn1-pkcs8': 2.3.15
|
||||
'@peculiar/asn1-rsa': 2.3.15
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
asn1js: 3.0.5
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-pkcs8@2.3.15':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/asn1-x509': 2.3.15
|
||||
asn1js: 3.0.5
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-pkcs9@2.3.15':
|
||||
dependencies:
|
||||
'@peculiar/asn1-cms': 2.3.15
|
||||
'@peculiar/asn1-pfx': 2.3.15
|
||||
'@peculiar/asn1-pkcs8': 2.3.15
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/asn1-x509': 2.3.15
|
||||
'@peculiar/asn1-x509-attr': 2.3.15
|
||||
asn1js: 3.0.5
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-rsa@2.3.15':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/asn1-x509': 2.3.15
|
||||
asn1js: 3.0.5
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-schema@2.3.13':
|
||||
dependencies:
|
||||
asn1js: 3.0.5
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-schema@2.3.15':
|
||||
dependencies:
|
||||
asn1js: 3.0.5
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-x509-attr@2.3.15':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
'@peculiar/asn1-x509': 2.3.15
|
||||
asn1js: 3.0.5
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-x509-logotype@2.3.13':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.13
|
||||
@ -5844,27 +5724,6 @@ snapshots:
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/asn1-x509@2.3.15':
|
||||
dependencies:
|
||||
'@peculiar/asn1-schema': 2.3.15
|
||||
asn1js: 3.0.5
|
||||
pvtsutils: 1.3.6
|
||||
tslib: 2.8.1
|
||||
|
||||
'@peculiar/x509@1.12.3':
|
||||
dependencies:
|
||||
'@peculiar/asn1-cms': 2.3.15
|
||||
'@peculiar/asn1-csr': 2.3.15
|
||||
'@peculiar/asn1-ecc': 2.3.15
|
||||
'@peculiar/asn1-pkcs9': 2.3.15
|
||||
'@peculiar/asn1-rsa': 2.3.15
|
||||
'@peculiar/asn1-schema': 2.3.13
|
||||
'@peculiar/asn1-x509': 2.3.13
|
||||
pvtsutils: 1.3.6
|
||||
reflect-metadata: 0.2.2
|
||||
tslib: 2.8.1
|
||||
tsyringe: 4.8.0
|
||||
|
||||
'@pkgjs/parseargs@0.11.0':
|
||||
optional: true
|
||||
|
||||
@ -6321,25 +6180,6 @@ snapshots:
|
||||
|
||||
'@push.rocks/smartpromise@4.2.3': {}
|
||||
|
||||
'@push.rocks/smartproxy@4.1.0':
|
||||
dependencies:
|
||||
'@push.rocks/lik': 6.1.0
|
||||
'@push.rocks/smartdelay': 3.0.5
|
||||
'@push.rocks/smartpromise': 4.2.3
|
||||
'@push.rocks/smartrequest': 2.0.23
|
||||
'@push.rocks/smartstring': 4.0.15
|
||||
'@tsclass/tsclass': 5.0.0
|
||||
'@types/minimatch': 5.1.2
|
||||
'@types/ws': 8.18.0
|
||||
acme-client: 5.4.0
|
||||
minimatch: 10.0.1
|
||||
pretty-ms: 9.2.0
|
||||
ws: 8.18.1
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- supports-color
|
||||
- utf-8-validate
|
||||
|
||||
'@push.rocks/smartpuppeteer@2.0.5(typescript@5.7.3)':
|
||||
dependencies:
|
||||
'@push.rocks/smartdelay': 3.0.5
|
||||
@ -7532,16 +7372,6 @@ snapshots:
|
||||
mime-types: 2.1.35
|
||||
negotiator: 0.6.3
|
||||
|
||||
acme-client@5.4.0:
|
||||
dependencies:
|
||||
'@peculiar/x509': 1.12.3
|
||||
asn1js: 3.0.5
|
||||
axios: 1.8.3(debug@4.4.0)
|
||||
debug: 4.4.0
|
||||
node-forge: 1.3.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
agent-base@6.0.2:
|
||||
dependencies:
|
||||
debug: 4.4.0
|
||||
@ -7613,14 +7443,6 @@ snapshots:
|
||||
|
||||
axe-core@4.10.3: {}
|
||||
|
||||
axios@1.8.3(debug@4.4.0):
|
||||
dependencies:
|
||||
follow-redirects: 1.15.9(debug@4.4.0)
|
||||
form-data: 4.0.2
|
||||
proxy-from-env: 1.1.0
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
|
||||
b4a@1.6.7: {}
|
||||
|
||||
bail@2.0.2: {}
|
||||
@ -10065,8 +9887,6 @@ snapshots:
|
||||
|
||||
readdirp@4.1.2: {}
|
||||
|
||||
reflect-metadata@0.2.2: {}
|
||||
|
||||
regenerator-runtime@0.14.1: {}
|
||||
|
||||
registry-auth-token@5.1.0:
|
||||
@ -10574,10 +10394,6 @@ snapshots:
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.3
|
||||
|
||||
tsyringe@4.8.0:
|
||||
dependencies:
|
||||
tslib: 1.14.1
|
||||
|
||||
turndown-plugin-gfm@1.0.2: {}
|
||||
|
||||
turndown@7.2.0:
|
||||
|
78
readme.md
78
readme.md
@ -103,81 +103,6 @@ async function sendLetter() {
|
||||
sendLetter();
|
||||
```
|
||||
|
||||
### Mail Transfer Agent (MTA)
|
||||
|
||||
The platform includes a robust Mail Transfer Agent (MTA) for enterprise-grade email handling with complete control over the email delivery process:
|
||||
|
||||
```mermaid
|
||||
graph TD
|
||||
API[API Clients] --> ApiManager
|
||||
SMTP[External SMTP Servers] <--> SMTPServer
|
||||
|
||||
subgraph "MTA Service"
|
||||
MtaService[MTA Service] --> SMTPServer[SMTP Server]
|
||||
MtaService --> EmailSendJob[Email Send Job]
|
||||
MtaService --> DnsManager[DNS Manager]
|
||||
MtaService --> DkimCreator[DKIM Creator]
|
||||
ApiManager[API Manager] --> MtaService
|
||||
end
|
||||
|
||||
subgraph "External Services"
|
||||
DnsManager <--> DNS[DNS Servers]
|
||||
EmailSendJob <--> MXServers[MX Servers]
|
||||
end
|
||||
```
|
||||
|
||||
The MTA service provides:
|
||||
- Complete SMTP server for receiving emails
|
||||
- DKIM signing and verification
|
||||
- SPF and DMARC support
|
||||
- DNS record management
|
||||
- Retry logic with queue processing
|
||||
- TLS encryption
|
||||
|
||||
Here's how to use the MTA service:
|
||||
|
||||
```ts
|
||||
import { MtaService, Email } from '@serve.zone/platformservice';
|
||||
|
||||
async function useMtaService() {
|
||||
// Initialize MTA service
|
||||
const mtaService = new MtaService(platformService);
|
||||
await mtaService.start();
|
||||
|
||||
// Send an email
|
||||
const email = new Email({
|
||||
from: 'sender@yourdomain.com',
|
||||
to: 'recipient@example.com',
|
||||
subject: 'Hello World',
|
||||
text: 'This is a test email',
|
||||
html: '<p>This is a <b>test</b> email</p>',
|
||||
attachments: [] // Optional attachments
|
||||
});
|
||||
|
||||
const emailId = await mtaService.send(email);
|
||||
console.log(`Email queued with ID: ${emailId}`);
|
||||
|
||||
// Check email status
|
||||
const status = mtaService.getEmailStatus(emailId);
|
||||
console.log(`Email status: ${status.status}`);
|
||||
|
||||
// Set up API for external access
|
||||
const apiManager = new ApiManager(mtaService);
|
||||
await apiManager.start(3000);
|
||||
console.log('MTA API running on port 3000');
|
||||
}
|
||||
|
||||
useMtaService();
|
||||
```
|
||||
|
||||
The MTA provides key advantages for applications requiring:
|
||||
- High-volume email sending
|
||||
- Compliance with email authentication standards
|
||||
- Detailed delivery tracking
|
||||
- Custom email handling logic
|
||||
- Multi-domain email management
|
||||
- Complete control over email infrastructure
|
||||
|
||||
### Leveraging AI Services
|
||||
|
||||
The platform also integrates AI functionalities, allowing for innovative use cases like generating content, analyzing text, or automating responses:
|
||||
@ -197,4 +122,5 @@ 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, MTA capabilities, and artificial intelligence seamlessly.
|
||||
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
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@serve.zone/platformservice',
|
||||
version: '2.3.0',
|
||||
version: '2.0.0',
|
||||
description: 'A multifaceted platform service handling mail, SMS, letter delivery, and AI services.'
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
export class AIBridge {
|
||||
|
||||
}
|
@ -1,10 +1,10 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import * as paths from './paths.js';
|
||||
import { PlatformServiceDb } from './classes.platformservicedb.js'
|
||||
import { EmailService } from './email/classes.emailservice.js';
|
||||
import { SmsService } from './sms/classes.smsservice.js';
|
||||
import { EmailService } from './email/email.classes.emailservice.js';
|
||||
import { SmsService } from './sms/smsservice.js';
|
||||
import { LetterService } from './letter/classes.letterservice.js';
|
||||
import { MtaService } from './mta/classes.mta.js';
|
||||
import { MtaService } from './mta/mta.classes.mta.js';
|
||||
|
||||
export class SzPlatformService {
|
||||
public projectinfo: plugins.projectinfo.ProjectInfo;
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from './plugins.js';
|
||||
import { SzPlatformService } from './platformservice.js';
|
||||
import { SzPlatformService } from './classes.platformservice.js';
|
||||
|
||||
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import { EmailService } from './classes.emailservice.js';
|
||||
import { EmailService } from './email.classes.emailservice.js';
|
||||
import { logger } from '../logger.js';
|
||||
|
||||
export class ApiManager {
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import { EmailService } from './classes.emailservice.js';
|
||||
import { EmailService } from './email.classes.emailservice.js';
|
||||
import { logger } from '../logger.js';
|
||||
|
||||
// Import MTA classes
|
@ -1,10 +1,10 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as paths from '../paths.js';
|
||||
import { MtaConnector } from './classes.connector.mta.js';
|
||||
import { RuleManager } from './classes.rulemanager.js';
|
||||
import { ApiManager } from './classes.apimanager.js';
|
||||
import { MtaConnector } from './email.classes.connector.mta.js';
|
||||
import { RuleManager } from './email.classes.rulemanager.js';
|
||||
import { ApiManager } from './email.classes.apimanager.js';
|
||||
import { logger } from '../logger.js';
|
||||
import type { SzPlatformService } from '../platformservice.js';
|
||||
import type { SzPlatformService } from '../classes.platformservice.js';
|
||||
|
||||
// Import MTA service
|
||||
import { MtaService, type IMtaConfig } from '../mta/index.js';
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import { EmailService } from './classes.emailservice.js';
|
||||
import { EmailService } from './email.classes.emailservice.js';
|
||||
import { logger } from '../logger.js';
|
||||
|
||||
export class RuleManager {
|
@ -1,4 +1,4 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as plugins from './email.plugins.js';
|
||||
|
||||
export class TemplateManager {
|
||||
public smartmailDefault = new plugins.smartmail.Smartmail({
|
@ -1,4 +1,4 @@
|
||||
export * from './00_commitinfo_data.js';
|
||||
import { SzPlatformService } from './platformservice.js';
|
||||
import { SzPlatformService } from './classes.platformservice.js';
|
||||
|
||||
export const runCli = async () => {}
|
@ -1,4 +1,4 @@
|
||||
import type { SzPlatformService } from '../platformservice.js';
|
||||
import type { SzPlatformService } from '../classes.platformservice.js';
|
||||
import * as plugins from '../plugins.js';
|
||||
|
||||
export interface ILetterConstructorOptions {
|
||||
|
@ -1 +0,0 @@
|
||||
export * from './classes.letterservice.js';
|
@ -1,7 +1,7 @@
|
||||
export * from './classes.dkimcreator.js';
|
||||
export * from './classes.emailsignjob.js';
|
||||
export * from './classes.dkimverifier.js';
|
||||
export * from './classes.mta.js';
|
||||
export * from './classes.smtpserver.js';
|
||||
export * from './classes.emailsendjob.js';
|
||||
export * from './classes.email.js';
|
||||
export * from './mta.classes.dkimcreator.js';
|
||||
export * from './mta.classes.emailsignjob.js';
|
||||
export * from './mta.classes.dkimverifier.js';
|
||||
export * from './mta.classes.mta.js';
|
||||
export * from './mta.classes.smtpserver.js';
|
||||
export * from './mta.classes.emailsendjob.js';
|
||||
export * from './mta.classes.email.js';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import { Email } from './classes.email.js';
|
||||
import type { IEmailOptions } from './classes.email.js';
|
||||
import { DeliveryStatus } from './classes.emailsendjob.js';
|
||||
import type { MtaService } from './classes.mta.js';
|
||||
import type { IDnsRecord } from './classes.dnsmanager.js';
|
||||
import { Email } from './mta.classes.email.js';
|
||||
import type { IEmailOptions } from './mta.classes.email.js';
|
||||
import { DeliveryStatus } from './mta.classes.emailsendjob.js';
|
||||
import type { MtaService } from './mta.classes.mta.js';
|
||||
import type { IDnsRecord } from './mta.classes.dnsmanager.js';
|
||||
|
||||
/**
|
||||
* Authentication options for API requests
|
@ -1,8 +1,8 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as paths from '../paths.js';
|
||||
|
||||
import { Email } from './classes.email.js';
|
||||
import type { MtaService } from './classes.mta.js';
|
||||
import { Email } from './mta.classes.email.js';
|
||||
import type { MtaService } from './mta.classes.mta.js';
|
||||
|
||||
const readFile = plugins.util.promisify(plugins.fs.readFile);
|
||||
const writeFile = plugins.util.promisify(plugins.fs.writeFile);
|
@ -1,5 +1,5 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import { MtaService } from './classes.mta.js';
|
||||
import { MtaService } from './mta.classes.mta.js';
|
||||
|
||||
class DKIMVerifier {
|
||||
public mtaRef: MtaService;
|
@ -1,8 +1,8 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as paths from '../paths.js';
|
||||
import { Email } from './classes.email.js';
|
||||
import { EmailSignJob } from './classes.emailsignjob.js';
|
||||
import type { MtaService } from './classes.mta.js';
|
||||
import { Email } from './mta.classes.email.js';
|
||||
import { EmailSignJob } from './mta.classes.emailsignjob.js';
|
||||
import type { MtaService } from './mta.classes.mta.js';
|
||||
|
||||
// Configuration options for email sending
|
||||
export interface IEmailSendOptions {
|
@ -1,14 +1,14 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as paths from '../paths.js';
|
||||
|
||||
import { Email } from './classes.email.js';
|
||||
import { EmailSendJob, DeliveryStatus } from './classes.emailsendjob.js';
|
||||
import { DKIMCreator } from './classes.dkimcreator.js';
|
||||
import { DKIMVerifier } from './classes.dkimverifier.js';
|
||||
import { SMTPServer, type ISmtpServerOptions } from './classes.smtpserver.js';
|
||||
import { DNSManager } from './classes.dnsmanager.js';
|
||||
import { ApiManager } from './classes.apimanager.js';
|
||||
import type { SzPlatformService } from '../platformservice.js';
|
||||
import { Email } from './mta.classes.email.js';
|
||||
import { EmailSendJob, DeliveryStatus } from './mta.classes.emailsendjob.js';
|
||||
import { DKIMCreator } from './mta.classes.dkimcreator.js';
|
||||
import { DKIMVerifier } from './mta.classes.dkimverifier.js';
|
||||
import { SMTPServer, type ISmtpServerOptions } from './mta.classes.smtpserver.js';
|
||||
import { DNSManager } from './mta.classes.dnsmanager.js';
|
||||
import { ApiManager } from './mta.classes.apimanager.js';
|
||||
import type { SzPlatformService } from '../classes.platformservice.js';
|
||||
|
||||
/**
|
||||
* Configuration options for the MTA service
|
@ -1,7 +1,7 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as paths from '../paths.js';
|
||||
import { Email } from './classes.email.js';
|
||||
import type { MtaService } from './classes.mta.js';
|
||||
import { Email } from './mta.classes.email.js';
|
||||
import type { MtaService } from './mta.classes.mta.js';
|
||||
|
||||
export interface ISmtpServerOptions {
|
||||
port: number;
|
@ -45,13 +45,12 @@ import * as smartfile from '@push.rocks/smartfile';
|
||||
import * as smartlog from '@push.rocks/smartlog';
|
||||
import * as smartmail from '@push.rocks/smartmail';
|
||||
import * as smartpath from '@push.rocks/smartpath';
|
||||
import * as smartproxy from '@push.rocks/smartproxy';
|
||||
import * as smartpromise from '@push.rocks/smartpromise';
|
||||
import * as smartrequest from '@push.rocks/smartrequest';
|
||||
import * as smartrule from '@push.rocks/smartrule';
|
||||
import * as smartrx from '@push.rocks/smartrx';
|
||||
|
||||
export { projectinfo, qenv, smartdata, smartfile, smartlog, smartmail, smartpath, smartproxy, smartpromise, smartrequest, smartrule, smartrx };
|
||||
export { projectinfo, qenv, smartdata, smartfile, smartlog, smartmail, smartpath, smartpromise, smartrequest, smartrule, smartrx };
|
||||
|
||||
// apiclient.xyz scope
|
||||
import * as letterxpress from '@apiclient.xyz/letterxpress';
|
||||
|
@ -1 +1 @@
|
||||
export * from './classes.smsservice.js';
|
||||
export * from './smsservice.js';
|
@ -1,7 +1,7 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import * as paths from '../paths.js';
|
||||
import { logger } from '../logger.js';
|
||||
import type { SzPlatformService } from '../platformservice.js';
|
||||
import type { SzPlatformService } from '../classes.platformservice.js';
|
||||
|
||||
export interface ISmsConstructorOptions {
|
||||
apiGatewayApiToken: string;
|
Loading…
x
Reference in New Issue
Block a user