@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.
- package/ABTest.cjs +180 -66
- package/Account.cjs +180 -66
- package/AccountDecisionRecord.cjs +180 -66
- package/AccountLinkingRequest.cjs +180 -66
- package/Action.cjs +180 -66
- package/Alert.cjs +180 -66
- package/Allocation.cjs +180 -66
- package/AlpacaAccount.cjs +180 -66
- package/AnalyticsConfiguration.cjs +180 -66
- package/AnalyticsSnapshot.cjs +180 -66
- package/Asset.cjs +180 -66
- package/AuditLog.cjs +180 -66
- package/Authenticator.cjs +180 -66
- package/Configuration.cjs +180 -66
- package/ConflictEvent.cjs +180 -66
- package/ConnectionHealthSnapshot.cjs +180 -66
- package/Customer.cjs +180 -66
- package/DeadLetterMessage.cjs +180 -66
- package/DecisionMemorySummary.cjs +180 -66
- package/EconomicEvent.cjs +180 -66
- package/EquityBar.cjs +180 -66
- package/Event.cjs +180 -66
- package/EventSnapshot.cjs +180 -66
- package/FeatureImportanceAnalysis.cjs +180 -66
- package/InstitutionalFlowSignal.cjs +180 -66
- package/InstitutionalHolding.cjs +180 -66
- package/InstitutionalSentimentAlerts.cjs +180 -66
- package/InstitutionalSentimentErrors.cjs +180 -66
- package/InstitutionalSentimentHistory.cjs +180 -66
- package/InstitutionalSentimentMetrics.cjs +180 -66
- package/InviteToken.cjs +180 -66
- package/LinkedProvider.cjs +180 -66
- package/LlmConfiguration.cjs +180 -66
- package/MLModelVersion.cjs +180 -66
- package/MLTrainingData.cjs +180 -66
- package/MarketSentiment.cjs +180 -66
- package/ModelArtifact.cjs +180 -66
- package/ModelVersion.cjs +180 -66
- package/ModelVersionArtifact.cjs +180 -66
- package/NewsArticle.cjs +180 -66
- package/NewsArticleAssetSentiment.cjs +180 -66
- package/OptionsContract.cjs +180 -66
- package/OptionsGreeksHistory.cjs +180 -66
- package/OptionsPosition.cjs +180 -66
- package/OptionsPositionEvent.cjs +180 -66
- package/OptionsTradeExecution.cjs +180 -66
- package/PolicyOverlay.cjs +180 -66
- package/PortfolioGreeksHistory.cjs +180 -66
- package/ScheduledOptionOrder.cjs +180 -66
- package/Session.cjs +180 -66
- package/SignalGeneratorMetrics.cjs +180 -66
- package/SignalLineage.cjs +180 -66
- package/SignalOutcome.cjs +180 -66
- package/SignalPriorityQueue.cjs +180 -66
- package/SyncEvent.cjs +180 -66
- package/SystemAlert.cjs +180 -66
- package/Trade.cjs +180 -66
- package/TradeAuditEvent.cjs +180 -66
- package/TradeExecutionHistory.cjs +180 -66
- package/TradeOutcome.cjs +180 -66
- package/TradingPolicy.cjs +180 -66
- package/User.cjs +180 -66
- package/VerificationToken.cjs +180 -66
- package/WaitlistEntry.cjs +180 -66
- package/client.cjs +131 -9
- package/client.d.ts +32 -0
- package/esm/ABTest.d.ts.map +1 -1
- package/esm/ABTest.js.map +1 -1
- package/esm/ABTest.mjs +180 -66
- package/esm/Account.d.ts.map +1 -1
- package/esm/Account.js.map +1 -1
- package/esm/Account.mjs +180 -66
- package/esm/AccountDecisionRecord.d.ts.map +1 -1
- package/esm/AccountDecisionRecord.js.map +1 -1
- package/esm/AccountDecisionRecord.mjs +180 -66
- package/esm/AccountLinkingRequest.d.ts.map +1 -1
- package/esm/AccountLinkingRequest.js.map +1 -1
- package/esm/AccountLinkingRequest.mjs +180 -66
- package/esm/Action.d.ts.map +1 -1
- package/esm/Action.js.map +1 -1
- package/esm/Action.mjs +180 -66
- package/esm/Alert.d.ts.map +1 -1
- package/esm/Alert.js.map +1 -1
- package/esm/Alert.mjs +180 -66
- package/esm/Allocation.d.ts.map +1 -1
- package/esm/Allocation.js.map +1 -1
- package/esm/Allocation.mjs +180 -66
- package/esm/AlpacaAccount.d.ts.map +1 -1
- package/esm/AlpacaAccount.js.map +1 -1
- package/esm/AlpacaAccount.mjs +180 -66
- package/esm/AnalyticsConfiguration.d.ts.map +1 -1
- package/esm/AnalyticsConfiguration.js.map +1 -1
- package/esm/AnalyticsConfiguration.mjs +180 -66
- package/esm/AnalyticsSnapshot.d.ts.map +1 -1
- package/esm/AnalyticsSnapshot.js.map +1 -1
- package/esm/AnalyticsSnapshot.mjs +180 -66
- package/esm/Asset.d.ts.map +1 -1
- package/esm/Asset.js.map +1 -1
- package/esm/Asset.mjs +180 -66
- package/esm/AuditLog.d.ts.map +1 -1
- package/esm/AuditLog.js.map +1 -1
- package/esm/AuditLog.mjs +180 -66
- package/esm/Authenticator.d.ts.map +1 -1
- package/esm/Authenticator.js.map +1 -1
- package/esm/Authenticator.mjs +180 -66
- package/esm/Configuration.d.ts.map +1 -1
- package/esm/Configuration.js.map +1 -1
- package/esm/Configuration.mjs +180 -66
- package/esm/ConflictEvent.d.ts.map +1 -1
- package/esm/ConflictEvent.js.map +1 -1
- package/esm/ConflictEvent.mjs +180 -66
- package/esm/ConnectionHealthSnapshot.d.ts.map +1 -1
- package/esm/ConnectionHealthSnapshot.js.map +1 -1
- package/esm/ConnectionHealthSnapshot.mjs +180 -66
- package/esm/Customer.d.ts.map +1 -1
- package/esm/Customer.js.map +1 -1
- package/esm/Customer.mjs +180 -66
- package/esm/DeadLetterMessage.d.ts.map +1 -1
- package/esm/DeadLetterMessage.js.map +1 -1
- package/esm/DeadLetterMessage.mjs +180 -66
- package/esm/DecisionMemorySummary.d.ts.map +1 -1
- package/esm/DecisionMemorySummary.js.map +1 -1
- package/esm/DecisionMemorySummary.mjs +180 -66
- package/esm/EconomicEvent.d.ts.map +1 -1
- package/esm/EconomicEvent.js.map +1 -1
- package/esm/EconomicEvent.mjs +180 -66
- package/esm/EquityBar.d.ts.map +1 -1
- package/esm/EquityBar.js.map +1 -1
- package/esm/EquityBar.mjs +180 -66
- package/esm/Event.d.ts.map +1 -1
- package/esm/Event.js.map +1 -1
- package/esm/Event.mjs +180 -66
- package/esm/EventSnapshot.d.ts.map +1 -1
- package/esm/EventSnapshot.js.map +1 -1
- package/esm/EventSnapshot.mjs +180 -66
- package/esm/FeatureImportanceAnalysis.d.ts.map +1 -1
- package/esm/FeatureImportanceAnalysis.js.map +1 -1
- package/esm/FeatureImportanceAnalysis.mjs +180 -66
- package/esm/InstitutionalFlowSignal.d.ts.map +1 -1
- package/esm/InstitutionalFlowSignal.js.map +1 -1
- package/esm/InstitutionalFlowSignal.mjs +180 -66
- package/esm/InstitutionalHolding.d.ts.map +1 -1
- package/esm/InstitutionalHolding.js.map +1 -1
- package/esm/InstitutionalHolding.mjs +180 -66
- package/esm/InstitutionalSentimentAlerts.d.ts.map +1 -1
- package/esm/InstitutionalSentimentAlerts.js.map +1 -1
- package/esm/InstitutionalSentimentAlerts.mjs +180 -66
- package/esm/InstitutionalSentimentErrors.d.ts.map +1 -1
- package/esm/InstitutionalSentimentErrors.js.map +1 -1
- package/esm/InstitutionalSentimentErrors.mjs +180 -66
- package/esm/InstitutionalSentimentHistory.d.ts.map +1 -1
- package/esm/InstitutionalSentimentHistory.js.map +1 -1
- package/esm/InstitutionalSentimentHistory.mjs +180 -66
- package/esm/InstitutionalSentimentMetrics.d.ts.map +1 -1
- package/esm/InstitutionalSentimentMetrics.js.map +1 -1
- package/esm/InstitutionalSentimentMetrics.mjs +180 -66
- package/esm/InviteToken.d.ts.map +1 -1
- package/esm/InviteToken.js.map +1 -1
- package/esm/InviteToken.mjs +180 -66
- package/esm/LinkedProvider.d.ts.map +1 -1
- package/esm/LinkedProvider.js.map +1 -1
- package/esm/LinkedProvider.mjs +180 -66
- package/esm/LlmConfiguration.d.ts.map +1 -1
- package/esm/LlmConfiguration.js.map +1 -1
- package/esm/LlmConfiguration.mjs +180 -66
- package/esm/MLModelVersion.d.ts.map +1 -1
- package/esm/MLModelVersion.js.map +1 -1
- package/esm/MLModelVersion.mjs +180 -66
- package/esm/MLTrainingData.d.ts.map +1 -1
- package/esm/MLTrainingData.js.map +1 -1
- package/esm/MLTrainingData.mjs +180 -66
- package/esm/MarketSentiment.d.ts.map +1 -1
- package/esm/MarketSentiment.js.map +1 -1
- package/esm/MarketSentiment.mjs +180 -66
- package/esm/ModelArtifact.d.ts.map +1 -1
- package/esm/ModelArtifact.js.map +1 -1
- package/esm/ModelArtifact.mjs +180 -66
- package/esm/ModelVersion.d.ts.map +1 -1
- package/esm/ModelVersion.js.map +1 -1
- package/esm/ModelVersion.mjs +180 -66
- package/esm/ModelVersionArtifact.d.ts.map +1 -1
- package/esm/ModelVersionArtifact.js.map +1 -1
- package/esm/ModelVersionArtifact.mjs +180 -66
- package/esm/NewsArticle.d.ts.map +1 -1
- package/esm/NewsArticle.js.map +1 -1
- package/esm/NewsArticle.mjs +180 -66
- package/esm/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/esm/NewsArticleAssetSentiment.js.map +1 -1
- package/esm/NewsArticleAssetSentiment.mjs +180 -66
- package/esm/OptionsContract.d.ts.map +1 -1
- package/esm/OptionsContract.js.map +1 -1
- package/esm/OptionsContract.mjs +180 -66
- package/esm/OptionsGreeksHistory.d.ts.map +1 -1
- package/esm/OptionsGreeksHistory.js.map +1 -1
- package/esm/OptionsGreeksHistory.mjs +180 -66
- package/esm/OptionsPosition.d.ts.map +1 -1
- package/esm/OptionsPosition.js.map +1 -1
- package/esm/OptionsPosition.mjs +180 -66
- package/esm/OptionsPositionEvent.d.ts.map +1 -1
- package/esm/OptionsPositionEvent.js.map +1 -1
- package/esm/OptionsPositionEvent.mjs +180 -66
- package/esm/OptionsTradeExecution.d.ts.map +1 -1
- package/esm/OptionsTradeExecution.js.map +1 -1
- package/esm/OptionsTradeExecution.mjs +180 -66
- package/esm/PolicyOverlay.d.ts.map +1 -1
- package/esm/PolicyOverlay.js.map +1 -1
- package/esm/PolicyOverlay.mjs +180 -66
- package/esm/PortfolioGreeksHistory.d.ts.map +1 -1
- package/esm/PortfolioGreeksHistory.js.map +1 -1
- package/esm/PortfolioGreeksHistory.mjs +180 -66
- package/esm/ScheduledOptionOrder.d.ts.map +1 -1
- package/esm/ScheduledOptionOrder.js.map +1 -1
- package/esm/ScheduledOptionOrder.mjs +180 -66
- package/esm/Session.d.ts.map +1 -1
- package/esm/Session.js.map +1 -1
- package/esm/Session.mjs +180 -66
- package/esm/SignalGeneratorMetrics.d.ts.map +1 -1
- package/esm/SignalGeneratorMetrics.js.map +1 -1
- package/esm/SignalGeneratorMetrics.mjs +180 -66
- package/esm/SignalLineage.d.ts.map +1 -1
- package/esm/SignalLineage.js.map +1 -1
- package/esm/SignalLineage.mjs +180 -66
- package/esm/SignalOutcome.d.ts.map +1 -1
- package/esm/SignalOutcome.js.map +1 -1
- package/esm/SignalOutcome.mjs +180 -66
- package/esm/SignalPriorityQueue.d.ts.map +1 -1
- package/esm/SignalPriorityQueue.js.map +1 -1
- package/esm/SignalPriorityQueue.mjs +180 -66
- package/esm/SyncEvent.d.ts.map +1 -1
- package/esm/SyncEvent.js.map +1 -1
- package/esm/SyncEvent.mjs +180 -66
- package/esm/SystemAlert.d.ts.map +1 -1
- package/esm/SystemAlert.js.map +1 -1
- package/esm/SystemAlert.mjs +180 -66
- package/esm/Trade.d.ts.map +1 -1
- package/esm/Trade.js.map +1 -1
- package/esm/Trade.mjs +180 -66
- package/esm/TradeAuditEvent.d.ts.map +1 -1
- package/esm/TradeAuditEvent.js.map +1 -1
- package/esm/TradeAuditEvent.mjs +180 -66
- package/esm/TradeExecutionHistory.d.ts.map +1 -1
- package/esm/TradeExecutionHistory.js.map +1 -1
- package/esm/TradeExecutionHistory.mjs +180 -66
- package/esm/TradeOutcome.d.ts.map +1 -1
- package/esm/TradeOutcome.js.map +1 -1
- package/esm/TradeOutcome.mjs +180 -66
- package/esm/TradingPolicy.d.ts.map +1 -1
- package/esm/TradingPolicy.js.map +1 -1
- package/esm/TradingPolicy.mjs +180 -66
- package/esm/User.d.ts.map +1 -1
- package/esm/User.js.map +1 -1
- package/esm/User.mjs +180 -66
- package/esm/VerificationToken.d.ts.map +1 -1
- package/esm/VerificationToken.js.map +1 -1
- package/esm/VerificationToken.mjs +180 -66
- package/esm/WaitlistEntry.d.ts.map +1 -1
- package/esm/WaitlistEntry.js.map +1 -1
- package/esm/WaitlistEntry.mjs +180 -66
- package/esm/client.d.ts +32 -0
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js.map +1 -1
- package/esm/client.mjs +130 -9
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js.map +1 -1
- package/esm/index.mjs +1 -1
- package/index.cjs +2 -1
- package/index.d.ts +2 -2
- package/package.json +1 -1
package/TradingPolicy.cjs
CHANGED
|
@@ -660,13 +660,28 @@ exports.TradingPolicy = {
|
|
|
660
660
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
661
661
|
continue;
|
|
662
662
|
}
|
|
663
|
-
// Log structured error details and rethrow
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
663
|
+
// Log structured error details and rethrow.
|
|
664
|
+
// Demote transient failures to WARN with explicit transient+recoveryHint
|
|
665
|
+
// metadata so log analytics can distinguish recoverable upstream retries
|
|
666
|
+
// from true defects.
|
|
667
|
+
if (isConnectionError) {
|
|
668
|
+
logger_1.logger.warn("Database create operation failed (transient after retries)", {
|
|
669
|
+
operation: 'createOneTradingPolicy',
|
|
670
|
+
model: 'TradingPolicy',
|
|
671
|
+
error: String(error),
|
|
672
|
+
isRetryable: true,
|
|
673
|
+
transient: true,
|
|
674
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
else {
|
|
678
|
+
logger_1.logger.error("Database create operation failed", {
|
|
679
|
+
operation: 'createOneTradingPolicy',
|
|
680
|
+
model: 'TradingPolicy',
|
|
681
|
+
error: String(error),
|
|
682
|
+
isRetryable: false,
|
|
683
|
+
});
|
|
684
|
+
}
|
|
670
685
|
throw error;
|
|
671
686
|
}
|
|
672
687
|
}
|
|
@@ -848,13 +863,25 @@ exports.TradingPolicy = {
|
|
|
848
863
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
849
864
|
continue;
|
|
850
865
|
}
|
|
851
|
-
// Log structured error details and rethrow
|
|
852
|
-
|
|
853
|
-
operation
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
866
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
867
|
+
if (isConnectionError) {
|
|
868
|
+
logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
|
|
869
|
+
operation: 'createManyTradingPolicy',
|
|
870
|
+
model: 'TradingPolicy',
|
|
871
|
+
error: String(error),
|
|
872
|
+
isRetryable: true,
|
|
873
|
+
transient: true,
|
|
874
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
875
|
+
});
|
|
876
|
+
}
|
|
877
|
+
else {
|
|
878
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
879
|
+
operation: 'createManyTradingPolicy',
|
|
880
|
+
model: 'TradingPolicy',
|
|
881
|
+
error: String(error),
|
|
882
|
+
isRetryable: false,
|
|
883
|
+
});
|
|
884
|
+
}
|
|
858
885
|
throw error;
|
|
859
886
|
}
|
|
860
887
|
}
|
|
@@ -2566,14 +2593,27 @@ exports.TradingPolicy = {
|
|
|
2566
2593
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2567
2594
|
continue;
|
|
2568
2595
|
}
|
|
2569
|
-
// Log structured error details and rethrow
|
|
2570
|
-
|
|
2571
|
-
operation
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2596
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
2597
|
+
if (isConnectionError) {
|
|
2598
|
+
logger_1.logger.warn("Database update operation failed (transient after retries)", {
|
|
2599
|
+
operation: 'updateOneTradingPolicy',
|
|
2600
|
+
model: 'TradingPolicy',
|
|
2601
|
+
error: String(error),
|
|
2602
|
+
recordId: props.id,
|
|
2603
|
+
isRetryable: true,
|
|
2604
|
+
transient: true,
|
|
2605
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
2606
|
+
});
|
|
2607
|
+
}
|
|
2608
|
+
else {
|
|
2609
|
+
logger_1.logger.error("Database update operation failed", {
|
|
2610
|
+
operation: 'updateOneTradingPolicy',
|
|
2611
|
+
model: 'TradingPolicy',
|
|
2612
|
+
error: String(error),
|
|
2613
|
+
recordId: props.id,
|
|
2614
|
+
isRetryable: false,
|
|
2615
|
+
});
|
|
2616
|
+
}
|
|
2577
2617
|
throw error;
|
|
2578
2618
|
}
|
|
2579
2619
|
}
|
|
@@ -4752,14 +4792,27 @@ exports.TradingPolicy = {
|
|
|
4752
4792
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4753
4793
|
continue;
|
|
4754
4794
|
}
|
|
4755
|
-
// Log structured error details and rethrow
|
|
4756
|
-
|
|
4757
|
-
operation
|
|
4758
|
-
|
|
4759
|
-
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4795
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
4796
|
+
if (isConnectionError) {
|
|
4797
|
+
logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
|
|
4798
|
+
operation: 'upsertOneTradingPolicy',
|
|
4799
|
+
model: 'TradingPolicy',
|
|
4800
|
+
error: String(error),
|
|
4801
|
+
recordId: props.id,
|
|
4802
|
+
isRetryable: true,
|
|
4803
|
+
transient: true,
|
|
4804
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
4805
|
+
});
|
|
4806
|
+
}
|
|
4807
|
+
else {
|
|
4808
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
4809
|
+
operation: 'upsertOneTradingPolicy',
|
|
4810
|
+
model: 'TradingPolicy',
|
|
4811
|
+
error: String(error),
|
|
4812
|
+
recordId: props.id,
|
|
4813
|
+
isRetryable: false,
|
|
4814
|
+
});
|
|
4815
|
+
}
|
|
4763
4816
|
throw error;
|
|
4764
4817
|
}
|
|
4765
4818
|
}
|
|
@@ -6469,13 +6522,25 @@ exports.TradingPolicy = {
|
|
|
6469
6522
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6470
6523
|
continue;
|
|
6471
6524
|
}
|
|
6472
|
-
// Log structured error details and rethrow
|
|
6473
|
-
|
|
6474
|
-
operation
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6525
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
6526
|
+
if (isConnectionError) {
|
|
6527
|
+
logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
|
|
6528
|
+
operation: 'updateManyTradingPolicy',
|
|
6529
|
+
model: 'TradingPolicy',
|
|
6530
|
+
error: String(error),
|
|
6531
|
+
isRetryable: true,
|
|
6532
|
+
transient: true,
|
|
6533
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
6534
|
+
});
|
|
6535
|
+
}
|
|
6536
|
+
else {
|
|
6537
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
6538
|
+
operation: 'updateManyTradingPolicy',
|
|
6539
|
+
model: 'TradingPolicy',
|
|
6540
|
+
error: String(error),
|
|
6541
|
+
isRetryable: false,
|
|
6542
|
+
});
|
|
6543
|
+
}
|
|
6479
6544
|
throw error;
|
|
6480
6545
|
}
|
|
6481
6546
|
}
|
|
@@ -6598,14 +6663,27 @@ exports.TradingPolicy = {
|
|
|
6598
6663
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6599
6664
|
continue;
|
|
6600
6665
|
}
|
|
6601
|
-
// Log structured error details and rethrow
|
|
6602
|
-
|
|
6603
|
-
operation
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
|
|
6607
|
-
|
|
6608
|
-
|
|
6666
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
6667
|
+
if (isConnectionError) {
|
|
6668
|
+
logger_1.logger.warn("Database delete operation failed (transient after retries)", {
|
|
6669
|
+
operation: 'deleteOneTradingPolicy',
|
|
6670
|
+
model: 'TradingPolicy',
|
|
6671
|
+
error: String(error),
|
|
6672
|
+
recordId: props.id,
|
|
6673
|
+
isRetryable: true,
|
|
6674
|
+
transient: true,
|
|
6675
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
6676
|
+
});
|
|
6677
|
+
}
|
|
6678
|
+
else {
|
|
6679
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
6680
|
+
operation: 'deleteOneTradingPolicy',
|
|
6681
|
+
model: 'TradingPolicy',
|
|
6682
|
+
error: String(error),
|
|
6683
|
+
recordId: props.id,
|
|
6684
|
+
isRetryable: false,
|
|
6685
|
+
});
|
|
6686
|
+
}
|
|
6609
6687
|
throw error;
|
|
6610
6688
|
}
|
|
6611
6689
|
}
|
|
@@ -6711,13 +6789,25 @@ exports.TradingPolicy = {
|
|
|
6711
6789
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6712
6790
|
continue;
|
|
6713
6791
|
}
|
|
6714
|
-
// Log structured error details and rethrow
|
|
6715
|
-
|
|
6716
|
-
operation
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6792
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
6793
|
+
if (isConnectionError) {
|
|
6794
|
+
logger_1.logger.warn("Database get operation failed (transient after retries)", {
|
|
6795
|
+
operation: 'getTradingPolicy',
|
|
6796
|
+
model: 'TradingPolicy',
|
|
6797
|
+
error: String(error),
|
|
6798
|
+
isRetryable: true,
|
|
6799
|
+
transient: true,
|
|
6800
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
6801
|
+
});
|
|
6802
|
+
}
|
|
6803
|
+
else {
|
|
6804
|
+
logger_1.logger.error("Database get operation failed", {
|
|
6805
|
+
operation: 'getTradingPolicy',
|
|
6806
|
+
model: 'TradingPolicy',
|
|
6807
|
+
error: String(error),
|
|
6808
|
+
isRetryable: false,
|
|
6809
|
+
});
|
|
6810
|
+
}
|
|
6721
6811
|
throw error;
|
|
6722
6812
|
}
|
|
6723
6813
|
}
|
|
@@ -6804,13 +6894,25 @@ exports.TradingPolicy = {
|
|
|
6804
6894
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6805
6895
|
continue;
|
|
6806
6896
|
}
|
|
6807
|
-
// Log structured error details and rethrow
|
|
6808
|
-
|
|
6809
|
-
operation
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6897
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
6898
|
+
if (isConnectionError) {
|
|
6899
|
+
logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
|
|
6900
|
+
operation: 'getAllTradingPolicy',
|
|
6901
|
+
model: 'TradingPolicy',
|
|
6902
|
+
error: String(error),
|
|
6903
|
+
isRetryable: true,
|
|
6904
|
+
transient: true,
|
|
6905
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
6906
|
+
});
|
|
6907
|
+
}
|
|
6908
|
+
else {
|
|
6909
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
6910
|
+
operation: 'getAllTradingPolicy',
|
|
6911
|
+
model: 'TradingPolicy',
|
|
6912
|
+
error: String(error),
|
|
6913
|
+
isRetryable: false,
|
|
6914
|
+
});
|
|
6915
|
+
}
|
|
6814
6916
|
throw error;
|
|
6815
6917
|
}
|
|
6816
6918
|
}
|
|
@@ -6930,13 +7032,25 @@ exports.TradingPolicy = {
|
|
|
6930
7032
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6931
7033
|
continue;
|
|
6932
7034
|
}
|
|
6933
|
-
// Log structured error details and rethrow
|
|
6934
|
-
|
|
6935
|
-
operation
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
7035
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
7036
|
+
if (isConnectionError) {
|
|
7037
|
+
logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
|
|
7038
|
+
operation: 'findManyTradingPolicy',
|
|
7039
|
+
model: 'TradingPolicy',
|
|
7040
|
+
error: String(error),
|
|
7041
|
+
isRetryable: true,
|
|
7042
|
+
transient: true,
|
|
7043
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
7044
|
+
});
|
|
7045
|
+
}
|
|
7046
|
+
else {
|
|
7047
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
7048
|
+
operation: 'findManyTradingPolicy',
|
|
7049
|
+
model: 'TradingPolicy',
|
|
7050
|
+
error: String(error),
|
|
7051
|
+
isRetryable: false,
|
|
7052
|
+
});
|
|
7053
|
+
}
|
|
6940
7054
|
throw error;
|
|
6941
7055
|
}
|
|
6942
7056
|
}
|
package/User.cjs
CHANGED
|
@@ -807,13 +807,28 @@ exports.User = {
|
|
|
807
807
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
808
808
|
continue;
|
|
809
809
|
}
|
|
810
|
-
// Log structured error details and rethrow
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
810
|
+
// Log structured error details and rethrow.
|
|
811
|
+
// Demote transient failures to WARN with explicit transient+recoveryHint
|
|
812
|
+
// metadata so log analytics can distinguish recoverable upstream retries
|
|
813
|
+
// from true defects.
|
|
814
|
+
if (isConnectionError) {
|
|
815
|
+
logger_1.logger.warn("Database create operation failed (transient after retries)", {
|
|
816
|
+
operation: 'createOneUser',
|
|
817
|
+
model: 'User',
|
|
818
|
+
error: String(error),
|
|
819
|
+
isRetryable: true,
|
|
820
|
+
transient: true,
|
|
821
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
822
|
+
});
|
|
823
|
+
}
|
|
824
|
+
else {
|
|
825
|
+
logger_1.logger.error("Database create operation failed", {
|
|
826
|
+
operation: 'createOneUser',
|
|
827
|
+
model: 'User',
|
|
828
|
+
error: String(error),
|
|
829
|
+
isRetryable: false,
|
|
830
|
+
});
|
|
831
|
+
}
|
|
817
832
|
throw error;
|
|
818
833
|
}
|
|
819
834
|
}
|
|
@@ -944,13 +959,25 @@ exports.User = {
|
|
|
944
959
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
945
960
|
continue;
|
|
946
961
|
}
|
|
947
|
-
// Log structured error details and rethrow
|
|
948
|
-
|
|
949
|
-
operation
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
962
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
963
|
+
if (isConnectionError) {
|
|
964
|
+
logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
|
|
965
|
+
operation: 'createManyUser',
|
|
966
|
+
model: 'User',
|
|
967
|
+
error: String(error),
|
|
968
|
+
isRetryable: true,
|
|
969
|
+
transient: true,
|
|
970
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
else {
|
|
974
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
975
|
+
operation: 'createManyUser',
|
|
976
|
+
model: 'User',
|
|
977
|
+
error: String(error),
|
|
978
|
+
isRetryable: false,
|
|
979
|
+
});
|
|
980
|
+
}
|
|
954
981
|
throw error;
|
|
955
982
|
}
|
|
956
983
|
}
|
|
@@ -2468,14 +2495,27 @@ exports.User = {
|
|
|
2468
2495
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2469
2496
|
continue;
|
|
2470
2497
|
}
|
|
2471
|
-
// Log structured error details and rethrow
|
|
2472
|
-
|
|
2473
|
-
operation
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2498
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
2499
|
+
if (isConnectionError) {
|
|
2500
|
+
logger_1.logger.warn("Database update operation failed (transient after retries)", {
|
|
2501
|
+
operation: 'updateOneUser',
|
|
2502
|
+
model: 'User',
|
|
2503
|
+
error: String(error),
|
|
2504
|
+
recordId: props.id,
|
|
2505
|
+
isRetryable: true,
|
|
2506
|
+
transient: true,
|
|
2507
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
2508
|
+
});
|
|
2509
|
+
}
|
|
2510
|
+
else {
|
|
2511
|
+
logger_1.logger.error("Database update operation failed", {
|
|
2512
|
+
operation: 'updateOneUser',
|
|
2513
|
+
model: 'User',
|
|
2514
|
+
error: String(error),
|
|
2515
|
+
recordId: props.id,
|
|
2516
|
+
isRetryable: false,
|
|
2517
|
+
});
|
|
2518
|
+
}
|
|
2479
2519
|
throw error;
|
|
2480
2520
|
}
|
|
2481
2521
|
}
|
|
@@ -4483,14 +4523,27 @@ exports.User = {
|
|
|
4483
4523
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4484
4524
|
continue;
|
|
4485
4525
|
}
|
|
4486
|
-
// Log structured error details and rethrow
|
|
4487
|
-
|
|
4488
|
-
operation
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4526
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
4527
|
+
if (isConnectionError) {
|
|
4528
|
+
logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
|
|
4529
|
+
operation: 'upsertOneUser',
|
|
4530
|
+
model: 'User',
|
|
4531
|
+
error: String(error),
|
|
4532
|
+
recordId: props.id,
|
|
4533
|
+
isRetryable: true,
|
|
4534
|
+
transient: true,
|
|
4535
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
4536
|
+
});
|
|
4537
|
+
}
|
|
4538
|
+
else {
|
|
4539
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
4540
|
+
operation: 'upsertOneUser',
|
|
4541
|
+
model: 'User',
|
|
4542
|
+
error: String(error),
|
|
4543
|
+
recordId: props.id,
|
|
4544
|
+
isRetryable: false,
|
|
4545
|
+
});
|
|
4546
|
+
}
|
|
4494
4547
|
throw error;
|
|
4495
4548
|
}
|
|
4496
4549
|
}
|
|
@@ -6006,13 +6059,25 @@ exports.User = {
|
|
|
6006
6059
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6007
6060
|
continue;
|
|
6008
6061
|
}
|
|
6009
|
-
// Log structured error details and rethrow
|
|
6010
|
-
|
|
6011
|
-
operation
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6062
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
6063
|
+
if (isConnectionError) {
|
|
6064
|
+
logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
|
|
6065
|
+
operation: 'updateManyUser',
|
|
6066
|
+
model: 'User',
|
|
6067
|
+
error: String(error),
|
|
6068
|
+
isRetryable: true,
|
|
6069
|
+
transient: true,
|
|
6070
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
6071
|
+
});
|
|
6072
|
+
}
|
|
6073
|
+
else {
|
|
6074
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
6075
|
+
operation: 'updateManyUser',
|
|
6076
|
+
model: 'User',
|
|
6077
|
+
error: String(error),
|
|
6078
|
+
isRetryable: false,
|
|
6079
|
+
});
|
|
6080
|
+
}
|
|
6016
6081
|
throw error;
|
|
6017
6082
|
}
|
|
6018
6083
|
}
|
|
@@ -6135,14 +6200,27 @@ exports.User = {
|
|
|
6135
6200
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6136
6201
|
continue;
|
|
6137
6202
|
}
|
|
6138
|
-
// Log structured error details and rethrow
|
|
6139
|
-
|
|
6140
|
-
operation
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6203
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
6204
|
+
if (isConnectionError) {
|
|
6205
|
+
logger_1.logger.warn("Database delete operation failed (transient after retries)", {
|
|
6206
|
+
operation: 'deleteOneUser',
|
|
6207
|
+
model: 'User',
|
|
6208
|
+
error: String(error),
|
|
6209
|
+
recordId: props.id,
|
|
6210
|
+
isRetryable: true,
|
|
6211
|
+
transient: true,
|
|
6212
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
6213
|
+
});
|
|
6214
|
+
}
|
|
6215
|
+
else {
|
|
6216
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
6217
|
+
operation: 'deleteOneUser',
|
|
6218
|
+
model: 'User',
|
|
6219
|
+
error: String(error),
|
|
6220
|
+
recordId: props.id,
|
|
6221
|
+
isRetryable: false,
|
|
6222
|
+
});
|
|
6223
|
+
}
|
|
6146
6224
|
throw error;
|
|
6147
6225
|
}
|
|
6148
6226
|
}
|
|
@@ -6242,13 +6320,25 @@ exports.User = {
|
|
|
6242
6320
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6243
6321
|
continue;
|
|
6244
6322
|
}
|
|
6245
|
-
// Log structured error details and rethrow
|
|
6246
|
-
|
|
6247
|
-
operation
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6323
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
6324
|
+
if (isConnectionError) {
|
|
6325
|
+
logger_1.logger.warn("Database get operation failed (transient after retries)", {
|
|
6326
|
+
operation: 'getUser',
|
|
6327
|
+
model: 'User',
|
|
6328
|
+
error: String(error),
|
|
6329
|
+
isRetryable: true,
|
|
6330
|
+
transient: true,
|
|
6331
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
6332
|
+
});
|
|
6333
|
+
}
|
|
6334
|
+
else {
|
|
6335
|
+
logger_1.logger.error("Database get operation failed", {
|
|
6336
|
+
operation: 'getUser',
|
|
6337
|
+
model: 'User',
|
|
6338
|
+
error: String(error),
|
|
6339
|
+
isRetryable: false,
|
|
6340
|
+
});
|
|
6341
|
+
}
|
|
6252
6342
|
throw error;
|
|
6253
6343
|
}
|
|
6254
6344
|
}
|
|
@@ -6335,13 +6425,25 @@ exports.User = {
|
|
|
6335
6425
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6336
6426
|
continue;
|
|
6337
6427
|
}
|
|
6338
|
-
// Log structured error details and rethrow
|
|
6339
|
-
|
|
6340
|
-
operation
|
|
6341
|
-
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6428
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
6429
|
+
if (isConnectionError) {
|
|
6430
|
+
logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
|
|
6431
|
+
operation: 'getAllUser',
|
|
6432
|
+
model: 'User',
|
|
6433
|
+
error: String(error),
|
|
6434
|
+
isRetryable: true,
|
|
6435
|
+
transient: true,
|
|
6436
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
6437
|
+
});
|
|
6438
|
+
}
|
|
6439
|
+
else {
|
|
6440
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
6441
|
+
operation: 'getAllUser',
|
|
6442
|
+
model: 'User',
|
|
6443
|
+
error: String(error),
|
|
6444
|
+
isRetryable: false,
|
|
6445
|
+
});
|
|
6446
|
+
}
|
|
6345
6447
|
throw error;
|
|
6346
6448
|
}
|
|
6347
6449
|
}
|
|
@@ -6455,13 +6557,25 @@ exports.User = {
|
|
|
6455
6557
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
6456
6558
|
continue;
|
|
6457
6559
|
}
|
|
6458
|
-
// Log structured error details and rethrow
|
|
6459
|
-
|
|
6460
|
-
operation
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6560
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
6561
|
+
if (isConnectionError) {
|
|
6562
|
+
logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
|
|
6563
|
+
operation: 'findManyUser',
|
|
6564
|
+
model: 'User',
|
|
6565
|
+
error: String(error),
|
|
6566
|
+
isRetryable: true,
|
|
6567
|
+
transient: true,
|
|
6568
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
6569
|
+
});
|
|
6570
|
+
}
|
|
6571
|
+
else {
|
|
6572
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
6573
|
+
operation: 'findManyUser',
|
|
6574
|
+
model: 'User',
|
|
6575
|
+
error: String(error),
|
|
6576
|
+
isRetryable: false,
|
|
6577
|
+
});
|
|
6578
|
+
}
|
|
6465
6579
|
throw error;
|
|
6466
6580
|
}
|
|
6467
6581
|
}
|