@adaptic/backend-legacy 0.0.960 → 0.0.962

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 (269) hide show
  1. package/ABTest.cjs +180 -66
  2. package/Account.cjs +180 -66
  3. package/AccountDecisionRecord.cjs +180 -66
  4. package/AccountLinkingRequest.cjs +180 -66
  5. package/Action.cjs +180 -66
  6. package/Alert.cjs +180 -66
  7. package/Allocation.cjs +180 -66
  8. package/AlpacaAccount.cjs +180 -66
  9. package/AnalyticsConfiguration.cjs +180 -66
  10. package/AnalyticsSnapshot.cjs +180 -66
  11. package/Asset.cjs +180 -66
  12. package/AuditLog.cjs +180 -66
  13. package/Authenticator.cjs +180 -66
  14. package/Configuration.cjs +180 -66
  15. package/ConflictEvent.cjs +180 -66
  16. package/ConnectionHealthSnapshot.cjs +180 -66
  17. package/Customer.cjs +180 -66
  18. package/DeadLetterMessage.cjs +180 -66
  19. package/DecisionMemorySummary.cjs +180 -66
  20. package/EconomicEvent.cjs +180 -66
  21. package/EquityBar.cjs +180 -66
  22. package/Event.cjs +180 -66
  23. package/EventSnapshot.cjs +180 -66
  24. package/FeatureImportanceAnalysis.cjs +180 -66
  25. package/InstitutionalFlowSignal.cjs +180 -66
  26. package/InstitutionalHolding.cjs +180 -66
  27. package/InstitutionalSentimentAlerts.cjs +180 -66
  28. package/InstitutionalSentimentErrors.cjs +180 -66
  29. package/InstitutionalSentimentHistory.cjs +180 -66
  30. package/InstitutionalSentimentMetrics.cjs +180 -66
  31. package/InviteToken.cjs +180 -66
  32. package/LinkedProvider.cjs +180 -66
  33. package/LlmConfiguration.cjs +180 -66
  34. package/MLModelVersion.cjs +180 -66
  35. package/MLTrainingData.cjs +180 -66
  36. package/MarketSentiment.cjs +180 -66
  37. package/ModelArtifact.cjs +180 -66
  38. package/ModelVersion.cjs +180 -66
  39. package/ModelVersionArtifact.cjs +180 -66
  40. package/NewsArticle.cjs +180 -66
  41. package/NewsArticleAssetSentiment.cjs +180 -66
  42. package/OptionsContract.cjs +180 -66
  43. package/OptionsGreeksHistory.cjs +180 -66
  44. package/OptionsPosition.cjs +180 -66
  45. package/OptionsPositionEvent.cjs +180 -66
  46. package/OptionsTradeExecution.cjs +180 -66
  47. package/PolicyOverlay.cjs +180 -66
  48. package/PortfolioGreeksHistory.cjs +180 -66
  49. package/ScheduledOptionOrder.cjs +180 -66
  50. package/Session.cjs +180 -66
  51. package/SignalGeneratorMetrics.cjs +180 -66
  52. package/SignalLineage.cjs +180 -66
  53. package/SignalOutcome.cjs +180 -66
  54. package/SignalPriorityQueue.cjs +180 -66
  55. package/SyncEvent.cjs +180 -66
  56. package/SystemAlert.cjs +180 -66
  57. package/Trade.cjs +180 -66
  58. package/TradeAuditEvent.cjs +180 -66
  59. package/TradeExecutionHistory.cjs +180 -66
  60. package/TradeOutcome.cjs +180 -66
  61. package/TradingPolicy.cjs +180 -66
  62. package/User.cjs +180 -66
  63. package/VerificationToken.cjs +180 -66
  64. package/WaitlistEntry.cjs +180 -66
  65. package/client.cjs +131 -9
  66. package/client.d.ts +32 -0
  67. package/esm/ABTest.d.ts.map +1 -1
  68. package/esm/ABTest.js.map +1 -1
  69. package/esm/ABTest.mjs +180 -66
  70. package/esm/Account.d.ts.map +1 -1
  71. package/esm/Account.js.map +1 -1
  72. package/esm/Account.mjs +180 -66
  73. package/esm/AccountDecisionRecord.d.ts.map +1 -1
  74. package/esm/AccountDecisionRecord.js.map +1 -1
  75. package/esm/AccountDecisionRecord.mjs +180 -66
  76. package/esm/AccountLinkingRequest.d.ts.map +1 -1
  77. package/esm/AccountLinkingRequest.js.map +1 -1
  78. package/esm/AccountLinkingRequest.mjs +180 -66
  79. package/esm/Action.d.ts.map +1 -1
  80. package/esm/Action.js.map +1 -1
  81. package/esm/Action.mjs +180 -66
  82. package/esm/Alert.d.ts.map +1 -1
  83. package/esm/Alert.js.map +1 -1
  84. package/esm/Alert.mjs +180 -66
  85. package/esm/Allocation.d.ts.map +1 -1
  86. package/esm/Allocation.js.map +1 -1
  87. package/esm/Allocation.mjs +180 -66
  88. package/esm/AlpacaAccount.d.ts.map +1 -1
  89. package/esm/AlpacaAccount.js.map +1 -1
  90. package/esm/AlpacaAccount.mjs +180 -66
  91. package/esm/AnalyticsConfiguration.d.ts.map +1 -1
  92. package/esm/AnalyticsConfiguration.js.map +1 -1
  93. package/esm/AnalyticsConfiguration.mjs +180 -66
  94. package/esm/AnalyticsSnapshot.d.ts.map +1 -1
  95. package/esm/AnalyticsSnapshot.js.map +1 -1
  96. package/esm/AnalyticsSnapshot.mjs +180 -66
  97. package/esm/Asset.d.ts.map +1 -1
  98. package/esm/Asset.js.map +1 -1
  99. package/esm/Asset.mjs +180 -66
  100. package/esm/AuditLog.d.ts.map +1 -1
  101. package/esm/AuditLog.js.map +1 -1
  102. package/esm/AuditLog.mjs +180 -66
  103. package/esm/Authenticator.d.ts.map +1 -1
  104. package/esm/Authenticator.js.map +1 -1
  105. package/esm/Authenticator.mjs +180 -66
  106. package/esm/Configuration.d.ts.map +1 -1
  107. package/esm/Configuration.js.map +1 -1
  108. package/esm/Configuration.mjs +180 -66
  109. package/esm/ConflictEvent.d.ts.map +1 -1
  110. package/esm/ConflictEvent.js.map +1 -1
  111. package/esm/ConflictEvent.mjs +180 -66
  112. package/esm/ConnectionHealthSnapshot.d.ts.map +1 -1
  113. package/esm/ConnectionHealthSnapshot.js.map +1 -1
  114. package/esm/ConnectionHealthSnapshot.mjs +180 -66
  115. package/esm/Customer.d.ts.map +1 -1
  116. package/esm/Customer.js.map +1 -1
  117. package/esm/Customer.mjs +180 -66
  118. package/esm/DeadLetterMessage.d.ts.map +1 -1
  119. package/esm/DeadLetterMessage.js.map +1 -1
  120. package/esm/DeadLetterMessage.mjs +180 -66
  121. package/esm/DecisionMemorySummary.d.ts.map +1 -1
  122. package/esm/DecisionMemorySummary.js.map +1 -1
  123. package/esm/DecisionMemorySummary.mjs +180 -66
  124. package/esm/EconomicEvent.d.ts.map +1 -1
  125. package/esm/EconomicEvent.js.map +1 -1
  126. package/esm/EconomicEvent.mjs +180 -66
  127. package/esm/EquityBar.d.ts.map +1 -1
  128. package/esm/EquityBar.js.map +1 -1
  129. package/esm/EquityBar.mjs +180 -66
  130. package/esm/Event.d.ts.map +1 -1
  131. package/esm/Event.js.map +1 -1
  132. package/esm/Event.mjs +180 -66
  133. package/esm/EventSnapshot.d.ts.map +1 -1
  134. package/esm/EventSnapshot.js.map +1 -1
  135. package/esm/EventSnapshot.mjs +180 -66
  136. package/esm/FeatureImportanceAnalysis.d.ts.map +1 -1
  137. package/esm/FeatureImportanceAnalysis.js.map +1 -1
  138. package/esm/FeatureImportanceAnalysis.mjs +180 -66
  139. package/esm/InstitutionalFlowSignal.d.ts.map +1 -1
  140. package/esm/InstitutionalFlowSignal.js.map +1 -1
  141. package/esm/InstitutionalFlowSignal.mjs +180 -66
  142. package/esm/InstitutionalHolding.d.ts.map +1 -1
  143. package/esm/InstitutionalHolding.js.map +1 -1
  144. package/esm/InstitutionalHolding.mjs +180 -66
  145. package/esm/InstitutionalSentimentAlerts.d.ts.map +1 -1
  146. package/esm/InstitutionalSentimentAlerts.js.map +1 -1
  147. package/esm/InstitutionalSentimentAlerts.mjs +180 -66
  148. package/esm/InstitutionalSentimentErrors.d.ts.map +1 -1
  149. package/esm/InstitutionalSentimentErrors.js.map +1 -1
  150. package/esm/InstitutionalSentimentErrors.mjs +180 -66
  151. package/esm/InstitutionalSentimentHistory.d.ts.map +1 -1
  152. package/esm/InstitutionalSentimentHistory.js.map +1 -1
  153. package/esm/InstitutionalSentimentHistory.mjs +180 -66
  154. package/esm/InstitutionalSentimentMetrics.d.ts.map +1 -1
  155. package/esm/InstitutionalSentimentMetrics.js.map +1 -1
  156. package/esm/InstitutionalSentimentMetrics.mjs +180 -66
  157. package/esm/InviteToken.d.ts.map +1 -1
  158. package/esm/InviteToken.js.map +1 -1
  159. package/esm/InviteToken.mjs +180 -66
  160. package/esm/LinkedProvider.d.ts.map +1 -1
  161. package/esm/LinkedProvider.js.map +1 -1
  162. package/esm/LinkedProvider.mjs +180 -66
  163. package/esm/LlmConfiguration.d.ts.map +1 -1
  164. package/esm/LlmConfiguration.js.map +1 -1
  165. package/esm/LlmConfiguration.mjs +180 -66
  166. package/esm/MLModelVersion.d.ts.map +1 -1
  167. package/esm/MLModelVersion.js.map +1 -1
  168. package/esm/MLModelVersion.mjs +180 -66
  169. package/esm/MLTrainingData.d.ts.map +1 -1
  170. package/esm/MLTrainingData.js.map +1 -1
  171. package/esm/MLTrainingData.mjs +180 -66
  172. package/esm/MarketSentiment.d.ts.map +1 -1
  173. package/esm/MarketSentiment.js.map +1 -1
  174. package/esm/MarketSentiment.mjs +180 -66
  175. package/esm/ModelArtifact.d.ts.map +1 -1
  176. package/esm/ModelArtifact.js.map +1 -1
  177. package/esm/ModelArtifact.mjs +180 -66
  178. package/esm/ModelVersion.d.ts.map +1 -1
  179. package/esm/ModelVersion.js.map +1 -1
  180. package/esm/ModelVersion.mjs +180 -66
  181. package/esm/ModelVersionArtifact.d.ts.map +1 -1
  182. package/esm/ModelVersionArtifact.js.map +1 -1
  183. package/esm/ModelVersionArtifact.mjs +180 -66
  184. package/esm/NewsArticle.d.ts.map +1 -1
  185. package/esm/NewsArticle.js.map +1 -1
  186. package/esm/NewsArticle.mjs +180 -66
  187. package/esm/NewsArticleAssetSentiment.d.ts.map +1 -1
  188. package/esm/NewsArticleAssetSentiment.js.map +1 -1
  189. package/esm/NewsArticleAssetSentiment.mjs +180 -66
  190. package/esm/OptionsContract.d.ts.map +1 -1
  191. package/esm/OptionsContract.js.map +1 -1
  192. package/esm/OptionsContract.mjs +180 -66
  193. package/esm/OptionsGreeksHistory.d.ts.map +1 -1
  194. package/esm/OptionsGreeksHistory.js.map +1 -1
  195. package/esm/OptionsGreeksHistory.mjs +180 -66
  196. package/esm/OptionsPosition.d.ts.map +1 -1
  197. package/esm/OptionsPosition.js.map +1 -1
  198. package/esm/OptionsPosition.mjs +180 -66
  199. package/esm/OptionsPositionEvent.d.ts.map +1 -1
  200. package/esm/OptionsPositionEvent.js.map +1 -1
  201. package/esm/OptionsPositionEvent.mjs +180 -66
  202. package/esm/OptionsTradeExecution.d.ts.map +1 -1
  203. package/esm/OptionsTradeExecution.js.map +1 -1
  204. package/esm/OptionsTradeExecution.mjs +180 -66
  205. package/esm/PolicyOverlay.d.ts.map +1 -1
  206. package/esm/PolicyOverlay.js.map +1 -1
  207. package/esm/PolicyOverlay.mjs +180 -66
  208. package/esm/PortfolioGreeksHistory.d.ts.map +1 -1
  209. package/esm/PortfolioGreeksHistory.js.map +1 -1
  210. package/esm/PortfolioGreeksHistory.mjs +180 -66
  211. package/esm/ScheduledOptionOrder.d.ts.map +1 -1
  212. package/esm/ScheduledOptionOrder.js.map +1 -1
  213. package/esm/ScheduledOptionOrder.mjs +180 -66
  214. package/esm/Session.d.ts.map +1 -1
  215. package/esm/Session.js.map +1 -1
  216. package/esm/Session.mjs +180 -66
  217. package/esm/SignalGeneratorMetrics.d.ts.map +1 -1
  218. package/esm/SignalGeneratorMetrics.js.map +1 -1
  219. package/esm/SignalGeneratorMetrics.mjs +180 -66
  220. package/esm/SignalLineage.d.ts.map +1 -1
  221. package/esm/SignalLineage.js.map +1 -1
  222. package/esm/SignalLineage.mjs +180 -66
  223. package/esm/SignalOutcome.d.ts.map +1 -1
  224. package/esm/SignalOutcome.js.map +1 -1
  225. package/esm/SignalOutcome.mjs +180 -66
  226. package/esm/SignalPriorityQueue.d.ts.map +1 -1
  227. package/esm/SignalPriorityQueue.js.map +1 -1
  228. package/esm/SignalPriorityQueue.mjs +180 -66
  229. package/esm/SyncEvent.d.ts.map +1 -1
  230. package/esm/SyncEvent.js.map +1 -1
  231. package/esm/SyncEvent.mjs +180 -66
  232. package/esm/SystemAlert.d.ts.map +1 -1
  233. package/esm/SystemAlert.js.map +1 -1
  234. package/esm/SystemAlert.mjs +180 -66
  235. package/esm/Trade.d.ts.map +1 -1
  236. package/esm/Trade.js.map +1 -1
  237. package/esm/Trade.mjs +180 -66
  238. package/esm/TradeAuditEvent.d.ts.map +1 -1
  239. package/esm/TradeAuditEvent.js.map +1 -1
  240. package/esm/TradeAuditEvent.mjs +180 -66
  241. package/esm/TradeExecutionHistory.d.ts.map +1 -1
  242. package/esm/TradeExecutionHistory.js.map +1 -1
  243. package/esm/TradeExecutionHistory.mjs +180 -66
  244. package/esm/TradeOutcome.d.ts.map +1 -1
  245. package/esm/TradeOutcome.js.map +1 -1
  246. package/esm/TradeOutcome.mjs +180 -66
  247. package/esm/TradingPolicy.d.ts.map +1 -1
  248. package/esm/TradingPolicy.js.map +1 -1
  249. package/esm/TradingPolicy.mjs +180 -66
  250. package/esm/User.d.ts.map +1 -1
  251. package/esm/User.js.map +1 -1
  252. package/esm/User.mjs +180 -66
  253. package/esm/VerificationToken.d.ts.map +1 -1
  254. package/esm/VerificationToken.js.map +1 -1
  255. package/esm/VerificationToken.mjs +180 -66
  256. package/esm/WaitlistEntry.d.ts.map +1 -1
  257. package/esm/WaitlistEntry.js.map +1 -1
  258. package/esm/WaitlistEntry.mjs +180 -66
  259. package/esm/client.d.ts +32 -0
  260. package/esm/client.d.ts.map +1 -1
  261. package/esm/client.js.map +1 -1
  262. package/esm/client.mjs +130 -9
  263. package/esm/index.d.ts +2 -2
  264. package/esm/index.d.ts.map +1 -1
  265. package/esm/index.js.map +1 -1
  266. package/esm/index.mjs +1 -1
  267. package/index.cjs +2 -1
  268. package/index.d.ts +2 -2
  269. package/package.json +1 -1
