@onivoro/server-typeorm-mysql 0.1.32 → 22.0.1

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.
Files changed (30) hide show
  1. package/dist/cjs/lib/classes/type-orm-repository.class.d.ts +1 -1
  2. package/dist/cjs/lib/decorators/nullable-table-column.decorator.d.ts +1 -1
  3. package/dist/cjs/lib/decorators/primary-table-column.decorator.d.ts +1 -1
  4. package/dist/cjs/lib/decorators/table-column.decorator.d.ts +1 -1
  5. package/dist/cjs/lib/decorators/table.decorator.d.ts +1 -1
  6. package/dist/cjs/lib/functions/data-source-config-factory.function.js +1 -2
  7. package/dist/cjs/lib/functions/generate-date-query.function.js +1 -2
  8. package/dist/cjs/lib/functions/get-api-type-from-column.function.js +1 -2
  9. package/dist/cjs/lib/functions/get-paging-key.function.js +1 -2
  10. package/dist/cjs/lib/functions/get-skip.function.js +1 -2
  11. package/dist/cjs/lib/functions/remove-falsey-keys.function.js +1 -2
  12. package/dist/cjs/lib/server-typeorm-mysql.module.js +1 -1
  13. package/dist/esm/lib/classes/type-orm-repository.class.d.ts +1 -1
  14. package/dist/esm/lib/decorators/nullable-table-column.decorator.d.ts +1 -1
  15. package/dist/esm/lib/decorators/primary-table-column.decorator.d.ts +1 -1
  16. package/dist/esm/lib/decorators/table-column.decorator.d.ts +1 -1
  17. package/dist/esm/lib/decorators/table.decorator.d.ts +1 -1
  18. package/dist/esm/lib/functions/data-source-config-factory.function.js +1 -2
  19. package/dist/esm/lib/functions/generate-date-query.function.js +1 -2
  20. package/dist/esm/lib/functions/get-api-type-from-column.function.js +1 -2
  21. package/dist/esm/lib/functions/get-paging-key.function.js +1 -2
  22. package/dist/esm/lib/functions/get-skip.function.js +1 -2
  23. package/dist/esm/lib/functions/remove-falsey-keys.function.js +1 -2
  24. package/dist/esm/lib/server-typeorm-mysql.module.js +1 -1
  25. package/dist/types/lib/classes/type-orm-repository.class.d.ts +1 -1
  26. package/dist/types/lib/decorators/nullable-table-column.decorator.d.ts +1 -1
  27. package/dist/types/lib/decorators/primary-table-column.decorator.d.ts +1 -1
  28. package/dist/types/lib/decorators/table-column.decorator.d.ts +1 -1
  29. package/dist/types/lib/decorators/table.decorator.d.ts +1 -1
  30. package/package.json +7 -7
@@ -10,7 +10,7 @@ export declare class TypeOrmRepository<TEntity> implements IEntityProvider<TEnti
10
10
  getManyAndCount(options: FindManyOptions<TEntity>): Promise<[TEntity[], number]>;
11
11
  getOne(options: FindOneOptions<TEntity>): Promise<TEntity>;
12
12
  postOne(body: Partial<TEntity>): Promise<TEntity>;
13
- postMany(body: Partial<TEntity>[]): Promise<TEntity[]>;
13
+ postMany(body: Partial<TEntity | undefined>[]): Promise<TEntity[]>;
14
14
  delete(options: FindOptionsWhere<TEntity>): Promise<void>;
15
15
  softDelete(options: FindOptionsWhere<TEntity>): Promise<void>;
16
16
  put(options: FindOptionsWhere<TEntity>, body: QueryDeepPartialEntity<TEntity>): Promise<void>;
@@ -1,2 +1,2 @@
1
1
  import { ColumnOptions } from "typeorm";
2
- export declare const NullableTableColumn: (options?: Pick<ColumnOptions, 'type'>) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
2
+ export declare const NullableTableColumn: (options?: Pick<ColumnOptions, "type">) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,2 +1,2 @@
1
1
  import { ColumnOptions } from "typeorm";
