@nathapp/nestjs-data 2.1.5 → 3.0.2
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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +17 -0
- package/CLAUDE.md +42 -0
- package/dist/constant/index.d.ts +1 -0
- package/dist/constant/index.js +18 -0
- package/dist/constant/index.js.map +1 -0
- package/dist/constant/tokens.d.ts +1 -0
- package/dist/constant/tokens.js +5 -0
- package/dist/constant/tokens.js.map +1 -0
- package/dist/index.d.ts +2 -6
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/interface/index.d.ts +2 -0
- package/dist/interface/index.js +19 -0
- package/dist/interface/index.js.map +1 -0
- package/dist/interface/repository.interface.d.ts +18 -0
- package/dist/interface/repository.interface.js +3 -0
- package/dist/interface/repository.interface.js.map +1 -0
- package/dist/interface/transaction-manager.interface.d.ts +5 -0
- package/dist/interface/transaction-manager.interface.js +3 -0
- package/dist/interface/transaction-manager.interface.js.map +1 -0
- package/lib/constant/index.ts +1 -0
- package/lib/constant/tokens.ts +1 -0
- package/lib/index.ts +2 -0
- package/lib/interface/index.ts +2 -0
- package/lib/interface/repository.interface.ts +87 -0
- package/lib/interface/transaction-manager.interface.ts +40 -0
- package/package.json +7 -21
- package/test/jest-test.json +24 -0
- package/test/repository.interface.spec.ts +112 -0
- package/test/tokens.spec.ts +11 -0
- package/tsconfig.json +9 -0
- package/LICENSE +0 -21
- package/README.md +0 -4
- package/dist/decorator/date-column.decorator.d.ts +0 -7
- package/dist/decorator/date-column.decorator.js +0 -51
- package/dist/decorator/date-column.decorator.js.map +0 -1
- package/dist/decorator/index.d.ts +0 -4
- package/dist/decorator/index.js +0 -15
- package/dist/decorator/index.js.map +0 -1
- package/dist/decorator/readonly-column.decorator.d.ts +0 -1
- package/dist/decorator/readonly-column.decorator.js +0 -14
- package/dist/decorator/readonly-column.decorator.js.map +0 -1
- package/dist/decorator/typeorm-ex.decorator.d.ts +0 -2
- package/dist/decorator/typeorm-ex.decorator.js +0 -10
- package/dist/decorator/typeorm-ex.decorator.js.map +0 -1
- package/dist/entities/base-entity.d.ts +0 -3
- package/dist/entities/base-entity.js +0 -8
- package/dist/entities/base-entity.js.map +0 -1
- package/dist/entities/index.d.ts +0 -2
- package/dist/entities/index.js +0 -6
- package/dist/entities/index.js.map +0 -1
- package/dist/pagination/index.d.ts +0 -2
- package/dist/pagination/index.js +0 -9
- package/dist/pagination/index.js.map +0 -1
- package/dist/pagination/page.d.ts +0 -35
- package/dist/pagination/page.js +0 -123
- package/dist/pagination/page.js.map +0 -1
- package/dist/repository/base.repository.d.ts +0 -18
- package/dist/repository/base.repository.js +0 -140
- package/dist/repository/base.repository.js.map +0 -1
- package/dist/repository/index.d.ts +0 -2
- package/dist/repository/index.js +0 -7
- package/dist/repository/index.js.map +0 -1
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/index.js +0 -11
- package/dist/testing/index.js.map +0 -1
- package/dist/testing/testing-utils.d.ts +0 -56
- package/dist/testing/testing-utils.js +0 -44
- package/dist/testing/testing-utils.js.map +0 -1
- package/dist/typeorm/base-typeorm-options-factory.d.ts +0 -18
- package/dist/typeorm/base-typeorm-options-factory.js +0 -42
- package/dist/typeorm/base-typeorm-options-factory.js.map +0 -1
- package/dist/typeorm/constants.d.ts +0 -16
- package/dist/typeorm/constants.js +0 -20
- package/dist/typeorm/constants.js.map +0 -1
- package/dist/typeorm/index.d.ts +0 -5
- package/dist/typeorm/index.js +0 -16
- package/dist/typeorm/index.js.map +0 -1
- package/dist/typeorm/typeorm-ex.module.d.ts +0 -13
- package/dist/typeorm/typeorm-ex.module.js +0 -75
- package/dist/typeorm/typeorm-ex.module.js.map +0 -1
- package/dist/typeorm/typeorm-utils.d.ts +0 -26
- package/dist/typeorm/typeorm-utils.js +0 -16
- package/dist/typeorm/typeorm-utils.js.map +0 -1
- package/index.d.ts +0 -1
- package/index.js +0 -6
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultTypeOrmModuleOptionFactory = exports.BaseTypeOrmModuleOptionFactory = void 0;
|
|
4
|
-
const typeorm_utils_1 = require("./typeorm-utils");
|
|
5
|
-
class BaseTypeOrmModuleOptionFactory {
|
|
6
|
-
constructor(connectionString, entities, options) {
|
|
7
|
-
this.connectionString = connectionString;
|
|
8
|
-
this.entities = entities;
|
|
9
|
-
this.options = options;
|
|
10
|
-
if (!connectionString || connectionString == "") {
|
|
11
|
-
throw new Error("connectionString is missing");
|
|
12
|
-
}
|
|
13
|
-
const isPresent = connectionString && connectionString != "";
|
|
14
|
-
this.connectionType = (isPresent ? this.connectionString.split(":").shift() : null);
|
|
15
|
-
}
|
|
16
|
-
createTypeOrmOptions(connectionName) {
|
|
17
|
-
const options = (0, typeorm_utils_1.sanatizeTypeOrmOptions)(this.connectionType, this.options);
|
|
18
|
-
switch (this.connectionType) {
|
|
19
|
-
case "mysql":
|
|
20
|
-
case "mariadb":
|
|
21
|
-
case "mongodb":
|
|
22
|
-
case "postgres":
|
|
23
|
-
return {
|
|
24
|
-
...options,
|
|
25
|
-
name: connectionName,
|
|
26
|
-
type: this.connectionType,
|
|
27
|
-
url: this.connectionString,
|
|
28
|
-
entities: this.entities || [],
|
|
29
|
-
};
|
|
30
|
-
default:
|
|
31
|
-
throw new Error("Connection Not Supported");
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
exports.BaseTypeOrmModuleOptionFactory = BaseTypeOrmModuleOptionFactory;
|
|
36
|
-
class DefaultTypeOrmModuleOptionFactory extends BaseTypeOrmModuleOptionFactory {
|
|
37
|
-
constructor(entities, options) {
|
|
38
|
-
super(process.env.MYSQL_URL, entities, options);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.DefaultTypeOrmModuleOptionFactory = DefaultTypeOrmModuleOptionFactory;
|
|
42
|
-
//# sourceMappingURL=base-typeorm-options-factory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-typeorm-options-factory.js","sourceRoot":"","sources":["../../lib/typeorm/base-typeorm-options-factory.ts"],"names":[],"mappings":";;;AAIA,mDAAyD;AAQzD,MAAa,8BAA8B;IAGzC,YAA6B,gBAAwB,EAClC,QAAsD,EACtD,OAA+B;QAFrB,qBAAgB,GAAhB,gBAAgB,CAAQ;QAClC,aAAQ,GAAR,QAAQ,CAA8C;QACtD,YAAO,GAAP,OAAO,CAAwB;QAEhD,IAAI,CAAC,gBAAgB,IAAI,gBAAgB,IAAI,EAAE,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACjD,CAAC;QAED,MAAM,SAAS,GAAG,gBAAgB,IAAI,gBAAgB,IAAI,EAAE,CAAC;QAC7D,IAAI,CAAC,cAAc,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAA6B,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACjH,CAAC;IAED,oBAAoB,CAAC,cAAuB;QAC1C,MAAM,OAAO,GAAG,IAAA,sCAAsB,EAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1E,QAAQ,IAAI,CAAC,cAAc,EAAE,CAAC;YAC5B,KAAK,OAAO,CAAC;YACb,KAAK,SAAS,CAAC;YACf,KAAK,SAAS,CAAC;YACf,KAAK,UAAU;gBACb,OAAO;oBACL,GAAG,OAAO;oBACV,IAAI,EAAE,cAAc;oBACpB,IAAI,EAAE,IAAI,CAAC,cAAc;oBACzB,GAAG,EAAE,IAAI,CAAC,gBAAgB;oBAC1B,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;iBAC9B,CAAA;YACH;gBACE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAChD,CAAC;IACH,CAAC;CACF;AAjCD,wEAiCC;AAED,MAAa,iCAAkC,SAAQ,8BAA8B;IACnF,YAAY,QAAsD,EAC/D,OAA+B;QAC9B,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;IACpD,CAAC;CACF;AALD,8EAKC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { SnakeNamingStrategy } from "typeorm-naming-strategies";
|
|
2
|
-
export declare const defaultExtraOptions: {
|
|
3
|
-
entities: any[];
|
|
4
|
-
logging: boolean;
|
|
5
|
-
synchronize: boolean;
|
|
6
|
-
autoLoadEntities: boolean;
|
|
7
|
-
namingStrategy: SnakeNamingStrategy;
|
|
8
|
-
};
|
|
9
|
-
export declare const defaultMysqlExtraOptions: {
|
|
10
|
-
supportBigNumbers: boolean;
|
|
11
|
-
bigNumberStrings: boolean;
|
|
12
|
-
};
|
|
13
|
-
export declare const defaultMongoExtraOptions: {
|
|
14
|
-
useNewUrlParser: boolean;
|
|
15
|
-
useUnifiedTopology: boolean;
|
|
16
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultMongoExtraOptions = exports.defaultMysqlExtraOptions = exports.defaultExtraOptions = void 0;
|
|
4
|
-
const typeorm_naming_strategies_1 = require("typeorm-naming-strategies");
|
|
5
|
-
exports.defaultExtraOptions = {
|
|
6
|
-
entities: [],
|
|
7
|
-
logging: false,
|
|
8
|
-
synchronize: false,
|
|
9
|
-
autoLoadEntities: true,
|
|
10
|
-
namingStrategy: new typeorm_naming_strategies_1.SnakeNamingStrategy(),
|
|
11
|
-
};
|
|
12
|
-
exports.defaultMysqlExtraOptions = {
|
|
13
|
-
supportBigNumbers: true,
|
|
14
|
-
bigNumberStrings: true,
|
|
15
|
-
};
|
|
16
|
-
exports.defaultMongoExtraOptions = {
|
|
17
|
-
useNewUrlParser: true,
|
|
18
|
-
useUnifiedTopology: true,
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../lib/typeorm/constants.ts"],"names":[],"mappings":";;;AAAA,yEAA+D;AAElD,QAAA,mBAAmB,GAAG;IACjC,QAAQ,EAAE,EAAE;IACZ,OAAO,EAAE,KAAK;IACd,WAAW,EAAE,KAAK;IAClB,gBAAgB,EAAE,IAAI;IACtB,cAAc,EAAE,IAAI,+CAAmB,EAAE;CAC1C,CAAA;AAEY,QAAA,wBAAwB,GAAG;IACtC,iBAAiB,EAAE,IAAI;IACvB,gBAAgB,EAAE,IAAI;CACvB,CAAA;AAEY,QAAA,wBAAwB,GAAG;IACtC,eAAe,EAAE,IAAI;IACrB,kBAAkB,EAAE,IAAI;CACzB,CAAA"}
|
package/dist/typeorm/index.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { BaseTypeOrmModuleOptionFactory, DefaultTypeOrmModuleOptionFactory, OptionWithoutEntities } from "./base-typeorm-options-factory";
|
|
2
|
-
import { defaultExtraOptions, defaultMongoExtraOptions, defaultMysqlExtraOptions } from "./constants";
|
|
3
|
-
import { DEFAULT_DATA_SOURCE_NAME, SupportedConnectionType, TypeOrmExModule } from "./typeorm-ex.module";
|
|
4
|
-
import { sanatizeTypeOrmOptions } from "./typeorm-utils";
|
|
5
|
-
export { TypeOrmExModule, DEFAULT_DATA_SOURCE_NAME, defaultExtraOptions, defaultMysqlExtraOptions, defaultMongoExtraOptions, SupportedConnectionType, sanatizeTypeOrmOptions, BaseTypeOrmModuleOptionFactory, OptionWithoutEntities, DefaultTypeOrmModuleOptionFactory, };
|
package/dist/typeorm/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultTypeOrmModuleOptionFactory = exports.BaseTypeOrmModuleOptionFactory = exports.sanatizeTypeOrmOptions = exports.defaultMongoExtraOptions = exports.defaultMysqlExtraOptions = exports.defaultExtraOptions = exports.DEFAULT_DATA_SOURCE_NAME = exports.TypeOrmExModule = void 0;
|
|
4
|
-
const base_typeorm_options_factory_1 = require("./base-typeorm-options-factory");
|
|
5
|
-
Object.defineProperty(exports, "BaseTypeOrmModuleOptionFactory", { enumerable: true, get: function () { return base_typeorm_options_factory_1.BaseTypeOrmModuleOptionFactory; } });
|
|
6
|
-
Object.defineProperty(exports, "DefaultTypeOrmModuleOptionFactory", { enumerable: true, get: function () { return base_typeorm_options_factory_1.DefaultTypeOrmModuleOptionFactory; } });
|
|
7
|
-
const constants_1 = require("./constants");
|
|
8
|
-
Object.defineProperty(exports, "defaultExtraOptions", { enumerable: true, get: function () { return constants_1.defaultExtraOptions; } });
|
|
9
|
-
Object.defineProperty(exports, "defaultMongoExtraOptions", { enumerable: true, get: function () { return constants_1.defaultMongoExtraOptions; } });
|
|
10
|
-
Object.defineProperty(exports, "defaultMysqlExtraOptions", { enumerable: true, get: function () { return constants_1.defaultMysqlExtraOptions; } });
|
|
11
|
-
const typeorm_ex_module_1 = require("./typeorm-ex.module");
|
|
12
|
-
Object.defineProperty(exports, "DEFAULT_DATA_SOURCE_NAME", { enumerable: true, get: function () { return typeorm_ex_module_1.DEFAULT_DATA_SOURCE_NAME; } });
|
|
13
|
-
Object.defineProperty(exports, "TypeOrmExModule", { enumerable: true, get: function () { return typeorm_ex_module_1.TypeOrmExModule; } });
|
|
14
|
-
const typeorm_utils_1 = require("./typeorm-utils");
|
|
15
|
-
Object.defineProperty(exports, "sanatizeTypeOrmOptions", { enumerable: true, get: function () { return typeorm_utils_1.sanatizeTypeOrmOptions; } });
|
|
16
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/typeorm/index.ts"],"names":[],"mappings":";;;AAAA,iFAA0I;AAaxI,+GAbO,6DAA8B,OAaP;AAE9B,kHAfuC,gEAAiC,OAevC;AAdnC,2CAAsG;AAOpG,oGAPO,+BAAmB,OAOP;AAEnB,yGAT4B,oCAAwB,OAS5B;AADxB,yGARsD,oCAAwB,OAQtD;AAP1B,2DAAyG;AAKvG,yGALO,4CAAwB,OAKP;AADxB,gGAJ0D,mCAAe,OAI1D;AAHjB,mDAAyD;AASvD,uGATO,sCAAsB,OASP"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DynamicModule } from "@nestjs/common";
|
|
2
|
-
import { TypeOrmModuleAsyncOptions, TypeOrmModuleOptions } from "@nestjs/typeorm";
|
|
3
|
-
import { DataSource, DataSourceOptions } from "typeorm";
|
|
4
|
-
import { EntityClassOrSchema } from "@nestjs/typeorm/dist/interfaces/entity-class-or-schema.type";
|
|
5
|
-
export declare const DEFAULT_DATA_SOURCE_NAME = "default";
|
|
6
|
-
export type SupportedConnectionType = "mysql" | "mariadb" | "mongodb" | "postgres";
|
|
7
|
-
export declare class TypeOrmExModule {
|
|
8
|
-
static forRoot(options?: TypeOrmModuleOptions): DynamicModule;
|
|
9
|
-
static forRootAsync(options?: TypeOrmModuleAsyncOptions): DynamicModule;
|
|
10
|
-
static forFeature(entities?: EntityClassOrSchema[], dataSource?: string): DynamicModule;
|
|
11
|
-
static forCustomRepository<T extends new (...args: any[]) => any>(repositories: T[], dataSource?: DataSource | DataSourceOptions | string): DynamicModule;
|
|
12
|
-
private static sanitizeOptions;
|
|
13
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TypeOrmExModule = exports.DEFAULT_DATA_SOURCE_NAME = void 0;
|
|
4
|
-
const typeorm_1 = require("@nestjs/typeorm");
|
|
5
|
-
const decorator_1 = require("../decorator");
|
|
6
|
-
const typeorm_utils_1 = require("./typeorm-utils");
|
|
7
|
-
const repository_1 = require("../repository");
|
|
8
|
-
exports.DEFAULT_DATA_SOURCE_NAME = 'default';
|
|
9
|
-
class TypeOrmExModule {
|
|
10
|
-
static forRoot(options) {
|
|
11
|
-
options = this.sanitizeOptions(options);
|
|
12
|
-
return {
|
|
13
|
-
module: TypeOrmExModule,
|
|
14
|
-
imports: [typeorm_1.TypeOrmModule.forRoot(options)],
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
static forRootAsync(options) {
|
|
18
|
-
return {
|
|
19
|
-
module: TypeOrmExModule,
|
|
20
|
-
imports: [typeorm_1.TypeOrmModule.forRootAsync(options)],
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
static forFeature(entities, dataSource = exports.DEFAULT_DATA_SOURCE_NAME) {
|
|
24
|
-
return {
|
|
25
|
-
module: TypeOrmExModule,
|
|
26
|
-
imports: [typeorm_1.TypeOrmModule.forFeature(entities, dataSource)],
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
static forCustomRepository(repositories, dataSource = exports.DEFAULT_DATA_SOURCE_NAME) {
|
|
30
|
-
const providers = [];
|
|
31
|
-
for (const repository of repositories) {
|
|
32
|
-
const entity = Reflect.getMetadata(decorator_1.TYPEORM_EX_CUSTOM_REPOSITORY, repository);
|
|
33
|
-
if (!entity) {
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
providers.push({
|
|
37
|
-
inject: [(0, typeorm_1.getDataSourceToken)(dataSource)],
|
|
38
|
-
provide: repository,
|
|
39
|
-
useFactory: (dataSource) => {
|
|
40
|
-
if (repository.prototype instanceof repository_1.BaseRepository) {
|
|
41
|
-
return new repository(dataSource);
|
|
42
|
-
}
|
|
43
|
-
const baseRepository = dataSource.getRepository(entity);
|
|
44
|
-
const customRepository = new repository(baseRepository.target, baseRepository.manager);
|
|
45
|
-
Object.defineProperty(customRepository, 'manager', {
|
|
46
|
-
get() {
|
|
47
|
-
return baseRepository.manager;
|
|
48
|
-
},
|
|
49
|
-
});
|
|
50
|
-
return customRepository;
|
|
51
|
-
},
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
exports: providers,
|
|
56
|
-
module: TypeOrmExModule,
|
|
57
|
-
providers,
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
static sanitizeOptions(options) {
|
|
61
|
-
let connectionType;
|
|
62
|
-
if (options.type) {
|
|
63
|
-
connectionType = options.type;
|
|
64
|
-
}
|
|
65
|
-
else if (options["url"]) {
|
|
66
|
-
connectionType = options["url"].split(":").shift();
|
|
67
|
-
}
|
|
68
|
-
if (!connectionType) {
|
|
69
|
-
throw new Error("Connection Not Supported");
|
|
70
|
-
}
|
|
71
|
-
return (0, typeorm_utils_1.sanatizeTypeOrmOptions)(connectionType, options);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
exports.TypeOrmExModule = TypeOrmExModule;
|
|
75
|
-
//# sourceMappingURL=typeorm-ex.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeorm-ex.module.js","sourceRoot":"","sources":["../../lib/typeorm/typeorm-ex.module.ts"],"names":[],"mappings":";;;AACA,6CAAqH;AAErH,4CAA4D;AAC5D,mDAAyD;AACzD,8CAA+C;AAElC,QAAA,wBAAwB,GAAG,SAAS,CAAC;AAGlD,MAAa,eAAe;IAGnB,MAAM,CAAC,OAAO,CAAC,OAA8B;QAClD,OAAO,GAAG,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACxC,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,CAAC,uBAAa,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;SAC1C,CAAA;IACH,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,OAAmC;QAC5D,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,CAAC,uBAAa,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;SAC/C,CAAA;IACH,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,QAAgC,EAAE,aAAqB,gCAAwB;QACtG,OAAO;YACL,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,CAAC,uBAAa,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;SAC1D,CAAA;IACH,CAAC;IAKM,MAAM,CAAC,mBAAmB,CAAwC,YAAiB,EAAE,aAG/E,gCAAwB;QACnC,MAAM,SAAS,GAAe,EAAE,CAAC;QAEjC,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;YACtC,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,wCAA4B,EAAE,UAAU,CAAC,CAAC;YAE7E,IAAI,CAAC,MAAM,EAAE,CAAC;gBACZ,SAAS;YACX,CAAC;YAED,SAAS,CAAC,IAAI,CAAC;gBACb,MAAM,EAAE,CAAC,IAAA,4BAAkB,EAAC,UAAU,CAAC,CAAC;gBACxC,OAAO,EAAE,UAAU;gBACnB,UAAU,EAAE,CAAC,UAAsB,EAAqB,EAAE;oBAExD,IAAG,UAAU,CAAC,SAAS,YAAY,2BAAc,EAAE,CAAC;wBAClD,OAAO,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;oBACpC,CAAC;oBAMD,MAAM,cAAc,GAAG,UAAU,CAAC,aAAa,CAAM,MAAM,CAAC,CAAC;oBAE7D,MAAM,gBAAgB,GAAG,IAAI,UAAU,CACrC,cAAc,CAAC,MAAM,EACrB,cAAc,CAAC,OAAO,CACvB,CAAC;oBAIF,MAAM,CAAC,cAAc,CAAC,gBAAgB,EAAE,SAAS,EAAE;wBACjD,GAAG;4BACD,OAAO,cAAc,CAAC,OAAO,CAAC;wBAChC,CAAC;qBACF,CAAC,CAAC;oBAEH,OAAO,gBAAgB,CAAC;gBAC1B,CAAC;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO;YACL,OAAO,EAAE,SAAS;YAClB,MAAM,EAAE,eAAe;YACvB,SAAS;SACV,CAAC;IACJ,CAAC;IAGO,MAAM,CAAC,eAAe,CAAC,OAA6B;QAC1D,IAAI,cAAuC,CAAC;QAE5C,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,cAAc,GAAG,OAAO,CAAC,IAA+B,CAAC;QAE3D,CAAC;aAAM,IAAI,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YAC1B,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAA6B,CAAC;QAChF,CAAC;QAED,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC9C,CAAC;QACD,OAAO,IAAA,sCAAsB,EAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACzD,CAAC;CACF;AAjGD,0CAiGC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { TypeOrmModuleOptions } from "@nestjs/typeorm";
|
|
2
|
-
import { SupportedConnectionType } from "./typeorm-ex.module";
|
|
3
|
-
import { OptionWithoutEntities } from "./base-typeorm-options-factory";
|
|
4
|
-
export declare const sanatizeTypeOrmOptions: (connectionType: SupportedConnectionType, options: TypeOrmModuleOptions | OptionWithoutEntities) => ({
|
|
5
|
-
entities: any[];
|
|
6
|
-
logging: boolean;
|
|
7
|
-
synchronize: boolean;
|
|
8
|
-
autoLoadEntities: boolean;
|
|
9
|
-
namingStrategy: import("typeorm-naming-strategies").SnakeNamingStrategy;
|
|
10
|
-
} & {
|
|
11
|
-
supportBigNumbers: boolean;
|
|
12
|
-
bigNumberStrings: boolean;
|
|
13
|
-
} & {
|
|
14
|
-
type: SupportedConnectionType;
|
|
15
|
-
} & Omit<Partial<import("typeorm/data-source/BaseDataSourceOptions").BaseDataSourceOptions>, "type" | "entities">) | ({
|
|
16
|
-
entities: any[];
|
|
17
|
-
logging: boolean;
|
|
18
|
-
synchronize: boolean;
|
|
19
|
-
autoLoadEntities: boolean;
|
|
20
|
-
namingStrategy: import("typeorm-naming-strategies").SnakeNamingStrategy;
|
|
21
|
-
} & {
|
|
22
|
-
useNewUrlParser: boolean;
|
|
23
|
-
useUnifiedTopology: boolean;
|
|
24
|
-
} & {
|
|
25
|
-
type: SupportedConnectionType;
|
|
26
|
-
} & Omit<Partial<import("typeorm/data-source/BaseDataSourceOptions").BaseDataSourceOptions>, "type" | "entities">);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sanatizeTypeOrmOptions = void 0;
|
|
4
|
-
const constants_1 = require("./constants");
|
|
5
|
-
const sanatizeTypeOrmOptions = (connectionType, options) => {
|
|
6
|
-
const dbType = { type: connectionType };
|
|
7
|
-
switch (connectionType) {
|
|
8
|
-
case "mysql":
|
|
9
|
-
case "mariadb":
|
|
10
|
-
return Object.assign(constants_1.defaultExtraOptions, constants_1.defaultMysqlExtraOptions, dbType, options);
|
|
11
|
-
case "mongodb":
|
|
12
|
-
return Object.assign(constants_1.defaultExtraOptions, constants_1.defaultMongoExtraOptions, dbType, options);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
exports.sanatizeTypeOrmOptions = sanatizeTypeOrmOptions;
|
|
16
|
-
//# sourceMappingURL=typeorm-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeorm-utils.js","sourceRoot":"","sources":["../../lib/typeorm/typeorm-utils.ts"],"names":[],"mappings":";;;AAEA,2CAAsG;AAK/F,MAAM,sBAAsB,GAAG,CAAC,cAAuC,EAAE,OAAqD,EAAE,EAAE;IACvI,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;IACxC,QAAQ,cAAc,EAAE,CAAC;QACvB,KAAK,OAAO,CAAC;QACb,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,MAAM,CAAC,+BAAmB,EAAE,oCAAwB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QACvF,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,MAAM,CAAC,+BAAmB,EAAE,oCAAwB,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;IACzF,CAAC;AACH,CAAC,CAAA;AATY,QAAA,sBAAsB,0BASlC"}
|
package/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./dist";
|