@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
@@ -597,13 +597,28 @@ exports.LlmConfiguration = {
597
597
  await new Promise(resolve => setTimeout(resolve, delay));
598
598
  continue;
599
599
  }
600
- // Log structured error details and rethrow
601
- logger_1.logger.error("Database create operation failed", {
602
- operation: 'createOneLlmConfiguration',
603
- model: 'LlmConfiguration',
604
- error: String(error),
605
- isRetryable: isConnectionError,
606
- });
600
+ // Log structured error details and rethrow.
601
+ // Demote transient failures to WARN with explicit transient+recoveryHint
602
+ // metadata so log analytics can distinguish recoverable upstream retries
603
+ // from true defects.
604
+ if (isConnectionError) {
605
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
606
+ operation: 'createOneLlmConfiguration',
607
+ model: 'LlmConfiguration',
608
+ error: String(error),
609
+ isRetryable: true,
610
+ transient: true,
611
+ recoveryHint: "Upstream caller should retry on next cycle",
612
+ });
613
+ }
614
+ else {
615
+ logger_1.logger.error("Database create operation failed", {
616
+ operation: 'createOneLlmConfiguration',
617
+ model: 'LlmConfiguration',
618
+ error: String(error),
619
+ isRetryable: false,
620
+ });
621
+ }
607
622
  throw error;
608
623
  }
609
624
  }
@@ -736,13 +751,25 @@ exports.LlmConfiguration = {
736
751
  await new Promise(resolve => setTimeout(resolve, delay));
737
752
  continue;
738
753
  }
739
- // Log structured error details and rethrow
740
- logger_1.logger.error("Database createMany operation failed", {
741
- operation: 'createManyLlmConfiguration',
742
- model: 'LlmConfiguration',
743
- error: String(error),
744
- isRetryable: isConnectionError,
745
- });
754
+ // Log structured error details and rethrow (transient -> WARN).
755
+ if (isConnectionError) {
756
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
757
+ operation: 'createManyLlmConfiguration',
758
+ model: 'LlmConfiguration',
759
+ error: String(error),
760
+ isRetryable: true,
761
+ transient: true,
762
+ recoveryHint: "Upstream caller should retry on next cycle",
763
+ });
764
+ }
765
+ else {
766
+ logger_1.logger.error("Database createMany operation failed", {
767
+ operation: 'createManyLlmConfiguration',
768
+ model: 'LlmConfiguration',
769
+ error: String(error),
770
+ isRetryable: false,
771
+ });
772
+ }
746
773
  throw error;
747
774
  }
748
775
  }
@@ -2519,14 +2546,27 @@ exports.LlmConfiguration = {
2519
2546
  await new Promise(resolve => setTimeout(resolve, delay));
2520
2547
  continue;
2521
2548
  }
2522
- // Log structured error details and rethrow
2523
- logger_1.logger.error("Database update operation failed", {
2524
- operation: 'updateOneLlmConfiguration',
2525
- model: 'LlmConfiguration',
2526
- error: String(error),
2527
- recordId: props.id,
2528
- isRetryable: isConnectionError,
2529
- });
2549
+ // Log structured error details and rethrow (transient -> WARN).
2550
+ if (isConnectionError) {
2551
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
2552
+ operation: 'updateOneLlmConfiguration',
2553
+ model: 'LlmConfiguration',
2554
+ error: String(error),
2555
+ recordId: props.id,
2556
+ isRetryable: true,
2557
+ transient: true,
2558
+ recoveryHint: "Upstream caller should retry on next cycle",
2559
+ });
2560
+ }
2561
+ else {
2562
+ logger_1.logger.error("Database update operation failed", {
2563
+ operation: 'updateOneLlmConfiguration',
2564
+ model: 'LlmConfiguration',
2565
+ error: String(error),
2566
+ recordId: props.id,
2567
+ isRetryable: false,
2568
+ });
2569
+ }
2530
2570
  throw error;
2531
2571
  }
2532
2572
  }
@@ -4754,14 +4794,27 @@ exports.LlmConfiguration = {
4754
4794
  await new Promise(resolve => setTimeout(resolve, delay));
4755
4795
  continue;
4756
4796
  }
