-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
400 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages | ||
|
||
name: Publish @sctg/web-smtp-relay-client to NPMJS | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
- run: cd web-smtp-relay-client | ||
- run: npm ci | ||
- run: npm run build | ||
- run: npm test | ||
|
||
publish-npm: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: cd web-smtp-relay-client | ||
- run: npm ci | ||
- run: npm run build | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPMJS_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional stylelint cache | ||
.stylelintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
.env.test | ||
.env.production | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# VS Code directories | ||
.vscode/ | ||
.history/ | ||
|
||
# SvelteKit build / generate output | ||
.svelte-kit | ||
|
||
# Temporary folders | ||
tmp/ | ||
temp/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# @sctg/web-smtp-relay-client | ||
|
||
A simple client for the web-smtp-relay server. | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @sctg/web-smtp-relay-client | ||
``` | ||
|
||
## Usage | ||
|
||
```typescript | ||
import { WebSMTPRelayClient, WebSMTPRelayConfig, EmailMessage } from '@sctg/web-smtp-relay-client'; | ||
|
||
const config: WebSMTPRelayConfig = { | ||
scheme: 'https', | ||
host: 'localhost', | ||
port: 8080, | ||
username: 'admin', | ||
password: 'admin123' | ||
}; | ||
|
||
const client = new WebSMTPRelayClient(config); | ||
|
||
const message: EmailMessage = { | ||
subject: 'Test Subject', | ||
body: 'This is a test email', | ||
destinations: ['[email protected]'] | ||
}; | ||
|
||
client.sendEmail(message) | ||
.then(() => console.log('Email sent successfully')) | ||
.catch((error) => console.error('Error sending email:', error)); | ||
``` | ||
|
||
## License | ||
|
||
This project is licensed under the GNU Affero General Public License v3.0 (AGPLv3). |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "@sctg/web-smtp-relay-client", | ||
"version": "1.0.0", | ||
"description": "A simple client for the web-smtp-relay server", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"private": false, | ||
"scripts": { | ||
"build": "tsc", | ||
"prepublishOnly": "npm run build" | ||
}, | ||
"keywords": ["smtp", "relay", "client"], | ||
"author": "Ronan LE MEILLAT", | ||
"license": "AGPL-3.0", | ||
"devDependencies": { | ||
"typescript": "^5.5.4", | ||
"@types/node": "^20", | ||
"@babel/parser": "^7.25.4", | ||
"@babel/types":"^7.25.4" | ||
}, | ||
"files": [ | ||
"dist/**/*" | ||
] | ||
} |
Oops, something went wrong.