@fintekkers/ledger-models 0.1.118 → 0.1.128

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 (260) hide show
  1. package/.npmrc.example +4 -0
  2. package/catalog/fields.json +275 -0
  3. package/catalog/measures.json +259 -0
  4. package/node/fintekkers/models/portfolio/portfolio_pb.js +13 -19
  5. package/node/fintekkers/models/position/field_pb.js +1 -7
  6. package/node/fintekkers/models/position/measure_pb.d.ts +18 -0
  7. package/node/fintekkers/models/position/measure_pb.js +20 -8
  8. package/node/fintekkers/models/position/position_filter_pb.js +7 -13
  9. package/node/fintekkers/models/position/position_pb.d.ts +7 -0
  10. package/node/fintekkers/models/position/position_pb.js +64 -17
  11. package/node/fintekkers/models/position/position_status_pb.js +1 -7
  12. package/node/fintekkers/models/position/position_util_pb.js +11 -17
  13. package/node/fintekkers/models/price/price_pb.d.ts +4 -0
  14. package/node/fintekkers/models/price/price_pb.js +45 -19
  15. package/node/fintekkers/models/price/price_type_grpc_pb.js +1 -0
  16. package/node/fintekkers/models/price/price_type_pb.d.ts +15 -0
  17. package/node/fintekkers/models/price/price_type_pb.js +30 -0
  18. package/node/fintekkers/models/security/bond/auction_type_pb.js +1 -7
  19. package/node/fintekkers/models/security/bond/issuance_pb.js +17 -23
  20. package/node/fintekkers/models/security/coupon_frequency_pb.js +1 -7
  21. package/node/fintekkers/models/security/coupon_type_pb.js +1 -7
  22. package/node/fintekkers/models/security/identifier/identifier_pb.js +9 -15
  23. package/node/fintekkers/models/security/identifier/identifier_type_pb.d.ts +1 -0
  24. package/node/fintekkers/models/security/identifier/identifier_type_pb.js +2 -7
  25. package/node/fintekkers/models/security/index/index_type_grpc_pb.js +1 -0
  26. package/node/fintekkers/models/security/index/index_type_pb.d.ts +22 -0
  27. package/node/fintekkers/models/security/index/index_type_pb.js +37 -0
  28. package/node/fintekkers/models/security/index_composition_pb.d.ts +126 -0
  29. package/node/fintekkers/models/security/index_composition_pb.js +992 -0
  30. package/node/fintekkers/models/security/security_pb.d.ts +382 -0
  31. package/node/fintekkers/models/security/security_pb.js +3183 -57
  32. package/node/fintekkers/models/security/security_quantity_type_pb.js +1 -7
  33. package/node/fintekkers/models/security/security_type_pb.d.ts +3 -0
  34. package/node/fintekkers/models/security/security_type_pb.js +5 -8
  35. package/node/fintekkers/models/security/tenor_pb.js +9 -15
  36. package/node/fintekkers/models/security/tenor_type_pb.js +1 -7
  37. package/node/fintekkers/models/strategy/strategy_allocation_pb.js +13 -19
  38. package/node/fintekkers/models/strategy/strategy_pb.js +14 -20
  39. package/node/fintekkers/models/transaction/transaction_pb.js +24 -30
  40. package/node/fintekkers/models/transaction/transaction_type_pb.js +1 -7
  41. package/node/fintekkers/models/util/api/api_key_pb.js +10 -16
  42. package/node/fintekkers/models/util/currency_pb.d.ts +27 -0
  43. package/node/fintekkers/models/util/currency_pb.js +170 -0
  44. package/node/fintekkers/models/util/date_range_pb.js +8 -14
  45. package/node/fintekkers/models/util/decimal_value_pb.js +4 -10
  46. package/node/fintekkers/models/util/endpoint_pb.js +7 -13
  47. package/node/fintekkers/models/util/local_date_pb.js +5 -11
  48. package/node/fintekkers/models/util/local_timestamp_pb.js +5 -11
  49. package/node/fintekkers/models/util/lock/node_partition_pb.js +9 -15
  50. package/node/fintekkers/models/util/lock/node_state_pb.js +10 -16
  51. package/node/fintekkers/models/util/uuid_pb.js +3 -9
  52. package/node/fintekkers/models/valuation/cashflow_pb.d.ts +57 -0
  53. package/node/fintekkers/models/valuation/cashflow_pb.js +401 -0
  54. package/node/fintekkers/requests/index_composition/create_index_composition_request_pb.d.ts +79 -0
  55. package/node/fintekkers/requests/index_composition/create_index_composition_request_pb.js +599 -0
  56. package/node/fintekkers/requests/index_composition/get_index_composition_request_pb.d.ts +84 -0
  57. package/node/fintekkers/requests/index_composition/get_index_composition_request_pb.js +624 -0
  58. package/node/fintekkers/requests/portfolio/create_portfolio_request_pb.js +7 -13
  59. package/node/fintekkers/requests/portfolio/create_portfolio_response_pb.js +8 -14
  60. package/node/fintekkers/requests/portfolio/query_portfolio_request_pb.d.ts +3 -0
  61. package/node/fintekkers/requests/portfolio/query_portfolio_request_pb.js +39 -15
  62. package/node/fintekkers/requests/portfolio/query_portfolio_response_pb.js +8 -14
  63. package/node/fintekkers/requests/position/query_position_request_pb.js +15 -27
  64. package/node/fintekkers/requests/position/query_position_response_pb.js +10 -16
  65. package/node/fintekkers/requests/price/create_price_request_pb.js +7 -13
  66. package/node/fintekkers/requests/price/create_price_response_pb.js +8 -14
  67. package/node/fintekkers/requests/price/query_price_request_pb.js +12 -18
  68. package/node/fintekkers/requests/price/query_price_response_pb.js +8 -14
  69. package/node/fintekkers/requests/security/create_security_request_pb.js +7 -13
  70. package/node/fintekkers/requests/security/create_security_response_pb.js +9 -15
  71. package/node/fintekkers/requests/security/get_field_values_request_pb.js +7 -13
  72. package/node/fintekkers/requests/security/get_field_values_response_pb.js +7 -13
  73. package/node/fintekkers/requests/security/get_fields_response_pb.js +8 -17
  74. package/node/fintekkers/requests/security/query_security_request_pb.d.ts +3 -0
  75. package/node/fintekkers/requests/security/query_security_request_pb.js +39 -15
  76. package/node/fintekkers/requests/security/query_security_response_pb.js +9 -15
  77. package/node/fintekkers/requests/transaction/create_transaction_request_pb.js +7 -13
  78. package/node/fintekkers/requests/transaction/create_transaction_response_pb.js +8 -14
  79. package/node/fintekkers/requests/transaction/query_transaction_request_pb.js +10 -16
  80. package/node/fintekkers/requests/transaction/query_transaction_response_pb.js +9 -15
  81. package/node/fintekkers/requests/util/delete_request_pb.d.ts +135 -0
  82. package/node/fintekkers/requests/util/delete_request_pb.js +1051 -0
  83. package/node/fintekkers/requests/util/errors/error_pb.js +7 -13
  84. package/node/fintekkers/requests/util/errors/message_pb.js +6 -12
  85. package/node/fintekkers/requests/util/errors/summary_pb.js +4 -10
  86. package/node/fintekkers/requests/util/lock/lock_request_pb.js +8 -14
  87. package/node/fintekkers/requests/util/lock/lock_response_pb.js +9 -15
  88. package/node/fintekkers/requests/util/operation_pb.js +1 -7
  89. package/node/fintekkers/requests/valuation/curve_request_pb.d.ts +85 -0
  90. package/node/fintekkers/requests/valuation/curve_request_pb.js +646 -0
  91. package/node/fintekkers/requests/valuation/curve_response_pb.d.ts +105 -0
  92. package/node/fintekkers/requests/valuation/curve_response_pb.js +806 -0
  93. package/node/fintekkers/requests/valuation/product_inputs.test.ts +172 -0
  94. package/node/fintekkers/requests/valuation/product_inputs_pb.d.ts +137 -0
  95. package/node/fintekkers/requests/valuation/product_inputs_pb.js +987 -0
  96. package/node/fintekkers/requests/valuation/valuation_request_pb.d.ts +19 -0
  97. package/node/fintekkers/requests/valuation/valuation_request_pb.js +168 -22
  98. package/node/fintekkers/requests/valuation/valuation_response_pb.d.ts +13 -0
  99. package/node/fintekkers/requests/valuation/valuation_response_pb.js +118 -16
  100. package/node/fintekkers/services/index-composition-service/index_composition_service_grpc_pb.d.ts +60 -0
  101. package/node/fintekkers/services/index-composition-service/index_composition_service_grpc_pb.js +87 -0
  102. package/node/fintekkers/services/index-composition-service/index_composition_service_pb.d.ts +9 -0
  103. package/node/fintekkers/services/index-composition-service/index_composition_service_pb.js +21 -0
  104. package/node/fintekkers/services/lock-service/lock_service_grpc_pb.js +22 -22
  105. package/node/fintekkers/services/lock-service/lock_service_pb.js +15 -21
  106. package/node/fintekkers/services/portfolio-service/portfolio_service_grpc_pb.d.ts +18 -0
  107. package/node/fintekkers/services/portfolio-service/portfolio_service_grpc_pb.js +39 -5
  108. package/node/fintekkers/services/portfolio-service/portfolio_service_pb.d.ts +1 -0
  109. package/node/fintekkers/services/portfolio-service/portfolio_service_pb.js +3 -7
  110. package/node/fintekkers/services/position-service/position_service_grpc_pb.d.ts +37 -0
  111. package/node/fintekkers/services/position-service/position_service_grpc_pb.js +64 -6
  112. package/node/fintekkers/services/position-service/position_service_pb.d.ts +3 -0
  113. package/node/fintekkers/services/position-service/position_service_pb.js +7 -7
  114. package/node/fintekkers/services/price-service/price_service_grpc_pb.js +5 -5
  115. package/node/fintekkers/services/price-service/price_service_pb.js +1 -7
  116. package/node/fintekkers/services/security-service/security_service_grpc_pb.d.ts +18 -0
  117. package/node/fintekkers/services/security-service/security_service_grpc_pb.js +43 -9
  118. package/node/fintekkers/services/security-service/security_service_pb.d.ts +1 -0
  119. package/node/fintekkers/services/security-service/security_service_pb.js +3 -7
  120. package/node/fintekkers/services/transaction-service/transaction_service_grpc_pb.d.ts +55 -0
  121. package/node/fintekkers/services/transaction-service/transaction_service_grpc_pb.js +97 -5
  122. package/node/fintekkers/services/transaction-service/transaction_service_pb.d.ts +4 -0
  123. package/node/fintekkers/services/transaction-service/transaction_service_pb.js +9 -7
  124. package/node/fintekkers/services/valuation-service/valuation_service_grpc_pb.d.ts +19 -0
  125. package/node/fintekkers/services/valuation-service/valuation_service_grpc_pb.js +37 -2
  126. package/node/fintekkers/services/valuation-service/valuation_service_pb.d.ts +2 -0
  127. package/node/fintekkers/services/valuation-service/valuation_service_pb.js +5 -7
  128. package/node/wrappers/models/portfolio/portfolio.js.map +1 -1
  129. package/node/wrappers/models/portfolio/portfolio.test.d.ts +2 -0
  130. package/node/wrappers/models/portfolio/portfolio.test.js +29 -0
  131. package/node/wrappers/models/portfolio/portfolio.test.js.map +1 -0
  132. package/node/wrappers/models/portfolio/portfolio.test.ts +28 -0
  133. package/node/wrappers/models/position/position.js +25 -13
  134. package/node/wrappers/models/position/position.js.map +1 -1
  135. package/node/wrappers/models/position/position.test.js +20 -0
  136. package/node/wrappers/models/position/position.test.js.map +1 -1
  137. package/node/wrappers/models/position/position.test.ts +23 -0
  138. package/node/wrappers/models/position/position.ts +27 -13
  139. package/node/wrappers/models/position/positionfilter.js +1 -1
  140. package/node/wrappers/models/position/positionfilter.js.map +1 -1
  141. package/node/wrappers/models/position/positionfilter.test.js.map +1 -1
  142. package/node/wrappers/models/price/Price.cash.test.d.ts +1 -0
  143. package/node/wrappers/models/price/Price.cash.test.js +42 -0
  144. package/node/wrappers/models/price/Price.cash.test.js.map +1 -0
  145. package/node/wrappers/models/price/Price.cash.test.ts +43 -0
  146. package/node/wrappers/models/price/Price.d.ts +38 -0
  147. package/node/wrappers/models/price/Price.js +111 -0
  148. package/node/wrappers/models/price/Price.js.map +1 -0
  149. package/node/wrappers/models/price/Price.test.d.ts +1 -0
  150. package/node/wrappers/models/price/Price.test.js +55 -0
  151. package/node/wrappers/models/price/Price.test.js.map +1 -0
  152. package/node/wrappers/models/price/Price.test.ts +63 -0
  153. package/node/wrappers/models/price/Price.ts +123 -0
  154. package/node/wrappers/models/security/BondSecurity.d.ts +17 -2
  155. package/node/wrappers/models/security/BondSecurity.js +59 -11
  156. package/node/wrappers/models/security/BondSecurity.js.map +1 -1
  157. package/node/wrappers/models/security/BondSecurity.priceScale.test.d.ts +1 -0
  158. package/node/wrappers/models/security/BondSecurity.priceScale.test.js +36 -0
  159. package/node/wrappers/models/security/BondSecurity.priceScale.test.js.map +1 -0
  160. package/node/wrappers/models/security/BondSecurity.priceScale.test.ts +36 -0
  161. package/node/wrappers/models/security/BondSecurity.test.js +34 -1
  162. package/node/wrappers/models/security/BondSecurity.test.js.map +1 -1
  163. package/node/wrappers/models/security/BondSecurity.test.ts +42 -1
  164. package/node/wrappers/models/security/BondSecurity.ts +63 -11
  165. package/node/wrappers/models/security/security-roundtrip.test.d.ts +1 -0
  166. package/node/wrappers/models/security/security-roundtrip.test.js +173 -0
  167. package/node/wrappers/models/security/security-roundtrip.test.js.map +1 -0
  168. package/node/wrappers/models/security/security-roundtrip.test.ts +192 -0
  169. package/node/wrappers/models/security/security.d.ts +8 -0
  170. package/node/wrappers/models/security/security.js +24 -2
  171. package/node/wrappers/models/security/security.js.map +1 -1
  172. package/node/wrappers/models/security/security.ts +26 -2
  173. package/node/wrappers/models/security/term.js +31 -6
  174. package/node/wrappers/models/security/term.js.map +1 -1
  175. package/node/wrappers/models/security/term.test.js +21 -2
  176. package/node/wrappers/models/security/term.test.js.map +1 -1
  177. package/node/wrappers/models/security/term.test.ts +28 -2
  178. package/node/wrappers/models/security/term.ts +34 -6
  179. package/node/wrappers/models/transaction/transaction.d.ts +59 -1
  180. package/node/wrappers/models/transaction/transaction.derived.test.d.ts +1 -0
  181. package/node/wrappers/models/transaction/transaction.derived.test.js +199 -0
  182. package/node/wrappers/models/transaction/transaction.derived.test.js.map +1 -0
  183. package/node/wrappers/models/transaction/transaction.derived.test.ts +251 -0
  184. package/node/wrappers/models/transaction/transaction.js +350 -2
  185. package/node/wrappers/models/transaction/transaction.js.map +1 -1
  186. package/node/wrappers/models/transaction/transaction.ts +416 -2
  187. package/node/wrappers/models/transaction/transaction_constructor.test.d.ts +1 -0
  188. package/node/wrappers/models/transaction/transaction_constructor.test.js +100 -0
  189. package/node/wrappers/models/transaction/transaction_constructor.test.js.map +1 -0
  190. package/node/wrappers/models/transaction/transaction_constructor.test.ts +111 -0
  191. package/node/wrappers/models/transaction/transaction_type.js.map +1 -1
  192. package/node/wrappers/models/utils/datetime.d.ts +6 -0
  193. package/node/wrappers/models/utils/datetime.js +14 -6
  194. package/node/wrappers/models/utils/datetime.js.map +1 -1
  195. package/node/wrappers/models/utils/datetime.ts +15 -6
  196. package/node/wrappers/models/utils/protoEnum.js.map +1 -1
  197. package/node/wrappers/models/utils/requestcontext.d.ts +17 -3
  198. package/node/wrappers/models/utils/requestcontext.js +39 -7
  199. package/node/wrappers/models/utils/requestcontext.js.map +1 -1
  200. package/node/wrappers/models/utils/requestcontext.test.d.ts +1 -0
  201. package/node/wrappers/models/utils/requestcontext.test.js +108 -0
  202. package/node/wrappers/models/utils/requestcontext.test.js.map +1 -0
  203. package/node/wrappers/models/utils/requestcontext.test.ts +85 -0
  204. package/node/wrappers/models/utils/requestcontext.ts +49 -9
  205. package/node/wrappers/models/utils/serialization.d.ts +2 -1
  206. package/node/wrappers/models/utils/serialization.js +4 -0
  207. package/node/wrappers/models/utils/serialization.js.map +1 -1
  208. package/node/wrappers/models/utils/serialization.test.js +15 -0
  209. package/node/wrappers/models/utils/serialization.test.js.map +1 -1
  210. package/node/wrappers/models/utils/serialization.test.ts +19 -1
  211. package/node/wrappers/models/utils/serialization.ts +5 -4
  212. package/node/wrappers/models/utils/serialization.util.js.map +1 -1
  213. package/node/wrappers/models/utils/uuid.js +9 -1
  214. package/node/wrappers/models/utils/uuid.js.map +1 -1
  215. package/node/wrappers/models/utils/uuid.test.js +22 -4
  216. package/node/wrappers/models/utils/uuid.test.js.map +1 -1
  217. package/node/wrappers/models/utils/uuid.test.ts +26 -5
  218. package/node/wrappers/models/utils/uuid.ts +7 -1
  219. package/node/wrappers/services/apikey.test.d.ts +7 -0
  220. package/node/wrappers/services/apikey.test.js +56 -0
  221. package/node/wrappers/services/apikey.test.js.map +1 -0
  222. package/node/wrappers/services/apikey.test.ts +65 -0
  223. package/node/wrappers/services/portfolio-service/PortfolioService.d.ts +1 -1
  224. package/node/wrappers/services/portfolio-service/PortfolioService.js +8 -2
  225. package/node/wrappers/services/portfolio-service/PortfolioService.js.map +1 -1
  226. package/node/wrappers/services/portfolio-service/PortfolioService.ts +7 -2
  227. package/node/wrappers/services/position-service/PositionService.d.ts +1 -1
  228. package/node/wrappers/services/position-service/PositionService.js +8 -2
  229. package/node/wrappers/services/position-service/PositionService.js.map +1 -1
  230. package/node/wrappers/services/position-service/PositionService.ts +7 -2
  231. package/node/wrappers/services/position-service/position.test.js.map +1 -1
  232. package/node/wrappers/services/price-service/PriceService.d.ts +29 -0
  233. package/node/wrappers/services/price-service/PriceService.js +151 -0
  234. package/node/wrappers/services/price-service/PriceService.js.map +1 -0
  235. package/node/wrappers/services/price-service/PriceService.ts +127 -0
  236. package/node/wrappers/services/price-service/price-wrapper.test.d.ts +1 -0
  237. package/node/wrappers/services/price-service/price-wrapper.test.js +132 -0
  238. package/node/wrappers/services/price-service/price-wrapper.test.js.map +1 -0
  239. package/node/wrappers/services/price-service/price-wrapper.test.ts +120 -0
  240. package/node/wrappers/services/price-service/price.test.d.ts +1 -0
  241. package/node/wrappers/services/price-service/price.test.js +198 -0
  242. package/node/wrappers/services/price-service/price.test.js.map +1 -0
  243. package/node/wrappers/services/price-service/price.test.ts +205 -0
  244. package/node/wrappers/services/security-service/SecurityService.d.ts +1 -1
  245. package/node/wrappers/services/security-service/SecurityService.js +8 -2
  246. package/node/wrappers/services/security-service/SecurityService.js.map +1 -1
  247. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.d.ts +1 -0
  248. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js +38 -0
  249. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js.map +1 -0
  250. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.ts +32 -0
  251. package/node/wrappers/services/security-service/SecurityService.ts +7 -2
  252. package/node/wrappers/services/security-service/security.maturityLadder.test.js.map +1 -1
  253. package/node/wrappers/services/transaction-service/TransactionService.d.ts +1 -1
  254. package/node/wrappers/services/transaction-service/TransactionService.js +8 -2
  255. package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
  256. package/node/wrappers/services/transaction-service/TransactionService.ts +7 -2
  257. package/node/wrappers/services/transaction-service/transaction.search.test.js.map +1 -1
  258. package/node/wrappers/services/transaction-service/transaction.test.js.map +1 -1
  259. package/package.json +3 -2
  260. package/.env +0 -3
