@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
package/Allocation.cjs CHANGED
@@ -624,13 +624,28 @@ exports.Allocation = {
624
624
  await new Promise(resolve => setTimeout(resolve, delay));
625
625
  continue;
626
626
  }
627
- // Log structured error details and rethrow
628
- logger_1.logger.error("Database create operation failed", {
629
- operation: 'createOneAllocation',
630
- model: 'Allocation',
631
- error: String(error),
632
- isRetryable: isConnectionError,
633
- });
627
+ // Log structured error details and rethrow.
628
+ // Demote transient failures to WARN with explicit transient+recoveryHint
629
+ // metadata so log analytics can distinguish recoverable upstream retries
630
+ // from true defects.
631
+ if (isConnectionError) {
632
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
633
+ operation: 'createOneAllocation',
634
+ model: 'Allocation',
635
+ error: String(error),
636
+ isRetryable: true,
637
+ transient: true,
638
+ recoveryHint: "Upstream caller should retry on next cycle",
639
+ });
640
+ }
641
+ else {
642
+ logger_1.logger.error("Database create operation failed", {
643
+ operation: 'createOneAllocation',
644
+ model: 'Allocation',
645
+ error: String(error),
646
+ isRetryable: false,
647
+ });
648
+ }
634
649
  throw error;
635
650
  }
636
651
  }
@@ -757,13 +772,25 @@ exports.Allocation = {
757
772
  await new Promise(resolve => setTimeout(resolve, delay));
758
773
  continue;
759
774
  }
760
- // Log structured error details and rethrow
761
- logger_1.logger.error("Database createMany operation failed", {
762
- operation: 'createManyAllocation',
763
- model: 'Allocation',
764
- error: String(error),
765
- isRetryable: isConnectionError,
766
- });
775
+ // Log structured error details and rethrow (transient -> WARN).
776
+ if (isConnectionError) {
777
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
778
+ operation: 'createManyAllocation',
779
+ model: 'Allocation',
780
+ error: String(error),
781
+ isRetryable: true,
782
+ transient: true,
783
+ recoveryHint: "Upstream caller should retry on next cycle",
784
+ });
785
+ }
786
+ else {
787
+ logger_1.logger.error("Database createMany operation failed", {
788
+ operation: 'createManyAllocation',
789
+ model: 'Allocation',
790
+ error: String(error),
791
+ isRetryable: false,
792
+ });
793
+ }
767
794
  throw error;
768
795
  }
769
796
  }
@@ -2690,14 +2717,27 @@ exports.Allocation = {
2690
2717
  await new Promise(resolve => setTimeout(resolve, delay));
2691
2718
  continue;
2692
2719
  }
2693
- // Log structured error details and rethrow
2694
- logger_1.logger.error("Database update operation failed", {
2695
- operation: 'updateOneAllocation',
2696
- model: 'Allocation',
2697
- error: String(error),
2698
- recordId: props.id,
2699
- isRetryable: isConnectionError,
2700
- });
2720
+ // Log structured error details and rethrow (transient -> WARN).
2721
+ if (isConnectionError) {
2722
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
2723
+ operation: 'updateOneAllocation',
2724
+ model: 'Allocation',
2725
+ error: String(error),
2726
+ recordId: props.id,
2727
+ isRetryable: true,
2728
+ transient: true,
2729
+ recoveryHint: "Upstream caller should retry on next cycle",
2730
+ });
2731
+ }
2732
+ else {
2733
+ logger_1.logger.error("Database update operation failed", {
2734
+ operation: 'updateOneAllocation',
2735
+ model: 'Allocation',
2736
+ error: String(error),
2737
+ recordId: props.id,
2738
+ isRetryable: false,
2739
+ });
2740
+ }
2701
2741
  throw error;
2702
2742
  }
2703
2743
  }
@@ -5082,14 +5122,27 @@ exports.Allocation = {
5082
5122
  await new Promise(resolve => setTimeout(resolve, delay));
5083
5123
  continue;
5084
5124
  }