@@ -228,13 +228,28 @@ exports.MLTrainingData = {
228
228
  await new Promise(resolve => setTimeout(resolve, delay));
229
229
  continue;
230
230
  }
231
- // Log structured error details and rethrow
232
- logger_1.logger.error("Database create operation failed", {
233
- operation: 'createOneMLTrainingData',
234
- model: 'MLTrainingData',
235
- error: String(error),
236
- isRetryable: isConnectionError,
237
- });
231
+ // Log structured error details and rethrow.
232
+ // Demote transient failures to WARN with explicit transient+recoveryHint
233
+ // metadata so log analytics can distinguish recoverable upstream retries
234
+ // from true defects.
235
+ if (isConnectionError) {
236
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
237
+ operation: 'createOneMLTrainingData',
238
+ model: 'MLTrainingData',
239
+ error: String(error),
240
+ isRetryable: true,
241
+ transient: true,
242
+ recoveryHint: "Upstream caller should retry on next cycle",
243
+ });
244
+ }
245
+ else {
246
+ logger_1.logger.error("Database create operation failed", {
247
+ operation: 'createOneMLTrainingData',
248
+ model: 'MLTrainingData',
249
+ error: String(error),
250
+ isRetryable: false,
251
+ });
252
+ }
238
253
  throw error;
