mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
Phase 1: Fix require-await and await-thenable errors
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
@@ -5,7 +5,7 @@ import { GET } from './route'
|
||||
|
||||
describe('GET /api/health', () => {
|
||||
it('returns OK status and permission level count', async () => {
|
||||
const response = await GET(new NextRequest('http://example.com/api/health'))
|
||||
const response = GET(new NextRequest('http://example.com/api/health'))
|
||||
const payload = await response.json()
|
||||
|
||||
expect(payload.status).toBe('ok')
|
||||
|
||||
@@ -40,7 +40,7 @@ export function PackageStyleLoader({ packages }: PackageStyleLoaderProps) {
|
||||
}
|
||||
|
||||
if (packages.length > 0) {
|
||||
loadStyles()
|
||||
void loadStyles()
|
||||
}
|
||||
}, [packages])
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import type { User } from '@/lib/types/level-types'
|
||||
|
||||
export async function fetchSession(): Promise<User | null> {
|
||||
export function fetchSession(): Promise<User | null> {
|
||||
// TODO: Implement session fetching
|
||||
return null
|
||||
return Promise.resolve(null)
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@ export interface LoginCredentials {
|
||||
password: string
|
||||
}
|
||||
|
||||
export async function login(_identifier: string, _password: string): Promise<User> {
|
||||
export function login(_identifier: string, _password: string): Promise<User> {
|
||||
// TODO: Implement login
|
||||
// For now, throw an error to indicate not implemented
|
||||
throw new Error('Login not implemented')
|
||||
return Promise.reject(new Error('Login not implemented'))
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ export interface RegisterData {
|
||||
password: string
|
||||
}
|
||||
|
||||
export async function register(_username: string, _email: string, _password: string): Promise<User> {
|
||||
export function register(_username: string, _email: string, _password: string): Promise<User> {
|
||||
// TODO: Implement registration
|
||||
throw new Error('Registration not implemented')
|
||||
return Promise.reject(new Error('Registration not implemented'))
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export function compile(source: string, _options?: CompileOptions): CompileResul
|
||||
return { code: source }
|
||||
}
|
||||
|
||||
export function loadAndInjectStyles(_packageId: string): string {
|
||||
export function loadAndInjectStyles(_packageId: string): Promise<string> {
|
||||
// TODO: Implement style loading and injection
|
||||
return ''
|
||||
return Promise.resolve('')
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export interface ListWorkflowRunsOptions {
|
||||
perPage?: number
|
||||
}
|
||||
|
||||
export function listWorkflowRuns(_options: ListWorkflowRunsOptions): WorkflowRun[] {
|
||||
export function listWorkflowRuns(_options: ListWorkflowRunsOptions): Promise<WorkflowRun[]> {
|
||||
// TODO: Implement workflow runs listing
|
||||
return []
|
||||
return Promise.resolve([])
|
||||
}
|
||||
|
||||
@@ -65,9 +65,9 @@ export function parseRestfulRequest(
|
||||
export function executeDbalOperation(
|
||||
_op: unknown,
|
||||
_context?: unknown
|
||||
): { success: boolean; data?: unknown; error?: string; meta?: unknown } {
|
||||
): Promise<{ success: boolean; data?: unknown; error?: string; meta?: unknown }> {
|
||||
// TODO: Implement DBAL operation execution
|
||||
return { success: false, error: 'Not implemented' }
|
||||
return Promise.resolve({ success: false, error: 'Not implemented' })
|
||||
}
|
||||
|
||||
export function executePackageAction(
|
||||
@@ -76,9 +76,9 @@ export function executePackageAction(
|
||||
_action: unknown,
|
||||
_id: unknown,
|
||||
_context?: unknown
|
||||
): { success: boolean; data?: unknown; error?: string } {
|
||||
): Promise<{ success: boolean; data?: unknown; error?: string }> {
|
||||
// TODO: Implement package action execution
|
||||
return { success: false, error: 'Not implemented' }
|
||||
return Promise.resolve({ success: false, error: 'Not implemented' })
|
||||
}
|
||||
|
||||
export interface TenantValidationResult {
|
||||
@@ -91,9 +91,9 @@ export function validateTenantAccess(
|
||||
_user: unknown,
|
||||
_tenant: unknown,
|
||||
_minLevel: unknown
|
||||
): TenantValidationResult {
|
||||
): Promise<TenantValidationResult> {
|
||||
// TODO: Implement tenant access validation
|
||||
return { allowed: false, reason: 'Not implemented' }
|
||||
return Promise.resolve({ allowed: false, reason: 'Not implemented' })
|
||||
}
|
||||
|
||||
// Re-export auth functions
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface UIPageData {
|
||||
actions?: Record<string, LuaActionHandler>
|
||||
}
|
||||
|
||||
export function loadPageFromDb(_path: string, _tenantId?: string): PageConfig | null {
|
||||
export function loadPageFromDb(_path: string, _tenantId?: string): Promise<PageConfig | null> {
|
||||
// TODO: Implement page loading from database
|
||||
return null
|
||||
return Promise.resolve(null)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
import type { PageConfig } from '../types/level-types'
|
||||
|
||||
export function loadPageFromLuaPackages(_b_path: string): PageConfig | null {
|
||||
export function loadPageFromLuaPackages(_b_path: string): Promise<PageConfig | null> {
|
||||
// TODO: Implement page loading from Lua packages
|
||||
return null
|
||||
return Promise.resolve(null)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user