@fintekkers/ledger-models 0.1.131 → 0.1.133

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 (151) hide show
  1. package/node/fintekkers/models/portfolio/portfolio_pb.js +19 -13
  2. package/node/fintekkers/models/position/field_pb.js +7 -1
  3. package/node/fintekkers/models/position/measure_pb.js +7 -1
  4. package/node/fintekkers/models/position/position_filter_pb.js +13 -7
  5. package/node/fintekkers/models/position/position_pb.js +17 -11
  6. package/node/fintekkers/models/position/position_status_pb.js +7 -1
  7. package/node/fintekkers/models/position/position_util_pb.js +17 -11
  8. package/node/fintekkers/models/price/price_pb.js +20 -14
  9. package/node/fintekkers/models/price/price_type_pb.js +7 -1
  10. package/node/fintekkers/models/security/bond/auction_type_pb.js +7 -1
  11. package/node/fintekkers/models/security/bond/issuance_pb.js +23 -17
  12. package/node/fintekkers/models/security/coupon_frequency_pb.js +7 -1
  13. package/node/fintekkers/models/security/coupon_type_pb.js +7 -1
  14. package/node/fintekkers/models/security/identifier/identifier_pb.js +15 -9
  15. package/node/fintekkers/models/security/identifier/identifier_type_pb.js +7 -1
  16. package/node/fintekkers/models/security/index/index_type_pb.js +7 -1
  17. package/node/fintekkers/models/security/index_composition_grpc_pb.js +1 -0
  18. package/node/fintekkers/models/security/index_composition_pb.js +29 -23
  19. package/node/fintekkers/models/security/security_pb.d.ts +6 -0
  20. package/node/fintekkers/models/security/security_pb.js +147 -90
  21. package/node/fintekkers/models/security/security_quantity_type_pb.js +7 -1
  22. package/node/fintekkers/models/security/security_type_pb.js +7 -1
  23. package/node/fintekkers/models/security/tenor_pb.js +15 -9
  24. package/node/fintekkers/models/security/tenor_type_pb.js +7 -1
  25. package/node/fintekkers/models/strategy/strategy_allocation_pb.js +19 -13
  26. package/node/fintekkers/models/strategy/strategy_pb.js +20 -14
  27. package/node/fintekkers/models/transaction/transaction_pb.js +30 -24
  28. package/node/fintekkers/models/transaction/transaction_type_pb.js +7 -1
  29. package/node/fintekkers/models/util/api/api_key_pb.js +16 -10
  30. package/node/fintekkers/models/util/currency_grpc_pb.js +1 -0
  31. package/node/fintekkers/models/util/currency_pb.js +10 -4
  32. package/node/fintekkers/models/util/date_range_pb.js +14 -8
  33. package/node/fintekkers/models/util/decimal_value_pb.js +10 -4
  34. package/node/fintekkers/models/util/endpoint_pb.js +13 -7
  35. package/node/fintekkers/models/util/local_date_pb.js +11 -5
  36. package/node/fintekkers/models/util/local_timestamp_pb.js +11 -5
  37. package/node/fintekkers/models/util/lock/node_partition_pb.js +15 -9
  38. package/node/fintekkers/models/util/lock/node_state_pb.js +16 -10
  39. package/node/fintekkers/models/util/uuid_pb.js +9 -3
  40. package/node/fintekkers/models/valuation/cashflow_grpc_pb.js +1 -0
  41. package/node/fintekkers/models/valuation/cashflow_pb.js +13 -7
  42. package/node/fintekkers/requests/index_composition/create_index_composition_request_grpc_pb.js +1 -0
  43. package/node/fintekkers/requests/index_composition/create_index_composition_request_pb.js +22 -16
  44. package/node/fintekkers/requests/index_composition/get_index_composition_request_grpc_pb.js +1 -0
  45. package/node/fintekkers/requests/index_composition/get_index_composition_request_pb.js +22 -16
  46. package/node/fintekkers/requests/portfolio/create_portfolio_request_pb.js +13 -7
  47. package/node/fintekkers/requests/portfolio/create_portfolio_response_pb.js +14 -8
  48. package/node/fintekkers/requests/portfolio/query_portfolio_request_pb.js +17 -11
  49. package/node/fintekkers/requests/portfolio/query_portfolio_response_pb.js +14 -8
  50. package/node/fintekkers/requests/position/query_position_request_pb.js +27 -15
  51. package/node/fintekkers/requests/position/query_position_response_pb.js +16 -10
  52. package/node/fintekkers/requests/price/create_price_request_pb.js +13 -7
  53. package/node/fintekkers/requests/price/create_price_response_pb.js +14 -8
  54. package/node/fintekkers/requests/price/query_price_request_pb.d.ts +3 -0
  55. package/node/fintekkers/requests/price/query_price_request_pb.js +48 -12
  56. package/node/fintekkers/requests/price/query_price_response_pb.d.ts +7 -0
  57. package/node/fintekkers/requests/price/query_price_response_pb.js +68 -9
  58. package/node/fintekkers/requests/security/create_security_request_pb.js +13 -7
  59. package/node/fintekkers/requests/security/create_security_response_pb.js +15 -9
  60. package/node/fintekkers/requests/security/get_field_values_request_pb.js +13 -7
  61. package/node/fintekkers/requests/security/get_field_values_response_pb.js +13 -7
  62. package/node/fintekkers/requests/security/get_fields_response_pb.js +17 -8
  63. package/node/fintekkers/requests/security/query_security_request_pb.js +17 -11
  64. package/node/fintekkers/requests/security/query_security_response_pb.js +15 -9
  65. package/node/fintekkers/requests/transaction/create_transaction_request_pb.js +13 -7
  66. package/node/fintekkers/requests/transaction/create_transaction_response_pb.js +14 -8
  67. package/node/fintekkers/requests/transaction/query_transaction_request_pb.js +16 -10
  68. package/node/fintekkers/requests/transaction/query_transaction_response_pb.js +15 -9
  69. package/node/fintekkers/requests/util/delete_request_grpc_pb.js +1 -0
  70. package/node/fintekkers/requests/util/delete_request_pb.js +34 -28
  71. package/node/fintekkers/requests/util/errors/error_pb.js +13 -7
  72. package/node/fintekkers/requests/util/errors/message_pb.js +12 -6
  73. package/node/fintekkers/requests/util/errors/summary_pb.js +10 -4
  74. package/node/fintekkers/requests/util/lock/lock_request_pb.js +14 -8
  75. package/node/fintekkers/requests/util/lock/lock_response_pb.js +15 -9
  76. package/node/fintekkers/requests/util/operation_pb.js +7 -1
  77. package/node/fintekkers/requests/valuation/curve_request_grpc_pb.js +1 -0
  78. package/node/fintekkers/requests/valuation/curve_request_pb.d.ts +12 -0
  79. package/node/fintekkers/requests/valuation/curve_request_pb.js +125 -14
  80. package/node/fintekkers/requests/valuation/curve_response_grpc_pb.js +1 -0
  81. package/node/fintekkers/requests/valuation/curve_response_pb.js +21 -15
  82. package/node/fintekkers/requests/valuation/product_inputs.test.d.ts +6 -0
  83. package/node/fintekkers/requests/valuation/product_inputs.test.js +146 -0
  84. package/node/fintekkers/requests/valuation/product_inputs.test.js.map +1 -0
  85. package/node/fintekkers/requests/valuation/product_inputs_grpc_pb.js +1 -0
  86. package/node/fintekkers/requests/valuation/product_inputs_pb.d.ts +42 -0
  87. package/node/fintekkers/requests/valuation/product_inputs_pb.js +360 -27
  88. package/node/fintekkers/requests/valuation/valuation_request_pb.js +25 -16
  89. package/node/fintekkers/requests/valuation/valuation_response_pb.js +16 -10
  90. package/node/fintekkers/services/index-composition-service/index_composition_service_grpc_pb.js +14 -14
  91. package/node/fintekkers/services/index-composition-service/index_composition_service_pb.js +7 -1
  92. package/node/fintekkers/services/lock-service/lock_service_grpc_pb.js +23 -23
  93. package/node/fintekkers/services/lock-service/lock_service_pb.js +21 -15
  94. package/node/fintekkers/services/portfolio-service/portfolio_service_grpc_pb.js +8 -8
  95. package/node/fintekkers/services/portfolio-service/portfolio_service_pb.js +7 -1
  96. package/node/fintekkers/services/position-service/position_service_grpc_pb.js +10 -10
  97. package/node/fintekkers/services/position-service/position_service_pb.js +7 -1
  98. package/node/fintekkers/services/price-service/price_service_grpc_pb.js +6 -6
  99. package/node/fintekkers/services/price-service/price_service_pb.js +7 -1
  100. package/node/fintekkers/services/security-service/security_service_grpc_pb.js +12 -12
  101. package/node/fintekkers/services/security-service/security_service_pb.js +7 -1
  102. package/node/fintekkers/services/transaction-service/transaction_service_grpc_pb.js +11 -11
  103. package/node/fintekkers/services/transaction-service/transaction_service_pb.js +7 -1
  104. package/node/fintekkers/services/valuation-service/valuation_service_grpc_pb.js +5 -5
  105. package/node/fintekkers/services/valuation-service/valuation_service_pb.js +7 -1
  106. package/node/wrappers/models/price/Price.d.ts +5 -0
  107. package/node/wrappers/models/price/Price.js +7 -0
  108. package/node/wrappers/models/price/Price.js.map +1 -1
  109. package/node/wrappers/models/price/Price.ts +8 -0
  110. package/node/wrappers/models/security/BondSecurity.d.ts +8 -0
  111. package/node/wrappers/models/security/BondSecurity.js +13 -0
  112. package/node/wrappers/models/security/BondSecurity.js.map +1 -1
  113. package/node/wrappers/models/security/BondSecurity.ts +13 -0
  114. package/node/wrappers/models/security/identifier.d.ts +26 -0
  115. package/node/wrappers/models/security/identifier.js +39 -0
  116. package/node/wrappers/models/security/identifier.js.map +1 -1
  117. package/node/wrappers/models/security/identifier.test.js +62 -0
  118. package/node/wrappers/models/security/identifier.test.js.map +1 -1
  119. package/node/wrappers/models/security/identifier.test.ts +70 -0
  120. package/node/wrappers/models/security/identifier.ts +44 -0
  121. package/node/wrappers/models/security/security.d.ts +42 -1
  122. package/node/wrappers/models/security/security.js +53 -2
  123. package/node/wrappers/models/security/security.js.map +1 -1
  124. package/node/wrappers/models/security/security.test.js +72 -0
  125. package/node/wrappers/models/security/security.test.js.map +1 -1
  126. package/node/wrappers/models/security/security.test.ts +80 -0
  127. package/node/wrappers/models/security/security.ts +56 -3
  128. package/node/wrappers/services/price-service/PriceService.d.ts +19 -0
  129. package/node/wrappers/services/price-service/PriceService.js +26 -0
  130. package/node/wrappers/services/price-service/PriceService.js.map +1 -1
  131. package/node/wrappers/services/price-service/PriceService.ts +29 -0
  132. package/node/wrappers/services/searchWithSecurities.test.js +125 -0
  133. package/node/wrappers/services/searchWithSecurities.test.js.map +1 -0
  134. package/node/wrappers/services/searchWithSecurities.test.ts +103 -0
  135. package/node/wrappers/services/transaction-service/TransactionService.d.ts +14 -0
  136. package/node/wrappers/services/transaction-service/TransactionService.js +25 -0
  137. package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
  138. package/node/wrappers/services/transaction-service/TransactionService.ts +29 -0
  139. package/node/wrappers/util/link-resolver.d.ts +127 -0
  140. package/node/wrappers/util/link-resolver.js +378 -0
  141. package/node/wrappers/util/link-resolver.js.map +1 -0
  142. package/node/wrappers/util/link-resolver.test.d.ts +1 -0
  143. package/node/wrappers/util/link-resolver.test.js +349 -0
  144. package/node/wrappers/util/link-resolver.test.js.map +1 -0
  145. package/node/wrappers/util/link-resolver.test.ts +402 -0
  146. package/node/wrappers/util/link-resolver.ts +448 -0
  147. package/package.json +1 -1
  148. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js +0 -38
  149. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js.map +0 -1
  150. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.ts +0 -32
  151. /package/node/wrappers/services/{security-service/SecurityService.searchByUuid.test.d.ts → searchWithSecurities.test.d.ts} +0 -0