239
254
  }
240
255
  }
@@ -400,13 +415,25 @@ exports.MLTrainingData = {
400
415
  await new Promise(resolve => setTimeout(resolve, delay));
401
416
  continue;
402
417
  }
403
- // Log structured error details and rethrow
404
- logger_1.logger.error("Database createMany operation failed", {
405
- operation: 'createManyMLTrainingData',
406
- model: 'MLTrainingData',
407
- error: String(error),
408
- isRetryable: isConnectionError,
409
- });
418
+ // Log structured error details and rethrow (transient -> WARN).
419
+ if (isConnectionError) {
420
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
421
+ operation: 'createManyMLTrainingData',
422
+ model: 'MLTrainingData',
423
+ error: String(error),
424
+ isRetryable: true,
425
+ transient: true,
426
+ recoveryHint: "Upstream caller should retry on next cycle",
427
+ });
428
+ }
429
+ else {
430
+ logger_1.logger.error("Database createMany operation failed", {
431
+ operation: 'createManyMLTrainingData',
432
+ model: 'MLTrainingData',
433
+ error: String(error),
434
+ isRetryable: false,
435
+ });
436
+ }
410
437
  throw error;
411
438
  }
412
439
  }
@@ -677,14 +704,27 @@ exports.MLTrainingData = {
677
704
  await new Promise(resolve => setTimeout(resolve, delay));
678
705
  continue;
679
706
  }