4757
- // Log structured error details and rethrow
4758
- logger_1.logger.error("Database upsert operation failed", {
4759
- operation: 'upsertOneLlmConfiguration',
4760
- model: 'LlmConfiguration',
4761
- error: String(error),
4762
- recordId: props.id,
4763
- isRetryable: isConnectionError,
4764
- });
4797
+ // Log structured error details and rethrow (transient -> WARN).
4798
+ if (isConnectionError) {
4799
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
4800
+ operation: 'upsertOneLlmConfiguration',
4801
+ model: 'LlmConfiguration',
4802
+ error: String(error),
4803
+ recordId: props.id,
4804
+ isRetryable: true,
4805
+ transient: true,
4806
+ recoveryHint: "Upstream caller should retry on next cycle",
4807
+ });
4808
+ }
4809
+ else {
4810
+ logger_1.logger.error("Database upsert operation failed", {
4811
+ operation: 'upsertOneLlmConfiguration',
4812
+ model: 'LlmConfiguration',
4813
+ error: String(error),
4814
+ recordId: props.id,
4815
+ isRetryable: false,
4816
+ });
4817
+ }
4765
4818
  throw error;
4766
4819
  }
4767
4820
  }
@@ -6536,13 +6589,25 @@ exports.LlmConfiguration = {
6536
6589
  await new Promise(resolve => setTimeout(resolve, delay));
6537
6590
  continue;
6538
6591
  }
6539
- // Log structured error details and rethrow
6540
- logger_1.logger.error("Database updateMany operation failed", {
6541
- operation: 'updateManyLlmConfiguration',
6542
- model: 'LlmConfiguration',
6543
- error: String(error),
6544
- isRetryable: isConnectionError,
6545
- });
6592
+ // Log structured error details and rethrow (transient -> WARN).
6593
+ if (isConnectionError) {
6594
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
6595
+ operation: 'updateManyLlmConfiguration',
6596
+ model: 'LlmConfiguration',
6597
+ error: String(error),
6598
+ isRetryable: true,
6599
+ transient: true,
6600
+ recoveryHint: "Upstream caller should retry on next cycle",
6601
+ });
6602
+ }
6603
+ else {
6604
+ logger_1.logger.error("Database updateMany operation failed", {
6605
+ operation: 'updateManyLlmConfiguration',
6606
+ model: 'LlmConfiguration',
6607
+ error: String(error),
6608
+ isRetryable: false,
6609
+ });
6610
+ }
6546
6611
  throw error;
6547
6612
  }
6548
6613
  }
@@ -6665,14 +6730,27 @@ exports.LlmConfiguration = {
6665
6730
  await new Promise(resolve => setTimeout(resolve, delay));
6666
6731
  continue;
6667
6732
  }
6668
- // Log structured error details and rethrow
6669
- logger_1.logger.error("Database delete operation failed", {
6670
- operation: 'deleteOneLlmConfiguration',
6671
- model: 'LlmConfiguration',
6672
- error: String(error),
6673
- recordId: props.id,
6674
- isRetryable: isConnectionError,
6675
- });
6733
+ // Log structured error details and rethrow (transient -> WARN).
6734
+ if (isConnectionError) {
6735
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
6736
+ operation: 'deleteOneLlmConfiguration',
6737
+ model: 'LlmConfiguration',
6738
+ error: String(error),
6739
+ recordId: props.id,
6740
+ isRetryable: true,
6741
+ transient: true,
6742
+ recoveryHint: "Upstream caller should retry on next cycle",
6743
+ });
6744
+ }
6745
+ else {
6746
+ logger_1.logger.error("Database delete operation failed", {
6747
+ operation: 'deleteOneLlmConfiguration',
6748
+ model: 'LlmConfiguration',
6749
+ error: String(error),
6750
+ recordId: props.id,
6751
+ isRetryable: false,
6752
+ });
6753
+ }
6676
6754
  throw error;
6677
6755
  }
6678
6756
  }
@@ -6769,13 +6847,25 @@ exports.LlmConfiguration = {
6769
6847
  await new Promise(resolve => setTimeout(resolve, delay));
6770
6848
  continue;
6771
6849
  }
6772
- // Log structured error details and rethrow
6773
- logger_1.logger.error("Database get operation failed", {
6774
- operation: 'getLlmConfiguration',
6775
- model: 'LlmConfiguration',
6776
- error: String(error),
6777
- isRetryable: isConnectionError,
6778
- });
6850
+ // Log structured error details and rethrow (transient -> WARN).
6851
+ if (isConnectionError) {
6852
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
6853
+ operation: 'getLlmConfiguration',
6854
+ model: 'LlmConfiguration',
6855
+ error: String(error),
6856
+ isRetryable: true,
6857
+ transient: true,
6858
+ recoveryHint: "Upstream caller should retry on next cycle",
6859
+ });
6860
+ }
6861
+ else {
6862
+ logger_1.logger.error("Database get operation failed", {
6863
+ operation: 'getLlmConfiguration',
6864
+ model: 'LlmConfiguration',
6865
+ error: String(error),
6866
+ isRetryable: false,
6867
+ });
6868
+ }
6779
6869
  throw error;
