From 1cc65d039a36ebf920ef8ddd192ad9fc233013cb Mon Sep 17 00:00:00 2001 From: "Marc J. Schmidt" Date: Tue, 3 Oct 2023 23:47:18 +0200 Subject: [PATCH] fix(type): rename ResetDecorator to ResetAnnotation --- packages/orm/src/plugin/log-plugin.ts | 4 ++-- packages/type/src/reflection/type.ts | 4 ++-- packages/type/tests/type.spec.ts | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/orm/src/plugin/log-plugin.ts b/packages/orm/src/plugin/log-plugin.ts index b45951a3f..e1746221f 100644 --- a/packages/orm/src/plugin/log-plugin.ts +++ b/packages/orm/src/plugin/log-plugin.ts @@ -12,7 +12,7 @@ import { ClassType } from '@deepkit/core'; import { DatabaseSession } from '../database-session.js'; import { Database } from '../database.js'; import { Query } from '../query.js'; -import { AutoIncrement, entity, InlineRuntimeType, PrimaryKey, PrimaryKeyFields, ReflectionClass, ResetDecorator } from '@deepkit/type'; +import { AutoIncrement, entity, InlineRuntimeType, PrimaryKey, PrimaryKeyFields, ReflectionClass, ResetAnnotation } from '@deepkit/type'; import { DatabasePlugin } from './plugin.js'; import { OrmEntity } from '../type.js'; @@ -128,7 +128,7 @@ export class LogPlugin implements DatabasePlugin { @entity.collection(this.getLogEntityCollectionName(schema)) class LogEntityForSchema extends this.options.entity { //we can not work with references since that would mean we can not delete the parent without deleting the log entry. - reference: InlineRuntimeType & ResetDecorator<'primaryKey'> & ResetDecorator<'autoIncrement'>; + reference: InlineRuntimeType & ResetAnnotation<'primaryKey'> & ResetAnnotation<'autoIncrement'>; } entry = ReflectionClass.from(LogEntityForSchema); diff --git a/packages/type/src/reflection/type.ts b/packages/type/src/reflection/type.ts index 6c1ae5771..3b9118676 100644 --- a/packages/type/src/reflection/type.ts +++ b/packages/type/src/reflection/type.ts @@ -1719,11 +1719,11 @@ export type Data = { __meta?: ['data', never & Name, * type Password = string & MinLength<6> & Excluded; * * interface UserCreationPayload { - * password: Password & ResetDecorator<'excluded'> + * password: Password & ResetAnnotation<'excluded'> * } * ``` */ -export type ResetDecorator = { __meta?: ['reset', Name] }; +export type ResetAnnotation = { __meta?: ['reset', Name] }; export type IndexOptions = { name?: string; diff --git a/packages/type/tests/type.spec.ts b/packages/type/tests/type.spec.ts index 4410ecbdd..57b21a9ab 100644 --- a/packages/type/tests/type.spec.ts +++ b/packages/type/tests/type.spec.ts @@ -15,7 +15,7 @@ import { PrimaryKey, primaryKeyAnnotation, ReflectionKind, - ResetDecorator, + ResetAnnotation, resolveTypeMembers, stringifyResolvedType, stringifyType, @@ -141,7 +141,7 @@ test('reset primary decorator', () => { } interface UserCreationPayload { - id: User['id'] & ResetDecorator<'primaryKey'>; + id: User['id'] & ResetAnnotation<'primaryKey'>; } const type = typeOf(); @@ -158,7 +158,7 @@ test('reset type decorator', () => { } interface UserCreationPayload { - password: User['password'] & Group<'a'> & ResetDecorator<'excluded'>; + password: User['password'] & Group<'a'> & ResetAnnotation<'excluded'>; } {