@adaptic/backend-legacy 0.0.959 → 0.0.961

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 (258) 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/esm/ABTest.d.ts.map +1 -1
  66. package/esm/ABTest.js.map +1 -1
  67. package/esm/ABTest.mjs +180 -66
  68. package/esm/Account.d.ts.map +1 -1
  69. package/esm/Account.js.map +1 -1
  70. package/esm/Account.mjs +180 -66
  71. package/esm/AccountDecisionRecord.d.ts.map +1 -1
  72. package/esm/AccountDecisionRecord.js.map +1 -1
  73. package/esm/AccountDecisionRecord.mjs +180 -66
  74. package/esm/AccountLinkingRequest.d.ts.map +1 -1
  75. package/esm/AccountLinkingRequest.js.map +1 -1
  76. package/esm/AccountLinkingRequest.mjs +180 -66
  77. package/esm/Action.d.ts.map +1 -1
  78. package/esm/Action.js.map +1 -1
  79. package/esm/Action.mjs +180 -66
  80. package/esm/Alert.d.ts.map +1 -1
  81. package/esm/Alert.js.map +1 -1
  82. package/esm/Alert.mjs +180 -66
  83. package/esm/Allocation.d.ts.map +1 -1
  84. package/esm/Allocation.js.map +1 -1
  85. package/esm/Allocation.mjs +180 -66
  86. package/esm/AlpacaAccount.d.ts.map +1 -1
  87. package/esm/AlpacaAccount.js.map +1 -1
  88. package/esm/AlpacaAccount.mjs +180 -66
  89. package/esm/AnalyticsConfiguration.d.ts.map +1 -1
  90. package/esm/AnalyticsConfiguration.js.map +1 -1
  91. package/esm/AnalyticsConfiguration.mjs +180 -66
  92. package/esm/AnalyticsSnapshot.d.ts.map +1 -1
  93. package/esm/AnalyticsSnapshot.js.map +1 -1
  94. package/esm/AnalyticsSnapshot.mjs +180 -66
  95. package/esm/Asset.d.ts.map +1 -1
  96. package/esm/Asset.js.map +1 -1
  97. package/esm/Asset.mjs +180 -66
  98. package/esm/AuditLog.d.ts.map +1 -1
  99. package/esm/AuditLog.js.map +1 -1
  100. package/esm/AuditLog.mjs +180 -66
  101. package/esm/Authenticator.d.ts.map +1 -1
  102. package/esm/Authenticator.js.map +1 -1
  103. package/esm/Authenticator.mjs +180 -66
  104. package/esm/Configuration.d.ts.map +1 -1
  105. package/esm/Configuration.js.map +1 -1
  106. package/esm/Configuration.mjs +180 -66
  107. package/esm/ConflictEvent.d.ts.map +1 -1
  108. package/esm/ConflictEvent.js.map +1 -1
  109. package/esm/ConflictEvent.mjs +180 -66
  110. package/esm/ConnectionHealthSnapshot.d.ts.map +1 -1
  111. package/esm/ConnectionHealthSnapshot.js.map +1 -1
  112. package/esm/ConnectionHealthSnapshot.mjs +180 -66
  113. package/esm/Customer.d.ts.map +1 -1
  114. package/esm/Customer.js.map +1 -1
  115. package/esm/Customer.mjs +180 -66
  116. package/esm/DeadLetterMessage.d.ts.map +1 -1
  117. package/esm/DeadLetterMessage.js.map +1 -1
  118. package/esm/DeadLetterMessage.mjs +180 -66
  119. package/esm/DecisionMemorySummary.d.ts.map +1 -1
  120. package/esm/DecisionMemorySummary.js.map +1 -1
  121. package/esm/DecisionMemorySummary.mjs +180 -66
  122. package/esm/EconomicEvent.d.ts.map +1 -1
  123. package/esm/EconomicEvent.js.map +1 -1
  124. package/esm/EconomicEvent.mjs +180 -66
  125. package/esm/EquityBar.d.ts.map +1 -1
  126. package/esm/EquityBar.js.map +1 -1
  127. package/esm/EquityBar.mjs +180 -66
  128. package/esm/Event.d.ts.map +1 -1
  129. package/esm/Event.js.map +1 -1
  130. package/esm/Event.mjs +180 -66
  131. package/esm/EventSnapshot.d.ts.map +1 -1
  132. package/esm/EventSnapshot.js.map +1 -1
  133. package/esm/EventSnapshot.mjs +180 -66
  134. package/esm/FeatureImportanceAnalysis.d.ts.map +1 -1
  135. package/esm/FeatureImportanceAnalysis.js.map +1 -1
  136. package/esm/FeatureImportanceAnalysis.mjs +180 -66
  137. package/esm/InstitutionalFlowSignal.d.ts.map +1 -1
  138. package/esm/InstitutionalFlowSignal.js.map +1 -1
  139. package/esm/InstitutionalFlowSignal.mjs +180 -66
  140. package/esm/InstitutionalHolding.d.ts.map +1 -1
  141. package/esm/InstitutionalHolding.js.map +1 -1
  142. package/esm/InstitutionalHolding.mjs +180 -66
  143. package/esm/InstitutionalSentimentAlerts.d.ts.map +1 -1
  144. package/esm/InstitutionalSentimentAlerts.js.map +1 -1
  145. package/esm/InstitutionalSentimentAlerts.mjs +180 -66
  146. package/esm/InstitutionalSentimentErrors.d.ts.map +1 -1
  147. package/esm/InstitutionalSentimentErrors.js.map +1 -1
  148. package/esm/InstitutionalSentimentErrors.mjs +180 -66
  149. package/esm/InstitutionalSentimentHistory.d.ts.map +1 -1
  150. package/esm/InstitutionalSentimentHistory.js.map +1 -1
  151. package/esm/InstitutionalSentimentHistory.mjs +180 -66
  152. package/esm/InstitutionalSentimentMetrics.d.ts.map +1 -1
  153. package/esm/InstitutionalSentimentMetrics.js.map +1 -1
  154. package/esm/InstitutionalSentimentMetrics.mjs +180 -66
  155. package/esm/InviteToken.d.ts.map +1 -1
  156. package/esm/InviteToken.js.map +1 -1
  157. package/esm/InviteToken.mjs +180 -66
  158. package/esm/LinkedProvider.d.ts.map +1 -1
  159. package/esm/LinkedProvider.js.map +1 -1
  160. package/esm/LinkedProvider.mjs +180 -66
  161. package/esm/LlmConfiguration.d.ts.map +1 -1
  162. package/esm/LlmConfiguration.js.map +1 -1
  163. package/esm/LlmConfiguration.mjs +180 -66
  164. package/esm/MLModelVersion.d.ts.map +1 -1
  165. package/esm/MLModelVersion.js.map +1 -1
  166. package/esm/MLModelVersion.mjs +180 -66
  167. package/esm/MLTrainingData.d.ts.map +1 -1
  168. package/esm/MLTrainingData.js.map +1 -1
  169. package/esm/MLTrainingData.mjs +180 -66
  170. package/esm/MarketSentiment.d.ts.map +1 -1
  171. package/esm/MarketSentiment.js.map +1 -1
  172. package/esm/MarketSentiment.mjs +180 -66
  173. package/esm/ModelArtifact.d.ts.map +1 -1
  174. package/esm/ModelArtifact.js.map +1 -1
  175. package/esm/ModelArtifact.mjs +180 -66
  176. package/esm/ModelVersion.d.ts.map +1 -1
  177. package/esm/ModelVersion.js.map +1 -1
  178. package/esm/ModelVersion.mjs +180 -66
  179. package/esm/ModelVersionArtifact.d.ts.map +1 -1
  180. package/esm/ModelVersionArtifact.js.map +1 -1
  181. package/esm/ModelVersionArtifact.mjs +180 -66
  182. package/esm/NewsArticle.d.ts.map +1 -1
  183. package/esm/NewsArticle.js.map +1 -1
  184. package/esm/NewsArticle.mjs +180 -66
  185. package/esm/NewsArticleAssetSentiment.d.ts.map +1 -1
  186. package/esm/NewsArticleAssetSentiment.js.map +1 -1
  187. package/esm/NewsArticleAssetSentiment.mjs +180 -66
  188. package/esm/OptionsContract.d.ts.map +1 -1
  189. package/esm/OptionsContract.js.map +1 -1
  190. package/esm/OptionsContract.mjs +180 -66
  191. package/esm/OptionsGreeksHistory.d.ts.map +1 -1
  192. package/esm/OptionsGreeksHistory.js.map +1 -1
  193. package/esm/OptionsGreeksHistory.mjs +180 -66
  194. package/esm/OptionsPosition.d.ts.map +1 -1
  195. package/esm/OptionsPosition.js.map +1 -1
  196. package/esm/OptionsPosition.mjs +180 -66
  197. package/esm/OptionsPositionEvent.d.ts.map +1 -1
  198. package/esm/OptionsPositionEvent.js.map +1 -1
  199. package/esm/OptionsPositionEvent.mjs +180 -66
  200. package/esm/OptionsTradeExecution.d.ts.map +1 -1
  201. package/esm/OptionsTradeExecution.js.map +1 -1
  202. package/esm/OptionsTradeExecution.mjs +180 -66
  203. package/esm/PolicyOverlay.d.ts.map +1 -1
  204. package/esm/PolicyOverlay.js.map +1 -1
  205. package/esm/PolicyOverlay.mjs +180 -66
  206. package/esm/PortfolioGreeksHistory.d.ts.map +1 -1
  207. package/esm/PortfolioGreeksHistory.js.map +1 -1
  208. package/esm/PortfolioGreeksHistory.mjs +180 -66
  209. package/esm/ScheduledOptionOrder.d.ts.map +1 -1
  210. package/esm/ScheduledOptionOrder.js.map +1 -1
  211. package/esm/ScheduledOptionOrder.mjs +180 -66
  212. package/esm/Session.d.ts.map +1 -1
  213. package/esm/Session.js.map +1 -1
  214. package/esm/Session.mjs +180 -66
  215. package/esm/SignalGeneratorMetrics.d.ts.map +1 -1
  216. package/esm/SignalGeneratorMetrics.js.map +1 -1
  217. package/esm/SignalGeneratorMetrics.mjs +180 -66
  218. package/esm/SignalLineage.d.ts.map +1 -1
  219. package/esm/SignalLineage.js.map +1 -1
  220. package/esm/SignalLineage.mjs +180 -66
  221. package/esm/SignalOutcome.d.ts.map +1 -1
  222. package/esm/SignalOutcome.js.map +1 -1
  223. package/esm/SignalOutcome.mjs +180 -66
  224. package/esm/SignalPriorityQueue.d.ts.map +1 -1
  225. package/esm/SignalPriorityQueue.js.map +1 -1
  226. package/esm/SignalPriorityQueue.mjs +180 -66
  227. package/esm/SyncEvent.d.ts.map +1 -1
  228. package/esm/SyncEvent.js.map +1 -1
  229. package/esm/SyncEvent.mjs +180 -66
  230. package/esm/SystemAlert.d.ts.map +1 -1
  231. package/esm/SystemAlert.js.map +1 -1
  232. package/esm/SystemAlert.mjs +180 -66
  233. package/esm/Trade.d.ts.map +1 -1
  234. package/esm/Trade.js.map +1 -1
  235. package/esm/Trade.mjs +180 -66
  236. package/esm/TradeAuditEvent.d.ts.map +1 -1
  237. package/esm/TradeAuditEvent.js.map +1 -1
  238. package/esm/TradeAuditEvent.mjs +180 -66
  239. package/esm/TradeExecutionHistory.d.ts.map +1 -1
  240. package/esm/TradeExecutionHistory.js.map +1 -1
  241. package/esm/TradeExecutionHistory.mjs +180 -66
  242. package/esm/TradeOutcome.d.ts.map +1 -1
  243. package/esm/TradeOutcome.js.map +1 -1
  244. package/esm/TradeOutcome.mjs +180 -66
  245. package/esm/TradingPolicy.d.ts.map +1 -1
  246. package/esm/TradingPolicy.js.map +1 -1
  247. package/esm/TradingPolicy.mjs +180 -66
  248. package/esm/User.d.ts.map +1 -1
  249. package/esm/User.js.map +1 -1
  250. package/esm/User.mjs +180 -66
  251. package/esm/VerificationToken.d.ts.map +1 -1
  252. package/esm/VerificationToken.js.map +1 -1
  253. package/esm/VerificationToken.mjs +180 -66
  254. package/esm/WaitlistEntry.d.ts.map +1 -1
  255. package/esm/WaitlistEntry.js.map +1 -1
  256. package/esm/WaitlistEntry.mjs +180 -66
  257. package/esm/index.d.ts.map +1 -1
  258. package/package.json +1 -1