2
- export declare const PrimaryTableColumn: (options?: Pick<ColumnOptions, 'type'>) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
2
+ export declare const PrimaryTableColumn: (options?: Pick<ColumnOptions, "type">) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,2 +1,2 @@
1
1
  import { ColumnOptions } from "typeorm";
2
- export declare const TableColumn: (options?: Pick<ColumnOptions, 'type'>) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
2
+ export declare const TableColumn: (options?: Pick<ColumnOptions, "type">) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,3 +1,3 @@
1
1
  export declare const Table: (EntityClass: {
2
2
  name: string;
3
- }) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
3
+ }) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dataSourceConfigFactory = void 0;
3
+ exports.dataSourceConfigFactory = dataSourceConfigFactory;
4
4
  const typeorm_naming_strategies_1 = require("typeorm-naming-strategies");
5
5
  function dataSourceConfigFactory(name, options, entities) {
6
6
  const { ca, database, host, password, port, username, synchronize = false, logging = false } = options;
@@ -22,4 +22,3 @@ function dataSourceConfigFactory(name, options, entities) {
22
22
  };
23
23
  return config;
24
24
  }
25
- exports.dataSourceConfigFactory = dataSourceConfigFactory;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateDateQuery = void 0;
3
+ exports.generateDateQuery = generateDateQuery;
4
4
  const typeorm_1 = require("typeorm");
5
5
  function generateDateQuery(minDueDate, maxDueDate) {
6
6
  if (minDueDate && maxDueDate) {
@@ -14,4 +14,3 @@ function generateDateQuery(minDueDate, maxDueDate) {
14
14
  }
15
15
  return undefined;
16
16
  }
17
- exports.generateDateQuery = generateDateQuery;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getApiTypeFromColumn = void 0;
3
+ exports.getApiTypeFromColumn = getApiTypeFromColumn;
4
4
  function getApiTypeFromColumn(columnType) {
5
5
  if (!columnType) {
6
6
  return 'string';
@@ -12,4 +12,3 @@ function getApiTypeFromColumn(columnType) {
12
12
  return 'string';
13
13
  }
14
14
  }
15
- exports.getApiTypeFromColumn = getApiTypeFromColumn;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPagingKey = void 0;
3
+ exports.getPagingKey = getPagingKey;
4
4
  function getPagingKey(pageSize, skip, total) {
5
5
  return pageSize * skip < total ? skip + 1 : undefined;
6
6
  }
7
- exports.getPagingKey = getPagingKey;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSkip = void 0;
3
+ exports.getSkip = getSkip;
4
4
  function getSkip(pagingKey, pageSize) {
5
5
  return pagingKey ? Number(pagingKey) * pageSize : 0;
6
6
  }
7
- exports.getSkip = getSkip;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeFalseyKeys = void 0;
3
+ exports.removeFalseyKeys = removeFalseyKeys;
4
4
  function removeFalseyKeys(obj) {
5
5
  return Object.entries(obj)
6
6
  .filter(([k, v]) => typeof v !== 'undefined')
@@ -9,4 +9,3 @@ function removeFalseyKeys(obj) {
9
9
  return acc;
10
10
  }, {});
11
11
  }
12
- exports.removeFalseyKeys = removeFalseyKeys;
@@ -30,7 +30,7 @@ let ServerTypeormMysqlModule = ServerTypeormMysqlModule_1 = class ServerTypeormM
30
30
  {
31
31
  provide: typeorm_1.EntityManager,
32
32
  useFactory: (dataSource) => {
33
- return dataSource.manager;
33
+ return dataSource?.manager;
34
34
  },
35
35
  inject: [typeorm_1.DataSource]
36
36
  },
@@ -10,7 +10,7 @@ export declare class TypeOrmRepository<TEntity> implements IEntityProvider<TEnti
10
10
  getManyAndCount(options: FindManyOptions<TEntity>): Promise<[TEntity[], number]>;
11
11
  getOne(options: FindOneOptions<TEntity>): Promise<TEntity>;
12
12
  postOne(body: Partial<TEntity>): Promise<TEntity>;
13
- postMany(body: Partial<TEntity>[]): Promise<TEntity[]>;
13
+ postMany(body: Partial<TEntity | undefined>[]): Promise<TEntity[]>;
14
14
  delete(options: FindOptionsWhere<TEntity>): Promise<void>;
15
15
  softDelete(options: FindOptionsWhere<TEntity>): Promise<void>;
16
16
  put(options: FindOptionsWhere<TEntity>, body: QueryDeepPartialEntity<TEntity>): Promise<void>;
@@ -1,2 +1,2 @@
1
1
  import { ColumnOptions } from "typeorm";
2
- export declare const NullableTableColumn: (options?: Pick<ColumnOptions, 'type'>) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
2
+ export declare const NullableTableColumn: (options?: Pick<ColumnOptions, "type">) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,2 +1,2 @@
1
1
  import { ColumnOptions } from "typeorm";
2
- export declare const PrimaryTableColumn: (options?: Pick<ColumnOptions, 'type'>) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
2
+ export declare const PrimaryTableColumn: (options?: Pick<ColumnOptions, "type">) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,2 +1,2 @@
1
1
  import { ColumnOptions } from "typeorm";
2
- export declare const TableColumn: (options?: Pick<ColumnOptions, 'type'>) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
2
+ export declare const TableColumn: (options?: Pick<ColumnOptions, "type">) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,3 +1,3 @@
1
1
  export declare const Table: (EntityClass: {
2
2
  name: string;
3
- }) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
3
+ }) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dataSourceConfigFactory = void 0;
3
+ exports.dataSourceConfigFactory = dataSourceConfigFactory;
4
4
  const typeorm_naming_strategies_1 = require("typeorm-naming-strategies");