@@ -0,0 +1,198 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
+ return new (P || (P = Promise))(function (resolve, reject) {
28
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
32
+ });
33
+ };
34
+ Object.defineProperty(exports, "__esModule", { value: true });
35
+ const util_1 = require("util");
36
+ const PriceService_1 = require("./PriceService");
37
+ const positionfilter_1 = require("../../models/position/positionfilter");
38
+ const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
39
+ const uuid_1 = require("../../models/utils/uuid");
40
+ const dt = __importStar(require("../../models/utils/datetime"));
41
+ const grpc = __importStar(require("@grpc/grpc-js"));
42
+ const price_service_grpc_pb_1 = require("../../../fintekkers/services/price-service/price_service_grpc_pb");
43
+ const query_price_request_pb_1 = require("../../../fintekkers/requests/price/query_price_request_pb");
44
+ const price_pb_1 = require("../../../fintekkers/models/price/price_pb");
45
+ const decimal_value_pb_1 = require("../../../fintekkers/models/util/decimal_value_pb");
46
+ const security_pb_1 = require("../../../fintekkers/models/security/security_pb");
47
+ const price_type_pb_1 = require("../../../fintekkers/models/price/price_type_pb");
48
+ const PRICE_SERVICE_URL = 'localhost:8083';
49
+ const priceService = new PriceService_1.PriceService(PRICE_SERVICE_URL);
50
+ afterAll(() => {
51
+ priceService.close();
52
+ });
53
+ /**
54
+ * Helper: get a security UUID that has prices by calling ListIds then GetByIds.
55
+ */
56
+ function getSecurityUuidWithPrices() {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ const client = new price_service_grpc_pb_1.PriceClient(PRICE_SERVICE_URL, grpc.credentials.createInsecure());
59
+ // ListIds to get a price UUID
60
+ const listRequest = new query_price_request_pb_1.QueryPriceRequestProto();
61
+ listRequest.setObjectClass('PriceRequest');
62
+ listRequest.setVersion('0.0.1');
63
+ const listIdsAsync = (0, util_1.promisify)(client.listIds.bind(client));
64
+ const listResponse = yield listIdsAsync(listRequest);
65
+ const priceUuids = listResponse.getPriceResponseList();
66
+ expect(priceUuids.length).toBeGreaterThan(0);
67
+ // GetByIds for the first price to get its security UUID
68
+ const getRequest = new query_price_request_pb_1.QueryPriceRequestProto();
69
+ getRequest.setObjectClass('PriceRequest');
70
+ getRequest.setVersion('0.0.1');
71
+ getRequest.setUuidsList([priceUuids[0].getUuid()]);
72
+ const getByIdsAsync = (0, util_1.promisify)(client.getByIds.bind(client));
73
+ const getResponse = yield getByIdsAsync(getRequest);
74
+ const prices = getResponse.getPriceResponseList();
75
+ expect(prices.length).toBeGreaterThan(0);
76
+ const securityUuidProto = prices[0].getSecurity().getUuid();
77
+ return { uuid: uuid_1.UUID.fromU8Array(securityUuidProto.getRawUuid_asU8()), client };
78
+ });
79
+ }
80
+ test('search with empty filter returns prices', () => __awaiter(void 0, void 0, void 0, function* () {
81
+ const now = dt.ZonedDateTime.now();
82
+ const emptyFilter = new positionfilter_1.PositionFilter();
83
+ const prices = yield priceService.searchPrice(now.toProto(), emptyFilter);
84
+ console.log(`Empty filter search returned ${prices.length} prices`);
85
+ expect(prices.length).toBeGreaterThan(0);
86
+ // Verify price structure
87
+ const firstPrice = prices[0];
88
+ expect(firstPrice.getPrice()).toBeTruthy();
89
+ expect(firstPrice.getSecurity()).toBeTruthy();
90
+ }), 120000);
91
+ test('search by SECURITY_ID returns prices for a known security', () => __awaiter(void 0, void 0, void 0, function* () {
92
+ var _a;
93
+ // First discover a security UUID that actually has prices
94
+ const { uuid: securityUuid, client } = yield getSecurityUuidWithPrices();
95
+ client.close();
96
+ console.log(`Found security UUID with prices: ${securityUuid.toString()}`);
97
+ const now = dt.ZonedDateTime.now();
98
+ const filter = new positionfilter_1.PositionFilter()
99
+ .addEqualsFilter(field_pb_1.FieldProto.SECURITY_ID, securityUuid);
100
+ const prices = yield priceService.searchPrice(now.toProto(), filter);
101
+ console.log(`Search returned ${prices.length} prices for security ${securityUuid.toString()}`);
102
+ expect(prices.length).toBeGreaterThan(0);
103
+ for (const price of prices) {
104
+ expect(price.getSecurity()).toBeTruthy();
105
+ expect((_a = price.getPrice()) === null || _a === void 0 ? void 0 : _a.getArbitraryPrecisionValue()).toBeTruthy();
106
+ }
107
+ }), 120000);
108
+ test('search for CUSIP 91282CPZ8 (UUID 18e8c4e6-3da0-47c9-b26d-c5ea8b8dce95) returns prices', () => __awaiter(void 0, void 0, void 0, function* () {
109
+ var _b;
110
+ const now = dt.ZonedDateTime.now();
111
+ const securityUuid = new uuid_1.UUID(uuid_1.UUID.fromString('18e8c4e6-3da0-47c9-b26d-c5ea8b8dce95'));
112
+ const filter = new positionfilter_1.PositionFilter()
113
+ .addEqualsFilter(field_pb_1.FieldProto.SECURITY_ID, securityUuid);
114
+ const prices = yield priceService.searchPrice(now.toProto(), filter);
115
+ console.log(`CUSIP 91282CPZ8 search returned ${prices.length} prices`);
116
+ // The gRPC call must succeed (no errors). If prices exist for this CUSIP,
117
+ // verify their structure. The service may not have this security loaded yet.
118
+ expect(prices.length).toBeGreaterThanOrEqual(0);
119
+ if (prices.length > 0) {
120
+ for (const price of prices) {
121
+ expect(price.getSecurity()).toBeTruthy();
122
+ const priceValue = (_b = price.getPrice()) === null || _b === void 0 ? void 0 : _b.getArbitraryPrecisionValue();
123
+ expect(priceValue).toBeTruthy();
124
+ console.log(` Price: ${priceValue}`);
125
+ }
126
+ }
127
+ else {
128
+ console.warn(' No prices loaded for CUSIP 91282CPZ8 yet — gRPC call succeeded, data not populated');
129
+ }
130
+ }), 120000);
131
+ /**
132
+ * Helper: build a PriceProto for a known security with a given price value.
133
+ */
134
+ function buildPriceProto(securityUuid, priceValue) {
135
+ const now = dt.ZonedDateTime.now();
136
+ const price = new price_pb_1.PriceProto();
137
+ price.setObjectClass('Price');
138
+ price.setVersion('0.0.1');
139
+ price.setUuid(uuid_1.UUID.random().toUUIDProto());
140
+ price.setAsOf(now.toProto());
141
+ const decimalValue = new decimal_value_pb_1.DecimalValueProto();
142
+ decimalValue.setArbitraryPrecisionValue(priceValue);
143
+ price.setPrice(decimalValue);
144
+ // Set security as a link reference
145
+ const security = new security_pb_1.SecurityProto();
146
+ security.setUuid(securityUuid.toUUIDProto());
147
+ security.setIsLink(true);
148
+ price.setSecurity(security);
149
+ price.setPriceType(price_type_pb_1.PriceTypeProto.PERCENTAGE);
150
+ return price;
151
+ }
152
+ test('createOrUpdate inserts a price via the gRPC API', () => __awaiter(void 0, void 0, void 0, function* () {
153
+ // Discover a real security UUID that already has prices
154
+ const { uuid: securityUuid, client } = yield getSecurityUuidWithPrices();
155
+ client.close();
156
+ const priceProto = buildPriceProto(securityUuid, '99.875');
157
+ const response = yield priceService.createOrUpdate(priceProto);
158
+ // The RPC must succeed and return a valid response
159
+ expect(response).toBeTruthy();
160
+ expect(response.getObjectClass()).toBeTruthy();
161
+ console.log(`createOrUpdate response object_class: ${response.getObjectClass()}`);
162
+ // Verify the price was persisted by searching for it
163
+ const now = dt.ZonedDateTime.now();
164
+ const filter = new positionfilter_1.PositionFilter()
165
+ .addEqualsFilter(field_pb_1.FieldProto.SECURITY_ID, securityUuid);
166
+ const prices = yield priceService.searchPrice(now.toProto(), filter);
167
+ const priceValues = prices.map(p => { var _a; return (_a = p.getPrice()) === null || _a === void 0 ? void 0 : _a.getArbitraryPrecisionValue(); });
168
+ expect(priceValues).toContain('99.875');
169
+ }), 120000);
170
+ test('validateCreateOrUpdate returns no errors for a valid price', () => __awaiter(void 0, void 0, void 0, function* () {
171
+ const { uuid: securityUuid, client } = yield getSecurityUuidWithPrices();
172
+ client.close();
173
+ const priceProto = buildPriceProto(securityUuid, '100.25');
174
+ const summary = yield priceService.validateCreateOrUpdate(priceProto);
175
+ expect(summary).toBeTruthy();
176
+ const errors = summary.getErrorsList();
177
+ console.log(`Validation errors: ${errors.length}`);
178
+ expect(errors.length).toBe(0);
179
+ }), 120000);
180
+ test('createOrUpdate price can be retrieved via search', () => __awaiter(void 0, void 0, void 0, function* () {
181
+ // Discover a real security UUID
182
+ const { uuid: securityUuid, client } = yield getSecurityUuidWithPrices();
183
+ client.close();
184
+ // Create a price with a distinctive value
185
+ const priceProto = buildPriceProto(securityUuid, '101.5');
186
+ const createResponse = yield priceService.createOrUpdate(priceProto);
187
+ expect(createResponse).toBeTruthy();
188
+ // Search for prices for that security and verify our price appears
189
+ const now = dt.ZonedDateTime.now();
190
+ const filter = new positionfilter_1.PositionFilter()
191
+ .addEqualsFilter(field_pb_1.FieldProto.SECURITY_ID, securityUuid);
192
+ const prices = yield priceService.searchPrice(now.toProto(), filter);
193
+ expect(prices.length).toBeGreaterThan(0);
194
+ const priceValues = prices.map(p => { var _a; return (_a = p.getPrice()) === null || _a === void 0 ? void 0 : _a.getArbitraryPrecisionValue(); });
195
+ console.log(`Found ${prices.length} prices for security, values: ${priceValues.join(', ')}`);
196
+ expect(priceValues).toContain('101.5');
197
+ }), 120000);
198
+ //# sourceMappingURL=price.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price.test.js","sourceRoot":"","sources":["price.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AACjC,iDAA8C;AAC9C,yEAAsE;AACtE,2EAA0E;AAC1E,kDAA+C;AAC/C,gEAAkD;AAClD,oDAAsC;AACtC,4GAA+F;AAC/F,sGAAmG;AAEnG,wEAAuE;AACvE,uFAAqF;AACrF,iFAAgF;AAChF,kFAAgF;AAEhF,MAAM,iBAAiB,GAAG,gBAAgB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AC,GAAG,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,IAAI,+BAAc,EAAE;SAChC,eAAe,CAAC,qBAAU,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,MAAM,CAAC,CAAC;IACrE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IAEzC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAC,OAAA,MAAA,CAAC,CAAC,QAAQ,EAAE,0CAAE,0BAA0B,EAAE,CAAA,EAAA,CAAC,CAAC;IAChF,OAAO,CAAC,GAAG,CAAC,SAAS,MAAM,CAAC,MAAM,iCAAiC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7F,MAAM,CAAC,WAAW,CAAC,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AACzC,CAAC,CAAA,EAAE,MAAM,CAAC,CAAC"}
@@ -0,0 +1,205 @@
1
+ import { promisify } from 'util';
2
+ import { PriceService } from './PriceService';
3
+ import { PositionFilter } from '../../models/position/positionfilter';
4
+ import { FieldProto } from '../../../fintekkers/models/position/field_pb';
5
+ import { UUID } from '../../models/utils/uuid';
6
+ import * as dt from '../../models/utils/datetime';
7
+ import * as grpc from '@grpc/grpc-js';
8
+ import { PriceClient } from '../../../fintekkers/services/price-service/price_service_grpc_pb';
9
+ import { QueryPriceRequestProto } from '../../../fintekkers/requests/price/query_price_request_pb';
10
+ import { QueryPriceResponseProto } from '../../../fintekkers/requests/price/query_price_response_pb';
11
+ import { PriceProto } from '../../../fintekkers/models/price/price_pb';
12
+ import { DecimalValueProto } from '../../../fintekkers/models/util/decimal_value_pb';
13
+ import { SecurityProto } from '../../../fintekkers/models/security/security_pb';
14
+ import { PriceTypeProto } from '../../../fintekkers/models/price/price_type_pb';
15
+
16
+ const PRICE_SERVICE_URL = 'localhost:8083';
17
+
18
+ const priceService = new PriceService(PRICE_SERVICE_URL);
19
+
20
+ afterAll(() => {
21
+ priceService.close();
22
+ });
23
+
24
+ /**
25
+ * Helper: get a security UUID that has prices by calling ListIds then GetByIds.
26
+ */
27
+ async function getSecurityUuidWithPrices(): Promise<{ uuid: UUID; client: PriceClient }> {
28
+ const client = new PriceClient(PRICE_SERVICE_URL, grpc.credentials.createInsecure());
29
+
30
+ // ListIds to get a price UUID
31
+ const listRequest = new QueryPriceRequestProto();
32
+ listRequest.setObjectClass('PriceRequest');
33
+ listRequest.setVersion('0.0.1');
34
+
35
+ const listIdsAsync = promisify(client.listIds.bind(client));
36
+ const listResponse = await listIdsAsync(listRequest) as QueryPriceResponseProto;
37
+ const priceUuids = listResponse.getPriceResponseList();
38
+ expect(priceUuids.length).toBeGreaterThan(0);
39
+
40
+ // GetByIds for the first price to get its security UUID
41
+ const getRequest = new QueryPriceRequestProto();
42
+ getRequest.setObjectClass('PriceRequest');
43
+ getRequest.setVersion('0.0.1');
44
+ getRequest.setUuidsList([priceUuids[0].getUuid()!]);
45
+
46
+ const getByIdsAsync = promisify(client.getByIds.bind(client));
47
+ const getResponse = await getByIdsAsync(getRequest) as QueryPriceResponseProto;
48
+ const prices = getResponse.getPriceResponseList();
49
+ expect(prices.length).toBeGreaterThan(0);
50
+
51
+ const securityUuidProto = prices[0].getSecurity()!.getUuid()!;
52
+ return { uuid: UUID.fromU8Array(securityUuidProto.getRawUuid_asU8()), client };
53
+ }
54
+
55
+ test('search with empty filter returns prices', async () => {
56
+ const now = dt.ZonedDateTime.now();
57
+ const emptyFilter = new PositionFilter();
58
+
59
+ const prices = await priceService.searchPrice(now.toProto(), emptyFilter);
60
+
61
+ console.log(`Empty filter search returned ${prices.length} prices`);
62
+ expect(prices.length).toBeGreaterThan(0);
63
+
64
+ // Verify price structure
65
+ const firstPrice = prices[0];
66
+ expect(firstPrice.getPrice()).toBeTruthy();
67
+ expect(firstPrice.getSecurity()).toBeTruthy();
68
+ }, 120000);
69
+
70
+ test('search by SECURITY_ID returns prices for a known security', async () => {
71
+ // First discover a security UUID that actually has prices
72
+ const { uuid: securityUuid, client } = await getSecurityUuidWithPrices();
73
+ client.close();
74
+ console.log(`Found security UUID with prices: ${securityUuid.toString()}`);
75
+
76
+ const now = dt.ZonedDateTime.now();
77
+
78
+ const filter = new PositionFilter()
79
+ .addEqualsFilter(FieldProto.SECURITY_ID, securityUuid);
80
+
81
+ const prices = await priceService.searchPrice(now.toProto(), filter);
82
+
83
+ console.log(`Search returned ${prices.length} prices for security ${securityUuid.toString()}`);
84
+ expect(prices.length).toBeGreaterThan(0);
85
+
86
+ for (const price of prices) {
87
+ expect(price.getSecurity()).toBeTruthy();
88
+ expect(price.getPrice()?.getArbitraryPrecisionValue()).toBeTruthy();
89
+ }
90
+ }, 120000);
91
+
92
+ test('search for CUSIP 91282CPZ8 (UUID 18e8c4e6-3da0-47c9-b26d-c5ea8b8dce95) returns prices', async () => {
93
+ const now = dt.ZonedDateTime.now();
94
+
95
+ const securityUuid = new UUID(UUID.fromString('18e8c4e6-3da0-47c9-b26d-c5ea8b8dce95'));
96
+ const filter = new PositionFilter()
97
+ .addEqualsFilter(FieldProto.SECURITY_ID, securityUuid);
98
+
99
+ const prices = await priceService.searchPrice(now.toProto(), filter);
100
+
101
+ console.log(`CUSIP 91282CPZ8 search returned ${prices.length} prices`);
102
+
103
+ // The gRPC call must succeed (no errors). If prices exist for this CUSIP,
104
+ // verify their structure. The service may not have this security loaded yet.
105
+ expect(prices.length).toBeGreaterThanOrEqual(0);
106
+
107
+ if (prices.length > 0) {
108
+ for (const price of prices) {
109
+ expect(price.getSecurity()).toBeTruthy();
110
+ const priceValue = price.getPrice()?.getArbitraryPrecisionValue();
111
+ expect(priceValue).toBeTruthy();
112
+ console.log(` Price: ${priceValue}`);
113
+ }
114
+ } else {
115
+ console.warn(' No prices loaded for CUSIP 91282CPZ8 yet — gRPC call succeeded, data not populated');
116
+ }
117
+ }, 120000);
118
+
119
+ /**
120
+ * Helper: build a PriceProto for a known security with a given price value.
121
+ */
122
+ function buildPriceProto(securityUuid: UUID, priceValue: string): PriceProto {
123
+ const now = dt.ZonedDateTime.now();
124
+
125
+ const price = new PriceProto();
126
+ price.setObjectClass('Price');
127
+ price.setVersion('0.0.1');
128
+ price.setUuid(UUID.random().toUUIDProto());
129
+ price.setAsOf(now.toProto());
130
+
131
+ const decimalValue = new DecimalValueProto();
132
+ decimalValue.setArbitraryPrecisionValue(priceValue);
133
+ price.setPrice(decimalValue);
134
+
135
+ // Set security as a link reference
136
+ const security = new SecurityProto();
137
+ security.setUuid(securityUuid.toUUIDProto());
138
+ security.setIsLink(true);
139
+ price.setSecurity(security);
140
+
141
+ price.setPriceType(PriceTypeProto.PERCENTAGE);
142
+
143
+ return price;
144
+ }
145
+
146
+ test('createOrUpdate inserts a price via the gRPC API', async () => {
147
+ // Discover a real security UUID that already has prices
148
+ const { uuid: securityUuid, client } = await getSecurityUuidWithPrices();
149
+ client.close();
150
+
151
+ const priceProto = buildPriceProto(securityUuid, '99.875');
152
+
153
+ const response = await priceService.createOrUpdate(priceProto);
154
+
155
+ // The RPC must succeed and return a valid response
156
+ expect(response).toBeTruthy();
157
+ expect(response.getObjectClass()).toBeTruthy();
158
+ console.log(`createOrUpdate response object_class: ${response.getObjectClass()}`);
159
+
160
+ // Verify the price was persisted by searching for it
161
+ const now = dt.ZonedDateTime.now();
162
+ const filter = new PositionFilter()
163
+ .addEqualsFilter(FieldProto.SECURITY_ID, securityUuid);
164
+
165
+ const prices = await priceService.searchPrice(now.toProto(), filter);
166
+ const priceValues = prices.map(p => p.getPrice()?.getArbitraryPrecisionValue());
167
+ expect(priceValues).toContain('99.875');
168
+ }, 120000);
169
+
170
+ test('validateCreateOrUpdate returns no errors for a valid price', async () => {
171
+ const { uuid: securityUuid, client } = await getSecurityUuidWithPrices();
172
+ client.close();
173
+
174
+ const priceProto = buildPriceProto(securityUuid, '100.25');
175
+
176
+ const summary = await priceService.validateCreateOrUpdate(priceProto);
177
+
178
+ expect(summary).toBeTruthy();
179
+ const errors = summary.getErrorsList();
180
+ console.log(`Validation errors: ${errors.length}`);
181
+ expect(errors.length).toBe(0);
182
+ }, 120000);
183
+
184
+ test('createOrUpdate price can be retrieved via search', async () => {
185
+ // Discover a real security UUID
186
+ const { uuid: securityUuid, client } = await getSecurityUuidWithPrices();
187
+ client.close();
188
+
189
+ // Create a price with a distinctive value
190
+ const priceProto = buildPriceProto(securityUuid, '101.5');
191
+ const createResponse = await priceService.createOrUpdate(priceProto);
192
+ expect(createResponse).toBeTruthy();
193
+
194
+ // Search for prices for that security and verify our price appears
195
+ const now = dt.ZonedDateTime.now();
196
+ const filter = new PositionFilter()
197
+ .addEqualsFilter(FieldProto.SECURITY_ID, securityUuid);
198
+
199
+ const prices = await priceService.searchPrice(now.toProto(), filter);
200
+ expect(prices.length).toBeGreaterThan(0);
201
+
202
+ const priceValues = prices.map(p => p.getPrice()?.getArbitraryPrecisionValue());
203
+ console.log(`Found ${prices.length} prices for security, values: ${priceValues.join(', ')}`);
204
+ expect(priceValues).toContain('101.5');
205
+ }, 120000);
@@ -6,7 +6,7 @@ import { PositionFilter } from '../../models/position/positionfilter';
6
6
  import { CreateSecurityResponseProto } from '../../../fintekkers/requests/security/create_security_response_pb';
