@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
@@ -451,13 +451,28 @@ exports.OptionsPositionEvent = {
451
451
  await new Promise(resolve => setTimeout(resolve, delay));
452
452
  continue;
453
453
  }
454
- // Log structured error details and rethrow
455
- logger_1.logger.error("Database create operation failed", {
456
- operation: 'createOneOptionsPositionEvent',
457
- model: 'OptionsPositionEvent',
458
- error: String(error),
459
- isRetryable: isConnectionError,
460
- });
454
+ // Log structured error details and rethrow.
455
+ // Demote transient failures to WARN with explicit transient+recoveryHint
456
+ // metadata so log analytics can distinguish recoverable upstream retries
457
+ // from true defects.
458
+ if (isConnectionError) {
459
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
460
+ operation: 'createOneOptionsPositionEvent',
461
+ model: 'OptionsPositionEvent',
462
+ error: String(error),
463
+ isRetryable: true,
464
+ transient: true,
465
+ recoveryHint: "Upstream caller should retry on next cycle",
466
+ });
467
+ }
468
+ else {
469
+ logger_1.logger.error("Database create operation failed", {
470
+ operation: 'createOneOptionsPositionEvent',
471
+ model: 'OptionsPositionEvent',
472
+ error: String(error),
473
+ isRetryable: false,
474
+ });
475
+ }
461
476
  throw error;
462
477
  }
463
478
  }
@@ -580,13 +595,25 @@ exports.OptionsPositionEvent = {
580
595
  await new Promise(resolve => setTimeout(resolve, delay));
581
596
  continue;
582
597
  }
583
- // Log structured error details and rethrow
584
- logger_1.logger.error("Database createMany operation failed", {
585
- operation: 'createManyOptionsPositionEvent',
586
- model: 'OptionsPositionEvent',
587
- error: String(error),
588
- isRetryable: isConnectionError,
589
- });
598
+ // Log structured error details and rethrow (transient -> WARN).
599
+ if (isConnectionError) {
600
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
601
+ operation: 'createManyOptionsPositionEvent',
602
+ model: 'OptionsPositionEvent',
603
+ error: String(error),
604
+ isRetryable: true,
605
+ transient: true,
606
+ recoveryHint: "Upstream caller should retry on next cycle",
607
+ });
608
+ }
609
+ else {
610
+ logger_1.logger.error("Database createMany operation failed", {
611
+ operation: 'createManyOptionsPositionEvent',
612
+ model: 'OptionsPositionEvent',
613
+ error: String(error),
614
+ isRetryable: false,
615
+ });
616
+ }
590
617
  throw error;
591
618
  }
592
619
  }
@@ -1814,14 +1841,27 @@ exports.OptionsPositionEvent = {
1814
1841
  await new Promise(resolve => setTimeout(resolve, delay));
1815
1842
  continue;
1816
1843
  }
1817
- // Log structured error details and rethrow
1818
- logger_1.logger.error("Database update operation failed", {
1819
- operation: 'updateOneOptionsPositionEvent',
1820
- model: 'OptionsPositionEvent',
1821
- error: String(error),
1822
- recordId: props.id,
1823
- isRetryable: isConnectionError,
1824
- });
1844
+ // Log structured error details and rethrow (transient -> WARN).
1845
+ if (isConnectionError) {
1846
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
1847
+ operation: 'updateOneOptionsPositionEvent',
1848
+ model: 'OptionsPositionEvent',
1849
+ error: String(error),
1850
+ recordId: props.id,
1851
+ isRetryable: true,
1852
+ transient: true,
1853
+ recoveryHint: "Upstream caller should retry on next cycle",
1854
+ });
1855
+ }
1856
+ else {
1857
+ logger_1.logger.error("Database update operation failed", {
1858
+ operation: 'updateOneOptionsPositionEvent',
1859
+ model: 'OptionsPositionEvent',
1860
+ error: String(error),
1861
+ recordId: props.id,
1862
+ isRetryable: false,
1863
+ });
1864
+ }
1825
1865
  throw error;
1826
1866
  }
1827
1867
  }
