@golemio/core 1.2.25-dev.723880707 → 1.2.25-dev.726368711

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 (188) hide show
  1. package/dist/helpers/connector/interfaces/IQueueConnector.d.ts +8 -0
  2. package/dist/helpers/connector/interfaces/IQueueConnector.js +3 -0
  3. package/dist/helpers/connector/interfaces/IQueueConnector.js.map +1 -0
  4. package/dist/helpers/ioc/Di.d.ts +2 -0
  5. package/dist/helpers/ioc/Di.js +7 -0
  6. package/dist/helpers/ioc/Di.js.map +1 -0
  7. package/dist/helpers/ioc/index.d.ts +1 -0
  8. package/dist/helpers/ioc/index.js +18 -0
  9. package/dist/helpers/ioc/index.js.map +1 -0
  10. package/dist/helpers/utils.d.ts +1 -0
  11. package/dist/helpers/utils.js +6 -0
  12. package/dist/helpers/utils.js.map +1 -0
  13. package/dist/input-gateway/config/InputGatewayConfiguration.d.ts +52 -0
  14. package/dist/input-gateway/config/InputGatewayConfiguration.js +77 -0
  15. package/dist/input-gateway/config/InputGatewayConfiguration.js.map +1 -0
  16. package/dist/input-gateway/config/abstract.d.ts +1 -2
  17. package/dist/input-gateway/config/config.d.ts +3 -0
  18. package/dist/input-gateway/config/config.js +5 -56
  19. package/dist/input-gateway/config/config.js.map +1 -1
  20. package/dist/input-gateway/connectors/AMQPConnector.d.ts +11 -24
  21. package/dist/input-gateway/connectors/AMQPConnector.js +45 -39
  22. package/dist/input-gateway/connectors/AMQPConnector.js.map +1 -1
  23. package/dist/input-gateway/connectors/index.d.ts +6 -1
  24. package/dist/input-gateway/connectors/index.js +4 -15
  25. package/dist/input-gateway/connectors/index.js.map +1 -1
  26. package/dist/input-gateway/controllers/BaseController.js +2 -2
  27. package/dist/input-gateway/controllers/BaseController.js.map +1 -1
  28. package/dist/input-gateway/helpers/Logger.d.ts +16 -20
  29. package/dist/input-gateway/helpers/Logger.js +16 -38
  30. package/dist/input-gateway/helpers/Logger.js.map +1 -1
  31. package/dist/input-gateway/helpers/LoggerEvents.d.ts +11 -0
  32. package/dist/input-gateway/helpers/LoggerEvents.js +55 -0
  33. package/dist/input-gateway/helpers/LoggerEvents.js.map +1 -0
  34. package/dist/input-gateway/helpers/index.d.ts +3 -0
  35. package/dist/input-gateway/helpers/index.js +5 -0
  36. package/dist/input-gateway/helpers/index.js.map +1 -1
  37. package/dist/input-gateway/helpers/interfaces/INumberOfRecordsEventData.d.ts +5 -0
  38. package/dist/input-gateway/helpers/interfaces/INumberOfRecordsEventData.js +3 -0
  39. package/dist/input-gateway/helpers/interfaces/INumberOfRecordsEventData.js.map +1 -0
  40. package/dist/input-gateway/helpers/interfaces/IResponseTimesEventData.d.ts +6 -0
  41. package/dist/input-gateway/helpers/interfaces/IResponseTimesEventData.js +3 -0
  42. package/dist/input-gateway/helpers/interfaces/IResponseTimesEventData.js.map +1 -0
  43. package/dist/input-gateway/ioc/ContainerToken.d.ts +8 -0
  44. package/dist/input-gateway/ioc/ContainerToken.js +12 -0
  45. package/dist/input-gateway/ioc/ContainerToken.js.map +1 -0
  46. package/dist/input-gateway/ioc/Di.d.ts +2 -0
  47. package/dist/input-gateway/ioc/Di.js +32 -0
  48. package/dist/input-gateway/ioc/Di.js.map +1 -0
  49. package/dist/input-gateway/ioc/index.d.ts +2 -0
  50. package/dist/input-gateway/ioc/index.js +19 -0
  51. package/dist/input-gateway/ioc/index.js.map +1 -0
  52. package/dist/integration-engine/config/IntegrationEngineConfiguration.d.ts +78 -0
  53. package/dist/integration-engine/config/IntegrationEngineConfiguration.js +109 -0
  54. package/dist/integration-engine/config/IntegrationEngineConfiguration.js.map +1 -0
  55. package/dist/integration-engine/config/config.d.ts +5 -1
  56. package/dist/integration-engine/config/config.js +6 -88
  57. package/dist/integration-engine/config/config.js.map +1 -1
  58. package/dist/integration-engine/connectors/AMQPConnector.d.ts +12 -5
  59. package/dist/integration-engine/connectors/AMQPConnector.js +59 -35
  60. package/dist/integration-engine/connectors/AMQPConnector.js.map +1 -1
  61. package/dist/integration-engine/connectors/MongoConnector.d.ts +9 -3
  62. package/dist/integration-engine/connectors/MongoConnector.js +36 -14
  63. package/dist/integration-engine/connectors/MongoConnector.js.map +1 -1
  64. package/dist/integration-engine/connectors/PostgresConnector.d.ts +12 -3
  65. package/dist/integration-engine/connectors/PostgresConnector.js +40 -16
  66. package/dist/integration-engine/connectors/PostgresConnector.js.map +1 -1
  67. package/dist/integration-engine/connectors/RedisConnector.d.ts +9 -3
  68. package/dist/integration-engine/connectors/RedisConnector.js +32 -10
  69. package/dist/integration-engine/connectors/RedisConnector.js.map +1 -1
  70. package/dist/integration-engine/connectors/index.d.ts +24 -4
  71. package/dist/integration-engine/connectors/index.js +22 -19
  72. package/dist/integration-engine/connectors/index.js.map +1 -1
  73. package/dist/integration-engine/connectors/interfaces/IMongoConnector.d.ts +7 -0
  74. package/dist/integration-engine/connectors/interfaces/IMongoConnector.js +3 -0
  75. package/dist/integration-engine/connectors/interfaces/IMongoConnector.js.map +1 -0
  76. package/dist/integration-engine/connectors/interfaces/IPostgresConnector.d.ts +7 -0
  77. package/dist/integration-engine/connectors/interfaces/IPostgresConnector.js +3 -0
  78. package/dist/integration-engine/connectors/interfaces/IPostgresConnector.js.map +1 -0
  79. package/dist/integration-engine/connectors/interfaces/IRedisConnector.d.ts +7 -0
  80. package/dist/integration-engine/connectors/interfaces/IRedisConnector.js +3 -0
  81. package/dist/integration-engine/connectors/interfaces/IRedisConnector.js.map +1 -0
  82. package/dist/integration-engine/data-access/RawDataStorage.d.ts +11 -0
  83. package/dist/integration-engine/data-access/RawDataStorage.js +81 -0
  84. package/dist/integration-engine/data-access/RawDataStorage.js.map +1 -0
  85. package/dist/integration-engine/data-access/StorageService.d.ts +10 -4
  86. package/dist/integration-engine/data-access/StorageService.js +40 -18
  87. package/dist/integration-engine/data-access/StorageService.js.map +1 -1
  88. package/dist/integration-engine/data-access/index.d.ts +6 -1
  89. package/dist/integration-engine/data-access/index.js +7 -15
  90. package/dist/integration-engine/data-access/index.js.map +1 -1
  91. package/dist/integration-engine/data-access/interfaces/IStorageService.d.ts +3 -0
  92. package/dist/integration-engine/data-access/interfaces/IStorageService.js +3 -0
  93. package/dist/integration-engine/data-access/interfaces/IStorageService.js.map +1 -0
  94. package/dist/integration-engine/data-access/pubsub/RedisPubSubChannel.d.ts +3 -3
  95. package/dist/integration-engine/data-access/pubsub/RedisPubSubChannel.js +7 -4
  96. package/dist/integration-engine/data-access/pubsub/RedisPubSubChannel.js.map +1 -1
  97. package/dist/integration-engine/data-access/pubsub/subscribers/AbstractSubscriber.d.ts +6 -2
  98. package/dist/integration-engine/data-access/pubsub/subscribers/AbstractSubscriber.js.map +1 -1
  99. package/dist/integration-engine/data-access/pubsub/subscribers/RedisSubscriber.d.ts +10 -12
  100. package/dist/integration-engine/data-access/pubsub/subscribers/RedisSubscriber.js +33 -45
  101. package/dist/integration-engine/data-access/pubsub/subscribers/RedisSubscriber.js.map +1 -1
  102. package/dist/integration-engine/data-access/pubsub/subscribers/interfaces/ISubscribeMessage.d.ts +1 -0
  103. package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategy.js +6 -4
  104. package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategy.js.map +1 -1
  105. package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.d.ts +1 -1
  106. package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.js +4 -3
  107. package/dist/integration-engine/datasources/protocol-strategy/PostgresProtocolStrategyStreamed.js.map +1 -1
  108. package/dist/integration-engine/helpers/FileCompressor.js +4 -6
  109. package/dist/integration-engine/helpers/FileCompressor.js.map +1 -1
  110. package/dist/integration-engine/helpers/GeocodeApi.d.ts +8 -3
  111. package/dist/integration-engine/helpers/GeocodeApi.js +32 -11
  112. package/dist/integration-engine/helpers/GeocodeApi.js.map +1 -1
  113. package/dist/integration-engine/helpers/Logger.d.ts +16 -10
  114. package/dist/integration-engine/helpers/Logger.js +13 -71
  115. package/dist/integration-engine/helpers/Logger.js.map +1 -1
  116. package/dist/integration-engine/helpers/LoggerEvents.d.ts +11 -0
  117. package/dist/integration-engine/helpers/LoggerEvents.js +91 -0
  118. package/dist/integration-engine/helpers/LoggerEvents.js.map +1 -0
  119. package/dist/integration-engine/helpers/RawDataStore.d.ts +3 -0
  120. package/dist/integration-engine/helpers/RawDataStore.js +5 -39
  121. package/dist/integration-engine/helpers/RawDataStore.js.map +1 -1
  122. package/dist/integration-engine/helpers/index.d.ts +8 -2
  123. package/dist/integration-engine/helpers/index.js +10 -2
  124. package/dist/integration-engine/helpers/index.js.map +1 -1
  125. package/dist/integration-engine/ioc/ContainerToken.d.ts +14 -0
  126. package/dist/integration-engine/ioc/ContainerToken.js +18 -0
  127. package/dist/integration-engine/ioc/ContainerToken.js.map +1 -0
  128. package/dist/integration-engine/ioc/Di.d.ts +2 -0
  129. package/dist/integration-engine/ioc/Di.js +46 -0
  130. package/dist/integration-engine/ioc/Di.js.map +1 -0
  131. package/dist/integration-engine/ioc/index.d.ts +2 -0
  132. package/dist/integration-engine/ioc/index.js +19 -0
  133. package/dist/integration-engine/ioc/index.js.map +1 -0
  134. package/dist/integration-engine/models/MongoModel.js +6 -6
  135. package/dist/integration-engine/models/MongoModel.js.map +1 -1
  136. package/dist/integration-engine/models/PostgresModel.d.ts +3 -1
  137. package/dist/integration-engine/models/PostgresModel.js +19 -14
  138. package/dist/integration-engine/models/PostgresModel.js.map +1 -1
  139. package/dist/integration-engine/models/RedisModel.js +2 -2
  140. package/dist/integration-engine/models/RedisModel.js.map +1 -1
  141. package/dist/output-gateway/Logger.d.ts +10 -2
  142. package/dist/output-gateway/Logger.js +9 -8
  143. package/dist/output-gateway/Logger.js.map +1 -1
  144. package/dist/output-gateway/config/OutputGatewayConfiguration.d.ts +51 -0
  145. package/dist/output-gateway/config/OutputGatewayConfiguration.js +90 -0
  146. package/dist/output-gateway/config/OutputGatewayConfiguration.js.map +1 -0
  147. package/dist/output-gateway/config/config.d.ts +5 -48
  148. package/dist/output-gateway/config/config.js +5 -69
  149. package/dist/output-gateway/config/config.js.map +1 -1
  150. package/dist/output-gateway/database/MongoDatabase.d.ts +7 -4
  151. package/dist/output-gateway/database/MongoDatabase.js +37 -16
  152. package/dist/output-gateway/database/MongoDatabase.js.map +1 -1
  153. package/dist/output-gateway/database/PostgreDatabase.d.ts +20 -3
  154. package/dist/output-gateway/database/PostgreDatabase.js +40 -17
  155. package/dist/output-gateway/database/PostgreDatabase.js.map +1 -1
  156. package/dist/output-gateway/database/index.d.ts +64 -1
  157. package/dist/output-gateway/database/index.js +17 -1
  158. package/dist/output-gateway/database/index.js.map +1 -1
  159. package/dist/output-gateway/ioc/ContainerToken.d.ts +13 -0
  160. package/dist/output-gateway/ioc/ContainerToken.js +17 -0
  161. package/dist/output-gateway/ioc/ContainerToken.js.map +1 -0
  162. package/dist/output-gateway/ioc/Di.d.ts +2 -0
  163. package/dist/output-gateway/ioc/Di.js +40 -0
  164. package/dist/output-gateway/ioc/Di.js.map +1 -0
  165. package/dist/output-gateway/ioc/index.d.ts +2 -0
  166. package/dist/output-gateway/ioc/index.js +19 -0
  167. package/dist/output-gateway/ioc/index.js.map +1 -0
  168. package/dist/output-gateway/models/GeoJsonModel.d.ts +1 -0
  169. package/dist/output-gateway/models/GeoJsonModel.js +7 -6
  170. package/dist/output-gateway/models/GeoJsonModel.js.map +1 -1
  171. package/dist/output-gateway/models/SequelizeModel.js +2 -2
  172. package/dist/output-gateway/models/SequelizeModel.js.map +1 -1
  173. package/dist/output-gateway/redis/CacheMiddleware.d.ts +9 -5
  174. package/dist/output-gateway/redis/CacheMiddleware.js +36 -17
  175. package/dist/output-gateway/redis/CacheMiddleware.js.map +1 -1
  176. package/dist/output-gateway/redis/RedisConnector.d.ts +6 -3
  177. package/dist/output-gateway/redis/RedisConnector.js +33 -13
  178. package/dist/output-gateway/redis/RedisConnector.js.map +1 -1
  179. package/dist/output-gateway/redis/index.d.ts +15 -1
  180. package/dist/output-gateway/redis/index.js +16 -1
  181. package/dist/output-gateway/redis/index.js.map +1 -1
  182. package/dist/shared/pino.d.ts +2 -0
  183. package/dist/shared/pino.js +29 -0
  184. package/dist/shared/pino.js.map +1 -0
  185. package/dist/shared/tsyringe.d.ts +1 -0
  186. package/dist/shared/tsyringe.js +18 -0
  187. package/dist/shared/tsyringe.js.map +1 -0
  188. package/package.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"PostgreDatabase.js","sourceRoot":"","sources":["../../../src/output-gateway/database/PostgreDatabase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,4CAAoB;AACpB,yCAAsC;AACtC,sCAAoC;AACpC,sCAAiC;AAEjC;;GAEG;AACH,MAAM,gBAAgB;IAIlB;QAIA,qBAAqB;QACd,YAAO,GAAG,CAAC,gBAAyB,EAAE,EAAE;YAC3C,IAAI;gBACA,IAAI,IAAI,CAAC,SAAS,EAAE;oBAChB,OAAO,IAAI,CAAC,SAAS,CAAC;iBACzB;gBACD,IAAI,CAAC,SAAS,GAAG,IAAI,qBAAS,CAAC,gBAAgB,IAAI,IAAI,CAAC,gBAAgB,EAAE;oBACtE,cAAc,EAAE;wBACZ,gBAAgB,EAAE,mBAAmB,YAAE,CAAC,QAAQ,EAAE,GAAG;qBACxD;oBACD,MAAM,EAAE;wBACJ,eAAe,EAAE,IAAI;wBACrB,UAAU,EAAE,KAAK;qBACpB;oBACD,OAAO,EAAE,YAAG,CAAC,KAAK;oBAClB,IAAI,EAAE;wBACF,OAAO,EAAE,KAAK;wBACd,IAAI,EAAE,MAAM,CAAC,eAAM,CAAC,0BAA0B,CAAC,IAAI,KAAK;wBACxD,GAAG,EAAE,MAAM,CAAC,eAAM,CAAC,6BAA6B,CAAC,IAAI,CAAC;wBACtD,GAAG,EAAE,MAAM,CAAC,eAAM,CAAC,6BAA6B,CAAC,IAAI,CAAC;qBACzD;iBACJ,CAAC,CAAC;gBACH,YAAG,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;gB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AAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;aAChC;QACL,CAAC,CAAA,CAAC;QAEK,YAAO,GAAG,GAAwB,EAAE;YACvC,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QAC5B,CAAC,CAAA,CAAC;QArDE,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,mBAAmB,IAAI,EAAE,CAAC;QACzD,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,0BAA0B,CAAC;QACzD,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,6BAA6B,CAAC;QAC/D,IAAI,CAAC,kBAAkB,GAAG,MAAM,CAAC,6BAA6B,CAAC;IACnE,CAAC;CAkDJ,CAAA;AAjEY,gBAAgB;IAD5B,IAAA,qBAAU,GAAE;IASJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;qCADS,uDAA0B;GAR5D,gBAAgB,CAiE5B;AAjEY,4CAAgB"}
