@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
@@ -656,13 +656,28 @@ export const TradingPolicy = {
656
656
  await new Promise(resolve => setTimeout(resolve, delay));
657
657
  continue;
658
658
  }
659
- // Log structured error details and rethrow
660
- logger.error("Database create operation failed", {
661
- operation: 'createOneTradingPolicy',
662
- model: 'TradingPolicy',
663
- error: String(error),
664
- isRetryable: isConnectionError,
665
- });
659
+ // Log structured error details and rethrow.
660
+ // Demote transient failures to WARN with explicit transient+recoveryHint
661
+ // metadata so log analytics can distinguish recoverable upstream retries
662
+ // from true defects.
663
+ if (isConnectionError) {
664
+ logger.warn("Database create operation failed (transient after retries)", {
665
+ operation: 'createOneTradingPolicy',
666
+ model: 'TradingPolicy',
667
+ error: String(error),
668
+ isRetryable: true,
669
+ transient: true,
670
+ recoveryHint: "Upstream caller should retry on next cycle",
671
+ });
672
+ }
673
+ else {
674
+ logger.error("Database create operation failed", {
675
+ operation: 'createOneTradingPolicy',
676
+ model: 'TradingPolicy',
677
+ error: String(error),
678
+ isRetryable: false,
679
+ });
680
+ }
666
681
  throw error;
667
682
  }
668
683
  }
@@ -843,13 +858,25 @@ export const TradingPolicy = {
843
858
  await new Promise(resolve => setTimeout(resolve, delay));
844
859
  continue;
845
860
  }
846
- // Log structured error details and rethrow
847
- logger.error("Database createMany operation failed", {
848
- operation: 'createManyTradingPolicy',
849
- model: 'TradingPolicy',
850
- error: String(error),
851
- isRetryable: isConnectionError,
852
- });
861
+ // Log structured error details and rethrow (transient -> WARN).
862
+ if (isConnectionError) {
863
+ logger.warn("Database createMany operation failed (transient after retries)", {
864
+ operation: 'createManyTradingPolicy',
865
+ model: 'TradingPolicy',
866
+ error: String(error),
867
+ isRetryable: true,
868
+ transient: true,
869
+ recoveryHint: "Upstream caller should retry on next cycle",
870
+ });
871
+ }
872
+ else {
873
+ logger.error("Database createMany operation failed", {
874
+ operation: 'createManyTradingPolicy',
875
+ model: 'TradingPolicy',
876
+ error: String(error),
877
+ isRetryable: false,
878
+ });
879
+ }
853
880
  throw error;
854
881
  }
855
882
  }
@@ -2560,14 +2587,27 @@ export const TradingPolicy = {
2560
2587
  await new Promise(resolve => setTimeout(resolve, delay));
2561
2588
  continue;
2562
2589
  }
2563
- // Log structured error details and rethrow
2564
- logger.error("Database update operation failed", {
2565
- operation: 'updateOneTradingPolicy',
2566
- model: 'TradingPolicy',
2567
- error: String(error),
2568
- recordId: props.id,
2569
- isRetryable: isConnectionError,
2570
- });
2590
+ // Log structured error details and rethrow (transient -> WARN).
2591
+ if (isConnectionError) {
2592
+ logger.warn("Database update operation failed (transient after retries)", {
2593
+ operation: 'updateOneTradingPolicy',
2594
+ model: 'TradingPolicy',
2595
+ error: String(error),
2596
+ recordId: props.id,
2597
+ isRetryable: true,
2598
+ transient: true,
2599
+ recoveryHint: "Upstream caller should retry on next cycle",
2600
+ });
2601
+ }
2602
+ else {
2603
+ logger.error("Database update operation failed", {
2604
+ operation: 'updateOneTradingPolicy',
2605
+ model: 'TradingPolicy',
2606
+ error: String(error),
2607
+ recordId: props.id,
2608
+ isRetryable: false,
2609
+ });
2610
+ }
2571
2611
  throw error;
2572
2612
  }
2573
2613
  }
@@ -4745,14 +4785,27 @@ export const TradingPolicy = {
4745
4785
  await new Promise(resolve => setTimeout(resolve, delay));
4746
4786
  continue;
4747
4787
  }