680
- // Log structured error details and rethrow
681
- logger_1.logger.error("Database update operation failed", {
682
- operation: 'updateOneMLTrainingData',
683
- model: 'MLTrainingData',
684
- error: String(error),
685
- recordId: props.id,
686
- isRetryable: isConnectionError,
687
- });
707
+ // Log structured error details and rethrow (transient -> WARN).
708
+ if (isConnectionError) {
709
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
710
+ operation: 'updateOneMLTrainingData',
711
+ model: 'MLTrainingData',
712
+ error: String(error),
713
+ recordId: props.id,
714
+ isRetryable: true,
715
+ transient: true,
716
+ recoveryHint: "Upstream caller should retry on next cycle",
717
+ });
718
+ }
719
+ else {
720
+ logger_1.logger.error("Database update operation failed", {
721
+ operation: 'updateOneMLTrainingData',
722
+ model: 'MLTrainingData',
723
+ error: String(error),
724
+ recordId: props.id,
725
+ isRetryable: false,
726
+ });
727
+ }
688
728
  throw error;
689
729
  }
690
730
  }
@@ -1002,14 +1042,27 @@ exports.MLTrainingData = {
1002
1042
  await new Promise(resolve => setTimeout(resolve, delay));
1003
1043
  continue;
1004
1044
  }