@@ -150,13 +150,28 @@ exports.InstitutionalSentimentAlerts = {
150
150
  await new Promise(resolve => setTimeout(resolve, delay));
151
151
  continue;
152
152
  }
153
- // Log structured error details and rethrow
154
- logger_1.logger.error("Database create operation failed", {
155
- operation: 'createOneInstitutionalSentimentAlerts',
156
- model: 'InstitutionalSentimentAlerts',
157
- error: String(error),
158
- isRetryable: isConnectionError,
159
- });
153
+ // Log structured error details and rethrow.
154
+ // Demote transient failures to WARN with explicit transient+recoveryHint
155
+ // metadata so log analytics can distinguish recoverable upstream retries
156
+ // from true defects.
157
+ if (isConnectionError) {
158
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
159
+ operation: 'createOneInstitutionalSentimentAlerts',
160
+ model: 'InstitutionalSentimentAlerts',
161
+ error: String(error),
162
+ isRetryable: true,
163
+ transient: true,
164
+ recoveryHint: "Upstream caller should retry on next cycle",
165
+ });
166
+ }
167
+ else {
168
+ logger_1.logger.error("Database create operation failed", {
169
+ operation: 'createOneInstitutionalSentimentAlerts',
170
+ model: 'InstitutionalSentimentAlerts',
171
+ error: String(error),
172
+ isRetryable: false,
173
+ });
174
+ }
160
175
  throw error;
