@nathapp/nestjs-data 1.0.0-rc.7 → 1.0.0-rc.9

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.
@@ -4,9 +4,9 @@ import { BaseDataSourceOptions } from "typeorm/data-source/BaseDataSourceOptions
4
4
  export type OptionWithoutEntities = Omit<Partial<BaseDataSourceOptions>, "entities" | "type">;
5
5
  export declare class BaseTypeOrmModuleOptionFactory implements TypeOrmOptionsFactory {
6
6
  private readonly connectionString;
7
- private readonly entities;
7
+ private readonly entities?;
8
8
  private readonly options?;
9
9
  private connectionType;
10
- constructor(connectionString: string, entities: MixedList<Function | string | EntitySchema>, options?: OptionWithoutEntities);
10
+ constructor(connectionString: string, entities?: MixedList<Function | string | EntitySchema>, options?: OptionWithoutEntities);
11
11
  createTypeOrmOptions(connectionName?: string): TypeOrmModuleOptions | Promise<TypeOrmModuleOptions>;
12
12
  }
@@ -1,5 +1,5 @@
1
- import { BaseTypeOrmModuleOptionFactory } from "./base-typeorm-options-factory";
1
+ import { BaseTypeOrmModuleOptionFactory, OptionWithoutEntities } from "./base-typeorm-options-factory";
2
2
  import { defaultExtraOptions, defaultMongoExtraOptions, defaultMysqlExtraOptions } from "./constants";
3
3
  import { DEFAULT_DATA_SOURCE_NAME, SupportedConnectionType, TypeOrmExModule } from "./typeorm-ex.module";
4
4
  import { sanatizeTypeOrmOptions } from "./typeorm-utils";
5
- export { TypeOrmExModule, DEFAULT_DATA_SOURCE_NAME, defaultExtraOptions, defaultMysqlExtraOptions, defaultMongoExtraOptions, SupportedConnectionType, sanatizeTypeOrmOptions, BaseTypeOrmModuleOptionFactory, };
5
+ export { TypeOrmExModule, DEFAULT_DATA_SOURCE_NAME, defaultExtraOptions, defaultMysqlExtraOptions, defaultMongoExtraOptions, SupportedConnectionType, sanatizeTypeOrmOptions, BaseTypeOrmModuleOptionFactory, OptionWithoutEntities, };
@@ -10,6 +10,8 @@ export declare const sanatizeTypeOrmOptions: (connectionType: SupportedConnectio
10
10
  } & {
11
11
  supportBigNumbers: boolean;
12
12
  bigNumberStrings: boolean;
13
+ } & {
14
+ type: SupportedConnectionType;
13
15
  } & OptionWithoutEntities) | ({
14
16
  entities: any[];
15
17
  logging: boolean;
@@ -19,4 +21,6 @@ export declare const sanatizeTypeOrmOptions: (connectionType: SupportedConnectio
19
21
  } & {
20
22
  useNewUrlParser: boolean;
21
23
  useUnifiedTopology: boolean;
24
+ } & {
25
+ type: SupportedConnectionType;
22
26
  } & OptionWithoutEntities);
@@ -3,12 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.sanatizeTypeOrmOptions = void 0;
4
4
  const constants_1 = require("./constants");
5
5
  const sanatizeTypeOrmOptions = (connectionType, options) => {
6
+ const dbType = { type: connectionType };
6
7
  switch (connectionType) {
7
8
  case "mysql":
8
9
  case "mariadb":
9
- return Object.assign(constants_1.defaultExtraOptions, constants_1.defaultMysqlExtraOptions, options);
10
+ return Object.assign(constants_1.defaultExtraOptions, constants_1.defaultMysqlExtraOptions, dbType, options);
10
11
  case "mongodb":
11
- return Object.assign(constants_1.defaultExtraOptions, constants_1.defaultMongoExtraOptions, options);
12
+ return Object.assign(constants_1.defaultExtraOptions, constants_1.defaultMongoExtraOptions, dbType, options);
12
13
  }
13
14
  };
14
15
  exports.sanatizeTypeOrmOptions = sanatizeTypeOrmOptions;
package/package.json CHANGED
@@ -1,28 +1,31 @@
1
1
  {
2
2
  "name": "@nathapp/nestjs-data",
3
- "version": "1.0.0-rc.7",
3
+ "version": "1.0.0-rc.9",
4
4
  "description": "@nathapp/nestjs-data",
5
5
  "scripts": {
6
6
  "build": "rimraf dist && tsc -p tsconfig.json",
7
7
  "precommit": "lint-staged",
8
- "test": "jest",
9
- "test:watch": "jest --watch",
10
- "test:cov": "jest --coverage",
11
- "test:e2e": "jest --config ./test/jest-e2e.json",
8
+ "test": "jest --config ./test/jest-test.json",
9
+ "test:cov": "jest --config ./test/jest-test.json --coverage",
10
+ "test:watch": "jest --config ./test/jest-test.json --watch",
12
11
  "lint": "eslint -c .eslintrc.js"
13
12
  },
14
13
  "author": "",
15
14
  "license": "ISC",
16
15
  "devDependencies": {
17
- "@nestjs/platform-express": "^9.0.0",
18
- "@nestjs/platform-fastify": "^9.0.0",
16
+ "@golevelup/ts-jest": "^0.3.7",
17
+ "@nestjs/testing": "^10.0.0",
18
+ "@types/jest": "^29.5.2",
19
19
  "@types/node": "^17.0.22",
20
20
  "@typescript-eslint/eslint-plugin": "^4",
21
21
  "@typescript-eslint/parser": "^4",
22
22
  "eslint": "*",
23
23
  "eslint-config-prettier": "^6",
24
24
  "eslint-plugin-prettier": "^3",
25
+ "jest": "^29.5.0",
25
26
  "prettier": "^2",
27
+ "supertest": "^6.3.3",
28
+ "ts-jest": "^29.1.0",
26
29
  "typescript": "^4"
27
30
  },
28
31
  "types": "./index.d.ts",
@@ -31,8 +34,7 @@
31
34
  "lib": "lib"
32
35
  },
33
36
  "dependencies": {
34
- "@nathapp/nestjs-common": "^1.0.1-rc.17",
35
- "@nestjs/typeorm": "^9.0.1",
37
+ "@nathapp/nestjs-common": "^1.0.1-rc.22",
36
38
  "moment": "^2.29.4",
37
39
  "typeorm": "^0.3.12",
38
40
  "typeorm-naming-strategies": "^4.1.0"
@@ -40,6 +42,7 @@
40
42
  "peerDependencies": {
41
43
  "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0",
42
44
  "@nestjs/core": "^8.0.0 || ^9.0.0 || ^10.0.0",
45
+ "@nestjs/typeorm": "^8.0.0 || ^9.0.0 || ^10.0.0",
43
46
  "class-transformer": "*",
44
47
  "class-validator": "*",
45
48
  "rxjs": "*"