@@ -3326,14 +3366,27 @@ exports.OptionsPositionEvent = {
3326
3366
  await new Promise(resolve => setTimeout(resolve, delay));
3327
3367
  continue;
3328
3368
  }
3329
- // Log structured error details and rethrow
3330
- logger_1.logger.error("Database upsert operation failed", {
3331
- operation: 'upsertOneOptionsPositionEvent',
3332
- model: 'OptionsPositionEvent',
3333
- error: String(error),
3334
- recordId: props.id,
3335
- isRetryable: isConnectionError,
3336
- });
3369
+ // Log structured error details and rethrow (transient -> WARN).
3370
+ if (isConnectionError) {
3371
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
3372
+ operation: 'upsertOneOptionsPositionEvent',
3373
+ model: 'OptionsPositionEvent',
3374
+ error: String(error),
3375
+ recordId: props.id,
3376
+ isRetryable: true,
3377
+ transient: true,
3378
+ recoveryHint: "Upstream caller should retry on next cycle",
3379
+ });
3380
+ }
3381
+ else {
3382
+ logger_1.logger.error("Database upsert operation failed", {
3383
+ operation: 'upsertOneOptionsPositionEvent',
3384
+ model: 'OptionsPositionEvent',
3385
+ error: String(error),
3386
+ recordId: props.id,
3387
+ isRetryable: false,
3388
+ });
3389
+ }
3337
3390
  throw error;
3338
3391
  }
3339
3392
  }
@@ -4559,13 +4612,25 @@ exports.OptionsPositionEvent = {
4559
4612
  await new Promise(resolve => setTimeout(resolve, delay));
4560
4613
  continue;
4561
4614
  }
4562
- // Log structured error details and rethrow
4563
- logger_1.logger.error("Database updateMany operation failed", {
4564
- operation: 'updateManyOptionsPositionEvent',
4565
- model: 'OptionsPositionEvent',
4566
- error: String(error),
4567
- isRetryable: isConnectionError,
4568
- });
4615
+ // Log structured error details and rethrow (transient -> WARN).
4616
+ if (isConnectionError) {
4617
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
4618
+ operation: 'updateManyOptionsPositionEvent',
4619
+ model: 'OptionsPositionEvent',
4620
+ error: String(error),
4621
+ isRetryable: true,
4622
+ transient: true,
4623
+ recoveryHint: "Upstream caller should retry on next cycle",
4624
+ });
4625
+ }
4626
+ else {
4627
+ logger_1.logger.error("Database updateMany operation failed", {
4628
+ operation: 'updateManyOptionsPositionEvent',
4629
+ model: 'OptionsPositionEvent',
4630
+ error: String(error),
4631
+ isRetryable: false,
4632
+ });
4633
+ }
4569
4634
  throw error;
4570
4635
  }
4571
4636
  }
@@ -4688,14 +4753,27 @@ exports.OptionsPositionEvent = {
4688
4753
  await new Promise(resolve => setTimeout(resolve, delay));
4689
4754
  continue;
4690
4755
  }
4691
- // Log structured error details and rethrow
4692
- logger_1.logger.error("Database delete operation failed", {
4693
- operation: 'deleteOneOptionsPositionEvent',
4694
- model: 'OptionsPositionEvent',
4695
- error: String(error),
4696
- recordId: props.id,
4697
- isRetryable: isConnectionError,
4698
- });
4756
+ // Log structured error details and rethrow (transient -> WARN).
4757
+ if (isConnectionError) {
4758
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
4759
+ operation: 'deleteOneOptionsPositionEvent',
4760
+ model: 'OptionsPositionEvent',
4761
+ error: String(error),
4762
+ recordId: props.id,
4763
+ isRetryable: true,
4764
+ transient: true,
4765
+ recoveryHint: "Upstream caller should retry on next cycle",
4766
+ });
4767
+ }
4768
+ else {
4769
+ logger_1.logger.error("Database delete operation failed", {
4770
+ operation: 'deleteOneOptionsPositionEvent',
4771
+ model: 'OptionsPositionEvent',
4772
+ error: String(error),
4773
+ recordId: props.id,
4774
+ isRetryable: false,
4775
+ });
4776
+ }
4699
4777
  throw error;
4700
4778
  }
4701
4779
  }
