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,8 +1,7 @@
import { TBeforeRequest } from '@automatisch/types';
import jwt from 'jsonwebtoken';
const addAuthHeader: TBeforeRequest = ($, requestConfig) => {
const key = $.auth.data?.apiKey as string;
const addAuthHeader = ($, requestConfig) => {
const key = $.auth.data?.apiKey;
if (key) {
const [id, secret] = key.split(':');

View File

@@ -0,0 +1,10 @@
const setBaseUrl = ($, requestConfig) => {
const instanceUrl = $.auth.data.instanceUrl;
if (instanceUrl) {
requestConfig.baseURL = `${instanceUrl}/ghost/api`;
}
return requestConfig;
};
export default setBaseUrl;

View File

@@ -1,12 +0,0 @@
import { TBeforeRequest } from '@automatisch/types';
const setBaseUrl: TBeforeRequest = ($, requestConfig) => {
const instanceUrl = $.auth.data.instanceUrl as string;
if (instanceUrl) {
requestConfig.baseURL = `${instanceUrl}/ghost/api`;
}
return requestConfig;
};
export default setBaseUrl;