@fintekkers/ledger-models 0.1.130 → 0.1.132

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 (134) 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.js +96 -90
  20. package/node/fintekkers/models/security/security_quantity_type_pb.js +7 -1
  21. package/node/fintekkers/models/security/security_type_pb.js +7 -1
  22. package/node/fintekkers/models/security/tenor_pb.js +15 -9
  23. package/node/fintekkers/models/security/tenor_type_pb.js +7 -1
  24. package/node/fintekkers/models/strategy/strategy_allocation_pb.js +19 -13
  25. package/node/fintekkers/models/strategy/strategy_pb.js +20 -14
  26. package/node/fintekkers/models/transaction/transaction_pb.js +30 -24
  27. package/node/fintekkers/models/transaction/transaction_type_pb.js +7 -1
  28. package/node/fintekkers/models/util/api/api_key_pb.js +16 -10
  29. package/node/fintekkers/models/util/currency_grpc_pb.js +1 -0
  30. package/node/fintekkers/models/util/currency_pb.js +10 -4
  31. package/node/fintekkers/models/util/date_range_pb.js +14 -8
  32. package/node/fintekkers/models/util/decimal_value_pb.js +10 -4
  33. package/node/fintekkers/models/util/endpoint_pb.js +13 -7
  34. package/node/fintekkers/models/util/local_date_pb.js +11 -5
  35. package/node/fintekkers/models/util/local_timestamp_pb.js +11 -5
  36. package/node/fintekkers/models/util/lock/node_partition_pb.js +15 -9
  37. package/node/fintekkers/models/util/lock/node_state_pb.js +16 -10
  38. package/node/fintekkers/models/util/uuid_pb.js +9 -3
  39. package/node/fintekkers/models/valuation/cashflow_grpc_pb.js +1 -0
  40. package/node/fintekkers/models/valuation/cashflow_pb.js +13 -7
  41. package/node/fintekkers/requests/index_composition/create_index_composition_request_grpc_pb.js +1 -0
  42. package/node/fintekkers/requests/index_composition/create_index_composition_request_pb.js +22 -16
  43. package/node/fintekkers/requests/index_composition/get_index_composition_request_grpc_pb.js +1 -0
  44. package/node/fintekkers/requests/index_composition/get_index_composition_request_pb.js +22 -16
  45. package/node/fintekkers/requests/portfolio/create_portfolio_request_pb.js +13 -7
  46. package/node/fintekkers/requests/portfolio/create_portfolio_response_pb.js +14 -8
  47. package/node/fintekkers/requests/portfolio/query_portfolio_request_pb.js +17 -11
  48. package/node/fintekkers/requests/portfolio/query_portfolio_response_pb.js +14 -8
  49. package/node/fintekkers/requests/position/query_position_request_pb.js +27 -15
  50. package/node/fintekkers/requests/position/query_position_response_pb.js +16 -10
  51. package/node/fintekkers/requests/price/create_price_request_pb.js +13 -7
  52. package/node/fintekkers/requests/price/create_price_response_pb.js +14 -8
  53. package/node/fintekkers/requests/price/query_price_request_pb.js +18 -12
  54. package/node/fintekkers/requests/price/query_price_response_pb.js +14 -8
  55. package/node/fintekkers/requests/security/create_security_request_pb.js +13 -7
  56. package/node/fintekkers/requests/security/create_security_response_pb.js +15 -9
  57. package/node/fintekkers/requests/security/get_field_values_request_pb.js +13 -7
  58. package/node/fintekkers/requests/security/get_field_values_response_pb.js +13 -7
  59. package/node/fintekkers/requests/security/get_fields_response_pb.js +17 -8
  60. package/node/fintekkers/requests/security/query_security_request_pb.js +17 -11
  61. package/node/fintekkers/requests/security/query_security_response_pb.js +15 -9
  62. package/node/fintekkers/requests/transaction/create_transaction_request_pb.js +13 -7
  63. package/node/fintekkers/requests/transaction/create_transaction_response_pb.js +14 -8
  64. package/node/fintekkers/requests/transaction/query_transaction_request_pb.js +16 -10
  65. package/node/fintekkers/requests/transaction/query_transaction_response_pb.js +15 -9
  66. package/node/fintekkers/requests/util/delete_request_grpc_pb.js +1 -0
  67. package/node/fintekkers/requests/util/delete_request_pb.js +34 -28
  68. package/node/fintekkers/requests/util/errors/error_pb.js +13 -7
  69. package/node/fintekkers/requests/util/errors/message_pb.js +12 -6
  70. package/node/fintekkers/requests/util/errors/summary_pb.js +10 -4
  71. package/node/fintekkers/requests/util/lock/lock_request_pb.js +14 -8
  72. package/node/fintekkers/requests/util/lock/lock_response_pb.js +15 -9
  73. package/node/fintekkers/requests/util/operation_pb.js +7 -1
  74. package/node/fintekkers/requests/valuation/curve_request_grpc_pb.js +1 -0
  75. package/node/fintekkers/requests/valuation/curve_request_pb.d.ts +12 -0
  76. package/node/fintekkers/requests/valuation/curve_request_pb.js +125 -14
  77. package/node/fintekkers/requests/valuation/curve_response_grpc_pb.js +1 -0
  78. package/node/fintekkers/requests/valuation/curve_response_pb.js +21 -15
  79. package/node/fintekkers/requests/valuation/product_inputs.test.d.ts +6 -0
  80. package/node/fintekkers/requests/valuation/product_inputs.test.js +146 -0
  81. package/node/fintekkers/requests/valuation/product_inputs.test.js.map +1 -0
  82. package/node/fintekkers/requests/valuation/product_inputs_grpc_pb.js +1 -0
  83. package/node/fintekkers/requests/valuation/product_inputs_pb.d.ts +42 -0
  84. package/node/fintekkers/requests/valuation/product_inputs_pb.js +360 -27
  85. package/node/fintekkers/requests/valuation/valuation_request_pb.js +25 -16
  86. package/node/fintekkers/requests/valuation/valuation_response_pb.js +16 -10
  87. package/node/fintekkers/services/index-composition-service/index_composition_service_grpc_pb.js +14 -14
  88. package/node/fintekkers/services/index-composition-service/index_composition_service_pb.js +7 -1
  89. package/node/fintekkers/services/lock-service/lock_service_grpc_pb.js +23 -23
  90. package/node/fintekkers/services/lock-service/lock_service_pb.js +21 -15
  91. package/node/fintekkers/services/portfolio-service/portfolio_service_grpc_pb.js +8 -8
  92. package/node/fintekkers/services/portfolio-service/portfolio_service_pb.js +7 -1
  93. package/node/fintekkers/services/position-service/position_service_grpc_pb.js +10 -10
  94. package/node/fintekkers/services/position-service/position_service_pb.js +7 -1
  95. package/node/fintekkers/services/price-service/price_service_grpc_pb.js +6 -6
  96. package/node/fintekkers/services/price-service/price_service_pb.js +7 -1
  97. package/node/fintekkers/services/security-service/security_service_grpc_pb.js +12 -12
  98. package/node/fintekkers/services/security-service/security_service_pb.js +7 -1
  99. package/node/fintekkers/services/transaction-service/transaction_service_grpc_pb.js +11 -11
  100. package/node/fintekkers/services/transaction-service/transaction_service_pb.js +7 -1
  101. package/node/fintekkers/services/valuation-service/valuation_service_grpc_pb.js +5 -5
  102. package/node/fintekkers/services/valuation-service/valuation_service_pb.js +7 -1
  103. package/node/wrappers/models/price/Price.d.ts +5 -0
  104. package/node/wrappers/models/price/Price.js +7 -0
  105. package/node/wrappers/models/price/Price.js.map +1 -1
  106. package/node/wrappers/models/price/Price.ts +8 -0
  107. package/node/wrappers/models/security/security.d.ts +6 -0
  108. package/node/wrappers/models/security/security.js +8 -0
  109. package/node/wrappers/models/security/security.js.map +1 -1
  110. package/node/wrappers/models/security/security.ts +9 -0
  111. package/node/wrappers/services/price-service/PriceService.d.ts +19 -0
  112. package/node/wrappers/services/price-service/PriceService.js +26 -0
  113. package/node/wrappers/services/price-service/PriceService.js.map +1 -1
  114. package/node/wrappers/services/price-service/PriceService.ts +29 -0
  115. package/node/wrappers/services/searchWithSecurities.test.js +125 -0
  116. package/node/wrappers/services/searchWithSecurities.test.js.map +1 -0
  117. package/node/wrappers/services/searchWithSecurities.test.ts +103 -0
  118. package/node/wrappers/services/transaction-service/TransactionService.d.ts +14 -0
  119. package/node/wrappers/services/transaction-service/TransactionService.js +25 -0
  120. package/node/wrappers/services/transaction-service/TransactionService.js.map +1 -1
  121. package/node/wrappers/services/transaction-service/TransactionService.ts +29 -0
  122. package/node/wrappers/util/link-resolver.d.ts +127 -0
  123. package/node/wrappers/util/link-resolver.js +378 -0
  124. package/node/wrappers/util/link-resolver.js.map +1 -0
  125. package/node/wrappers/util/link-resolver.test.d.ts +1 -0
  126. package/node/wrappers/util/link-resolver.test.js +349 -0
  127. package/node/wrappers/util/link-resolver.test.js.map +1 -0
  128. package/node/wrappers/util/link-resolver.test.ts +402 -0
  129. package/node/wrappers/util/link-resolver.ts +448 -0
  130. package/package.json +1 -1
  131. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js +0 -38
  132. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.js.map +0 -1
  133. package/node/wrappers/services/security-service/SecurityService.searchByUuid.test.ts +0 -32
  134. /package/node/wrappers/services/{security-service/SecurityService.searchByUuid.test.d.ts → searchWithSecurities.test.d.ts} +0 -0
