feat(cli): run migrations and app in start command (#284)
* feat: perform pending migrations in start command * feat: log error when DB connection is refused * feat: log error when Redis connection is refused * refactor: fix type errors * fix: correct server and copy graphql schema * fix: differentiate migrations by env * chore: remove dev executable * chore: fix typo in default postgresUsername * fix: copy json files into dist folder * chore(cli): add dev script * chore: pull non-dev logs to info level * feat(cli): run app in start command * fix(backend): remove default count in Connection * fix(cli): remove .eslintrc usage in lint script * refactor: remove disableMigrationsListValidation * refactor: make Step optional in ExecutionStep * refactor: make Flow optional in Step
This commit is contained in:
@@ -22,6 +22,8 @@ const createAuthData = async (
|
||||
const appClass = (await import(`../../apps/${connection.key}`)).default;
|
||||
const appData = App.findOneByKey(connection.key);
|
||||
|
||||
if (!connection.formattedData) { return null; }
|
||||
|
||||
const appInstance = new appClass(appData, {
|
||||
consumerKey: connection.formattedData.consumerKey,
|
||||
consumerSecret: connection.formattedData.consumerSecret,
|
||||
|
@@ -19,6 +19,8 @@ const deleteStep = async (
|
||||
})
|
||||
.throwIfNotFound();
|
||||
|
||||
if (!step) return;
|
||||
|
||||
await step.$query().delete();
|
||||
|
||||
const nextSteps = await step.flow
|
||||
|
@@ -18,6 +18,8 @@ const resetConnection = async (
|
||||
})
|
||||
.throwIfNotFound();
|
||||
|
||||
if (!connection.formattedData) { return null; }
|
||||
|
||||
connection = await connection.$query().patchAndFetch({
|
||||
formattedData: { screenName: connection.formattedData.screenName },
|
||||
});
|
||||
|
@@ -26,10 +26,13 @@ const getConnectedApps = async (
|
||||
.filter((app: IApp) => connectionKeys.includes(app.key))
|
||||
.map((app: IApp) => {
|
||||
const connection = connections.find(
|
||||
(connection: IConnection) => connection.key === app.key
|
||||
(connection) => (connection as IConnection).key === app.key
|
||||
);
|
||||
|
||||
app.connectionCount = connection.count;
|
||||
if (connection) {
|
||||
app.connectionCount = connection.count;
|
||||
}
|
||||
|
||||
return app;
|
||||
});
|
||||
|
||||
|
@@ -12,8 +12,12 @@ const getData = async (_parent: unknown, params: Params, context: Context) => {
|
||||
.withGraphFetched('connection')
|
||||
.findById(params.stepId);
|
||||
|
||||
if (!step) return null;
|
||||
|
||||
const connection = step.connection;
|
||||
|
||||
if (!connection || !step.appKey) return null;
|
||||
|
||||
const appData = App.findOneByKey(step.appKey);
|
||||
const AppClass = (await import(`../../apps/${step.appKey}`)).default;
|
||||
|
||||
|
Reference in New Issue
Block a user