5085
- // Log structured error details and rethrow
5086
- logger_1.logger.error("Database upsert operation failed", {
5087
- operation: 'upsertOneAllocation',
5088
- model: 'Allocation',
5089
- error: String(error),
5090
- recordId: props.id,
5091
- isRetryable: isConnectionError,
5092
- });
5125
+ // Log structured error details and rethrow (transient -> WARN).
5126
+ if (isConnectionError) {
5127
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
5128
+ operation: 'upsertOneAllocation',
5129
+ model: 'Allocation',
5130
+ error: String(error),
5131
+ recordId: props.id,
5132
+ isRetryable: true,
5133
+ transient: true,
5134
+ recoveryHint: "Upstream caller should retry on next cycle",
5135
+ });
5136
+ }
5137
+ else {
5138
+ logger_1.logger.error("Database upsert operation failed", {
5139
+ operation: 'upsertOneAllocation',
5140
+ model: 'Allocation',
5141
+ error: String(error),
5142
+ recordId: props.id,
5143
+ isRetryable: false,
5144
+ });
5145
+ }
5093
5146
  throw error;
5094
5147
  }
5095
5148
  }
@@ -7005,13 +7058,25 @@ exports.Allocation = {
7005
7058
  await new Promise(resolve => setTimeout(resolve, delay));
7006
7059
  continue;
7007
7060
  }
7008
- // Log structured error details and rethrow
7009
- logger_1.logger.error("Database updateMany operation failed", {
7010
- operation: 'updateManyAllocation',
7011
- model: 'Allocation',
7012
- error: String(error),
7013
- isRetryable: isConnectionError,
7014
- });
7061
+ // Log structured error details and rethrow (transient -> WARN).
7062
+ if (isConnectionError) {
7063
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
7064
+ operation: 'updateManyAllocation',
7065
+ model: 'Allocation',
7066
+ error: String(error),
7067
+ isRetryable: true,
7068
+ transient: true,
7069
+ recoveryHint: "Upstream caller should retry on next cycle",
7070
+ });
7071
+ }
7072
+ else {
7073
+ logger_1.logger.error("Database updateMany operation failed", {
7074
+ operation: 'updateManyAllocation',
7075
+ model: 'Allocation',
7076
+ error: String(error),
7077
+ isRetryable: false,
7078
+ });
7079
+ }
7015
7080
  throw error;
7016
7081
  }
7017
7082
  }
@@ -7134,14 +7199,27 @@ exports.Allocation = {
7134
7199
  await new Promise(resolve => setTimeout(resolve, delay));
7135
7200
  continue;
7136
7201
  }
7137
- // Log structured error details and rethrow
7138
- logger_1.logger.error("Database delete operation failed", {
7139
- operation: 'deleteOneAllocation',
7140
- model: 'Allocation',
7141
- error: String(error),
7142
- recordId: props.id,
7143
- isRetryable: isConnectionError,
7144
- });
7202
+ // Log structured error details and rethrow (transient -> WARN).
7203
+ if (isConnectionError) {
7204
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
7205
+ operation: 'deleteOneAllocation',
7206
+ model: 'Allocation',
7207
+ error: String(error),
7208
+ recordId: props.id,
7209
+ isRetryable: true,
7210
+ transient: true,
7211
+ recoveryHint: "Upstream caller should retry on next cycle",
7212
+ });
7213
+ }
7214
+ else {
7215
+ logger_1.logger.error("Database delete operation failed", {
7216
+ operation: 'deleteOneAllocation',
7217
+ model: 'Allocation',
7218
+ error: String(error),
7219
+ recordId: props.id,
7220
+ isRetryable: false,
7221
+ });
7222
+ }
7145
7223
  throw error;
7146
7224
  }
7147
7225
  }
