@onivoro/server-typeorm-postgres 0.1.9 → 0.1.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/server-typeorm-postgres",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "dependencies": {
5
5
  "typeorm-naming-strategies": "^4.1.0"
6
6
  },
package/src/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export * from './lib/classes/columns-migration-base.class';
3
3
  export * from './lib/classes/drop-column-migration-base.class';
4
4
  export * from './lib/classes/index-migration-base.class';
5
5
  export * from './lib/classes/sql-writer.class';
6
+ export * from './lib/classes/type-orm-paging-repository.class';
6
7
  export * from './lib/classes/type-orm-repository.class';
7
8
  export * from './lib/decorators/nullable-table-column.decorator';
8
9
  export * from './lib/decorators/primary-table-column.decorator';
@@ -17,4 +18,6 @@ export * from './lib/functions/get-skip.function';
17
18
  export * from './lib/functions/remove-falsey-keys.function';
18
19
  export * from './lib/types/data-source-options.interface';
19
20
  export * from './lib/types/entity-provider.interface';
21
+ export * from './lib/types/page-params.interface';
22
+ export * from './lib/types/paged-data.interface';
20
23
  export * from './lib/server-typeorm-postgres.module';
package/src/index.js CHANGED
@@ -6,6 +6,7 @@ tslib_1.__exportStar(require("./lib/classes/columns-migration-base.class"), expo
6
6
  tslib_1.__exportStar(require("./lib/classes/drop-column-migration-base.class"), exports);
7
7
  tslib_1.__exportStar(require("./lib/classes/index-migration-base.class"), exports);
8
8
  tslib_1.__exportStar(require("./lib/classes/sql-writer.class"), exports);
9
+ tslib_1.__exportStar(require("./lib/classes/type-orm-paging-repository.class"), exports);
9
10
  tslib_1.__exportStar(require("./lib/classes/type-orm-repository.class"), exports);
10
11
  tslib_1.__exportStar(require("./lib/decorators/nullable-table-column.decorator"), exports);
11
12
  tslib_1.__exportStar(require("./lib/decorators/primary-table-column.decorator"), exports);
@@ -20,5 +21,7 @@ tslib_1.__exportStar(require("./lib/functions/get-skip.function"), exports);
20
21
  tslib_1.__exportStar(require("./lib/functions/remove-falsey-keys.function"), exports);
21
22
  tslib_1.__exportStar(require("./lib/types/data-source-options.interface"), exports);
22
23
  tslib_1.__exportStar(require("./lib/types/entity-provider.interface"), exports);
24
+ tslib_1.__exportStar(require("./lib/types/page-params.interface"), exports);
25
+ tslib_1.__exportStar(require("./lib/types/paged-data.interface"), exports);
23
26
  tslib_1.__exportStar(require("./lib/server-typeorm-postgres.module"), exports);
24
27
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/server-typeorm-postgres/src/index.ts"],"names":[],"mappings":";;;AAAA,oFAA0D;AAC1D,qFAA2D;AAC3D,yFAA+D;AAC/D,mFAAyD;AACzD,yEAA+C;AAC/C,kFAAwD;AAExD,2FAAiE;AACjE,0FAAgE;AAChE,kFAAwD;AACxD,2EAAiD;AAEjD,8FAAoE;AACpE,uFAA6D;AAC7D,uFAA6D;AAC7D,4FAAkE;AAClE,kFAAwD;AACxD,4EAAkD;AAClD,sFAA4D;AAE5D,oFAA0D;AAC1D,gFAAsD;AAEtD,+EAAqD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/server-typeorm-postgres/src/index.ts"],"names":[],"mappings":";;;AAAA,oFAA0D;AAC1D,qFAA2D;AAC3D,yFAA+D;AAC/D,mFAAyD;AACzD,yEAA+C;AAC/C,yFAA+D;AAC/D,kFAAwD;AAExD,2FAAiE;AACjE,0FAAgE;AAChE,kFAAwD;AACxD,2EAAiD;AAEjD,8FAAoE;AACpE,uFAA6D;AAC7D,uFAA6D;AAC7D,4FAAkE;AAClE,kFAAwD;AACxD,4EAAkD;AAClD,sFAA4D;AAE5D,oFAA0D;AAC1D,gFAAsD;AACtD,4EAAkD;AAClD,2EAAiD;AAEjD,+EAAqD"}
@@ -0,0 +1,14 @@
1
+ import { EntityManager } from 'typeorm';
2
+ import { TypeOrmRepository } from './type-orm-repository.class';
3
+ import { IPagedData } from '../types/paged-data.interface';
4
+ import { getSkip } from '../functions/get-skip.function';
5
+ import { removeFalseyKeys } from '../functions/remove-falsey-keys.function';
6
+ import { getPagingKey } from '../functions/get-paging-key.function';
7
+ import { IPageParams } from '../types/page-params.interface';
8
+ export declare abstract class TypeOrmPagingRepository<TEntity> extends TypeOrmRepository<TEntity> {
9
+ protected getPagingKey: typeof getPagingKey;
10
+ protected getSkip: typeof getSkip;
11
+ protected removeFalseyKeys: typeof removeFalseyKeys;
12
+ constructor(entityType: any, entityManager: EntityManager);
13
+ abstract getPage<TParams extends IPageParams>(params: TParams): Promise<IPagedData<TEntity>>;
14
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeOrmPagingRepository = void 0;
4
+ const type_orm_repository_class_1 = require("./type-orm-repository.class");
5
+ const get_skip_function_1 = require("../functions/get-skip.function");
6
+ const remove_falsey_keys_function_1 = require("../functions/remove-falsey-keys.function");
7
+ const get_paging_key_function_1 = require("../functions/get-paging-key.function");
8
+ class TypeOrmPagingRepository extends type_orm_repository_class_1.TypeOrmRepository {
9
+ getPagingKey = get_paging_key_function_1.getPagingKey;
10
+ getSkip = get_skip_function_1.getSkip;
11
+ removeFalseyKeys = remove_falsey_keys_function_1.removeFalseyKeys;
12
+ constructor(entityType, entityManager) {
13
+ super(entityType, entityManager);
14
+ }
15
+ }
16
+ exports.TypeOrmPagingRepository = TypeOrmPagingRepository;
17
+ //# sourceMappingURL=type-orm-paging-repository.class.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-orm-paging-repository.class.js","sourceRoot":"","sources":["../../../../../../libs/server-typeorm-postgres/src/lib/classes/type-orm-paging-repository.class.ts"],"names":[],"mappings":";;;AAIA,2EAAgE;AAEhE,sEAAyD;AACzD,0FAA4E;AAC5E,kFAAoE;AAGpE,MAAsB,uBAAiC,SAAQ,6CAA0B;IAC7E,YAAY,GAAG,sCAAY,CAAC;IAC5B,OAAO,GAAG,2BAAO,CAAC;IAClB,gBAAgB,GAAG,8CAAgB,CAAC;IAE9C,YAAY,UAAe,EAAE,aAA4B;QACvD,KAAK,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACnC,CAAC;CAGF;AAVD,0DAUC"}
@@ -0,0 +1,4 @@
1
+ export interface IPageParams {
2
+ pagingKey: number;
3
+ pageSize: number;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=page-params.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page-params.interface.js","sourceRoot":"","sources":["../../../../../../libs/server-typeorm-postgres/src/lib/types/page-params.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export interface IPagedData<TEntity> {
2
+ data: TEntity[];
3
+ total: number;
4
+ pagingKey: number;
5
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=paged-data.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paged-data.interface.js","sourceRoot":"","sources":["../../../../../../libs/server-typeorm-postgres/src/lib/types/paged-data.interface.ts"],"names":[],"mappings":""}