161
176
  }
162
177
  }
@@ -283,13 +298,25 @@ exports.InstitutionalSentimentAlerts = {
283
298
  await new Promise(resolve => setTimeout(resolve, delay));
284
299
  continue;
285
300
  }
286
- // Log structured error details and rethrow
287
- logger_1.logger.error("Database createMany operation failed", {
288
- operation: 'createManyInstitutionalSentimentAlerts',
289
- model: 'InstitutionalSentimentAlerts',
290
- error: String(error),
291
- isRetryable: isConnectionError,
292
- });
301
+ // Log structured error details and rethrow (transient -> WARN).
302
+ if (isConnectionError) {
303
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
304
+ operation: 'createManyInstitutionalSentimentAlerts',
305
+ model: 'InstitutionalSentimentAlerts',
306
+ error: String(error),
307
+ isRetryable: true,
308
+ transient: true,
309
+ recoveryHint: "Upstream caller should retry on next cycle",
310
+ });
311
+ }
312
+ else {
313
+ logger_1.logger.error("Database createMany operation failed", {
314
+ operation: 'createManyInstitutionalSentimentAlerts',
315
+ model: 'InstitutionalSentimentAlerts',
316
+ error: String(error),
317
+ isRetryable: false,
318
+ });
319
+ }
293
320
  throw error;