@@ -7238,13 +7316,25 @@ exports.Allocation = {
7238
7316
  await new Promise(resolve => setTimeout(resolve, delay));
7239
7317
  continue;
7240
7318
  }
7241
- // Log structured error details and rethrow
7242
- logger_1.logger.error("Database get operation failed", {
7243
- operation: 'getAllocation',
7244
- model: 'Allocation',
7245
- error: String(error),
7246
- isRetryable: isConnectionError,
7247
- });
7319
+ // Log structured error details and rethrow (transient -> WARN).
7320
+ if (isConnectionError) {
7321
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
7322
+ operation: 'getAllocation',
7323
+ model: 'Allocation',
7324
+ error: String(error),
7325
+ isRetryable: true,
7326
+ transient: true,
7327
+ recoveryHint: "Upstream caller should retry on next cycle",
7328
+ });
7329
+ }
7330
+ else {
7331
+ logger_1.logger.error("Database get operation failed", {
7332
+ operation: 'getAllocation',
7333
+ model: 'Allocation',
7334
+ error: String(error),
7335
+ isRetryable: false,
7336
+ });
7337
+ }
7248
7338
  throw error;
7249
7339
  }
7250
7340
  }
@@ -7331,13 +7421,25 @@ exports.Allocation = {
7331
7421
  await new Promise(resolve => setTimeout(resolve, delay));
7332
7422
  continue;
7333
7423
  }
7334
- // Log structured error details and rethrow
7335
- logger_1.logger.error("Database getAll operation failed", {
7336
- operation: 'getAllAllocation',
7337
- model: 'Allocation',
7338
- error: String(error),
7339
- isRetryable: isConnectionError,
7340
- });
7424
+ // Log structured error details and rethrow (transient -> WARN).
7425
+ if (isConnectionError) {
7426
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
7427
+ operation: 'getAllAllocation',
7428
+ model: 'Allocation',
7429
+ error: String(error),
7430
+ isRetryable: true,
7431
+ transient: true,
7432
+ recoveryHint: "Upstream caller should retry on next cycle",
7433
+ });
7434
+ }
7435
+ else {
7436
+ logger_1.logger.error("Database getAll operation failed", {
7437
+ operation: 'getAllAllocation',
7438
+ model: 'Allocation',
7439
+ error: String(error),
7440
+ isRetryable: false,
7441
+ });
7442
+ }
7341
7443
  throw error;
7342
7444
  }
7343
7445
  }
@@ -7448,13 +7550,25 @@ exports.Allocation = {
7448
7550
  await new Promise(resolve => setTimeout(resolve, delay));
7449
7551
  continue;
7450
7552
  }
7451
- // Log structured error details and rethrow
7452
- logger_1.logger.error("Database findMany operation failed", {
7453
- operation: 'findManyAllocation',
7454
- model: 'Allocation',
7455
- error: String(error),
7456
- isRetryable: isConnectionError,
7457
- });
7553
+ // Log structured error details and rethrow (transient -> WARN).
7554
+ if (isConnectionError) {
7555
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
7556
+ operation: 'findManyAllocation',
7557
+ model: 'Allocation',
7558
+ error: String(error),
7559
+ isRetryable: true,
7560
+ transient: true,
7561
+ recoveryHint: "Upstream caller should retry on next cycle",
7562
+ });
7563
+ }
7564
+ else {
7565
+ logger_1.logger.error("Database findMany operation failed", {
7566
+ operation: 'findManyAllocation',
7567
+ model: 'Allocation',
7568
+ error: String(error),
7569
+ isRetryable: false,
7570
+ });
7571
+ }
7458
7572
  throw error;
7459
7573
  }
7460
7574
  }
package/AlpacaAccount.cjs CHANGED
@@ -765,13 +765,28 @@ exports.AlpacaAccount = {
765
765
  await new Promise(resolve => setTimeout(resolve, delay));
766
766
  continue;
767
767
  }
768
- // Log structured error details and rethrow
769
- logger_1.logger.error("Database create operation failed", {
770
- operation: 'createOneAlpacaAccount',
771
- model: 'AlpacaAccount',
772
- error: String(error),
773
- isRetryable: isConnectionError,
774
- });
768
+ // Log structured error details and rethrow.
769
+ // Demote transient failures to WARN with explicit transient+recoveryHint
770
+ // metadata so log analytics can distinguish recoverable upstream retries
771
+ // from true defects.
772
+ if (isConnectionError) {
773
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
774
+ operation: 'createOneAlpacaAccount',
775
+ model: 'AlpacaAccount',
776
+ error: String(error),
777
+ isRetryable: true,
778
+ transient: true,
779
+ recoveryHint: "Upstream caller should retry on next cycle",
780
+ });
781
+ }
782
+ else {
783
+ logger_1.logger.error("Database create operation failed", {
784
+ operation: 'createOneAlpacaAccount',
785
+ model: 'AlpacaAccount',
786
+ error: String(error),
787
+ isRetryable: false,
788
+ });
789
+ }
775
790
  throw error;
776
791
  }
777
792
  }
@@ -916,13 +931,25 @@ exports.AlpacaAccount = {
916
931
  await new Promise(resolve => setTimeout(resolve, delay));
917
932
  continue;
918
933
  }
919
- // Log structured error details and rethrow
920
- logger_1.logger.error("Database createMany operation failed", {
921
- operation: 'createManyAlpacaAccount',
922
- model: 'AlpacaAccount',
923
- error: String(error),
924
- isRetryable: isConnectionError,
925
- });
934
+ // Log structured error details and rethrow (transient -> WARN).
935
+ if (isConnectionError) {
936
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
937
+ operation: 'createManyAlpacaAccount',
938
+ model: 'AlpacaAccount',
939
+ error: String(error),
940
+ isRetryable: true,
941
+ transient: true,
942
+ recoveryHint: "Upstream caller should retry on next cycle",
943
+ });
944
+ }
945
+ else {
946
+ logger_1.logger.error("Database createMany operation failed", {
947
+ operation: 'createManyAlpacaAccount',
948
+ model: 'AlpacaAccount',
949
+ error: String(error),
950
+ isRetryable: false,
951
+ });
952
+ }
926
953
  throw error;
927
954
  }
928
955
  }
@@ -2493,14 +2520,27 @@ exports.AlpacaAccount = {
2493
2520
  await new Promise(resolve => setTimeout(resolve, delay));
2494
2521
  continue;
2495
2522
  }
2496
- // Log structured error details and rethrow
2497
- logger_1.logger.error("Database update operation failed", {
2498
- operation: 'updateOneAlpacaAccount',
2499
- model: 'AlpacaAccount',
2500
- error: String(error),
2501
- recordId: props.id,
2502
- isRetryable: isConnectionError,
2503
- });
2523
+ // Log structured error details and rethrow (transient -> WARN).
2524
+ if (isConnectionError) {
2525
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
2526
+ operation: 'updateOneAlpacaAccount',
2527
+ model: 'AlpacaAccount',
2528
+ error: String(error),
2529
+ recordId: props.id,
2530
+ isRetryable: true,
2531
+ transient: true,
2532
+ recoveryHint: "Upstream caller should retry on next cycle",
2533
+ });
2534
+ }
2535
+ else {
2536
+ logger_1.logger.error("Database update operation failed", {
2537
+ operation: 'updateOneAlpacaAccount',
2538
+ model: 'AlpacaAccount',
2539
+ error: String(error),
2540
+ recordId: props.id,
2541
+ isRetryable: false,
2542
+ });
2543
+ }
2504
2544
  throw error;
2505
2545
  }
2506
2546
  }
@@ -4561,14 +4601,27 @@ exports.AlpacaAccount = {
4561
4601
  await new Promise(resolve => setTimeout(resolve, delay));
4562
4602
  continue;
4563
4603
  }
4564
- // Log structured error details and rethrow
4565
- logger_1.logger.error("Database upsert operation failed", {
4566
- operation: 'upsertOneAlpacaAccount',
4567
- model: 'AlpacaAccount',
4568
- error: String(error),
4569
- recordId: props.id,
4570
- isRetryable: isConnectionError,
4571
- });
4604
+ // Log structured error details and rethrow (transient -> WARN).
4605
+ if (isConnectionError) {
4606
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
4607
+ operation: 'upsertOneAlpacaAccount',
4608
+ model: 'AlpacaAccount',
4609
+ error: String(error),
4610
+ recordId: props.id,
4611
+ isRetryable: true,
4612
+ transient: true,
4613
+ recoveryHint: "Upstream caller should retry on next cycle",
4614
+ });
4615
+ }
4616
+ else {
4617
+ logger_1.logger.error("Database upsert operation failed", {
4618
+ operation: 'upsertOneAlpacaAccount',
4619
+ model: 'AlpacaAccount',
4620
+ error: String(error),
4621
+ recordId: props.id,
4622
+ isRetryable: false,
4623
+ });
4624
+ }
4572
4625
  throw error;
4573
4626
  }
4574
4627
  }
@@ -6137,13 +6190,25 @@ exports.AlpacaAccount = {
6137
6190
  await new Promise(resolve => setTimeout(resolve, delay));
6138
6191
  continue;
6139
6192
  }
6140
- // Log structured error details and rethrow
6141
- logger_1.logger.error("Database updateMany operation failed", {
6142
- operation: 'updateManyAlpacaAccount',
6143
- model: 'AlpacaAccount',
6144
- error: String(error),
6145
- isRetryable: isConnectionError,
6146
- });
6193
+ // Log structured error details and rethrow (transient -> WARN).
6194
+ if (isConnectionError) {
6195
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
6196
+ operation: 'updateManyAlpacaAccount',
6197
+ model: 'AlpacaAccount',
6198
+ error: String(error),
6199
+ isRetryable: true,
6200
+ transient: true,
6201
+ recoveryHint: "Upstream caller should retry on next cycle",
6202
+ });
6203
+ }
6204
+ else {
6205
+ logger_1.logger.error("Database updateMany operation failed", {
6206
+ operation: 'updateManyAlpacaAccount',
6207
+ model: 'AlpacaAccount',
6208
+ error: String(error),
6209
+ isRetryable: false,
6210
+ });
6211
+ }
6147
6212
  throw error;
6148
6213
  }
6149
6214
  }
@@ -6266,14 +6331,27 @@ exports.AlpacaAccount = {
6266
6331
  await new Promise(resolve => setTimeout(resolve, delay));
6267
6332
  continue;
6268
6333
  }
6269
- // Log structured error details and rethrow
6270
- logger_1.logger.error("Database delete operation failed", {
6271
- operation: 'deleteOneAlpacaAccount',
6272
- model: 'AlpacaAccount',
6273
- error: String(error),
6274
- recordId: props.id,
6275
- isRetryable: isConnectionError,
6276
- });
6334
+ // Log structured error details and rethrow (transient -> WARN).
6335
+ if (isConnectionError) {
6336
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
6337
+ operation: 'deleteOneAlpacaAccount',
6338
+ model: 'AlpacaAccount',
6339
+ error: String(error),
6340
+ recordId: props.id,
6341
+ isRetryable: true,
6342
+ transient: true,
6343
+ recoveryHint: "Upstream caller should retry on next cycle",
6344
+ });
6345
+ }
6346
+ else {
6347
+ logger_1.logger.error("Database delete operation failed", {
6348
+ operation: 'deleteOneAlpacaAccount',
6349
+ model: 'AlpacaAccount',
6350
+ error: String(error),
6351
+ recordId: props.id,
6352
+ isRetryable: false,
6353
+ });
6354
+ }
6277
6355
  throw error;
6278
6356
  }
6279
6357
  }
@@ -6375,13 +6453,25 @@ exports.AlpacaAccount = {
6375
6453
  await new Promise(resolve => setTimeout(resolve, delay));
6376
6454
  continue;
6377
6455
  }
6378
- // Log structured error details and rethrow
6379
- logger_1.logger.error("Database get operation failed", {
6380
- operation: 'getAlpacaAccount',
6381
- model: 'AlpacaAccount',
6382
- error: String(error),
6383
- isRetryable: isConnectionError,
6384
- });
6456
+ // Log structured error details and rethrow (transient -> WARN).
6457
+ if (isConnectionError) {
6458
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
6459
+ operation: 'getAlpacaAccount',
6460
+ model: 'AlpacaAccount',
6461
+ error: String(error),
6462
+ isRetryable: true,
6463
+ transient: true,
6464
+ recoveryHint: "Upstream caller should retry on next cycle",
6465
+ });
6466
+ }
6467
+ else {
6468
+ logger_1.logger.error("Database get operation failed", {
6469
+ operation: 'getAlpacaAccount',
6470
+ model: 'AlpacaAccount',
6471
+ error: String(error),
6472
+ isRetryable: false,
6473
+ });
6474
+ }
6385
6475
  throw error;
6386
6476
  }
6387
6477
  }
@@ -6468,13 +6558,25 @@ exports.AlpacaAccount = {
6468
6558
  await new Promise(resolve => setTimeout(resolve, delay));
6469
6559
  continue;
6470
6560
  }
6471
- // Log structured error details and rethrow
6472
- logger_1.logger.error("Database getAll operation failed", {
6473
- operation: 'getAllAlpacaAccount',
6474
- model: 'AlpacaAccount',
6475
- error: String(error),
6476
- isRetryable: isConnectionError,
6477
- });
6561
+ // Log structured error details and rethrow (transient -> WARN).
6562
+ if (isConnectionError) {
6563
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
6564
+ operation: 'getAllAlpacaAccount',
6565
+ model: 'AlpacaAccount',
6566
+ error: String(error),
6567
+ isRetryable: true,
6568
+ transient: true,
6569
+ recoveryHint: "Upstream caller should retry on next cycle",
6570
+ });
6571
+ }
6572
+ else {
6573
+ logger_1.logger.error("Database getAll operation failed", {
6574
+ operation: 'getAllAlpacaAccount',
6575
+ model: 'AlpacaAccount',
6576
+ error: String(error),
6577
+ isRetryable: false,
6578
+ });
6579
+ }
6478
6580
  throw error;
6479
6581
  }
6480
6582
  }
@@ -6588,13 +6690,25 @@ exports.AlpacaAccount = {
6588
6690
  await new Promise(resolve => setTimeout(resolve, delay));
6589
6691
  continue;
6590
6692
  }
6591
- // Log structured error details and rethrow
6592
- logger_1.logger.error("Database findMany operation failed", {
6593
- operation: 'findManyAlpacaAccount',
6594
- model: 'AlpacaAccount',
6595
- error: String(error),
6596
- isRetryable: isConnectionError,
6597
- });
6693
+ // Log structured error details and rethrow (transient -> WARN).
6694
+ if (isConnectionError) {
6695
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
6696
+ operation: 'findManyAlpacaAccount',
6697
+ model: 'AlpacaAccount',
6698
+ error: String(error),
6699
+ isRetryable: true,
6700
+ transient: true,
6701
+ recoveryHint: "Upstream caller should retry on next cycle",
6702
+ });
6703
+ }
6704
+ else {
6705
+ logger_1.logger.error("Database findMany operation failed", {
6706
+ operation: 'findManyAlpacaAccount',
6707
+ model: 'AlpacaAccount',
6708
+ error: String(error),
6709
+ isRetryable: false,
6710
+ });
6711
+ }
6598
6712
  throw error;
6599
6713
  }
6600
6714
  }