feat: Convert all app files to JS

This commit is contained in:
Faruk AYDIN
2024-01-05 17:44:21 +01:00
parent b95478b635
commit 43dba351c3
1030 changed files with 5114 additions and 6436 deletions

View File

@@ -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: 'version',
label: 'PostgreSQL version',
type: 'string' as const,
type: 'string',
required: true,
readOnly: false,
value: null,
@@ -18,7 +18,7 @@ export default {
{
key: 'host',
label: 'Host',
type: 'string' as const,
type: 'string',
required: true,
readOnly: false,
value: '127.0.0.1',
@@ -29,7 +29,7 @@ export default {
{
key: 'port',
label: 'Port',
type: 'string' as const,
type: 'string',
required: true,
readOnly: false,
value: '5432',
@@ -40,7 +40,7 @@ export default {
{
key: 'enableSsl',
label: 'Enable SSL',
type: 'dropdown' as const,
type: 'dropdown',
required: true,
readOnly: false,
value: 'false',
@@ -61,7 +61,7 @@ export default {
{
key: 'database',
label: 'Database name',
type: 'string' as const,
type: 'string',
required: true,
readOnly: false,
value: null,
@@ -72,7 +72,7 @@ export default {
{
key: 'user',
label: 'Database username',
type: 'string' as const,
type: 'string',
required: true,
readOnly: false,
value: null,
@@ -83,7 +83,7 @@ export default {
{
key: 'password',
label: 'Password',
type: 'string' as const,
type: 'string',
required: true,
readOnly: false,
value: null,

View File

@@ -0,0 +1,9 @@
import verifyCredentials from './verify-credentials.js';
const isStillVerified = async ($) => {
await verifyCredentials($);
return true;
};
export default isStillVerified;

View File

@@ -1,10 +0,0 @@
import { IGlobalVariable } from '@automatisch/types';
import verifyCredentials from './verify-credentials';
const isStillVerified = async ($: IGlobalVariable) => {
await verifyCredentials($);
return true;
};
export default isStillVerified;

View File

@@ -1,8 +1,7 @@
import { IGlobalVariable } from '@automatisch/types';
import logger from '../../../helpers/logger';
import getClient from '../common/postgres-client';
import logger from '../../../helpers/logger.js';
import getClient from '../common/postgres-client.js';
const verifyCredentials = async ($: IGlobalVariable) => {
const verifyCredentials = async ($) => {
const client = getClient($);
const checkConnection = await client.raw('SELECT 1');
client.destroy();