1005
- // Log structured error details and rethrow
1006
- logger_1.logger.error("Database upsert operation failed", {
1007
- operation: 'upsertOneMLTrainingData',
1008
- model: 'MLTrainingData',
1009
- error: String(error),
1010
- recordId: props.id,
1011
- isRetryable: isConnectionError,
1012
- });
1045
+ // Log structured error details and rethrow (transient -> WARN).
1046
+ if (isConnectionError) {
1047
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
1048
+ operation: 'upsertOneMLTrainingData',
1049
+ model: 'MLTrainingData',
1050
+ error: String(error),
1051
+ recordId: props.id,
1052
+ isRetryable: true,
1053
+ transient: true,
1054
+ recoveryHint: "Upstream caller should retry on next cycle",
1055
+ });
1056
+ }
1057
+ else {
1058
+ logger_1.logger.error("Database upsert operation failed", {
1059
+ operation: 'upsertOneMLTrainingData',
1060
+ model: 'MLTrainingData',
1061
+ error: String(error),
1062
+ recordId: props.id,
1063
+ isRetryable: false,
1064
+ });
1065
+ }
1013
1066
  throw error;
1014
1067
  }
1015
1068
  }
@@ -1278,13 +1331,25 @@ exports.MLTrainingData = {
1278
1331
  await new Promise(resolve => setTimeout(resolve, delay));
1279
1332
  continue;
1280
1333
  }
1281
- // Log structured error details and rethrow
1282
- logger_1.logger.error("Database updateMany operation failed", {
1283
- operation: 'updateManyMLTrainingData',
1284
- model: 'MLTrainingData',
1285
- error: String(error),
1286
- isRetryable: isConnectionError,
1287
- });
1334
+ // Log structured error details and rethrow (transient -> WARN).
1335
+ if (isConnectionError) {
1336
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
1337
+ operation: 'updateManyMLTrainingData',
1338
+ model: 'MLTrainingData',
1339
+ error: String(error),
1340
+ isRetryable: true,
1341
+ transient: true,
1342
+ recoveryHint: "Upstream caller should retry on next cycle",
1343
+ });
1344
+ }
1345
+ else {
1346
+ logger_1.logger.error("Database updateMany operation failed", {
1347
+ operation: 'updateManyMLTrainingData',
1348
+ model: 'MLTrainingData',
1349
+ error: String(error),
1350
+ isRetryable: false,
1351
+ });
1352
+ }
1288
1353
  throw error;
1289
1354
  }
1290
1355
  }
@@ -1407,14 +1472,27 @@ exports.MLTrainingData = {
1407
1472
  await new Promise(resolve => setTimeout(resolve, delay));
1408
1473
  continue;
1409
1474
  }
1410
- // Log structured error details and rethrow
1411
- logger_1.logger.error("Database delete operation failed", {
1412
- operation: 'deleteOneMLTrainingData',
1413
- model: 'MLTrainingData',
1414
- error: String(error),
1415
- recordId: props.id,
1416
- isRetryable: isConnectionError,
1417
- });
1475
+ // Log structured error details and rethrow (transient -> WARN).
1476
+ if (isConnectionError) {
1477
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
1478
+ operation: 'deleteOneMLTrainingData',
1479
+ model: 'MLTrainingData',
1480
+ error: String(error),
1481
+ recordId: props.id,
1482
+ isRetryable: true,
1483
+ transient: true,
1484
+ recoveryHint: "Upstream caller should retry on next cycle",
1485
+ });
1486
+ }
1487
+ else {
1488
+ logger_1.logger.error("Database delete operation failed", {
1489
+ operation: 'deleteOneMLTrainingData',
1490
+ model: 'MLTrainingData',
1491
+ error: String(error),
1492
+ recordId: props.id,
1493
+ isRetryable: false,
1494
+ });
1495
+ }
1418
1496
  throw error;
1419
1497
  }
1420
1498
  }