@@ -4794,13 +4872,25 @@ exports.OptionsPositionEvent = {
4794
4872
  await new Promise(resolve => setTimeout(resolve, delay));
4795
4873
  continue;
4796
4874
  }
4797
- // Log structured error details and rethrow
4798
- logger_1.logger.error("Database get operation failed", {
4799
- operation: 'getOptionsPositionEvent',
4800
- model: 'OptionsPositionEvent',
4801
- error: String(error),
4802
- isRetryable: isConnectionError,
4803
- });
4875
+ // Log structured error details and rethrow (transient -> WARN).
4876
+ if (isConnectionError) {
4877
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
4878
+ operation: 'getOptionsPositionEvent',
4879
+ model: 'OptionsPositionEvent',
4880
+ error: String(error),
4881
+ isRetryable: true,
4882
+ transient: true,
4883
+ recoveryHint: "Upstream caller should retry on next cycle",
4884
+ });
4885
+ }
4886
+ else {
4887
+ logger_1.logger.error("Database get operation failed", {
4888
+ operation: 'getOptionsPositionEvent',
4889
+ model: 'OptionsPositionEvent',
4890
+ error: String(error),
4891
+ isRetryable: false,
4892
+ });
4893
+ }
4804
4894
  throw error;
4805
4895
  }
4806
4896
  }
@@ -4887,13 +4977,25 @@ exports.OptionsPositionEvent = {
4887
4977
  await new Promise(resolve => setTimeout(resolve, delay));
4888
4978
  continue;
4889
4979
  }
4890
- // Log structured error details and rethrow
4891
- logger_1.logger.error("Database getAll operation failed", {
4892
- operation: 'getAllOptionsPositionEvent',
4893
- model: 'OptionsPositionEvent',
4894
- error: String(error),
4895
- isRetryable: isConnectionError,
4896
- });
4980
+ // Log structured error details and rethrow (transient -> WARN).
4981
+ if (isConnectionError) {
4982
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
4983
+ operation: 'getAllOptionsPositionEvent',
4984
+ model: 'OptionsPositionEvent',
4985
+ error: String(error),
4986
+ isRetryable: true,
4987
+ transient: true,
4988
+ recoveryHint: "Upstream caller should retry on next cycle",
4989
+ });
4990
+ }
4991
+ else {
4992
+ logger_1.logger.error("Database getAll operation failed", {
4993
+ operation: 'getAllOptionsPositionEvent',
4994
+ model: 'OptionsPositionEvent',
4995
+ error: String(error),
4996
+ isRetryable: false,
4997
+ });
4998
+ }
4897
4999
  throw error;
4898
5000
  }
4899
5001
  }
@@ -5004,13 +5106,25 @@ exports.OptionsPositionEvent = {
5004
5106
  await new Promise(resolve => setTimeout(resolve, delay));
5005
5107
  continue;
5006
5108
  }
5007
- // Log structured error details and rethrow
5008
- logger_1.logger.error("Database findMany operation failed", {
5009
- operation: 'findManyOptionsPositionEvent',
5010
- model: 'OptionsPositionEvent',
5011
- error: String(error),
5012
- isRetryable: isConnectionError,
5013
- });
5109
+ // Log structured error details and rethrow (transient -> WARN).
5110
+ if (isConnectionError) {
5111
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
5112
+ operation: 'findManyOptionsPositionEvent',
5113
+ model: 'OptionsPositionEvent',
5114
+ error: String(error),
5115
+ isRetryable: true,
5116
+ transient: true,
5117
+ recoveryHint: "Upstream caller should retry on next cycle",
5118
+ });
5119
+ }
5120
+ else {
5121
+ logger_1.logger.error("Database findMany operation failed", {
5122
+ operation: 'findManyOptionsPositionEvent',
5123
+ model: 'OptionsPositionEvent',
5124
+ error: String(error),
5125
+ isRetryable: false,
5126
+ });
5127
+ }
5014
5128
  throw error;
5015
5129
  }
5016
5130
  }
@@ -662,13 +662,28 @@ exports.OptionsTradeExecution = {
662
662
  await new Promise(resolve => setTimeout(resolve, delay));
663
663
  continue;
664
664
  }