@@ -1,2 +1,65 @@
1
- export * from "./MongoDatabase";
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose" />
25
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/aggregate" />
26
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/callback" />
27
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/collection" />
28
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/connection" />
29
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/cursor" />
30
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/document" />
31
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/error" />
32
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/expressions" />
33
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/helpers" />
34
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/middlewares" />
35
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/indexes" />
36
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/models" />
37
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/mongooseoptions" />
38
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/pipelinestage" />
39
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/populate" />
40
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/query" />
41
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/schemaoptions" />
42
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/schematypes" />
43
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/session" />
44
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/types" />
45
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/utility" />
46
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/validation" />
47
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/virtuals" />
48
+ /// <reference types="@golemio/validator/node_modules/mongoose" />
49
+ /// <reference types="mongoose/types/inferschematype" />
50
+ /// <reference types="@golemio/validator/node_modules/mongoose/types/inferschematype" />
51
+ import { Sequelize } from "sequelize";
52
+ /**
53
+ * @deprecated For backwards compatibility. Use ioc container instead.
54
+ */
55
+ declare const mongooseConnection: Promise<import("mongoose").Connection>;
56
+ /**
57
+ * @deprecated For backwards compatibility. Use ioc container instead.
58
+ */
59
+ declare const sequelizeConnection: Sequelize;
60
+ /**
61
+ * @deprecated For backwards compatibility. Use ioc container instead.
62
+ */
63
+ declare const sequelizeReadOnlyConnection: Sequelize;
2
64
  export * from "./PostgreDatabase";