6780
6870
  }
6781
6871
  }
@@ -6862,13 +6952,25 @@ exports.LlmConfiguration = {
6862
6952
  await new Promise(resolve => setTimeout(resolve, delay));
6863
6953
  continue;
6864
6954
  }
6865
- // Log structured error details and rethrow
6866
- logger_1.logger.error("Database getAll operation failed", {
6867
- operation: 'getAllLlmConfiguration',
6868
- model: 'LlmConfiguration',
6869
- error: String(error),
6870
- isRetryable: isConnectionError,
6871
- });
6955
+ // Log structured error details and rethrow (transient -> WARN).
6956
+ if (isConnectionError) {
6957
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
6958
+ operation: 'getAllLlmConfiguration',
6959
+ model: 'LlmConfiguration',
6960
+ error: String(error),
6961
+ isRetryable: true,
6962
+ transient: true,
6963
+ recoveryHint: "Upstream caller should retry on next cycle",
6964
+ });
6965
+ }
6966
+ else {
6967
+ logger_1.logger.error("Database getAll operation failed", {
6968
+ operation: 'getAllLlmConfiguration',
6969
+ model: 'LlmConfiguration',
6970
+ error: String(error),
6971
+ isRetryable: false,
6972
+ });
6973
+ }
6872
6974
  throw error;
6873
6975
  }
6874
6976
  }
@@ -6979,13 +7081,25 @@ exports.LlmConfiguration = {
6979
7081
  await new Promise(resolve => setTimeout(resolve, delay));
6980
7082
  continue;
6981
7083
  }
6982
- // Log structured error details and rethrow
6983
- logger_1.logger.error("Database findMany operation failed", {
6984
- operation: 'findManyLlmConfiguration',
6985
- model: 'LlmConfiguration',
6986
- error: String(error),
6987
- isRetryable: isConnectionError,
6988
- });
7084
+ // Log structured error details and rethrow (transient -> WARN).
7085
+ if (isConnectionError) {
7086
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
7087
+ operation: 'findManyLlmConfiguration',
7088
+ model: 'LlmConfiguration',
7089
+ error: String(error),
7090
+ isRetryable: true,
7091
+ transient: true,
7092
+ recoveryHint: "Upstream caller should retry on next cycle",
7093
+ });
7094
+ }
7095
+ else {
7096
+ logger_1.logger.error("Database findMany operation failed", {
7097
+ operation: 'findManyLlmConfiguration',
7098
+ model: 'LlmConfiguration',
7099
+ error: String(error),
7100
+ isRetryable: false,
7101
+ });
7102
+ }
6989
7103
  throw error;
6990
7104
  }
6991
7105
  }
@@ -154,13 +154,28 @@ exports.MLModelVersion = {
154
154
  await new Promise(resolve => setTimeout(resolve, delay));
155
155
  continue;
156
156
  }
157
- // Log structured error details and rethrow
158
- logger_1.logger.error("Database create operation failed", {
159
- operation: 'createOneMLModelVersion',
160
- model: 'MLModelVersion',
161
- error: String(error),
162
- isRetryable: isConnectionError,
163
- });
157
+ // Log structured error details and rethrow.
158
+ // Demote transient failures to WARN with explicit transient+recoveryHint
159
+ // metadata so log analytics can distinguish recoverable upstream retries
160
+ // from true defects.
161
+ if (isConnectionError) {
162
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
163
+ operation: 'createOneMLModelVersion',
164
+ model: 'MLModelVersion',
165
+ error: String(error),
166
+ isRetryable: true,
167
+ transient: true,
168
+ recoveryHint: "Upstream caller should retry on next cycle",
169
+ });
170
+ }
171
+ else {
172
+ logger_1.logger.error("Database create operation failed", {
173
+ operation: 'createOneMLModelVersion',
174
+ model: 'MLModelVersion',
175
+ error: String(error),
176
+ isRetryable: false,
177
+ });
178
+ }
164
179
  throw error;
165
180
  }
166
181
  }
@@ -290,13 +305,25 @@ exports.MLModelVersion = {
290
305
  await new Promise(resolve => setTimeout(resolve, delay));
291
306
  continue;
292
307
  }