665
- // Log structured error details and rethrow
666
- logger_1.logger.error("Database create operation failed", {
667
- operation: 'createOneOptionsTradeExecution',
668
- model: 'OptionsTradeExecution',
669
- error: String(error),
670
- isRetryable: isConnectionError,
671
- });
665
+ // Log structured error details and rethrow.
666
+ // Demote transient failures to WARN with explicit transient+recoveryHint
667
+ // metadata so log analytics can distinguish recoverable upstream retries
668
+ // from true defects.
669
+ if (isConnectionError) {
670
+ logger_1.logger.warn("Database create operation failed (transient after retries)", {
671
+ operation: 'createOneOptionsTradeExecution',
672
+ model: 'OptionsTradeExecution',
673
+ error: String(error),
674
+ isRetryable: true,
675
+ transient: true,
676
+ recoveryHint: "Upstream caller should retry on next cycle",
677
+ });
678
+ }
679
+ else {
680
+ logger_1.logger.error("Database create operation failed", {
681
+ operation: 'createOneOptionsTradeExecution',
682
+ model: 'OptionsTradeExecution',
683
+ error: String(error),
684
+ isRetryable: false,
685
+ });
686
+ }
672
687
  throw error;
673
688
  }
674
689
  }
@@ -811,13 +826,25 @@ exports.OptionsTradeExecution = {
811
826
  await new Promise(resolve => setTimeout(resolve, delay));
812
827
  continue;
813
828
  }
814
- // Log structured error details and rethrow
815
- logger_1.logger.error("Database createMany operation failed", {
816
- operation: 'createManyOptionsTradeExecution',
817
- model: 'OptionsTradeExecution',
818
- error: String(error),
819
- isRetryable: isConnectionError,
820
- });
829
+ // Log structured error details and rethrow (transient -> WARN).
830
+ if (isConnectionError) {
831
+ logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
832
+ operation: 'createManyOptionsTradeExecution',
833
+ model: 'OptionsTradeExecution',
834
+ error: String(error),
835
+ isRetryable: true,
836
+ transient: true,
837
+ recoveryHint: "Upstream caller should retry on next cycle",
838
+ });
839
+ }
840
+ else {
841
+ logger_1.logger.error("Database createMany operation failed", {
842
+ operation: 'createManyOptionsTradeExecution',
843
+ model: 'OptionsTradeExecution',
844
+ error: String(error),
845
+ isRetryable: false,
846
+ });
847
+ }
821
848
  throw error;
822
849
  }
823
850
  }
@@ -2527,14 +2554,27 @@ exports.OptionsTradeExecution = {
2527
2554
  await new Promise(resolve => setTimeout(resolve, delay));
2528
2555
  continue;
2529
2556
  }
2530
- // Log structured error details and rethrow
2531
- logger_1.logger.error("Database update operation failed", {
2532
- operation: 'updateOneOptionsTradeExecution',
2533
- model: 'OptionsTradeExecution',
2534
- error: String(error),
2535
- recordId: props.id,
2536
- isRetryable: isConnectionError,
2537
- });
2557
+ // Log structured error details and rethrow (transient -> WARN).
2558
+ if (isConnectionError) {
2559
+ logger_1.logger.warn("Database update operation failed (transient after retries)", {
2560
+ operation: 'updateOneOptionsTradeExecution',
2561
+ model: 'OptionsTradeExecution',
2562
+ error: String(error),
2563
+ recordId: props.id,
2564
+ isRetryable: true,
2565
+ transient: true,
2566
+ recoveryHint: "Upstream caller should retry on next cycle",
2567
+ });
2568
+ }
2569
+ else {
2570
+ logger_1.logger.error("Database update operation failed", {
2571
+ operation: 'updateOneOptionsTradeExecution',
2572
+ model: 'OptionsTradeExecution',
2573
+ error: String(error),
2574
+ recordId: props.id,
2575
+ isRetryable: false,
2576
+ });
2577
+ }
2538
2578
  throw error;
2539
2579
  }
2540
2580
  }
