chore: introduce @automatisch/types

This commit is contained in:
Ali BARIN
2022-03-01 22:56:19 +01:00
committed by Ömer Faruk Aydın
parent bbb6f0b0ff
commit 3391578655
54 changed files with 377 additions and 297 deletions

View File

@@ -6,10 +6,10 @@ import User from './user';
import appConfig from '../config/app';
class Connection extends Base {
id!: number;
id!: string;
key!: string;
data!: any;
userId!: number;
userId!: string;
verified: boolean;
count: number;

View File

@@ -4,8 +4,8 @@ import Step from './step';
class ExecutionStep extends Base {
id!: string;
executionId!: number;
stepId!: number;
executionId!: string;
stepId!: string;
dataIn!: any;
dataOut!: any;
status: string;
@@ -17,8 +17,8 @@ class ExecutionStep extends Base {
properties: {
id: { type: 'string' },
executionId: { type: 'integer' },
stepId: { type: 'integer' },
executionId: { type: 'string' },
stepId: { type: 'string' },
dataIn: { type: 'object' },
dataOut: { type: 'object' },
status: { type: 'string', enum: ['success', 'failure'] },

View File

@@ -1,11 +1,11 @@
import { ModelOptions, QueryContext, ValidationError } from 'objection';
import { ValidationError } from 'objection';
import Base from './base';
import Step from './step';
class Flow extends Base {
id!: string;
name: string;
userId!: number;
userId!: string;
active: boolean;
steps?: [Step];
@@ -17,7 +17,7 @@ class Flow extends Base {
properties: {
id: { type: 'string' },
name: { type: 'string' },
userId: { type: 'integer' },
userId: { type: 'string' },
active: { type: 'boolean' },
},
};

View File

@@ -2,14 +2,14 @@ import Base from './base';
import Flow from './flow';
import Connection from './connection';
import ExecutionStep from './execution-step';
import { StepType } from '../types/step';
import type { IStep } from '@automatisch/types';
class Step extends Base {
id!: number;
id!: string;
flowId!: string;
key: string;
appKey: string;
type!: StepType;
type!: IStep["type"];
connectionId?: string;
status: string;
position: number;
@@ -25,7 +25,7 @@ class Step extends Base {
required: ['type'],
properties: {
id: { type: 'integer' },
id: { type: 'string' },
flowId: { type: 'string' },
key: { type: ['string', 'null'] },
appKey: { type: ['string', 'null'], minLength: 1, maxLength: 255 },

View File

@@ -6,7 +6,7 @@ import Step from './step';
import bcrypt from 'bcrypt';
class User extends Base {
id!: number;
id!: string;
email!: string;
password!: string;
connections?: [Connection];
@@ -20,7 +20,7 @@ class User extends Base {
required: ['email', 'password'],
properties: {
id: { type: 'integer' },
id: { type: 'string' },
email: { type: 'string', format: 'email', minLength: 1, maxLength: 255 },
password: { type: 'string', minLength: 1, maxLength: 255 },
},