@mikro-orm/core 6.5.7-dev.2 → 6.5.7-dev.4
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.
- package/index.js +5 -1
- package/index.mjs +4 -0
- package/package.json +2 -2
- package/typings.d.ts +30 -22
package/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.Config = exports.HiddenProps = exports.EagerProps = exports.OptionalProps = exports.EntityRepositoryType = exports.EntityMetadata = exports.PrimaryKeyProp = void 0;
|
|
17
|
+
exports.RequiredNullable = exports.DefineConfig = exports.Config = exports.Hidden = exports.Opt = exports.HiddenProps = exports.EagerProps = exports.OptionalProps = exports.EntityRepositoryType = exports.EntityMetadata = exports.PrimaryKeyProp = void 0;
|
|
18
18
|
/**
|
|
19
19
|
* @packageDocumentation
|
|
20
20
|
* @module core
|
|
@@ -27,7 +27,11 @@ Object.defineProperty(exports, "EntityRepositoryType", { enumerable: true, get:
|
|
|
27
27
|
Object.defineProperty(exports, "OptionalProps", { enumerable: true, get: function () { return typings_1.OptionalProps; } });
|
|
28
28
|
Object.defineProperty(exports, "EagerProps", { enumerable: true, get: function () { return typings_1.EagerProps; } });
|
|
29
29
|
Object.defineProperty(exports, "HiddenProps", { enumerable: true, get: function () { return typings_1.HiddenProps; } });
|
|
30
|
+
Object.defineProperty(exports, "Opt", { enumerable: true, get: function () { return typings_1.Opt; } });
|
|
31
|
+
Object.defineProperty(exports, "Hidden", { enumerable: true, get: function () { return typings_1.Hidden; } });
|
|
30
32
|
Object.defineProperty(exports, "Config", { enumerable: true, get: function () { return typings_1.Config; } });
|
|
33
|
+
Object.defineProperty(exports, "DefineConfig", { enumerable: true, get: function () { return typings_1.DefineConfig; } });
|
|
34
|
+
Object.defineProperty(exports, "RequiredNullable", { enumerable: true, get: function () { return typings_1.RequiredNullable; } });
|
|
31
35
|
__exportStar(require("./enums"), exports);
|
|
32
36
|
__exportStar(require("./errors"), exports);
|
|
33
37
|
__exportStar(require("./exceptions"), exports);
|
package/index.mjs
CHANGED
|
@@ -50,6 +50,7 @@ export const DeadlockException = mod.DeadlockException;
|
|
|
50
50
|
export const DecimalType = mod.DecimalType;
|
|
51
51
|
export const DefaultLogger = mod.DefaultLogger;
|
|
52
52
|
export const DeferMode = mod.DeferMode;
|
|
53
|
+
export const DefineConfig = mod.DefineConfig;
|
|
53
54
|
export const DoubleType = mod.DoubleType;
|
|
54
55
|
export const DriverException = mod.DriverException;
|
|
55
56
|
export const EagerProps = mod.EagerProps;
|
|
@@ -90,6 +91,7 @@ export const ForeignKeyConstraintViolationException = mod.ForeignKeyConstraintVi
|
|
|
90
91
|
export const Formula = mod.Formula;
|
|
91
92
|
export const GeneratedCacheAdapter = mod.GeneratedCacheAdapter;
|
|
92
93
|
export const GroupOperator = mod.GroupOperator;
|
|
94
|
+
export const Hidden = mod.Hidden;
|
|
93
95
|
export const HiddenProps = mod.HiddenProps;
|
|
94
96
|
export const Hydrator = mod.Hydrator;
|
|
95
97
|
export const IdentityMap = mod.IdentityMap;
|
|
@@ -132,6 +134,7 @@ export const OneToManyOptionsBuilder = mod.OneToManyOptionsBuilder;
|
|
|
132
134
|
export const OneToManyOptionsBuilderOnlyMappedBy = mod.OneToManyOptionsBuilderOnlyMappedBy;
|
|
133
135
|
export const OneToOne = mod.OneToOne;
|
|
134
136
|
export const OneToOneOptionsBuilder = mod.OneToOneOptionsBuilder;
|
|
137
|
+
export const Opt = mod.Opt;
|
|
135
138
|
export const OptimisticLockError = mod.OptimisticLockError;
|
|
136
139
|
export const OptionalProps = mod.OptionalProps;
|
|
137
140
|
export const PlainObject = mod.PlainObject;
|
|
@@ -155,6 +158,7 @@ export const ReferenceKind = mod.ReferenceKind;
|
|
|
155
158
|
export const ReferenceOptionsBuilder = mod.ReferenceOptionsBuilder;
|
|
156
159
|
export const ReflectMetadataProvider = mod.ReflectMetadataProvider;
|
|
157
160
|
export const RequestContext = mod.RequestContext;
|
|
161
|
+
export const RequiredNullable = mod.RequiredNullable;
|
|
158
162
|
export const SCALAR_TYPES = mod.SCALAR_TYPES;
|
|
159
163
|
export const ScalarReference = mod.ScalarReference;
|
|
160
164
|
export const SerializationContext = mod.SerializationContext;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/core",
|
|
3
|
-
"version": "6.5.7-dev.
|
|
3
|
+
"version": "6.5.7-dev.4",
|
|
4
4
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"esprima": "4.0.1",
|
|
65
65
|
"fs-extra": "11.3.2",
|
|
66
66
|
"globby": "11.1.0",
|
|
67
|
-
"mikro-orm": "6.5.7-dev.
|
|
67
|
+
"mikro-orm": "6.5.7-dev.4",
|
|
68
68
|
"reflect-metadata": "0.2.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
package/typings.d.ts
CHANGED
|
@@ -43,22 +43,34 @@ export declare const OptionalProps: unique symbol;
|
|
|
43
43
|
export declare const EagerProps: unique symbol;
|
|
44
44
|
export declare const HiddenProps: unique symbol;
|
|
45
45
|
export declare const Config: unique symbol;
|
|
46
|
-
|
|
47
|
-
declare
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
export type RequiredNullable<T = never> = (T &
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
export type Opt<T = unknown> = T & Opt.Brand;
|
|
47
|
+
export declare namespace Opt {
|
|
48
|
+
const __optional: unique symbol;
|
|
49
|
+
interface Brand {
|
|
50
|
+
[__optional]?: 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
export type RequiredNullable<T = never> = (T & RequiredNullable.Brand) | null;
|
|
54
|
+
export declare namespace RequiredNullable {
|
|
55
|
+
const __requiredNullable: unique symbol;
|
|
56
|
+
interface Brand {
|
|
57
|
+
[__requiredNullable]?: 1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
export type Hidden<T = unknown> = T & Hidden.Brand;
|
|
61
|
+
export declare namespace Hidden {
|
|
62
|
+
const __hidden: unique symbol;
|
|
63
|
+
interface Brand {
|
|
64
|
+
[__hidden]?: 1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export type DefineConfig<T extends TypeConfig> = T & DefineConfig.Brand;
|
|
68
|
+
export declare namespace DefineConfig {
|
|
69
|
+
const __config: unique symbol;
|
|
70
|
+
interface Brand {
|
|
71
|
+
[__config]?: 1;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
62
74
|
export type CleanTypeConfig<T> = Compute<Pick<T, Extract<keyof T, keyof TypeConfig>>>;
|
|
63
75
|
export interface TypeConfig {
|
|
64
76
|
forceObject?: boolean;
|
|
@@ -220,9 +232,7 @@ export type EntityDataProp<T, C extends boolean> = T extends Date ? string | Dat
|
|
|
220
232
|
__runtime?: infer Runtime;
|
|
221
233
|
__raw?: infer Raw;
|
|
222
234
|
} ? (C extends true ? Raw : Runtime) : T extends Reference<infer U> ? EntityDataNested<U, C> : T extends ScalarReference<infer U> ? EntityDataProp<U, C> : T extends Collection<infer U, any> ? U | U[] | EntityDataNested<U, C> | EntityDataNested<U, C>[] : T extends readonly (infer U)[] ? U extends NonArrayObject ? U | U[] | EntityDataNested<U, C> | EntityDataNested<U, C>[] : U[] | EntityDataNested<U, C>[] : EntityDataNested<T, C>;
|
|
223
|
-
export type RequiredEntityDataProp<T, O, C extends boolean> = T extends Date ? string | Date : Exclude<T, null> extends {
|
|
224
|
-
[__requiredNullable]?: 1;
|
|
225
|
-
} ? T | null : T extends Scalar ? T : T extends {
|
|
235
|
+
export type RequiredEntityDataProp<T, O, C extends boolean> = T extends Date ? string | Date : Exclude<T, null> extends RequiredNullable.Brand ? T | null : T extends Scalar ? T : T extends {
|
|
226
236
|
__runtime?: infer Runtime;
|
|
227
237
|
__raw?: infer Raw;
|
|
228
238
|
} ? (C extends true ? Raw : Runtime) : T extends Reference<infer U> ? RequiredEntityDataNested<U, O, C> : T extends ScalarReference<infer U> ? RequiredEntityDataProp<U, O, C> : T extends Collection<infer U, any> ? U | U[] | RequiredEntityDataNested<U, O, C> | RequiredEntityDataNested<U, O, C>[] : T extends readonly (infer U)[] ? U extends NonArrayObject ? U | U[] | RequiredEntityDataNested<U, O, C> | RequiredEntityDataNested<U, O, C>[] : U[] | RequiredEntityDataNested<U, O, C>[] : RequiredEntityDataNested<T, O, C>;
|
|
@@ -238,9 +248,7 @@ type NullableKeys<T, V = null> = {
|
|
|
238
248
|
[K in keyof T]: V extends T[K] ? K : never;
|
|
239
249
|
}[keyof T];
|
|
240
250
|
type RequiredNullableKeys<T> = {
|
|
241
|
-
[K in keyof T]: Exclude<T[K], null> extends
|
|
242
|
-
[__requiredNullable]?: 1;
|
|
243
|
-
} ? K : never;
|
|
251
|
+
[K in keyof T]: Exclude<T[K], null> extends RequiredNullable.Brand ? K : never;
|
|
244
252
|
}[keyof T];
|
|
245
253
|
type ProbablyOptionalProps<T> = PrimaryProperty<T> | ExplicitlyOptionalProps<T> | Exclude<NonNullable<NullableKeys<T, null | undefined>>, RequiredNullableKeys<T>>;
|
|
246
254
|
type IsOptional<T, K extends keyof T, I> = T[K] extends Collection<any, any> ? true : ExtractType<T[K]> extends I ? true : K extends ProbablyOptionalProps<T> ? true : false;
|