293
- // Log structured error details and rethrow
294
- logger_1.logger.error("Database createMany operation failed", {
295
- operation: 'createManyMLModelVersion',
296
- model: 'MLModelVersion',
297
- error: String(error),
298
- isRetryable: isConnectionError,
299
- });
308
+ // Log structured error details and rethrow (transient -> WARN).
309
+ if (isConnectionError) {
310
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
311
+ operation: 'createManyMLModelVersion',
312
+ model: 'MLModelVersion',
313
+ error: String(error),
314
+ isRetryable: true,
315
+ transient: true,
316
+ recoveryHint: "Upstream caller should retry on next cycle",
317
+ });
318
+ }
319
+ else {
320
+ logger_1.logger.error("Database createMany operation failed", {
321
+ operation: 'createManyMLModelVersion',
322
+ model: 'MLModelVersion',
323
+ error: String(error),
324
+ isRetryable: false,
325
+ });
326
+ }
300
327
  throw error;
301
328
  }
302
329
  }
@@ -455,14 +482,27 @@ exports.MLModelVersion = {
455
482
  await new Promise(resolve => setTimeout(resolve, delay));
456
483
  continue;
457
484
  }
458
- // Log structured error details and rethrow
459
- logger_1.logger.error("Database update operation failed", {
460
- operation: 'updateOneMLModelVersion',
461
- model: 'MLModelVersion',
462
- error: String(error),
463
- recordId: props.id,
464
- isRetryable: isConnectionError,
465
- });
485
+ // Log structured error details and rethrow (transient -> WARN).
486
+ if (isConnectionError) {
487
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
488
+ operation: 'updateOneMLModelVersion',
489
+ model: 'MLModelVersion',
490
+ error: String(error),
491
+ recordId: props.id,
492
+ isRetryable: true,
493
+ transient: true,
494
+ recoveryHint: "Upstream caller should retry on next cycle",
495
+ });
496
+ }
497
+ else {
498
+ logger_1.logger.error("Database update operation failed", {
499
+ operation: 'updateOneMLModelVersion',
500
+ model: 'MLModelVersion',
501
+ error: String(error),
502
+ recordId: props.id,
503
+ isRetryable: false,
504
+ });
505
+ }
466
506
  throw error;
467
507
  }
468
508
  }
@@ -626,14 +666,27 @@ exports.MLModelVersion = {
626
666
  await new Promise(resolve => setTimeout(resolve, delay));
627
667
  continue;
628
668
  }
629
- // Log structured error details and rethrow
630
- logger_1.logger.error("Database upsert operation failed", {
631
- operation: 'upsertOneMLModelVersion',
632
- model: 'MLModelVersion',
633
- error: String(error),
634
- recordId: props.id,
635
- isRetryable: isConnectionError,
636
- });
669
+ // Log structured error details and rethrow (transient -> WARN).
670
+ if (isConnectionError) {
671
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
672
+ operation: 'upsertOneMLModelVersion',
673
+ model: 'MLModelVersion',
674
+ error: String(error),
675
+ recordId: props.id,
676
+ isRetryable: true,
677
+ transient: true,
678
+ recoveryHint: "Upstream caller should retry on next cycle",
679
+ });
680
+ }
681
+ else {
682
+ logger_1.logger.error("Database upsert operation failed", {
683
+ operation: 'upsertOneMLModelVersion',
684
+ model: 'MLModelVersion',
685
+ error: String(error),
686
+ recordId: props.id,
687
+ isRetryable: false,
688
+ });
689
+ }
637
690
  throw error;
638
691
  }
639
692
  }
@@ -790,13 +843,25 @@ exports.MLModelVersion = {
790
843
  await new Promise(resolve => setTimeout(resolve, delay));
791
844
  continue;
792
845
  }
793
- // Log structured error details and rethrow
794
- logger_1.logger.error("Database updateMany operation failed", {
795
- operation: 'updateManyMLModelVersion',
796
- model: 'MLModelVersion',
797
- error: String(error),
798
- isRetryable: isConnectionError,
799
- });
846
+ // Log structured error details and rethrow (transient -> WARN).
847
+ if (isConnectionError) {
848
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
849
+ operation: 'updateManyMLModelVersion',
850
+ model: 'MLModelVersion',
851
+ error: String(error),
852
+ isRetryable: true,
853
+ transient: true,
854
+ recoveryHint: "Upstream caller should retry on next cycle",
855
+ });
856
+ }
857
+ else {
858
+ logger_1.logger.error("Database updateMany operation failed", {
859
+ operation: 'updateManyMLModelVersion',
860
+ model: 'MLModelVersion',
861
+ error: String(error),
862
+ isRetryable: false,
863
+ });
864
+ }
800
865
  throw error;
801
866
  }
802
867
  }
@@ -919,14 +984,27 @@ exports.MLModelVersion = {
919
984
  await new Promise(resolve => setTimeout(resolve, delay));
920
985
  continue;
921
986
  }
