feat: Convert all app files to JS
This commit is contained in:
@@ -1,23 +1,24 @@
|
||||
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 Name',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
placeholder: null,
|
||||
description: 'Host name of your Odoo Server (e.g. sub.domain.com without the protocol)',
|
||||
description:
|
||||
'Host name of your Odoo Server (e.g. sub.domain.com without the protocol)',
|
||||
clickToCopy: false,
|
||||
},
|
||||
{
|
||||
key: 'port',
|
||||
label: 'Port',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: '443',
|
||||
@@ -28,7 +29,7 @@ export default {
|
||||
{
|
||||
key: 'secure',
|
||||
label: 'Secure',
|
||||
type: 'dropdown' as const,
|
||||
type: 'dropdown',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: 'true',
|
||||
@@ -49,7 +50,7 @@ export default {
|
||||
{
|
||||
key: 'databaseName',
|
||||
label: 'Database Name',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
@@ -60,27 +61,28 @@ export default {
|
||||
{
|
||||
key: 'email',
|
||||
label: 'Email Address',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
placeholder: null,
|
||||
description: 'Email Address of the account that will be interacting with the database',
|
||||
clickToCopy: false
|
||||
description:
|
||||
'Email Address of the account that will be interacting with the database',
|
||||
clickToCopy: false,
|
||||
},
|
||||
{
|
||||
key: 'apiKey',
|
||||
label: 'API Key',
|
||||
type: 'string' as const,
|
||||
type: 'string',
|
||||
required: true,
|
||||
readOnly: false,
|
||||
value: null,
|
||||
placeholder: null,
|
||||
description: 'API Key for your Odoo account',
|
||||
clickToCopy: false
|
||||
}
|
||||
clickToCopy: false,
|
||||
},
|
||||
],
|
||||
|
||||
verifyCredentials,
|
||||
isStillVerified
|
||||
isStillVerified,
|
||||
};
|
8
packages/backend/src/apps/odoo/auth/is-still-verified.js
Normal file
8
packages/backend/src/apps/odoo/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;
|
@@ -1,7 +1,6 @@
|
||||
import { IGlobalVariable } from '@automatisch/types';
|
||||
import { authenticate } from '../common/xmlrpc-client';
|
||||
import { authenticate } from '../common/xmlrpc-client.js';
|
||||
|
||||
const verifyCredentials = async ($: IGlobalVariable) => {
|
||||
const verifyCredentials = async ($) => {
|
||||
try {
|
||||
await authenticate($);
|
||||
|
||||
@@ -11,6 +10,6 @@ const verifyCredentials = async ($: IGlobalVariable) => {
|
||||
} catch (error) {
|
||||
throw new Error('Failed while authorizing!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
export default verifyCredentials;
|
Reference in New Issue
Block a user