294
321
  }
295
322
  }
@@ -447,14 +474,27 @@ exports.InstitutionalSentimentAlerts = {
447
474
  await new Promise(resolve => setTimeout(resolve, delay));
448
475
  continue;
449
476
  }
450
- // Log structured error details and rethrow
451
- logger_1.logger.error("Database update operation failed", {
452
- operation: 'updateOneInstitutionalSentimentAlerts',
453
- model: 'InstitutionalSentimentAlerts',
454
- error: String(error),
455
- recordId: props.id,
456
- isRetryable: isConnectionError,
457
- });
477
+ // Log structured error details and rethrow (transient -> WARN).
478
+ if (isConnectionError) {
479
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
480
+ operation: 'updateOneInstitutionalSentimentAlerts',
481
+ model: 'InstitutionalSentimentAlerts',
482
+ error: String(error),
483
+ recordId: props.id,
484
+ isRetryable: true,
485
+ transient: true,
486
+ recoveryHint: "Upstream caller should retry on next cycle",
487
+ });
488
+ }
489
+ else {
490
+ logger_1.logger.error("Database update operation failed", {
491
+ operation: 'updateOneInstitutionalSentimentAlerts',
492
+ model: 'InstitutionalSentimentAlerts',
493
+ error: String(error),
494
+ recordId: props.id,
495
+ isRetryable: false,
496
+ });
497
+ }
458
498
  throw error;
459
499
  }
460
500
  }
@@ -617,14 +657,27 @@ exports.InstitutionalSentimentAlerts = {
617
657
  await new Promise(resolve => setTimeout(resolve, delay));
618
658
  continue;
619
659
  }
620
- // Log structured error details and rethrow
621
- logger_1.logger.error("Database upsert operation failed", {
622
- operation: 'upsertOneInstitutionalSentimentAlerts',
623
- model: 'InstitutionalSentimentAlerts',
624
- error: String(error),
625
- recordId: props.id,
626
- isRetryable: isConnectionError,
627
- });
660
+ // Log structured error details and rethrow (transient -> WARN).
661
+ if (isConnectionError) {
662
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
663
+ operation: 'upsertOneInstitutionalSentimentAlerts',
664
+ model: 'InstitutionalSentimentAlerts',
665
+ error: String(error),
666
+ recordId: props.id,
667
+ isRetryable: true,
668
+ transient: true,
669
+ recoveryHint: "Upstream caller should retry on next cycle",
670
+ });
671
+ }
672
+ else {
673
+ logger_1.logger.error("Database upsert operation failed", {
674
+ operation: 'upsertOneInstitutionalSentimentAlerts',
675
+ model: 'InstitutionalSentimentAlerts',
676
+ error: String(error),
677
+ recordId: props.id,
678
+ isRetryable: false,
679
+ });
680
+ }
628
681
  throw error;
629
682
  }
630
683
  }
@@ -780,13 +833,25 @@ exports.InstitutionalSentimentAlerts = {
780
833
  await new Promise(resolve => setTimeout(resolve, delay));
781
834
  continue;
782
835
  }