@@ -4676,14 +4716,27 @@ exports.OptionsTradeExecution = {
4676
4716
  await new Promise(resolve => setTimeout(resolve, delay));
4677
4717
  continue;
4678
4718
  }
4679
- // Log structured error details and rethrow
4680
- logger_1.logger.error("Database upsert operation failed", {
4681
- operation: 'upsertOneOptionsTradeExecution',
4682
- model: 'OptionsTradeExecution',
4683
- error: String(error),
4684
- recordId: props.id,
4685
- isRetryable: isConnectionError,
4686
- });
4719
+ // Log structured error details and rethrow (transient -> WARN).
4720
+ if (isConnectionError) {
4721
+ logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
4722
+ operation: 'upsertOneOptionsTradeExecution',
4723
+ model: 'OptionsTradeExecution',
4724
+ error: String(error),
4725
+ recordId: props.id,
4726
+ isRetryable: true,
4727
+ transient: true,
4728
+ recoveryHint: "Upstream caller should retry on next cycle",
4729
+ });
4730
+ }
4731
+ else {
4732
+ logger_1.logger.error("Database upsert operation failed", {
4733
+ operation: 'upsertOneOptionsTradeExecution',
4734
+ model: 'OptionsTradeExecution',
4735
+ error: String(error),
4736
+ recordId: props.id,
4737
+ isRetryable: false,
4738
+ });
4739
+ }
4687
4740
  throw error;
4688
4741
  }
4689
4742
  }
@@ -6391,13 +6444,25 @@ exports.OptionsTradeExecution = {
6391
6444
  await new Promise(resolve => setTimeout(resolve, delay));
6392
6445
  continue;
6393
6446
  }
6394
- // Log structured error details and rethrow
6395
- logger_1.logger.error("Database updateMany operation failed", {
6396
- operation: 'updateManyOptionsTradeExecution',
6397
- model: 'OptionsTradeExecution',
6398
- error: String(error),
6399
- isRetryable: isConnectionError,
6400
- });
6447
+ // Log structured error details and rethrow (transient -> WARN).
6448
+ if (isConnectionError) {
6449
+ logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
6450
+ operation: 'updateManyOptionsTradeExecution',
6451
+ model: 'OptionsTradeExecution',
6452
+ error: String(error),
6453
+ isRetryable: true,
6454
+ transient: true,
6455
+ recoveryHint: "Upstream caller should retry on next cycle",
6456
+ });
6457
+ }
6458
+ else {
6459
+ logger_1.logger.error("Database updateMany operation failed", {
6460
+ operation: 'updateManyOptionsTradeExecution',
6461
+ model: 'OptionsTradeExecution',
6462
+ error: String(error),
6463
+ isRetryable: false,
6464
+ });
6465
+ }
6401
6466
  throw error;
6402
6467
  }
6403
6468
  }
@@ -6520,14 +6585,27 @@ exports.OptionsTradeExecution = {
6520
6585
  await new Promise(resolve => setTimeout(resolve, delay));
6521
6586
  continue;
6522
6587
  }
6523
- // Log structured error details and rethrow
6524
- logger_1.logger.error("Database delete operation failed", {
6525
- operation: 'deleteOneOptionsTradeExecution',
6526
- model: 'OptionsTradeExecution',
6527
- error: String(error),
6528
- recordId: props.id,
6529
- isRetryable: isConnectionError,
6530
- });
6588
+ // Log structured error details and rethrow (transient -> WARN).
6589
+ if (isConnectionError) {
6590
+ logger_1.logger.warn("Database delete operation failed (transient after retries)", {
6591
+ operation: 'deleteOneOptionsTradeExecution',
6592
+ model: 'OptionsTradeExecution',
6593
+ error: String(error),
6594
+ recordId: props.id,
6595
+ isRetryable: true,
6596
+ transient: true,
6597
+ recoveryHint: "Upstream caller should retry on next cycle",
6598
+ });
6599
+ }
6600
+ else {
6601
+ logger_1.logger.error("Database delete operation failed", {
6602
+ operation: 'deleteOneOptionsTradeExecution',
6603
+ model: 'OptionsTradeExecution',
6604
+ error: String(error),
6605
+ recordId: props.id,
6606
+ isRetryable: false,
6607
+ });
6608
+ }
6531
6609
  throw error;
