@onivoro/server-typeorm-postgres 0.1.8 → 0.1.10
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 +1 -1
- package/src/index.d.ts +3 -0
- package/src/index.js +3 -0
- package/src/index.js.map +1 -1
- package/src/lib/classes/type-orm-paging-repository.class.d.ts +13 -0
- package/src/lib/classes/type-orm-paging-repository.class.js +17 -0
- package/src/lib/classes/type-orm-paging-repository.class.js.map +1 -0
- package/src/lib/functions/generate-date-query.function.d.ts +2 -0
- package/src/lib/functions/generate-date-query.function.js +18 -0
- package/src/lib/functions/generate-date-query.function.js.map +1 -0
- package/src/lib/types/paged-data.interface.d.ts +5 -0
- package/src/lib/types/paged-data.interface.js +3 -0
- package/src/lib/types/paged-data.interface.js.map +1 -0
package/package.json
CHANGED
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';
|
|
@@ -10,10 +11,12 @@ export * from './lib/decorators/table-column.decorator';
|
|
|
10
11
|
export * from './lib/decorators/table.decorator';
|
|
11
12
|
export * from './lib/functions/data-source-config-factory.function';
|
|
12
13
|
export * from './lib/functions/data-source-factory.function';
|
|
14
|
+
export * from './lib/functions/generate-date-query.function';
|
|
13
15
|
export * from './lib/functions/get-api-type-from-column.function';
|
|
14
16
|
export * from './lib/functions/get-paging-key.function';
|
|
15
17
|
export * from './lib/functions/get-skip.function';
|
|
16
18
|
export * from './lib/functions/remove-falsey-keys.function';
|
|
17
19
|
export * from './lib/types/data-source-options.interface';
|
|
18
20
|
export * from './lib/types/entity-provider.interface';
|
|
21
|
+
export * from './lib/types/paged-data.interface';
|
|
19
22
|
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);
|
|
@@ -13,11 +14,13 @@ tslib_1.__exportStar(require("./lib/decorators/table-column.decorator"), exports
|
|
|
13
14
|
tslib_1.__exportStar(require("./lib/decorators/table.decorator"), exports);
|
|
14
15
|
tslib_1.__exportStar(require("./lib/functions/data-source-config-factory.function"), exports);
|
|
15
16
|
tslib_1.__exportStar(require("./lib/functions/data-source-factory.function"), exports);
|
|
17
|
+
tslib_1.__exportStar(require("./lib/functions/generate-date-query.function"), exports);
|
|
16
18
|
tslib_1.__exportStar(require("./lib/functions/get-api-type-from-column.function"), exports);
|
|
17
19
|
tslib_1.__exportStar(require("./lib/functions/get-paging-key.function"), exports);
|
|
18
20
|
tslib_1.__exportStar(require("./lib/functions/get-skip.function"), exports);
|
|
19
21
|
tslib_1.__exportStar(require("./lib/functions/remove-falsey-keys.function"), exports);
|
|
20
22
|
tslib_1.__exportStar(require("./lib/types/data-source-options.interface"), exports);
|
|
21
23
|
tslib_1.__exportStar(require("./lib/types/entity-provider.interface"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./lib/types/paged-data.interface"), exports);
|
|
22
25
|
tslib_1.__exportStar(require("./lib/server-typeorm-postgres.module"), exports);
|
|
23
26
|
//# 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,4FAAkE;AAClE,kFAAwD;AACxD,4EAAkD;AAClD,sFAA4D;AAE5D,oFAA0D;AAC1D,gFAAsD;
|
|
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,2EAAiD;AAEjD,+EAAqD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
export declare abstract class TypeOrmPagingRepository<TEntity> extends TypeOrmRepository<TEntity> {
|
|
8
|
+
protected getPagingKey: typeof getPagingKey;
|
|
9
|
+
protected getSkip: typeof getSkip;
|
|
10
|
+
protected removeFalseyKeys: typeof removeFalseyKeys;
|
|
11
|
+
constructor(entityType: any, entityManager: EntityManager);
|
|
12
|
+
abstract getPage(): Promise<IPagedData<TEntity>>;
|
|
13
|
+
}
|
|
@@ -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;AAEpE,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,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateDateQuery = void 0;
|
|
4
|
+
const typeorm_1 = require("typeorm");
|
|
5
|
+
function generateDateQuery(minDueDate, maxDueDate) {
|
|
6
|
+
if (minDueDate && maxDueDate) {
|
|
7
|
+
return (0, typeorm_1.Between)(minDueDate, maxDueDate);
|
|
8
|
+
}
|
|
9
|
+
if (maxDueDate) {
|
|
10
|
+
return (0, typeorm_1.LessThanOrEqual)(new Date(maxDueDate));
|
|
11
|
+
}
|
|
12
|
+
if (minDueDate) {
|
|
13
|
+
return (0, typeorm_1.MoreThanOrEqual)(new Date(minDueDate));
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
exports.generateDateQuery = generateDateQuery;
|
|
18
|
+
//# sourceMappingURL=generate-date-query.function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-date-query.function.js","sourceRoot":"","sources":["../../../../../../libs/server-typeorm-postgres/src/lib/functions/generate-date-query.function.ts"],"names":[],"mappings":";;;AAAA,qCAAkF;AAElF,SAAgB,iBAAiB,CAC7B,UAAkB,EAClB,UAAkB;IAElB,IAAI,UAAU,IAAI,UAAU,EAAE;QAC1B,OAAO,IAAA,iBAAO,EAAC,UAAiB,EAAE,UAAiB,CAAC,CAAC;KACxD;IAED,IAAI,UAAU,EAAE;QACZ,OAAO,IAAA,yBAAe,EAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;KAChD;IAED,IAAI,UAAU,EAAE;QACZ,OAAO,IAAA,yBAAe,EAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;KAChD;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAjBD,8CAiBC"}
|
|
@@ -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":""}
|