7
7
  declare class SecurityService {
8
8
  private client;
9
- constructor();
9
+ constructor(apiKey?: string);
10
10
  validateCreateSecurity(security: SecurityProto): Promise<SummaryProto>;
11
11
  createSecurity(security: SecurityProto): Promise<CreateSecurityResponseProto>;
12
12
  searchSecurityAsOfNow(positionFilter: PositionFilter): Promise<Security[]>;
@@ -45,8 +45,14 @@ const query_security_request_pb_1 = require("../../../fintekkers/requests/securi
45
45
  const create_security_request_pb_1 = require("../../../fintekkers/requests/security/create_security_request_pb");
46
46
  const requestcontext_1 = __importDefault(require("../../models/utils/requestcontext"));
47
47
  class SecurityService {
48
- constructor() {
49
- this.client = new security_service_grpc_pb_1.SecurityClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
48
+ constructor(apiKey) {
49
+ if (apiKey) {
50
+ const { credentials, interceptors } = requestcontext_1.default.getAuthenticatedClientOptions(apiKey);
51
+ this.client = new security_service_grpc_pb_1.SecurityClient(requestcontext_1.default.apiURL, credentials, { interceptors });
52
+ }
53
+ else {
54
+ this.client = new security_service_grpc_pb_1.SecurityClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
55
+ }
50
56
  }
51
57
  validateCreateSecurity(security) {
52
58
  return __awaiter(this, void 0, void 0, function* () {
@@ -1 +1 @@
1
- {"version":3,"file":"SecurityService.js","sourceRoot":"","sources":["SecurityService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AAMjC,8EAAsD;AAItD,gEAAkD;AAElD,sBAAsB;AACtB,qHAAwG;AACxG,+GAA4G;AAE5G,iHAA8G;AAG9G,uFAA0D;AAE1D,MAAM,eAAe;IAGnB;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,yCAAc,CAAC,wBAAS,CAAC,MAAM,EAAE,wBAAS,CAAC,cAAc,CAAC,CAAC;IAC/E,CAAC;IAEK,sBAAsB,CAAC,QAAuB;;YAClD,MAAM,aAAa,GAAG,IAAI,uDAA0B,EAAE,CAAC;YACvD,aAAa,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC;YAChD,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAClC,aAAa,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAEzC,MAAM,2BAA2B,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YACpG,MAAM,QAAQ,GAAG,MAAM,2BAA2B,CAAC,aAAa,CAAC,CAAC;YAClE,OAAO,QAAwB,CAAC;QAClC,C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BAA0B,EAAE,CAAC;QAC5C,CAAC;KAAA;CACF;AAEQ,0CAAe"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ const SecurityService_1 = require("./SecurityService");
13
+ const positionfilter_1 = require("../../models/position/positionfilter");
14
+ const field_pb_1 = require("../../../fintekkers/models/position/field_pb");
15
+ const identifier_1 = require("../../models/security/identifier");
16
+ const identifier_pb_1 = require("../../../fintekkers/models/security/identifier/identifier_pb");
17
+ const identifier_type_pb_1 = require("../../../fintekkers/models/security/identifier/identifier_type_pb");
18
+ test('searchByUuid returns the security matching the given UUID', () => __awaiter(void 0, void 0, void 0, function* () {
19
+ const service = new SecurityService_1.SecurityService();
20
+ // First find a known security by CUSIP to get its UUID
21
+ const filter = new positionfilter_1.PositionFilter();
22
+ const identifierProto = new identifier_pb_1.IdentifierProto()
23
+ .setIdentifierType(identifier_type_pb_1.IdentifierTypeProto.CUSIP)
24
+ .setIdentifierValue('912810TM4');
25
+ filter.addObjectFilter(field_pb_1.FieldProto.IDENTIFIER, new identifier_1.Identifier(identifierProto));
26
+ const byIdentifier = yield service.searchSecurityAsOfNow(filter);
27
+ if (byIdentifier.length === 0) {
28
+ console.warn('No security found for test CUSIP — skipping UUID lookup assertion');
29
+ return;
30
+ }
31
+ const original = byIdentifier[0];
32
+ const uuidStr = original.getID().toString();
33
+ // Now look it up by UUID
34
+ const byUuid = yield service.searchByUuid(uuidStr);
35
+ expect(byUuid.length).toBeGreaterThan(0);
36
+ expect(byUuid[0].getID().toString()).toBe(uuidStr);
37
+ }), 30000);
38
+ //# sourceMappingURL=SecurityService.searchByUuid.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecurityService.searchByUuid.test.js","sourceRoot":"","sources":["SecurityService.searchByUuid.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uDAAoD;AACpD,yEAAsE;AACtE,2EAA0E;AAC1E,iEAA8D;AAC9D,gGAA+F;AAC/F,0GAAwG;AAExG,IAAI,CAAC,2DAA2D,EAAE,GAAS,EAAE;IAC3E,MAAM,OAAO,GAAG,IAAI,iCAAe,EAAE,CAAC;IAEtC,uDAAuD;IACvD,MAAM,MAAM,GAAG,IAAI,+BAAc,EAAE,CAAC;IACpC,MAAM,eAAe,GAAG,IAAI,+BAAe,EAAE;SAC1C,iBAAiB,CAAC,wCAAmB,CAAC,KAAK,CAAC;SAC5C,kBAAkB,CAAC,WAAW,CAAC,CAAC;IACnC,MAAM,CAAC,eAAe,CAAC,qBAAU,CAAC,UAAU,EAAE,IAAI,uBAAU,CAAC,eAAe,CAAC,CAAC,CAAC;IAE/E,MAAM,YAAY,GAAG,MAAM,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACjE,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;QAC7B,OAAO,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAC;QAClF,OAAO;KACR;IAED,MAAM,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC;IAE5C,yBAAyB;IACzB,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;IAEnD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IACzC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACrD,CAAC,CAAA,EAAE,KAAK,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { SecurityService } from './SecurityService';
2
+ import { PositionFilter } from '../../models/position/positionfilter';
3
+ import { FieldProto } from '../../../fintekkers/models/position/field_pb';
4
+ import { Identifier } from '../../models/security/identifier';
5
+ import { IdentifierProto } from '../../../fintekkers/models/security/identifier/identifier_pb';
6
+ import { IdentifierTypeProto } from '../../../fintekkers/models/security/identifier/identifier_type_pb';
7
+
8
+ test('searchByUuid returns the security matching the given UUID', async () => {
9
+ const service = new SecurityService();
10
+
11
+ // First find a known security by CUSIP to get its UUID
12
+ const filter = new PositionFilter();
13
+ const identifierProto = new IdentifierProto()
14
+ .setIdentifierType(IdentifierTypeProto.CUSIP)
15
+ .setIdentifierValue('912810TM4');
16
+ filter.addObjectFilter(FieldProto.IDENTIFIER, new Identifier(identifierProto));
17
+
18
+ const byIdentifier = await service.searchSecurityAsOfNow(filter);
19
+ if (byIdentifier.length === 0) {
20
+ console.warn('No security found for test CUSIP — skipping UUID lookup assertion');
21
+ return;
22
+ }
23
+
24
+ const original = byIdentifier[0];
25
+ const uuidStr = original.getID().toString();
26
+
27
+ // Now look it up by UUID
28
+ const byUuid = await service.searchByUuid(uuidStr);
29
+
30
+ expect(byUuid.length).toBeGreaterThan(0);
31
+ expect(byUuid[0].getID().toString()).toBe(uuidStr);
32
+ }, 30000);
@@ -22,8 +22,13 @@ import EnvConfig from '../../models/utils/requestcontext';
22
22
  class SecurityService {
23
23
  private client: SecurityClient;
24
24
 
25
- constructor() {
26
- this.client = new SecurityClient(EnvConfig.apiURL, EnvConfig.apiCredentials);
25
+ constructor(apiKey?: string) {
26
+ if (apiKey) {
27
+ const { credentials, interceptors } = EnvConfig.getAuthenticatedClientOptions(apiKey);
28
+ this.client = new SecurityClient(EnvConfig.apiURL, credentials, { interceptors });
29
+ } else {
30
+ this.client = new SecurityClient(EnvConfig.apiURL, EnvConfig.apiCredentials);
31
+ }
27
32
  }
28
33
 
29
34
  async validateCreateSecurity(security: SecurityProto): Promise<SummaryProto> {
@@ -1 +1 @@
1
- {"version":3,"file":"security.maturityLadder.test.js","sourceRoot":"","sources":["security.maturityLadder.test.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAkC;AAElC,SAAS;AAET,cAAc;AACd,2EAA0E;AAC1E,uDAAoD;AACpD,yEAAsE;AAEtE,oEAA0E;AAE1E,IAAI,CAAC,kGAAkG,EAAE,GAAS,EAAE;IAChH,6FAA6F;IAC7F,MAAM,eAAe,GAAG,IAAI,iCAAe,EAAE,CAAC;IAE9C,MAAM,cAAc,GAAG,IAAI,+BAAc,EAAE,CAAC;IAC5C,cAAc,CAAC,eAAe,CAAC,qBAAU,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;IACvE,cAAc,CAAC,eAAe,CAAC,qBAAU,CAAC,oBAAoB,EAAE,eAAe,CAAC,CAAC;IAEjF,IAAI,UAAU,GAAG,MAAM,eAAe,CAAC,qBAAqB,CAAC,cAAc,CAAC,CAAC;IAE7E,MAAM,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC9B,IAAI,OAAO,GAAG,EAAE,CAAC;IAEjB,+CAA+C;IAC/C,KAAK,IAAI,KAAK,IAAI,UAAU,EAAE,CAAC;QAC3B,IAAI,QAAQ,GAAa,UAAU,CAAC,KAAK,CAAC,CAAC;QAE3C,IAAI,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC,mBAAmB,EAAE,CAAC;QACxD,IAAI,QAAQ,GAAG,YAAY,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAEhF,IAAI,QAAQ,EAAE,CAAC;YACX,IAAI,CAAC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AAI,EAAE,GAAW,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE,CAAC;gBAExH,IAAI,MAAM,GAAG;oBACT,OAAO,EAAE,EAAE;oBACX,WAAW,EAAE,QAAQ,CAAC,YAAY,EAAE;oBACpC,mBAAmB,EAAE,mBAAmB;oBACxC,cAAc,EAAE,QAAQ,CAAC,eAAe,EAAE;iBAC7C,CAAC;gBACF,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACxB;SACJ;KACJ;IAED,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAA,EAAE,KAAK,CAAC,CAAC"}
@@ -5,7 +5,7 @@ import { SummaryProto } from '../../../fintekkers/requests/util/errors/summary_p
5
5
  import { CreateTransactionResponseProto } from '../../../fintekkers/requests/transaction/create_transaction_response_pb';
6
6
  declare class TransactionService {
7
7
  private client;
8
- constructor();
8
+ constructor(apiKey?: string);
9
9
  validateCreateTransaction(transaction: Transaction): Promise<SummaryProto>;
10
10
  createTransaction(transaction: Transaction): Promise<CreateTransactionResponseProto>;
11
11
  searchTransaction(asOf: LocalTimestampProto, positionFilter: PositionFilter, maxResults?: number): Promise<Transaction[]>;
@@ -23,8 +23,14 @@ const create_transaction_request_pb_1 = require("../../../fintekkers/requests/tr
23
23
  const query_transaction_request_pb_1 = require("../../../fintekkers/requests/transaction/query_transaction_request_pb");
24
24
  const requestcontext_1 = __importDefault(require("../../models/utils/requestcontext"));
25
25
  class TransactionService {
26
- constructor() {
27
- this.client = new transaction_service_grpc_pb_1.TransactionClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
26
+ constructor(apiKey) {
27
+ if (apiKey) {
28
+ const { credentials, interceptors } = requestcontext_1.default.getAuthenticatedClientOptions(apiKey);
29
+ this.client = new transaction_service_grpc_pb_1.TransactionClient(requestcontext_1.default.apiURL, credentials, { interceptors });
30
+ }
31
+ else {
32
+ this.client = new transaction_service_grpc_pb_1.TransactionClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
33
+ }
28
34
  }
29
35
  validateCreateTransaction(transaction) {
30
36
  return __awaiter(this, void 0, void 0, function* () {
@@ -1 +1 @@
1
- {"version":3,"file":"TransactionService.js","sourceRoot":"","sources":["TransactionService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+BAAiC;AAEjC,SAAS;AACT,uFAA+D;AAK/D,cAAc;AAEd,sBAAsB;AACtB,8HAAiH;AACjH,0HAAuH;AAEvH,wHAAqH;AAErH,uFAA0D;AAG1D,MAAM,kBAAkB;IAGtB;QACE,IAAI,CAAC,MAAM,GAAG,IAAI,+CAAiB,CAAC,wBAAS,CAAC,MAAM,EAAE,wBAAS,CAAC,cAAc,CAAC,CAAC;IAClF,CAAC;IAEK,yBAAyB,CAAC,WAAwB;;YACtD,MAAM,aAAa,GAAG,IAAI,6DAA6B,EAAE,CAAC;YAC1D,aAAa,CAAC,cAAc,CAAC,oBAAoB,CAAC,CAAC;YACnD,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YAClC,aAAa,CAAC,yBAAyB,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;YAE3D,MAAM,2BAA2B,GAAG,IAAA,gBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;YACpG,MAAM,QAAQ,GAAG,MAAM,2BAA2B,CAAC,aAAa,CAAiB,CAAC;YAClF,OAAO,QAAQ,CAAC;QAClB,CAAC;KAAA;IAEK,iBAAiB,CAAC,WAAwB;;YAC9C,MAAM,aAAa,GAAG,IAAI,6DAA6B,EAAE,CAAC;YAC1D,aAAa,CAAC,cAAc,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CAAC,OAAO,EAAE,CAAC,CAAC;QAClE,aAAa,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;QAEnC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC;QAE9B,SAAe,0BAA0B;;gBACvC,MAAM,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;gBAChD,IAAI,OAAO,GAAkB,EAAE,CAAC;gBAEhC,OAAO,IAAI,OAAO,CAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;oBACpD,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,QAAuC,EAAE,EAAE;wBAC7D,QAAQ,CAAC,0BAA0B,EAAE,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,EAAE;4BAC5D,MAAM,GAAG,GAAgB,IAAI,qBAAW,CAAC,WAAW,CAAC,CAAC;4BACtD,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;wBACpB,CAAC,CAAC,CAAA;oBACJ,CAAC,CAAC,CAAC;oBAEH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE;wBACrB,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;wBAClD,OAAO,CAAC,OAAO,CAAC,CAAC;oBACnB,CAAC,CAAC,CAAC;oBAEH,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;wBAC1B,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,GAAG,CAAC,CAAC;wBAC3C,MAAM,CAAC,GAAG,CAAC,CAAC;oBACd,CAAC,CAAC,CAAC;gBACL,CAAC,CAAC,CAAC;YACL,CAAC;SAAA;QAED,OAAO,0BAA0B,EAAE,CAAC;IACtC,CAAC;CACF;AAEQ,gDAAkB"}
@@ -20,8 +20,13 @@ import EnvConfig from '../../models/utils/requestcontext';
20
20
  class TransactionService {
21
21
  private client: TransactionClient;
22
22
 
23
- constructor() {
24
- this.client = new TransactionClient(EnvConfig.apiURL, EnvConfig.apiCredentials);
23
+ constructor(apiKey?: string) {
24
+ if (apiKey) {
25
+ const { credentials, interceptors } = EnvConfig.getAuthenticatedClientOptions(apiKey);
26
+ this.client = new TransactionClient(EnvConfig.apiURL, credentials, { interceptors });
27
+ } else {
28
+ this.client = new TransactionClient(EnvConfig.apiURL, EnvConfig.apiCredentials);
29
+ }
25
30
  }
26
31
 
27
32
  async validateCreateTransaction(transaction: Transaction): Promise<SummaryProto> {
@@ -1 +1 @@
1
- {"version":3,"file":"transaction.search.test.js","sourceRoot":"","sources":["transaction.search.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,cAAc;AACd,2EAA0E;AAG1E,gEAAkD;AAOlD,6DAA0D;AAK1D,yEAAsE;AAEtE,IAAI,CAAC,2DAA2D,EAAE,GAAS,EAAE;IAC3E,MAAM,MAAM,GAAG,MAAM,sBAAsB,EAAE,CAAC;IAC9C,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC,CAAA,EAAE,KAAK,CAAC,CAAC;AAEV,SAAe,sBAAsB;;QACnC,MAAM,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,CAAC;QACnC,MAAM,kBAAkB,GAAG,IAAI,uCAAkB,EAAE,CAAC;QAEpD,MAAM,cAAc,GAAG,IAAI,+BAAc,EAAE,CAAC;QAC5C,cAAc,CAAC,eAAe,CAAC,qBAAU,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAEvE,gEAAgE;QAChE,MAAM,YAAY,GAAG,MAAM,kBAAkB,CAAC,iBAAiB,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;QAC/F,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAErC,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,CAAC,GAAG,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