4748
- // Log structured error details and rethrow
4749
- logger.error("Database upsert operation failed", {
4750
- operation: 'upsertOneTradingPolicy',
4751
- model: 'TradingPolicy',
4752
- error: String(error),
4753
- recordId: props.id,
4754
- isRetryable: isConnectionError,
4755
- });
4788
+ // Log structured error details and rethrow (transient -> WARN).
4789
+ if (isConnectionError) {
4790
+ logger.warn("Database upsert operation failed (transient after retries)", {
4791
+ operation: 'upsertOneTradingPolicy',
4792
+ model: 'TradingPolicy',
4793
+ error: String(error),
4794
+ recordId: props.id,
4795
+ isRetryable: true,
4796
+ transient: true,
4797
+ recoveryHint: "Upstream caller should retry on next cycle",
4798
+ });
4799
+ }
4800
+ else {
4801
+ logger.error("Database upsert operation failed", {
4802
+ operation: 'upsertOneTradingPolicy',
4803
+ model: 'TradingPolicy',
4804
+ error: String(error),
4805
+ recordId: props.id,
4806
+ isRetryable: false,
4807
+ });
4808
+ }
4756
4809
  throw error;
4757
4810
  }
4758
4811
  }
@@ -6461,13 +6514,25 @@ export const TradingPolicy = {
6461
6514
  await new Promise(resolve => setTimeout(resolve, delay));
6462
6515
  continue;
6463
6516
  }
6464
- // Log structured error details and rethrow
6465
- logger.error("Database updateMany operation failed", {
6466
- operation: 'updateManyTradingPolicy',
6467
- model: 'TradingPolicy',
6468
- error: String(error),
6469
- isRetryable: isConnectionError,
6470
- });
6517
+ // Log structured error details and rethrow (transient -> WARN).
6518
+ if (isConnectionError) {
6519
+ logger.warn("Database updateMany operation failed (transient after retries)", {
6520
+ operation: 'updateManyTradingPolicy',
6521
+ model: 'TradingPolicy',
6522
+ error: String(error),
6523
+ isRetryable: true,
6524
+ transient: true,
6525
+ recoveryHint: "Upstream caller should retry on next cycle",
6526
+ });
6527
+ }
6528
+ else {
6529
+ logger.error("Database updateMany operation failed", {
6530
+ operation: 'updateManyTradingPolicy',
6531
+ model: 'TradingPolicy',
6532
+ error: String(error),
6533
+ isRetryable: false,
6534
+ });
6535
+ }
6471
6536
  throw error;
6472
6537
  }
6473
6538
  }
@@ -6589,14 +6654,27 @@ export const TradingPolicy = {
6589
6654
  await new Promise(resolve => setTimeout(resolve, delay));
6590
6655
  continue;
6591
6656
  }
6592
- // Log structured error details and rethrow
6593
- logger.error("Database delete operation failed", {
6594
- operation: 'deleteOneTradingPolicy',
6595
- model: 'TradingPolicy',
6596
- error: String(error),
6597
- recordId: props.id,
6598
- isRetryable: isConnectionError,
6599
- });
6657
+ // Log structured error details and rethrow (transient -> WARN).
6658
+ if (isConnectionError) {
6659
+ logger.warn("Database delete operation failed (transient after retries)", {
6660
+ operation: 'deleteOneTradingPolicy',
6661
+ model: 'TradingPolicy',
6662
+ error: String(error),
6663
+ recordId: props.id,
6664
+ isRetryable: true,
6665
+ transient: true,
6666
+ recoveryHint: "Upstream caller should retry on next cycle",
6667
+ });
6668
+ }
6669
+ else {
6670
+ logger.error("Database delete operation failed", {
6671
+ operation: 'deleteOneTradingPolicy',
6672
+ model: 'TradingPolicy',
6673
+ error: String(error),
6674
+ recordId: props.id,
6675
+ isRetryable: false,
6676
+ });
6677
+ }
6600
6678
  throw error;
6601
6679
  }
6602
6680
  }
@@ -6701,13 +6779,25 @@ export const TradingPolicy = {
6701
6779
  await new Promise(resolve => setTimeout(resolve, delay));
6702
6780
  continue;
6703
6781
  }
