@hedhog/pagination 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. package/dist/databases/abstract.database.d.ts +61 -0
  2. package/dist/databases/abstract.database.d.ts.map +1 -0
  3. package/dist/databases/abstract.database.js +643 -0
  4. package/dist/databases/abstract.database.js.map +1 -0
  5. package/dist/databases/database.d.ts +5 -0
  6. package/dist/databases/database.d.ts.map +1 -0
  7. package/dist/databases/database.factory.d.ts +7 -0
  8. package/dist/databases/database.factory.d.ts.map +1 -0
  9. package/dist/databases/database.factory.js +44 -0
  10. package/dist/databases/database.factory.js.map +1 -0
  11. package/dist/databases/database.js +9 -0
  12. package/dist/databases/database.js.map +1 -0
  13. package/dist/databases/index.d.ts +4 -0
  14. package/dist/databases/index.d.ts.map +1 -0
  15. package/dist/databases/index.js +20 -0
  16. package/dist/databases/index.js.map +1 -0
  17. package/dist/databases/mysql.database.d.ts +10 -0
  18. package/dist/databases/mysql.database.d.ts.map +1 -0
  19. package/dist/databases/mysql.database.js +17 -0
  20. package/dist/databases/mysql.database.js.map +1 -0
  21. package/dist/databases/postgres.database.d.ts +10 -0
  22. package/dist/databases/postgres.database.d.ts.map +1 -0
  23. package/dist/databases/postgres.database.js +17 -0
  24. package/dist/databases/postgres.database.js.map +1 -0
  25. package/dist/pagination.service.d.ts +16 -2
  26. package/dist/pagination.service.d.ts.map +1 -1
  27. package/dist/pagination.service.js +131 -5
  28. package/dist/pagination.service.js.map +1 -1
  29. package/dist/types/pagination.types.d.ts +1 -0
  30. package/dist/types/pagination.types.d.ts.map +1 -1
  31. package/dist/types/query-option.d.ts +5 -0
  32. package/dist/types/query-option.d.ts.map +1 -0
  33. package/dist/types/query-option.js +3 -0
  34. package/dist/types/query-option.js.map +1 -0
  35. package/dist/types/relation-n2n-result.d.ts +7 -0
  36. package/dist/types/relation-n2n-result.d.ts.map +1 -0
  37. package/dist/types/relation-n2n-result.js +3 -0
  38. package/dist/types/relation-n2n-result.js.map +1 -0
  39. package/dist/types/transaction-queries.d.ts +7 -0
  40. package/dist/types/transaction-queries.d.ts.map +1 -0
  41. package/dist/types/transaction-queries.js +3 -0
  42. package/dist/types/transaction-queries.js.map +1 -0
  43. package/package.json +6 -2
  44. package/src/databases/abstract.database.ts +833 -0
  45. package/src/databases/database.factory.ts +26 -0
  46. package/src/databases/database.ts +4 -0
  47. package/src/databases/index.ts +3 -0
  48. package/src/databases/mysql.database.ts +14 -0
  49. package/src/databases/postgres.database.ts +14 -0
  50. package/src/pagination.service.ts +216 -12
  51. package/src/types/pagination.types.ts +1 -0
  52. package/src/types/query-option.ts +4 -0
  53. package/src/types/relation-n2n-result.ts +6 -0
  54. package/src/types/transaction-queries.ts +7 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstract.database.js","sourceRoot":"","sources":["../../src/databases/abstract.database.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,qCAAqC;AAIrC,yCAAsC;AACtC,uCAAwC;AAExC,MAAa,gBAAgB;IAa3B,YACY,IAAc,EACd,IAAY,EACZ,IAAY,EACZ,QAAgB,EAChB,QAAgB,EAChB,IAAY;QALZ,SAAI,GAAJ,IAAI,CAAU;QACd,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAQ;QAChB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,SAAI,GAAJ,IAAI,CAAQ;QAlBhB,WAAM,GAA+B,IAAI,CAAC;QAC1C,gBAAW,GAAQ,EAAE,CAAC;QACtB,uBAAkB,GAAQ,EAAE,CAAC;QAC7B,gBAAW,GAAQ,EAAE,CAAC;QACtB,2BAAsB,GAAQ,EAAE,CAAC;QACjC,gBAAW,GAAQ,EAAE,CAAC;QACtB,eAAU,GAAQ,EAAE,CAAC;QACrB,kBAAa,GAAQ,EAAE,CAAC;QACxB,wBAAmB,GAAQ,EAAE,CAAC;QAC9B,iBAAY,GAAG,IAAI,YAAY,EAAE,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AK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC;gBACZ,KAAK;gBACL,KAAK;gBACL,MAAM;gBACN,OAAO;aACR,CAAC,CAAC;YACH,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QACrE,CAAC;QAED,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAEtD,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAE5C,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,MAAM,CAAA,MAAA,IAAI,CAAC,MAAM,0CAAE,GAAG,EAAE,CAAA,CAAC;YACzB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACrB,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AAvzBD,4CAuzBC"}