922
- // Log structured error details and rethrow
923
- logger_1.logger.error("Database delete operation failed", {
924
- operation: 'deleteOneMLModelVersion',
925
- model: 'MLModelVersion',
926
- error: String(error),
927
- recordId: props.id,
928
- isRetryable: isConnectionError,
929
- });
987
+ // Log structured error details and rethrow (transient -> WARN).
988
+ if (isConnectionError) {
989
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
990
+ operation: 'deleteOneMLModelVersion',
991
+ model: 'MLModelVersion',
992
+ error: String(error),
993
+ recordId: props.id,
994
+ isRetryable: true,
995
+ transient: true,
996
+ recoveryHint: "Upstream caller should retry on next cycle",
997
+ });
998
+ }
999
+ else {
1000
+ logger_1.logger.error("Database delete operation failed", {
1001
+ operation: 'deleteOneMLModelVersion',
1002
+ model: 'MLModelVersion',
1003
+ error: String(error),
1004
+ recordId: props.id,
1005
+ isRetryable: false,
1006
+ });
1007
+ }
930
1008
  throw error;
931
1009
  }
932
1010
  }
@@ -1022,13 +1100,25 @@ exports.MLModelVersion = {
1022
1100
  await new Promise(resolve => setTimeout(resolve, delay));
1023
1101
  continue;
1024
1102
  }
1025
- // Log structured error details and rethrow
1026
- logger_1.logger.error("Database get operation failed", {
1027
- operation: 'getMLModelVersion',
1028
- model: 'MLModelVersion',
1029
- error: String(error),
1030
- isRetryable: isConnectionError,
1031
- });
1103
+ // Log structured error details and rethrow (transient -> WARN).
1104
+ if (isConnectionError) {
1105
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
1106
+ operation: 'getMLModelVersion',
1107
+ model: 'MLModelVersion',
1108
+ error: String(error),
1109
+ isRetryable: true,
1110
+ transient: true,
1111
+ recoveryHint: "Upstream caller should retry on next cycle",
1112
+ });
1113
+ }
1114
+ else {
1115
+ logger_1.logger.error("Database get operation failed", {
1116
+ operation: 'getMLModelVersion',
1117
+ model: 'MLModelVersion',
1118
+ error: String(error),
1119
+ isRetryable: false,
1120
+ });
1121
+ }
1032
1122
  throw error;
1033
1123
  }
1034
1124
  }
@@ -1115,13 +1205,25 @@ exports.MLModelVersion = {
1115
1205
  await new Promise(resolve => setTimeout(resolve, delay));
1116
1206
  continue;
1117
1207
  }
1118
- // Log structured error details and rethrow
1119
- logger_1.logger.error("Database getAll operation failed", {
1120
- operation: 'getAllMLModelVersion',
1121
- model: 'MLModelVersion',
1122
- error: String(error),
1123
- isRetryable: isConnectionError,
1124
- });
1208
+ // Log structured error details and rethrow (transient -> WARN).
1209
+ if (isConnectionError) {
1210
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
1211
+ operation: 'getAllMLModelVersion',
1212
+ model: 'MLModelVersion',
1213
+ error: String(error),
1214
+ isRetryable: true,
1215
+ transient: true,
1216
+ recoveryHint: "Upstream caller should retry on next cycle",
1217
+ });
1218
+ }
1219
+ else {
1220
+ logger_1.logger.error("Database getAll operation failed", {
1221
+ operation: 'getAllMLModelVersion',
1222
+ model: 'MLModelVersion',
1223
+ error: String(error),
1224
+ isRetryable: false,
1225
+ });
1226
+ }
1125
1227
  throw error;
1126
1228
  }
1127
1229
  }
@@ -1229,13 +1331,25 @@ exports.MLModelVersion = {
1229
1331
  await new Promise(resolve => setTimeout(resolve, delay));
1230
1332
  continue;
1231
1333
  }
1232
- // Log structured error details and rethrow
1233
- logger_1.logger.error("Database findMany operation failed", {
1234
- operation: 'findManyMLModelVersion',
1235
- model: 'MLModelVersion',
1236
- error: String(error),
1237
- isRetryable: isConnectionError,
1238
- });
1334
+ // Log structured error details and rethrow (transient -> WARN).
1335
+ if (isConnectionError) {
1336
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
1337
+ operation: 'findManyMLModelVersion',
1338
+ model: 'MLModelVersion',
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 findMany operation failed", {
1347
+ operation: 'findManyMLModelVersion',
1348
+ model: 'MLModelVersion',
1349
+ error: String(error),
1350
+ isRetryable: false,
1351
+ });
1352
+ }
1239
1353
  throw error;
1240
1354
  }
1241
1355
  }