@@ -0,0 +1,349 @@
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
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const link_resolver_1 = __importDefault(require("./link-resolver"));
16
+ const Price_1 = __importDefault(require("../models/price/Price"));
17
+ const uuid_1 = require("../models/utils/uuid");
18
+ const security_pb_1 = require("../../fintekkers/models/security/security_pb");
19
+ const price_pb_1 = require("../../fintekkers/models/price/price_pb");
20
+ const decimal_value_pb_1 = require("../../fintekkers/models/util/decimal_value_pb");
21
+ const identifier_pb_1 = require("../../fintekkers/models/security/identifier/identifier_pb");
22
+ const local_timestamp_pb_1 = require("../../fintekkers/models/util/local_timestamp_pb");
23
+ const timestamp_pb_1 = require("google-protobuf/google/protobuf/timestamp_pb");
24
+ const query_security_response_pb_1 = require("../../fintekkers/requests/security/query_security_response_pb");
25
+ const query_portfolio_response_pb_1 = require("../../fintekkers/requests/portfolio/query_portfolio_response_pb");
26
+ function newCallLog() {
27
+ return { count: 0, uuids: [], asOfSeconds: [] };
28
+ }
29
+ // Minimal mock for the security gRPC client. The LinkResolver only calls
30
+ // `getByIds`; we node-style invoke the callback with a fake response built
31
+ // from a pre-canned UUID → SecurityProto map. The mock also records each
32
+ // call's as_of (in seconds since epoch, or null if unset) so tests can
33
+ // assert per-bucket RPC behavior.
34
+ function mockSecurityClient(store, callLog) {
35
+ return {
36
+ getByIds: (request, callback) => {
37
+ var _a, _b;
38
+ const uuidProtos = request.getUuidsList();
39
+ const requestedUuids = uuidProtos.map((u) => uuid_1.UUID.fromU8Array(u.getRawUuid_asU8()).toString());
40
+ callLog.count += 1;
41
+ callLog.uuids.push(requestedUuids);
42
+ const asOf = request.getAsOf();
43
+ callLog.asOfSeconds.push((_b = (_a = asOf === null || asOf === void 0 ? void 0 : asOf.getTimestamp()) === null || _a === void 0 ? void 0 : _a.getSeconds()) !== null && _b !== void 0 ? _b : null);
44
+ const response = new query_security_response_pb_1.QuerySecurityResponseProto();
45
+ const found = [];
46
+ for (const u of requestedUuids) {
47
+ const proto = store.get(u);
48
+ if (proto)
49
+ found.push(proto);
50
+ }
51
+ response.setSecurityResponseList(found);
52
+ // Schedule async like a real gRPC client would.
53
+ setImmediate(() => callback(null, response));
54
+ },
55
+ };
56
+ }
57
+ function mockPortfolioClient(store, callLog) {
58
+ return {
59
+ getByIds: (request, callback) => {
60
+ var _a, _b;
61
+ const uuidProtos = request.getUuidsList();
62
+ const requestedUuids = uuidProtos.map((u) => uuid_1.UUID.fromU8Array(u.getRawUuid_asU8()).toString());
63
+ callLog.count += 1;
64
+ callLog.uuids.push(requestedUuids);
65
+ const asOf = request.getAsOf();
66
+ callLog.asOfSeconds.push((_b = (_a = asOf === null || asOf === void 0 ? void 0 : asOf.getTimestamp()) === null || _a === void 0 ? void 0 : _a.getSeconds()) !== null && _b !== void 0 ? _b : null);
67
+ const response = new query_portfolio_response_pb_1.QueryPortfolioResponseProto();
68
+ const found = [];
69
+ for (const u of requestedUuids) {
70
+ const proto = store.get(u);
71
+ if (proto)
72
+ found.push(proto);
73
+ }
74
+ response.setPortfolioResponseList(found);
75
+ setImmediate(() => callback(null, response));
76
+ },
77
+ };
78
+ }
79
+ function makeAsOf(epochSeconds) {
80
+ const ts = new timestamp_pb_1.Timestamp();
81
+ ts.setSeconds(epochSeconds);
82
+ ts.setNanos(0);
83
+ const lt = new local_timestamp_pb_1.LocalTimestampProto();
84
+ lt.setTimestamp(ts);
85
+ lt.setTimeZone('UTC');
86
+ return lt;
87
+ }
88
+ function fullSecurity(uuid, issuerName) {
89
+ const proto = new security_pb_1.SecurityProto();
90
+ proto.setObjectClass('Security');
91
+ proto.setVersion('0.0.1');
92
+ proto.setUuid(uuid.toUUIDProto());
93
+ proto.setIsLink(false);
94
+ proto.setIssuerName(issuerName);
95
+ const ident = new identifier_pb_1.IdentifierProto();
96
+ ident.setIdentifierValue(`TICKER-${issuerName}`);
97
+ proto.setIdentifier(ident);
98
+ return proto;
99
+ }
100
+ function linkPrice(securityUuid, priceValue, asOf) {
101
+ const linkSec = new security_pb_1.SecurityProto();
102
+ linkSec.setUuid(securityUuid.toUUIDProto());
103
+ linkSec.setIsLink(true);
104
+ if (asOf)
105
+ linkSec.setAsOf(asOf);
106
+ const priceProto = new price_pb_1.PriceProto();
107
+ priceProto.setObjectClass('Price');
108
+ priceProto.setVersion('0.0.1');
109
+ priceProto.setUuid(uuid_1.UUID.random().toUUIDProto());
110
+ priceProto.setSecurity(linkSec);
111
+ const dv = new decimal_value_pb_1.DecimalValueProto();
112
+ dv.setArbitraryPrecisionValue(priceValue);
113
+ priceProto.setPrice(dv);
114
+ return new Price_1.default(priceProto);
115
+ }
116
+ describe('LinkResolver', () => {
117
+ test('bulk resolveSecurities dedupes UUIDs (5 prices, 3 unique → 1 RPC, 3 UUIDs)', () => __awaiter(void 0, void 0, void 0, function* () {
118
+ const uuidA = uuid_1.UUID.random();
119
+ const uuidB = uuid_1.UUID.random();
120
+ const uuidC = uuid_1.UUID.random();
121
+ const store = new Map([
122
+ [uuidA.toString(), fullSecurity(uuidA, 'AAPL')],
123
+ [uuidB.toString(), fullSecurity(uuidB, 'MSFT')],
124
+ [uuidC.toString(), fullSecurity(uuidC, 'GOOG')],
125
+ ]);
126
+ const callLog = newCallLog();
127
+ const resolver = new link_resolver_1.default({
128
+ securityClient: mockSecurityClient(store, callLog),
129
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
130
+ });
131
+ const prices = [
132
+ linkPrice(uuidA, '100'),
133
+ linkPrice(uuidA, '101'),
134
+ linkPrice(uuidB, '200'),
135
+ linkPrice(uuidA, '102'),
136
+ linkPrice(uuidC, '300'),
137
+ ];
138
+ yield resolver.resolveSecurities(prices);
139
+ expect(callLog.count).toBe(1);
140
+ expect(callLog.uuids[0].length).toBe(3);
141
+ expect(new Set(callLog.uuids[0])).toEqual(new Set([uuidA.toString(), uuidB.toString(), uuidC.toString()]));
142
+ // Each price's embedded security is now hydrated.
143
+ for (const p of prices) {
144
+ expect(p.proto.getSecurity().getIsLink()).toBe(false);
145
+ expect(p.proto.getSecurity().getIssuerName().length).toBeGreaterThan(0);
146
+ }
147
+ }));
148
+ test('cache hit: second getSecurity call for the same UUID does not re-RPC', () => __awaiter(void 0, void 0, void 0, function* () {
149
+ const uuid = uuid_1.UUID.random();
150
+ const store = new Map([
151
+ [uuid.toString(), fullSecurity(uuid, 'AAPL')],
152
+ ]);
153
+ const callLog = newCallLog();
154
+ const resolver = new link_resolver_1.default({
155
+ securityClient: mockSecurityClient(store, callLog),
156
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
157
+ });
158
+ const sec1 = yield resolver.getSecurity(uuid);
159
+ const sec2 = yield resolver.getSecurity(uuid);
160
+ expect(callLog.count).toBe(1);
161
+ expect(sec1.getIssuerName()).toBe('AAPL');
162
+ expect(sec2.getIssuerName()).toBe('AAPL');
163
+ }));
164
+ test('concurrent same-UUID requests collapse to one RPC', () => __awaiter(void 0, void 0, void 0, function* () {
165
+ const uuid = uuid_1.UUID.random();
166
+ const store = new Map([
167
+ [uuid.toString(), fullSecurity(uuid, 'AAPL')],
168
+ ]);
169
+ const callLog = newCallLog();
170
+ const resolver = new link_resolver_1.default({
171
+ securityClient: mockSecurityClient(store, callLog),
172
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
173
+ });
174
+ // Fire N parallel calls for the same UUID before any resolves.
175
+ const results = yield Promise.all([
176
+ resolver.getSecurity(uuid),
177
+ resolver.getSecurity(uuid),
178
+ resolver.getSecurity(uuid),
179
+ resolver.getSecurity(uuid),
180
+ ]);
181
+ expect(callLog.count).toBe(1);
182
+ for (const r of results)
183
+ expect(r.getIssuerName()).toBe('AAPL');
184
+ }));
185
+ test('caching disabled (cacheSize=0) re-RPCs every call', () => __awaiter(void 0, void 0, void 0, function* () {
186
+ const uuid = uuid_1.UUID.random();
187
+ const store = new Map([
188
+ [uuid.toString(), fullSecurity(uuid, 'AAPL')],
189
+ ]);
190
+ const callLog = newCallLog();
191
+ const resolver = new link_resolver_1.default({
192
+ cacheSize: 0,
193
+ securityClient: mockSecurityClient(store, callLog),
194
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
195
+ });
196
+ yield resolver.getSecurity(uuid);
197
+ yield resolver.getSecurity(uuid);
198
+ expect(callLog.count).toBe(2);
199
+ }));
200
+ test('non-link items pass through unchanged (resolveSecurities is a no-op for them)', () => __awaiter(void 0, void 0, void 0, function* () {
201
+ const callLog = newCallLog();
202
+ const resolver = new link_resolver_1.default({
203
+ securityClient: mockSecurityClient(new Map(), callLog),
204
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
205
+ });
206
+ // Build a Price whose embedded Security is NOT a link (full entity).
207
+ const fullSec = fullSecurity(uuid_1.UUID.random(), 'AAPL');
208
+ const priceProto = new price_pb_1.PriceProto();
209
+ priceProto.setObjectClass('Price');
210
+ priceProto.setUuid(uuid_1.UUID.random().toUUIDProto());
211
+ priceProto.setSecurity(fullSec);
212
+ const dv = new decimal_value_pb_1.DecimalValueProto();
213
+ dv.setArbitraryPrecisionValue('100');
214
+ priceProto.setPrice(dv);
215
+ const price = new Price_1.default(priceProto);
216
+ yield resolver.resolveSecurities([price]);
217
+ expect(callLog.count).toBe(0);
218
+ expect(price.proto.getSecurity().getIssuerName()).toBe('AAPL');
219
+ }));
220
+ test('resolveSecurities skips items missing security', () => __awaiter(void 0, void 0, void 0, function* () {
221
+ const callLog = newCallLog();
222
+ const resolver = new link_resolver_1.default({
223
+ securityClient: mockSecurityClient(new Map(), callLog),
224
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
225
+ });
226
+ const priceProto = new price_pb_1.PriceProto();
227
+ priceProto.setObjectClass('Price');
228
+ priceProto.setUuid(uuid_1.UUID.random().toUUIDProto());
229
+ // No security set on this price.
230
+ const dv = new decimal_value_pb_1.DecimalValueProto();
231
+ dv.setArbitraryPrecisionValue('100');
232
+ priceProto.setPrice(dv);
233
+ const price = new Price_1.default(priceProto);
234
+ yield resolver.resolveSecurities([price]);
235
+ expect(callLog.count).toBe(0);
236
+ }));
237
+ test('cache cross-call: a second resolveSecurities call reuses the cache from the first', () => __awaiter(void 0, void 0, void 0, function* () {
238
+ const uuidA = uuid_1.UUID.random();
239
+ const uuidB = uuid_1.UUID.random();
240
+ const store = new Map([
241
+ [uuidA.toString(), fullSecurity(uuidA, 'AAPL')],
242
+ [uuidB.toString(), fullSecurity(uuidB, 'MSFT')],
243
+ ]);
244
+ const callLog = newCallLog();
245
+ const resolver = new link_resolver_1.default({
246
+ securityClient: mockSecurityClient(store, callLog),
247
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
248
+ });
249
+ // First call: 2 unique UUIDs → 1 RPC fetching both.
250
+ yield resolver.resolveSecurities([linkPrice(uuidA, '1'), linkPrice(uuidB, '2')]);
251
+ expect(callLog.count).toBe(1);
252
+ expect(callLog.uuids[0].length).toBe(2);
253
+ // Second call: both UUIDs already cached → 0 additional RPCs.
254
+ yield resolver.resolveSecurities([linkPrice(uuidA, '3'), linkPrice(uuidB, '4')]);
255
+ expect(callLog.count).toBe(1);
256
+ }));
257
+ // ---------- as_of-aware behavior (per is_link_pattern.md addendum) ----------
258
+ test('link without as_of → request omits as_of (server returns latest)', () => __awaiter(void 0, void 0, void 0, function* () {
259
+ const uuid = uuid_1.UUID.random();
260
+ const store = new Map([
261
+ [uuid.toString(), fullSecurity(uuid, 'AAPL')],
262
+ ]);
263
+ const callLog = newCallLog();
264
+ const resolver = new link_resolver_1.default({
265
+ securityClient: mockSecurityClient(store, callLog),
266
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
267
+ });
268
+ yield resolver.resolveSecurities([linkPrice(uuid, '1')]);
269
+ expect(callLog.count).toBe(1);
270
+ expect(callLog.asOfSeconds[0]).toBeNull();
271
+ }));
272
+ test('link with as_of → request carries that as_of', () => __awaiter(void 0, void 0, void 0, function* () {
273
+ const uuid = uuid_1.UUID.random();
274
+ const store = new Map([
275
+ [uuid.toString(), fullSecurity(uuid, 'AAPL')],
276
+ ]);
277
+ const callLog = newCallLog();
278
+ const resolver = new link_resolver_1.default({
279
+ securityClient: mockSecurityClient(store, callLog),
280
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
281
+ });
282
+ const t1 = makeAsOf(1700000000);
283
+ yield resolver.resolveSecurities([linkPrice(uuid, '1', t1)]);
284
+ expect(callLog.count).toBe(1);
285
+ expect(callLog.asOfSeconds[0]).toBe(1700000000);
286
+ }));
287
+ test('two as_of buckets for the same UUID → 2 separate RPCs (one per bucket)', () => __awaiter(void 0, void 0, void 0, function* () {
288
+ const uuid = uuid_1.UUID.random();
289
+ const store = new Map([
290
+ [uuid.toString(), fullSecurity(uuid, 'AAPL')],
291
+ ]);
292
+ const callLog = newCallLog();
293
+ const resolver = new link_resolver_1.default({
294
+ securityClient: mockSecurityClient(store, callLog),
295
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
296
+ });
297
+ const t1 = makeAsOf(1700000000);
298
+ const t2 = makeAsOf(1800000000);
299
+ yield resolver.resolveSecurities([
300
+ linkPrice(uuid, '1', t1),
301
+ linkPrice(uuid, '2', t2),
302
+ ]);
303
+ expect(callLog.count).toBe(2);
304
+ expect(new Set(callLog.asOfSeconds)).toEqual(new Set([1700000000, 1800000000]));
305
+ }));
306
+ test('same as_of for the same UUID → still 1 RPC (proper bucket dedupe)', () => __awaiter(void 0, void 0, void 0, function* () {
307
+ const uuid = uuid_1.UUID.random();
308
+ const store = new Map([
309
+ [uuid.toString(), fullSecurity(uuid, 'AAPL')],
310
+ ]);
311
+ const callLog = newCallLog();
312
+ const resolver = new link_resolver_1.default({
313
+ securityClient: mockSecurityClient(store, callLog),
314
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
315
+ });
316
+ const t1a = makeAsOf(1700000000);
317
+ const t1b = makeAsOf(1700000000); // same moment, different proto instance
318
+ yield resolver.resolveSecurities([
319
+ linkPrice(uuid, '1', t1a),
320
+ linkPrice(uuid, '2', t1b),
321
+ ]);
322
+ expect(callLog.count).toBe(1);
323
+ expect(callLog.uuids[0]).toEqual([uuid.toString()]);
324
+ }));
325
+ test('cache key includes as_of: latest cached does NOT serve a t1 lookup, and vice versa', () => __awaiter(void 0, void 0, void 0, function* () {
326
+ const uuid = uuid_1.UUID.random();
327
+ const store = new Map([
328
+ [uuid.toString(), fullSecurity(uuid, 'AAPL')],
329
+ ]);
330
+ const callLog = newCallLog();
331
+ const resolver = new link_resolver_1.default({
332
+ securityClient: mockSecurityClient(store, callLog),
333
+ portfolioClient: mockPortfolioClient(new Map(), newCallLog()),
334
+ });
335
+ const t1 = makeAsOf(1700000000);
336
+ // First: latest. RPC fired.
337
+ yield resolver.getSecurity(uuid);
338
+ expect(callLog.count).toBe(1);
339
+ expect(callLog.asOfSeconds[0]).toBeNull();
340
+ // Second: as_of=t1. Should NOT be served by the "latest" cache → another RPC.
341
+ yield resolver.getSecurity(uuid, t1);
342
+ expect(callLog.count).toBe(2);
343
+ expect(callLog.asOfSeconds[1]).toBe(1700000000);
344
+ // Third: same (uuid, t1) → cache hit, no new RPC.
345
+ yield resolver.getSecurity(uuid, makeAsOf(1700000000));
346
+ expect(callLog.count).toBe(2);
347
+ }));
348
+ });
349
+ //# sourceMappingURL=link-resolver.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-resolver.test.js","sourceRoot":"","sources":["link-resolver.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oEAA2C;AAC3C,kEAA0C;AAC1C,+CAA4C;AAE5C,8EAA6E;AAE7E,qEAAoE;AACpE,oFAAkF;AAClF,6FAA4F;AAC5F,wFAAsF;AACtF,+EAAyE;AACzE,8GAA2G;AAE3G,iHAA8G;AAS9G,SAAS,UAAU;IACjB,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;AAClD,CAAC;AAED,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,uEAAuE;AACvE,kCAAkC;AAClC,SAAS,kBAAkB,CAAC,KAAiC,EAAE,OAAgB;IAC7E,OAAO;QACL,QAAQ,EAAE,CACR,OAAkC,EAClC,QAA2E,EAC3E,EAAE;;YACF,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;YAC1C,MAAM,cAAc,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAI,CAAC,WAAW,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;YAC/F,OAAO,CAAC,KAAK,IAAI,CAAC,CAAC;YACnB,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACnC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;YAC/B,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,MAAA,MAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,YAAY,EAAE,0CAAE,UAAU,EAAE,mCAAI,IAAI,CAAC,CAAC;YAErE,MAAM,QAAQ,GAAG,IAAI,uDAA0B,EAAE,C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