@@ -0,0 +1,5 @@
1
+ export declare enum Database {
2
+ POSTGRES = "postgres",
3
+ MYSQL = "mysql"
4
+ }
5
+ //# sourceMappingURL=database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/databases/database.ts"],"names":[],"mappings":"AAAA,oBAAY,QAAQ;IAClB,QAAQ,aAAa;IACrB,KAAK,UAAU;CAChB"}
@@ -0,0 +1,7 @@
1
+ import { Database } from './database';
2
+ import { PostgresDatabase } from './postgres.database';
3
+ import { MySQLDatabase } from './mysql.database';
4
+ export declare class DatabaseFactory {
5
+ static create(type: Database, host: string, user: string, password: string, database: string, port: number): PostgresDatabase | MySQLDatabase;
6
+ }
7
+ //# sourceMappingURL=database.factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.factory.d.ts","sourceRoot":"","sources":["../../src/databases/database.factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,qBAAa,eAAe;WACZ,MAAM,CAClB,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM;CAaf"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.DatabaseFactory = void 0;
27
+ const chalk = __importStar(require("chalk"));
28
+ const database_1 = require("./database");
29
+ const postgres_database_1 = require("./postgres.database");
30
+ const mysql_database_1 = require("./mysql.database");
31
+ class DatabaseFactory {
32
+ static create(type, host, user, password, database, port) {
33
+ switch (type) {
34
+ case database_1.Database.POSTGRES:
35
+ return new postgres_database_1.PostgresDatabase(host, user, password, database, port);
36
+ case database_1.Database.MYSQL:
37
+ return new mysql_database_1.MySQLDatabase(host, user, password, database, port);
38
+ default:
39
+ console.info(chalk.yellow(`[WARN] Unsupported Database: ${type}`));
40
+ }
41
+ }
42
+ }
43
+ exports.DatabaseFactory = DatabaseFactory;
44
+ //# sourceMappingURL=database.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.factory.js","sourceRoot":"","sources":["../../src/databases/database.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAA+B;AAC/B,yCAAsC;AACtC,2DAAuD;AACvD,qDAAiD;AAEjD,MAAa,eAAe;IACnB,MAAM,CAAC,MAAM,CAClB,IAAc,EACd,IAAY,EACZ,IAAY,EACZ,QAAgB,EAChB,QAAgB,EAChB,IAAY;QAEZ,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,mBAAQ,CAAC,QAAQ;gBACpB,OAAO,IAAI,oCAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;YAEpE,KAAK,mBAAQ,CAAC,KAAK;gBACjB,OAAO,IAAI,8BAAa,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;YAEjE;gBACE,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,gCAAgC,IAAI,EAAE,CAAC,CAAC,CAAC;QACvE,CAAC;IACH,CAAC;CACF;AApBD,0CAoBC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Database = void 0;
4
+ var Database;
5
+ (function (Database) {
6
+ Database["POSTGRES"] = "postgres";
7
+ Database["MYSQL"] = "mysql";
8
+ })(Database || (exports.Database = Database = {}));
9
+ //# sourceMappingURL=database.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/databases/database.ts"],"names":[],"mappings":";;;AAAA,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,iCAAqB,CAAA;IACrB,2BAAe,CAAA;AACjB,CAAC,EAHW,QAAQ,wBAAR,QAAQ,QAGnB"}
@@ -0,0 +1,4 @@
1
+ export * from './database';
2
+ export * from './database.factory';
3
+ export * from './abstract.database';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/databases/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./database"), exports);
18
+ __exportStar(require("./database.factory"), exports);
19
+ __exportStar(require("./abstract.database"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/databases/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,qDAAmC;AACnC,sDAAoC"}
@@ -0,0 +1,10 @@
1
+ import { AbstractDatabase } from './abstract.database';
2
+ export declare class MySQLDatabase extends AbstractDatabase {
3
+ protected host: string;
4
+ protected user: string;
5
+ protected password: string;
6
+ protected database: string;
7
+ protected port: number;
8
+ constructor(host: string, user: string, password: string, database: string, port: number);
9
+ }
10
+ //# sourceMappingURL=mysql.database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mysql.database.d.ts","sourceRoot":"","sources":["../../src/databases/mysql.database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,qBAAa,aAAc,SAAQ,gBAAgB;IAE/C,SAAS,CAAC,IAAI,EAAE,MAAM;IACtB,SAAS,CAAC,IAAI,EAAE,MAAM;IACtB,SAAS,CAAC,QAAQ,EAAE,MAAM;IAC1B,SAAS,CAAC,QAAQ,EAAE,MAAM;IAC1B,SAAS,CAAC,IAAI,EAAE,MAAM;gBAJZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM;CAIzB"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MySQLDatabase = void 0;
4
+ const abstract_database_1 = require("./abstract.database");
5
+ const database_1 = require("./database");
6
+ class MySQLDatabase extends abstract_database_1.AbstractDatabase {
7
+ constructor(host, user, password, database, port) {
8
+ super(database_1.Database.MYSQL, host, user, password, database, port);
9
+ this.host = host;
10
+ this.user = user;
11
+ this.password = password;
12
+ this.database = database;
13
+ this.port = port;
14
+ }
15
+ }
16
+ exports.MySQLDatabase = MySQLDatabase;
17
+ //# sourceMappingURL=mysql.database.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mysql.database.js","sourceRoot":"","sources":["../../src/databases/mysql.database.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AACvD,yCAAsC;AAEtC,MAAa,aAAc,SAAQ,oCAAgB;IACjD,YACY,IAAY,EACZ,IAAY,EACZ,QAAgB,EAChB,QAAgB,EAChB,IAAY;QAEtB,KAAK,CAAC,mBAAQ,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QANlD,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAQ;QAChB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,SAAI,GAAJ,IAAI,CAAQ;IAGxB,CAAC;CACF;AAVD,sCAUC"}
@@ -0,0 +1,10 @@
1
+ import { AbstractDatabase } from './abstract.database';
2
+ export declare class PostgresDatabase extends AbstractDatabase {
3
+ protected host: string;
4
+ protected user: string;
5
+ protected password: string;
6
+ protected database: string;
7
+ protected port: number;
8
+ constructor(host: string, user: string, password: string, database: string, port: number);
9
+ }
10
+ //# sourceMappingURL=postgres.database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgres.database.d.ts","sourceRoot":"","sources":["../../src/databases/postgres.database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,qBAAa,gBAAiB,SAAQ,gBAAgB;IAElD,SAAS,CAAC,IAAI,EAAE,MAAM;IACtB,SAAS,CAAC,IAAI,EAAE,MAAM;IACtB,SAAS,CAAC,QAAQ,EAAE,MAAM;IAC1B,SAAS,CAAC,QAAQ,EAAE,MAAM;IAC1B,SAAS,CAAC,IAAI,EAAE,MAAM;gBAJZ,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM;CAIzB"}
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostgresDatabase = void 0;
4
+ const abstract_database_1 = require("./abstract.database");
5
+ const database_1 = require("./database");
6
+ class PostgresDatabase extends abstract_database_1.AbstractDatabase {
7
+ constructor(host, user, password, database, port) {
8
+ super(database_1.Database.POSTGRES, host, user, password, database, port);
9
+ this.host = host;
10
+ this.user = user;
11
+ this.password = password;
12
+ this.database = database;
13
+ this.port = port;
14
+ }
15
+ }
16
+ exports.PostgresDatabase = PostgresDatabase;
17
+ //# sourceMappingURL=postgres.database.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgres.database.js","sourceRoot":"","sources":["../../src/databases/postgres.database.ts"],"names":[],"mappings":";;;AAAA,2DAAuD;AACvD,yCAAsC;AAEtC,MAAa,gBAAiB,SAAQ,oCAAgB;IACpD,YACY,IAAY,EACZ,IAAY,EACZ,QAAgB,EAChB,QAAgB,EAChB,IAAY;QAEtB,KAAK,CAAC,mBAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QANrD,SAAI,GAAJ,IAAI,CAAQ;QACZ,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAQ;QAChB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,SAAI,GAAJ,IAAI,CAAQ;IAGxB,CAAC;CACF;AAVD,4CAUC"}
@@ -1,9 +1,23 @@
1
- import type { BaseModel, FindManyArgs, PaginatedResult, PaginationParams } from './types/pagination.types';
1
+ import type { BaseModel, FindManyArgs, PaginationParams } from './types/pagination.types';
2
2
  export declare class PaginationService {
3
3
  private readonly logger;
4
- paginate<T, M extends BaseModel>(model: M, paginationParams: PaginationParams, customQuery?: FindManyArgs<M>, translationKey?: string): Promise<PaginatedResult<T>>;
4
+ private db;
5
+ paginate<T, M extends BaseModel>(model: M, paginationParams: PaginationParams, customQuery?: FindManyArgs<M>, translationKey?: string): Promise<{
6
+ total: number;
7
+ lastPage: number;
8
+ page: number;
9
+ pageSize: number;
10
+ prev: number;
11
+ next: number;
12
+ data: any[];
13
+ }>;
5
14
  extractFieldNames(model: Record<string, any>): string[];
6
15
  isInvalidField(sortField: string, model: BaseModel): boolean;
16
+ isInvalidLocaleField(sortField: string, model: BaseModel): boolean;
7
17
  isInvalidFields(fields: string[], model: BaseModel): boolean;
18
+ isInvalidLocaleFields(fields: string[], model: BaseModel): boolean;
19
+ getDb(model: any): Promise<any>;
20
+ getBuilder(model: any, tableName: string, query: any, builder: any): Promise<any>;
21
+ query(model: any, query: any): Promise<any[]>;
8
22
  }
9
23
  //# sourceMappingURL=pagination.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.service.d.ts","sourceRoot":"","sources":["../src/pagination.service.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,eAAe,EACf,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAElC,qBACa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;IAEvD,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,SAAS,EACnC,KAAK,EAAE,CAAC,EACR,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAC7B,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IA4H9B,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE;IAcvD,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO;IAI5D,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO;CAK7D"}
1
+ {"version":3,"file":"pagination.service.d.ts","sourceRoot":"","sources":["../src/pagination.service.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EACV,SAAS,EACT,YAAY,EACZ,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAElC,qBACa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsC;IAC7D,OAAO,CAAC,EAAE,CAAa;IACjB,QAAQ,CAAC,CAAC,EAAE,CAAC,SAAS,SAAS,EACnC,KAAK,EAAE,CAAC,EACR,gBAAgB,EAAE,gBAAgB,EAClC,WAAW,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,EAC7B,cAAc,CAAC,EAAE,MAAM;;;;;;;;;IAuIzB,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,MAAM,EAAE;IAcvD,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO;IAI5D,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO;IAMlE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO;IAM5D,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,SAAS,GAAG,OAAO;IAQ5D,KAAK,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAwB/B,UAAU,CACd,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,GAAG,GACX,OAAO,CAAC,GAAG,CAAC;IAkIT,KAAK,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;CAoBpD"}
@@ -8,13 +8,15 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var PaginationService_1;
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.PaginationService = void 0;
11
- const utils_1 = require("@hedhog/utils");
11
+ const core_1 = require("@hedhog/core");
12
12
  const common_1 = require("@nestjs/common");
13
13
  const pagination_constants_1 = require("./constants/pagination.constants");
14
+ const databases_1 = require("./databases");
14
15
  const patination_enums_1 = require("./enums/patination.enums");
15
16
  let PaginationService = PaginationService_1 = class PaginationService {
16
17
  constructor() {
17
18
  this.logger = new common_1.Logger(PaginationService_1.name);
19
+ this.db = null;
18
20
  }
19
21
  async paginate(model, paginationParams, customQuery, translationKey) {
20
22
  try {
@@ -38,11 +40,22 @@ let PaginationService = PaginationService_1 = class PaginationService {
38
40
  };
39
41
  if (sortField) {
40
42
  const invalid = this.isInvalidField(sortField, model);
43
+ let localeInvalid = false;
41
44
  if (invalid) {
42
- this.logger.error(`Invalid field: ${sortField}`);
43
- throw new common_1.BadRequestException(`Invalid field: ${sortField}. Valid columns are: ${this.extractFieldNames(model).join(', ')}`);
45
+ localeInvalid = this.isInvalidLocaleField(sortField, model);
46
+ if (localeInvalid) {
47
+ this.logger.error(`Invalid field: ${sortField}`);
48
+ throw new common_1.BadRequestException(`Invalid field: ${sortField}. Valid columns are: ${this.extractFieldNames(model).join(', ')}`);
49
+ }
50
+ else {
51
+ sortOrderCondition = {
52
+ [`${model.name}_locale`]: { [sortField]: sortOrder },
53
+ };
54
+ }
55
+ }
56
+ else {
57
+ sortOrderCondition = { [sortField]: sortOrder };
44
58
  }
45
- sortOrderCondition = { [sortField]: sortOrder };
46
59
  }
47
60
  if (search) {
48
61
  if (typeof search !== 'string') {
@@ -81,10 +94,11 @@ let PaginationService = PaginationService_1 = class PaginationService {
81
94
  let [total, data] = await Promise.all([
82
95
  model.count({ where: (customQuery === null || customQuery === void 0 ? void 0 : customQuery.where) || {} }),
83
96
  model.findMany(query),
97
+ //this.query(model, query),
84
98
  ]);
85
99
  const lastPage = Math.ceil(total / pageSize);
86
100
  if (translationKey) {
87
- data = data.map((item) => (0, utils_1.itemTranslations)(translationKey, item));
101
+ data = data.map((item) => (0, core_1.itemTranslations)(translationKey, item));
88
102
  }
89
103
  return {
90
104
  total,
@@ -117,9 +131,121 @@ let PaginationService = PaginationService_1 = class PaginationService {
117
131
  isInvalidField(sortField, model) {
118
132
  return model && model.fields ? !model.fields[sortField] : true;
119
133
  }
134
+ isInvalidLocaleField(sortField, model) {
135
+ const fields = model['$parent'][`${model.name}_locale`].fields;
136
+ return model && fields ? !fields[sortField] : true;
137
+ }
120
138
  isInvalidFields(fields, model) {
121
139
  return !fields.every((field) => model.fields ? model && model.fields[field] : false);
122
140
  }
141
+ isInvalidLocaleFields(fields, model) {
142
+ const localeFields = model['$parent'][`${model.name}_locale`].fields;
143
+ return !fields.every((field) => localeFields ? !localeFields[field] : false);
144
+ }
145
+ async getDb(model) {
146
+ const { DATABASE_URL, DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD, DB_DATABASE, } = model['$parent']._engine.config.env;
147
+ const type = DATABASE_URL.split(':')[0];
148
+ this.db = databases_1.DatabaseFactory.create(type === 'mysql' ? databases_1.Database.MYSQL : databases_1.Database.POSTGRES, DB_HOST, DB_USERNAME, DB_PASSWORD, DB_DATABASE, Number(DB_PORT));
149
+ return this.db;
150
+ }
151
+ async getBuilder(model, tableName, query, builder) {
152
+ const db = await this.getDb(model);
153
+ if (!builder) {
154
+ builder = {
155
+ joinTables: [],
156
+ select: [],
157
+ where: [],
158
+ order: [],
159
+ join: [],
160
+ from: db.getColumnNameWithScaping(tableName),
161
+ };
162
+ }
163
+ if (query.orderBy) {
164
+ for (const key in query.orderBy) {
165
+ if (typeof query.orderBy[key] === 'object') {
166
+ if (!builder.joinTables.includes(key)) {
167
+ builder.joinTables.push(key);
168
+ const foreignKey = await db.getColumnNameFromRelation(tableName, `${tableName}_locale`);
169
+ const primaryKeys = await db.getPrimaryKeys(tableName);
170
+ if (primaryKeys.length !== 1) {
171
+ throw new Error('Only single primary key is supported');
172
+ }
173
+ const primaryKey = primaryKeys[0];
174
+ builder.join.push(`LEFT JOIN ${db.getColumnNameWithScaping(key)} ON ${db.getColumnNameWithScaping(key)}.${db.getColumnNameWithScaping(foreignKey)} = ${db.getColumnNameWithScaping(tableName)}.${db.getColumnNameWithScaping(primaryKey)}`);
175
+ for (const k in query.orderBy[key]) {
176
+ builder.order.push(`${db.getColumnNameWithScaping(key)}.${db.getColumnNameWithScaping(k)} ${query.orderBy[key][k]}`);
177
+ }
178
+ }
179
+ }
180
+ }
181
+ }
182
+ if (query.select) {
183
+ builder.select = [
184
+ ...builder.select,
185
+ ...Object.keys(query.select).map((key) => `${db.getColumnNameWithScaping(tableName)}.${db.getColumnNameWithScaping(key)}`),
186
+ ];
187
+ for (const key in query.select) {
188
+ if (typeof query.select[key] === 'object') {
189
+ builder = await this.getBuilder(model, key, query.select[key], builder);
190
+ }
191
+ }
192
+ }
193
+ else if (query.include) {
194
+ builder.select = [
195
+ ...builder.select,
196
+ `${db.getColumnNameWithScaping(tableName)}.*`,
197
+ ];
198
+ for (const key in query.include) {
199
+ if (typeof query.include[key] === 'object') {
200
+ if (!builder.joinTables.includes(key)) {
201
+ builder.joinTables.push(key);
202
+ const foreignKey = await db.getColumnNameFromRelation(tableName, key);
203
+ const primaryKeys = await db.getPrimaryKeys(tableName);
204
+ const primaryKey = primaryKeys[0];
205
+ builder.join.push(`LEFT JOIN ${db.getColumnNameWithScaping(key)} ON ${db.getColumnNameWithScaping(key)}.${db.getColumnNameWithScaping(foreignKey)} = ${db.getColumnNameWithScaping(tableName)}.${db.getColumnNameWithScaping(primaryKey)}`);
206
+ builder = await this.getBuilder(model, key, query.include[key], builder);
207
+ }
208
+ }
209
+ }
210
+ }
211
+ if (query.where) {
212
+ for (const key in query.where) {
213
+ if (typeof query.where[key] === 'object') {
214
+ if (!builder.joinTables.includes(key)) {
215
+ builder.joinTables.push(key);
216
+ const foreignKey = await db.getColumnNameFromRelation(key, tableName);
217
+ const primaryKeys = await db.getPrimaryKeys(key);
218
+ builder.join.push(`LEFT JOIN ${db.getColumnNameWithScaping(key)} ON ${db.getColumnNameWithScaping(key)}.${db.getColumnNameWithScaping(primaryKeys[0])} = ${db.getColumnNameWithScaping(tableName)}.${db.getColumnNameWithScaping(foreignKey)}`);
219
+ for (const k in query.where[key]) {
220
+ builder.where.push(`${db.getColumnNameWithScaping(key)}.${db.getColumnNameWithScaping(k)} = ${databases_1.AbstractDatabase.addSimpleQuotes(query.where[key][k])}`);
221
+ }
222
+ }
223
+ }
224
+ else {
225
+ builder.where.push(`${db.getColumnNameWithScaping(tableName)}.${db.getColumnNameWithScaping(key)} = ${databases_1.AbstractDatabase.addSimpleQuotes(query.where[key])}`);
226
+ }
227
+ }
228
+ }
229
+ return builder;
230
+ }
231
+ async query(model, query) {
232
+ const db = await this.getDb(model);
233
+ const builder = await this.getBuilder(model, model.name, query, null);
234
+ const sql = [];
235
+ sql.push(`SELECT ${builder.select.join(', ')}`);
236
+ sql.push(`FROM ${builder.from}`);
237
+ if (builder.join.length)
238
+ sql.push(builder.join.join(' '));
239
+ if (builder.where.length)
240
+ sql.push(`WHERE ${builder.where.join(' AND ')}`);
241
+ if (builder.order.length)
242
+ sql.push(`ORDER BY ${builder.order.join(', ')}`);
243
+ if (query.take >= 0 && query.skip >= 0)
244
+ sql.push(db.getLimit(query.take, query.skip));
245
+ console.log('sql', sql.join(' '));
246
+ const result = await db.query(sql.join(' '));
247
+ return result;
248
+ }
123
249
  };
124
250
  exports.PaginationService = PaginationService;
125
251
  exports.PaginationService = PaginationService = PaginationService_1 = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.service.js","sourceRoot":"","sources":["../src/pagination.service.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,yCAAiD;AACjD,2CAAyE;AACzE,2EAG0C;AAC1C,+DAA8D;AASvD,IAAM,iBAAiB,yBAAvB,MAAM,iBAAiB;IAAvB;QACY,WAAM,GAAG,IAAI,eAAM,CAAC,mBAAiB,CAAC,IAAI,CAAC,CAAC;IA0J/D,CAAC;IAxJC,KAAK,CAAC,QAAQ,CACZ,KAAQ,EACR,gBAAkC,EAClC,WAA6B,EAC7B,cAAuB;QAEvB,IAAI,CAAC;YACH,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,IAAI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,OAAO,CAAC,KAAK,CAAC,MAAM;YAAE,GAAG,CAAC,IAAI,CAAC,YAAY,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC3E,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC;YACpC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;QAEhD,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAElC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QAE7C,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAA;AAvWY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAuW7B"}
@@ -26,6 +26,7 @@ export type BaseModel = {
26
26
  findMany: (args: any) => Promise<any[]>;
27
27
  count: (args: any) => Promise<number>;
28
28
  fields?: Record<string, any>;
29
+ name: string;
29
30
  };
30
31
  export type FindManyArgs<M> = M extends {
31
32
  findMany: (args: infer A) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.types.d.ts","sourceRoot":"","sources":["../../src/types/pagination.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,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M,EAAE,GAAG,CAAC,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,GAAG,CAAA;CAAE,GACxE,CAAC,GACD,KAAK,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type QueryOption = {
2
+ returning?: string[] | string;
3
+ primaryKeys?: string[] | string;
4
+ };
5
+ //# sourceMappingURL=query-option.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-option.d.ts","sourceRoot":"","sources":["../../src/types/query-option.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;CACjC,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=query-option.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query-option.js","sourceRoot":"","sources":["../../src/types/query-option.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ export type RelationN2NResult = {
2
+ tableNameIntermediate: string;
3
+ columnNameOrigin: string;
4
+ columnNameDestination: string;
5
+ primaryKeyDestination: string;
6
+ };
7
+ //# sourceMappingURL=relation-n2n-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation-n2n-result.d.ts","sourceRoot":"","sources":["../../src/types/relation-n2n-result.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;CAC/B,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=relation-n2n-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relation-n2n-result.js","sourceRoot":"","sources":["../../src/types/relation-n2n-result.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { QueryOption } from './query-option';
2
+ export type TransactionQueries = {
3
+ query: string;
4
+ values?: any[];
5
+ options?: QueryOption;
6
+ };
7
+ //# sourceMappingURL=transaction-queries.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-queries.d.ts","sourceRoot":"","sources":["../../src/types/transaction-queries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=transaction-queries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction-queries.js","sourceRoot":"","sources":["../../src/types/transaction-queries.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedhog/pagination",
3
- "version": "0.0.17",
3
+ "version": "0.0.18",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -19,8 +19,12 @@
19
19
  "class-validator": "^0.14.1"
20
20
  },
21
21
  "devDependencies": {
22
- "@hedhog/utils": "latest",
22
+ "@hedhog/utils": "^0.0.27",
23
23
  "class-transformer": "^0.5.1",
24
24
  "class-validator": "^0.14.1"
25
+ },
26
+ "dependencies": {
27
+ "mysql2": "^3.11.3",
28
+ "pg": "^8.13.1"
25
29
  }
26
30
  }