@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
|
@@ -142,13 +142,28 @@ exports.TradeExecutionHistory = {
|
|
|
142
142
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
143
143
|
continue;
|
|
144
144
|
}
|
|
145
|
-
// Log structured error details and rethrow
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
145
|
+
// Log structured error details and rethrow.
|
|
146
|
+
// Demote transient failures to WARN with explicit transient+recoveryHint
|
|
147
|
+
// metadata so log analytics can distinguish recoverable upstream retries
|
|
148
|
+
// from true defects.
|
|
149
|
+
if (isConnectionError) {
|
|
150
|
+
logger_1.logger.warn("Database create operation failed (transient after retries)", {
|
|
151
|
+
operation: 'createOneTradeExecutionHistory',
|
|
152
|
+
model: 'TradeExecutionHistory',
|
|
153
|
+
error: String(error),
|
|
154
|
+
isRetryable: true,
|
|
155
|
+
transient: true,
|
|
156
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
logger_1.logger.error("Database create operation failed", {
|
|
161
|
+
operation: 'createOneTradeExecutionHistory',
|
|
162
|
+
model: 'TradeExecutionHistory',
|
|
163
|
+
error: String(error),
|
|
164
|
+
isRetryable: false,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
152
167
|
throw error;
|
|
153
168
|
}
|
|
154
169
|
}
|
|
@@ -272,13 +287,25 @@ exports.TradeExecutionHistory = {
|
|
|
272
287
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
273
288
|
continue;
|
|
274
289
|
}
|
|
275
|
-
// Log structured error details and rethrow
|
|
276
|
-
|
|
277
|
-
operation
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
290
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
291
|
+
if (isConnectionError) {
|
|
292
|
+
logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
|
|
293
|
+
operation: 'createManyTradeExecutionHistory',
|
|
294
|
+
model: 'TradeExecutionHistory',
|
|
295
|
+
error: String(error),
|
|
296
|
+
isRetryable: true,
|
|
297
|
+
transient: true,
|
|
298
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
303
|
+
operation: 'createManyTradeExecutionHistory',
|
|
304
|
+
model: 'TradeExecutionHistory',
|
|
305
|
+
error: String(error),
|
|
306
|
+
isRetryable: false,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
282
309
|
throw error;
|
|
283
310
|
}
|
|
284
311
|
}
|
|
@@ -419,14 +446,27 @@ exports.TradeExecutionHistory = {
|
|
|
419
446
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
420
447
|
continue;
|
|
421
448
|
}
|
|
422
|
-
// Log structured error details and rethrow
|
|
423
|
-
|
|
424
|
-
operation
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
449
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
450
|
+
if (isConnectionError) {
|
|
451
|
+
logger_1.logger.warn("Database update operation failed (transient after retries)", {
|
|
452
|
+
operation: 'updateOneTradeExecutionHistory',
|
|
453
|
+
model: 'TradeExecutionHistory',
|
|
454
|
+
error: String(error),
|
|
455
|
+
recordId: props.id,
|
|
456
|
+
isRetryable: true,
|
|
457
|
+
transient: true,
|
|
458
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
else {
|
|
462
|
+
logger_1.logger.error("Database update operation failed", {
|
|
463
|
+
operation: 'updateOneTradeExecutionHistory',
|
|
464
|
+
model: 'TradeExecutionHistory',
|
|
465
|
+
error: String(error),
|
|
466
|
+
recordId: props.id,
|
|
467
|
+
isRetryable: false,
|
|
468
|
+
});
|
|
469
|
+
}
|
|
430
470
|
throw error;
|
|
431
471
|
}
|
|
432
472
|
}
|
|
@@ -569,14 +609,27 @@ exports.TradeExecutionHistory = {
|
|
|
569
609
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
570
610
|
continue;
|
|
571
611
|
}
|
|
572
|
-
// Log structured error details and rethrow
|
|
573
|
-
|
|
574
|
-
operation
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
612
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
613
|
+
if (isConnectionError) {
|
|
614
|
+
logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
|
|
615
|
+
operation: 'upsertOneTradeExecutionHistory',
|
|
616
|
+
model: 'TradeExecutionHistory',
|
|
617
|
+
error: String(error),
|
|
618
|
+
recordId: props.id,
|
|
619
|
+
isRetryable: true,
|
|
620
|
+
transient: true,
|
|
621
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
626
|
+
operation: 'upsertOneTradeExecutionHistory',
|
|
627
|
+
model: 'TradeExecutionHistory',
|
|
628
|
+
error: String(error),
|
|
629
|
+
recordId: props.id,
|
|
630
|
+
isRetryable: false,
|
|
631
|
+
});
|
|
632
|
+
}
|
|
580
633
|
throw error;
|
|
581
634
|
}
|
|
582
635
|
}
|
|
@@ -715,13 +768,25 @@ exports.TradeExecutionHistory = {
|
|
|
715
768
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
716
769
|
continue;
|
|
717
770
|
}
|
|
718
|
-
// Log structured error details and rethrow
|
|
719
|
-
|
|
720
|
-
operation
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
771
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
772
|
+
if (isConnectionError) {
|
|
773
|
+
logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
|
|
774
|
+
operation: 'updateManyTradeExecutionHistory',
|
|
775
|
+
model: 'TradeExecutionHistory',
|
|
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 updateMany operation failed", {
|
|
784
|
+
operation: 'updateManyTradeExecutionHistory',
|
|
785
|
+
model: 'TradeExecutionHistory',
|
|
786
|
+
error: String(error),
|
|
787
|
+
isRetryable: false,
|
|
788
|
+
});
|
|
789
|
+
}
|
|
725
790
|
throw error;
|
|
726
791
|
}
|
|
727
792
|
}
|
|
@@ -844,14 +909,27 @@ exports.TradeExecutionHistory = {
|
|
|
844
909
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
845
910
|
continue;
|
|
846
911
|
}
|
|
847
|
-
// Log structured error details and rethrow
|
|
848
|
-
|
|
849
|
-
operation
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
912
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
913
|
+
if (isConnectionError) {
|
|
914
|
+
logger_1.logger.warn("Database delete operation failed (transient after retries)", {
|
|
915
|
+
operation: 'deleteOneTradeExecutionHistory',
|
|
916
|
+
model: 'TradeExecutionHistory',
|
|
917
|
+
error: String(error),
|
|
918
|
+
recordId: props.id,
|
|
919
|
+
isRetryable: true,
|
|
920
|
+
transient: true,
|
|
921
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
922
|
+
});
|
|
923
|
+
}
|
|
924
|
+
else {
|
|
925
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
926
|
+
operation: 'deleteOneTradeExecutionHistory',
|
|
927
|
+
model: 'TradeExecutionHistory',
|
|
928
|
+
error: String(error),
|
|
929
|
+
recordId: props.id,
|
|
930
|
+
isRetryable: false,
|
|
931
|
+
});
|
|
932
|
+
}
|
|
855
933
|
throw error;
|
|
856
934
|
}
|
|
857
935
|
}
|
|
@@ -947,13 +1025,25 @@ exports.TradeExecutionHistory = {
|
|
|
947
1025
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
948
1026
|
continue;
|
|
949
1027
|
}
|
|
950
|
-
// Log structured error details and rethrow
|
|
951
|
-
|
|
952
|
-
operation
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
1028
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1029
|
+
if (isConnectionError) {
|
|
1030
|
+
logger_1.logger.warn("Database get operation failed (transient after retries)", {
|
|
1031
|
+
operation: 'getTradeExecutionHistory',
|
|
1032
|
+
model: 'TradeExecutionHistory',
|
|
1033
|
+
error: String(error),
|
|
1034
|
+
isRetryable: true,
|
|
1035
|
+
transient: true,
|
|
1036
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1037
|
+
});
|
|
1038
|
+
}
|
|
1039
|
+
else {
|
|
1040
|
+
logger_1.logger.error("Database get operation failed", {
|
|
1041
|
+
operation: 'getTradeExecutionHistory',
|
|
1042
|
+
model: 'TradeExecutionHistory',
|
|
1043
|
+
error: String(error),
|
|
1044
|
+
isRetryable: false,
|
|
1045
|
+
});
|
|
1046
|
+
}
|
|
957
1047
|
throw error;
|
|
958
1048
|
}
|
|
959
1049
|
}
|
|
@@ -1040,13 +1130,25 @@ exports.TradeExecutionHistory = {
|
|
|
1040
1130
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1041
1131
|
continue;
|
|
1042
1132
|
}
|
|
1043
|
-
// Log structured error details and rethrow
|
|
1044
|
-
|
|
1045
|
-
operation
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1133
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1134
|
+
if (isConnectionError) {
|
|
1135
|
+
logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
|
|
1136
|
+
operation: 'getAllTradeExecutionHistory',
|
|
1137
|
+
model: 'TradeExecutionHistory',
|
|
1138
|
+
error: String(error),
|
|
1139
|
+
isRetryable: true,
|
|
1140
|
+
transient: true,
|
|
1141
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1142
|
+
});
|
|
1143
|
+
}
|
|
1144
|
+
else {
|
|
1145
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
1146
|
+
operation: 'getAllTradeExecutionHistory',
|
|
1147
|
+
model: 'TradeExecutionHistory',
|
|
1148
|
+
error: String(error),
|
|
1149
|
+
isRetryable: false,
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1050
1152
|
throw error;
|
|
1051
1153
|
}
|
|
1052
1154
|
}
|
|
@@ -1154,13 +1256,25 @@ exports.TradeExecutionHistory = {
|
|
|
1154
1256
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1155
1257
|
continue;
|
|
1156
1258
|
}
|
|
1157
|
-
// Log structured error details and rethrow
|
|
1158
|
-
|
|
1159
|
-
operation
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1259
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1260
|
+
if (isConnectionError) {
|
|
1261
|
+
logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
|
|
1262
|
+
operation: 'findManyTradeExecutionHistory',
|
|
1263
|
+
model: 'TradeExecutionHistory',
|
|
1264
|
+
error: String(error),
|
|
1265
|
+
isRetryable: true,
|
|
1266
|
+
transient: true,
|
|
1267
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
else {
|
|
1271
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
1272
|
+
operation: 'findManyTradeExecutionHistory',
|
|
1273
|
+
model: 'TradeExecutionHistory',
|
|
1274
|
+
error: String(error),
|
|
1275
|
+
isRetryable: false,
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1164
1278
|
throw error;
|
|
1165
1279
|
}
|
|
1166
1280
|
}
|
package/TradeOutcome.cjs
CHANGED
|
@@ -174,13 +174,28 @@ exports.TradeOutcome = {
|
|
|
174
174
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
175
175
|
continue;
|
|
176
176
|
}
|
|
177
|
-
// Log structured error details and rethrow
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
177
|
+
// Log structured error details and rethrow.
|
|
178
|
+
// Demote transient failures to WARN with explicit transient+recoveryHint
|
|
179
|
+
// metadata so log analytics can distinguish recoverable upstream retries
|
|
180
|
+
// from true defects.
|
|
181
|
+
if (isConnectionError) {
|
|
182
|
+
logger_1.logger.warn("Database create operation failed (transient after retries)", {
|
|
183
|
+
operation: 'createOneTradeOutcome',
|
|
184
|
+
model: 'TradeOutcome',
|
|
185
|
+
error: String(error),
|
|
186
|
+
isRetryable: true,
|
|
187
|
+
transient: true,
|
|
188
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
logger_1.logger.error("Database create operation failed", {
|
|
193
|
+
operation: 'createOneTradeOutcome',
|
|
194
|
+
model: 'TradeOutcome',
|
|
195
|
+
error: String(error),
|
|
196
|
+
isRetryable: false,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
184
199
|
throw error;
|
|
185
200
|
}
|
|
186
201
|
}
|
|
@@ -319,13 +334,25 @@ exports.TradeOutcome = {
|
|
|
319
334
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
320
335
|
continue;
|
|
321
336
|
}
|
|
322
|
-
// Log structured error details and rethrow
|
|
323
|
-
|
|
324
|
-
operation
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
337
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
338
|
+
if (isConnectionError) {
|
|
339
|
+
logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
|
|
340
|
+
operation: 'createManyTradeOutcome',
|
|
341
|
+
model: 'TradeOutcome',
|
|
342
|
+
error: String(error),
|
|
343
|
+
isRetryable: true,
|
|
344
|
+
transient: true,
|
|
345
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
else {
|
|
349
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
350
|
+
operation: 'createManyTradeOutcome',
|
|
351
|
+
model: 'TradeOutcome',
|
|
352
|
+
error: String(error),
|
|
353
|
+
isRetryable: false,
|
|
354
|
+
});
|
|
355
|
+
}
|
|
329
356
|
throw error;
|
|
330
357
|
}
|
|
331
358
|
}
|
|
@@ -517,14 +544,27 @@ exports.TradeOutcome = {
|
|
|
517
544
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
518
545
|
continue;
|
|
519
546
|
}
|
|
520
|
-
// Log structured error details and rethrow
|
|
521
|
-
|
|
522
|
-
operation
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
547
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
548
|
+
if (isConnectionError) {
|
|
549
|
+
logger_1.logger.warn("Database update operation failed (transient after retries)", {
|
|
550
|
+
operation: 'updateOneTradeOutcome',
|
|
551
|
+
model: 'TradeOutcome',
|
|
552
|
+
error: String(error),
|
|
553
|
+
recordId: props.id,
|
|
554
|
+
isRetryable: true,
|
|
555
|
+
transient: true,
|
|
556
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
else {
|
|
560
|
+
logger_1.logger.error("Database update operation failed", {
|
|
561
|
+
operation: 'updateOneTradeOutcome',
|
|
562
|
+
model: 'TradeOutcome',
|
|
563
|
+
error: String(error),
|
|
564
|
+
recordId: props.id,
|
|
565
|
+
isRetryable: false,
|
|
566
|
+
});
|
|
567
|
+
}
|
|
528
568
|
throw error;
|
|
529
569
|
}
|
|
530
570
|
}
|
|
@@ -739,14 +779,27 @@ exports.TradeOutcome = {
|
|
|
739
779
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
740
780
|
continue;
|
|
741
781
|
}
|
|
742
|
-
// Log structured error details and rethrow
|
|
743
|
-
|
|
744
|
-
operation
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
782
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
783
|
+
if (isConnectionError) {
|
|
784
|
+
logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
|
|
785
|
+
operation: 'upsertOneTradeOutcome',
|
|
786
|
+
model: 'TradeOutcome',
|
|
787
|
+
error: String(error),
|
|
788
|
+
recordId: props.id,
|
|
789
|
+
isRetryable: true,
|
|
790
|
+
transient: true,
|
|
791
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
else {
|
|
795
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
796
|
+
operation: 'upsertOneTradeOutcome',
|
|
797
|
+
model: 'TradeOutcome',
|
|
798
|
+
error: String(error),
|
|
799
|
+
recordId: props.id,
|
|
800
|
+
isRetryable: false,
|
|
801
|
+
});
|
|
802
|
+
}
|
|
750
803
|
throw error;
|
|
751
804
|
}
|
|
752
805
|
}
|
|
@@ -936,13 +989,25 @@ exports.TradeOutcome = {
|
|
|
936
989
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
937
990
|
continue;
|
|
938
991
|
}
|
|
939
|
-
// Log structured error details and rethrow
|
|
940
|
-
|
|
941
|
-
operation
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
992
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
993
|
+
if (isConnectionError) {
|
|
994
|
+
logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
|
|
995
|
+
operation: 'updateManyTradeOutcome',
|
|
996
|
+
model: 'TradeOutcome',
|
|
997
|
+
error: String(error),
|
|
998
|
+
isRetryable: true,
|
|
999
|
+
transient: true,
|
|
1000
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1001
|
+
});
|
|
1002
|
+
}
|
|
1003
|
+
else {
|
|
1004
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
1005
|
+
operation: 'updateManyTradeOutcome',
|
|
1006
|
+
model: 'TradeOutcome',
|
|
1007
|
+
error: String(error),
|
|
1008
|
+
isRetryable: false,
|
|
1009
|
+
});
|
|
1010
|
+
}
|
|
946
1011
|
throw error;
|
|
947
1012
|
}
|
|
948
1013
|
}
|
|
@@ -1065,14 +1130,27 @@ exports.TradeOutcome = {
|
|
|
1065
1130
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1066
1131
|
continue;
|
|
1067
1132
|
}
|
|
1068
|
-
// Log structured error details and rethrow
|
|
1069
|
-
|
|
1070
|
-
operation
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1133
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1134
|
+
if (isConnectionError) {
|
|
1135
|
+
logger_1.logger.warn("Database delete operation failed (transient after retries)", {
|
|
1136
|
+
operation: 'deleteOneTradeOutcome',
|
|
1137
|
+
model: 'TradeOutcome',
|
|
1138
|
+
error: String(error),
|
|
1139
|
+
recordId: props.id,
|
|
1140
|
+
isRetryable: true,
|
|
1141
|
+
transient: true,
|
|
1142
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1143
|
+
});
|
|
1144
|
+
}
|
|
1145
|
+
else {
|
|
1146
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
1147
|
+
operation: 'deleteOneTradeOutcome',
|
|
1148
|
+
model: 'TradeOutcome',
|
|
1149
|
+
error: String(error),
|
|
1150
|
+
recordId: props.id,
|
|
1151
|
+
isRetryable: false,
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1076
1154
|
throw error;
|
|
1077
1155
|
}
|
|
1078
1156
|
}
|
|
@@ -1177,13 +1255,25 @@ exports.TradeOutcome = {
|
|
|
1177
1255
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1178
1256
|
continue;
|
|
1179
1257
|
}
|
|
1180
|
-
// Log structured error details and rethrow
|
|
1181
|
-
|
|
1182
|
-
operation
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1258
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1259
|
+
if (isConnectionError) {
|
|
1260
|
+
logger_1.logger.warn("Database get operation failed (transient after retries)", {
|
|
1261
|
+
operation: 'getTradeOutcome',
|
|
1262
|
+
model: 'TradeOutcome',
|
|
1263
|
+
error: String(error),
|
|
1264
|
+
isRetryable: true,
|
|
1265
|
+
transient: true,
|
|
1266
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1267
|
+
});
|
|
1268
|
+
}
|
|
1269
|
+
else {
|
|
1270
|
+
logger_1.logger.error("Database get operation failed", {
|
|
1271
|
+
operation: 'getTradeOutcome',
|
|
1272
|
+
model: 'TradeOutcome',
|
|
1273
|
+
error: String(error),
|
|
1274
|
+
isRetryable: false,
|
|
1275
|
+
});
|
|
1276
|
+
}
|
|
1187
1277
|
throw error;
|
|
1188
1278
|
}
|
|
1189
1279
|
}
|
|
@@ -1270,13 +1360,25 @@ exports.TradeOutcome = {
|
|
|
1270
1360
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1271
1361
|
continue;
|
|
1272
1362
|
}
|
|
1273
|
-
// Log structured error details and rethrow
|
|
1274
|
-
|
|
1275
|
-
operation
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1363
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1364
|
+
if (isConnectionError) {
|
|
1365
|
+
logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
|
|
1366
|
+
operation: 'getAllTradeOutcome',
|
|
1367
|
+
model: 'TradeOutcome',
|
|
1368
|
+
error: String(error),
|
|
1369
|
+
isRetryable: true,
|
|
1370
|
+
transient: true,
|
|
1371
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1372
|
+
});
|
|
1373
|
+
}
|
|
1374
|
+
else {
|
|
1375
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
1376
|
+
operation: 'getAllTradeOutcome',
|
|
1377
|
+
model: 'TradeOutcome',
|
|
1378
|
+
error: String(error),
|
|
1379
|
+
isRetryable: false,
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1280
1382
|
throw error;
|
|
1281
1383
|
}
|
|
1282
1384
|
}
|
|
@@ -1393,13 +1495,25 @@ exports.TradeOutcome = {
|
|
|
1393
1495
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1394
1496
|
continue;
|
|
1395
1497
|
}
|
|
1396
|
-
// Log structured error details and rethrow
|
|
1397
|
-
|
|
1398
|
-
operation
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1498
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1499
|
+
if (isConnectionError) {
|
|
1500
|
+
logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
|
|
1501
|
+
operation: 'findManyTradeOutcome',
|
|
1502
|
+
model: 'TradeOutcome',
|
|
1503
|
+
error: String(error),
|
|
1504
|
+
isRetryable: true,
|
|
1505
|
+
transient: true,
|
|
1506
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1507
|
+
});
|
|
1508
|
+
}
|
|
1509
|
+
else {
|
|
1510
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
1511
|
+
operation: 'findManyTradeOutcome',
|
|
1512
|
+
model: 'TradeOutcome',
|
|
1513
|
+
error: String(error),
|
|
1514
|
+
isRetryable: false,
|
|
1515
|
+
});
|
|
1516
|
+
}
|
|
1403
1517
|
throw error;
|
|
1404
1518
|
}
|
|
1405
1519
|
}
|