chore: Use string IDs instead of integer ones

This commit is contained in:
Faruk AYDIN
2022-01-29 13:59:52 +03:00
committed by Ömer Faruk Aydın
parent 86d5cceec7
commit c6e2b94128
27 changed files with 157 additions and 135 deletions

View File

@@ -1,10 +1,9 @@
import { GraphQLNonNull, GraphQLInt } from 'graphql'; import { GraphQLNonNull, GraphQLString } from 'graphql';
import Connection from '../../models/connection';
import authLinkType from '../types/auth-link'; import authLinkType from '../types/auth-link';
import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import RequestWithCurrentUser from '../../types/express/request-with-current-user';
type Params = { type Params = {
id: number; id: string;
}; };
const createAuthDataResolver = async ( const createAuthDataResolver = async (
@@ -40,7 +39,7 @@ const createAuthDataResolver = async (
const createAuthData = { const createAuthData = {
type: authLinkType, type: authLinkType,
args: { args: {
id: { type: GraphQLNonNull(GraphQLInt) }, id: { type: GraphQLNonNull(GraphQLString) },
}, },
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => resolve: (_: any, params: Params, req: RequestWithCurrentUser) =>
createAuthDataResolver(params, req), createAuthDataResolver(params, req),

View File

@@ -3,7 +3,7 @@ import flowType from '../types/flow';
import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import RequestWithCurrentUser from '../../types/express/request-with-current-user';
const createFlowResolver = async (req: RequestWithCurrentUser) => { const createFlowResolver = async (req: RequestWithCurrentUser) => {
const flow = await req.currentUser.$relatedQuery('flows').insert(); const flow = await req.currentUser.$relatedQuery('flows').insert({});
await Step.query().insert({ await Step.query().insert({
flowId: flow.id, flowId: flow.id,

View File

@@ -1,8 +1,8 @@
import { GraphQLInt, GraphQLNonNull, GraphQLBoolean } from 'graphql'; import { GraphQLString, GraphQLNonNull, GraphQLBoolean } from 'graphql';
import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import RequestWithCurrentUser from '../../types/express/request-with-current-user';
type Params = { type Params = {
id: number; id: string;
data: object; data: object;
}; };
const deleteConnectionResolver = async ( const deleteConnectionResolver = async (
@@ -23,7 +23,7 @@ const deleteConnectionResolver = async (
const deleteConnection = { const deleteConnection = {
type: GraphQLBoolean, type: GraphQLBoolean,
args: { args: {
id: { type: GraphQLNonNull(GraphQLInt) }, id: { type: GraphQLNonNull(GraphQLString) },
}, },
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => resolve: (_: any, params: Params, req: RequestWithCurrentUser) =>
deleteConnectionResolver(params, req), deleteConnectionResolver(params, req),

View File

@@ -1,9 +1,9 @@
import { GraphQLInt, GraphQLNonNull, GraphQLBoolean } from 'graphql'; import { GraphQLString, GraphQLNonNull, GraphQLBoolean } from 'graphql';
import Step from '../../models/step'; import Step from '../../models/step';
import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import RequestWithCurrentUser from '../../types/express/request-with-current-user';
type Params = { type Params = {
id: number; id: string;
}; };
const deleteStepResolver = async ( const deleteStepResolver = async (
@@ -24,7 +24,7 @@ const deleteStepResolver = async (
const deleteStep = { const deleteStep = {
type: GraphQLBoolean, type: GraphQLBoolean,
args: { args: {
id: { type: GraphQLNonNull(GraphQLInt) }, id: { type: GraphQLNonNull(GraphQLString) },
}, },
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => resolve: (_: any, params: Params, req: RequestWithCurrentUser) =>
deleteStepResolver(params, req), deleteStepResolver(params, req),

View File

@@ -1,34 +1,38 @@
import { GraphQLInt, GraphQLNonNull } from 'graphql'; import { GraphQLString, GraphQLNonNull } from 'graphql';
import Connection from '../../models/connection'; import Connection from '../../models/connection';
import Step from '../../models/step'; import Step from '../../models/step';
import stepType from '../types/step'; import stepType from '../types/step';
type Params = { type Params = {
id: number, id: string;
data: Record<string, unknown> data: Record<string, unknown>;
} };
const executeStepResolver = async (params: Params): Promise<any> => { const executeStepResolver = async (params: Params): Promise<any> => {
const step = await Step.query().findOne({ const step = await Step.query()
id: params.id .findOne({
}).throwIfNotFound(); id: params.id,
})
.throwIfNotFound();
const connection = await Connection.query().findOne({ const connection = await Connection.query()
id: step.connectionId .findOne({
}).throwIfNotFound(); id: step.connectionId,
})
.throwIfNotFound();
const appClass = (await import(`../../apps/${step.appKey}`)).default; const appClass = (await import(`../../apps/${step.appKey}`)).default;
const appInstance = new appClass(connection.data); const appInstance = new appClass(connection.data);
await appInstance.triggers[step.key].run(); await appInstance.triggers[step.key].run();
return step; return step;
} };
const executeStep = { const executeStep = {
type: stepType, type: stepType,
args: { args: {
id: { type: GraphQLNonNull(GraphQLInt) } id: { type: GraphQLNonNull(GraphQLString) },
}, },
resolve: (_: any, params: Params) => executeStepResolver(params) resolve: (_: any, params: Params) => executeStepResolver(params),
}; };
export default executeStep; export default executeStep;

View File

@@ -1,9 +1,9 @@
import { GraphQLInt, GraphQLNonNull } from 'graphql'; import { GraphQLString, GraphQLNonNull } from 'graphql';
import connectionType from '../types/connection'; import connectionType from '../types/connection';
import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import RequestWithCurrentUser from '../../types/express/request-with-current-user';
type Params = { type Params = {
id: number; id: string;
}; };
const resetConnectionResolver = async ( const resetConnectionResolver = async (
@@ -27,7 +27,7 @@ const resetConnectionResolver = async (
const resetConnection = { const resetConnection = {
type: connectionType, type: connectionType,
args: { args: {
id: { type: GraphQLNonNull(GraphQLInt) }, id: { type: GraphQLNonNull(GraphQLString) },
}, },
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => resolve: (_: any, params: Params, req: RequestWithCurrentUser) =>
resetConnectionResolver(params, req), resetConnectionResolver(params, req),

View File

@@ -1,12 +1,13 @@
import { GraphQLInt, GraphQLNonNull } from 'graphql'; import { GraphQLString, GraphQLNonNull } from 'graphql';
import { GraphQLJSONObject } from 'graphql-type-json'; import { GraphQLJSONObject } from 'graphql-type-json';
import connectionType from '../types/connection'; import connectionType from '../types/connection';
import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import RequestWithCurrentUser from '../../types/express/request-with-current-user';
type Params = { type Params = {
id: number; id: string;
data: object; data: object;
}; };
const updateConnectionResolver = async ( const updateConnectionResolver = async (
params: Params, params: Params,
req: RequestWithCurrentUser req: RequestWithCurrentUser
@@ -31,7 +32,7 @@ const updateConnectionResolver = async (
const updateConnection = { const updateConnection = {
type: connectionType, type: connectionType,
args: { args: {
id: { type: GraphQLNonNull(GraphQLInt) }, id: { type: GraphQLNonNull(GraphQLString) },
data: { type: GraphQLNonNull(GraphQLJSONObject) }, data: { type: GraphQLNonNull(GraphQLJSONObject) },
}, },
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => resolve: (_: any, params: Params, req: RequestWithCurrentUser) =>

View File

@@ -1,11 +1,12 @@
import { GraphQLInt, GraphQLString, GraphQLNonNull } from 'graphql'; import { GraphQLString, GraphQLNonNull } from 'graphql';
import flowType from '../types/flow'; import flowType from '../types/flow';
import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import RequestWithCurrentUser from '../../types/express/request-with-current-user';
type Params = { type Params = {
id: number; id: string;
name: string; name: string;
}; };
const updateFlowResolver = async ( const updateFlowResolver = async (
params: Params, params: Params,
req: RequestWithCurrentUser req: RequestWithCurrentUser
@@ -28,7 +29,7 @@ const updateFlowResolver = async (
const updateFlow = { const updateFlow = {
type: flowType, type: flowType,
args: { args: {
id: { type: GraphQLNonNull(GraphQLInt) }, id: { type: GraphQLNonNull(GraphQLString) },
name: { type: GraphQLNonNull(GraphQLString) }, name: { type: GraphQLNonNull(GraphQLString) },
}, },
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => resolve: (_: any, params: Params, req: RequestWithCurrentUser) =>

View File

@@ -5,15 +5,15 @@ import RequestWithCurrentUser from '../../types/express/request-with-current-use
type Params = { type Params = {
input: { input: {
id: number; id: string;
key: string; key: string;
appKey: string; appKey: string;
parameters: string; parameters: string;
flow: { flow: {
id: number; id: string;
}; };
connection: { connection: {
id: number; id: string;
}; };
}; };
}; };

View File

@@ -1,10 +1,11 @@
import { GraphQLInt, GraphQLNonNull } from 'graphql'; import { GraphQLString, GraphQLNonNull } from 'graphql';
import connectionType from '../types/connection'; import connectionType from '../types/connection';
import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import RequestWithCurrentUser from '../../types/express/request-with-current-user';
type Params = { type Params = {
id: number; id: string;
}; };
const verifyConnectionResolver = async ( const verifyConnectionResolver = async (
params: Params, params: Params,
req: RequestWithCurrentUser req: RequestWithCurrentUser
@@ -36,7 +37,7 @@ const verifyConnectionResolver = async (
const verifyConnection = { const verifyConnection = {
type: connectionType, type: connectionType,
args: { args: {
id: { type: GraphQLNonNull(GraphQLInt) }, id: { type: GraphQLNonNull(GraphQLString) },
}, },
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => resolve: (_: any, params: Params, req: RequestWithCurrentUser) =>
verifyConnectionResolver(params, req), verifyConnectionResolver(params, req),

View File

@@ -1,9 +1,9 @@
import { GraphQLNonNull, GraphQLInt } from 'graphql'; import { GraphQLNonNull, GraphQLString } from 'graphql';
import RequestWithCurrentUser from '../../types/express/request-with-current-user'; import RequestWithCurrentUser from '../../types/express/request-with-current-user';
import flowType from '../types/flow'; import flowType from '../types/flow';
type Params = { type Params = {
id: number; id: string;
}; };
const getFlowResolver = async (params: Params, req: RequestWithCurrentUser) => { const getFlowResolver = async (params: Params, req: RequestWithCurrentUser) => {
@@ -20,7 +20,7 @@ const getFlowResolver = async (params: Params, req: RequestWithCurrentUser) => {
const getFlow = { const getFlow = {
type: flowType, type: flowType,
args: { args: {
id: { type: GraphQLNonNull(GraphQLInt) }, id: { type: GraphQLNonNull(GraphQLString) },
}, },
resolve: (_: any, params: Params, req: RequestWithCurrentUser) => resolve: (_: any, params: Params, req: RequestWithCurrentUser) =>
getFlowResolver(params, req), getFlowResolver(params, req),

View File

@@ -1,4 +1,4 @@
import { GraphQLObjectType, GraphQLString, GraphQLBoolean, GraphQLInt } from 'graphql'; import { GraphQLObjectType, GraphQLString, GraphQLBoolean } from 'graphql';
import connectionDataType from './connection-data'; import connectionDataType from './connection-data';
const connectionType = new GraphQLObjectType({ const connectionType = new GraphQLObjectType({
@@ -8,14 +8,14 @@ const connectionType = new GraphQLObjectType({
const appType = require('./app').default; const appType = require('./app').default;
return { return {
id: { type: GraphQLInt }, id: { type: GraphQLString },
key: { type: GraphQLString }, key: { type: GraphQLString },
data: { type: connectionDataType }, data: { type: connectionDataType },
verified: { type: GraphQLBoolean }, verified: { type: GraphQLBoolean },
app: { type: appType }, app: { type: appType },
createdAt: { type: GraphQLString } createdAt: { type: GraphQLString },
} };
} },
}) });
export default connectionType; export default connectionType;

View File

@@ -1,16 +1,21 @@
import { GraphQLList, GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLBoolean } from 'graphql'; import {
GraphQLList,
GraphQLObjectType,
GraphQLString,
GraphQLBoolean,
} from 'graphql';
import StepType from './step'; import StepType from './step';
const flowType = new GraphQLObjectType({ const flowType = new GraphQLObjectType({
name: 'Flow', name: 'Flow',
fields: { fields: {
id: { type: GraphQLInt }, id: { type: GraphQLString },
name: { type: GraphQLString }, name: { type: GraphQLString },
active: { type: GraphQLBoolean }, active: { type: GraphQLBoolean },
steps: { steps: {
type: GraphQLList(StepType), type: GraphQLList(StepType),
} },
} },
}) });
export default flowType; export default flowType;

View File

@@ -10,8 +10,8 @@ import ConnectionType from './connection';
const stepType = new GraphQLObjectType({ const stepType = new GraphQLObjectType({
name: 'Step', name: 'Step',
fields: { fields: {
id: { type: GraphQLInt }, id: { type: GraphQLString },
previousStepId: { type: GraphQLInt }, previousStepId: { type: GraphQLString },
key: { type: GraphQLString }, key: { type: GraphQLString },
appKey: { type: GraphQLString }, appKey: { type: GraphQLString },
type: { type: {
@@ -32,15 +32,15 @@ const stepType = new GraphQLObjectType({
export const stepInputType = new GraphQLInputObjectType({ export const stepInputType = new GraphQLInputObjectType({
name: 'StepInput', name: 'StepInput',
fields: { fields: {
id: { type: GraphQLInt }, id: { type: GraphQLString },
previousStepId: { type: GraphQLInt }, previousStepId: { type: GraphQLString },
key: { type: GraphQLString }, key: { type: GraphQLString },
appKey: { type: GraphQLString }, appKey: { type: GraphQLString },
connection: { connection: {
type: new GraphQLInputObjectType({ type: new GraphQLInputObjectType({
name: 'StepConnectionInput', name: 'StepConnectionInput',
fields: { fields: {
id: { type: GraphQLInt }, id: { type: GraphQLString },
}, },
}), }),
}, },
@@ -48,7 +48,7 @@ export const stepInputType = new GraphQLInputObjectType({
type: new GraphQLInputObjectType({ type: new GraphQLInputObjectType({
name: 'StepFlowInput', name: 'StepFlowInput',
fields: { fields: {
id: { type: GraphQLInt }, id: { type: GraphQLString },
}, },
}), }),
}, },
@@ -57,7 +57,7 @@ export const stepInputType = new GraphQLInputObjectType({
type: new GraphQLInputObjectType({ type: new GraphQLInputObjectType({
name: 'PreviousStepInput', name: 'PreviousStepInput',
fields: { fields: {
id: { type: GraphQLInt }, id: { type: GraphQLString },
}, },
}), }),
}, },

View File

@@ -1,13 +1,13 @@
import { GraphQLObjectType, GraphQLString, GraphQLInt } from 'graphql'; import { GraphQLObjectType, GraphQLString } from 'graphql';
const userType = new GraphQLObjectType({ const userType = new GraphQLObjectType({
name: 'User', name: 'User',
fields: { fields: {
id: { type: GraphQLInt }, id: { type: GraphQLString },
email: { type: GraphQLString }, email: { type: GraphQLString },
createdAt: { type: GraphQLString }, createdAt: { type: GraphQLString },
updatedAt: { type: GraphQLString } updatedAt: { type: GraphQLString },
} },
}) });
export default userType; export default userType;

View File

@@ -1,23 +1,23 @@
import { QueryContext, ModelOptions } from 'objection'; import { QueryContext, ModelOptions } from 'objection';
import type { RelationMappings } from 'objection'; import type { RelationMappings } from 'objection';
import { AES, enc } from 'crypto-js'; import { AES, enc } from 'crypto-js';
import Base from './base' import Base from './base';
import User from './user' import User from './user';
import appConfig from '../config/app'; import appConfig from '../config/app';
class Connection extends Base { class Connection extends Base {
id!: number id!: number;
key!: string key!: string;
data!: any data!: any;
userId!: number userId!: number;
verified: boolean verified: boolean;
count: number count: number;
static tableName = 'connections'; static tableName = 'connections';
static jsonSchema = { static jsonSchema = {
type: 'object', type: 'object',
required: ['key', 'data', 'userId'], required: ['key', 'data'],
properties: { properties: {
id: { type: 'integer' }, id: { type: 'integer' },
@@ -25,8 +25,8 @@ class Connection extends Base {
data: { type: 'object' }, data: { type: 'object' },
userId: { type: 'integer' }, userId: { type: 'integer' },
verified: { type: 'boolean' }, verified: { type: 'boolean' },
} },
} };
static relationMappings = (): RelationMappings => ({ static relationMappings = (): RelationMappings => ({
user: { user: {
@@ -36,21 +36,26 @@ class Connection extends Base {
from: 'connections.user_id', from: 'connections.user_id',
to: 'users.id', to: 'users.id',
}, },
} },
}) });
encryptData(): void { encryptData(): void {
if(!this.eligibleForEncryption()) return; if (!this.eligibleForEncryption()) return;
this.data = AES.encrypt(JSON.stringify(this.data), appConfig.encryptionKey).toString(); this.data = AES.encrypt(
JSON.stringify(this.data),
appConfig.encryptionKey
).toString();
} }
decryptData(): void { decryptData(): void {
if(!this.eligibleForEncryption()) return; if (!this.eligibleForEncryption()) return;
this.data = JSON.parse(AES.decrypt(this.data, appConfig.encryptionKey).toString(enc.Utf8)); this.data = JSON.parse(
AES.decrypt(this.data, appConfig.encryptionKey).toString(enc.Utf8)
);
} }
eligibleForEncryption(): boolean { eligibleForEncryption(): boolean {
return this.data ? true : false return this.data ? true : false;
} }
// TODO: Make another abstraction like beforeSave instead of using // TODO: Make another abstraction like beforeSave instead of using
@@ -60,7 +65,10 @@ class Connection extends Base {
this.encryptData(); this.encryptData();
} }
async $beforeUpdate(opt: ModelOptions, queryContext: QueryContext): Promise<void> { async $beforeUpdate(
opt: ModelOptions,
queryContext: QueryContext
): Promise<void> {
await super.$beforeUpdate(opt, queryContext); await super.$beforeUpdate(opt, queryContext);
this.encryptData(); this.encryptData();
} }

View File

@@ -27,7 +27,7 @@ class Step extends Base {
id: { type: 'integer' }, id: { type: 'integer' },
flowId: { type: 'integer' }, flowId: { type: 'integer' },
key: { type: ['string', null] }, key: { type: ['string', null] },
appKey: { type: 'string', minLength: 1, maxLength: 255 }, appKey: { type: ['string', null], minLength: 1, maxLength: 255 },
type: { type: 'string', enum: ['action', 'trigger'] }, type: { type: 'string', enum: ['action', 'trigger'] },
connectionId: { type: ['integer', null] }, connectionId: { type: ['integer', null] },
position: { type: 'integer' }, position: { type: 'integer' },

View File

@@ -14,13 +14,10 @@ import type { Step } from 'types/step';
type EditorProps = { type EditorProps = {
flow: Flow; flow: Flow;
} };
function updateHandlerFactory(flowId: number, previousStepId: number) { function updateHandlerFactory(flowId: string, previousStepId: string) {
return function createStepUpdateHandler( return function createStepUpdateHandler(cache: any, mutationResult: any) {
cache: any,
mutationResult: any,
) {
const { data } = mutationResult; const { data } = mutationResult;
const { createStep: createdStep } = data; const { createStep: createdStep } = data;
const { getFlow: flow } = cache.readQuery({ const { getFlow: flow } = cache.readQuery({
@@ -40,7 +37,7 @@ function updateHandlerFactory(flowId: number, previousStepId: number) {
variables: { id: flowId }, variables: { id: flowId },
data: { getFlow: { ...flow, steps } }, data: { getFlow: { ...flow, steps } },
}); });
} };
} }
export default function Editor(props: EditorProps): React.ReactElement { export default function Editor(props: EditorProps): React.ReactElement {
@@ -49,41 +46,47 @@ export default function Editor(props: EditorProps): React.ReactElement {
const [currentStep, setCurrentStep] = React.useState<number | null>(0); const [currentStep, setCurrentStep] = React.useState<number | null>(0);
const { flow } = props; const { flow } = props;
const onStepChange = React.useCallback((step: any) => { const onStepChange = React.useCallback(
const mutationInput: Record<string, unknown> = { (step: any) => {
id: step.id, const mutationInput: Record<string, unknown> = {
key: step.key, id: step.id,
parameters: JSON.stringify(step.parameters, null, 2), key: step.key,
connection: { parameters: JSON.stringify(step.parameters, null, 2),
id: step.connection?.id connection: {
}, id: step.connection?.id,
flow: { },
id: flow.id, flow: {
}, id: flow.id,
}; },
};
if (step.appKey) { if (step.appKey) {
mutationInput.appKey = step.appKey; mutationInput.appKey = step.appKey;
} }
updateStep({ variables: { input: mutationInput } }); updateStep({ variables: { input: mutationInput } });
}, [updateStep, flow.id]); },
[updateStep, flow.id]
);
const addStep = React.useCallback((previousStepId) => { const addStep = React.useCallback(
const mutationInput = { (previousStepId) => {
previousStep: { const mutationInput = {
id: previousStepId, previousStep: {
}, id: previousStepId,
flow: { },
id: flow.id, flow: {
}, id: flow.id,
}; },
};
createStep({ createStep({
variables: { input: mutationInput }, variables: { input: mutationInput },
update: updateHandlerFactory(flow.id, previousStepId), update: updateHandlerFactory(flow.id, previousStepId),
}); });
}, [createStep, flow.id]); },
[createStep, flow.id]
);
return ( return (
<Box <Box
@@ -113,5 +116,5 @@ export default function Editor(props: EditorProps): React.ReactElement {
</React.Fragment> </React.Fragment>
))} ))}
</Box> </Box>
) );
}; }

View File

@@ -1,7 +1,7 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const CREATE_AUTH_DATA = gql` export const CREATE_AUTH_DATA = gql`
mutation createAuthData($id: Int!) { mutation createAuthData($id: String!) {
createAuthData(id: $id) { createAuthData(id: $id) {
url url
} }

View File

@@ -1,7 +1,7 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const DELETE_CONNECTION = gql` export const DELETE_CONNECTION = gql`
mutation DeleteConnection($id: Int!) { mutation DeleteConnection($id: String!) {
deleteConnection(id: $id) deleteConnection(id: $id)
} }
`; `;

View File

@@ -1,7 +1,7 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const RESET_CONNECTION = gql` export const RESET_CONNECTION = gql`
mutation ResetConnection($id: Int!) { mutation ResetConnection($id: String!) {
resetConnection(id: $id) { resetConnection(id: $id) {
id id
} }

View File

@@ -1,7 +1,7 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const UPDATE_CONNECTION = gql` export const UPDATE_CONNECTION = gql`
mutation UpdateConnection($id: Int!, $data: JSONObject!) { mutation UpdateConnection($id: String!, $data: JSONObject!) {
updateConnection(id: $id, data: $data) { updateConnection(id: $id, data: $data) {
id id
key key

View File

@@ -1,7 +1,7 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const VERIFY_CONNECTION = gql` export const VERIFY_CONNECTION = gql`
mutation VerifyConnection($id: Int!) { mutation VerifyConnection($id: String!) {
verifyConnection(id: $id) { verifyConnection(id: $id) {
id id
verified verified

View File

@@ -1,7 +1,7 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const GET_FLOW = gql` export const GET_FLOW = gql`
query GetFlow($id: Int!) { query GetFlow($id: String!) {
getFlow(id: $id) { getFlow(id: $id) {
id id
name name

View File

@@ -1,7 +1,7 @@
import { gql } from '@apollo/client'; import { gql } from '@apollo/client';
export const TEST_CONNECTION = gql` export const TEST_CONNECTION = gql`
query TestConnection($id: Int!) { query TestConnection($id: String!) {
testConnection(id: $id) { testConnection(id: $id) {
id id
verified verified

View File

@@ -1,7 +1,7 @@
import type { Step } from './step'; import type { Step } from './step';
export type Flow = { export type Flow = {
id: number; id: string;
name: string; name: string;
steps: Step[]; steps: Step[];
active: boolean; active: boolean;

View File

@@ -9,9 +9,9 @@ export type Step = {
name: string; name: string;
appKey: string; appKey: string;
type: StepType; type: StepType;
previousStepId: number | null; previousStepId: string | null;
parameters: Record<string, unknown>; parameters: Record<string, unknown>;
connection: { connection: {
id: number; id: string;
}; };
}; };