783
- // Log structured error details and rethrow
784
- logger_1.logger.error("Database updateMany operation failed", {
785
- operation: 'updateManyInstitutionalSentimentAlerts',
786
- model: 'InstitutionalSentimentAlerts',
787
- error: String(error),
788
- isRetryable: isConnectionError,
789
- });
836
+ // Log structured error details and rethrow (transient -> WARN).
837
+ if (isConnectionError) {
838
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
839
+ operation: 'updateManyInstitutionalSentimentAlerts',
840
+ model: 'InstitutionalSentimentAlerts',
841
+ error: String(error),
842
+ isRetryable: true,
843
+ transient: true,
844
+ recoveryHint: "Upstream caller should retry on next cycle",
845
+ });
846
+ }
847
+ else {
848
+ logger_1.logger.error("Database updateMany operation failed", {
849
+ operation: 'updateManyInstitutionalSentimentAlerts',
850
+ model: 'InstitutionalSentimentAlerts',
851
+ error: String(error),
852
+ isRetryable: false,
853
+ });
854
+ }
790
855
  throw error;
791
856
  }
792
857
  }
@@ -909,14 +974,27 @@ exports.InstitutionalSentimentAlerts = {
909
974
  await new Promise(resolve => setTimeout(resolve, delay));
910
975
  continue;
911
976
  }
912
- // Log structured error details and rethrow
913
- logger_1.logger.error("Database delete operation failed", {
914
- operation: 'deleteOneInstitutionalSentimentAlerts',
915
- model: 'InstitutionalSentimentAlerts',
916
- error: String(error),
917
- recordId: props.id,
918
- isRetryable: isConnectionError,
919
- });
977
+ // Log structured error details and rethrow (transient -> WARN).
978
+ if (isConnectionError) {
979
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
980
+ operation: 'deleteOneInstitutionalSentimentAlerts',
981
+ model: 'InstitutionalSentimentAlerts',
982
+ error: String(error),
983
+ recordId: props.id,
984
+ isRetryable: true,
985
+ transient: true,
986
+ recoveryHint: "Upstream caller should retry on next cycle",
987
+ });
988
+ }
989
+ else {
990
+ logger_1.logger.error("Database delete operation failed", {
991
+ operation: 'deleteOneInstitutionalSentimentAlerts',
992
+ model: 'InstitutionalSentimentAlerts',
993
+ error: String(error),
994
+ recordId: props.id,
995
+ isRetryable: false,
996
+ });
997
+ }
920
998
  throw error;
921
999
  }
922
1000
  }
@@ -1015,13 +1093,25 @@ exports.InstitutionalSentimentAlerts = {
1015
1093
  await new Promise(resolve => setTimeout(resolve, delay));
1016
1094
  continue;
1017
1095
  }
1018
- // Log structured error details and rethrow
1019
- logger_1.logger.error("Database get operation failed", {
1020
- operation: 'getInstitutionalSentimentAlerts',
1021
- model: 'InstitutionalSentimentAlerts',
1022
- error: String(error),
1023
- isRetryable: isConnectionError,
1024
- });
1096
+ // Log structured error details and rethrow (transient -> WARN).
1097
+ if (isConnectionError) {
1098
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
1099
+ operation: 'getInstitutionalSentimentAlerts',
1100
+ model: 'InstitutionalSentimentAlerts',
1101
+ error: String(error),
1102
+ isRetryable: true,
1103
+ transient: true,
1104
+ recoveryHint: "Upstream caller should retry on next cycle",
1105
+ });
1106
+ }
1107
+ else {
1108
+ logger_1.logger.error("Database get operation failed", {
1109
+ operation: 'getInstitutionalSentimentAlerts',
1110
+ model: 'InstitutionalSentimentAlerts',
1111
+ error: String(error),
1112
+ isRetryable: false,
1113
+ });
1114
+ }
1025
1115
  throw error;
1026
1116
  }
1027
1117
  }
@@ -1108,13 +1198,25 @@ exports.InstitutionalSentimentAlerts = {
1108
1198
  await new Promise(resolve => setTimeout(resolve, delay));
1109
1199
  continue;
1110
1200
  }
1111
- // Log structured error details and rethrow
1112
- logger_1.logger.error("Database getAll operation failed", {
1113
- operation: 'getAllInstitutionalSentimentAlerts',
1114
- model: 'InstitutionalSentimentAlerts',
1115
- error: String(error),
1116
- isRetryable: isConnectionError,
1117
- });
1201
+ // Log structured error details and rethrow (transient -> WARN).
1202
+ if (isConnectionError) {
1203
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
1204
+ operation: 'getAllInstitutionalSentimentAlerts',
1205
+ model: 'InstitutionalSentimentAlerts',
1206
+ error: String(error),
1207
+ isRetryable: true,
1208
+ transient: true,
1209
+ recoveryHint: "Upstream caller should retry on next cycle",
1210
+ });
1211
+ }
1212
+ else {
1213
+ logger_1.logger.error("Database getAll operation failed", {
1214
+ operation: 'getAllInstitutionalSentimentAlerts',
1215
+ model: 'InstitutionalSentimentAlerts',
1216
+ error: String(error),
1217
+ isRetryable: false,
1218
+ });
1219
+ }
1118
1220
  throw error;
