refactor: Setup typescript project references across workflow, core, and cli (#4519)

* refactor: use consistent folder structure across workflow, core, and cli

* setup typescript project references across workflow, core, and cli
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2022-11-09 15:25:00 +01:00
committed by GitHub
parent de96def372
commit 698d96a617
251 changed files with 1284 additions and 1134 deletions

View File

@@ -1,4 +1,3 @@
/* eslint-disable import/no-cycle */
import ClientOAuth2 from 'client-oauth2';
import Csrf from 'csrf';
import express from 'express';
@@ -17,18 +16,20 @@ import {
} from 'n8n-workflow';
import { resolve as pathResolve } from 'path';
import { Db, ICredentialsDb, ResponseHelper } from '..';
import { RESPONSE_ERROR_MESSAGES } from '../constants';
import * as Db from '@/Db';
import * as ResponseHelper from '@/ResponseHelper';
import { ICredentialsDb } from '@/Interfaces';
import { RESPONSE_ERROR_MESSAGES, TEMPLATES_DIR } from '@/constants';
import {
CredentialsHelper,
getCredentialForUser,
getCredentialWithoutUser,
} from '../CredentialsHelper';
import { getLogger } from '../Logger';
import { OAuthRequest } from '../requests';
import { externalHooks } from '../Server';
import config from '../../config';
import { getInstanceBaseUrl } from '../UserManagement/UserManagementHelper';
} from '@/CredentialsHelper';
import { getLogger } from '@/Logger';
import { OAuthRequest } from '@/requests';
import { externalHooks } from '@/Server';
import config from '@/config';
import { getInstanceBaseUrl } from '@/UserManagement/UserManagementHelper';
export const oauth2CredentialController = express.Router();
@@ -334,7 +335,7 @@ oauth2CredentialController.get(
credentialId: state.cid,
});
return res.sendFile(pathResolve(__dirname, '../../../templates/oauth-callback.html'));
return res.sendFile(pathResolve(TEMPLATES_DIR, 'oauth-callback.html'));
} catch (error) {
// Error response
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument