feat: Convert all app files to JS
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
import verifyCredentials from './verify-credentials';
|
||||
import isStillVerified from './is-still-verified';
|
||||
import verifyCredentials from './verify-credentials.js';
|
||||
import isStillVerified from './is-still-verified.js';
|
||||
|
||||
export default {
|
||||
fields: [
|
||||
{
|
||||
key: 'host',
|
||||
label: 'Host',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
@@ -18,7 +18,7 @@ export default {
|
||||
{
|
||||
key: 'username',
|
||||
label: 'Email/Username',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
@@ -30,7 +30,7 @@ export default {
|
||||
{
|
||||
key: 'password',
|
||||
label: 'Password',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
@@ -42,7 +42,7 @@ export default {
|
||||
{
|
||||
key: 'useTls',
|
||||
label: 'Use TLS?',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: false,
|
||||
readOnly: false,
|
||||
value: false,
|
||||
@@ -64,7 +64,7 @@ export default {
|
||||
{
|
||||
key: 'port',
|
||||
label: 'Port',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
readOnly: false,
|
||||
value: '25',
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
{
|
||||
key: 'fromEmail',
|
||||
label: 'From Email',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: false,
|
||||
readOnly: false,
|
||||
value: null,
|
8
packages/backend/src/apps/smtp/auth/is-still-verified.js
Normal file
8
packages/backend/src/apps/smtp/auth/is-still-verified.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import verifyCredentials from './verify-credentials.js';
|
||||
|
||||
const isStillVerified = async ($) => {
|
||||
await verifyCredentials($);
|
||||
return true;
|
||||
};
|
||||
|
||||
export default isStillVerified;
|
@@ -1,9 +0,0 @@
|
||||
import { IGlobalVariable } from '@automatisch/types';
|
||||
import verifyCredentials from './verify-credentials';
|
||||
|
||||
const isStillVerified = async ($: IGlobalVariable) => {
|
||||
await verifyCredentials($);
|
||||
return true;
|
||||
};
|
||||
|
||||
export default isStillVerified;
|
11
packages/backend/src/apps/smtp/auth/verify-credentials.js
Normal file
11
packages/backend/src/apps/smtp/auth/verify-credentials.js
Normal file
@@ -0,0 +1,11 @@
|
||||
import transporter from '../common/transporter.js';
|
||||
|
||||
const verifyCredentials = async ($) => {
|
||||
await transporter($).verify();
|
||||
|
||||
await $.auth.set({
|
||||
screenName: $.auth.data.username,
|
||||
});
|
||||
};
|
||||
|
||||
export default verifyCredentials;
|
@@ -1,12 +0,0 @@
|
||||
import { IGlobalVariable } from '@automatisch/types';
|
||||
import transporter from '../common/transporter';
|
||||
|
||||
const verifyCredentials = async ($: IGlobalVariable) => {
|
||||
await transporter($).verify();
|
||||
|
||||
await $.auth.set({
|
||||
screenName: $.auth.data.username,
|
||||
});
|
||||
};
|
||||
|
||||
export default verifyCredentials;
|
Reference in New Issue
Block a user