pangea-server 3.3.86 → 3.3.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -12,6 +12,9 @@ declare global {
|
|
|
12
12
|
type ColHidden<T> = T & {
|
|
13
13
|
__brand: 'hidden';
|
|
14
14
|
};
|
|
15
|
+
type ColRelation<T> = T & {
|
|
16
|
+
__brand: 'relation';
|
|
17
|
+
};
|
|
15
18
|
type ColVirtual<T> = CreationOptional<T>;
|
|
16
19
|
type ModelInstance<BM extends BaseModel> = InferAttributes<BM>;
|
|
17
20
|
type Where<BM extends BaseModel> = WhereOptions<BM> & Record<symbol, any>;
|
|
@@ -59,8 +62,7 @@ type OptionalIfOptional<T> = {
|
|
|
59
62
|
type IncludeHidden<T> = {
|
|
60
63
|
[K in keyof T]-?: Exclude<T[K], undefined> extends ColHidden<infer U> ? U : T[K];
|
|
61
64
|
};
|
|
62
|
-
type IsRelation<T> = NonNullable<T> extends BaseModel | Array<BaseModel> ? true : false;
|
|
63
65
|
type StripRelations<T> = {
|
|
64
|
-
[K in keyof T as
|
|
66
|
+
[K in keyof T as T[K] extends ColRelation<unknown> ? never : K]: T[K];
|
|
65
67
|
};
|
|
66
68
|
export {};
|