65
+ export { mongooseConnection, sequelizeConnection, sequelizeReadOnlyConnection };
@@ -14,6 +14,22 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./MongoDatabase"), exports);
17
+ exports.sequelizeReadOnlyConnection = exports.sequelizeConnection = exports.mongooseConnection = void 0;
18
+ const ioc_1 = require("../ioc");
19
+ /**
20
+ * @deprecated For backwards compatibility. Use ioc container instead.
21
+ */
22
+ const mongooseConnection = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.MongoDatabase).connect();
23
+ exports.mongooseConnection = mongooseConnection;
24
+ /**
25
+ * @deprecated For backwards compatibility. Use ioc container instead.
26
+ */
27
+ const sequelizeConnection = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.SequelizeConnection);
28
+ exports.sequelizeConnection = sequelizeConnection;
29
+ /**
30
+ * @deprecated For backwards compatibility. Use ioc container instead.
31
+ */
32
+ const sequelizeReadOnlyConnection = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.SequelizeReadOnlyConnection);
33
+ exports.sequelizeReadOnlyConnection = sequelizeReadOnlyConnection;
18
34
  __exportStar(require("./PostgreDatabase"), exports);
19
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/database/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,oDAAkC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/database/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,gCAAiE;AAIjE;;GAEG;AACH,MAAM,kBAAkB,GAAG,4BAAsB,CAAC,OAAO,CAAgB,oBAAc,CAAC,aAAa,CAAC,CAAC,OAAO,EAAE,CAAC;AAWxG,gDAAkB;AAV3B;;GAEG;AACH,MAAM,mBAAmB,GAAG,4BAAsB,CAAC,OAAO,CAAY,oBAAc,CAAC,mBAAmB,CAAC,CAAC;AAO7E,kDAAmB;AANhD;;GAEG;AACH,MAAM,2BAA2B,GAAG,4BAAsB,CAAC,OAAO,CAAY,oBAAc,CAAC,2BAA2B,CAAC,CAAC;AAGxE,kEAA2B;AAD7E,oDAAkC"}
@@ -0,0 +1,13 @@
1
+ declare const ContainerToken: {
2
+ Config: symbol;
3
+ Logger: symbol;
4
+ LoggerEvents: symbol;
5
+ RequestLogger: symbol;
6
+ PostgresDatabase: symbol;
7
+ SequelizeReadOnlyConnection: symbol;
8
+ SequelizeConnection: symbol;
9
+ RedisConnector: symbol;
10
+ CacheMiddleware: symbol;
11
+ MongoDatabase: symbol;
12
+ };
13
+ export { ContainerToken };
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContainerToken = void 0;
4
+ const ContainerToken = {
5
+ Config: Symbol(),
6
+ Logger: Symbol(),
7
+ LoggerEvents: Symbol(),
8
+ RequestLogger: Symbol(),
9
+ PostgresDatabase: Symbol(),
10
+ SequelizeReadOnlyConnection: Symbol(),
11
+ SequelizeConnection: Symbol(),
12
+ RedisConnector: Symbol(),
13
+ CacheMiddleware: Symbol(),
14
+ MongoDatabase: Symbol(),
15
+ };
16
+ exports.ContainerToken = ContainerToken;
17
+ //# sourceMappingURL=ContainerToken.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContainerToken.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/ContainerToken.ts"],"names":[],"mappings":";;;AAAA,MAAM,cAAc,GAAG;IACnB,MAAM,EAAE,MAAM,EAAE;IAChB,MAAM,EAAE,MAAM,EAAE;IAChB,YAAY,EAAE,MAAM,EAAE;IACtB,aAAa,EAAE,MAAM,EAAE;IACvB,gBAAgB,EAAE,MAAM,EAAE;IAC1B,2BAA2B,EAAE,MAAM,EAAE;IACrC,mBAAmB,EAAE,MAAM,EAAE;IAC7B,cAAc,EAAE,MAAM,EAAE;IACxB,eAAe,EAAE,MAAM,EAAE;IACzB,aAAa,EAAE,MAAM,EAAE;CAC1B,CAAC;AAEO,wCAAc"}
@@ -0,0 +1,2 @@
1
+ declare const OutputGatewayContainer: import("tsyringe").DependencyContainer;
2
+ export { OutputGatewayContainer };
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OutputGatewayContainer = void 0;
4
+ const _helpers_1 = require("../../helpers");
5
+ const Di_1 = require("../../helpers/ioc/Di");
6
+ const OutputGatewayConfiguration_1 = require("../config/OutputGatewayConfiguration");
7
+ const MongoDatabase_1 = require("../database/MongoDatabase");
8
+ const PostgreDatabase_1 = require("../database/PostgreDatabase");
9
+ const CacheMiddleware_1 = require("../redis/CacheMiddleware");
10
+ const RedisConnector_1 = require("../redis/RedisConnector");
11
+ const tsyringe_1 = require("tsyringe");
12
+ const ContainerToken_1 = require("./ContainerToken");
13
+ //#region Initialization
14
+ const singletonOptions = { lifecycle: tsyringe_1.Lifecycle.Singleton };
15
+ const OutputGatewayContainer = Di_1.GlobalContainer.createChildContainer();
16
+ exports.OutputGatewayContainer = OutputGatewayContainer;
17
+ //#endregion
18
+ //#region General
19
+ OutputGatewayContainer.registerSingleton(ContainerToken_1.ContainerToken.Config, OutputGatewayConfiguration_1.OutputGatewayConfiguration);
20
+ const config = OutputGatewayContainer.resolve(ContainerToken_1.ContainerToken.Config);
21
+ OutputGatewayContainer.register(ContainerToken_1.ContainerToken.Logger, {
22
+ useFactory: (0, tsyringe_1.instanceCachingFactory)(() => (0, _helpers_1.createLogger)({
23
+ projectName: "output-gateway",
24
+ nodeEnv: config.node_env,
25
+ logLevel: config.log_level,
26
+ })),
27
+ }).registerInstance(ContainerToken_1.ContainerToken.RequestLogger, (0, _helpers_1.createRequestLogger)(config.node_env, OutputGatewayContainer.resolve(ContainerToken_1.ContainerToken.Logger)));
28
+ //#endregion
29
+ //#region Data Access
30
+ OutputGatewayContainer.register(ContainerToken_1.ContainerToken.PostgresDatabase, { useClass: PostgreDatabase_1.PostgresDatabase }, { lifecycle: tsyringe_1.Lifecycle.Transient })
31
+ .register(ContainerToken_1.ContainerToken.SequelizeReadOnlyConnection, {
32
+ useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => c.resolve(ContainerToken_1.ContainerToken.PostgresDatabase).connect(config.postgres_read_only_connection || "")),
33
+ })
34
+ .register(ContainerToken_1.ContainerToken.SequelizeConnection, {
35
+ useFactory: (0, tsyringe_1.instanceCachingFactory)((c) => c.resolve(ContainerToken_1.ContainerToken.PostgresDatabase).connect(config.postgres_connection || "")),
36
+ })
37
+ .registerSingleton(ContainerToken_1.ContainerToken.MongoDatabase, MongoDatabase_1.MongoDatabase)
38
+ .registerSingleton(ContainerToken_1.ContainerToken.RedisConnector, RedisConnector_1.RedisConnector)
39
+ .registerSingleton(ContainerToken_1.ContainerToken.CacheMiddleware, CacheMiddleware_1.CacheMiddleware);
40
+ //# sourceMappingURL=Di.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Di.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/Di.ts"],"names":[],"mappings":";;;AAAA,4CAAsE;AACtE,6CAAkD;AAClD,qFAAmF;AACnF,6DAA2D;AAC3D,iEAAgE;AAChE,8DAA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AI,EAAE,CAAC,CACnH;CACJ,CAAC;KACD,QAAQ,CAAC,+BAAc,CAAC,mBAAmB,EAAE;IAC1C,UAAU,EAAE,IAAA,iCAAsB,EAAC,CAAC,CAAC,EAAE,EAAE,CACrC,CAAC,CAAC,OAAO,CAAmB,+BAAc,CAAC,gBAAgB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,mBAAmB,IAAI,EAAE,CAAC,CACzG;CACJ,CAAC;KACD,iBAAiB,CAAC,+BAAc,CAAC,aAAa,EAAE,6BAAa,CAAC;KAC9D,iBAAiB,CAAC,+BAAc,CAAC,cAAc,EAAE,+BAAc,CAAC;KAChE,iBAAiB,CAAC,+BAAc,CAAC,eAAe,EAAE,iCAAe,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from "./ContainerToken";
2
+ export * from "./Di";
@@ -0,0 +1,19 @@
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("./ContainerToken"), exports);
18
+ __exportStar(require("./Di"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/output-gateway/ioc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,uCAAqB"}
@@ -19,6 +19,7 @@ import { IGeoJsonModel } from "./interfaces/IGeoJsonModel";
19
19
  * Performs database queries.
20
20
  */
21
21
  export declare class GeoJsonModel extends MongoModel implements IGeoJsonModel {
22
+ private log;
22
23
  /**
23
24
  * Creates a model with specified schema definition
24
25
  * @param inName Name of the model - corresponding with mongo collection name (eg. "parkings" for "Parking" model)
@@ -14,7 +14,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.GeoJsonModel = void 0;
16
16
  const Geo_1 = require("../Geo");
17
- const Logger_1 = require("../Logger");
17
+ const ioc_1 = require("../ioc");
18
18
  const models_1 = require("./");
19
19
  const errors_1 = require("@golemio/errors");
20
20
  const moment_timezone_1 = __importDefault(require("moment-timezone"));
@@ -83,11 +83,12 @@ class GeoJsonModel extends models_1.MongoModel {
83
83
  }
84
84
  return true;
85
85
  };
86
+ this.log = ioc_1.OutputGatewayContainer.resolve(ioc_1.ContainerToken.Logger);
86
87
  // create $geonear index
87
88
  this.schema.index({ geometry: "2dsphere" });
88
89
  if (!this.HasRequiredGeojsonProps(inSchema)) {
89
- Logger_1.log.warn("Creating " + inName + " GeoJSON model: imported schema not in GeoJSON format!");
90
- Logger_1.log.debug(inSchema);
90
+ this.log.warn("Creating " + inName + " GeoJSON model: imported schema not in GeoJSON format!");
91
+ this.log.debug(inSchema);
91
92
  }
92
93
  }
93
94
  /** Retrieves all the records from database
@@ -152,8 +153,8 @@ class GeoJsonModel extends models_1.MongoModel {
152
153
  q.skip(options.offset);
153
154
  }
154
155
  q.select(this.projection);
155
- Logger_1.log.silly("Executing query with selection: ");
156
- Logger_1.log.silly(this.selection);
156
+ this.log.silly("Executing query with selection: ");
157
+ this.log.silly(this.selection);
157
158
  this.selection = {};
158
159
  const data = yield q.exec();
159
160
  // Create GeoJSON FeatureCollection output
@@ -174,7 +175,7 @@ class GeoJsonModel extends models_1.MongoModel {
174
175
  return __awaiter(this, void 0, void 0, function* () {
175
176
  const found = yield this.model.findOne(this.PrimaryIdentifierSelection(inId), "-_id -__v").lean().exec();
176
177
  if (!found || (found instanceof Array && found.length === 0)) {
177
- Logger_1.log.debug("Could not find any record by specified selection.", this.PrimaryIdentifierSelection(inId));
178
+ this.log.debug("Could not find any record by specified selection.", this.PrimaryIdentifierSelection(inId));
178
179
  throw new errors_1.CustomError("Id `" + inId + "` not found", true, "GeoJsonModel", 404);
179
180
  }
180
181
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"GeoJsonModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/GeoJsonModel.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gCAAwH;AACxH,sCAAiC;AACjC,+BAAwC;AAGxC,4CAA8C;AAC9C,sEAAqC;AAIrC;;;;;;;;;;;;;GAaG;AACH,MAAa,YAAa,SAAQ,mBAAU;IACxC;;;;;;OAMG;IACH,YAAmB,MAAc,EAAE,QAA0B,EAAE,gBAAyB;QACpF,KAAK,CAAC,MAAM,EAAE,QAAQ,EAAE,gBAAgB,CAAC,CAAC;QA2G9C;;;WAGG;QACI,kBAAa,GAAG,GAA4C,EAAE;YACjE,MAAM,MAAM,GAAU,MAAM,IAAI,CAAC,KAAK;iBACjC,SAAS,CAAC;gBACP,EAAE,OAAO,EAAE,wBAAwB,EAAE;gBACrC,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,2BAA2B,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,wBAAwB,EAAE,EAAE,EAAE;gBACjG,EAAE,QAAQ,EAAE,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE;aAC3D,CAAC;iBACD,IAAI,EAAE,CAAC;YACZ,OAAO,MAAM;iBACR,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC;iBACxB,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAA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strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SequelizeModel = void 0;
4
- const PostgreDatabase_1 = require("../database/PostgreDatabase");
4
+ const database_1 = require("../database");
5
5
  const models_1 = require("./");
6
6
  /**
7
7
  * General model for data stored in PostgreSQL.
@@ -19,7 +19,7 @@ class SequelizeModel extends models_1.BaseModel {
19
19
  return;
20
20
  };
21
21
  // @ts-ignore
22
- this.sequelizeModel = PostgreDatabase_1.sequelizeConnection.define(tableName, attributes, Object.assign({
22
+ this.sequelizeModel = database_1.sequelizeConnection.define(tableName, attributes, Object.assign({
23
23
  // Remove all audit fields in the default scope: they will be automatically excluded,
24
24
  // as they're not needed in the output view, but are present in the table/data
25
25
  defaultScope: {
@@ -1 +1 @@
1
- {"version":3,"file":"SequelizeModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/SequelizeModel.ts"],"names":[],"mappings":";;;AACA,iEAAmE;AACnE,+BAAuC;AAEvC;;;;;GAKG;AACH,MAAsB,cAAe,SAAQ,kBAAS;IAOlD,YAAsB,IAAY,EAAE,SAAiB,EAAE,UAAgC,EAAE,OAA2B;QAChH,KAAK,CAAC,IAAI,CAAC,CAAC;QAchB;;WAEG;QACI,cAAS,GAAG,CAAC,MAAW,EAAQ,EAAE;YACrC,OAAO;QACX,CAAC,CAAC;QAlBE,aAAa;QACb,IAAI,CAAC,cAAc,GAAG,qCAAmB,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU;YAClE,qFAAqF;YACrF,8EAA8E;YAC9E,YAAY,EAAE;gBACV,UAAU,EAAE;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;iBAC1G;aACJ,IACE,OAAO,EACZ,CAAC;IACP,CAAC;CAQJ;AA5BD,wCA4BC"}
1
+ {"version":3,"file":"SequelizeModel.js","sourceRoot":"","sources":["../../../src/output-gateway/models/SequelizeModel.ts"],"names":[],"mappings":";;;AACA,0CAAoD;AACpD,+BAAuC;AAEvC;;;;;GAKG;AACH,MAAsB,cAAe,SAAQ,kBAAS;IAOlD,YAAsB,IAAY,EAAE,SAAiB,EAAE,UAAgC,EAAE,OAA2B;QAChH,KAAK,CAAC,IAAI,CAAC,CAAC;QAchB;;WAEG;QACI,cAAS,GAAG,CAAC,MAAW,EAAQ,EAAE;YACrC,OAAO;QACX,CAAC,CAAC;QAlBE,aAAa;QACb,IAAI,CAAC,cAAc,GAAG,8BAAmB,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU;YAClE,qFAAqF;YACrF,8EAA8E;YAC9E,YAAY,EAAE;gBACV,UAAU,EAAE;oBACR,OAAO,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,CAAC;iBAC1G;aACJ,IACE,OAAO,EACZ,CAAC;IACP,CAAC;CAQJ;AA5BD,wCA4BC"}
@@ -1,15 +1,19 @@
1
1
  /// <reference types="qs" />
2
+ import { ILogger } from "../../helpers";
3
+ import { OutputGatewayConfiguration } from "../config/OutputGatewayConfiguration";
2
4
  import { NextFunction, Request, Response } from "express";
3
- declare class MyCacheMiddleware {
5
+ import { RedisConnector } from "./RedisConnector";
6
+ export declare class CacheMiddleware {
7
+ private log;
8
+ private redisConnector;
9
+ private redisEnabled;
4
10
  private defaultCacheTtl;
5
- private redisClient?;
6
11
  private cacheWithRedisMiddleware;
12
+ private redisClient?;
13
+ constructor(config: OutputGatewayConfiguration, log: ILogger, redisConnector: RedisConnector);
7
14
  init(): void;
8
15
  getDefaultCacheTtl(): number;
9
16
  isNoCacheHeader: (req: Request, res: Response) => boolean;
10
17
  getMiddleware(expire?: number | string): (req: Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: Response<any, Record<string, any>>, next: NextFunction) => void;
11
18
  private middleware;
12
19
  }
13
- declare const CacheMiddleware: MyCacheMiddleware;
14
- declare const useCacheMiddleware: (expire?: number | string) => (req: Request, res: Response, next: NextFunction) => void;
15
- export { CacheMiddleware, useCacheMiddleware };
@@ -1,20 +1,30 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
2
14
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
15
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
16
  };
5
17
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.useCacheMiddleware = exports.CacheMiddleware = void 0;
18
+ exports.CacheMiddleware = void 0;
19
+ const ioc_1 = require("../ioc");
20
+ const OutputGatewayConfiguration_1 = require("../config/OutputGatewayConfiguration");
7
21
  const apicache_plus_1 = __importDefault(require("apicache-plus"));
8
- const config_1 = require("../config");
9
- const Logger_1 = require("../Logger");
22
+ const tsyringe_1 = require("tsyringe");
10
23
  const RedisConnector_1 = require("./RedisConnector");
11
- class MyCacheMiddleware {
12
- constructor() {
13
- this.defaultCacheTtl = parseInt(config_1.config.redis_ttl || "60000", 10);
14
- // as default is used memory-cache
15
- this.cacheWithRedisMiddleware = apicache_plus_1.default.options({
16
- defaultDuration: this.defaultCacheTtl.toString(),
17
- }).middleware;
24
+ let CacheMiddleware = class CacheMiddleware {
25
+ constructor(config, log, redisConnector) {
26
+ this.log = log;
27
+ this.redisConnector = redisConnector;
18
28
  this.isNoCacheHeader = (req, res) => {
19
29
  const cacheHeader = req.headers["cache-control"];
20
30
  return cacheHeader === "no-cache";
@@ -30,10 +40,15 @@ class MyCacheMiddleware {
30
40
  }
31
41
  };
32
42
  };
43
+ this.redisEnabled = config.redis_enable;
44
+ this.defaultCacheTtl = parseInt(config.redis_ttl || "60000", 10);
45
+ this.cacheWithRedisMiddleware = apicache_plus_1.default.options({
46
+ defaultDuration: this.defaultCacheTtl.toString(),
47
+ }).middleware;
33
48
  }
34
49
  init() {
35
- if (config_1.config.redis_enable) {
36
- this.redisClient = RedisConnector_1.RedisConnector.getConnection(RedisConnector_1.ConnectionType.APICACHE);
50
+ if (this.redisEnabled) {
51
+ this.redisClient = this.redisConnector.getConnection(RedisConnector_1.ConnectionType.APICACHE);
37
52
  // sets redis to apicache
38
53
  this.cacheWithRedisMiddleware = apicache_plus_1.default.options({
39
54
  defaultDuration: this.defaultCacheTtl.toString(),
@@ -41,7 +56,7 @@ class MyCacheMiddleware {
41
56
  }).middleware;
42
57
  }
43
58
  else {
44
- Logger_1.log.warn("[apicache] Redis is not enabled. Memory memory-cache used.");
59
+ this.log.warn("[apicache] Redis is not enabled. Memory memory-cache used.");
45
60
  }
46
61
  }
47
62
  getDefaultCacheTtl() {
@@ -50,9 +65,13 @@ class MyCacheMiddleware {
50
65
  getMiddleware(expire) {
51
66
  return this.middleware(expire);
52
67
  }
53
- }
54
- const CacheMiddleware = new MyCacheMiddleware();
68
+ };
69
+ CacheMiddleware = __decorate([
70
+ (0, tsyringe_1.injectable)(),
71
+ __param(0, (0, tsyringe_1.inject)(ioc_1.ContainerToken.Config)),
72
+ __param(1, (0, tsyringe_1.inject)(ioc_1.ContainerToken.Logger)),
73
+ __param(2, (0, tsyringe_1.inject)(ioc_1.ContainerToken.RedisConnector)),
74
+ __metadata("design:paramtypes", [OutputGatewayConfiguration_1.OutputGatewayConfiguration, Object, RedisConnector_1.RedisConnector])
75
+ ], CacheMiddleware);
55
76
  exports.CacheMiddleware = CacheMiddleware;
56
- const useCacheMiddleware = (expire) => CacheMiddleware.getMiddleware(expire);
57
- exports.useCacheMiddleware = useCacheMiddleware;
58
77
  //# sourceMappingURL=CacheMiddleware.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CacheMiddleware.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/CacheMiddleware.ts"],"names":[],"mappings":";;;;;;AAAA,kEAAqC;AAGrC,sCAAoC;AACpC,sCAAiC;AACjC,qDAAkE;AAElE,MAAM,iBAAiB;IAAvB;QACY,oBAAe,GAAW,QAAQ,CAAC,eAAM,CAAC,SAAS,IAAI,OAAO,EAAE,EAAE,CAAC,CAAC;QAI5E,kCAAkC;QAC1B,6BAAwB,GAAG,uBAAQ,CAAC,OAAO,CAAC;YAChD,eAAe,EAAE,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE;SACnD,CAAC,CAAC,UAAU,CAAC;QAoBP,oBAAe,GAAG,CAAC,GAAY,EAAE,GAAa,EAAW,EAAE;YAC9D,MAAM,WAAW,GAAuB,GAAG,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;YACrE,OAAO,WAAW,KAAK,UAAU,CAAC;QACtC,CAAC,CAAC;QAMM,eAAU,GAAG,CAAC,MAAwB,EAAE,EAAE;YAC9C,OAAO,CAAC,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;gBACvD,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE;oBACjC,MAAM,UAAU,GAAG,IAAI,CAAC,wBAAwB,CAAC,MAAM,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC;oBACjF,UAAU,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,CAAC;iBAC9B;qBAAM;oBACH,IAAI,EAAE,CAAC;iBACV;YACL,CAAC,CAAC;QACN,CAAC,CAAC;IACN,CAAC;IArCU,IAAI;QACP,IAAI,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,CAAC;IAOM,aAAa,CAAC,MAAwB;QACzC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;CAYJ,CAAA;AAzDY,eAAe;IAD3B,IAAA,qBAAU,GAAE;IAUJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,cAAc,CAAC,CAAA;qCAFC,uDAA0B,UAEF,+BAAc;GAXxE,eAAe,CAyD3B;AAzDY,0CAAe"}
@@ -1,10 +1,15 @@
1
+ import { ILogger } from "../../helpers";
2
+ import { OutputGatewayConfiguration } from "../config/OutputGatewayConfiguration";
1
3
  import { RedisClient } from "redis";
2
4
  export declare enum ConnectionType {
3
5
  DEFAULT = "DEFAULT",
4
6
  APICACHE = "APICACHE"
5
7
  }
6
- declare class MyRedis {
8
+ export declare class RedisConnector {
9
+ private log;
10
+ private redisConnectionString;
7
11
  private connections;
12
+ constructor(config: OutputGatewayConfiguration, log: ILogger);
8
13
  connect: () => Promise<RedisClient>;
9
14
  getConnection(connectionType?: ConnectionType): RedisClient;
10
15
  isConnected(connectionType?: ConnectionType): boolean;
@@ -12,5 +17,3 @@ declare class MyRedis {
12
17
  private createConnection;
13
18
  private checkOnConnect;
14
19
  }
15
- declare const RedisConnector: MyRedis;
16
- export { RedisConnector };
@@ -1,4 +1,16 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
2
14
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
15
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
16
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -13,11 +25,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
25
  };
14
26
  Object.defineProperty(exports, "__esModule", { value: true });
15
27
  exports.RedisConnector = exports.ConnectionType = void 0;
28
+ const OutputGatewayConfiguration_1 = require("../config/OutputGatewayConfiguration");
29
+ const ioc_1 = require("../ioc");
16
30
  const errors_1 = require("@golemio/errors");
17
- const promises_1 = require("timers/promises");
18
31
  const redis_1 = __importDefault(require("redis"));
19
- const config_1 = require("../config");
20
- const Logger_1 = require("../Logger");
32
+ const promises_1 = require("timers/promises");
33
+ const tsyringe_1 = require("tsyringe");
21
34
  var ConnectionType;
22
35
  (function (ConnectionType) {
23
36
  ConnectionType["DEFAULT"] = "DEFAULT";
@@ -27,8 +40,9 @@ const connectionOptions = {
27
40
  [ConnectionType.DEFAULT]: {},
28
41
  [ConnectionType.APICACHE]: { detect_buffers: true },
29
42
  };
30
- class MyRedis {
31
- constructor() {
43
+ let RedisConnector = class RedisConnector {
44
+ constructor(config, log) {
45
+ this.log = log;
32
46
  this.connections = new Map();
33
47
  this.connect = () => __awaiter(this, void 0, void 0, function* () {
34
48
  if (this.connections.has(ConnectionType.DEFAULT)) {
@@ -41,14 +55,14 @@ class MyRedis {
41
55
  });
42
56
  this.createConnection = (connectionType) => __awaiter(this, void 0, void 0, function* () {
43
57
  try {
44
- if (!config_1.config.redis_connection) {
58
+ if (!this.redisConnectionString) {
45
59
  throw new errors_1.CustomError("The ENV variable REDIS_CONN cannot be undefined.", true, this.constructor.name);
46
60
  }
47
61
  const connection = redis_1.default
48
- .createClient(config_1.config.redis_connection, connectionOptions[connectionType])
49
- .on("message", (message) => Logger_1.log.info(message))
50
- .on("error", (error) => Logger_1.log.warn(error))
51
- .on("connect", () => Logger_1.log.info("Connected to Redis!"));
62
+ .createClient(this.redisConnectionString, connectionOptions[connectionType])
63
+ .on("message", (message) => this.log.info(message))
64
+ .on("error", (error) => this.log.warn(error))
65
+ .on("connect", () => this.log.info("Connected to Redis!"));
52
66
  this.connections.set(connectionType, connection);
53
67
  // waiting for the redis client to connect
54
68
  const delay = 500; // millis
@@ -70,6 +84,7 @@ class MyRedis {
70
84
  }
71
85
  throw new Error(`Failed to connect to Redis after ${attemps * delay} millis.`);
72
86
  });
87
+ this.redisConnectionString = config.redis_connection;
73
88
  }
74
89
  getConnection(connectionType = ConnectionType.DEFAULT) {
75
90
  const connection = this.connections.get(connectionType);
@@ -84,7 +99,7 @@ class MyRedis {
84
99
  }
85
100
  disconnect() {
86
101
  return __awaiter(this, void 0, void 0, function* () {
87
- Logger_1.log.info("Redis disconnect called");
102
+ this.log.info("Redis disconnect called");
88
103
  for (const connection of this.connections.values()) {
89
104
  yield new Promise((resolve, reject) => {
90
105
  connection.quit((err) => {
@@ -96,7 +111,12 @@ class MyRedis {
96
111
  }
97
112
  });
98
113
  }
99
- }
100
- const RedisConnector = new MyRedis();
114
+ };
115
+ RedisConnector = __decorate([
116
+ (0, tsyringe_1.injectable)(),
117
+ __param(0, (0, tsyringe_1.inject)(ioc_1.ContainerToken.Config)),
118
+ __param(1, (0, tsyringe_1.inject)(ioc_1.ContainerToken.Logger)),
119
+ __metadata("design:paramtypes", [OutputGatewayConfiguration_1.OutputGatewayConfiguration, Object])
120
+ ], RedisConnector);
101
121
  exports.RedisConnector = RedisConnector;
102
122
  //# sourceMappingURL=RedisConnector.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"R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aAAa,CAAC,iBAAiC,cAAc,CAAC,OAAO;QACxE,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,EAAE;YACb,MAAM,IAAI,oBAAW,CACjB,gEAAgE,EAChE,KAAK,EACL,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,IAAI,CACP,CAAC;SACL;QACD,OAAO,UAAU,CAAC;IACtB,CAAC;IAEM,WAAW,CAAC,iBAAiC,cAAc,CAAC,OAAO;QACtE,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACxD,OAAO,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,SAAS,CAAC;IAChD,CAAC;IAEY,UAAU;;YACnB,YAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;YAEpC,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE;gBAChD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBACxC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;wBACpB,IAAI,GAAG;4BAAE,MAAM,CAAC,GAAG,CAAC,CAAC;wBACrB,OAAO,EAAE,CAAC;oBACd,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;aACN;QACL,CAAC;KAAA;CAuCJ;AAED,MAAM,cAAc,GAAG,IAAI,OAAO,EAAE,CAAC;AAE5B,wCAAc"}
1
+ {"version":3,"file":"RedisConnector.js","sourceRoot":"","sources":["../../../src/output-gateway/redis/RedisConnector.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qFAAmF;AACnF,gCAAyC;AACzC,4CAA8C;AAC9C,kDAAuD;AACvD,8CAAsD;AACtD,uCAA8C;AAE9C,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,qCAAmB,CA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OAAO;QACxE,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACxD,IAAI,CAAC,UAAU,EAAE;YACb,MAAM,IAAI,oBAAW,CACjB,gEAAgE,EAChE,KAAK,EACL,IAAI,CAAC,WAAW,CAAC,IAAI,EACrB,IAAI,CACP,CAAC;SACL;QACD,OAAO,UAAU,CAAC;IACtB,CAAC;IAEM,WAAW,CAAC,iBAAiC,cAAc,CAAC,OAAO;QACtE,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACxD,OAAO,CAAC,CAAC,UAAU,IAAI,UAAU,CAAC,SAAS,CAAC;IAChD,CAAC;IAEY,UAAU;;YACnB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;YAEzC,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE;gBAChD,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBACxC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;wBACpB,IAAI,GAAG;4BAAE,MAAM,CAAC,GAAG,CAAC,CAAC;wBACrB,OAAO,EAAE,CAAC;oBACd,CAAC,CAAC,CAAC;gBACP,CAAC,CAAC,CAAC;aACN;QACL,CAAC;KAAA;CAuCJ,CAAA;AA3FY,cAAc;IAD1B,IAAA,qBAAU,GAAE;IAMJ,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;IAC7B,WAAA,IAAA,iBAAM,EAAC,oBAAc,CAAC,MAAM,CAAC,CAAA;qCADS,uDAA0B;GAL5D,cAAc,CA2F1B;AA3FY,wCAAc"}
@@ -1,2 +1,16 @@
1
+ /// <reference types="qs" />
2
+ /// <reference types="express" />
3
+ import { CacheMiddleware } from "./CacheMiddleware";
4
+ import { ConnectionType, RedisConnector } from "./RedisConnector";
5
+ /**
6
+ * @deprecated For backwards compatibility. Use ioc container instead.
7
+ */
8
+ declare const redisConnector: RedisConnector;
9
+ /**
10
+ * @deprecated For backwards compatibility. Use ioc container instead.
11
+ */
12
+ declare const cacheMiddleware: CacheMiddleware;
13
+ declare const useCacheMiddleware: (expire?: number | string) => (req: import("express").Request<import("express-serve-static-core").ParamsDictionary, any, any, import("qs").ParsedQs, Record<string, any>>, res: import("express").Response<any, Record<string, any>>, next: import("express").NextFunction) => void;
1
14
  export * from "./CacheMiddleware";
2
- export * from "./RedisConnector";
15
+ export { cacheMiddleware as CacheMiddleware, useCacheMiddleware };
16
+ export { redisConnector as RedisConnector, ConnectionType };