@ikonintegration/ikapi 5.0.2 → 5.0.4

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 (132) hide show
  1. package/package.json +1 -1
  2. package/src/BaseEvent/Launchable/ContainerExec.ts +6 -2
  3. package/src/Mailer/Mailer.ts +42 -52
  4. package/dist/index.d.ts +0 -17
  5. package/dist/index.js +0 -28
  6. package/dist/index.js.map +0 -1
  7. package/dist/package-lock.json +0 -11901
  8. package/dist/package.json +0 -82
  9. package/dist/src/API/Request.d.ts +0 -125
  10. package/dist/src/API/Request.js +0 -185
  11. package/dist/src/API/Request.js.map +0 -1
  12. package/dist/src/API/Response.d.ts +0 -188
  13. package/dist/src/API/Response.js +0 -270
  14. package/dist/src/API/Response.js.map +0 -1
  15. package/dist/src/BaseEvent/DynamoTransaction.d.ts +0 -70
  16. package/dist/src/BaseEvent/DynamoTransaction.js +0 -104
  17. package/dist/src/BaseEvent/DynamoTransaction.js.map +0 -1
  18. package/dist/src/BaseEvent/EventProcessor.d.ts +0 -58
  19. package/dist/src/BaseEvent/EventProcessor.js +0 -101
  20. package/dist/src/BaseEvent/EventProcessor.js.map +0 -1
  21. package/dist/src/BaseEvent/Launchable/ContainerExec.d.ts +0 -42
  22. package/dist/src/BaseEvent/Launchable/ContainerExec.js +0 -102
  23. package/dist/src/BaseEvent/Launchable/ContainerExec.js.map +0 -1
  24. package/dist/src/BaseEvent/Launchable/index.d.ts +0 -34
  25. package/dist/src/BaseEvent/Launchable/index.js +0 -43
  26. package/dist/src/BaseEvent/Launchable/index.js.map +0 -1
  27. package/dist/src/BaseEvent/Launchable/types.d.ts +0 -10
  28. package/dist/src/BaseEvent/Launchable/types.js +0 -2
  29. package/dist/src/BaseEvent/Launchable/types.js.map +0 -1
  30. package/dist/src/BaseEvent/Process.d.ts +0 -50
  31. package/dist/src/BaseEvent/Process.js +0 -64
  32. package/dist/src/BaseEvent/Process.js.map +0 -1
  33. package/dist/src/BaseEvent/StepTransaction.d.ts +0 -23
  34. package/dist/src/BaseEvent/StepTransaction.js +0 -27
  35. package/dist/src/BaseEvent/StepTransaction.js.map +0 -1
  36. package/dist/src/BaseEvent/Transaction.d.ts +0 -149
  37. package/dist/src/BaseEvent/Transaction.js +0 -224
  38. package/dist/src/BaseEvent/Transaction.js.map +0 -1
  39. package/dist/src/Cache/Redis.d.ts +0 -29
  40. package/dist/src/Cache/Redis.js +0 -80
  41. package/dist/src/Cache/Redis.js.map +0 -1
  42. package/dist/src/Cache/types.d.ts +0 -31
  43. package/dist/src/Cache/types.js +0 -2
  44. package/dist/src/Cache/types.js.map +0 -1
  45. package/dist/src/Config/Configuration.d.ts +0 -123
  46. package/dist/src/Config/Configuration.js +0 -109
  47. package/dist/src/Config/Configuration.js.map +0 -1
  48. package/dist/src/Config/EnvironmentVar.d.ts +0 -74
  49. package/dist/src/Config/EnvironmentVar.js +0 -138
  50. package/dist/src/Config/EnvironmentVar.js.map +0 -1
  51. package/dist/src/Crypto/Crypto.d.ts +0 -45
  52. package/dist/src/Crypto/Crypto.js +0 -72
  53. package/dist/src/Crypto/Crypto.js.map +0 -1
  54. package/dist/src/Database/Database.d.ts +0 -21
  55. package/dist/src/Database/Database.js +0 -15
  56. package/dist/src/Database/Database.js.map +0 -1
  57. package/dist/src/Database/DatabaseManager.d.ts +0 -47
  58. package/dist/src/Database/DatabaseManager.js +0 -60
  59. package/dist/src/Database/DatabaseManager.js.map +0 -1
  60. package/dist/src/Database/DatabaseTransaction.d.ts +0 -101
  61. package/dist/src/Database/DatabaseTransaction.js +0 -126
  62. package/dist/src/Database/DatabaseTransaction.js.map +0 -1
  63. package/dist/src/Database/index.d.ts +0 -10
  64. package/dist/src/Database/index.js +0 -15
  65. package/dist/src/Database/index.js.map +0 -1
  66. package/dist/src/Database/integrations/dynamo/DynamoDatabase.d.ts +0 -35
  67. package/dist/src/Database/integrations/dynamo/DynamoDatabase.js +0 -59
  68. package/dist/src/Database/integrations/dynamo/DynamoDatabase.js.map +0 -1
  69. package/dist/src/Database/integrations/kysely/KyselyDatabase.d.ts +0 -66
  70. package/dist/src/Database/integrations/kysely/KyselyDatabase.js +0 -86
  71. package/dist/src/Database/integrations/kysely/KyselyDatabase.js.map +0 -1
  72. package/dist/src/Database/integrations/kysely/KyselyTransaction.d.ts +0 -70
  73. package/dist/src/Database/integrations/kysely/KyselyTransaction.js +0 -118
  74. package/dist/src/Database/integrations/kysely/KyselyTransaction.js.map +0 -1
  75. package/dist/src/Database/integrations/pgsql/PostgresDatabase.d.ts +0 -36
  76. package/dist/src/Database/integrations/pgsql/PostgresDatabase.js +0 -54
  77. package/dist/src/Database/integrations/pgsql/PostgresDatabase.js.map +0 -1
  78. package/dist/src/Database/integrations/pgsql/PostgresTransaction.d.ts +0 -63
  79. package/dist/src/Database/integrations/pgsql/PostgresTransaction.js +0 -61
  80. package/dist/src/Database/integrations/pgsql/PostgresTransaction.js.map +0 -1
  81. package/dist/src/Database/types.d.ts +0 -76
  82. package/dist/src/Database/types.js +0 -2
  83. package/dist/src/Database/types.js.map +0 -1
  84. package/dist/src/Globals.d.ts +0 -93
  85. package/dist/src/Globals.js +0 -99
  86. package/dist/src/Globals.js.map +0 -1
  87. package/dist/src/Logger/Logger.d.ts +0 -161
  88. package/dist/src/Logger/Logger.js +0 -299
  89. package/dist/src/Logger/Logger.js.map +0 -1
  90. package/dist/src/Mailer/Mailer.d.ts +0 -78
  91. package/dist/src/Mailer/Mailer.js +0 -182
  92. package/dist/src/Mailer/Mailer.js.map +0 -1
  93. package/dist/src/Publisher/Publisher.d.ts +0 -39
  94. package/dist/src/Publisher/Publisher.js +0 -77
  95. package/dist/src/Publisher/Publisher.js.map +0 -1
  96. package/dist/src/Server/RouteResolver.d.ts +0 -33
  97. package/dist/src/Server/RouteResolver.js +0 -100
  98. package/dist/src/Server/RouteResolver.js.map +0 -1
  99. package/dist/src/Server/Router.d.ts +0 -157
  100. package/dist/src/Server/Router.js +0 -32
  101. package/dist/src/Server/Router.js.map +0 -1
  102. package/dist/src/Server/lib/ContainerServer.d.ts +0 -42
  103. package/dist/src/Server/lib/ContainerServer.js +0 -66
  104. package/dist/src/Server/lib/ContainerServer.js.map +0 -1
  105. package/dist/src/Server/lib/Server.d.ts +0 -45
  106. package/dist/src/Server/lib/Server.js +0 -93
  107. package/dist/src/Server/lib/Server.js.map +0 -1
  108. package/dist/src/Server/lib/container/GenericHandler.d.ts +0 -9
  109. package/dist/src/Server/lib/container/GenericHandler.js +0 -82
  110. package/dist/src/Server/lib/container/GenericHandler.js.map +0 -1
  111. package/dist/src/Server/lib/container/GenericHandlerEvent.d.ts +0 -52
  112. package/dist/src/Server/lib/container/GenericHandlerEvent.js +0 -132
  113. package/dist/src/Server/lib/container/GenericHandlerEvent.js.map +0 -1
  114. package/dist/src/Server/lib/container/HealthHandler.d.ts +0 -9
  115. package/dist/src/Server/lib/container/HealthHandler.js +0 -19
  116. package/dist/src/Server/lib/container/HealthHandler.js.map +0 -1
  117. package/dist/src/Server/lib/container/Proxy.d.ts +0 -67
  118. package/dist/src/Server/lib/container/Proxy.js +0 -143
  119. package/dist/src/Server/lib/container/Proxy.js.map +0 -1
  120. package/dist/src/Server/lib/container/Utils.d.ts +0 -14
  121. package/dist/src/Server/lib/container/Utils.js +0 -37
  122. package/dist/src/Server/lib/container/Utils.js.map +0 -1
  123. package/dist/src/Util/AsyncSingleton.d.ts +0 -31
  124. package/dist/src/Util/AsyncSingleton.js +0 -83
  125. package/dist/src/Util/AsyncSingleton.js.map +0 -1
  126. package/dist/src/Util/Utils.d.ts +0 -61
  127. package/dist/src/Util/Utils.js +0 -147
  128. package/dist/src/Util/Utils.js.map +0 -1
  129. package/dist/src/Validation/Validator.d.ts +0 -17
  130. package/dist/src/Validation/Validator.js +0 -39
  131. package/dist/src/Validation/Validator.js.map +0 -1
  132. package/dist/tsconfig.tsbuildinfo +0 -1