@@ -1516,13 +1594,25 @@ exports.MLTrainingData = {
1516
1594
  await new Promise(resolve => setTimeout(resolve, delay));
1517
1595
  continue;
1518
1596
  }
1519
- // Log structured error details and rethrow
1520
- logger_1.logger.error("Database get operation failed", {
1521
- operation: 'getMLTrainingData',
1522
- model: 'MLTrainingData',
1523
- error: String(error),
1524
- isRetryable: isConnectionError,
1525
- });
1597
+ // Log structured error details and rethrow (transient -> WARN).
1598
+ if (isConnectionError) {
1599
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
1600
+ operation: 'getMLTrainingData',
1601
+ model: 'MLTrainingData',
1602
+ error: String(error),
1603
+ isRetryable: true,
1604
+ transient: true,
1605
+ recoveryHint: "Upstream caller should retry on next cycle",
1606
+ });
1607
+ }
1608
+ else {
1609
+ logger_1.logger.error("Database get operation failed", {
1610
+ operation: 'getMLTrainingData',
1611
+ model: 'MLTrainingData',
1612
+ error: String(error),
1613
+ isRetryable: false,
1614
+ });
1615
+ }
1526
1616
  throw error;
1527
1617
  }
1528
1618
  }
@@ -1609,13 +1699,25 @@ exports.MLTrainingData = {
1609
1699
  await new Promise(resolve => setTimeout(resolve, delay));
1610
1700
  continue;
1611
1701
  }
1612
- // Log structured error details and rethrow
1613
- logger_1.logger.error("Database getAll operation failed", {
1614
- operation: 'getAllMLTrainingData',
1615
- model: 'MLTrainingData',
1616
- error: String(error),
1617
- isRetryable: isConnectionError,
1618
- });
1702
+ // Log structured error details and rethrow (transient -> WARN).
1703
+ if (isConnectionError) {
1704
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
1705
+ operation: 'getAllMLTrainingData',
1706
+ model: 'MLTrainingData',
1707
+ error: String(error),
1708
+ isRetryable: true,
1709
+ transient: true,
1710
+ recoveryHint: "Upstream caller should retry on next cycle",
1711
+ });
1712
+ }
1713
+ else {
1714
+ logger_1.logger.error("Database getAll operation failed", {
1715
+ operation: 'getAllMLTrainingData',
1716
+ model: 'MLTrainingData',
1717
+ error: String(error),
1718
+ isRetryable: false,
1719
+ });
1720
+ }
1619
1721
  throw error;
1620
1722
  }
1621
1723
  }
@@ -1729,13 +1831,25 @@ exports.MLTrainingData = {
1729
1831
  await new Promise(resolve => setTimeout(resolve, delay));
1730
1832
  continue;
1731
1833
  }
1732
- // Log structured error details and rethrow
1733
- logger_1.logger.error("Database findMany operation failed", {
1734
- operation: 'findManyMLTrainingData',
1735
- model: 'MLTrainingData',
1736
- error: String(error),
1737
- isRetryable: isConnectionError,
1738
- });
1834
+ // Log structured error details and rethrow (transient -> WARN).
1835
+ if (isConnectionError) {
1836
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
1837
+ operation: 'findManyMLTrainingData',
1838
+ model: 'MLTrainingData',
1839
+ error: String(error),
1840
+ isRetryable: true,
1841
+ transient: true,
1842
+ recoveryHint: "Upstream caller should retry on next cycle",
1843
+ });
1844
+ }
1845
+ else {
1846
+ logger_1.logger.error("Database findMany operation failed", {
1847
+ operation: 'findManyMLTrainingData',
1848
+ model: 'MLTrainingData',
1849
+ error: String(error),
1850
+ isRetryable: false,
1851
+ });
1852
+ }
1739
1853
  throw error;
1740
1854
  }
1741
1855
  }
@@ -138,13 +138,28 @@ exports.MarketSentiment = {
138
138
  await new Promise(resolve => setTimeout(resolve, delay));
139
139
  continue;
140
140
  }
141
- // Log structured error details and rethrow
142
- logger_1.logger.error("Database create operation failed", {
143
- operation: 'createOneMarketSentiment',
144
- model: 'MarketSentiment',
145
- error: String(error),
146
- isRetryable: isConnectionError,
147
- });
141
+ // Log structured error details and rethrow.
142
+ // Demote transient failures to WARN with explicit transient+recoveryHint
143
+ // metadata so log analytics can distinguish recoverable upstream retries
144
+ // from true defects.
145
+ if (isConnectionError) {
146
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
147
+ operation: 'createOneMarketSentiment',
148
+ model: 'MarketSentiment',
149
+ error: String(error),
150
+ isRetryable: true,
151
+ transient: true,
152
+ recoveryHint: "Upstream caller should retry on next cycle",
153
+ });
154
+ }
155
+ else {
156
+ logger_1.logger.error("Database create operation failed", {
157
+ operation: 'createOneMarketSentiment',
158
+ model: 'MarketSentiment',
159
+ error: String(error),
160
+ isRetryable: false,
161
+ });
162
+ }
148
163
  throw error;