@@ -0,0 +1,378 @@
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 util_1 = require("util");
16
+ const security_service_grpc_pb_1 = require("../../fintekkers/services/security-service/security_service_grpc_pb");
17
+ const portfolio_service_grpc_pb_1 = require("../../fintekkers/services/portfolio-service/portfolio_service_grpc_pb");
18
+ const query_security_request_pb_1 = require("../../fintekkers/requests/security/query_security_request_pb");
19
+ const query_portfolio_request_pb_1 = require("../../fintekkers/requests/portfolio/query_portfolio_request_pb");
20
+ const security_1 = __importDefault(require("../models/security/security"));
21
+ const portfolio_1 = __importDefault(require("../models/portfolio/portfolio"));
22
+ const uuid_1 = require("../models/utils/uuid");
23
+ const requestcontext_1 = __importDefault(require("../models/utils/requestcontext"));
24
+ /**
25
+ * Tiny LRU. Map keeps insertion order; on get-hit we delete + re-insert
26
+ * to bump to the end (most recently used). On overflow we drop the
27
+ * oldest entry (first key in the Map). Avoids pulling in lru-cache as a
28
+ * dependency for ~30 lines of logic.
29
+ */
30
+ class TinyLRU {
31
+ constructor(maxSize, ttlMs) {
32
+ this.maxSize = maxSize;
33
+ this.ttlMs = ttlMs;
34
+ this.map = new Map();
35
+ }
36
+ get(key) {
37
+ if (this.maxSize === 0)
38
+ return undefined;
39
+ const entry = this.map.get(key);
40
+ if (!entry)
41
+ return undefined;
42
+ if (this.ttlMs !== undefined && Date.now() - entry.insertedAt > this.ttlMs) {
43
+ this.map.delete(key);
44
+ return undefined;
45
+ }
46
+ // Bump to most-recently-used.
47
+ this.map.delete(key);
48
+ this.map.set(key, entry);
49
+ return entry.value;
50
+ }
51
+ set(key, value) {
52
+ if (this.maxSize === 0)
53
+ return;
54
+ if (this.map.has(key))
55
+ this.map.delete(key);
56
+ this.map.set(key, { value, insertedAt: Date.now() });
57
+ while (this.map.size > this.maxSize) {
58
+ const oldest = this.map.keys().next().value;
59
+ if (oldest === undefined)
60
+ break;
61
+ this.map.delete(oldest);
62
+ }
63
+ }
64
+ size() {
65
+ return this.map.size;
66
+ }
67
+ clear() {
68
+ this.map.clear();
69
+ }
70
+ }
71
+ /**
72
+ * Stable serialization of a LocalTimestampProto for use in cache keys
73
+ * and as_of-bucket grouping. Uses the proto's binary form (Uint8Array
74
+ * → base64). Returns the literal "latest" when as_of is undefined so
75
+ * unset and explicit-undefined collapse to the same bucket.
76
+ *
77
+ * Two LocalTimestampProto instances representing the same moment will
78
+ * produce the same key as long as the underlying nanos/seconds match —
79
+ * proto3 binary encoding is canonical for unset fields.
80
+ */
81
+ function asOfKey(asOf) {
82
+ if (!asOf)
83
+ return 'latest';
84
+ // serializeBinary returns Uint8Array.
85
+ const bytes = asOf.serializeBinary();
86
+ return Buffer.from(bytes).toString('base64');
87
+ }
88
+ class LinkResolver {
89
+ constructor(opts = {}) {
90
+ var _a;
91
+ // Concurrent-call dedupe: a UUID currently being fetched maps to the
92
+ // promise the *first* caller is awaiting. Subsequent callers for the
93
+ // same UUID receive that same promise.
94
+ this.securityInFlight = new Map();
95
+ this.portfolioInFlight = new Map();
96
+ const cacheSize = (_a = opts.cacheSize) !== null && _a !== void 0 ? _a : 1000;
97
+ const ttlMs = opts.ttlMs;
98
+ this.securityCache = new TinyLRU(cacheSize, ttlMs);
99
+ this.portfolioCache = new TinyLRU(cacheSize, ttlMs);
100
+ if (opts.securityClient) {
101
+ this.securityClient = opts.securityClient;
102
+ }
103
+ else if (opts.apiKey) {
104
+ const { credentials, interceptors } = requestcontext_1.default.getAuthenticatedClientOptions(opts.apiKey);
105
+ this.securityClient = new security_service_grpc_pb_1.SecurityClient(requestcontext_1.default.apiURL, credentials, { interceptors });
106
+ }
107
+ else {
108
+ this.securityClient = new security_service_grpc_pb_1.SecurityClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
109
+ }
110
+ if (opts.portfolioClient) {
111
+ this.portfolioClient = opts.portfolioClient;
112
+ }
113
+ else if (opts.apiKey) {
114
+ const { credentials, interceptors } = requestcontext_1.default.getAuthenticatedClientOptions(opts.apiKey);
115
+ this.portfolioClient = new portfolio_service_grpc_pb_1.PortfolioClient(requestcontext_1.default.apiURL, credentials, { interceptors });
116
+ }
117
+ else {
118
+ this.portfolioClient = new portfolio_service_grpc_pb_1.PortfolioClient(requestcontext_1.default.apiURL, requestcontext_1.default.apiCredentials);
119
+ }
120
+ }
121
+ /**
122
+ * Resolve a single SecurityProto by UUID. If `asOf` is supplied, fetch
123
+ * the version of the entity as of that timestamp; otherwise fetch the
124
+ * latest. Cached + concurrent-deduped on the (uuid, asOf) pair.
125
+ * Throws if the server doesn't return the UUID (no silent null).
126
+ */
127
+ getSecurity(uuid, asOf) {
128
+ return __awaiter(this, void 0, void 0, function* () {
129
+ const proto = yield this.fetchSecurityProto(uuid, asOf);
130
+ return security_1.default.create(proto);
131
+ });
132
+ }
133
+ /**
134
+ * Resolve a single PortfolioProto by UUID, optionally as of `asOf`.
135
+ * Cached + concurrent-deduped on (uuid, asOf).
136
+ */
137
+ getPortfolio(uuid, asOf) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ const proto = yield this.fetchPortfolioProto(uuid, asOf);
140
+ return new portfolio_1.default(proto);
141
+ });
142
+ }
143
+ /**
144
+ * Walk `items`, find the ones whose embedded security is `is_link=true`,
145
+ * batch-fetch the unique (uuid, as_of) pairs (grouped by as_of so each
146
+ * GetByIds RPC carries one timestamp), and mutate each item's proto in
147
+ * place so subsequent `item.getSecurity()` calls return the full entity.
148
+ * Returns the same array for chaining.
149
+ *
150
+ * Honors per-link `as_of`: if the embedded sub-message has `as_of` set,
151
+ * the resolver fetches the version of the entity at that timestamp,
152
+ * not the latest.
153
+ *
154
+ * `T` is structural: anything with a `proto` field that exposes
155
+ * `getSecurity()` / `setSecurity()` works (Price, Transaction, etc).
156
+ */
157
+ resolveSecurities(items) {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ if (items.length === 0)
160
+ return items;
161
+ // Group: as_of bucket → (cacheKey → UUID) for items not yet cached.
162
+ const buckets = new Map();
163
+ for (const item of items) {
164
+ const sec = item.proto.getSecurity();
165
+ if (!sec || !sec.getIsLink())
166
+ continue;
167
+ const uuidProto = sec.getUuid();
168
+ if (!uuidProto)
169
+ continue;
170
+ const uuid = uuid_1.UUID.fromU8Array(uuidProto.getRawUuid_asU8());
171
+ const asOf = sec.getAsOf();
172
+ const bucketKey = asOfKey(asOf);
173
+ const cacheKey = `${uuid.toString()}@${bucketKey}`;
174
+ // Skip if already cached for this exact (uuid, as_of).
175
+ if (this.securityCache.get(cacheKey))
176
+ continue;
177
+ let bucket = buckets.get(bucketKey);
178
+ if (!bucket) {
179
+ bucket = new Map();
180
+ buckets.set(bucketKey, bucket);
181
+ }
182
+ if (!bucket.has(cacheKey))
183
+ bucket.set(cacheKey, uuid);
184
+ }
185
+ // One GetByIds RPC per as_of bucket. Fire in parallel.
186
+ yield Promise.all(Array.from(buckets.entries()).map(([bucketKey, uuidMap]) => __awaiter(this, void 0, void 0, function* () {
187
+ // Recover the LocalTimestampProto for this bucket from the first
188
+ // item whose serialized as_of matches. We could store it alongside
189
+ // but it's cheap to re-find.
190
+ const asOf = bucketKey === 'latest' ? undefined : findAsOfForBucket(items, (sec) => sec.getSecurity(), bucketKey);
191
+ const fetched = yield this.batchFetchSecurities(Array.from(uuidMap.values()), asOf);
192
+ for (const proto of fetched) {
193
+ const uuidProto = proto.getUuid();
194
+ if (!uuidProto)
195
+ continue;
196
+ const uuidStr = uuid_1.UUID.fromU8Array(uuidProto.getRawUuid_asU8()).toString();
197
+ this.securityCache.set(`${uuidStr}@${bucketKey}`, proto);
198
+ }
199
+ })));
200
+ // Mutate each item's embedded security in place.
201
+ for (const item of items) {
202
+ const sec = item.proto.getSecurity();
203
+ if (!sec || !sec.getIsLink())
204
+ continue;
205
+ const uuidProto = sec.getUuid();
206
+ if (!uuidProto)
207
+ continue;
208
+ const uuidStr = uuid_1.UUID.fromU8Array(uuidProto.getRawUuid_asU8()).toString();
209
+ const bucketKey = asOfKey(sec.getAsOf());
210
+ const resolved = this.securityCache.get(`${uuidStr}@${bucketKey}`);
211
+ if (resolved)
212
+ item.proto.setSecurity(resolved);
213
+ }
214
+ return items;
215
+ });
216
+ }
217
+ /**
218
+ * Same shape as resolveSecurities, but for embedded PortfolioProto.
219
+ * Honors per-link `as_of` the same way.
220
+ */
221
+ resolvePortfolios(items) {
222
+ return __awaiter(this, void 0, void 0, function* () {
223
+ if (items.length === 0)
224
+ return items;
225
+ const buckets = new Map();
226
+ for (const item of items) {
227
+ const port = item.proto.getPortfolio();
228
+ if (!port || !port.getIsLink())
229
+ continue;
230
+ const uuidProto = port.getUuid();
231
+ if (!uuidProto)
232
+ continue;
233
+ const uuid = uuid_1.UUID.fromU8Array(uuidProto.getRawUuid_asU8());
234
+ const asOf = port.getAsOf();
235
+ const bucketKey = asOfKey(asOf);
236
+ const cacheKey = `${uuid.toString()}@${bucketKey}`;
237
+ if (this.portfolioCache.get(cacheKey))
238
+ continue;
239
+ let bucket = buckets.get(bucketKey);
240
+ if (!bucket) {
241
+ bucket = new Map();
242
+ buckets.set(bucketKey, bucket);
243
+ }
244
+ if (!bucket.has(cacheKey))
245
+ bucket.set(cacheKey, uuid);
246
+ }
247
+ yield Promise.all(Array.from(buckets.entries()).map(([bucketKey, uuidMap]) => __awaiter(this, void 0, void 0, function* () {
248
+ const asOf = bucketKey === 'latest' ? undefined : findAsOfForBucket(items, (it) => it.getPortfolio(), bucketKey);
249
+ const fetched = yield this.batchFetchPortfolios(Array.from(uuidMap.values()), asOf);
250
+ for (const proto of fetched) {
251
+ const uuidProto = proto.getUuid();
252
+ if (!uuidProto)
253
+ continue;
254
+ const uuidStr = uuid_1.UUID.fromU8Array(uuidProto.getRawUuid_asU8()).toString();
255
+ this.portfolioCache.set(`${uuidStr}@${bucketKey}`, proto);
256
+ }
257
+ })));
258
+ for (const item of items) {
259
+ const port = item.proto.getPortfolio();
260
+ if (!port || !port.getIsLink())
261
+ continue;
262
+ const uuidProto = port.getUuid();
263
+ if (!uuidProto)
264
+ continue;
265
+ const uuidStr = uuid_1.UUID.fromU8Array(uuidProto.getRawUuid_asU8()).toString();
266
+ const bucketKey = asOfKey(port.getAsOf());
267
+ const resolved = this.portfolioCache.get(`${uuidStr}@${bucketKey}`);
268
+ if (resolved)
269
+ item.proto.setPortfolio(resolved);
270
+ }
271
+ return items;
272
+ });
273
+ }
274
+ /** Test/debug helper. Not part of the stable API. */
275
+ clearCache() {
276
+ this.securityCache.clear();
277
+ this.portfolioCache.clear();
278
+ this.securityInFlight.clear();
279
+ this.portfolioInFlight.clear();
280
+ }
281
+ // ---------- internals ----------
282
+ fetchSecurityProto(uuid, asOf) {
283
+ return __awaiter(this, void 0, void 0, function* () {
284
+ const key = `${uuid.toString()}@${asOfKey(asOf)}`;
285
+ const cached = this.securityCache.get(key);
286
+ if (cached)
287
+ return cached;
288
+ const inFlight = this.securityInFlight.get(key);
289
+ if (inFlight)
290
+ return inFlight;
291
+ const promise = this.batchFetchSecurities([uuid], asOf).then((protos) => {
292
+ if (protos.length === 0) {
293
+ throw new Error(`Security not found: ${uuid.toString()}@${asOfKey(asOf)}`);
294
+ }
295
+ const proto = protos[0];
296
+ this.securityCache.set(key, proto);
297
+ return proto;
298
+ }).finally(() => {
299
+ this.securityInFlight.delete(key);
300
+ });
301
+ this.securityInFlight.set(key, promise);
302
+ return promise;
303
+ });
304
+ }
305
+ fetchPortfolioProto(uuid, asOf) {
306
+ return __awaiter(this, void 0, void 0, function* () {
307
+ const key = `${uuid.toString()}@${asOfKey(asOf)}`;
308
+ const cached = this.portfolioCache.get(key);
309
+ if (cached)
310
+ return cached;
311
+ const inFlight = this.portfolioInFlight.get(key);
312
+ if (inFlight)
313
+ return inFlight;
314
+ const promise = this.batchFetchPortfolios([uuid], asOf).then((protos) => {
315
+ if (protos.length === 0) {
316
+ throw new Error(`Portfolio not found: ${uuid.toString()}@${asOfKey(asOf)}`);
317
+ }
318
+ const proto = protos[0];
319
+ this.portfolioCache.set(key, proto);
320
+ return proto;
321
+ }).finally(() => {
322
+ this.portfolioInFlight.delete(key);
323
+ });
324
+ this.portfolioInFlight.set(key, promise);
325
+ return promise;
326
+ });
327
+ }
328
+ batchFetchSecurities(uuids, asOf) {
329
+ return __awaiter(this, void 0, void 0, function* () {
330
+ if (uuids.length === 0)
331
+ return [];
332
+ const request = new query_security_request_pb_1.QuerySecurityRequestProto();
333
+ request.setObjectClass('SecurityRequest');
334
+ request.setVersion('0.0.1');
335
+ const uuidProtos = uuids.map((u) => u.toUUIDProto());
336
+ request.setUuidsList(uuidProtos);
337
+ if (asOf)
338
+ request.setAsOf(asOf);
339
+ const getByIdsAsync = (0, util_1.promisify)(this.securityClient.getByIds.bind(this.securityClient));
340
+ const response = (yield getByIdsAsync(request));
341
+ return response.getSecurityResponseList();
342
+ });
343
+ }
344
+ batchFetchPortfolios(uuids, asOf) {
345
+ return __awaiter(this, void 0, void 0, function* () {
346
+ if (uuids.length === 0)
347
+ return [];
348
+ const request = new query_portfolio_request_pb_1.QueryPortfolioRequestProto();
349
+ request.setObjectClass('PortfolioRequest');
350
+ request.setVersion('0.0.1');
351
+ const uuidProtos = uuids.map((u) => u.toUUIDProto());
352
+ request.setUuidsList(uuidProtos);
353
+ if (asOf)
354
+ request.setAsOf(asOf);
355
+ const getByIdsAsync = (0, util_1.promisify)(this.portfolioClient.getByIds.bind(this.portfolioClient));
356
+ const response = (yield getByIdsAsync(request));
357
+ return response.getPortfolioResponseList();
358
+ });
359
+ }
360
+ }
361
+ /**
362
+ * Walk `items` and return the first sub-message's as_of whose serialized
363
+ * key matches `bucketKey`. Used by the bulk resolvers to recover the
364
+ * canonical LocalTimestampProto instance for a bucket.
365
+ */
366
+ function findAsOfForBucket(items, read, bucketKey) {
367
+ for (const item of items) {
368
+ const sub = read(item.proto);
369
+ if (!sub || !sub.getIsLink())
370
+ continue;
371
+ const asOf = sub.getAsOf();
372
+ if (asOfKey(asOf) === bucketKey)
373
+ return asOf;
374
+ }
375
+ return undefined;
376
+ }
377
+ exports.default = LinkResolver;
378
+ //# sourceMappingURL=link-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-resolver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