@@ -1,126 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- /**
11
- * Abstract class representing a database transaction.
12
- * Warning: These need to be arrow functions!
13
- * @class DatabaseTransaction
14
- */
15
- export class DatabaseTransaction extends Function {
16
- /**
17
- * Constructor for a class that interacts with a database using a writer and reader.
18
- * @param {any} writer - The object responsible for writing to the database.
19
- * @param {Database<any>} database - The database to interact with.
20
- * @param {any} [reader] - The object responsible for reading from the database (optional).
21
- * @returns None
22
- */
23
- constructor(writer, database, reader) {
24
- super('...args', 'return this.transaction(...args)');
25
- /**
26
- * Check if the object is open.
27
- * @returns {boolean} - true if the object is open, false otherwise.
28
- */
29
- this.isOpen = () => {
30
- return this._isOpen;
31
- };
32
- /**
33
- * Begins a transaction asynchronously.
34
- * @returns {Promise<void>} A Promise that resolves when the transaction has begun.
35
- * @throws {Error} If the transaction is already open.
36
- */
37
- this.begin = () => __awaiter(this, void 0, void 0, function* () {
38
- if (this._isOpen) {
39
- throw new Error('Cannot begin, transaction is already opened!');
40
- }
41
- yield this.doBegin();
42
- this._isOpen = true;
43
- });
44
- /**
45
- * Asynchronously commits the transaction.
46
- * If the transaction is already closed, an error is thrown.
47
- * @returns Promise<void>
48
- * @throws Error if the transaction is already closed
49
- */
50
- this.commit = () => __awaiter(this, void 0, void 0, function* () {
51
- if (!this._isOpen) {
52
- throw new Error('Cannot commit, transaction is already closed!');
53
- }
54
- yield this.doCommit();
55
- this._isOpen = false;
56
- });
57
- /**
58
- * Rollback the transaction by reverting any changes made within the transaction.
59
- * If the transaction is already closed, an error is thrown.
60
- * @returns Promise<void>
61
- * @throws Error if the transaction is already closed.
62
- */
63
- this.rollback = () => __awaiter(this, void 0, void 0, function* () {
64
- if (!this._isOpen) {
65
- throw new Error('Cannot rollback, transaction is already closed!');
66
- }
67
- yield this.doRollback();
68
- this._isOpen = false;
69
- });
70
- /**
71
- * Closes the success modal, committing or rolling back changes based on the autoCommit setting.
72
- * If the modal is open and autoCommit is enabled, it will commit the changes.
73
- * If autoCommit is disabled, it will rollback the changes.
74
- * @returns {Promise<void>} A promise that resolves once the commit or rollback operation is completed.
75
- */
76
- this.closeSuccess = () => __awaiter(this, void 0, void 0, function* () {
77
- if (this._isOpen) {
78
- if (this.database.config['autoCommit']) {
79
- yield this.doCommit();
80
- }
81
- else {
82
- yield this.doRollback();
83
- }
84
- }
85
- });
86
- /**
87
- * Closes the failure by performing a rollback if the failure is currently open.
88
- * @returns {Promise<void>} A promise that resolves once the rollback is completed.
89
- */
90
- this.closeFailure = () => __awaiter(this, void 0, void 0, function* () {
91
- if (this._isOpen) {
92
- yield this.doRollback();
93
- }
94
- });
95
- this.writer = writer;
96
- this.database = database;
97
- this.reader = reader;
98
- }
99
- /**
100
- * Creates a proxy instance for the given subclass of DatabaseTransaction.
101
- * The proxy handles method binding and transaction execution based on the subclass state.
102
- * @param {T} subclass - The subclass of DatabaseTransaction to proxy.
103
- * @returns A proxied instance of the subclass with method binding and transaction execution logic.
104
- */
105
- static proxyInstance(subclass) {
106
- const bind = (target, key) => typeof target[key] === 'function' ? target[key].bind(target) : target[key];
107
- return new Proxy(subclass, {
108
- get(target, p) {
109
- if (target[p] !== undefined) {
110
- return bind(target, p);
111
- }
112
- else if (target._isOpen) {
113
- return bind(target.transaction, p);
114
- }
115
- return undefined;
116
- },
117
- apply(target, thisArg, argArray) {
118
- if (target._isOpen) {
119
- return target.transaction(...argArray);
120
- }
121
- throw new Error('Transaction is closed!');
122
- },
123
- });
124
- }
125
- }
126
- //# sourceMappingURL=DatabaseTransaction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DatabaseT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QAAe;gBAC5C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;oBACnB,OAAO,MAAM,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAA;gBACxC,CAAC;gBACD,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAA;YAC3C,CAAC;SACF,CAAC,CAAA;IACJ,CAAC;CA+FF"}
@@ -1,10 +0,0 @@
1
- import { Database } from './Database.js';
2
- import { DatabaseManager } from './DatabaseManager.js';
3
- import { DatabaseTransaction } from './DatabaseTransaction.js';
4
- import { DynamoDatabase } from './integrations/dynamo/DynamoDatabase.js';
5
- import { KyselyDatabase } from './integrations/kysely/KyselyDatabase.js';
6
- import { KyselyTransaction } from './integrations/kysely/KyselyTransaction.js';
7
- import { PostgresDatabase } from './integrations/pgsql/PostgresDatabase.js';
8
- import { PostgresTransaction } from './integrations/pgsql/PostgresTransaction.js';
9
- import { DbConfig } from './types.js';
10
- export { DatabaseTransaction, Database, DatabaseManager, DbConfig, PostgresTransaction, PostgresDatabase, KyselyTransaction, KyselyDatabase, DynamoDatabase, };
@@ -1,15 +0,0 @@
1
- import { Database } from './Database.js';
2
- import { DatabaseManager } from './DatabaseManager.js';
3
- import { DatabaseTransaction } from './DatabaseTransaction.js';
4
- import { DynamoDatabase } from './integrations/dynamo/DynamoDatabase.js';
5
- import { KyselyDatabase } from './integrations/kysely/KyselyDatabase.js';
6
- import { PostgresDatabase } from './integrations/pgsql/PostgresDatabase.js';
7
- export {
8
- // Abstracts
9
- DatabaseTransaction, Database,
10
- // 'Entrypoints'
11
- DatabaseManager, PostgresDatabase, KyselyDatabase,
12
- // Dynamo
13
- // DynamoTransaction,
14
- DynamoDatabase, };
15
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Database/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAA;AAExE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAA;AAI3E,OAAO;AACL,YAAY;AACZ,mBAAmB,EACnB,QAAQ;AACR,gBAAgB;AAChB,eAAe,EAIf,gBAAgB,EAGhB,cAAc;AACd,SAAS;AACT,qBAAqB;AACrB,cAAc,GACf,CAAA"}
@@ -1,35 +0,0 @@
1
- import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
2
- import { Database } from '../../Database.js';
3
- import type { DbConfig } from '../../types.js';
4
- /**
5
- * Represents a DynamoDB database connection that extends a generic Database class.
6
- * @extends Database<any>
7
- */
8
- export declare class DynamoDatabase extends Database<any> {
9
- /**
10
- * A private static property that holds an instance of the DynamoDBClient class.
11
- * This property can be used to interact with DynamoDB services.
12
- */
13
- private static dynamoProvider;
14
- /**
15
- * A readonly property representing the DynamoDB client used to interact with DynamoDB.
16
- */
17
- readonly client: DynamoDBClient;
18
- /**
19
- * Constructor for creating a new instance of a class that interacts with a DynamoDB database.
20
- * @param {DbConfig<'dynamo'>} config - The configuration object for DynamoDB.
21
- * @returns None
22
- */
23
- constructor(config: DbConfig<'dynamo'>);
24
- /**
25
- * Override method to handle a transaction asynchronously.
26
- * @returns A Promise that resolves to null.
27
- */
28
- transaction(): Promise<any>;
29
- /**
30
- * Creates a provider for DynamoDB based on the provided configuration.
31
- * @param {DbConfig<'dynamo'>} config - The configuration object for DynamoDB.
32
- * @returns A DynamoDB provider instance based on the provided configuration.
33
- */
34
- private providerFactory;
35
- }
@@ -1,59 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { Agent } from 'https';
11
- import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
12
- import { NodeHttpHandler } from '@smithy/node-http-handler';
13
- import { Database } from '../../Database.js';
14
- /**
15
- * Represents a DynamoDB database connection that extends a generic Database class.
16
- * @extends Database<any>
17
- */
18
- export class DynamoDatabase extends Database {
19
- /**
20
- * Constructor for creating a new instance of a class that interacts with a DynamoDB database.
21
- * @param {DbConfig<'dynamo'>} config - The configuration object for DynamoDB.
22
- * @returns None
23
- */
24
- constructor(config) {
25
- super(config);
26
- this.client = this.providerFactory(config);
27
- }
28
- /**
29
- * Override method to handle a transaction asynchronously.
30
- * @returns A Promise that resolves to null.
31
- */
32
- transaction() {
33
- return __awaiter(this, void 0, void 0, function* () {
34
- return Promise.resolve(null);
35
- });
36
- }
37
- /**
38
- * Creates a provider for DynamoDB based on the provided configuration.
39
- * @param {DbConfig<'dynamo'>} config - The configuration object for DynamoDB.
40
- * @returns A DynamoDB provider instance based on the provided configuration.
41
- */
42
- providerFactory(config) {
43
- return new DynamoDatabase.dynamoProvider({
44
- region: config.region,
45
- maxAttempts: config.maxAttempts || 3,
46
- requestHandler: new NodeHttpHandler({
47
- connectionTimeout: config.connectionTimeout || 60000,
48
- socketTimeout: config.connectionTimeout || 60000,
49
- httpsAgent: new Agent({ keepAlive: false, maxSockets: 50, rejectUnauthorized: true }),
50
- }),
51
- });
52
- }
53
- }
54
- /**
55
- * A private static property that holds an instance of the DynamoDBClient class.
56
- * This property can be used to interact with DynamoDB services.
57
- */
58
- DynamoDatabase.dynamoProvider = DynamoDBClient;
59
- //# sourceMappingURL=DynamoDatabase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DynamoDatabase.js","sourceRoot":"","sources":["../../../../../src/Database/integrations/dynamo/DynamoDatabase.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,QAAa;IAW/C;;;;OAIG;IACH,YAAY,MAA0B;QACpC,KAAK,CAAC,MAAM,CAAC,CAAA;QACb,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;IAC5C,CAAC;IAED;;;OAGG;IACmB,WAAW;;YAC/B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QAC9B,CAAC;KAAA;IAED;;;;OAIG;IACK,eAAe,CAAC,MAA0B;QAChD,OAAO,IAAI,cAAc,CAAC,cAAc,CAAC;YACvC,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,CAAC;YACpC,cAAc,EAAE,IAAI,eAAe,CAAC;gBAClC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,IAAI,KAAK;gBACpD,aAAa,EAAE,MAAM,CAAC,iBAAiB,IAAI,KAAK;gBAChD,UAAU,EAAE,IAAI,KAAK,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC;aACtF,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;;AA3CD;;;GAGG;AACY,6BAAc,GAAG,cAAc,CAAA"}
@@ -1,66 +0,0 @@
1
- import { Kysely } from 'kysely';
2
- import { KyselyTransaction } from './KyselyTransaction.js';
3
- import { Database } from '../../Database.js';
4
- import type { DbConfig } from '../../types.js';
5
- /**
6
- * Represents a database connection using the Kysely library with support for transactions.
7
- * @template DBSchema - The schema type for the database.
8
- */
9
- export declare class KyselyDatabase<DBSchema = never> extends Database<KyselyTransaction<DBSchema>> {
10
- /**
11
- * Represents a PostgreSQL provider for querying data using the PostgresDialect.
12
- * @type {PostgresDialect}
13
- */
14
- private static kyselyPgProvider;
15
- /**
16
- * A public static property that provides access to the Kysely class.
17
- * This property can be accessed without creating an instance of the class.
18
- */
19
- private static kyselyProvider;
20
- /**
21
- * A static property that represents a connection pool for PostgreSQL database connections.
22
- * @type {Pool}
23
- */
24
- private static pgProvider;
25
- /**
26
- * Represents a PostgreSQL client using the PostgresDialect.
27
- */
28
- private readonly pgClient;
29
- /**
30
- * Represents a client for querying the database with the specified schema.
31
- * @type {Kysely<DBSchema>} client - The client for querying the database.
32
- */
33
- readonly client: Kysely<DBSchema>;
34
- /**
35
- * Optional property representing the Postgres dialect for reading in a database client.
36
- */
37
- private readonly pgReadClient?;
38
- /**
39
- * Represents a client for reading from the database.
40
- * @type {Kysely<DBSchema> | undefined} - The client for reading from the database.
41
- */
42
- readonly readClient?: Kysely<DBSchema>;
43
- /**
44
- * Constructor for creating a database connection using the provided configuration.
45
- * @param {DbConfig<'kysely'>} config - The configuration object for the database connection.
46
- * @returns None
47
- */
48
- constructor(config: DbConfig<'kysely'>);
49
- /**
50
- * Override method that starts a new transaction using the provided client and read client.
51
- * @returns A Promise that resolves to a KyselyTransaction object for the specified database schema.
52
- */
53
- transaction(): Promise<KyselyTransaction<DBSchema>>;
54
- /**
55
- * Creates a database dialect based on the provided configuration.
56
- * @param {DbBaseConfig} config - The configuration object for the database connection.
57
- * @returns A database dialect instance based on the provided configuration.
58
- */
59
- private dialectFactory;
60
- /**
61
- * Creates a provider for interacting with a database using the specified Postgres dialect.
62
- * @param {PostgresDialect} dialect - The Postgres dialect to use for the database connection.
63
- * @returns A database provider for interacting with the database.
64
- */
65
- private providerFactory;
66
- }
@@ -1,86 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { CamelCasePlugin, Kysely, PostgresDialect } from 'kysely';
11
- import pg from 'pg';
12
- import { KyselyTransactionImpl } from './KyselyTransaction.js';
13
- import { Database } from '../../Database.js';
14
- /**
15
- * Represents a database connection using the Kysely library with support for transactions.
16
- * @template DBSchema - The schema type for the database.
17
- */
18
- export class KyselyDatabase extends Database {
19
- /**
20
- * Constructor for creating a database connection using the provided configuration.
21
- * @param {DbConfig<'kysely'>} config - The configuration object for the database connection.
22
- * @returns None
23
- */
24
- constructor(config) {
25
- super(config);
26
- this.pgClient = this.dialectFactory(config);
27
- this.client = this.providerFactory(this.pgClient);
28
- if (config.readReplica) {
29
- this.pgReadClient = this.dialectFactory(config.readReplica);
30
- this.readClient = this.providerFactory(this.pgReadClient);
31
- }
32
- }
33
- /**
34
- * Override method that starts a new transaction using the provided client and read client.
35
- * @returns A Promise that resolves to a KyselyTransaction object for the specified database schema.
36
- */
37
- transaction() {
38
- return __awaiter(this, void 0, void 0, function* () {
39
- return KyselyTransactionImpl.newTransaction(this.client, this, this.readClient);
40
- });
41
- }
42
- /**
43
- * Creates a database dialect based on the provided configuration.
44
- * @param {DbBaseConfig} config - The configuration object for the database connection.
45
- * @returns A database dialect instance based on the provided configuration.
46
- */
47
- dialectFactory(config) {
48
- return new KyselyDatabase.kyselyPgProvider({
49
- pool: new KyselyDatabase.pgProvider({
50
- host: config.host,
51
- port: config.port,
52
- user: config.username,
53
- password: config.password,
54
- database: config.database,
55
- max: config.maxConnections,
56
- }),
57
- });
58
- }
59
- /**
60
- * Creates a provider for interacting with a database using the specified Postgres dialect.
61
- * @param {PostgresDialect} dialect - The Postgres dialect to use for the database connection.
62
- * @returns A database provider for interacting with the database.
63
- */
64
- providerFactory(dialect) {
65
- return new KyselyDatabase.kyselyProvider({
66
- dialect,
67
- plugins: [new CamelCasePlugin()],
68
- });
69
- }
70
- }
71
- /**
72
- * Represents a PostgreSQL provider for querying data using the PostgresDialect.
73
- * @type {PostgresDialect}
74
- */
75
- KyselyDatabase.kyselyPgProvider = PostgresDialect;
76
- /**
77
- * A public static property that provides access to the Kysely class.
78
- * This property can be accessed without creating an instance of the class.
79
- */
80
- KyselyDatabase.kyselyProvider = Kysely;
81
- /**
82
- * A static property that represents a connection pool for PostgreSQL database connections.
83
- * @type {Pool}
84
- */
85
- KyselyDatabase.pgProvider = pg.Pool;
86
- //# sourceMappingURL=KyselyDatabase.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KyselyDatabase.js","sourceRoot":"","sources":["../../../../../src/Database/integrations/kysely/KyselyDatabase.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AACjE,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,OAAO,EAAqB,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAG5C;;;GAGG;AACH,MAAM,OAAO,cAAiC,SAAQ,QAAqC;IAmCzF;;;;OAIG;IACH,YAAY,MAA0B;QACpC,KAAK,CAAC,MAAM,CAAC,CAAA;QACb,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC3C,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QACjD,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACvB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAA;YAC3D,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QAC3D,CAAC;IACH,CAAC;IAED;;;OAGG;IACmB,WAAW;;YAC/B,OAAO,qBAAqB,CAAC,cAAc,CAAW,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;QAC3F,CAAC;KAAA;IAED;;;;OAIG;IACK,cAAc,CAAC,MAAoB;QACzC,OAAO,IAAI,cAAc,CAAC,gBAAgB,CAAC;YACzC,IAAI,EAAE,IAAI,cAAc,CAAC,UAAU,CAAC;gBAClC,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,IAAI,EAAE,MAAM,CAAC,QAAQ;gBACrB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ;gBACzB,GAAG,EAAE,MAAM,CAAC,cAAc;aAC3B,CAAC;SACH,CAAC,CAAA;IACJ,CAAC;IAED;;;;OAIG;IACK,eAAe,CAAC,OAAwB;QAC9C,OAAO,IAAI,cAAc,CAAC,cAAc,CAAW;YACjD,OAAO;YACP,OAAO,EAAE,CAAC,IAAI,eAAe,EAAE,CAAC;SACjC,CAAC,CAAA;IACJ,CAAC;;AArFD;;;GAGG;AACY,+BAAgB,GAAG,eAAe,CAAA;AACjD;;;GAGG;AACY,6BAAc,GAAG,MAAM,CAAA;AACtC;;;GAGG;AACY,yBAAU,GAAG,EAAE,CAAC,IAAI,CAAA"}
@@ -1,70 +0,0 @@
1
- import { Kysely, Transaction } from 'kysely';
2
- import { KyselyDatabase } from './KyselyDatabase.js';
3
- import { Database } from '../../Database.js';
4
- import { DatabaseTransaction } from '../../DatabaseTransaction.js';
5
- /**
6
- * Represents a transaction for querying a database with a specific schema.
7
- * @typeparam DBSchema - The schema of the database.
8
- * @type {KyselyTransactionImpl<DBSchema> & Transaction<DBSchema>}
9
- */
10
- export type KyselyTransaction<DBSchema> = KyselyTransactionImpl<DBSchema> & Transaction<DBSchema>;
11
- /**
12
- * Represents a transaction in a Postgres database.
13
- */
14
- export declare class KyselyTransactionImpl<DBSchema> extends DatabaseTransaction {
15
- /**
16
- * A readonly property representing a writer for a Kysely object.
17
- * @type {Kysely<any>}
18
- */
19
- readonly writer: Kysely<any>;
20
- /**
21
- * A readonly property representing a reader of type Kysely<any>.
22
- * This property allows reading data of any type using the Kysely interface.
23
- */
24
- readonly reader: Kysely<any>;
25
- /**
26
- * A protected property representing a transaction of type any.
27
- */
28
- protected transaction: Transaction<any>;
29
- /**
30
- * A protected property representing a database instance.
31
- * @type {Database<KyselyTransaction<DBSchema>>}
32
- */
33
- protected database: Database<KyselyTransaction<DBSchema>>;
34
- /**
35
- * A private property that represents a deferred object.
36
- * @type {Deferred<any>}
37
- */
38
- private txWrapper;
39
- /**
40
- * Constructs a new instance of the class.
41
- * @param {Kysely<DBSchema>} delegate - The delegate object for the database query.
42
- * @param {KyselyDatabase<DBSchema>} database - The database object for the query.
43
- * @param {Kysely<DBSchema>} [reader] - An optional reader object for the query.
44
- * @returns None
45
- */
46
- private constructor();
47
- /**
48
- * Creates a new database transaction for the given database schema.
49
- * @param {Kysely<DBSchema>} connection - The connection object for the transaction.
50
- * @param {KyselyDatabase<DBSchema>} database - The database object for the transaction.
51
- * @param {Kysely<DBSchema>} [reader] - An optional reader object for the transaction.
52
- * @returns {Promise<KyselyTransaction<DBSchema>>} A promise that resolves to the created transaction.
53
- */
54
- static newTransaction<DBSchema>(connection: Kysely<DBSchema>, database: KyselyDatabase<DBSchema>, reader?: Kysely<DBSchema>): Promise<KyselyTransaction<DBSchema>>;
55
- /**
56
- * Asynchronously begins a transaction using a writer and resolves the transaction once it is executed.
57
- * @returns A Promise that resolves with the transaction object once the transaction is executed.
58
- */
59
- protected doBegin: () => Promise<unknown>;
60
- /**
61
- * Executes the commit operation by resolving the transaction wrapper and returning a resolved Promise.
62
- * @returns A Promise that resolves to null.
63
- */
64
- protected doCommit: () => Promise<void>;
65
- /**
66
- * Performs a rollback operation by rejecting the transaction wrapper with an error.
67
- * @returns A resolved Promise after the rollback operation is completed.
68
- */
69
- protected doRollback: () => Promise<void>;
70
- }
@@ -1,118 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- import { DatabaseTransaction } from '../../DatabaseTransaction.js';
11
- /**
12
- * Represents a transaction in a Postgres database.
13
- */
14
- export class KyselyTransactionImpl extends DatabaseTransaction {
15
- /**
16
- * Constructs a new instance of the class.
17
- * @param {Kysely<DBSchema>} delegate - The delegate object for the database query.
18
- * @param {KyselyDatabase<DBSchema>} database - The database object for the query.
19
- * @param {Kysely<DBSchema>} [reader] - An optional reader object for the query.
20
- * @returns None
21
- */
22
- constructor(delegate, database, reader) {
23
- super(delegate, database, reader);
24
- /**
25
- * Asynchronously begins a transaction using a writer and resolves the transaction once it is executed.
26
- * @returns A Promise that resolves with the transaction object once the transaction is executed.
27
- */
28
- this.doBegin = () => __awaiter(this, void 0, void 0, function* () {
29
- this.txWrapper = new Deferred();
30
- return new Promise(resolve => {
31
- this.writer
32
- .transaction()
33
- .execute((trx) => __awaiter(this, void 0, void 0, function* () {
34
- this.transaction = trx;
35
- resolve(trx); // resolve with tx
36
- return this.txWrapper.promise; // wait for wrapper to be solved
37
- }))
38
- .catch(() => {
39
- // Don't do anything here. Just swallow the exception.
40
- });
41
- });
42
- });
43
- /**
44
- * Executes the commit operation by resolving the transaction wrapper and returning a resolved Promise.
45
- * @returns A Promise that resolves to null.
46
- */
47
- this.doCommit = () => {
48
- this.txWrapper.resolve(null);
49
- return Promise.resolve();
50
- };
51
- /**
52
- * Performs a rollback operation by rejecting the transaction wrapper with an error.
53
- * @returns A resolved Promise after the rollback operation is completed.
54
- */
55
- this.doRollback = () => {
56
- this.txWrapper.reject(new Error('Rollback'));
57
- return Promise.resolve();
58
- };
59
- }
60
- /**
61
- * Creates a new database transaction for the given database schema.
62
- * @param {Kysely<DBSchema>} connection - The connection object for the transaction.
63
- * @param {KyselyDatabase<DBSchema>} database - The database object for the transaction.
64
- * @param {Kysely<DBSchema>} [reader] - An optional reader object for the transaction.
65
- * @returns {Promise<KyselyTransaction<DBSchema>>} A promise that resolves to the created transaction.
66
- */
67
- static newTransaction(connection, database, reader) {
68
- return __awaiter(this, void 0, void 0, function* () {
69
- const tx = new KyselyTransactionImpl(connection, database, reader);
70
- yield tx.begin();
71
- return DatabaseTransaction.proxyInstance(tx);
72
- });
73
- }
74
- }
75
- /**
76
- * Represents a deferred promise that can be resolved or rejected at a later time.
77
- * @template T - The type of the value that the promise will resolve to.
78
- */
79
- class Deferred {
80
- /**
81
- * Constructor for creating a new Promise instance with resolve and reject functions.
82
- * @constructor
83
- */
84
- constructor() {
85
- this._promise = new Promise((resolve, reject) => {
86
- this._reject = reject;
87
- this._resolve = resolve;
88
- });
89
- }
90
- /**
91
- * Getter method to retrieve the Promise object.
92
- * @returns {Promise<T>} A Promise object of type T.
93
- */
94
- get promise() {
95
- return this._promise;
96
- }
97
- /**
98
- * Resolves the Promise with the given value.
99
- * @param {T | PromiseLike<T>} value - The value to resolve the Promise with.
100
- * @returns void
101
- */
102
- resolve(value) {
103
- if (this._resolve) {
104
- this._resolve(value);
105
- }
106
- }
107
- /**
108
- * Rejects the Promise with the given reason, if the reject function is available.
109
- * @param {any} reason - The reason for rejecting the Promise.
110
- * @returns void
111
- */
112
- reject(reason) {
113
- if (this._reject) {
114
- this._reject(reason);
115
- }
116
- }
117
- }
118
- //# sourceMappingURL=KyselyTransaction.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"KyselyTransaction.js","sourceRoot":"","sources":["../../../../../src/Database/integrations/kysely/KyselyTransaction.ts"],"names":[],"mappings":";;;;;;;;;AAIA,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAQlE;;GAEG;AACH,MAAM,OAAO,qBAAgC,SAAQ,mBAAmB;IAyBtE;;;;;;OAMG;IACH,YACE,QAA0B,EAC1B,QAAkC,EAClC,MAAyB;QAEzB,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;QAoBnC;;;WAGG;QACO,YAAO,GAAG,GAAS,EAAE;YAC7B,IAAI,CAAC,SAAS,GAAG,IAAI,QAAQ,EAAO,CAAA;YACpC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;gBAC3B,IAAI,CAAC,MAAM;qBACR,WAAW,EAAE;qBACb,OAAO,CAAC,CAAM,GAAG,EAAC,EAAE;oBACnB,IAAI,CAAC,WAAW,GAAG,GAAG,CAAA;oBACtB,OAAO,CAAC,GAAG,CAAC,CAAA,CAAC,kBAAkB;oBAC/B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAA,CAAC,gCAAgC;gBAChE,CAAC,CAAA,CAAC;qBACD,KAAK,CAAC,GAAG,EAAE;oBACV,sDAAsD;gBACxD,CAAC,CAAC,CAAA;YACN,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA,CAAA;QAED;;;WAGG;QACO,aAAQ,GAAG,GAAG,EAAE;YACxB,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;YAC5B,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;QAC1B,CAAC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Database } from '../../Database.js';
4
- import type { DbConfig } from '../../types.js';
5
- /**
6
- * Represents a Postgres database connection that extends the Database class.
7
- * @extends Database<PostgresTransaction>
8
- */
9
- export declare class PostgresDatabase extends Database<PostgresTransaction> {
10
- /**
11
- * A public static property that represents a connection pool for a PostgreSQL database.
12
- * This property is used to manage and provide connections to the PostgreSQL database.
13
- */
14
- private static pgProvider;
15
- /**
16
- * Represents a connection pool to manage multiple client connections to the database.
17
- */
18
- readonly client: pg.Pool;
19
- /**
20
- * A private property that represents a connection pool for clients.
21
- * @type {Pool | undefined}
22
- */
23
- readonly readClient?: pg.Pool;
24
- /**
25
- * Constructor for creating a new instance of a database connection using Postgres.
26
- * @param {DbConfig<'pg'>} config - The configuration object for the Postgres database.
27
- * @returns None
28
- */
29
- constructor(config: DbConfig<'pg'>);
30
- /**
31
- * Creates a new Postgres transaction using the provided client and read client.
32
- * @returns {Promise<PostgresTransaction>} A promise that resolves to a new PostgresTransaction object.
33
- */
34
- transaction(): Promise<PostgresTransaction>;
35
- private providerFactory;
36
- }