Skip to content

Commit

Permalink
chore: add web-smtp-relay-client
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Aug 22, 2024
1 parent 4774a5b commit b5e8475
Show file tree
Hide file tree
Showing 8 changed files with 400 additions and 13 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/npmjs_publish.yaml
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}}
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,31 +125,31 @@ This project includes a Helm chart for easy deployment to Kubernetes clusters. T

1. If you don't want to install the chart you can use our public Helm repository:
```bash
```bash
helm repo add highcanfly <https://helm-repo.highcanfly.club/>
helm repo update highcanfly
helm repo add highcanfly <https://helm-repo.highcanfly.club/>
helm repo update highcanfly
```
```
Then install the chart:
Then install the chart:
```bash
helm upgrade --install --create-namespace --namespace web-smtp-relay web-smtp-relay highcanfly/web-smtp-relay --values values.yaml
```
```bash
helm upgrade --install --create-namespace --namespace web-smtp-relay web-smtp-relay highcanfly/web-smtp-relay --values values.yaml
```
2. Clone the repository or download the Helm chart files.
3. Navigate to the chart directory:
```bash
cd web-smtp-relay
```
```bash
cd web-smtp-relay
```
4. Install the chart with the release name `my-web-smtp-relay`:
```bash
helm install my-web-smtp-relay .
```bash
helm install my-web-smtp-relay .
```
### Customizing the Chart
Expand Down
115 changes: 115 additions & 0 deletions web-smtp-relay-client/.gitignore
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/
39 changes: 39 additions & 0 deletions web-smtp-relay-client/README.md
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).
111 changes: 111 additions & 0 deletions web-smtp-relay-client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions web-smtp-relay-client/package.json
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/**/*"
]
}
Loading

0 comments on commit b5e8475

Please sign in to comment.