1119
1221
  }
1120
1222
  }
@@ -1225,13 +1327,25 @@ exports.InstitutionalSentimentAlerts = {
1225
1327
  await new Promise(resolve => setTimeout(resolve, delay));
1226
1328
  continue;
1227
1329
  }
1228
- // Log structured error details and rethrow
1229
- logger_1.logger.error("Database findMany operation failed", {
1230
- operation: 'findManyInstitutionalSentimentAlerts',
1231
- model: 'InstitutionalSentimentAlerts',
1232
- error: String(error),
1233
- isRetryable: isConnectionError,
1234
- });
1330
+ // Log structured error details and rethrow (transient -> WARN).
1331
+ if (isConnectionError) {
1332
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
1333
+ operation: 'findManyInstitutionalSentimentAlerts',
1334
+ model: 'InstitutionalSentimentAlerts',
1335
+ error: String(error),
1336
+ isRetryable: true,
1337
+ transient: true,
1338
+ recoveryHint: "Upstream caller should retry on next cycle",
1339
+ });
1340
+ }
1341
+ else {
1342
+ logger_1.logger.error("Database findMany operation failed", {
1343
+ operation: 'findManyInstitutionalSentimentAlerts',
1344
+ model: 'InstitutionalSentimentAlerts',
1345
+ error: String(error),
1346
+ isRetryable: false,
1347
+ });
1348
+ }
1235
1349
  throw error;
1236
1350
  }
1237
1351
  }
@@ -141,13 +141,28 @@ exports.InstitutionalSentimentErrors = {
141
141
  await new Promise(resolve => setTimeout(resolve, delay));
142
142
  continue;
143
143
  }
144
- // Log structured error details and rethrow
145
- logger_1.logger.error("Database create operation failed", {
146
- operation: 'createOneInstitutionalSentimentErrors',
147
- model: 'InstitutionalSentimentErrors',
148
- error: String(error),
149
- isRetryable: isConnectionError,
150
- });
144
+ // Log structured error details and rethrow.
145
+ // Demote transient failures to WARN with explicit transient+recoveryHint
146
+ // metadata so log analytics can distinguish recoverable upstream retries
147
+ // from true defects.
148
+ if (isConnectionError) {
149
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
150
+ operation: 'createOneInstitutionalSentimentErrors',
151
+ model: 'InstitutionalSentimentErrors',
152
+ error: String(error),
153
+ isRetryable: true,
154
+ transient: true,
155
+ recoveryHint: "Upstream caller should retry on next cycle",
156
+ });
157
+ }
158
+ else {
159
+ logger_1.logger.error("Database create operation failed", {
160
+ operation: 'createOneInstitutionalSentimentErrors',
161
+ model: 'InstitutionalSentimentErrors',
162
+ error: String(error),
163
+ isRetryable: false,
164
+ });
165
+ }
151
166
  throw error;
152
167
  }
153
168
  }
@@ -270,13 +285,25 @@ exports.InstitutionalSentimentErrors = {
270
285
  await new Promise(resolve => setTimeout(resolve, delay));
271
286
  continue;
272
287
  }
273
- // Log structured error details and rethrow
274
- logger_1.logger.error("Database createMany operation failed", {
275
- operation: 'createManyInstitutionalSentimentErrors',
276
- model: 'InstitutionalSentimentErrors',
277
- error: String(error),
278
- isRetryable: isConnectionError,
279
- });
288
+ // Log structured error details and rethrow (transient -> WARN).
289
+ if (isConnectionError) {
290
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
291
+ operation: 'createManyInstitutionalSentimentErrors',
292
+ model: 'InstitutionalSentimentErrors',
293
+ error: String(error),
294
+ isRetryable: true,
295
+ transient: true,
296
+ recoveryHint: "Upstream caller should retry on next cycle",
297
+ });
298
+ }
299
+ else {
300
+ logger_1.logger.error("Database createMany operation failed", {
301
+ operation: 'createManyInstitutionalSentimentErrors',
302
+ model: 'InstitutionalSentimentErrors',
303
+ error: String(error),
304
+ isRetryable: false,
305
+ });
306
+ }
280
307
  throw error;
281
308
  }
282
309
  }
@@ -419,14 +446,27 @@ exports.InstitutionalSentimentErrors = {
419
446
  await new Promise(resolve => setTimeout(resolve, delay));
420
447
  continue;
421
448
  }