149
164
  }
150
165
  }
@@ -265,13 +280,25 @@ exports.MarketSentiment = {
265
280
  await new Promise(resolve => setTimeout(resolve, delay));
266
281
  continue;
267
282
  }
268
- // Log structured error details and rethrow
269
- logger_1.logger.error("Database createMany operation failed", {
270
- operation: 'createManyMarketSentiment',
271
- model: 'MarketSentiment',
272
- error: String(error),
273
- isRetryable: isConnectionError,
274
- });
283
+ // Log structured error details and rethrow (transient -> WARN).
284
+ if (isConnectionError) {
285
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
286
+ operation: 'createManyMarketSentiment',
287
+ model: 'MarketSentiment',
288
+ error: String(error),
289
+ isRetryable: true,
290
+ transient: true,
291
+ recoveryHint: "Upstream caller should retry on next cycle",
292
+ });
293
+ }
294
+ else {
295
+ logger_1.logger.error("Database createMany operation failed", {
296
+ operation: 'createManyMarketSentiment',
297
+ model: 'MarketSentiment',
298
+ error: String(error),
299
+ isRetryable: false,
300
+ });
301
+ }
275
302
  throw error;
276
303
  }
277
304
  }
@@ -411,14 +438,27 @@ exports.MarketSentiment = {
411
438
  await new Promise(resolve => setTimeout(resolve, delay));
412
439
  continue;
413
440
  }
414
- // Log structured error details and rethrow
415
- logger_1.logger.error("Database update operation failed", {
416
- operation: 'updateOneMarketSentiment',
417
- model: 'MarketSentiment',
418
- error: String(error),
419
- recordId: props.id,
420
- isRetryable: isConnectionError,
421
- });
441
+ // Log structured error details and rethrow (transient -> WARN).
442
+ if (isConnectionError) {
443
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
444
+ operation: 'updateOneMarketSentiment',
445
+ model: 'MarketSentiment',
446
+ error: String(error),
447
+ recordId: props.id,
448
+ isRetryable: true,
449
+ transient: true,
450
+ recoveryHint: "Upstream caller should retry on next cycle",
451
+ });
452
+ }
453
+ else {
454
+ logger_1.logger.error("Database update operation failed", {
455
+ operation: 'updateOneMarketSentiment',
456
+ model: 'MarketSentiment',
457
+ error: String(error),
458
+ recordId: props.id,
459
+ isRetryable: false,
460
+ });
461
+ }
422
462
  throw error;
423
463
  }
424
464
  }
@@ -554,14 +594,27 @@ exports.MarketSentiment = {
554
594
  await new Promise(resolve => setTimeout(resolve, delay));
555
595
  continue;
556
596
  }
557
- // Log structured error details and rethrow
558
- logger_1.logger.error("Database upsert operation failed", {
559
- operation: 'upsertOneMarketSentiment',
560
- model: 'MarketSentiment',
561
- error: String(error),
562
- recordId: props.id,
563
- isRetryable: isConnectionError,
564
- });
597
+ // Log structured error details and rethrow (transient -> WARN).
598
+ if (isConnectionError) {
599
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
600
+ operation: 'upsertOneMarketSentiment',
601
+ model: 'MarketSentiment',
602
+ error: String(error),
603
+ recordId: props.id,
604
+ isRetryable: true,
605
+ transient: true,
606
+ recoveryHint: "Upstream caller should retry on next cycle",
607
+ });
608
+ }
609
+ else {
610
+ logger_1.logger.error("Database upsert operation failed", {
611
+ operation: 'upsertOneMarketSentiment',
612
+ model: 'MarketSentiment',
613
+ error: String(error),
614
+ recordId: props.id,
615
+ isRetryable: false,
616
+ });
617
+ }
565
618
  throw error;
566
619
  }
567
620
  }
@@ -699,13 +752,25 @@ exports.MarketSentiment = {
699
752
  await new Promise(resolve => setTimeout(resolve, delay));
700
753
  continue;
701
754
  }
702
- // Log structured error details and rethrow
703
- logger_1.logger.error("Database updateMany operation failed", {
704
- operation: 'updateManyMarketSentiment',
705
- model: 'MarketSentiment',
706
- error: String(error),
707
- isRetryable: isConnectionError,
708
- });
755
+ // Log structured error details and rethrow (transient -> WARN).
756
+ if (isConnectionError) {
757
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
758
+ operation: 'updateManyMarketSentiment',
759
+ model: 'MarketSentiment',
760
+ error: String(error),
761
+ isRetryable: true,
762
+ transient: true,
763
+ recoveryHint: "Upstream caller should retry on next cycle",
764
+ });
765
+ }
766
+ else {
767
+ logger_1.logger.error("Database updateMany operation failed", {
768
+ operation: 'updateManyMarketSentiment',
769
+ model: 'MarketSentiment',
770
+ error: String(error),
771
+ isRetryable: false,
772
+ });
773
+ }
709
774
  throw error;
710
775
  }
711
776
  }
