@adaptic/backend-legacy 0.0.903 → 0.0.905
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 +291 -63
- package/Account.cjs +291 -63
- package/AccountLinkingRequest.cjs +291 -63
- package/Action.cjs +291 -63
- package/Alert.cjs +291 -63
- package/Allocation.cjs +291 -63
- package/AlpacaAccount.cjs +291 -63
- package/AnalyticsConfiguration.cjs +291 -63
- package/AnalyticsSnapshot.cjs +291 -63
- package/Asset.cjs +291 -63
- package/AuditLog.cjs +291 -63
- package/Authenticator.cjs +291 -63
- package/Configuration.cjs +291 -63
- package/ConflictEvent.cjs +291 -63
- package/ConnectionHealthSnapshot.cjs +291 -63
- package/Customer.cjs +291 -63
- package/DeadLetterMessage.cjs +291 -63
- package/EconomicEvent.cjs +291 -63
- package/Event.cjs +291 -63
- package/EventSnapshot.cjs +291 -63
- package/FeatureImportanceAnalysis.cjs +291 -63
- package/InstitutionalFlowSignal.cjs +291 -63
- package/InstitutionalHolding.cjs +291 -63
- package/InstitutionalSentimentAlerts.cjs +291 -63
- package/InstitutionalSentimentErrors.cjs +291 -63
- package/InstitutionalSentimentHistory.cjs +291 -63
- package/InstitutionalSentimentMetrics.cjs +291 -63
- package/InviteToken.cjs +291 -63
- package/LinkedProvider.cjs +291 -63
- package/MLTrainingData.cjs +291 -63
- package/MarketSentiment.cjs +291 -63
- package/ModelArtifact.cjs +291 -63
- package/ModelVersion.cjs +291 -63
- package/ModelVersionArtifact.cjs +291 -63
- package/NewsArticle.cjs +291 -63
- package/NewsArticleAssetSentiment.cjs +291 -63
- package/OptionsContract.cjs +291 -63
- package/OptionsGreeksHistory.cjs +291 -63
- package/OptionsPosition.cjs +291 -63
- package/OptionsTradeExecution.cjs +291 -63
- package/PortfolioGreeksHistory.cjs +291 -63
- package/ScheduledOptionOrder.cjs +291 -63
- package/Session.cjs +291 -63
- package/SignalGeneratorMetrics.cjs +291 -63
- package/SignalLineage.cjs +291 -63
- package/SignalOutcome.cjs +291 -63
- package/SignalPriorityQueue.cjs +291 -63
- package/SyncEvent.cjs +291 -63
- package/SystemAlert.cjs +291 -63
- package/Trade.cjs +291 -63
- package/TradeAuditEvent.cjs +291 -63
- package/TradeExecutionHistory.cjs +291 -63
- package/User.cjs +291 -63
- package/VerificationToken.cjs +291 -63
- package/WaitlistEntry.cjs +291 -63
- package/esm/ABTest.d.ts.map +1 -1
- package/esm/ABTest.js.map +1 -1
- package/esm/ABTest.mjs +255 -27
- package/esm/Account.d.ts.map +1 -1
- package/esm/Account.js.map +1 -1
- package/esm/Account.mjs +255 -27
- package/esm/AccountLinkingRequest.d.ts.map +1 -1
- package/esm/AccountLinkingRequest.js.map +1 -1
- package/esm/AccountLinkingRequest.mjs +255 -27
- package/esm/Action.d.ts.map +1 -1
- package/esm/Action.js.map +1 -1
- package/esm/Action.mjs +255 -27
- package/esm/Alert.d.ts.map +1 -1
- package/esm/Alert.js.map +1 -1
- package/esm/Alert.mjs +255 -27
- package/esm/Allocation.d.ts.map +1 -1
- package/esm/Allocation.js.map +1 -1
- package/esm/Allocation.mjs +255 -27
- package/esm/AlpacaAccount.d.ts.map +1 -1
- package/esm/AlpacaAccount.js.map +1 -1
- package/esm/AlpacaAccount.mjs +255 -27
- package/esm/AnalyticsConfiguration.d.ts.map +1 -1
- package/esm/AnalyticsConfiguration.js.map +1 -1
- package/esm/AnalyticsConfiguration.mjs +255 -27
- package/esm/AnalyticsSnapshot.d.ts.map +1 -1
- package/esm/AnalyticsSnapshot.js.map +1 -1
- package/esm/AnalyticsSnapshot.mjs +255 -27
- package/esm/Asset.d.ts.map +1 -1
- package/esm/Asset.js.map +1 -1
- package/esm/Asset.mjs +255 -27
- package/esm/AuditLog.d.ts.map +1 -1
- package/esm/AuditLog.js.map +1 -1
- package/esm/AuditLog.mjs +255 -27
- package/esm/Authenticator.d.ts.map +1 -1
- package/esm/Authenticator.js.map +1 -1
- package/esm/Authenticator.mjs +255 -27
- package/esm/Configuration.d.ts.map +1 -1
- package/esm/Configuration.js.map +1 -1
- package/esm/Configuration.mjs +255 -27
- package/esm/ConflictEvent.d.ts.map +1 -1
- package/esm/ConflictEvent.js.map +1 -1
- package/esm/ConflictEvent.mjs +255 -27
- package/esm/ConnectionHealthSnapshot.d.ts.map +1 -1
- package/esm/ConnectionHealthSnapshot.js.map +1 -1
- package/esm/ConnectionHealthSnapshot.mjs +255 -27
- package/esm/Customer.d.ts.map +1 -1
- package/esm/Customer.js.map +1 -1
- package/esm/Customer.mjs +255 -27
- package/esm/DeadLetterMessage.d.ts.map +1 -1
- package/esm/DeadLetterMessage.js.map +1 -1
- package/esm/DeadLetterMessage.mjs +255 -27
- package/esm/EconomicEvent.d.ts.map +1 -1
- package/esm/EconomicEvent.js.map +1 -1
- package/esm/EconomicEvent.mjs +255 -27
- package/esm/Event.d.ts.map +1 -1
- package/esm/Event.js.map +1 -1
- package/esm/Event.mjs +255 -27
- package/esm/EventSnapshot.d.ts.map +1 -1
- package/esm/EventSnapshot.js.map +1 -1
- package/esm/EventSnapshot.mjs +255 -27
- package/esm/FeatureImportanceAnalysis.d.ts.map +1 -1
- package/esm/FeatureImportanceAnalysis.js.map +1 -1
- package/esm/FeatureImportanceAnalysis.mjs +255 -27
- package/esm/InstitutionalFlowSignal.d.ts.map +1 -1
- package/esm/InstitutionalFlowSignal.js.map +1 -1
- package/esm/InstitutionalFlowSignal.mjs +255 -27
- package/esm/InstitutionalHolding.d.ts.map +1 -1
- package/esm/InstitutionalHolding.js.map +1 -1
- package/esm/InstitutionalHolding.mjs +255 -27
- package/esm/InstitutionalSentimentAlerts.d.ts.map +1 -1
- package/esm/InstitutionalSentimentAlerts.js.map +1 -1
- package/esm/InstitutionalSentimentAlerts.mjs +255 -27
- package/esm/InstitutionalSentimentErrors.d.ts.map +1 -1
- package/esm/InstitutionalSentimentErrors.js.map +1 -1
- package/esm/InstitutionalSentimentErrors.mjs +255 -27
- package/esm/InstitutionalSentimentHistory.d.ts.map +1 -1
- package/esm/InstitutionalSentimentHistory.js.map +1 -1
- package/esm/InstitutionalSentimentHistory.mjs +255 -27
- package/esm/InstitutionalSentimentMetrics.d.ts.map +1 -1
- package/esm/InstitutionalSentimentMetrics.js.map +1 -1
- package/esm/InstitutionalSentimentMetrics.mjs +255 -27
- package/esm/InviteToken.d.ts.map +1 -1
- package/esm/InviteToken.js.map +1 -1
- package/esm/InviteToken.mjs +255 -27
- package/esm/LinkedProvider.d.ts.map +1 -1
- package/esm/LinkedProvider.js.map +1 -1
- package/esm/LinkedProvider.mjs +255 -27
- package/esm/MLTrainingData.d.ts.map +1 -1
- package/esm/MLTrainingData.js.map +1 -1
- package/esm/MLTrainingData.mjs +255 -27
- package/esm/MarketSentiment.d.ts.map +1 -1
- package/esm/MarketSentiment.js.map +1 -1
- package/esm/MarketSentiment.mjs +255 -27
- package/esm/ModelArtifact.d.ts.map +1 -1
- package/esm/ModelArtifact.js.map +1 -1
- package/esm/ModelArtifact.mjs +255 -27
- package/esm/ModelVersion.d.ts.map +1 -1
- package/esm/ModelVersion.js.map +1 -1
- package/esm/ModelVersion.mjs +255 -27
- package/esm/ModelVersionArtifact.d.ts.map +1 -1
- package/esm/ModelVersionArtifact.js.map +1 -1
- package/esm/ModelVersionArtifact.mjs +255 -27
- package/esm/NewsArticle.d.ts.map +1 -1
- package/esm/NewsArticle.js.map +1 -1
- package/esm/NewsArticle.mjs +255 -27
- package/esm/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/esm/NewsArticleAssetSentiment.js.map +1 -1
- package/esm/NewsArticleAssetSentiment.mjs +255 -27
- package/esm/OptionsContract.d.ts.map +1 -1
- package/esm/OptionsContract.js.map +1 -1
- package/esm/OptionsContract.mjs +255 -27
- package/esm/OptionsGreeksHistory.d.ts.map +1 -1
- package/esm/OptionsGreeksHistory.js.map +1 -1
- package/esm/OptionsGreeksHistory.mjs +255 -27
- package/esm/OptionsPosition.d.ts.map +1 -1
- package/esm/OptionsPosition.js.map +1 -1
- package/esm/OptionsPosition.mjs +255 -27
- package/esm/OptionsTradeExecution.d.ts.map +1 -1
- package/esm/OptionsTradeExecution.js.map +1 -1
- package/esm/OptionsTradeExecution.mjs +255 -27
- package/esm/PortfolioGreeksHistory.d.ts.map +1 -1
- package/esm/PortfolioGreeksHistory.js.map +1 -1
- package/esm/PortfolioGreeksHistory.mjs +255 -27
- package/esm/ScheduledOptionOrder.d.ts.map +1 -1
- package/esm/ScheduledOptionOrder.js.map +1 -1
- package/esm/ScheduledOptionOrder.mjs +255 -27
- package/esm/Session.d.ts.map +1 -1
- package/esm/Session.js.map +1 -1
- package/esm/Session.mjs +255 -27
- package/esm/SignalGeneratorMetrics.d.ts.map +1 -1
- package/esm/SignalGeneratorMetrics.js.map +1 -1
- package/esm/SignalGeneratorMetrics.mjs +255 -27
- package/esm/SignalLineage.d.ts.map +1 -1
- package/esm/SignalLineage.js.map +1 -1
- package/esm/SignalLineage.mjs +255 -27
- package/esm/SignalOutcome.d.ts.map +1 -1
- package/esm/SignalOutcome.js.map +1 -1
- package/esm/SignalOutcome.mjs +255 -27
- package/esm/SignalPriorityQueue.d.ts.map +1 -1
- package/esm/SignalPriorityQueue.js.map +1 -1
- package/esm/SignalPriorityQueue.mjs +255 -27
- package/esm/SyncEvent.d.ts.map +1 -1
- package/esm/SyncEvent.js.map +1 -1
- package/esm/SyncEvent.mjs +255 -27
- package/esm/SystemAlert.d.ts.map +1 -1
- package/esm/SystemAlert.js.map +1 -1
- package/esm/SystemAlert.mjs +255 -27
- package/esm/Trade.d.ts.map +1 -1
- package/esm/Trade.js.map +1 -1
- package/esm/Trade.mjs +255 -27
- package/esm/TradeAuditEvent.d.ts.map +1 -1
- package/esm/TradeAuditEvent.js.map +1 -1
- package/esm/TradeAuditEvent.mjs +255 -27
- package/esm/TradeExecutionHistory.d.ts.map +1 -1
- package/esm/TradeExecutionHistory.js.map +1 -1
- package/esm/TradeExecutionHistory.mjs +255 -27
- package/esm/User.d.ts.map +1 -1
- package/esm/User.js.map +1 -1
- package/esm/User.mjs +255 -27
- package/esm/VerificationToken.d.ts.map +1 -1
- package/esm/VerificationToken.js.map +1 -1
- package/esm/VerificationToken.mjs +255 -27
- package/esm/WaitlistEntry.d.ts.map +1 -1
- package/esm/WaitlistEntry.js.map +1 -1
- package/esm/WaitlistEntry.mjs +255 -27
- package/esm/middleware/audit-logger.d.ts +0 -7
- package/esm/middleware/audit-logger.d.ts.map +1 -1
- package/esm/middleware/audit-logger.js.map +1 -1
- package/esm/middleware/audit-logger.mjs +5 -3
- package/esm/prismaClient.d.ts.map +1 -1
- package/esm/prismaClient.js.map +1 -1
- package/esm/prismaClient.mjs +38 -9
- package/package.json +1 -1
- package/prismaClient.cjs +38 -9
|
@@ -988,6 +988,27 @@ export const FeatureImportanceAnalysis = {
|
|
|
988
988
|
}
|
|
989
989
|
catch (error) {
|
|
990
990
|
lastError = error;
|
|
991
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
992
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
993
|
+
error.message?.includes('violates unique constraint') ||
|
|
994
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
995
|
+
error.message?.includes('unique constraint') ||
|
|
996
|
+
error.message?.includes('23514') ||
|
|
997
|
+
error.message?.includes('23505') ||
|
|
998
|
+
error.message?.includes('P2002') ||
|
|
999
|
+
error.message?.includes('P2003');
|
|
1000
|
+
if (isConstraintViolation) {
|
|
1001
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
1002
|
+
logger.error("Non-retryable constraint violation in createOneFeatureImportanceAnalysis", {
|
|
1003
|
+
operation: 'createOneFeatureImportanceAnalysis',
|
|
1004
|
+
model: 'FeatureImportanceAnalysis',
|
|
1005
|
+
error: String(error),
|
|
1006
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1007
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1008
|
+
isRetryable: false,
|
|
1009
|
+
});
|
|
1010
|
+
throw error;
|
|
1011
|
+
}
|
|
991
1012
|
// Check if this is a database connection error that we should retry
|
|
992
1013
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
993
1014
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -997,12 +1018,22 @@ export const FeatureImportanceAnalysis = {
|
|
|
997
1018
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
998
1019
|
retryCount++;
|
|
999
1020
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1000
|
-
logger.warn("Database connection error, retrying..."
|
|
1021
|
+
logger.warn("Database connection error in createOneFeatureImportanceAnalysis, retrying...", {
|
|
1022
|
+
operation: 'createOneFeatureImportanceAnalysis',
|
|
1023
|
+
model: 'FeatureImportanceAnalysis',
|
|
1024
|
+
attempt: retryCount,
|
|
1025
|
+
maxRetries: MAX_RETRIES,
|
|
1026
|
+
});
|
|
1001
1027
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1002
1028
|
continue;
|
|
1003
1029
|
}
|
|
1004
|
-
// Log
|
|
1005
|
-
logger.error("Database
|
|
1030
|
+
// Log structured error details and rethrow
|
|
1031
|
+
logger.error("Database create operation failed", {
|
|
1032
|
+
operation: 'createOneFeatureImportanceAnalysis',
|
|
1033
|
+
model: 'FeatureImportanceAnalysis',
|
|
1034
|
+
error: String(error),
|
|
1035
|
+
isRetryable: isConnectionError,
|
|
1036
|
+
});
|
|
1006
1037
|
throw error;
|
|
1007
1038
|
}
|
|
1008
1039
|
}
|
|
@@ -1074,6 +1105,27 @@ export const FeatureImportanceAnalysis = {
|
|
|
1074
1105
|
}
|
|
1075
1106
|
catch (error) {
|
|
1076
1107
|
lastError = error;
|
|
1108
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1109
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
1110
|
+
error.message?.includes('violates unique constraint') ||
|
|
1111
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
1112
|
+
error.message?.includes('unique constraint') ||
|
|
1113
|
+
error.message?.includes('23514') ||
|
|
1114
|
+
error.message?.includes('23505') ||
|
|
1115
|
+
error.message?.includes('P2002') ||
|
|
1116
|
+
error.message?.includes('P2003');
|
|
1117
|
+
if (isConstraintViolation) {
|
|
1118
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
1119
|
+
logger.error("Non-retryable constraint violation in createManyFeatureImportanceAnalysis", {
|
|
1120
|
+
operation: 'createManyFeatureImportanceAnalysis',
|
|
1121
|
+
model: 'FeatureImportanceAnalysis',
|
|
1122
|
+
error: String(error),
|
|
1123
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1124
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1125
|
+
isRetryable: false,
|
|
1126
|
+
});
|
|
1127
|
+
throw error;
|
|
1128
|
+
}
|
|
1077
1129
|
// Check if this is a database connection error that we should retry
|
|
1078
1130
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
1079
1131
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -1083,12 +1135,22 @@ export const FeatureImportanceAnalysis = {
|
|
|
1083
1135
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1084
1136
|
retryCount++;
|
|
1085
1137
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1086
|
-
logger.warn("Database connection error, retrying..."
|
|
1138
|
+
logger.warn("Database connection error in createManyFeatureImportanceAnalysis, retrying...", {
|
|
1139
|
+
operation: 'createManyFeatureImportanceAnalysis',
|
|
1140
|
+
model: 'FeatureImportanceAnalysis',
|
|
1141
|
+
attempt: retryCount,
|
|
1142
|
+
maxRetries: MAX_RETRIES,
|
|
1143
|
+
});
|
|
1087
1144
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1088
1145
|
continue;
|
|
1089
1146
|
}
|
|
1090
|
-
// Log
|
|
1091
|
-
logger.error("Database
|
|
1147
|
+
// Log structured error details and rethrow
|
|
1148
|
+
logger.error("Database createMany operation failed", {
|
|
1149
|
+
operation: 'createManyFeatureImportanceAnalysis',
|
|
1150
|
+
model: 'FeatureImportanceAnalysis',
|
|
1151
|
+
error: String(error),
|
|
1152
|
+
isRetryable: isConnectionError,
|
|
1153
|
+
});
|
|
1092
1154
|
throw error;
|
|
1093
1155
|
}
|
|
1094
1156
|
}
|
|
@@ -4524,6 +4586,28 @@ export const FeatureImportanceAnalysis = {
|
|
|
4524
4586
|
}
|
|
4525
4587
|
catch (error) {
|
|
4526
4588
|
lastError = error;
|
|
4589
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
4590
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
4591
|
+
error.message?.includes('violates unique constraint') ||
|
|
4592
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
4593
|
+
error.message?.includes('unique constraint') ||
|
|
4594
|
+
error.message?.includes('23514') ||
|
|
4595
|
+
error.message?.includes('23505') ||
|
|
4596
|
+
error.message?.includes('P2002') ||
|
|
4597
|
+
error.message?.includes('P2003');
|
|
4598
|
+
if (isConstraintViolation) {
|
|
4599
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
4600
|
+
logger.error("Non-retryable constraint violation in updateOneFeatureImportanceAnalysis", {
|
|
4601
|
+
operation: 'updateOneFeatureImportanceAnalysis',
|
|
4602
|
+
model: 'FeatureImportanceAnalysis',
|
|
4603
|
+
error: String(error),
|
|
4604
|
+
recordId: props.id,
|
|
4605
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
4606
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
4607
|
+
isRetryable: false,
|
|
4608
|
+
});
|
|
4609
|
+
throw error;
|
|
4610
|
+
}
|
|
4527
4611
|
// Check if this is a database connection error that we should retry
|
|
4528
4612
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
4529
4613
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -4533,12 +4617,24 @@ export const FeatureImportanceAnalysis = {
|
|
|
4533
4617
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4534
4618
|
retryCount++;
|
|
4535
4619
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4536
|
-
logger.warn("Database connection error, retrying..."
|
|
4620
|
+
logger.warn("Database connection error in updateOneFeatureImportanceAnalysis, retrying...", {
|
|
4621
|
+
operation: 'updateOneFeatureImportanceAnalysis',
|
|
4622
|
+
model: 'FeatureImportanceAnalysis',
|
|
4623
|
+
attempt: retryCount,
|
|
4624
|
+
maxRetries: MAX_RETRIES,
|
|
4625
|
+
recordId: props.id,
|
|
4626
|
+
});
|
|
4537
4627
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4538
4628
|
continue;
|
|
4539
4629
|
}
|
|
4540
|
-
// Log
|
|
4541
|
-
logger.error("Database
|
|
4630
|
+
// Log structured error details and rethrow
|
|
4631
|
+
logger.error("Database update operation failed", {
|
|
4632
|
+
operation: 'updateOneFeatureImportanceAnalysis',
|
|
4633
|
+
model: 'FeatureImportanceAnalysis',
|
|
4634
|
+
error: String(error),
|
|
4635
|
+
recordId: props.id,
|
|
4636
|
+
isRetryable: isConnectionError,
|
|
4637
|
+
});
|
|
4542
4638
|
throw error;
|
|
4543
4639
|
}
|
|
4544
4640
|
}
|
|
@@ -8733,6 +8829,28 @@ export const FeatureImportanceAnalysis = {
|
|
|
8733
8829
|
}
|
|
8734
8830
|
catch (error) {
|
|
8735
8831
|
lastError = error;
|
|
8832
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
8833
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
8834
|
+
error.message?.includes('violates unique constraint') ||
|
|
8835
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
8836
|
+
error.message?.includes('unique constraint') ||
|
|
8837
|
+
error.message?.includes('23514') ||
|
|
8838
|
+
error.message?.includes('23505') ||
|
|
8839
|
+
error.message?.includes('P2002') ||
|
|
8840
|
+
error.message?.includes('P2003');
|
|
8841
|
+
if (isConstraintViolation) {
|
|
8842
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
8843
|
+
logger.error("Non-retryable constraint violation in upsertOneFeatureImportanceAnalysis", {
|
|
8844
|
+
operation: 'upsertOneFeatureImportanceAnalysis',
|
|
8845
|
+
model: 'FeatureImportanceAnalysis',
|
|
8846
|
+
error: String(error),
|
|
8847
|
+
recordId: props.id,
|
|
8848
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
8849
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
8850
|
+
isRetryable: false,
|
|
8851
|
+
});
|
|
8852
|
+
throw error;
|
|
8853
|
+
}
|
|
8736
8854
|
// Check if this is a database connection error that we should retry
|
|
8737
8855
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
8738
8856
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -8742,12 +8860,24 @@ export const FeatureImportanceAnalysis = {
|
|
|
8742
8860
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
8743
8861
|
retryCount++;
|
|
8744
8862
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
8745
|
-
logger.warn("Database connection error, retrying..."
|
|
8863
|
+
logger.warn("Database connection error in upsertOneFeatureImportanceAnalysis, retrying...", {
|
|
8864
|
+
operation: 'upsertOneFeatureImportanceAnalysis',
|
|
8865
|
+
model: 'FeatureImportanceAnalysis',
|
|
8866
|
+
attempt: retryCount,
|
|
8867
|
+
maxRetries: MAX_RETRIES,
|
|
8868
|
+
recordId: props.id,
|
|
8869
|
+
});
|
|
8746
8870
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
8747
8871
|
continue;
|
|
8748
8872
|
}
|
|
8749
|
-
// Log
|
|
8750
|
-
logger.error("Database
|
|
8873
|
+
// Log structured error details and rethrow
|
|
8874
|
+
logger.error("Database upsert operation failed", {
|
|
8875
|
+
operation: 'upsertOneFeatureImportanceAnalysis',
|
|
8876
|
+
model: 'FeatureImportanceAnalysis',
|
|
8877
|
+
error: String(error),
|
|
8878
|
+
recordId: props.id,
|
|
8879
|
+
isRetryable: isConnectionError,
|
|
8880
|
+
});
|
|
8751
8881
|
throw error;
|
|
8752
8882
|
}
|
|
8753
8883
|
}
|
|
@@ -12183,6 +12313,27 @@ export const FeatureImportanceAnalysis = {
|
|
|
12183
12313
|
}
|
|
12184
12314
|
catch (error) {
|
|
12185
12315
|
lastError = error;
|
|
12316
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
12317
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
12318
|
+
error.message?.includes('violates unique constraint') ||
|
|
12319
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
12320
|
+
error.message?.includes('unique constraint') ||
|
|
12321
|
+
error.message?.includes('23514') ||
|
|
12322
|
+
error.message?.includes('23505') ||
|
|
12323
|
+
error.message?.includes('P2002') ||
|
|
12324
|
+
error.message?.includes('P2003');
|
|
12325
|
+
if (isConstraintViolation) {
|
|
12326
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
12327
|
+
logger.error("Non-retryable constraint violation in updateManyFeatureImportanceAnalysis", {
|
|
12328
|
+
operation: 'updateManyFeatureImportanceAnalysis',
|
|
12329
|
+
model: 'FeatureImportanceAnalysis',
|
|
12330
|
+
error: String(error),
|
|
12331
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
12332
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
12333
|
+
isRetryable: false,
|
|
12334
|
+
});
|
|
12335
|
+
throw error;
|
|
12336
|
+
}
|
|
12186
12337
|
// Check if this is a database connection error that we should retry
|
|
12187
12338
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
12188
12339
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -12192,12 +12343,22 @@ export const FeatureImportanceAnalysis = {
|
|
|
12192
12343
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12193
12344
|
retryCount++;
|
|
12194
12345
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12195
|
-
logger.warn("Database connection error, retrying..."
|
|
12346
|
+
logger.warn("Database connection error in updateManyFeatureImportanceAnalysis, retrying...", {
|
|
12347
|
+
operation: 'updateManyFeatureImportanceAnalysis',
|
|
12348
|
+
model: 'FeatureImportanceAnalysis',
|
|
12349
|
+
attempt: retryCount,
|
|
12350
|
+
maxRetries: MAX_RETRIES,
|
|
12351
|
+
});
|
|
12196
12352
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12197
12353
|
continue;
|
|
12198
12354
|
}
|
|
12199
|
-
// Log
|
|
12200
|
-
logger.error("Database
|
|
12355
|
+
// Log structured error details and rethrow
|
|
12356
|
+
logger.error("Database updateMany operation failed", {
|
|
12357
|
+
operation: 'updateManyFeatureImportanceAnalysis',
|
|
12358
|
+
model: 'FeatureImportanceAnalysis',
|
|
12359
|
+
error: String(error),
|
|
12360
|
+
isRetryable: isConnectionError,
|
|
12361
|
+
});
|
|
12201
12362
|
throw error;
|
|
12202
12363
|
}
|
|
12203
12364
|
}
|
|
@@ -12255,6 +12416,31 @@ export const FeatureImportanceAnalysis = {
|
|
|
12255
12416
|
}
|
|
12256
12417
|
catch (error) {
|
|
12257
12418
|
lastError = error;
|
|
12419
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
12420
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
12421
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
12422
|
+
error.message?.includes('violates unique constraint') ||
|
|
12423
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
12424
|
+
error.message?.includes('unique constraint') ||
|
|
12425
|
+
error.message?.includes('23514') ||
|
|
12426
|
+
error.message?.includes('23505') ||
|
|
12427
|
+
error.message?.includes('23503') ||
|
|
12428
|
+
error.message?.includes('P2002') ||
|
|
12429
|
+
error.message?.includes('P2003') ||
|
|
12430
|
+
error.message?.includes('P2014');
|
|
12431
|
+
if (isConstraintViolation) {
|
|
12432
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
12433
|
+
logger.error("Non-retryable constraint violation in deleteOneFeatureImportanceAnalysis", {
|
|
12434
|
+
operation: 'deleteOneFeatureImportanceAnalysis',
|
|
12435
|
+
model: 'FeatureImportanceAnalysis',
|
|
12436
|
+
error: String(error),
|
|
12437
|
+
recordId: props.id,
|
|
12438
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
12439
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
12440
|
+
isRetryable: false,
|
|
12441
|
+
});
|
|
12442
|
+
throw error;
|
|
12443
|
+
}
|
|
12258
12444
|
// Check if this is a database connection error that we should retry
|
|
12259
12445
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
12260
12446
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -12264,12 +12450,24 @@ export const FeatureImportanceAnalysis = {
|
|
|
12264
12450
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12265
12451
|
retryCount++;
|
|
12266
12452
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12267
|
-
logger.warn("Database connection error, retrying..."
|
|
12453
|
+
logger.warn("Database connection error in deleteOneFeatureImportanceAnalysis, retrying...", {
|
|
12454
|
+
operation: 'deleteOneFeatureImportanceAnalysis',
|
|
12455
|
+
model: 'FeatureImportanceAnalysis',
|
|
12456
|
+
attempt: retryCount,
|
|
12457
|
+
maxRetries: MAX_RETRIES,
|
|
12458
|
+
recordId: props.id,
|
|
12459
|
+
});
|
|
12268
12460
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12269
12461
|
continue;
|
|
12270
12462
|
}
|
|
12271
|
-
// Log
|
|
12272
|
-
logger.error("Database
|
|
12463
|
+
// Log structured error details and rethrow
|
|
12464
|
+
logger.error("Database delete operation failed", {
|
|
12465
|
+
operation: 'deleteOneFeatureImportanceAnalysis',
|
|
12466
|
+
model: 'FeatureImportanceAnalysis',
|
|
12467
|
+
error: String(error),
|
|
12468
|
+
recordId: props.id,
|
|
12469
|
+
isRetryable: isConnectionError,
|
|
12470
|
+
});
|
|
12273
12471
|
throw error;
|
|
12274
12472
|
}
|
|
12275
12473
|
}
|
|
@@ -12338,12 +12536,22 @@ export const FeatureImportanceAnalysis = {
|
|
|
12338
12536
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12339
12537
|
retryCount++;
|
|
12340
12538
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12341
|
-
logger.warn("Database connection error, retrying..."
|
|
12539
|
+
logger.warn("Database connection error in getFeatureImportanceAnalysis, retrying...", {
|
|
12540
|
+
operation: 'getFeatureImportanceAnalysis',
|
|
12541
|
+
model: 'FeatureImportanceAnalysis',
|
|
12542
|
+
attempt: retryCount,
|
|
12543
|
+
maxRetries: MAX_RETRIES,
|
|
12544
|
+
});
|
|
12342
12545
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12343
12546
|
continue;
|
|
12344
12547
|
}
|
|
12345
|
-
// Log
|
|
12346
|
-
logger.error("Database
|
|
12548
|
+
// Log structured error details and rethrow
|
|
12549
|
+
logger.error("Database get operation failed", {
|
|
12550
|
+
operation: 'getFeatureImportanceAnalysis',
|
|
12551
|
+
model: 'FeatureImportanceAnalysis',
|
|
12552
|
+
error: String(error),
|
|
12553
|
+
isRetryable: isConnectionError,
|
|
12554
|
+
});
|
|
12347
12555
|
throw error;
|
|
12348
12556
|
}
|
|
12349
12557
|
}
|
|
@@ -12400,12 +12608,22 @@ export const FeatureImportanceAnalysis = {
|
|
|
12400
12608
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12401
12609
|
retryCount++;
|
|
12402
12610
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12403
|
-
logger.warn("Database connection error, retrying..."
|
|
12611
|
+
logger.warn("Database connection error in getAllFeatureImportanceAnalysis, retrying...", {
|
|
12612
|
+
operation: 'getAllFeatureImportanceAnalysis',
|
|
12613
|
+
model: 'FeatureImportanceAnalysis',
|
|
12614
|
+
attempt: retryCount,
|
|
12615
|
+
maxRetries: MAX_RETRIES,
|
|
12616
|
+
});
|
|
12404
12617
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12405
12618
|
continue;
|
|
12406
12619
|
}
|
|
12407
|
-
// Log
|
|
12408
|
-
logger.error("Database
|
|
12620
|
+
// Log structured error details and rethrow
|
|
12621
|
+
logger.error("Database getAll operation failed", {
|
|
12622
|
+
operation: 'getAllFeatureImportanceAnalysis',
|
|
12623
|
+
model: 'FeatureImportanceAnalysis',
|
|
12624
|
+
error: String(error),
|
|
12625
|
+
isRetryable: isConnectionError,
|
|
12626
|
+
});
|
|
12409
12627
|
throw error;
|
|
12410
12628
|
}
|
|
12411
12629
|
}
|
|
@@ -12481,12 +12699,22 @@ export const FeatureImportanceAnalysis = {
|
|
|
12481
12699
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
12482
12700
|
retryCount++;
|
|
12483
12701
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
12484
|
-
logger.warn("Database connection error, retrying..."
|
|
12702
|
+
logger.warn("Database connection error in findManyFeatureImportanceAnalysis, retrying...", {
|
|
12703
|
+
operation: 'findManyFeatureImportanceAnalysis',
|
|
12704
|
+
model: 'FeatureImportanceAnalysis',
|
|
12705
|
+
attempt: retryCount,
|
|
12706
|
+
maxRetries: MAX_RETRIES,
|
|
12707
|
+
});
|
|
12485
12708
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
12486
12709
|
continue;
|
|
12487
12710
|
}
|
|
12488
|
-
// Log
|
|
12489
|
-
logger.error("Database
|
|
12711
|
+
// Log structured error details and rethrow
|
|
12712
|
+
logger.error("Database findMany operation failed", {
|
|
12713
|
+
operation: 'findManyFeatureImportanceAnalysis',
|
|
12714
|
+
model: 'FeatureImportanceAnalysis',
|
|
12715
|
+
error: String(error),
|
|
12716
|
+
isRetryable: isConnectionError,
|
|
12717
|
+
});
|
|
12490
12718
|
throw error;
|
|
12491
12719
|
}
|
|
12492
12720
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstitutionalFlowSignal.d.ts","sourceRoot":"","sources":["../../src/InstitutionalFlowSignal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,IAAI,2BAA2B,EAAE,MAAM,+DAA+D,CAAC;AACvI,OAAO,EAA4B,gBAAgB,EAAE,qBAAqB,EAAoB,MAAM,UAAU,CAAC;AAoG7G,eAAO,MAAM,uBAAuB;IAElC;;;;;OAKG;IAEH;;;;;;OAMG;kBACiB,2BAA2B,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"InstitutionalFlowSignal.d.ts","sourceRoot":"","sources":["../../src/InstitutionalFlowSignal.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,IAAI,2BAA2B,EAAE,MAAM,+DAA+D,CAAC;AACvI,OAAO,EAA4B,gBAAgB,EAAE,qBAAqB,EAAoB,MAAM,UAAU,CAAC;AAoG7G,eAAO,MAAM,uBAAuB;IAElC;;;;;OAKG;IAEH;;;;;;OAMG;kBACiB,2BAA2B,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAsQhJ;;;;;;OAMG;sBACqB,2BAA2B,EAAE,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAgHjJ;;;;;;OAMG;kBACiB,2BAA2B,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAqqB9I;;;;;;OAMG;kBACiB,2BAA2B,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAyzB9I;;;;;;OAMG;sBACqB,2BAA2B,EAAE,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAoqBjJ;;;;;;OAMG;kBACiB,2BAA2B,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,2BAA2B,CAAC;IAmH9I;;;;;;;OAOG;eACc,2BAA2B,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,eAAe,GAAG,GAAG,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC;IAuFpK;;;;;OAKG;0BACyB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,2BAA2B,EAAE,GAAG,IAAI,CAAC;IA4EnH;;;;;;;OAOG;oBACmB,2BAA2B,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,eAAe,GAAG,GAAG,OAAO,CAAC,2BAA2B,EAAE,GAAG,IAAI,CAAC;CA6F5K,CAAC"}
|