422
- // Log structured error details and rethrow
423
- logger_1.logger.error("Database update operation failed", {
424
- operation: 'updateOneInstitutionalSentimentErrors',
425
- model: 'InstitutionalSentimentErrors',
426
- error: String(error),
427
- recordId: props.id,
428
- isRetryable: isConnectionError,
429
- });
449
+ // Log structured error details and rethrow (transient -> WARN).
450
+ if (isConnectionError) {
451
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
452
+ operation: 'updateOneInstitutionalSentimentErrors',
453
+ model: 'InstitutionalSentimentErrors',
454
+ error: String(error),
455
+ recordId: props.id,
456
+ isRetryable: true,
457
+ transient: true,
458
+ recoveryHint: "Upstream caller should retry on next cycle",
459
+ });
460
+ }
461
+ else {
462
+ logger_1.logger.error("Database update operation failed", {
463
+ operation: 'updateOneInstitutionalSentimentErrors',
464
+ model: 'InstitutionalSentimentErrors',
465
+ error: String(error),
466
+ recordId: props.id,
467
+ isRetryable: false,
468
+ });
469
+ }
430
470
  throw error;
431
471
  }
432
472
  }
@@ -570,14 +610,27 @@ exports.InstitutionalSentimentErrors = {
570
610
  await new Promise(resolve => setTimeout(resolve, delay));
571
611
  continue;
572
612
  }
573
- // Log structured error details and rethrow
574
- logger_1.logger.error("Database upsert operation failed", {
575
- operation: 'upsertOneInstitutionalSentimentErrors',
576
- model: 'InstitutionalSentimentErrors',
577
- error: String(error),
578
- recordId: props.id,
579
- isRetryable: isConnectionError,
580
- });
613
+ // Log structured error details and rethrow (transient -> WARN).
614
+ if (isConnectionError) {
615
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
616
+ operation: 'upsertOneInstitutionalSentimentErrors',
617
+ model: 'InstitutionalSentimentErrors',
618
+ error: String(error),
619
+ recordId: props.id,
620
+ isRetryable: true,
621
+ transient: true,
622
+ recoveryHint: "Upstream caller should retry on next cycle",
623
+ });
624
+ }
625
+ else {
626
+ logger_1.logger.error("Database upsert operation failed", {
627
+ operation: 'upsertOneInstitutionalSentimentErrors',
628
+ model: 'InstitutionalSentimentErrors',
629
+ error: String(error),
630
+ recordId: props.id,
631
+ isRetryable: false,
632
+ });
633
+ }
581
634
  throw error;
582
635
  }
583
636
  }
@@ -718,13 +771,25 @@ exports.InstitutionalSentimentErrors = {
718
771
  await new Promise(resolve => setTimeout(resolve, delay));
719
772
  continue;
720
773
  }
721
- // Log structured error details and rethrow
722
- logger_1.logger.error("Database updateMany operation failed", {
723
- operation: 'updateManyInstitutionalSentimentErrors',
724
- model: 'InstitutionalSentimentErrors',
725
- error: String(error),
726
- isRetryable: isConnectionError,
727
- });
774
+ // Log structured error details and rethrow (transient -> WARN).
775
+ if (isConnectionError) {
776
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
777
+ operation: 'updateManyInstitutionalSentimentErrors',
778
+ model: 'InstitutionalSentimentErrors',
779
+ error: String(error),
780
+ isRetryable: true,
781
+ transient: true,
782
+ recoveryHint: "Upstream caller should retry on next cycle",
783
+ });
784
+ }
785
+ else {
786
+ logger_1.logger.error("Database updateMany operation failed", {
787
+ operation: 'updateManyInstitutionalSentimentErrors',
788
+ model: 'InstitutionalSentimentErrors',
789
+ error: String(error),
790
+ isRetryable: false,
791
+ });
792
+ }
728
793
  throw error;
729
794
  }
730
795
  }
@@ -847,14 +912,27 @@ exports.InstitutionalSentimentErrors = {
847
912
  await new Promise(resolve => setTimeout(resolve, delay));
848
913
  continue;
849
914
  }