@@ -828,14 +893,27 @@ exports.MarketSentiment = {
828
893
  await new Promise(resolve => setTimeout(resolve, delay));
829
894
  continue;
830
895
  }
831
- // Log structured error details and rethrow
832
- logger_1.logger.error("Database delete operation failed", {
833
- operation: 'deleteOneMarketSentiment',
834
- model: 'MarketSentiment',
835
- error: String(error),
836
- recordId: props.id,
837
- isRetryable: isConnectionError,
838
- });
896
+ // Log structured error details and rethrow (transient -> WARN).
897
+ if (isConnectionError) {
898
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
899
+ operation: 'deleteOneMarketSentiment',
900
+ model: 'MarketSentiment',
901
+ error: String(error),
902
+ recordId: props.id,
903
+ isRetryable: true,
904
+ transient: true,
905
+ recoveryHint: "Upstream caller should retry on next cycle",
906
+ });
907
+ }
908
+ else {
909
+ logger_1.logger.error("Database delete operation failed", {
910
+ operation: 'deleteOneMarketSentiment',
911
+ model: 'MarketSentiment',
912
+ error: String(error),
913
+ recordId: props.id,
914
+ isRetryable: false,
915
+ });
916
+ }
839
917
  throw error;
840
918
  }
841
919
  }
@@ -931,13 +1009,25 @@ exports.MarketSentiment = {
931
1009
  await new Promise(resolve => setTimeout(resolve, delay));
932
1010
  continue;
933
1011
  }
934
- // Log structured error details and rethrow
935
- logger_1.logger.error("Database get operation failed", {
936
- operation: 'getMarketSentiment',
937
- model: 'MarketSentiment',
938
- error: String(error),
939
- isRetryable: isConnectionError,
940
- });
1012
+ // Log structured error details and rethrow (transient -> WARN).
1013
+ if (isConnectionError) {
1014
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
1015
+ operation: 'getMarketSentiment',
1016
+ model: 'MarketSentiment',
1017
+ error: String(error),
1018
+ isRetryable: true,
1019
+ transient: true,
1020
+ recoveryHint: "Upstream caller should retry on next cycle",
1021
+ });
1022
+ }
1023
+ else {
1024
+ logger_1.logger.error("Database get operation failed", {
1025
+ operation: 'getMarketSentiment',
1026
+ model: 'MarketSentiment',
1027
+ error: String(error),
1028
+ isRetryable: false,
1029
+ });
1030
+ }
941
1031
  throw error;
942
1032
  }
943
1033
  }
@@ -1024,13 +1114,25 @@ exports.MarketSentiment = {
1024
1114
  await new Promise(resolve => setTimeout(resolve, delay));
1025
1115
  continue;
1026
1116
  }
1027
- // Log structured error details and rethrow
1028
- logger_1.logger.error("Database getAll operation failed", {
1029
- operation: 'getAllMarketSentiment',
1030
- model: 'MarketSentiment',
1031
- error: String(error),
1032
- isRetryable: isConnectionError,
1033
- });
1117
+ // Log structured error details and rethrow (transient -> WARN).
1118
+ if (isConnectionError) {
1119
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
1120
+ operation: 'getAllMarketSentiment',
1121
+ model: 'MarketSentiment',
1122
+ error: String(error),
1123
+ isRetryable: true,
1124
+ transient: true,
1125
+ recoveryHint: "Upstream caller should retry on next cycle",
1126
+ });
1127
+ }
1128
+ else {
1129
+ logger_1.logger.error("Database getAll operation failed", {
1130
+ operation: 'getAllMarketSentiment',
1131
+ model: 'MarketSentiment',
1132
+ error: String(error),
1133
+ isRetryable: false,
1134
+ });
1135
+ }
1034
1136
  throw error;
1035
1137
  }
1036
1138
  }
@@ -1138,13 +1240,25 @@ exports.MarketSentiment = {
1138
1240
  await new Promise(resolve => setTimeout(resolve, delay));
1139
1241
  continue;
1140
1242
  }
1141
- // Log structured error details and rethrow
1142
- logger_1.logger.error("Database findMany operation failed", {
1143
- operation: 'findManyMarketSentiment',
1144
- model: 'MarketSentiment',
1145
- error: String(error),
1146
- isRetryable: isConnectionError,
1147
- });
1243
+ // Log structured error details and rethrow (transient -> WARN).
1244
+ if (isConnectionError) {
1245
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
1246
+ operation: 'findManyMarketSentiment',
1247
+ model: 'MarketSentiment',
1248
+ error: String(error),
1249
+ isRetryable: true,
1250
+ transient: true,
1251
+ recoveryHint: "Upstream caller should retry on next cycle",
1252
+ });
1253
+ }
1254
+ else {
1255
+ logger_1.logger.error("Database findMany operation failed", {
1256
+ operation: 'findManyMarketSentiment',
1257
+ model: 'MarketSentiment',
1258
+ error: String(error),
1259
+ isRetryable: false,
1260
+ });
1261
+ }
1148
1262
  throw error;
1149
1263
  }
1150
1264
  }