6532
6610
  }
6533
6611
  }
@@ -6635,13 +6713,25 @@ exports.OptionsTradeExecution = {
6635
6713
  await new Promise(resolve => setTimeout(resolve, delay));
6636
6714
  continue;
6637
6715
  }
6638
- // Log structured error details and rethrow
6639
- logger_1.logger.error("Database get operation failed", {
6640
- operation: 'getOptionsTradeExecution',
6641
- model: 'OptionsTradeExecution',
6642
- error: String(error),
6643
- isRetryable: isConnectionError,
6644
- });
6716
+ // Log structured error details and rethrow (transient -> WARN).
6717
+ if (isConnectionError) {
6718
+ logger_1.logger.warn("Database get operation failed (transient after retries)", {
6719
+ operation: 'getOptionsTradeExecution',
6720
+ model: 'OptionsTradeExecution',
6721
+ error: String(error),
6722
+ isRetryable: true,
6723
+ transient: true,
6724
+ recoveryHint: "Upstream caller should retry on next cycle",
6725
+ });
6726
+ }
6727
+ else {
6728
+ logger_1.logger.error("Database get operation failed", {
6729
+ operation: 'getOptionsTradeExecution',
6730
+ model: 'OptionsTradeExecution',
6731
+ error: String(error),
6732
+ isRetryable: false,
6733
+ });
6734
+ }
6645
6735
  throw error;
6646
6736
  }
6647
6737
  }
@@ -6728,13 +6818,25 @@ exports.OptionsTradeExecution = {
6728
6818
  await new Promise(resolve => setTimeout(resolve, delay));
6729
6819
  continue;
6730
6820
  }
6731
- // Log structured error details and rethrow
6732
- logger_1.logger.error("Database getAll operation failed", {
6733
- operation: 'getAllOptionsTradeExecution',
6734
- model: 'OptionsTradeExecution',
6735
- error: String(error),
6736
- isRetryable: isConnectionError,
6737
- });
6821
+ // Log structured error details and rethrow (transient -> WARN).
6822
+ if (isConnectionError) {
6823
+ logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
6824
+ operation: 'getAllOptionsTradeExecution',
6825
+ model: 'OptionsTradeExecution',
6826
+ error: String(error),
6827
+ isRetryable: true,
6828
+ transient: true,
6829
+ recoveryHint: "Upstream caller should retry on next cycle",
6830
+ });
6831
+ }
6832
+ else {
6833
+ logger_1.logger.error("Database getAll operation failed", {
6834
+ operation: 'getAllOptionsTradeExecution',
6835
+ model: 'OptionsTradeExecution',
6836
+ error: String(error),
6837
+ isRetryable: false,
6838
+ });
6839
+ }
6738
6840
  throw error;
6739
6841
  }
6740
6842
  }
@@ -6854,13 +6956,25 @@ exports.OptionsTradeExecution = {
6854
6956
  await new Promise(resolve => setTimeout(resolve, delay));
6855
6957
  continue;
6856
6958
  }
6857
- // Log structured error details and rethrow
6858
- logger_1.logger.error("Database findMany operation failed", {
6859
- operation: 'findManyOptionsTradeExecution',
6860
- model: 'OptionsTradeExecution',
6861
- error: String(error),
6862
- isRetryable: isConnectionError,
6863
- });
6959
+ // Log structured error details and rethrow (transient -> WARN).
6960
+ if (isConnectionError) {
6961
+ logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
6962
+ operation: 'findManyOptionsTradeExecution',
6963
+ model: 'OptionsTradeExecution',
6964
+ error: String(error),
6965
+ isRetryable: true,
6966
+ transient: true,
6967
+ recoveryHint: "Upstream caller should retry on next cycle",
6968
+ });
6969
+ }
6970
+ else {
6971
+ logger_1.logger.error("Database findMany operation failed", {
6972
+ operation: 'findManyOptionsTradeExecution',
6973
+ model: 'OptionsTradeExecution',
6974
+ error: String(error),
6975
+ isRetryable: false,
6976
+ });
6977
+ }
6864
6978
  throw error;
6865
6979
  }
6866
6980
  }