@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/MLTrainingData.cjs
CHANGED
|
@@ -228,13 +228,28 @@ exports.MLTrainingData = {
|
|
|
228
228
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
229
229
|
continue;
|
|
230
230
|
}
|
|
231
|
-
// Log structured error details and rethrow
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
231
|
+
// Log structured error details and rethrow.
|
|
232
|
+
// Demote transient failures to WARN with explicit transient+recoveryHint
|
|
233
|
+
// metadata so log analytics can distinguish recoverable upstream retries
|
|
234
|
+
// from true defects.
|
|
235
|
+
if (isConnectionError) {
|
|
236
|
+
logger_1.logger.warn("Database create operation failed (transient after retries)", {
|
|
237
|
+
operation: 'createOneMLTrainingData',
|
|
238
|
+
model: 'MLTrainingData',
|
|
239
|
+
error: String(error),
|
|
240
|
+
isRetryable: true,
|
|
241
|
+
transient: true,
|
|
242
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
logger_1.logger.error("Database create operation failed", {
|
|
247
|
+
operation: 'createOneMLTrainingData',
|
|
248
|
+
model: 'MLTrainingData',
|
|
249
|
+
error: String(error),
|
|
250
|
+
isRetryable: false,
|
|
251
|
+
});
|
|
252
|
+
}
|
|
238
253
|
throw error;
|
|
239
254
|
}
|
|
240
255
|
}
|
|
@@ -400,13 +415,25 @@ exports.MLTrainingData = {
|
|
|
400
415
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
401
416
|
continue;
|
|
402
417
|
}
|
|
403
|
-
// Log structured error details and rethrow
|
|
404
|
-
|
|
405
|
-
operation
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
418
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
419
|
+
if (isConnectionError) {
|
|
420
|
+
logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
|
|
421
|
+
operation: 'createManyMLTrainingData',
|
|
422
|
+
model: 'MLTrainingData',
|
|
423
|
+
error: String(error),
|
|
424
|
+
isRetryable: true,
|
|
425
|
+
transient: true,
|
|
426
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
431
|
+
operation: 'createManyMLTrainingData',
|
|
432
|
+
model: 'MLTrainingData',
|
|
433
|
+
error: String(error),
|
|
434
|
+
isRetryable: false,
|
|
435
|
+
});
|
|
436
|
+
}
|
|
410
437
|
throw error;
|
|
411
438
|
}
|
|
412
439
|
}
|
|
@@ -677,14 +704,27 @@ exports.MLTrainingData = {
|
|
|
677
704
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
678
705
|
continue;
|
|
679
706
|
}
|
|
680
|
-
// Log structured error details and rethrow
|
|
681
|
-
|
|
682
|
-
operation
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
707
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
708
|
+
if (isConnectionError) {
|
|
709
|
+
logger_1.logger.warn("Database update operation failed (transient after retries)", {
|
|
710
|
+
operation: 'updateOneMLTrainingData',
|
|
711
|
+
model: 'MLTrainingData',
|
|
712
|
+
error: String(error),
|
|
713
|
+
recordId: props.id,
|
|
714
|
+
isRetryable: true,
|
|
715
|
+
transient: true,
|
|
716
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
717
|
+
});
|
|
718
|
+
}
|
|
719
|
+
else {
|
|
720
|
+
logger_1.logger.error("Database update operation failed", {
|
|
721
|
+
operation: 'updateOneMLTrainingData',
|
|
722
|
+
model: 'MLTrainingData',
|
|
723
|
+
error: String(error),
|
|
724
|
+
recordId: props.id,
|
|
725
|
+
isRetryable: false,
|
|
726
|
+
});
|
|
727
|
+
}
|
|
688
728
|
throw error;
|
|
689
729
|
}
|
|
690
730
|
}
|
|
@@ -1002,14 +1042,27 @@ exports.MLTrainingData = {
|
|
|
1002
1042
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1003
1043
|
continue;
|
|
1004
1044
|
}
|
|
1005
|
-
// Log structured error details and rethrow
|
|
1006
|
-
|
|
1007
|
-
operation
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1045
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1046
|
+
if (isConnectionError) {
|
|
1047
|
+
logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
|
|
1048
|
+
operation: 'upsertOneMLTrainingData',
|
|
1049
|
+
model: 'MLTrainingData',
|
|
1050
|
+
error: String(error),
|
|
1051
|
+
recordId: props.id,
|
|
1052
|
+
isRetryable: true,
|
|
1053
|
+
transient: true,
|
|
1054
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
else {
|
|
1058
|
+
logger_1.logger.error("Database upsert operation failed", {
|
|
1059
|
+
operation: 'upsertOneMLTrainingData',
|
|
1060
|
+
model: 'MLTrainingData',
|
|
1061
|
+
error: String(error),
|
|
1062
|
+
recordId: props.id,
|
|
1063
|
+
isRetryable: false,
|
|
1064
|
+
});
|
|
1065
|
+
}
|
|
1013
1066
|
throw error;
|
|
1014
1067
|
}
|
|
1015
1068
|
}
|
|
@@ -1278,13 +1331,25 @@ exports.MLTrainingData = {
|
|
|
1278
1331
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1279
1332
|
continue;
|
|
1280
1333
|
}
|
|
1281
|
-
// Log structured error details and rethrow
|
|
1282
|
-
|
|
1283
|
-
operation
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1334
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1335
|
+
if (isConnectionError) {
|
|
1336
|
+
logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
|
|
1337
|
+
operation: 'updateManyMLTrainingData',
|
|
1338
|
+
model: 'MLTrainingData',
|
|
1339
|
+
error: String(error),
|
|
1340
|
+
isRetryable: true,
|
|
1341
|
+
transient: true,
|
|
1342
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1343
|
+
});
|
|
1344
|
+
}
|
|
1345
|
+
else {
|
|
1346
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
1347
|
+
operation: 'updateManyMLTrainingData',
|
|
1348
|
+
model: 'MLTrainingData',
|
|
1349
|
+
error: String(error),
|
|
1350
|
+
isRetryable: false,
|
|
1351
|
+
});
|
|
1352
|
+
}
|
|
1288
1353
|
throw error;
|
|
1289
1354
|
}
|
|
1290
1355
|
}
|
|
@@ -1407,14 +1472,27 @@ exports.MLTrainingData = {
|
|
|
1407
1472
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1408
1473
|
continue;
|
|
1409
1474
|
}
|
|
1410
|
-
// Log structured error details and rethrow
|
|
1411
|
-
|
|
1412
|
-
operation
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1475
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1476
|
+
if (isConnectionError) {
|
|
1477
|
+
logger_1.logger.warn("Database delete operation failed (transient after retries)", {
|
|
1478
|
+
operation: 'deleteOneMLTrainingData',
|
|
1479
|
+
model: 'MLTrainingData',
|
|
1480
|
+
error: String(error),
|
|
1481
|
+
recordId: props.id,
|
|
1482
|
+
isRetryable: true,
|
|
1483
|
+
transient: true,
|
|
1484
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1485
|
+
});
|
|
1486
|
+
}
|
|
1487
|
+
else {
|
|
1488
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
1489
|
+
operation: 'deleteOneMLTrainingData',
|
|
1490
|
+
model: 'MLTrainingData',
|
|
1491
|
+
error: String(error),
|
|
1492
|
+
recordId: props.id,
|
|
1493
|
+
isRetryable: false,
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1418
1496
|
throw error;
|
|
1419
1497
|
}
|
|
1420
1498
|
}
|
|
@@ -1516,13 +1594,25 @@ exports.MLTrainingData = {
|
|
|
1516
1594
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1517
1595
|
continue;
|
|
1518
1596
|
}
|
|
1519
|
-
// Log structured error details and rethrow
|
|
1520
|
-
|
|
1521
|
-
operation
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1597
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1598
|
+
if (isConnectionError) {
|
|
1599
|
+
logger_1.logger.warn("Database get operation failed (transient after retries)", {
|
|
1600
|
+
operation: 'getMLTrainingData',
|
|
1601
|
+
model: 'MLTrainingData',
|
|
1602
|
+
error: String(error),
|
|
1603
|
+
isRetryable: true,
|
|
1604
|
+
transient: true,
|
|
1605
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1606
|
+
});
|
|
1607
|
+
}
|
|
1608
|
+
else {
|
|
1609
|
+
logger_1.logger.error("Database get operation failed", {
|
|
1610
|
+
operation: 'getMLTrainingData',
|
|
1611
|
+
model: 'MLTrainingData',
|
|
1612
|
+
error: String(error),
|
|
1613
|
+
isRetryable: false,
|
|
1614
|
+
});
|
|
1615
|
+
}
|
|
1526
1616
|
throw error;
|
|
1527
1617
|
}
|
|
1528
1618
|
}
|
|
@@ -1609,13 +1699,25 @@ exports.MLTrainingData = {
|
|
|
1609
1699
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1610
1700
|
continue;
|
|
1611
1701
|
}
|
|
1612
|
-
// Log structured error details and rethrow
|
|
1613
|
-
|
|
1614
|
-
operation
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1702
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1703
|
+
if (isConnectionError) {
|
|
1704
|
+
logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
|
|
1705
|
+
operation: 'getAllMLTrainingData',
|
|
1706
|
+
model: 'MLTrainingData',
|
|
1707
|
+
error: String(error),
|
|
1708
|
+
isRetryable: true,
|
|
1709
|
+
transient: true,
|
|
1710
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1711
|
+
});
|
|
1712
|
+
}
|
|
1713
|
+
else {
|
|
1714
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
1715
|
+
operation: 'getAllMLTrainingData',
|
|
1716
|
+
model: 'MLTrainingData',
|
|
1717
|
+
error: String(error),
|
|
1718
|
+
isRetryable: false,
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1619
1721
|
throw error;
|
|
1620
1722
|
}
|
|
1621
1723
|
}
|
|
@@ -1729,13 +1831,25 @@ exports.MLTrainingData = {
|
|
|
1729
1831
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1730
1832
|
continue;
|
|
1731
1833
|
}
|
|
1732
|
-
// Log structured error details and rethrow
|
|
1733
|
-
|
|
1734
|
-
operation
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1834
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1835
|
+
if (isConnectionError) {
|
|
1836
|
+
logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
|
|
1837
|
+
operation: 'findManyMLTrainingData',
|
|
1838
|
+
model: 'MLTrainingData',
|
|
1839
|
+
error: String(error),
|
|
1840
|
+
isRetryable: true,
|
|
1841
|
+
transient: true,
|
|
1842
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1843
|
+
});
|
|
1844
|
+
}
|
|
1845
|
+
else {
|
|
1846
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
1847
|
+
operation: 'findManyMLTrainingData',
|
|
1848
|
+
model: 'MLTrainingData',
|
|
1849
|
+
error: String(error),
|
|
1850
|
+
isRetryable: false,
|
|
1851
|
+
});
|
|
1852
|
+
}
|
|
1739
1853
|
throw error;
|
|
1740
1854
|
}
|
|
1741
1855
|
}
|
package/MarketSentiment.cjs
CHANGED
|
@@ -138,13 +138,28 @@ exports.MarketSentiment = {
|
|
|
138
138
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
139
139
|
continue;
|
|
140
140
|
}
|
|
141
|
-
// Log structured error details and rethrow
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
// Log structured error details and rethrow.
|
|
142
|
+
// Demote transient failures to WARN with explicit transient+recoveryHint
|
|
143
|
+
// metadata so log analytics can distinguish recoverable upstream retries
|
|
144
|
+
// from true defects.
|
|
145
|
+
if (isConnectionError) {
|
|
146
|
+
logger_1.logger.warn("Database create operation failed (transient after retries)", {
|
|
147
|
+
operation: 'createOneMarketSentiment',
|
|
148
|
+
model: 'MarketSentiment',
|
|
149
|
+
error: String(error),
|
|
150
|
+
isRetryable: true,
|
|
151
|
+
transient: true,
|
|
152
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
logger_1.logger.error("Database create operation failed", {
|
|
157
|
+
operation: 'createOneMarketSentiment',
|
|
158
|
+
model: 'MarketSentiment',
|
|
159
|
+
error: String(error),
|
|
160
|
+
isRetryable: false,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
148
163
|
throw error;
|
|
149
164
|
}
|
|
150
165
|
}
|
|
@@ -265,13 +280,25 @@ exports.MarketSentiment = {
|
|
|
265
280
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
266
281
|
continue;
|
|
267
282
|
}
|
|
268
|
-
// Log structured error details and rethrow
|
|
269
|
-
|
|
270
|
-
operation
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
283
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
284
|
+
if (isConnectionError) {
|
|
285
|
+
logger_1.logger.warn("Database createMany operation failed (transient after retries)", {
|
|
286
|
+
operation: 'createManyMarketSentiment',
|
|
287
|
+
model: 'MarketSentiment',
|
|
288
|
+
error: String(error),
|
|
289
|
+
isRetryable: true,
|
|
290
|
+
transient: true,
|
|
291
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
292
|
+
});
|
|
293
|
+
}
|
|
294
|
+
else {
|
|
295
|
+
logger_1.logger.error("Database createMany operation failed", {
|
|
296
|
+
operation: 'createManyMarketSentiment',
|
|
297
|
+
model: 'MarketSentiment',
|
|
298
|
+
error: String(error),
|
|
299
|
+
isRetryable: false,
|
|
300
|
+
});
|
|
301
|
+
}
|
|
275
302
|
throw error;
|
|
276
303
|
}
|
|
277
304
|
}
|
|
@@ -411,14 +438,27 @@ exports.MarketSentiment = {
|
|
|
411
438
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
412
439
|
continue;
|
|
413
440
|
}
|
|
414
|
-
// Log structured error details and rethrow
|
|
415
|
-
|
|
416
|
-
operation
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
441
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
442
|
+
if (isConnectionError) {
|
|
443
|
+
logger_1.logger.warn("Database update operation failed (transient after retries)", {
|
|
444
|
+
operation: 'updateOneMarketSentiment',
|
|
445
|
+
model: 'MarketSentiment',
|
|
446
|
+
error: String(error),
|
|
447
|
+
recordId: props.id,
|
|
448
|
+
isRetryable: true,
|
|
449
|
+
transient: true,
|
|
450
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
logger_1.logger.error("Database update operation failed", {
|
|
455
|
+
operation: 'updateOneMarketSentiment',
|
|
456
|
+
model: 'MarketSentiment',
|
|
457
|
+
error: String(error),
|
|
458
|
+
recordId: props.id,
|
|
459
|
+
isRetryable: false,
|
|
460
|
+
});
|
|
461
|
+
}
|
|
422
462
|
throw error;
|
|
423
463
|
}
|
|
424
464
|
}
|
|
@@ -554,14 +594,27 @@ exports.MarketSentiment = {
|
|
|
554
594
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
555
595
|
continue;
|
|
556
596
|
}
|
|
557
|
-
// Log structured error details and rethrow
|
|
558
|
-
|
|
559
|
-
operation
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
597
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
598
|
+
if (isConnectionError) {
|
|
599
|
+
logger_1.logger.warn("Database upsert operation failed (transient after retries)", {
|
|
600
|
+
operation: 'upsertOneMarketSentiment',
|
|
601
|
+
model: 'MarketSentiment',
|
|
602
|
+
error: String(error),
|
|
603
|
+
recordId: props.id,
|
|
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 upsert operation failed", {
|
|
611
|
+
operation: 'upsertOneMarketSentiment',
|
|
612
|
+
model: 'MarketSentiment',
|
|
613
|
+
error: String(error),
|
|
614
|
+
recordId: props.id,
|
|
615
|
+
isRetryable: false,
|
|
616
|
+
});
|
|
617
|
+
}
|
|
565
618
|
throw error;
|
|
566
619
|
}
|
|
567
620
|
}
|
|
@@ -699,13 +752,25 @@ exports.MarketSentiment = {
|
|
|
699
752
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
700
753
|
continue;
|
|
701
754
|
}
|
|
702
|
-
// Log structured error details and rethrow
|
|
703
|
-
|
|
704
|
-
operation
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
755
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
756
|
+
if (isConnectionError) {
|
|
757
|
+
logger_1.logger.warn("Database updateMany operation failed (transient after retries)", {
|
|
758
|
+
operation: 'updateManyMarketSentiment',
|
|
759
|
+
model: 'MarketSentiment',
|
|
760
|
+
error: String(error),
|
|
761
|
+
isRetryable: true,
|
|
762
|
+
transient: true,
|
|
763
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
764
|
+
});
|
|
765
|
+
}
|
|
766
|
+
else {
|
|
767
|
+
logger_1.logger.error("Database updateMany operation failed", {
|
|
768
|
+
operation: 'updateManyMarketSentiment',
|
|
769
|
+
model: 'MarketSentiment',
|
|
770
|
+
error: String(error),
|
|
771
|
+
isRetryable: false,
|
|
772
|
+
});
|
|
773
|
+
}
|
|
709
774
|
throw error;
|
|
710
775
|
}
|
|
711
776
|
}
|
|
@@ -828,14 +893,27 @@ exports.MarketSentiment = {
|
|
|
828
893
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
829
894
|
continue;
|
|
830
895
|
}
|
|
831
|
-
// Log structured error details and rethrow
|
|
832
|
-
|
|
833
|
-
operation
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
896
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
897
|
+
if (isConnectionError) {
|
|
898
|
+
logger_1.logger.warn("Database delete operation failed (transient after retries)", {
|
|
899
|
+
operation: 'deleteOneMarketSentiment',
|
|
900
|
+
model: 'MarketSentiment',
|
|
901
|
+
error: String(error),
|
|
902
|
+
recordId: props.id,
|
|
903
|
+
isRetryable: true,
|
|
904
|
+
transient: true,
|
|
905
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
else {
|
|
909
|
+
logger_1.logger.error("Database delete operation failed", {
|
|
910
|
+
operation: 'deleteOneMarketSentiment',
|
|
911
|
+
model: 'MarketSentiment',
|
|
912
|
+
error: String(error),
|
|
913
|
+
recordId: props.id,
|
|
914
|
+
isRetryable: false,
|
|
915
|
+
});
|
|
916
|
+
}
|
|
839
917
|
throw error;
|
|
840
918
|
}
|
|
841
919
|
}
|
|
@@ -931,13 +1009,25 @@ exports.MarketSentiment = {
|
|
|
931
1009
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
932
1010
|
continue;
|
|
933
1011
|
}
|
|
934
|
-
// Log structured error details and rethrow
|
|
935
|
-
|
|
936
|
-
operation
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
1012
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1013
|
+
if (isConnectionError) {
|
|
1014
|
+
logger_1.logger.warn("Database get operation failed (transient after retries)", {
|
|
1015
|
+
operation: 'getMarketSentiment',
|
|
1016
|
+
model: 'MarketSentiment',
|
|
1017
|
+
error: String(error),
|
|
1018
|
+
isRetryable: true,
|
|
1019
|
+
transient: true,
|
|
1020
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1021
|
+
});
|
|
1022
|
+
}
|
|
1023
|
+
else {
|
|
1024
|
+
logger_1.logger.error("Database get operation failed", {
|
|
1025
|
+
operation: 'getMarketSentiment',
|
|
1026
|
+
model: 'MarketSentiment',
|
|
1027
|
+
error: String(error),
|
|
1028
|
+
isRetryable: false,
|
|
1029
|
+
});
|
|
1030
|
+
}
|
|
941
1031
|
throw error;
|
|
942
1032
|
}
|
|
943
1033
|
}
|
|
@@ -1024,13 +1114,25 @@ exports.MarketSentiment = {
|
|
|
1024
1114
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1025
1115
|
continue;
|
|
1026
1116
|
}
|
|
1027
|
-
// Log structured error details and rethrow
|
|
1028
|
-
|
|
1029
|
-
operation
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1117
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1118
|
+
if (isConnectionError) {
|
|
1119
|
+
logger_1.logger.warn("Database getAll operation failed (transient after retries)", {
|
|
1120
|
+
operation: 'getAllMarketSentiment',
|
|
1121
|
+
model: 'MarketSentiment',
|
|
1122
|
+
error: String(error),
|
|
1123
|
+
isRetryable: true,
|
|
1124
|
+
transient: true,
|
|
1125
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
else {
|
|
1129
|
+
logger_1.logger.error("Database getAll operation failed", {
|
|
1130
|
+
operation: 'getAllMarketSentiment',
|
|
1131
|
+
model: 'MarketSentiment',
|
|
1132
|
+
error: String(error),
|
|
1133
|
+
isRetryable: false,
|
|
1134
|
+
});
|
|
1135
|
+
}
|
|
1034
1136
|
throw error;
|
|
1035
1137
|
}
|
|
1036
1138
|
}
|
|
@@ -1138,13 +1240,25 @@ exports.MarketSentiment = {
|
|
|
1138
1240
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1139
1241
|
continue;
|
|
1140
1242
|
}
|
|
1141
|
-
// Log structured error details and rethrow
|
|
1142
|
-
|
|
1143
|
-
operation
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1243
|
+
// Log structured error details and rethrow (transient -> WARN).
|
|
1244
|
+
if (isConnectionError) {
|
|
1245
|
+
logger_1.logger.warn("Database findMany operation failed (transient after retries)", {
|
|
1246
|
+
operation: 'findManyMarketSentiment',
|
|
1247
|
+
model: 'MarketSentiment',
|
|
1248
|
+
error: String(error),
|
|
1249
|
+
isRetryable: true,
|
|
1250
|
+
transient: true,
|
|
1251
|
+
recoveryHint: "Upstream caller should retry on next cycle",
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
else {
|
|
1255
|
+
logger_1.logger.error("Database findMany operation failed", {
|
|
1256
|
+
operation: 'findManyMarketSentiment',
|
|
1257
|
+
model: 'MarketSentiment',
|
|
1258
|
+
error: String(error),
|
|
1259
|
+
isRetryable: false,
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1148
1262
|
throw error;
|
|
1149
1263
|
}
|
|
1150
1264
|
}
|