6704
- // Log structured error details and rethrow
6705
- logger.error("Database get operation failed", {
6706
- operation: 'getTradingPolicy',
6707
- model: 'TradingPolicy',
6708
- error: String(error),
6709
- isRetryable: isConnectionError,
6710
- });
6782
+ // Log structured error details and rethrow (transient -> WARN).
6783
+ if (isConnectionError) {
6784
+ logger.warn("Database get operation failed (transient after retries)", {
6785
+ operation: 'getTradingPolicy',
6786
+ model: 'TradingPolicy',
6787
+ error: String(error),
6788
+ isRetryable: true,
6789
+ transient: true,
6790
+ recoveryHint: "Upstream caller should retry on next cycle",
6791
+ });
6792
+ }
6793
+ else {
6794
+ logger.error("Database get operation failed", {
6795
+ operation: 'getTradingPolicy',
6796
+ model: 'TradingPolicy',
6797
+ error: String(error),
6798
+ isRetryable: false,
6799
+ });
6800
+ }
6711
6801
  throw error;
6712
6802
  }
6713
6803
  }
@@ -6793,13 +6883,25 @@ export const TradingPolicy = {
6793
6883
  await new Promise(resolve => setTimeout(resolve, delay));
6794
6884
  continue;
6795
6885
  }
6796
- // Log structured error details and rethrow
6797
- logger.error("Database getAll operation failed", {
6798
- operation: 'getAllTradingPolicy',
6799
- model: 'TradingPolicy',
6800
- error: String(error),
6801
- isRetryable: isConnectionError,
6802
- });
6886
+ // Log structured error details and rethrow (transient -> WARN).
6887
+ if (isConnectionError) {
6888
+ logger.warn("Database getAll operation failed (transient after retries)", {
6889
+ operation: 'getAllTradingPolicy',
6890
+ model: 'TradingPolicy',
6891
+ error: String(error),
6892
+ isRetryable: true,
6893
+ transient: true,
6894
+ recoveryHint: "Upstream caller should retry on next cycle",
6895
+ });
6896
+ }
6897
+ else {
6898
+ logger.error("Database getAll operation failed", {
6899
+ operation: 'getAllTradingPolicy',
6900
+ model: 'TradingPolicy',
6901
+ error: String(error),
6902
+ isRetryable: false,
6903
+ });
6904
+ }
6803
6905
  throw error;
6804
6906
  }
6805
6907
  }
@@ -6918,13 +7020,25 @@ export const TradingPolicy = {
6918
7020
  await new Promise(resolve => setTimeout(resolve, delay));
6919
7021
  continue;
6920
7022
  }
6921
- // Log structured error details and rethrow
6922
- logger.error("Database findMany operation failed", {
6923
- operation: 'findManyTradingPolicy',
6924
- model: 'TradingPolicy',
6925
- error: String(error),
6926
- isRetryable: isConnectionError,
6927
- });
7023
+ // Log structured error details and rethrow (transient -> WARN).
7024
+ if (isConnectionError) {
7025
+ logger.warn("Database findMany operation failed (transient after retries)", {
7026
+ operation: 'findManyTradingPolicy',
7027
+ model: 'TradingPolicy',
7028
+ error: String(error),
7029
+ isRetryable: true,
7030
+ transient: true,
7031
+ recoveryHint: "Upstream caller should retry on next cycle",
7032
+ });
7033
+ }
7034
+ else {
7035
+ logger.error("Database findMany operation failed", {
7036
+ operation: 'findManyTradingPolicy',
7037
+ model: 'TradingPolicy',
7038
+ error: String(error),
7039
+ isRetryable: false,
7040
+ });
7041
+ }
6928
7042
  throw error;
6929
7043
  }
6930
7044
  }
package/esm/User.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../src/User.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAmB,gBAAgB,EAAE,qBAAqB,EAAoB,MAAM,UAAU,CAAC;AAsMpG,eAAO,MAAM,IAAI;IAEf;;;;;OAKG;IAEH;;;;;;OAMG;kBACiB,QAAQ,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC;IAinB1G;;;;;;;OAOG;sBACqB,QAAQ,EAAE,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,YAAY;QAAE,cAAc,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IA+ItK;;;;;;OAMG;kBACiB,QAAQ,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,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