5
5
  function dataSourceConfigFactory(name, options, entities) {
6
6
  const { ca, database, host, password, port, username, synchronize = false, logging = false } = options;
@@ -22,4 +22,3 @@ function dataSourceConfigFactory(name, options, entities) {
22
22
  };
23
23
  return config;
24
24
  }
25
- exports.dataSourceConfigFactory = dataSourceConfigFactory;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.generateDateQuery = void 0;
3
+ exports.generateDateQuery = generateDateQuery;
4
4
  const typeorm_1 = require("typeorm");
5
5
  function generateDateQuery(minDueDate, maxDueDate) {
6
6
  if (minDueDate && maxDueDate) {
@@ -14,4 +14,3 @@ function generateDateQuery(minDueDate, maxDueDate) {
14
14
  }
15
15
  return undefined;
16
16
  }
17
- exports.generateDateQuery = generateDateQuery;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getApiTypeFromColumn = void 0;
3
+ exports.getApiTypeFromColumn = getApiTypeFromColumn;
4
4
  function getApiTypeFromColumn(columnType) {
5
5
  if (!columnType) {
6
6
  return 'string';
@@ -12,4 +12,3 @@ function getApiTypeFromColumn(columnType) {
12
12
  return 'string';
13
13
  }
14
14
  }
15
- exports.getApiTypeFromColumn = getApiTypeFromColumn;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getPagingKey = void 0;
3
+ exports.getPagingKey = getPagingKey;
4
4
  function getPagingKey(pageSize, skip, total) {
5
5
  return pageSize * skip < total ? skip + 1 : undefined;
6
6
  }
7
- exports.getPagingKey = getPagingKey;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSkip = void 0;
3
+ exports.getSkip = getSkip;
4
4
  function getSkip(pagingKey, pageSize) {
5
5
  return pagingKey ? Number(pagingKey) * pageSize : 0;
6
6
  }
7
- exports.getSkip = getSkip;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.removeFalseyKeys = void 0;
3
+ exports.removeFalseyKeys = removeFalseyKeys;
4
4
  function removeFalseyKeys(obj) {
5
5
  return Object.entries(obj)
6
6
  .filter(([k, v]) => typeof v !== 'undefined')
@@ -9,4 +9,3 @@ function removeFalseyKeys(obj) {
9
9
  return acc;
10
10
  }, {});
11
11
  }
12
- exports.removeFalseyKeys = removeFalseyKeys;
@@ -30,7 +30,7 @@ let ServerTypeormMysqlModule = ServerTypeormMysqlModule_1 = class ServerTypeormM
30
30
  {
31
31
  provide: typeorm_1.EntityManager,
32
32
  useFactory: (dataSource) => {
33
- return dataSource.manager;
33
+ return dataSource?.manager;
34
34
  },
35
35
  inject: [typeorm_1.DataSource]
36
36
  },
@@ -10,7 +10,7 @@ export declare class TypeOrmRepository<TEntity> implements IEntityProvider<TEnti
10
10
  getManyAndCount(options: FindManyOptions<TEntity>): Promise<[TEntity[], number]>;
11
11
  getOne(options: FindOneOptions<TEntity>): Promise<TEntity>;
12
12
  postOne(body: Partial<TEntity>): Promise<TEntity>;
13
- postMany(body: Partial<TEntity>[]): Promise<TEntity[]>;
13
+ postMany(body: Partial<TEntity | undefined>[]): Promise<TEntity[]>;
14
14
  delete(options: FindOptionsWhere<TEntity>): Promise<void>;
15
15
  softDelete(options: FindOptionsWhere<TEntity>): Promise<void>;
16
16
  put(options: FindOptionsWhere<TEntity>, body: QueryDeepPartialEntity<TEntity>): Promise<void>;
@@ -1,2 +1,2 @@
1
1
  import { ColumnOptions } from "typeorm";
2
- export declare const NullableTableColumn: (options?: Pick<ColumnOptions, 'type'>) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
2
+ export declare const NullableTableColumn: (options?: Pick<ColumnOptions, "type">) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,2 +1,2 @@
1
1
  import { ColumnOptions } from "typeorm";
2
- export declare const PrimaryTableColumn: (options?: Pick<ColumnOptions, 'type'>) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
2
+ export declare const PrimaryTableColumn: (options?: Pick<ColumnOptions, "type">) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,2 +1,2 @@
1
1
  import { ColumnOptions } from "typeorm";
2
- export declare const TableColumn: (options?: Pick<ColumnOptions, 'type'>) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
2
+ export declare const TableColumn: (options?: Pick<ColumnOptions, "type">) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
@@ -1,3 +1,3 @@
1
1
  export declare const Table: (EntityClass: {
2
2
  name: string;
3
- }) => <TFunction extends Function, Y>(target: object | TFunction, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
3
+ }) => <TFunction extends Function, Y>(target: TFunction | object, propertyKey?: string | symbol, descriptor?: TypedPropertyDescriptor<Y>) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/server-typeorm-mysql",
3
- "version": "0.1.32",
3
+ "version": "22.0.1",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/onivoro/server-typeorm-mysql.git"
6
6
  },
@@ -30,19 +30,19 @@
30
30
  "module": ""
31
31
  },
32
32
  "devDependencies": {
33
- "@onivoro/cli": "*",
33
+ "@onivoro/cli": "^22.0.3",
34
34
  "@types/jest": "*",
35
- "@types/node": "18.19.1",
35
+ "@types/node": "22.7.9",
36
36
  "typescript": "*"
37
37
  },
38
38
  "engines": {
39
- "node": "18.19.1",
40
- "npm": "10.2.4"
39
+ "node": "22.10.0",
40
+ "npm": "10.9.0"
41
41
  },
42
42
  "dependencies": {
43
- "@nestjs/common": "^10.4.4",
43
+ "@nestjs/common": "^10.4.6",
44
44
  "@nestjs/swagger": "^7.4.2",
45
- "@onivoro/isomorphic-common": "^0.4.0",
45
+ "@onivoro/isomorphic-common": "^22.0.1",
46
46
  "typeorm": "^0.3.20",
47
47
  "typeorm-naming-strategies": "^4.1.0"
48
48
  }