typeorm 0.3.21-dev.af603ae → 0.3.21-dev.af7ac1c
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/README.md +0 -1
- package/browser/cache/QueryResultCache.d.ts +4 -2
- package/browser/cache/QueryResultCache.js.map +1 -1
- package/browser/connection/ConnectionOptionsReader.d.ts +4 -4
- package/browser/driver/aurora-mysql/AuroraMysqlQueryRunner.d.ts +0 -1
- package/browser/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/browser/driver/cockroachdb/CockroachConnectionCredentialsOptions.d.ts +0 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.d.ts +0 -1
- package/browser/driver/cockroachdb/CockroachQueryRunner.js +5 -3
- package/browser/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/browser/driver/mongodb/MongoConnectionOptions.d.ts +0 -1
- package/browser/driver/mongodb/MongoQueryRunner.d.ts +0 -1
- package/browser/driver/mongodb/typings.d.ts +0 -8
- package/browser/driver/mongodb/typings.js +0 -1
- package/browser/driver/mongodb/typings.js.map +1 -1
- package/browser/driver/mysql/MysqlQueryRunner.d.ts +0 -1
- package/browser/driver/oracle/OracleQueryRunner.d.ts +0 -1
- package/browser/driver/postgres/PostgresConnectionCredentialsOptions.d.ts +0 -1
- package/browser/driver/postgres/PostgresQueryRunner.d.ts +0 -1
- package/browser/driver/sap/SapQueryRunner.d.ts +0 -1
- package/browser/driver/spanner/SpannerQueryRunner.d.ts +0 -1
- package/browser/driver/sqlite-abstract/AbstractSqliteQueryRunner.d.ts +0 -1
- package/browser/driver/sqlserver/SqlServerQueryRunner.d.ts +0 -1
- package/browser/find-options/FindOptionsOrder.d.ts +0 -1
- package/browser/find-options/FindOptionsRelations.d.ts +0 -1
- package/browser/find-options/FindOptionsSelect.d.ts +0 -1
- package/browser/find-options/FindOptionsWhere.d.ts +0 -1
- package/browser/platform/PlatformTools.d.ts +0 -4
- package/browser/query-builder/SelectQueryBuilder.d.ts +0 -1
- package/browser/query-runner/QueryRunner.d.ts +0 -1
- package/cache/QueryResultCache.d.ts +4 -2
- package/cache/QueryResultCache.js.map +1 -1
- package/connection/ConnectionOptionsReader.d.ts +4 -4
- package/container.js +2 -3
- package/container.js.map +1 -1
- package/decorator/Check.js +1 -2
- package/decorator/Check.js.map +1 -1
- package/decorator/EntityRepository.js +1 -2
- package/decorator/EntityRepository.js.map +1 -1
- package/decorator/Exclusion.js +1 -2
- package/decorator/Exclusion.js.map +1 -1
- package/decorator/Generated.js +1 -2
- package/decorator/Generated.js.map +1 -1
- package/decorator/Index.js +1 -2
- package/decorator/Index.js.map +1 -1
- package/decorator/Unique.js +1 -2
- package/decorator/Unique.js.map +1 -1
- package/decorator/columns/Column.js +1 -2
- package/decorator/columns/Column.js.map +1 -1
- package/decorator/columns/CreateDateColumn.js +1 -2
- package/decorator/columns/CreateDateColumn.js.map +1 -1
- package/decorator/columns/DeleteDateColumn.js +1 -2
- package/decorator/columns/DeleteDateColumn.js.map +1 -1
- package/decorator/columns/ObjectIdColumn.js +1 -2
- package/decorator/columns/ObjectIdColumn.js.map +1 -1
- package/decorator/columns/PrimaryColumn.js +1 -2
- package/decorator/columns/PrimaryColumn.js.map +1 -1
- package/decorator/columns/PrimaryGeneratedColumn.js +1 -2
- package/decorator/columns/PrimaryGeneratedColumn.js.map +1 -1
- package/decorator/columns/UpdateDateColumn.js +1 -2
- package/decorator/columns/UpdateDateColumn.js.map +1 -1
- package/decorator/columns/VersionColumn.js +1 -2
- package/decorator/columns/VersionColumn.js.map +1 -1
- package/decorator/columns/ViewColumn.js +1 -2
- package/decorator/columns/ViewColumn.js.map +1 -1
- package/decorator/columns/VirtualColumn.js +1 -2
- package/decorator/columns/VirtualColumn.js.map +1 -1
- package/decorator/entity/ChildEntity.js +1 -2
- package/decorator/entity/ChildEntity.js.map +1 -1
- package/decorator/entity/Entity.js +1 -2
- package/decorator/entity/Entity.js.map +1 -1
- package/decorator/entity/TableInheritance.js +1 -2
- package/decorator/entity/TableInheritance.js.map +1 -1
- package/decorator/entity-view/ViewEntity.js +1 -2
- package/decorator/entity-view/ViewEntity.js.map +1 -1
- package/decorator/listeners/AfterInsert.js +1 -2
- package/decorator/listeners/AfterInsert.js.map +1 -1
- package/decorator/listeners/AfterLoad.js +1 -2
- package/decorator/listeners/AfterLoad.js.map +1 -1
- package/decorator/listeners/AfterRecover.js +1 -2
- package/decorator/listeners/AfterRecover.js.map +1 -1
- package/decorator/listeners/AfterRemove.js +1 -2
- package/decorator/listeners/AfterRemove.js.map +1 -1
- package/decorator/listeners/AfterSoftRemove.js +1 -2
- package/decorator/listeners/AfterSoftRemove.js.map +1 -1
- package/decorator/listeners/AfterUpdate.js +1 -2
- package/decorator/listeners/AfterUpdate.js.map +1 -1
- package/decorator/listeners/BeforeInsert.js +1 -2
- package/decorator/listeners/BeforeInsert.js.map +1 -1
- package/decorator/listeners/BeforeRecover.js +1 -2
- package/decorator/listeners/BeforeRecover.js.map +1 -1
- package/decorator/listeners/BeforeRemove.js +1 -2
- package/decorator/listeners/BeforeRemove.js.map +1 -1
- package/decorator/listeners/BeforeSoftRemove.js +1 -2
- package/decorator/listeners/BeforeSoftRemove.js.map +1 -1
- package/decorator/listeners/BeforeUpdate.js +1 -2
- package/decorator/listeners/BeforeUpdate.js.map +1 -1
- package/decorator/listeners/EventSubscriber.js +1 -2
- package/decorator/listeners/EventSubscriber.js.map +1 -1
- package/decorator/relations/JoinColumn.js +1 -2
- package/decorator/relations/JoinColumn.js.map +1 -1
- package/decorator/relations/JoinTable.js +1 -2
- package/decorator/relations/JoinTable.js.map +1 -1
- package/decorator/relations/ManyToMany.js +1 -2
- package/decorator/relations/ManyToMany.js.map +1 -1
- package/decorator/relations/ManyToOne.js +1 -2
- package/decorator/relations/ManyToOne.js.map +1 -1
- package/decorator/relations/OneToMany.js +1 -2
- package/decorator/relations/OneToMany.js.map +1 -1
- package/decorator/relations/OneToOne.js +1 -2
- package/decorator/relations/OneToOne.js.map +1 -1
- package/decorator/relations/RelationCount.js +1 -2
- package/decorator/relations/RelationCount.js.map +1 -1
- package/decorator/relations/RelationId.js +1 -2
- package/decorator/relations/RelationId.js.map +1 -1
- package/decorator/tree/Tree.js +1 -2
- package/decorator/tree/Tree.js.map +1 -1
- package/decorator/tree/TreeChildren.js +1 -2
- package/decorator/tree/TreeChildren.js.map +1 -1
- package/decorator/tree/TreeLevelColumn.js +1 -2
- package/decorator/tree/TreeLevelColumn.js.map +1 -1
- package/decorator/tree/TreeParent.js +1 -2
- package/decorator/tree/TreeParent.js.map +1 -1
- package/driver/aurora-mysql/AuroraMysqlQueryRunner.d.ts +0 -1
- package/driver/better-sqlite3/BetterSqlite3QueryRunner.js.map +1 -1
- package/driver/cockroachdb/CockroachConnectionCredentialsOptions.d.ts +0 -1
- package/driver/cockroachdb/CockroachQueryRunner.d.ts +0 -1
- package/driver/cockroachdb/CockroachQueryRunner.js +5 -3
- package/driver/cockroachdb/CockroachQueryRunner.js.map +1 -1
- package/driver/mongodb/MongoConnectionOptions.d.ts +0 -1
- package/driver/mongodb/MongoQueryRunner.d.ts +0 -1
- package/driver/mongodb/typings.d.ts +0 -8
- package/driver/mongodb/typings.js +0 -1
- package/driver/mongodb/typings.js.map +1 -1
- package/driver/mysql/MysqlQueryRunner.d.ts +0 -1
- package/driver/oracle/OracleQueryRunner.d.ts +0 -1
- package/driver/postgres/PostgresConnectionCredentialsOptions.d.ts +0 -1
- package/driver/postgres/PostgresQueryRunner.d.ts +0 -1
- package/driver/sap/SapQueryRunner.d.ts +0 -1
- package/driver/spanner/SpannerQueryRunner.d.ts +0 -1
- package/driver/sqlite-abstract/AbstractSqliteQueryRunner.d.ts +0 -1
- package/driver/sqlserver/SqlServerQueryRunner.d.ts +0 -1
- package/find-options/FindOptionsOrder.d.ts +0 -1
- package/find-options/FindOptionsRelations.d.ts +0 -1
- package/find-options/FindOptionsSelect.d.ts +0 -1
- package/find-options/FindOptionsWhere.d.ts +0 -1
- package/find-options/operator/And.js +1 -2
- package/find-options/operator/And.js.map +1 -1
- package/find-options/operator/Any.js +1 -2
- package/find-options/operator/Any.js.map +1 -1
- package/find-options/operator/ArrayContainedBy.js +1 -2
- package/find-options/operator/ArrayContainedBy.js.map +1 -1
- package/find-options/operator/ArrayContains.js +1 -2
- package/find-options/operator/ArrayContains.js.map +1 -1
- package/find-options/operator/ArrayOverlap.js +1 -2
- package/find-options/operator/ArrayOverlap.js.map +1 -1
- package/find-options/operator/Between.js +1 -2
- package/find-options/operator/Between.js.map +1 -1
- package/find-options/operator/Equal.js +1 -2
- package/find-options/operator/Equal.js.map +1 -1
- package/find-options/operator/ILike.js +1 -2
- package/find-options/operator/ILike.js.map +1 -1
- package/find-options/operator/In.js +1 -2
- package/find-options/operator/In.js.map +1 -1
- package/find-options/operator/IsNull.js +1 -2
- package/find-options/operator/IsNull.js.map +1 -1
- package/find-options/operator/JsonContains.js +1 -2
- package/find-options/operator/JsonContains.js.map +1 -1
- package/find-options/operator/LessThan.js +1 -2
- package/find-options/operator/LessThan.js.map +1 -1
- package/find-options/operator/LessThanOrEqual.js +1 -2
- package/find-options/operator/LessThanOrEqual.js.map +1 -1
- package/find-options/operator/Like.js +1 -2
- package/find-options/operator/Like.js.map +1 -1
- package/find-options/operator/MoreThan.js +1 -2
- package/find-options/operator/MoreThan.js.map +1 -1
- package/find-options/operator/MoreThanOrEqual.js +1 -2
- package/find-options/operator/MoreThanOrEqual.js.map +1 -1
- package/find-options/operator/Not.js +1 -2
- package/find-options/operator/Not.js.map +1 -1
- package/find-options/operator/Or.js +1 -2
- package/find-options/operator/Or.js.map +1 -1
- package/find-options/operator/Raw.js +1 -2
- package/find-options/operator/Raw.js.map +1 -1
- package/globals.js +14 -15
- package/globals.js.map +1 -1
- package/package.json +1 -1
- package/platform/PlatformTools.d.ts +0 -4
- package/query-builder/SelectQueryBuilder.d.ts +0 -1
- package/query-builder/index.js +1 -2
- package/query-builder/index.js.map +1 -1
- package/query-runner/QueryRunner.d.ts +0 -1
- package/util/DirectoryExportedClassesLoader.js +2 -3
- package/util/DirectoryExportedClassesLoader.js.map +1 -1
- package/util/ImportUtils.js +1 -2
- package/util/ImportUtils.js.map +1 -1
- package/util/PathUtils.js +3 -4
- package/util/PathUtils.js.map +1 -1
- package/util/StringUtils.js +6 -7
- package/util/StringUtils.js.map +1 -1
|
@@ -13,11 +13,13 @@ export interface QueryResultCache {
|
|
|
13
13
|
*/
|
|
14
14
|
disconnect(): Promise<void>;
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Perform operations during schema synchronization.
|
|
17
17
|
*/
|
|
18
18
|
synchronize(queryRunner?: QueryRunner): Promise<void>;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Get data from cache.
|
|
21
|
+
* Returns cache result if found.
|
|
22
|
+
* Returns undefined if result is not cached.
|
|
21
23
|
*/
|
|
22
24
|
getFromCache(options: QueryResultCacheOptions, queryRunner?: QueryRunner): Promise<QueryResultCacheOptions | undefined>;
|
|
23
25
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cache/QueryResultCache.ts"],"names":[],"mappings":"","file":"QueryResultCache.js","sourcesContent":["import { QueryResultCacheOptions } from \"./QueryResultCacheOptions\"\nimport { QueryRunner } from \"../query-runner/QueryRunner\"\n\n/**\n * Implementations of this interface provide different strategies to cache query builder results.\n */\nexport interface QueryResultCache {\n /**\n * Creates a connection with given cache provider.\n */\n connect(): Promise<void>\n\n /**\n * Closes a connection with given cache provider.\n */\n disconnect(): Promise<void>\n\n /**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/cache/QueryResultCache.ts"],"names":[],"mappings":"","file":"QueryResultCache.js","sourcesContent":["import { QueryResultCacheOptions } from \"./QueryResultCacheOptions\"\nimport { QueryRunner } from \"../query-runner/QueryRunner\"\n\n/**\n * Implementations of this interface provide different strategies to cache query builder results.\n */\nexport interface QueryResultCache {\n /**\n * Creates a connection with given cache provider.\n */\n connect(): Promise<void>\n\n /**\n * Closes a connection with given cache provider.\n */\n disconnect(): Promise<void>\n\n /**\n * Perform operations during schema synchronization.\n */\n synchronize(queryRunner?: QueryRunner): Promise<void>\n\n /**\n * Get data from cache.\n * Returns cache result if found.\n * Returns undefined if result is not cached.\n */\n getFromCache(\n options: QueryResultCacheOptions,\n queryRunner?: QueryRunner,\n ): Promise<QueryResultCacheOptions | undefined>\n\n /**\n * Stores given query result in the cache.\n */\n storeInCache(\n options: QueryResultCacheOptions,\n savedCache: QueryResultCacheOptions | undefined,\n queryRunner?: QueryRunner,\n ): Promise<void>\n\n /**\n * Checks if cache is expired or not.\n */\n isExpired(savedCache: QueryResultCacheOptions): boolean\n\n /**\n * Clears everything stored in the cache.\n */\n clear(queryRunner?: QueryRunner): Promise<void>\n\n /**\n * Removes all cached results by given identifiers from cache.\n */\n remove(identifiers: string[], queryRunner?: QueryRunner): Promise<void>\n}\n"],"sourceRoot":".."}
|
|
@@ -8,22 +8,22 @@ export declare class ConnectionOptionsReader {
|
|
|
8
8
|
* Directory where ormconfig should be read from.
|
|
9
9
|
* By default its your application root (where your app package.json is located).
|
|
10
10
|
*/
|
|
11
|
-
root?: string
|
|
11
|
+
root?: string;
|
|
12
12
|
/**
|
|
13
13
|
* Filename of the ormconfig configuration. By default its equal to "ormconfig".
|
|
14
14
|
*/
|
|
15
|
-
configName?: string
|
|
15
|
+
configName?: string;
|
|
16
16
|
} | undefined;
|
|
17
17
|
constructor(options?: {
|
|
18
18
|
/**
|
|
19
19
|
* Directory where ormconfig should be read from.
|
|
20
20
|
* By default its your application root (where your app package.json is located).
|
|
21
21
|
*/
|
|
22
|
-
root?: string
|
|
22
|
+
root?: string;
|
|
23
23
|
/**
|
|
24
24
|
* Filename of the ormconfig configuration. By default its equal to "ormconfig".
|
|
25
25
|
*/
|
|
26
|
-
configName?: string
|
|
26
|
+
configName?: string;
|
|
27
27
|
} | undefined);
|
|
28
28
|
/**
|
|
29
29
|
* Returns all connection options read from the ormconfig.
|
package/container.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.useContainer = useContainer;
|
|
4
|
+
exports.getFromContainer = getFromContainer;
|
|
4
5
|
/**
|
|
5
6
|
* Container to be used by this library for inversion control. If container was not implicitly set then by default
|
|
6
7
|
* container simply creates a new instance of the given class.
|
|
@@ -34,7 +35,6 @@ function useContainer(iocContainer, options) {
|
|
|
34
35
|
userContainer = iocContainer;
|
|
35
36
|
userContainerOptions = options;
|
|
36
37
|
}
|
|
37
|
-
exports.useContainer = useContainer;
|
|
38
38
|
/**
|
|
39
39
|
* Gets the IOC container used by this library.
|
|
40
40
|
*
|
|
@@ -56,6 +56,5 @@ function getFromContainer(someClass) {
|
|
|
56
56
|
}
|
|
57
57
|
return defaultContainer.get(someClass);
|
|
58
58
|
}
|
|
59
|
-
exports.getFromContainer = getFromContainer;
|
|
60
59
|
|
|
61
60
|
//# sourceMappingURL=container.js.map
|
package/container.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/container.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/container.ts"],"names":[],"mappings":";;AA8DA,oCAMC;AAOD,4CAcC;AA5DD;;;;;GAKG;AACH,MAAM,gBAAgB,GAAuB,IAAI,CAAC;IAAA;QAGtC,cAAS,GAAsC,EAAE,CAAA;IAc7D,CAAC;IAZG,GAAG,CAAI,SAA2B;QAC9B,IAAI,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAA;QAC/D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,QAAQ,GAAG;gBACP,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,IAAK,SAAyB,EAAE;aAC3C,CAAA;YACD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACjC,CAAC;QAED,OAAO,QAAQ,CAAC,MAAM,CAAA;IAC1B,CAAC;CACJ,CAAC,EAAE,CAAA;AAEJ,IAAI,aAAiC,CAAA;AACrC,IAAI,oBAAqD,CAAA;AAEzD;;;;GAIG;AACH,SAAgB,YAAY,CACxB,YAAgC,EAChC,OAA6B;IAE7B,aAAa,GAAG,YAAY,CAAA;IAC5B,oBAAoB,GAAG,OAAO,CAAA;AAClC,CAAC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAI,SAA2B;IAC3D,IAAI,aAAa,EAAE,CAAC;QAChB,IAAI,CAAC;YACD,MAAM,QAAQ,GAAG,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,CAAA;YAC7C,IAAI,QAAQ;gBAAE,OAAO,QAAQ,CAAA;YAE7B,IAAI,CAAC,oBAAoB,IAAI,CAAC,oBAAoB,CAAC,QAAQ;gBACvD,OAAO,QAAQ,CAAA;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,IAAI,CAAC,oBAAoB,IAAI,CAAC,oBAAoB,CAAC,gBAAgB;gBAC/D,MAAM,KAAK,CAAA;QACnB,CAAC;IACL,CAAC;IACD,OAAO,gBAAgB,CAAC,GAAG,CAAI,SAAS,CAAC,CAAA;AAC7C,CAAC","file":"container.js","sourcesContent":["/**\n * Container options.\n *\n * @deprecated\n */\nexport interface UseContainerOptions {\n /**\n * If set to true, then default container will be used in the case if given container haven't returned anything.\n */\n fallback?: boolean\n\n /**\n * If set to true, then default container will be used in the case if given container thrown an exception.\n */\n fallbackOnErrors?: boolean\n}\n\n/**\n * @deprecated\n */\nexport type ContainedType<T> = { new (...args: any[]): T } | Function\n\n/**\n * @deprecated\n */\nexport interface ContainerInterface {\n get<T>(someClass: ContainedType<T>): T\n}\n\n/**\n * Container to be used by this library for inversion control. If container was not implicitly set then by default\n * container simply creates a new instance of the given class.\n *\n * @deprecated\n */\nconst defaultContainer: ContainerInterface = new (class\n implements ContainerInterface\n{\n private instances: { type: Function; object: any }[] = []\n\n get<T>(someClass: ContainedType<T>): T {\n let instance = this.instances.find((i) => i.type === someClass)\n if (!instance) {\n instance = {\n type: someClass,\n object: new (someClass as new () => T)(),\n }\n this.instances.push(instance)\n }\n\n return instance.object\n }\n})()\n\nlet userContainer: ContainerInterface\nlet userContainerOptions: UseContainerOptions | undefined\n\n/**\n * Sets container to be used by this library.\n *\n * @deprecated\n */\nexport function useContainer(\n iocContainer: ContainerInterface,\n options?: UseContainerOptions,\n) {\n userContainer = iocContainer\n userContainerOptions = options\n}\n\n/**\n * Gets the IOC container used by this library.\n *\n * @deprecated\n */\nexport function getFromContainer<T>(someClass: ContainedType<T>): T {\n if (userContainer) {\n try {\n const instance = userContainer.get(someClass)\n if (instance) return instance\n\n if (!userContainerOptions || !userContainerOptions.fallback)\n return instance\n } catch (error) {\n if (!userContainerOptions || !userContainerOptions.fallbackOnErrors)\n throw error\n }\n }\n return defaultContainer.get<T>(someClass)\n}\n"],"sourceRoot":"."}
|
package/decorator/Check.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Check =
|
|
3
|
+
exports.Check = Check;
|
|
4
4
|
const globals_1 = require("../globals");
|
|
5
5
|
const error_1 = require("../error");
|
|
6
6
|
/**
|
|
@@ -23,6 +23,5 @@ function Check(nameOrExpression, maybeExpression) {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
exports.Check = Check;
|
|
27
26
|
|
|
28
27
|
//# sourceMappingURL=Check.js.map
|
package/decorator/Check.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/Check.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/Check.ts"],"names":[],"mappings":";;AA0BA,sBAqBC;AA/CD,wCAAmD;AAEnD,oCAAuC;AAmBvC;;;;GAIG;AACH,SAAgB,KAAK,CACjB,gBAAwB,EACxB,eAAwB;IAExB,MAAM,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAA;IAC3D,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAA;IAEvE,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,oBAAY,CAAC,8BAA8B,CAAC,CAAA;IAEvE,OAAO,UACH,WAA8B,EAC9B,YAA8B;QAE9B,IAAA,gCAAsB,GAAE,CAAC,MAAM,CAAC,IAAI,CAAC;YACjC,MAAM,EAAE,YAAY;gBAChB,CAAC,CAAC,WAAW,CAAC,WAAW;gBACzB,CAAC,CAAE,WAAwB;YAC/B,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,UAAU;SACJ,CAAC,CAAA;IAC3B,CAAC,CAAA;AACL,CAAC","file":"Check.js","sourcesContent":["import { getMetadataArgsStorage } from \"../globals\"\nimport { CheckMetadataArgs } from \"../metadata-args/CheckMetadataArgs\"\nimport { TypeORMError } from \"../error\"\n\n/**\n * Creates a database check.\n * Can be used on entity property or on entity.\n * Can create checks with composite columns when used on entity.\n */\nexport function Check(expression: string): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database check.\n * Can be used on entity property or on entity.\n * Can create checks with composite columns when used on entity.\n */\nexport function Check(\n name: string,\n expression: string,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database check.\n * Can be used on entity property or on entity.\n * Can create checks with composite columns when used on entity.\n */\nexport function Check(\n nameOrExpression: string,\n maybeExpression?: string,\n): ClassDecorator & PropertyDecorator {\n const name = maybeExpression ? nameOrExpression : undefined\n const expression = maybeExpression ? maybeExpression : nameOrExpression\n\n if (!expression) throw new TypeORMError(`Check expression is required`)\n\n return function (\n clsOrObject: Function | Object,\n propertyName?: string | symbol,\n ) {\n getMetadataArgsStorage().checks.push({\n target: propertyName\n ? clsOrObject.constructor\n : (clsOrObject as Function),\n name: name,\n expression: expression,\n } as CheckMetadataArgs)\n }\n}\n"],"sourceRoot":".."}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EntityRepository =
|
|
3
|
+
exports.EntityRepository = EntityRepository;
|
|
4
4
|
const globals_1 = require("../globals");
|
|
5
5
|
/**
|
|
6
6
|
* Used to declare a class as a custom repository.
|
|
@@ -17,6 +17,5 @@ function EntityRepository(entity) {
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.EntityRepository = EntityRepository;
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=EntityRepository.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/EntityRepository.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/EntityRepository.ts"],"names":[],"mappings":";;AAWA,4CASC;AApBD,wCAAmD;AAInD;;;;;;GAMG;AACH,SAAgB,gBAAgB,CAC5B,MAAqC;IAErC,OAAO,UAAU,MAAgB;QAC7B,IAAA,gCAAsB,GAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAC7C,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,MAAM;SACe,CAAC,CAAA;IACtC,CAAC,CAAA;AACL,CAAC","file":"EntityRepository.js","sourcesContent":["import { getMetadataArgsStorage } from \"../globals\"\nimport { EntityRepositoryMetadataArgs } from \"../metadata-args/EntityRepositoryMetadataArgs\"\nimport { EntitySchema } from \"../entity-schema/EntitySchema\"\n\n/**\n * Used to declare a class as a custom repository.\n * Custom repository can manage some specific entity or just be generic.\n * Custom repository optionally can extend AbstractRepository, Repository or TreeRepository.\n *\n * @deprecated use Repository.extend function to create a custom repository\n */\nexport function EntityRepository(\n entity?: Function | EntitySchema<any>,\n): ClassDecorator {\n return function (target: Function) {\n getMetadataArgsStorage().entityRepositories.push({\n target: target,\n entity: entity,\n } as EntityRepositoryMetadataArgs)\n }\n}\n"],"sourceRoot":".."}
|
package/decorator/Exclusion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Exclusion =
|
|
3
|
+
exports.Exclusion = Exclusion;
|
|
4
4
|
const globals_1 = require("../globals");
|
|
5
5
|
const error_1 = require("../error");
|
|
6
6
|
/**
|
|
@@ -23,6 +23,5 @@ function Exclusion(nameOrExpression, maybeExpression) {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
exports.Exclusion = Exclusion;
|
|
27
26
|
|
|
28
27
|
//# sourceMappingURL=Exclusion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/Exclusion.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/Exclusion.ts"],"names":[],"mappings":";;AA4BA,8BAqBC;AAjDD,wCAAmD;AAEnD,oCAAuC;AAqBvC;;;;GAIG;AACH,SAAgB,SAAS,CACrB,gBAAwB,EACxB,eAAwB;IAExB,MAAM,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,SAAS,CAAA;IAC3D,MAAM,UAAU,GAAG,eAAe,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAA;IAEvE,IAAI,CAAC,UAAU;QAAE,MAAM,IAAI,oBAAY,CAAC,kCAAkC,CAAC,CAAA;IAE3E,OAAO,UACH,WAA8B,EAC9B,YAA8B;QAE9B,IAAA,gCAAsB,GAAE,CAAC,UAAU,CAAC,IAAI,CAAC;YACrC,MAAM,EAAE,YAAY;gBAChB,CAAC,CAAC,WAAW,CAAC,WAAW;gBACzB,CAAC,CAAE,WAAwB;YAC/B,IAAI,EAAE,IAAI;YACV,UAAU,EAAE,UAAU;SACA,CAAC,CAAA;IAC/B,CAAC,CAAA;AACL,CAAC","file":"Exclusion.js","sourcesContent":["import { getMetadataArgsStorage } from \"../globals\"\nimport { ExclusionMetadataArgs } from \"../metadata-args/ExclusionMetadataArgs\"\nimport { TypeORMError } from \"../error\"\n\n/**\n * Creates a database exclusion.\n * Can be used on entity.\n * Can create exclusions with composite columns when used on entity.\n */\nexport function Exclusion(\n expression: string,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database exclusion.\n * Can be used on entity.\n * Can create exclusions with composite columns when used on entity.\n */\nexport function Exclusion(\n name: string,\n expression: string,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database exclusion.\n * Can be used on entity.\n * Can create exclusions with composite columns when used on entity.\n */\nexport function Exclusion(\n nameOrExpression: string,\n maybeExpression?: string,\n): ClassDecorator & PropertyDecorator {\n const name = maybeExpression ? nameOrExpression : undefined\n const expression = maybeExpression ? maybeExpression : nameOrExpression\n\n if (!expression) throw new TypeORMError(`Exclusion expression is required`)\n\n return function (\n clsOrObject: Function | Object,\n propertyName?: string | symbol,\n ) {\n getMetadataArgsStorage().exclusions.push({\n target: propertyName\n ? clsOrObject.constructor\n : (clsOrObject as Function),\n name: name,\n expression: expression,\n } as ExclusionMetadataArgs)\n }\n}\n"],"sourceRoot":".."}
|
package/decorator/Generated.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Generated =
|
|
3
|
+
exports.Generated = Generated;
|
|
4
4
|
const globals_1 = require("../globals");
|
|
5
5
|
/**
|
|
6
6
|
* Marks a column to generate a value on entity insertion.
|
|
@@ -20,6 +20,5 @@ function Generated(strategy = "increment") {
|
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
exports.Generated = Generated;
|
|
24
23
|
|
|
25
24
|
//# sourceMappingURL=Generated.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/Generated.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/Generated.ts"],"names":[],"mappings":";;AAYA,8BAUC;AAtBD,wCAAmD;AAGnD;;;;;;;;GAQG;AACH,SAAgB,SAAS,CACrB,WAA2C,WAAW;IAEtD,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,IAAA,gCAAsB,GAAE,CAAC,WAAW,CAAC,IAAI,CAAC;YACtC,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,QAAQ,EAAE,QAAQ;SACI,CAAC,CAAA;IAC/B,CAAC,CAAA;AACL,CAAC","file":"Generated.js","sourcesContent":["import { getMetadataArgsStorage } from \"../globals\"\nimport { GeneratedMetadataArgs } from \"../metadata-args/GeneratedMetadataArgs\"\n\n/**\n * Marks a column to generate a value on entity insertion.\n * There are three types of generation strategy - increment, uuid and rowid (cockroachdb only).\n * Increment uses a number which increases by one on each insertion.\n * Uuid generates a special UUID token.\n * Rowid supports only in CockroachDB and uses `unique_rowid()` function\n *\n * Note, some databases do not support non-primary generation columns.\n */\nexport function Generated(\n strategy: \"increment\" | \"uuid\" | \"rowid\" = \"increment\",\n): PropertyDecorator {\n return function (object: Object, propertyName: string) {\n getMetadataArgsStorage().generations.push({\n target: object.constructor,\n propertyName: propertyName,\n strategy: strategy,\n } as GeneratedMetadataArgs)\n }\n}\n"],"sourceRoot":".."}
|
package/decorator/Index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Index =
|
|
3
|
+
exports.Index = Index;
|
|
4
4
|
const globals_1 = require("../globals");
|
|
5
5
|
const ObjectUtils_1 = require("../util/ObjectUtils");
|
|
6
6
|
/**
|
|
@@ -52,6 +52,5 @@ function Index(nameOrFieldsOrOptions, maybeFieldsOrOptions, maybeOptions) {
|
|
|
52
52
|
});
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
-
exports.Index = Index;
|
|
56
55
|
|
|
57
56
|
//# sourceMappingURL=Index.js.map
|
package/decorator/Index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/Index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/Index.ts"],"names":[],"mappings":";;AAiFA,sBAkEC;AAnJD,wCAAmD;AAGnD,qDAAiD;AAyEjD;;;;GAIG;AACH,SAAgB,KAAK,CACjB,qBAIkB,EAClB,oBAI4B,EAC5B,YAA2B;IAE3B,uBAAuB;IACvB,MAAM,IAAI,GACN,OAAO,qBAAqB,KAAK,QAAQ;QACrC,CAAC,CAAC,qBAAqB;QACvB,CAAC,CAAC,SAAS,CAAA;IACnB,MAAM,MAAM,GACR,OAAO,qBAAqB,KAAK,QAAQ;QACrC,CAAC,CAGE,oBAAoB;QACvB,CAAC,CAAE,qBAAkC,CAAA;IAC7C,IAAI,OAAO,GACP,yBAAW,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QAC3C,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB,CAAC;QACjC,CAAC,CAAE,qBAAsC;QACzC,CAAC,CAAC,YAAY,CAAA;IACtB,IAAI,CAAC,OAAO;QACR,OAAO;YACH,yBAAW,CAAC,QAAQ,CAAC,oBAAoB,CAAC;gBAC1C,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC;gBAChC,CAAC,CAAE,oBAAqC;gBACxC,CAAC,CAAC,YAAY,CAAA;IAE1B,OAAO,UACH,WAA8B,EAC9B,YAA8B;QAE9B,IAAA,gCAAsB,GAAE,CAAC,OAAO,CAAC,IAAI,CAAC;YAClC,MAAM,EAAE,YAAY;gBAChB,CAAC,CAAC,WAAW,CAAC,WAAW;gBACzB,CAAC,CAAE,WAAwB;YAC/B,IAAI,EAAE,IAAI;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM;YAC/C,WAAW,EACP,OAAO;gBACN,OAAkC,CAAC,WAAW,KAAK,KAAK;gBACrD,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,IAAI;YACd,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;YAC1C,MAAM,EAAE,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YAChD,OAAO,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YAClD,QAAQ,EAAE,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YACpD,YAAY,EAAE,OAAO,IAAI,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YAC5D,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;YAC5C,MAAM,EAAE,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YAChD,UAAU,EAAE,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YACxD,UAAU,EAAE,OAAO,IAAI,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;YACxD,kBAAkB,EAAE,OAAO;gBACvB,CAAC,CAAC,OAAO,CAAC,kBAAkB;gBAC5B,CAAC,CAAC,SAAS;SACG,CAAC,CAAA;IAC3B,CAAC,CAAA;AACL,CAAC","file":"Index.js","sourcesContent":["import { getMetadataArgsStorage } from \"../globals\"\nimport { IndexMetadataArgs } from \"../metadata-args/IndexMetadataArgs\"\nimport { IndexOptions } from \"./options/IndexOptions\"\nimport { ObjectUtils } from \"../util/ObjectUtils\"\n\n/**\n * Creates a database index.\n * Can be used on entity property or on entity.\n * Can create indices with composite columns when used on entity.\n */\nexport function Index(\n options?: IndexOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database index.\n * Can be used on entity property or on entity.\n * Can create indices with composite columns when used on entity.\n */\nexport function Index(\n name: string,\n options?: IndexOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database index.\n * Can be used on entity property or on entity.\n * Can create indices with composite columns when used on entity.\n */\nexport function Index(\n name: string,\n options: { synchronize: false },\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database index.\n * Can be used on entity property or on entity.\n * Can create indices with composite columns when used on entity.\n */\nexport function Index(\n name: string,\n fields: string[],\n options?: IndexOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database index.\n * Can be used on entity property or on entity.\n * Can create indices with composite columns when used on entity.\n */\nexport function Index(\n fields: string[],\n options?: IndexOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database index.\n * Can be used on entity property or on entity.\n * Can create indices with composite columns when used on entity.\n */\nexport function Index(\n fields: (object?: any) => any[] | { [key: string]: number },\n options?: IndexOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database index.\n * Can be used on entity property or on entity.\n * Can create indices with composite columns when used on entity.\n */\nexport function Index(\n name: string,\n fields: (object?: any) => any[] | { [key: string]: number },\n options?: IndexOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Creates a database index.\n * Can be used on entity property or on entity.\n * Can create indices with composite columns when used on entity.\n */\nexport function Index(\n nameOrFieldsOrOptions?:\n | string\n | string[]\n | ((object: any) => any[] | { [key: string]: number })\n | IndexOptions,\n maybeFieldsOrOptions?:\n | ((object?: any) => any[] | { [key: string]: number })\n | IndexOptions\n | string[]\n | { synchronize: false },\n maybeOptions?: IndexOptions,\n): ClassDecorator & PropertyDecorator {\n // normalize parameters\n const name =\n typeof nameOrFieldsOrOptions === \"string\"\n ? nameOrFieldsOrOptions\n : undefined\n const fields =\n typeof nameOrFieldsOrOptions === \"string\"\n ? <\n | ((object?: any) => any[] | { [key: string]: number })\n | string[]\n >maybeFieldsOrOptions\n : (nameOrFieldsOrOptions as string[])\n let options =\n ObjectUtils.isObject(nameOrFieldsOrOptions) &&\n !Array.isArray(nameOrFieldsOrOptions)\n ? (nameOrFieldsOrOptions as IndexOptions)\n : maybeOptions\n if (!options)\n options =\n ObjectUtils.isObject(maybeFieldsOrOptions) &&\n !Array.isArray(maybeFieldsOrOptions)\n ? (maybeFieldsOrOptions as IndexOptions)\n : maybeOptions\n\n return function (\n clsOrObject: Function | Object,\n propertyName?: string | symbol,\n ) {\n getMetadataArgsStorage().indices.push({\n target: propertyName\n ? clsOrObject.constructor\n : (clsOrObject as Function),\n name: name,\n columns: propertyName ? [propertyName] : fields,\n synchronize:\n options &&\n (options as { synchronize: false }).synchronize === false\n ? false\n : true,\n where: options ? options.where : undefined,\n unique: options && options.unique ? true : false,\n spatial: options && options.spatial ? true : false,\n fulltext: options && options.fulltext ? true : false,\n nullFiltered: options && options.nullFiltered ? true : false,\n parser: options ? options.parser : undefined,\n sparse: options && options.sparse ? true : false,\n background: options && options.background ? true : false,\n concurrent: options && options.concurrent ? true : false,\n expireAfterSeconds: options\n ? options.expireAfterSeconds\n : undefined,\n } as IndexMetadataArgs)\n }\n}\n"],"sourceRoot":".."}
|
package/decorator/Unique.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Unique =
|
|
3
|
+
exports.Unique = Unique;
|
|
4
4
|
const globals_1 = require("../globals");
|
|
5
5
|
const ObjectUtils_1 = require("../util/ObjectUtils");
|
|
6
6
|
/**
|
|
@@ -46,6 +46,5 @@ function Unique(nameOrFieldsOrOptions, maybeFieldsOrOptions, maybeOptions) {
|
|
|
46
46
|
(0, globals_1.getMetadataArgsStorage)().uniques.push(args);
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
exports.Unique = Unique;
|
|
50
49
|
|
|
51
50
|
//# sourceMappingURL=Unique.js.map
|
package/decorator/Unique.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/Unique.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/Unique.ts"],"names":[],"mappings":";;AA0CA,wBA+DC;AAzGD,wCAAmD;AAGnD,qDAAiD;AAoCjD;;GAEG;AACH,SAAgB,MAAM,CAClB,qBAImB,EACnB,oBAGmB,EACnB,YAA4B;IAE5B,MAAM,IAAI,GACN,OAAO,qBAAqB,KAAK,QAAQ;QACrC,CAAC,CAAC,qBAAqB;QACvB,CAAC,CAAC,SAAS,CAAA;IACnB,MAAM,MAAM,GACR,OAAO,qBAAqB,KAAK,QAAQ;QACrC,CAAC,CAGE,oBAAoB;QACvB,CAAC,CAAE,qBAAkC,CAAA;IAC7C,IAAI,OAAO,GACP,yBAAW,CAAC,QAAQ,CAAC,qBAAqB,CAAC;QAC3C,CAAC,KAAK,CAAC,OAAO,CAAC,qBAAqB,CAAC;QACjC,CAAC,CAAE,qBAAuC;QAC1C,CAAC,CAAC,YAAY,CAAA;IACtB,IAAI,CAAC,OAAO;QACR,OAAO;YACH,yBAAW,CAAC,QAAQ,CAAC,qBAAqB,CAAC;gBAC3C,CAAC,KAAK,CAAC,OAAO,CAAC,oBAAoB,CAAC;gBAChC,CAAC,CAAE,oBAAsC;gBACzC,CAAC,CAAC,YAAY,CAAA;IAE1B,OAAO,UACH,WAA8B,EAC9B,YAA8B;QAE9B,IAAI,OAAO,GAAG,MAAM,CAAA;QAEpB,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC7B,QAAQ,OAAO,YAAY,EAAE,CAAC;gBAC1B,KAAK,QAAQ;oBACT,OAAO,GAAG,CAAC,YAAY,CAAC,CAAA;oBACxB,MAAK;gBAET,KAAK,QAAQ;oBACT,OAAO,GAAG,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAA;oBACnC,MAAK;YACb,CAAC;QACL,CAAC;QAED,MAAM,IAAI,GAAuB;YAC7B,MAAM,EAAE,YAAY;gBAChB,CAAC,CAAC,WAAW,CAAC,WAAW;gBACzB,CAAC,CAAE,WAAwB;YAC/B,IAAI,EAAE,IAAI;YACV,OAAO;YACP,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;SACvD,CAAA;QACD,IAAA,gCAAsB,GAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/C,CAAC,CAAA;AACL,CAAC","file":"Unique.js","sourcesContent":["import { getMetadataArgsStorage } from \"../globals\"\nimport { UniqueMetadataArgs } from \"../metadata-args/UniqueMetadataArgs\"\nimport { UniqueOptions } from \"./options/UniqueOptions\"\nimport { ObjectUtils } from \"../util/ObjectUtils\"\n\n/**\n * Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.\n */\nexport function Unique(\n name: string,\n fields: string[],\n options?: UniqueOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.\n */\nexport function Unique(\n fields: string[],\n options?: UniqueOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.\n */\nexport function Unique(\n fields: (object?: any) => any[] | { [key: string]: number },\n options?: UniqueOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.\n */\nexport function Unique(\n name: string,\n fields: (object?: any) => any[] | { [key: string]: number },\n options?: UniqueOptions,\n): ClassDecorator & PropertyDecorator\n\n/**\n * Composite unique constraint must be set on entity classes and must specify entity's fields to be unique.\n */\nexport function Unique(\n nameOrFieldsOrOptions?:\n | string\n | string[]\n | ((object: any) => any[] | { [key: string]: number })\n | UniqueOptions,\n maybeFieldsOrOptions?:\n | ((object?: any) => any[] | { [key: string]: number })\n | string[]\n | UniqueOptions,\n maybeOptions?: UniqueOptions,\n): ClassDecorator & PropertyDecorator {\n const name =\n typeof nameOrFieldsOrOptions === \"string\"\n ? nameOrFieldsOrOptions\n : undefined\n const fields =\n typeof nameOrFieldsOrOptions === \"string\"\n ? <\n | ((object?: any) => any[] | { [key: string]: number })\n | string[]\n >maybeFieldsOrOptions\n : (nameOrFieldsOrOptions as string[])\n let options =\n ObjectUtils.isObject(nameOrFieldsOrOptions) &&\n !Array.isArray(nameOrFieldsOrOptions)\n ? (nameOrFieldsOrOptions as UniqueOptions)\n : maybeOptions\n if (!options)\n options =\n ObjectUtils.isObject(nameOrFieldsOrOptions) &&\n !Array.isArray(maybeFieldsOrOptions)\n ? (maybeFieldsOrOptions as UniqueOptions)\n : maybeOptions\n\n return function (\n clsOrObject: Function | Object,\n propertyName?: string | symbol,\n ) {\n let columns = fields\n\n if (propertyName !== undefined) {\n switch (typeof propertyName) {\n case \"string\":\n columns = [propertyName]\n break\n\n case \"symbol\":\n columns = [propertyName.toString()]\n break\n }\n }\n\n const args: UniqueMetadataArgs = {\n target: propertyName\n ? clsOrObject.constructor\n : (clsOrObject as Function),\n name: name,\n columns,\n deferrable: options ? options.deferrable : undefined,\n }\n getMetadataArgsStorage().uniques.push(args)\n }\n}\n"],"sourceRoot":".."}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Column =
|
|
3
|
+
exports.Column = Column;
|
|
4
4
|
const globals_1 = require("../../globals");
|
|
5
5
|
const ColumnTypeUndefinedError_1 = require("../../error/ColumnTypeUndefinedError");
|
|
6
6
|
/**
|
|
@@ -74,6 +74,5 @@ function Column(typeOrOptions, options) {
|
|
|
74
74
|
}
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
exports.Column = Column;
|
|
78
77
|
|
|
79
78
|
//# sourceMappingURL=Column.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/columns/Column.ts"],"names":[],"mappings":"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","file":"Column.js","sourcesContent":["import { getMetadataArgsStorage } from \"../../globals\"\nimport {\n ColumnType,\n SimpleColumnType,\n SpatialColumnType,\n WithLengthColumnType,\n WithPrecisionColumnType,\n WithWidthColumnType,\n} from \"../../driver/types/ColumnTypes\"\nimport { ColumnMetadataArgs } from \"../../metadata-args/ColumnMetadataArgs\"\nimport { ColumnCommonOptions } from \"../options/ColumnCommonOptions\"\nimport { SpatialColumnOptions } from \"../options/SpatialColumnOptions\"\nimport { ColumnWithLengthOptions } from \"../options/ColumnWithLengthOptions\"\nimport { ColumnNumericOptions } from \"../options/ColumnNumericOptions\"\nimport { ColumnEnumOptions } from \"../options/ColumnEnumOptions\"\nimport { ColumnEmbeddedOptions } from \"../options/ColumnEmbeddedOptions\"\nimport { EmbeddedMetadataArgs } from \"../../metadata-args/EmbeddedMetadataArgs\"\nimport { ColumnTypeUndefinedError } from \"../../error/ColumnTypeUndefinedError\"\nimport { ColumnHstoreOptions } from \"../options/ColumnHstoreOptions\"\nimport { ColumnWithWidthOptions } from \"../options/ColumnWithWidthOptions\"\nimport { GeneratedMetadataArgs } from \"../../metadata-args/GeneratedMetadataArgs\"\nimport { ColumnOptions } from \"../options/ColumnOptions\"\n\n/**\n * Column decorator is used to mark a specific class property as a table column. Only properties decorated with this\n * decorator will be persisted to the database when entity be saved.\n */\nexport function Column(): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(options: ColumnOptions): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: SimpleColumnType,\n options?: ColumnCommonOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: SpatialColumnType,\n options?: ColumnCommonOptions & SpatialColumnOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithLengthColumnType,\n options?: ColumnCommonOptions & ColumnWithLengthOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithWidthColumnType,\n options?: ColumnCommonOptions & ColumnWithWidthOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithPrecisionColumnType,\n options?: ColumnCommonOptions & ColumnNumericOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"enum\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"simple-enum\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"set\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"hstore\",\n options?: ColumnCommonOptions & ColumnHstoreOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n *\n * Property in entity can be marked as Embedded, and on persist all columns from the embedded are mapped to the\n * single table of the entity where Embedded is used. And on hydration all columns which supposed to be in the\n * embedded will be mapped to it from the single table.\n */\nexport function Column(\n type: (type?: any) => Function,\n options?: ColumnEmbeddedOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n typeOrOptions?:\n | ((type?: any) => Function)\n | ColumnType\n | (ColumnOptions & ColumnEmbeddedOptions),\n options?: ColumnOptions & ColumnEmbeddedOptions,\n): PropertyDecorator {\n return function (object: Object, propertyName: string) {\n // normalize parameters\n let type: ColumnType | undefined\n if (\n typeof typeOrOptions === \"string\" ||\n typeof typeOrOptions === \"function\"\n ) {\n type = <ColumnType>typeOrOptions\n } else if (typeOrOptions) {\n options = <ColumnOptions>typeOrOptions\n type = typeOrOptions.type\n }\n if (!options) options = {} as ColumnOptions\n\n // if type is not given explicitly then try to guess it\n const reflectMetadataType =\n Reflect && (Reflect as any).getMetadata\n ? (Reflect as any).getMetadata(\n \"design:type\",\n object,\n propertyName,\n )\n : undefined\n if (!type && reflectMetadataType)\n // if type is not given explicitly then try to guess it\n type = reflectMetadataType\n\n // check if there is no type in column options then set type from first function argument, or guessed one\n if (!options.type && type) options.type = type\n\n // specify HSTORE type if column is HSTORE\n if (options.type === \"hstore\" && !options.hstoreType)\n options.hstoreType =\n reflectMetadataType === Object ? \"object\" : \"string\"\n\n if (typeof typeOrOptions === \"function\") {\n // register an embedded\n getMetadataArgsStorage().embeddeds.push({\n target: object.constructor,\n propertyName: propertyName,\n isArray:\n reflectMetadataType === Array || options.array === true,\n prefix:\n options.prefix !== undefined ? options.prefix : undefined,\n type: typeOrOptions as (type?: any) => Function,\n } as EmbeddedMetadataArgs)\n } else {\n // register a regular column\n\n // if we still don't have a type then we need to give error to user that type is required\n if (!options.type)\n throw new ColumnTypeUndefinedError(object, propertyName)\n\n // create unique\n if (options.unique === true)\n getMetadataArgsStorage().uniques.push({\n target: object.constructor,\n columns: [propertyName],\n })\n\n getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"regular\",\n options: options,\n } as ColumnMetadataArgs)\n\n if (options.generated) {\n getMetadataArgsStorage().generations.push({\n target: object.constructor,\n propertyName: propertyName,\n strategy:\n typeof options.generated === \"string\"\n ? options.generated\n : \"increment\",\n } as GeneratedMetadataArgs)\n }\n }\n }\n}\n"],"sourceRoot":"../.."}
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/columns/Column.ts"],"names":[],"mappings":"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","file":"Column.js","sourcesContent":["import { getMetadataArgsStorage } from \"../../globals\"\nimport {\n ColumnType,\n SimpleColumnType,\n SpatialColumnType,\n WithLengthColumnType,\n WithPrecisionColumnType,\n WithWidthColumnType,\n} from \"../../driver/types/ColumnTypes\"\nimport { ColumnMetadataArgs } from \"../../metadata-args/ColumnMetadataArgs\"\nimport { ColumnCommonOptions } from \"../options/ColumnCommonOptions\"\nimport { SpatialColumnOptions } from \"../options/SpatialColumnOptions\"\nimport { ColumnWithLengthOptions } from \"../options/ColumnWithLengthOptions\"\nimport { ColumnNumericOptions } from \"../options/ColumnNumericOptions\"\nimport { ColumnEnumOptions } from \"../options/ColumnEnumOptions\"\nimport { ColumnEmbeddedOptions } from \"../options/ColumnEmbeddedOptions\"\nimport { EmbeddedMetadataArgs } from \"../../metadata-args/EmbeddedMetadataArgs\"\nimport { ColumnTypeUndefinedError } from \"../../error/ColumnTypeUndefinedError\"\nimport { ColumnHstoreOptions } from \"../options/ColumnHstoreOptions\"\nimport { ColumnWithWidthOptions } from \"../options/ColumnWithWidthOptions\"\nimport { GeneratedMetadataArgs } from \"../../metadata-args/GeneratedMetadataArgs\"\nimport { ColumnOptions } from \"../options/ColumnOptions\"\n\n/**\n * Column decorator is used to mark a specific class property as a table column. Only properties decorated with this\n * decorator will be persisted to the database when entity be saved.\n */\nexport function Column(): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(options: ColumnOptions): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: SimpleColumnType,\n options?: ColumnCommonOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: SpatialColumnType,\n options?: ColumnCommonOptions & SpatialColumnOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithLengthColumnType,\n options?: ColumnCommonOptions & ColumnWithLengthOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithWidthColumnType,\n options?: ColumnCommonOptions & ColumnWithWidthOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: WithPrecisionColumnType,\n options?: ColumnCommonOptions & ColumnNumericOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"enum\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"simple-enum\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"set\",\n options?: ColumnCommonOptions & ColumnEnumOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n type: \"hstore\",\n options?: ColumnCommonOptions & ColumnHstoreOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n *\n * Property in entity can be marked as Embedded, and on persist all columns from the embedded are mapped to the\n * single table of the entity where Embedded is used. And on hydration all columns which supposed to be in the\n * embedded will be mapped to it from the single table.\n */\nexport function Column(\n type: (type?: any) => Function,\n options?: ColumnEmbeddedOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n */\nexport function Column(\n typeOrOptions?:\n | ((type?: any) => Function)\n | ColumnType\n | (ColumnOptions & ColumnEmbeddedOptions),\n options?: ColumnOptions & ColumnEmbeddedOptions,\n): PropertyDecorator {\n return function (object: Object, propertyName: string) {\n // normalize parameters\n let type: ColumnType | undefined\n if (\n typeof typeOrOptions === \"string\" ||\n typeof typeOrOptions === \"function\"\n ) {\n type = <ColumnType>typeOrOptions\n } else if (typeOrOptions) {\n options = <ColumnOptions>typeOrOptions\n type = typeOrOptions.type\n }\n if (!options) options = {} as ColumnOptions\n\n // if type is not given explicitly then try to guess it\n const reflectMetadataType =\n Reflect && (Reflect as any).getMetadata\n ? (Reflect as any).getMetadata(\n \"design:type\",\n object,\n propertyName,\n )\n : undefined\n if (!type && reflectMetadataType)\n // if type is not given explicitly then try to guess it\n type = reflectMetadataType\n\n // check if there is no type in column options then set type from first function argument, or guessed one\n if (!options.type && type) options.type = type\n\n // specify HSTORE type if column is HSTORE\n if (options.type === \"hstore\" && !options.hstoreType)\n options.hstoreType =\n reflectMetadataType === Object ? \"object\" : \"string\"\n\n if (typeof typeOrOptions === \"function\") {\n // register an embedded\n getMetadataArgsStorage().embeddeds.push({\n target: object.constructor,\n propertyName: propertyName,\n isArray:\n reflectMetadataType === Array || options.array === true,\n prefix:\n options.prefix !== undefined ? options.prefix : undefined,\n type: typeOrOptions as (type?: any) => Function,\n } as EmbeddedMetadataArgs)\n } else {\n // register a regular column\n\n // if we still don't have a type then we need to give error to user that type is required\n if (!options.type)\n throw new ColumnTypeUndefinedError(object, propertyName)\n\n // create unique\n if (options.unique === true)\n getMetadataArgsStorage().uniques.push({\n target: object.constructor,\n columns: [propertyName],\n })\n\n getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"regular\",\n options: options,\n } as ColumnMetadataArgs)\n\n if (options.generated) {\n getMetadataArgsStorage().generations.push({\n target: object.constructor,\n propertyName: propertyName,\n strategy:\n typeof options.generated === \"string\"\n ? options.generated\n : \"increment\",\n } as GeneratedMetadataArgs)\n }\n }\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CreateDateColumn =
|
|
3
|
+
exports.CreateDateColumn = CreateDateColumn;
|
|
4
4
|
const globals_1 = require("../../globals");
|
|
5
5
|
/**
|
|
6
6
|
* This column will store a creation date of the inserted object.
|
|
@@ -17,6 +17,5 @@ function CreateDateColumn(options) {
|
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
}
|
|
20
|
-
exports.CreateDateColumn = CreateDateColumn;
|
|
21
20
|
|
|
22
21
|
//# sourceMappingURL=CreateDateColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/columns/CreateDateColumn.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/columns/CreateDateColumn.ts"],"names":[],"mappings":";;AASA,4CASC;AAlBD,2CAAsD;AAItD;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,OAAuB;IACpD,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,IAAA,gCAAsB,GAAE,CAAC,OAAO,CAAC,IAAI,CAAC;YAClC,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,OAAO,IAAI,EAAE;SACH,CAAC,CAAA;IAC5B,CAAC,CAAA;AACL,CAAC","file":"CreateDateColumn.js","sourcesContent":["import { getMetadataArgsStorage } from \"../../globals\"\nimport { ColumnMetadataArgs } from \"../../metadata-args/ColumnMetadataArgs\"\nimport { ColumnOptions } from \"../options/ColumnOptions\"\n\n/**\n * This column will store a creation date of the inserted object.\n * Creation date is generated and inserted only once,\n * at the first time when you create an object, the value is inserted into the table, and is never touched again.\n */\nexport function CreateDateColumn(options?: ColumnOptions): PropertyDecorator {\n return function (object: Object, propertyName: string) {\n getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"createDate\",\n options: options || {},\n } as ColumnMetadataArgs)\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DeleteDateColumn =
|
|
3
|
+
exports.DeleteDateColumn = DeleteDateColumn;
|
|
4
4
|
const globals_1 = require("../../globals");
|
|
5
5
|
/**
|
|
6
6
|
* This column will store a delete date of the soft-deleted object.
|
|
@@ -16,6 +16,5 @@ function DeleteDateColumn(options) {
|
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
exports.DeleteDateColumn = DeleteDateColumn;
|
|
20
19
|
|
|
21
20
|
//# sourceMappingURL=DeleteDateColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/columns/DeleteDateColumn.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/columns/DeleteDateColumn.ts"],"names":[],"mappings":";;AAQA,4CASC;AAjBD,2CAAsD;AAItD;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,OAAuB;IACpD,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,IAAA,gCAAsB,GAAE,CAAC,OAAO,CAAC,IAAI,CAAC;YAClC,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,YAAY;YAClB,OAAO,EAAE,OAAO,IAAI,EAAE;SACH,CAAC,CAAA;IAC5B,CAAC,CAAA;AACL,CAAC","file":"DeleteDateColumn.js","sourcesContent":["import { getMetadataArgsStorage } from \"../../globals\"\nimport { ColumnMetadataArgs } from \"../../metadata-args/ColumnMetadataArgs\"\nimport { ColumnOptions } from \"../options/ColumnOptions\"\n\n/**\n * This column will store a delete date of the soft-deleted object.\n * This date is being updated each time you soft-delete the object.\n */\nexport function DeleteDateColumn(options?: ColumnOptions): PropertyDecorator {\n return function (object: Object, propertyName: string) {\n getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"deleteDate\",\n options: options || {},\n } as ColumnMetadataArgs)\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObjectIdColumn =
|
|
3
|
+
exports.ObjectIdColumn = ObjectIdColumn;
|
|
4
4
|
const globals_1 = require("../../globals");
|
|
5
5
|
/**
|
|
6
6
|
* Special type of column that is available only for MongoDB database.
|
|
@@ -23,6 +23,5 @@ function ObjectIdColumn(options) {
|
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
exports.ObjectIdColumn = ObjectIdColumn;
|
|
27
26
|
|
|
28
27
|
//# sourceMappingURL=ObjectIdColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/columns/ObjectIdColumn.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/columns/ObjectIdColumn.ts"],"names":[],"mappings":";;AAQA,wCAeC;AAvBD,2CAAsD;AAItD;;;GAGG;AACH,SAAgB,cAAc,CAAC,OAAuB;IAClD,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,kEAAkE;QAClE,IAAI,CAAC,OAAO;YAAE,OAAO,GAAG,EAAmB,CAAA;QAC3C,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;QACtB,IAAI,CAAC,OAAO,CAAC,IAAI;YAAE,OAAO,CAAC,IAAI,GAAG,KAAK,CAAA;QAEvC,4CAA4C;QAC5C,IAAA,gCAAsB,GAAE,CAAC,OAAO,CAAC,IAAI,CAAC;YAClC,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,UAAU;YAChB,OAAO,EAAE,OAAO;SACG,CAAC,CAAA;IAC5B,CAAC,CAAA;AACL,CAAC","file":"ObjectIdColumn.js","sourcesContent":["import { getMetadataArgsStorage } from \"../../globals\"\nimport { ColumnMetadataArgs } from \"../../metadata-args/ColumnMetadataArgs\"\nimport { ColumnOptions } from \"../options/ColumnOptions\"\n\n/**\n * Special type of column that is available only for MongoDB database.\n * Marks your entity's column to be an object id.\n */\nexport function ObjectIdColumn(options?: ColumnOptions): PropertyDecorator {\n return function (object: Object, propertyName: string) {\n // if column options are not given then create a new empty options\n if (!options) options = {} as ColumnOptions\n options.primary = true\n if (!options.name) options.name = \"_id\"\n\n // create and register a new column metadata\n getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"objectId\",\n options: options,\n } as ColumnMetadataArgs)\n }\n}\n"],"sourceRoot":"../.."}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PrimaryColumn =
|
|
3
|
+
exports.PrimaryColumn = PrimaryColumn;
|
|
4
4
|
const globals_1 = require("../../globals");
|
|
5
5
|
const ColumnTypeUndefinedError_1 = require("../../error/ColumnTypeUndefinedError");
|
|
6
6
|
const PrimaryColumnCannotBeNullableError_1 = require("../../error/PrimaryColumnCannotBeNullableError");
|
|
@@ -59,6 +59,5 @@ function PrimaryColumn(typeOrOptions, options) {
|
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
-
exports.PrimaryColumn = PrimaryColumn;
|
|
63
62
|
|
|
64
63
|
//# sourceMappingURL=PrimaryColumn.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/decorator/columns/PrimaryColumn.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/decorator/columns/PrimaryColumn.ts"],"names":[],"mappings":";;AAoCA,sCA+DC;AAnGD,2CAAsD;AACtD,mFAA+E;AAC/E,uGAAmG;AA6BnG;;;;GAIG;AACH,SAAgB,aAAa,CACzB,aAAiD,EACjD,OAA8B;IAE9B,OAAO,UAAU,MAAc,EAAE,YAAoB;QACjD,uBAAuB;QACvB,IAAI,IAA4B,CAAA;QAChC,IACI,OAAO,aAAa,KAAK,QAAQ;YACjC,aAAa,KAAK,MAAM;YACxB,aAAa,KAAK,OAAO;YACzB,aAAa,KAAK,MAAM,EAC1B,CAAC;YACC,IAAI,GAAG,aAA2B,CAAA;QACtC,CAAC;aAAM,CAAC;YACJ,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAwB,aAAa,CAAC,CAAA;QACpE,CAAC;QACD,IAAI,CAAC,OAAO;YAAE,OAAO,GAAG,EAA0B,CAAA;QAElD,uDAAuD;QACvD,MAAM,mBAAmB,GACrB,OAAO,IAAK,OAAe,CAAC,WAAW;YACnC,CAAC,CAAE,OAAe,CAAC,WAAW,CACxB,aAAa,EACb,MAAM,EACN,YAAY,CACf;YACH,CAAC,CAAC,SAAS,CAAA;QACnB,IAAI,CAAC,IAAI,IAAI,mBAAmB;YAAE,IAAI,GAAG,mBAAmB,CAAA;QAE5D,yGAAyG;QACzG,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,IAAI;YAAE,OAAO,CAAC,IAAI,GAAG,IAAI,CAAA;QAE9C,yFAAyF;QACzF,IAAI,CAAC,OAAO,CAAC,IAAI;YACb,MAAM,IAAI,mDAAwB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;QAE5D,wFAAwF;QACxF,IAAI,OAAO,CAAC,QAAQ;YAChB,MAAM,IAAI,uEAAkC,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;QAEtE,6CAA6C;QAC7C,OAAO,CAAC,OAAO,GAAG,IAAI,CAAA;QAEtB,4CAA4C;QAC5C,IAAA,gCAAsB,GAAE,CAAC,OAAO,CAAC,IAAI,CAAC;YAClC,MAAM,EAAE,MAAM,CAAC,WAAW;YAC1B,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,OAAO;SACG,CAAC,CAAA;QAExB,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YACpB,IAAA,gCAAsB,GAAE,CAAC,WAAW,CAAC,IAAI,CAAC;gBACtC,MAAM,EAAE,MAAM,CAAC,WAAW;gBAC1B,YAAY,EAAE,YAAY;gBAC1B,QAAQ,EACJ,OAAO,OAAO,CAAC,SAAS,KAAK,QAAQ;oBACjC,CAAC,CAAC,OAAO,CAAC,SAAS;oBACnB,CAAC,CAAC,WAAW;aACC,CAAC,CAAA;QAC/B,CAAC;IACL,CAAC,CAAA;AACL,CAAC","file":"PrimaryColumn.js","sourcesContent":["import { getMetadataArgsStorage } from \"../../globals\"\nimport { ColumnTypeUndefinedError } from \"../../error/ColumnTypeUndefinedError\"\nimport { PrimaryColumnCannotBeNullableError } from \"../../error/PrimaryColumnCannotBeNullableError\"\nimport { ColumnMetadataArgs } from \"../../metadata-args/ColumnMetadataArgs\"\nimport { GeneratedMetadataArgs } from \"../../metadata-args/GeneratedMetadataArgs\"\nimport { ColumnOptions } from \"../options/ColumnOptions\"\nimport { ColumnType } from \"../../driver/types/ColumnTypes\"\n\n/**\n * Describes all primary key column's options.\n * If specified, the nullable field must be set to false.\n */\nexport type PrimaryColumnOptions = ColumnOptions & { nullable?: false }\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n * Primary columns also creates a PRIMARY KEY for this column in a db.\n */\nexport function PrimaryColumn(options?: PrimaryColumnOptions): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n * Primary columns also creates a PRIMARY KEY for this column in a db.\n */\nexport function PrimaryColumn(\n type?: ColumnType,\n options?: PrimaryColumnOptions,\n): PropertyDecorator\n\n/**\n * Column decorator is used to mark a specific class property as a table column.\n * Only properties decorated with this decorator will be persisted to the database when entity be saved.\n * Primary columns also creates a PRIMARY KEY for this column in a db.\n */\nexport function PrimaryColumn(\n typeOrOptions?: ColumnType | PrimaryColumnOptions,\n options?: PrimaryColumnOptions,\n): PropertyDecorator {\n return function (object: Object, propertyName: string) {\n // normalize parameters\n let type: ColumnType | undefined\n if (\n typeof typeOrOptions === \"string\" ||\n typeOrOptions === String ||\n typeOrOptions === Boolean ||\n typeOrOptions === Number\n ) {\n type = typeOrOptions as ColumnType\n } else {\n options = Object.assign({}, <PrimaryColumnOptions>typeOrOptions)\n }\n if (!options) options = {} as PrimaryColumnOptions\n\n // if type is not given explicitly then try to guess it\n const reflectMetadataType =\n Reflect && (Reflect as any).getMetadata\n ? (Reflect as any).getMetadata(\n \"design:type\",\n object,\n propertyName,\n )\n : undefined\n if (!type && reflectMetadataType) type = reflectMetadataType\n\n // check if there is no type in column options then set type from first function argument, or guessed one\n if (!options.type && type) options.type = type\n\n // if we still don't have a type then we need to give error to user that type is required\n if (!options.type)\n throw new ColumnTypeUndefinedError(object, propertyName)\n\n // check if column is not nullable, because we cannot allow a primary key to be nullable\n if (options.nullable)\n throw new PrimaryColumnCannotBeNullableError(object, propertyName)\n\n // explicitly set a primary to column options\n options.primary = true\n\n // create and register a new column metadata\n getMetadataArgsStorage().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"regular\",\n options: options,\n } as ColumnMetadataArgs)\n\n if (options.generated) {\n getMetadataArgsStorage().generations.push({\n target: object.constructor,\n propertyName: propertyName,\n strategy:\n typeof options.generated === \"string\"\n ? options.generated\n : \"increment\",\n } as GeneratedMetadataArgs)\n }\n }\n}\n"],"sourceRoot":"../.."}
|