diff --git a/packages/runtime/src/client/crud/operations/aggregate.ts b/packages/runtime/src/client/crud/operations/aggregate.ts index 03b1ae6d..2bcd2014 100644 --- a/packages/runtime/src/client/crud/operations/aggregate.ts +++ b/packages/runtime/src/client/crud/operations/aggregate.ts @@ -7,10 +7,10 @@ import { BaseOperationHandler } from './base'; export class AggregateOperationHandler extends BaseOperationHandler { async handle(_operation: 'aggregate', args: unknown | undefined) { // normalize args to strip `undefined` fields - const normalizeArgs = this.normalizeArgs(args); + const normalizedArgs = this.normalizeArgs(args); // parse args - const parsedArgs = this.inputValidator.validateAggregateArgs(this.model, normalizeArgs); + const parsedArgs = this.inputValidator.validateAggregateArgs(this.model, normalizedArgs); let query = this.kysely.selectFrom((eb) => { // nested query for filtering and pagination diff --git a/packages/runtime/src/client/crud/operations/count.ts b/packages/runtime/src/client/crud/operations/count.ts index 9a8cc315..e44a5897 100644 --- a/packages/runtime/src/client/crud/operations/count.ts +++ b/packages/runtime/src/client/crud/operations/count.ts @@ -5,10 +5,10 @@ import { BaseOperationHandler } from './base'; export class CountOperationHandler extends BaseOperationHandler { async handle(_operation: 'count', args: unknown | undefined) { // normalize args to strip `undefined` fields - const normalizeArgs = this.normalizeArgs(args); + const normalizedArgs = this.normalizeArgs(args); // parse args - const parsedArgs = this.inputValidator.validateCountArgs(this.model, normalizeArgs); + const parsedArgs = this.inputValidator.validateCountArgs(this.model, normalizedArgs); let query = this.kysely.selectFrom((eb) => { // nested query for filtering and pagination diff --git a/packages/runtime/src/client/crud/operations/create.ts b/packages/runtime/src/client/crud/operations/create.ts index a908346b..bc15bb36 100644 --- a/packages/runtime/src/client/crud/operations/create.ts +++ b/packages/runtime/src/client/crud/operations/create.ts @@ -8,16 +8,16 @@ import { BaseOperationHandler } from './base'; export class CreateOperationHandler extends BaseOperationHandler { async handle(operation: 'create' | 'createMany' | 'createManyAndReturn', args: unknown | undefined) { // normalize args to strip `undefined` fields - const normalizeArgs = this.normalizeArgs(args); + const normalizedArgs = this.normalizeArgs(args); return match(operation) - .with('create', () => this.runCreate(this.inputValidator.validateCreateArgs(this.model, normalizeArgs))) + .with('create', () => this.runCreate(this.inputValidator.validateCreateArgs(this.model, normalizedArgs))) .with('createMany', () => { - return this.runCreateMany(this.inputValidator.validateCreateManyArgs(this.model, normalizeArgs)); + return this.runCreateMany(this.inputValidator.validateCreateManyArgs(this.model, normalizedArgs)); }) .with('createManyAndReturn', () => { return this.runCreateManyAndReturn( - this.inputValidator.validateCreateManyAndReturnArgs(this.model, normalizeArgs), + this.inputValidator.validateCreateManyAndReturnArgs(this.model, normalizedArgs), ); }) .exhaustive(); diff --git a/packages/runtime/src/client/crud/operations/delete.ts b/packages/runtime/src/client/crud/operations/delete.ts index 7ee821c6..e20c48be 100644 --- a/packages/runtime/src/client/crud/operations/delete.ts +++ b/packages/runtime/src/client/crud/operations/delete.ts @@ -7,12 +7,12 @@ import { BaseOperationHandler } from './base'; export class DeleteOperationHandler extends BaseOperationHandler { async handle(operation: 'delete' | 'deleteMany', args: unknown | undefined) { // normalize args to strip `undefined` fields - const normalizeArgs = this.normalizeArgs(args); + const normalizedArgs = this.normalizeArgs(args); return match(operation) - .with('delete', () => this.runDelete(this.inputValidator.validateDeleteArgs(this.model, normalizeArgs))) + .with('delete', () => this.runDelete(this.inputValidator.validateDeleteArgs(this.model, normalizedArgs))) .with('deleteMany', () => - this.runDeleteMany(this.inputValidator.validateDeleteManyArgs(this.model, normalizeArgs)), + this.runDeleteMany(this.inputValidator.validateDeleteManyArgs(this.model, normalizedArgs)), ) .exhaustive(); } diff --git a/packages/runtime/src/client/crud/operations/group-by.ts b/packages/runtime/src/client/crud/operations/group-by.ts index f1630c82..1cf619b5 100644 --- a/packages/runtime/src/client/crud/operations/group-by.ts +++ b/packages/runtime/src/client/crud/operations/group-by.ts @@ -7,10 +7,10 @@ import { BaseOperationHandler } from './base'; export class GroupByeOperationHandler extends BaseOperationHandler { async handle(_operation: 'groupBy', args: unknown | undefined) { // normalize args to strip `undefined` fields - const normalizeArgs = this.normalizeArgs(args); + const normalizedArgs = this.normalizeArgs(args); // parse args - const parsedArgs = this.inputValidator.validateGroupByArgs(this.model, normalizeArgs); + const parsedArgs = this.inputValidator.validateGroupByArgs(this.model, normalizedArgs); let query = this.kysely.selectFrom((eb) => { // nested query for filtering and pagination diff --git a/packages/runtime/src/client/crud/operations/update.ts b/packages/runtime/src/client/crud/operations/update.ts index 577646ef..ab0c086f 100644 --- a/packages/runtime/src/client/crud/operations/update.ts +++ b/packages/runtime/src/client/crud/operations/update.ts @@ -8,19 +8,19 @@ import { BaseOperationHandler } from './base'; export class UpdateOperationHandler extends BaseOperationHandler { async handle(operation: 'update' | 'updateMany' | 'updateManyAndReturn' | 'upsert', args: unknown) { // normalize args to strip `undefined` fields - const normalizeArgs = this.normalizeArgs(args); + const normalizedArgs = this.normalizeArgs(args); return match(operation) - .with('update', () => this.runUpdate(this.inputValidator.validateUpdateArgs(this.model, normalizeArgs))) + .with('update', () => this.runUpdate(this.inputValidator.validateUpdateArgs(this.model, normalizedArgs))) .with('updateMany', () => - this.runUpdateMany(this.inputValidator.validateUpdateManyArgs(this.model, normalizeArgs)), + this.runUpdateMany(this.inputValidator.validateUpdateManyArgs(this.model, normalizedArgs)), ) .with('updateManyAndReturn', () => this.runUpdateManyAndReturn( - this.inputValidator.validateUpdateManyAndReturnArgs(this.model, normalizeArgs), + this.inputValidator.validateUpdateManyAndReturnArgs(this.model, normalizedArgs), ), ) - .with('upsert', () => this.runUpsert(this.inputValidator.validateUpsertArgs(this.model, normalizeArgs))) + .with('upsert', () => this.runUpsert(this.inputValidator.validateUpsertArgs(this.model, normalizedArgs))) .exhaustive(); } diff --git a/packages/runtime/src/client/errors.ts b/packages/runtime/src/client/errors.ts index 0ec57b40..38c5077b 100644 --- a/packages/runtime/src/client/errors.ts +++ b/packages/runtime/src/client/errors.ts @@ -19,11 +19,7 @@ export class QueryError extends Error { /** * Error thrown when an internal error occurs. */ -export class InternalError extends Error { - constructor(message: string) { - super(message); - } -} +export class InternalError extends Error {} /** * Error thrown when an entity is not found.