chore: Update objectionjs version to 3
This commit is contained in:

committed by
Ömer Faruk Aydın

parent
61c1f3a300
commit
70bb79ab6c
@@ -34,7 +34,7 @@
|
||||
"knex": "^0.95.11",
|
||||
"morgan": "^1.10.0",
|
||||
"nodemailer": "6.7.0",
|
||||
"objection": "^2.2.17",
|
||||
"objection": "^3.0.0",
|
||||
"pg": "^8.7.1",
|
||||
"twilio": "3.70.0",
|
||||
"twitch-js": "2.0.0-beta.42",
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import Step from '../../models/step';
|
||||
import flowType, { flowInputType} from '../types/flow';
|
||||
import flowType, { flowInputType } from '../types/flow';
|
||||
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
|
||||
import StepEnumType from '../../types/step-enum-type';
|
||||
|
||||
type Params = {
|
||||
input: {
|
||||
@@ -8,7 +9,10 @@ type Params = {
|
||||
};
|
||||
};
|
||||
|
||||
const createFlowResolver = async (params: Params, req: RequestWithCurrentUser) => {
|
||||
const createFlowResolver = async (
|
||||
params: Params,
|
||||
req: RequestWithCurrentUser
|
||||
) => {
|
||||
const appKey = params?.input?.triggerAppKey;
|
||||
|
||||
const flow = await req.currentUser.$relatedQuery('flows').insert({
|
||||
@@ -17,7 +21,7 @@ const createFlowResolver = async (params: Params, req: RequestWithCurrentUser) =
|
||||
|
||||
await Step.query().insert({
|
||||
flowId: flow.id,
|
||||
type: 'trigger',
|
||||
type: StepEnumType.Trigger,
|
||||
position: 1,
|
||||
appKey,
|
||||
});
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import { GraphQLNonNull } from 'graphql';
|
||||
import stepType, { stepInputType } from '../types/step';
|
||||
import RequestWithCurrentUser from '../../types/express/request-with-current-user';
|
||||
import StepEnumType from '../../types/step-enum-type';
|
||||
|
||||
type Params = {
|
||||
input: {
|
||||
@@ -41,7 +42,7 @@ const createStepResolver = async (
|
||||
const step = await flow.$relatedQuery('steps').insertAndFetch({
|
||||
key: input.key,
|
||||
appKey: input.appKey,
|
||||
type: 'action',
|
||||
type: StepEnumType.Action,
|
||||
position: previousStep.position + 1,
|
||||
});
|
||||
|
||||
|
@@ -8,7 +8,7 @@ type Params = {
|
||||
id: string;
|
||||
key: string;
|
||||
appKey: string;
|
||||
parameters: string;
|
||||
parameters: Record<string, unknown>;
|
||||
flow: {
|
||||
id: string;
|
||||
};
|
||||
|
@@ -61,7 +61,7 @@ export const stepInputType = new GraphQLInputObjectType({
|
||||
},
|
||||
}),
|
||||
},
|
||||
parameters: { type: GraphQLString },
|
||||
parameters: { type: GraphQLJSONObject },
|
||||
previousStep: {
|
||||
type: new GraphQLInputObjectType({
|
||||
name: 'PreviousStepInput',
|
||||
|
@@ -4,7 +4,7 @@ import ExecutionStep from './execution-step';
|
||||
|
||||
class Execution extends Base {
|
||||
id!: string;
|
||||
flowId!: number;
|
||||
flowId!: string;
|
||||
testRun: boolean;
|
||||
executionSteps: ExecutionStep[];
|
||||
|
||||
|
@@ -2,22 +2,18 @@ import Base from './base';
|
||||
import Flow from './flow';
|
||||
import Connection from './connection';
|
||||
import ExecutionStep from './execution-step';
|
||||
|
||||
enum StepEnumType {
|
||||
'trigger',
|
||||
'action',
|
||||
}
|
||||
import StepEnumType from '../types/step-enum-type';
|
||||
|
||||
class Step extends Base {
|
||||
id!: number;
|
||||
flowId!: number;
|
||||
flowId!: string;
|
||||
key: string;
|
||||
appKey: string;
|
||||
type!: StepEnumType;
|
||||
connectionId: string;
|
||||
status: string;
|
||||
position: number;
|
||||
parameters: string;
|
||||
parameters: Record<string, unknown>;
|
||||
connection?: Connection;
|
||||
flow?: Flow;
|
||||
executionSteps?: [ExecutionStep];
|
||||
@@ -30,14 +26,14 @@ class Step extends Base {
|
||||
|
||||
properties: {
|
||||
id: { type: 'integer' },
|
||||
flowId: { type: 'integer' },
|
||||
flowId: { type: 'string' },
|
||||
key: { type: ['string', null] },
|
||||
appKey: { type: ['string', null], minLength: 1, maxLength: 255 },
|
||||
type: { type: 'string', enum: ['action', 'trigger'] },
|
||||
connectionId: { type: ['string', null] },
|
||||
status: { type: 'string', enum: ['incomplete', 'completed'] },
|
||||
position: { type: 'integer' },
|
||||
parameters: { type: ['string', null] },
|
||||
parameters: { type: ['object', null] },
|
||||
},
|
||||
};
|
||||
|
||||
|
6
packages/backend/src/types/step-enum-type.ts
Normal file
6
packages/backend/src/types/step-enum-type.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
enum StepEnumType {
|
||||
Trigger = 'trigger',
|
||||
Action = 'action',
|
||||
}
|
||||
|
||||
export default StepEnumType;
|
Reference in New Issue
Block a user