850
- // Log structured error details and rethrow
851
- logger_1.logger.error("Database delete operation failed", {
852
- operation: 'deleteOneInstitutionalSentimentErrors',
853
- model: 'InstitutionalSentimentErrors',
854
- error: String(error),
855
- recordId: props.id,
856
- isRetryable: isConnectionError,
857
- });
915
+ // Log structured error details and rethrow (transient -> WARN).
916
+ if (isConnectionError) {
917
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
918
+ operation: 'deleteOneInstitutionalSentimentErrors',
919
+ model: 'InstitutionalSentimentErrors',
920
+ error: String(error),
921
+ recordId: props.id,
922
+ isRetryable: true,
923
+ transient: true,
924
+ recoveryHint: "Upstream caller should retry on next cycle",
925
+ });
926
+ }
927
+ else {
928
+ logger_1.logger.error("Database delete operation failed", {
929
+ operation: 'deleteOneInstitutionalSentimentErrors',
930
+ model: 'InstitutionalSentimentErrors',
931
+ error: String(error),
932
+ recordId: props.id,
933
+ isRetryable: false,
934
+ });
935
+ }
858
936
  throw error;
859
937
  }
860
938
  }
@@ -950,13 +1028,25 @@ exports.InstitutionalSentimentErrors = {
950
1028
  await new Promise(resolve => setTimeout(resolve, delay));
951
1029
  continue;
952
1030
  }
953
- // Log structured error details and rethrow
954
- logger_1.logger.error("Database get operation failed", {
955
- operation: 'getInstitutionalSentimentErrors',
956
- model: 'InstitutionalSentimentErrors',
957
- error: String(error),
958
- isRetryable: isConnectionError,
959
- });
1031
+ // Log structured error details and rethrow (transient -> WARN).
1032
+ if (isConnectionError) {
1033
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
1034
+ operation: 'getInstitutionalSentimentErrors',
1035
+ model: 'InstitutionalSentimentErrors',
1036
+ error: String(error),
1037
+ isRetryable: true,
1038
+ transient: true,
1039
+ recoveryHint: "Upstream caller should retry on next cycle",
1040
+ });
1041
+ }
1042
+ else {
1043
+ logger_1.logger.error("Database get operation failed", {
1044
+ operation: 'getInstitutionalSentimentErrors',
1045
+ model: 'InstitutionalSentimentErrors',
1046
+ error: String(error),
1047
+ isRetryable: false,
1048
+ });
1049
+ }
960
1050
  throw error;
961
1051
  }
962
1052
  }
@@ -1043,13 +1133,25 @@ exports.InstitutionalSentimentErrors = {
1043
1133
  await new Promise(resolve => setTimeout(resolve, delay));
1044
1134
  continue;
1045
1135
  }
1046
- // Log structured error details and rethrow
1047
- logger_1.logger.error("Database getAll operation failed", {
1048
- operation: 'getAllInstitutionalSentimentErrors',
1049
- model: 'InstitutionalSentimentErrors',
1050
- error: String(error),
1051
- isRetryable: isConnectionError,
1052
- });
1136
+ // Log structured error details and rethrow (transient -> WARN).
1137
+ if (isConnectionError) {
1138
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
1139
+ operation: 'getAllInstitutionalSentimentErrors',
1140
+ model: 'InstitutionalSentimentErrors',
1141
+ error: String(error),
1142
+ isRetryable: true,
1143
+ transient: true,
1144
+ recoveryHint: "Upstream caller should retry on next cycle",
1145
+ });
1146
+ }
1147
+ else {
1148
+ logger_1.logger.error("Database getAll operation failed", {
1149
+ operation: 'getAllInstitutionalSentimentErrors',
1150
+ model: 'InstitutionalSentimentErrors',
1151
+ error: String(error),
1152
+ isRetryable: false,
1153
+ });
1154
+ }
1053
1155
  throw error;
1054
1156
  }
1055
1157
  }
@@ -1157,13 +1259,25 @@ exports.InstitutionalSentimentErrors = {
1157
1259
  await new Promise(resolve => setTimeout(resolve, delay));
1158
1260
  continue;
1159
1261
  }
1160
- // Log structured error details and rethrow
1161
- logger_1.logger.error("Database findMany operation failed", {
1162
- operation: 'findManyInstitutionalSentimentErrors',
1163
- model: 'InstitutionalSentimentErrors',
1164
- error: String(error),
1165
- isRetryable: isConnectionError,
1166
- });
1262
+ // Log structured error details and rethrow (transient -> WARN).
1263
+ if (isConnectionError) {
1264
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
1265
+ operation: 'findManyInstitutionalSentimentErrors',
1266
+ model: 'InstitutionalSentimentErrors',
1267
+ error: String(error),
1268
+ isRetryable: true,
1269
+ transient: true,
1270
+ recoveryHint: "Upstream caller should retry on next cycle",
1271
+ });
1272
+ }
1273
+ else {
1274
+ logger_1.logger.error("Database findMany operation failed", {
1275
+ operation: 'findManyInstitutionalSentimentErrors',
1276
+ model: 'InstitutionalSentimentErrors',
1277
+ error: String(error),
1278
+ isRetryable: false,
1279
+ });
1280
+ }
1167
1281
  throw error;
1168
1282
  }
1169
1283
  }