Fix DBAL import paths and add missing type definitions

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-06 01:56:27 +00:00
parent b4650d1e91
commit 1a421ea2da
43 changed files with 151 additions and 66 deletions

View File

@@ -3,7 +3,7 @@
* @description Create Lua script operation
*/
import type { CreateLuaScriptInput, LuaScript, Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateLuaScriptCreate } from '../../../validation/entities/lua-script/validate-lua-script-create'
/**

View File

@@ -3,7 +3,7 @@
* @description Delete Lua script operation
*/
import type { Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../../../validation/entities/validate-id'
/**

View File

@@ -3,7 +3,7 @@
* @description Get Lua script by ID operation
*/
import type { LuaScript, Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../../../validation/entities/validate-id'
/**

View File

@@ -3,7 +3,7 @@
* @description List Lua scripts with filtering and pagination
*/
import type { ListOptions, LuaScript, Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
/**
* List Lua scripts with filtering and pagination

View File

@@ -3,7 +3,7 @@
* @description Update Lua script operation
*/
import type { LuaScript, Result, UpdateLuaScriptInput } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../../../validation/entities/validate-id'
import { validateLuaScriptUpdate } from '../../../validation/entities/lua-script/validate-lua-script-update'

View File

@@ -10,6 +10,25 @@ export interface CreateLuaScriptInput {
isActive?: boolean;
}
export interface UpdateLuaScriptInput {
name?: string;
code?: string;
description?: string;
isActive?: boolean;
}
export interface LuaScript {
id: string;
name: string;
code: string;
description?: string;
isActive: boolean;
isSandboxed: boolean;
timeoutMs: number;
createdAt: Date;
updatedAt: Date;
}
export interface LuaScriptView {
id: string;
name: string;

View File

@@ -1,7 +1,7 @@
import type { DBALAdapter } from '../../../../adapters/adapter'
import type { User } from '../../../../foundation/types'
import { DBALError } from '../../../../foundation/errors'
import { validateUserCreate, validateUserUpdate } from '../../../../foundation/validation'
import type { DBALAdapter } from '../../../../../adapters/adapter'
import type { User } from '../../../../../core/foundation/types'
import { DBALError } from '../../../../../core/foundation/errors'
import { validateUserCreate, validateUserUpdate } from '../../../../../core/foundation/validation'
export const createManyUsers = async (
adapter: DBALAdapter,

View File

@@ -1,6 +1,6 @@
import type { DBALAdapter } from '../../../../adapters/adapter'
import { DBALError } from '../../../../foundation/errors'
import type { User } from '../../../../foundation/types'
import type { DBALAdapter } from '../../../../../adapters/adapter'
import { DBALError } from '../../../../../core/foundation/errors'
import type { User } from '../../../../../core/foundation/types'
import { assertValidUserCreate } from './validation'
export const createUser = async (

View File

@@ -1,5 +1,5 @@
import type { DBALAdapter } from '../../../../adapters/adapter'
import { DBALError } from '../../../../foundation/errors'
import type { DBALAdapter } from '../../../../../adapters/adapter'
import { DBALError } from '../../../../../core/foundation/errors'
import { assertValidUserId } from './validation'
export const deleteUser = async (adapter: DBALAdapter, id: string): Promise<boolean> => {

View File

@@ -1,6 +1,6 @@
// TODO: Implement user operations
// import type { DBALAdapter } from '../../../../adapters/adapter'
// import type { User, ListOptions, ListResult } from '../../../../foundation/types'
// import type { DBALAdapter } from '../../../../../adapters/adapter'
// import type { User, ListOptions, ListResult } from '../../../../../core/foundation/types'
// import { createUser } from './create'
// import { deleteUser } from './delete'
// import { updateUser } from './update'

View File

@@ -1,7 +1,7 @@
import type { DBALAdapter } from '../../../../adapters/adapter'
import type { User, ListOptions, ListResult } from '../../../../foundation/types'
import { DBALError } from '../../../../foundation/errors'
import { validateId } from '../../../../foundation/validation'
import type { DBALAdapter } from '../../../../../adapters/adapter'
import type { User, ListOptions, ListResult } from '../../../../../core/foundation/types'
import { DBALError } from '../../../../../core/foundation/errors'
import { validateId } from '../../../../../core/foundation/validation'
export const readUser = async (adapter: DBALAdapter, id: string): Promise<User | null> => {
const validationErrors = validateId(id)

View File

@@ -1,6 +1,6 @@
import type { DBALAdapter } from '../../../../adapters/adapter'
import { DBALError } from '../../../../foundation/errors'
import type { User } from '../../../../foundation/types'
import type { DBALAdapter } from '../../../../../adapters/adapter'
import { DBALError } from '../../../../../core/foundation/errors'
import type { User } from '../../../../../core/foundation/types'
import { assertValidUserId, assertValidUserUpdate } from './validation'
export const updateUser = async (

View File

@@ -1,6 +1,6 @@
import { DBALError } from '../../../../foundation/errors'
import type { User } from '../../../../foundation/types'
import { validateId, validateUserCreate, validateUserUpdate } from '../../../../foundation/validation'
import { DBALError } from '../../../../../core/foundation/errors'
import type { User } from '../../../../../core/foundation/types'
import { validateId, validateUserCreate, validateUserUpdate } from '../../../../../core/foundation/validation'
export const assertValidUserId = (id: string): void => {
const validationErrors = validateId(id)

View File

@@ -3,7 +3,7 @@
* @description Create package operation
*/
import type { CreatePackageInput, Package, Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { validatePackageCreate } from '../../validation/validate-package-create'
/**

View File

@@ -3,8 +3,8 @@
* @description Delete package operation
*/
import type { Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Delete a package by ID

View File

@@ -3,8 +3,8 @@
* @description Get package operations
*/
import type { Package, Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Get a package by ID

View File

@@ -3,7 +3,7 @@
* @description List packages with filtering and pagination
*/
import type { ListOptions, Package, Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
/**
* List packages with filtering and pagination

View File

@@ -3,8 +3,8 @@
* @description Update package operation
*/
import type { Package, Result, UpdatePackageInput } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
import { validatePackageUpdate } from '../../validation/validate-package-update'
/**

View File

@@ -11,6 +11,13 @@ export interface CreatePackageInput {
isPublished?: boolean;
}
export interface UpdatePackageInput {
name?: string;
version?: string;
description?: string;
isPublished?: boolean;
}
export interface Package {
id: string;
packageId: string;

View File

@@ -3,7 +3,7 @@
* @description Create page operation
*/
import type { CreatePageInput, PageView, Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { validatePageCreate } from '../../validation/validate-page-create'
/**

View File

@@ -3,8 +3,8 @@
* @description Delete page operation
*/
import type { Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Delete a page by ID

View File

@@ -3,8 +3,8 @@
* @description Get page operations
*/
import type { PageView, Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Get a page by ID

View File

@@ -3,7 +3,7 @@
* @description List pages with filtering and pagination
*/
import type { ListOptions, PageView, Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
/**
* List pages with filtering and pagination

View File

@@ -3,8 +3,8 @@
* @description Update page operation
*/
import type { PageView, Result, UpdatePageInput } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
import { validatePageUpdate } from '../../validation/validate-page-update'
/**

View File

@@ -12,6 +12,27 @@ export interface CreatePageInput {
isActive?: boolean;
}
export interface UpdatePageInput {
slug?: string;
title?: string;
description?: string;
level?: string;
layout?: string;
isActive?: boolean;
}
export interface Page {
id: string;
slug: string;
title: string;
description?: string;
level?: string;
layout?: string;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
}
export interface PageView {
id: string;
slug: string;

View File

@@ -3,7 +3,7 @@
* @description Create session operation
*/
import type { CreateSessionInput, Result, Session } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateSessionCreate } from '../../validation/validate-session-create'
/**

View File

@@ -3,8 +3,8 @@
* @description Delete session operation
*/
import type { Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Delete a session by ID

View File

@@ -3,8 +3,8 @@
* @description Get session operations
*/
import type { Result, Session } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Get a session by ID

View File

@@ -3,7 +3,7 @@
* @description List sessions with filtering and pagination
*/
import type { ListOptions, Result, Session } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { cleanExpiredSessions } from './clean-expired'
/**

View File

@@ -3,8 +3,8 @@
* @description Update session operation
*/
import type { Result, Session, UpdateSessionInput } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
import { validateSessionUpdate } from '../../validation/validate-session-update'
/**

View File

@@ -8,6 +8,11 @@ export interface CreateSessionInput {
expiresAt?: Date;
}
export interface UpdateSessionInput {
userId?: string;
expiresAt?: Date;
}
export interface Session {
id: string;
token: string;

View File

@@ -3,7 +3,7 @@
* @description Create user operation
*/
import type { CreateUserInput, Result, User } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateUserCreate } from '../../validation/validate-user-create'
/**

View File

@@ -3,8 +3,8 @@
* @description Delete user operation
*/
import type { Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Delete a user by ID

View File

@@ -3,8 +3,8 @@
* @description Get user operations
*/
import type { Result, User } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Get a user by ID

View File

@@ -3,7 +3,7 @@
* @description List users with filtering and pagination
*/
import type { ListOptions, Result, User } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
/**
* List users with filtering and pagination

View File

@@ -3,8 +3,8 @@
* @description Update user operation
*/
import type { Result, UpdateUserInput, User } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
import { validateUserUpdate } from '../../validation/validate-user-update'
/**

View File

@@ -10,6 +10,22 @@ export interface CreateUserInput {
isActive?: boolean;
}
export interface UpdateUserInput {
username?: string;
email?: string;
password?: string;
isActive?: boolean;
}
export interface User {
id: string;
username: string;
email: string;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
}
export interface UserView {
id: string;
username: string;

View File

@@ -3,7 +3,7 @@
* @description Create workflow operation
*/
import type { CreateWorkflowInput, Result, Workflow } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateWorkflowCreate } from '../../validation/validate-workflow-create'
/**

View File

@@ -3,8 +3,8 @@
* @description Delete workflow operation
*/
import type { Result } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Delete a workflow by ID

View File

@@ -3,8 +3,8 @@
* @description Get workflow operation
*/
import type { Result, Workflow } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
/**
* Get a workflow by ID

View File

@@ -3,7 +3,7 @@
* @description List workflows with filtering and pagination
*/
import type { ListOptions, Result, Workflow } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import type { InMemoryStore } from '../store/in-memory-store'
/**
* List workflows with filtering and pagination

View File

@@ -3,8 +3,8 @@
* @description Update workflow operation
*/
import type { Result, UpdateWorkflowInput, Workflow } from '../../types'
import type { InMemoryStore } from '../../store/in-memory-store'
import { validateId } from '../../validation/validate-id'
import type { InMemoryStore } from '../store/in-memory-store'
import { validateId } from '../validation/validate-id'
import { validateWorkflowUpdate } from '../../validation/validate-workflow-update'
/**

View File

@@ -10,6 +10,23 @@ export interface CreateWorkflowInput {
isActive?: boolean;
}
export interface UpdateWorkflowInput {
name?: string;
description?: string;
definition?: any;
isActive?: boolean;
}
export interface Workflow {
id: string;
name: string;
description?: string;
definition?: any;
isActive: boolean;
createdAt: Date;
updatedAt: Date;
}
export interface WorkflowView {
id: string;
name: string;