@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
|
@@ -328,6 +328,27 @@ export const NewsArticleAssetSentiment = {
|
|
|
328
328
|
}
|
|
329
329
|
catch (error) {
|
|
330
330
|
lastError = error;
|
|
331
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
332
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
333
|
+
error.message?.includes('violates unique constraint') ||
|
|
334
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
335
|
+
error.message?.includes('unique constraint') ||
|
|
336
|
+
error.message?.includes('23514') ||
|
|
337
|
+
error.message?.includes('23505') ||
|
|
338
|
+
error.message?.includes('P2002') ||
|
|
339
|
+
error.message?.includes('P2003');
|
|
340
|
+
if (isConstraintViolation) {
|
|
341
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
342
|
+
logger.error("Non-retryable constraint violation in createOneNewsArticleAssetSentiment", {
|
|
343
|
+
operation: 'createOneNewsArticleAssetSentiment',
|
|
344
|
+
model: 'NewsArticleAssetSentiment',
|
|
345
|
+
error: String(error),
|
|
346
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
347
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
348
|
+
isRetryable: false,
|
|
349
|
+
});
|
|
350
|
+
throw error;
|
|
351
|
+
}
|
|
331
352
|
// Check if this is a database connection error that we should retry
|
|
332
353
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
333
354
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -337,12 +358,22 @@ export const NewsArticleAssetSentiment = {
|
|
|
337
358
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
338
359
|
retryCount++;
|
|
339
360
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
340
|
-
logger.warn("Database connection error, retrying..."
|
|
361
|
+
logger.warn("Database connection error in createOneNewsArticleAssetSentiment, retrying...", {
|
|
362
|
+
operation: 'createOneNewsArticleAssetSentiment',
|
|
363
|
+
model: 'NewsArticleAssetSentiment',
|
|
364
|
+
attempt: retryCount,
|
|
365
|
+
maxRetries: MAX_RETRIES,
|
|
366
|
+
});
|
|
341
367
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
342
368
|
continue;
|
|
343
369
|
}
|
|
344
|
-
// Log
|
|
345
|
-
logger.error("Database
|
|
370
|
+
// Log structured error details and rethrow
|
|
371
|
+
logger.error("Database create operation failed", {
|
|
372
|
+
operation: 'createOneNewsArticleAssetSentiment',
|
|
373
|
+
model: 'NewsArticleAssetSentiment',
|
|
374
|
+
error: String(error),
|
|
375
|
+
isRetryable: isConnectionError,
|
|
376
|
+
});
|
|
346
377
|
throw error;
|
|
347
378
|
}
|
|
348
379
|
}
|
|
@@ -405,6 +436,27 @@ export const NewsArticleAssetSentiment = {
|
|
|
405
436
|
}
|
|
406
437
|
catch (error) {
|
|
407
438
|
lastError = error;
|
|
439
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
440
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
441
|
+
error.message?.includes('violates unique constraint') ||
|
|
442
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
443
|
+
error.message?.includes('unique constraint') ||
|
|
444
|
+
error.message?.includes('23514') ||
|
|
445
|
+
error.message?.includes('23505') ||
|
|
446
|
+
error.message?.includes('P2002') ||
|
|
447
|
+
error.message?.includes('P2003');
|
|
448
|
+
if (isConstraintViolation) {
|
|
449
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
450
|
+
logger.error("Non-retryable constraint violation in createManyNewsArticleAssetSentiment", {
|
|
451
|
+
operation: 'createManyNewsArticleAssetSentiment',
|
|
452
|
+
model: 'NewsArticleAssetSentiment',
|
|
453
|
+
error: String(error),
|
|
454
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
455
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
456
|
+
isRetryable: false,
|
|
457
|
+
});
|
|
458
|
+
throw error;
|
|
459
|
+
}
|
|
408
460
|
// Check if this is a database connection error that we should retry
|
|
409
461
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
410
462
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -414,12 +466,22 @@ export const NewsArticleAssetSentiment = {
|
|
|
414
466
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
415
467
|
retryCount++;
|
|
416
468
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
417
|
-
logger.warn("Database connection error, retrying..."
|
|
469
|
+
logger.warn("Database connection error in createManyNewsArticleAssetSentiment, retrying...", {
|
|
470
|
+
operation: 'createManyNewsArticleAssetSentiment',
|
|
471
|
+
model: 'NewsArticleAssetSentiment',
|
|
472
|
+
attempt: retryCount,
|
|
473
|
+
maxRetries: MAX_RETRIES,
|
|
474
|
+
});
|
|
418
475
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
419
476
|
continue;
|
|
420
477
|
}
|
|
421
|
-
// Log
|
|
422
|
-
logger.error("Database
|
|
478
|
+
// Log structured error details and rethrow
|
|
479
|
+
logger.error("Database createMany operation failed", {
|
|
480
|
+
operation: 'createManyNewsArticleAssetSentiment',
|
|
481
|
+
model: 'NewsArticleAssetSentiment',
|
|
482
|
+
error: String(error),
|
|
483
|
+
isRetryable: isConnectionError,
|
|
484
|
+
});
|
|
423
485
|
throw error;
|
|
424
486
|
}
|
|
425
487
|
}
|
|
@@ -963,6 +1025,28 @@ export const NewsArticleAssetSentiment = {
|
|
|
963
1025
|
}
|
|
964
1026
|
catch (error) {
|
|
965
1027
|
lastError = error;
|
|
1028
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1029
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
1030
|
+
error.message?.includes('violates unique constraint') ||
|
|
1031
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
1032
|
+
error.message?.includes('unique constraint') ||
|
|
1033
|
+
error.message?.includes('23514') ||
|
|
1034
|
+
error.message?.includes('23505') ||
|
|
1035
|
+
error.message?.includes('P2002') ||
|
|
1036
|
+
error.message?.includes('P2003');
|
|
1037
|
+
if (isConstraintViolation) {
|
|
1038
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
1039
|
+
logger.error("Non-retryable constraint violation in updateOneNewsArticleAssetSentiment", {
|
|
1040
|
+
operation: 'updateOneNewsArticleAssetSentiment',
|
|
1041
|
+
model: 'NewsArticleAssetSentiment',
|
|
1042
|
+
error: String(error),
|
|
1043
|
+
recordId: props.id,
|
|
1044
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1045
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1046
|
+
isRetryable: false,
|
|
1047
|
+
});
|
|
1048
|
+
throw error;
|
|
1049
|
+
}
|
|
966
1050
|
// Check if this is a database connection error that we should retry
|
|
967
1051
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
968
1052
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -972,12 +1056,24 @@ export const NewsArticleAssetSentiment = {
|
|
|
972
1056
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
973
1057
|
retryCount++;
|
|
974
1058
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
975
|
-
logger.warn("Database connection error, retrying..."
|
|
1059
|
+
logger.warn("Database connection error in updateOneNewsArticleAssetSentiment, retrying...", {
|
|
1060
|
+
operation: 'updateOneNewsArticleAssetSentiment',
|
|
1061
|
+
model: 'NewsArticleAssetSentiment',
|
|
1062
|
+
attempt: retryCount,
|
|
1063
|
+
maxRetries: MAX_RETRIES,
|
|
1064
|
+
recordId: props.id,
|
|
1065
|
+
});
|
|
976
1066
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
977
1067
|
continue;
|
|
978
1068
|
}
|
|
979
|
-
// Log
|
|
980
|
-
logger.error("Database
|
|
1069
|
+
// Log structured error details and rethrow
|
|
1070
|
+
logger.error("Database update operation failed", {
|
|
1071
|
+
operation: 'updateOneNewsArticleAssetSentiment',
|
|
1072
|
+
model: 'NewsArticleAssetSentiment',
|
|
1073
|
+
error: String(error),
|
|
1074
|
+
recordId: props.id,
|
|
1075
|
+
isRetryable: isConnectionError,
|
|
1076
|
+
});
|
|
981
1077
|
throw error;
|
|
982
1078
|
}
|
|
983
1079
|
}
|
|
@@ -1671,6 +1767,28 @@ export const NewsArticleAssetSentiment = {
|
|
|
1671
1767
|
}
|
|
1672
1768
|
catch (error) {
|
|
1673
1769
|
lastError = error;
|
|
1770
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1771
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
1772
|
+
error.message?.includes('violates unique constraint') ||
|
|
1773
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
1774
|
+
error.message?.includes('unique constraint') ||
|
|
1775
|
+
error.message?.includes('23514') ||
|
|
1776
|
+
error.message?.includes('23505') ||
|
|
1777
|
+
error.message?.includes('P2002') ||
|
|
1778
|
+
error.message?.includes('P2003');
|
|
1779
|
+
if (isConstraintViolation) {
|
|
1780
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
1781
|
+
logger.error("Non-retryable constraint violation in upsertOneNewsArticleAssetSentiment", {
|
|
1782
|
+
operation: 'upsertOneNewsArticleAssetSentiment',
|
|
1783
|
+
model: 'NewsArticleAssetSentiment',
|
|
1784
|
+
error: String(error),
|
|
1785
|
+
recordId: props.id,
|
|
1786
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1787
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1788
|
+
isRetryable: false,
|
|
1789
|
+
});
|
|
1790
|
+
throw error;
|
|
1791
|
+
}
|
|
1674
1792
|
// Check if this is a database connection error that we should retry
|
|
1675
1793
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
1676
1794
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -1680,12 +1798,24 @@ export const NewsArticleAssetSentiment = {
|
|
|
1680
1798
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1681
1799
|
retryCount++;
|
|
1682
1800
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1683
|
-
logger.warn("Database connection error, retrying..."
|
|
1801
|
+
logger.warn("Database connection error in upsertOneNewsArticleAssetSentiment, retrying...", {
|
|
1802
|
+
operation: 'upsertOneNewsArticleAssetSentiment',
|
|
1803
|
+
model: 'NewsArticleAssetSentiment',
|
|
1804
|
+
attempt: retryCount,
|
|
1805
|
+
maxRetries: MAX_RETRIES,
|
|
1806
|
+
recordId: props.id,
|
|
1807
|
+
});
|
|
1684
1808
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1685
1809
|
continue;
|
|
1686
1810
|
}
|
|
1687
|
-
// Log
|
|
1688
|
-
logger.error("Database
|
|
1811
|
+
// Log structured error details and rethrow
|
|
1812
|
+
logger.error("Database upsert operation failed", {
|
|
1813
|
+
operation: 'upsertOneNewsArticleAssetSentiment',
|
|
1814
|
+
model: 'NewsArticleAssetSentiment',
|
|
1815
|
+
error: String(error),
|
|
1816
|
+
recordId: props.id,
|
|
1817
|
+
isRetryable: isConnectionError,
|
|
1818
|
+
});
|
|
1689
1819
|
throw error;
|
|
1690
1820
|
}
|
|
1691
1821
|
}
|
|
@@ -2229,6 +2359,27 @@ export const NewsArticleAssetSentiment = {
|
|
|
2229
2359
|
}
|
|
2230
2360
|
catch (error) {
|
|
2231
2361
|
lastError = error;
|
|
2362
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
2363
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
2364
|
+
error.message?.includes('violates unique constraint') ||
|
|
2365
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
2366
|
+
error.message?.includes('unique constraint') ||
|
|
2367
|
+
error.message?.includes('23514') ||
|
|
2368
|
+
error.message?.includes('23505') ||
|
|
2369
|
+
error.message?.includes('P2002') ||
|
|
2370
|
+
error.message?.includes('P2003');
|
|
2371
|
+
if (isConstraintViolation) {
|
|
2372
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
2373
|
+
logger.error("Non-retryable constraint violation in updateManyNewsArticleAssetSentiment", {
|
|
2374
|
+
operation: 'updateManyNewsArticleAssetSentiment',
|
|
2375
|
+
model: 'NewsArticleAssetSentiment',
|
|
2376
|
+
error: String(error),
|
|
2377
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
2378
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
2379
|
+
isRetryable: false,
|
|
2380
|
+
});
|
|
2381
|
+
throw error;
|
|
2382
|
+
}
|
|
2232
2383
|
// Check if this is a database connection error that we should retry
|
|
2233
2384
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
2234
2385
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -2238,12 +2389,22 @@ export const NewsArticleAssetSentiment = {
|
|
|
2238
2389
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2239
2390
|
retryCount++;
|
|
2240
2391
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2241
|
-
logger.warn("Database connection error, retrying..."
|
|
2392
|
+
logger.warn("Database connection error in updateManyNewsArticleAssetSentiment, retrying...", {
|
|
2393
|
+
operation: 'updateManyNewsArticleAssetSentiment',
|
|
2394
|
+
model: 'NewsArticleAssetSentiment',
|
|
2395
|
+
attempt: retryCount,
|
|
2396
|
+
maxRetries: MAX_RETRIES,
|
|
2397
|
+
});
|
|
2242
2398
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2243
2399
|
continue;
|
|
2244
2400
|
}
|
|
2245
|
-
// Log
|
|
2246
|
-
logger.error("Database
|
|
2401
|
+
// Log structured error details and rethrow
|
|
2402
|
+
logger.error("Database updateMany operation failed", {
|
|
2403
|
+
operation: 'updateManyNewsArticleAssetSentiment',
|
|
2404
|
+
model: 'NewsArticleAssetSentiment',
|
|
2405
|
+
error: String(error),
|
|
2406
|
+
isRetryable: isConnectionError,
|
|
2407
|
+
});
|
|
2247
2408
|
throw error;
|
|
2248
2409
|
}
|
|
2249
2410
|
}
|
|
@@ -2301,6 +2462,31 @@ export const NewsArticleAssetSentiment = {
|
|
|
2301
2462
|
}
|
|
2302
2463
|
catch (error) {
|
|
2303
2464
|
lastError = error;
|
|
2465
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
2466
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
2467
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
2468
|
+
error.message?.includes('violates unique constraint') ||
|
|
2469
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
2470
|
+
error.message?.includes('unique constraint') ||
|
|
2471
|
+
error.message?.includes('23514') ||
|
|
2472
|
+
error.message?.includes('23505') ||
|
|
2473
|
+
error.message?.includes('23503') ||
|
|
2474
|
+
error.message?.includes('P2002') ||
|
|
2475
|
+
error.message?.includes('P2003') ||
|
|
2476
|
+
error.message?.includes('P2014');
|
|
2477
|
+
if (isConstraintViolation) {
|
|
2478
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
2479
|
+
logger.error("Non-retryable constraint violation in deleteOneNewsArticleAssetSentiment", {
|
|
2480
|
+
operation: 'deleteOneNewsArticleAssetSentiment',
|
|
2481
|
+
model: 'NewsArticleAssetSentiment',
|
|
2482
|
+
error: String(error),
|
|
2483
|
+
recordId: props.id,
|
|
2484
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
2485
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
2486
|
+
isRetryable: false,
|
|
2487
|
+
});
|
|
2488
|
+
throw error;
|
|
2489
|
+
}
|
|
2304
2490
|
// Check if this is a database connection error that we should retry
|
|
2305
2491
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
2306
2492
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -2310,12 +2496,24 @@ export const NewsArticleAssetSentiment = {
|
|
|
2310
2496
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2311
2497
|
retryCount++;
|
|
2312
2498
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2313
|
-
logger.warn("Database connection error, retrying..."
|
|
2499
|
+
logger.warn("Database connection error in deleteOneNewsArticleAssetSentiment, retrying...", {
|
|
2500
|
+
operation: 'deleteOneNewsArticleAssetSentiment',
|
|
2501
|
+
model: 'NewsArticleAssetSentiment',
|
|
2502
|
+
attempt: retryCount,
|
|
2503
|
+
maxRetries: MAX_RETRIES,
|
|
2504
|
+
recordId: props.id,
|
|
2505
|
+
});
|
|
2314
2506
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2315
2507
|
continue;
|
|
2316
2508
|
}
|
|
2317
|
-
// Log
|
|
2318
|
-
logger.error("Database
|
|
2509
|
+
// Log structured error details and rethrow
|
|
2510
|
+
logger.error("Database delete operation failed", {
|
|
2511
|
+
operation: 'deleteOneNewsArticleAssetSentiment',
|
|
2512
|
+
model: 'NewsArticleAssetSentiment',
|
|
2513
|
+
error: String(error),
|
|
2514
|
+
recordId: props.id,
|
|
2515
|
+
isRetryable: isConnectionError,
|
|
2516
|
+
});
|
|
2319
2517
|
throw error;
|
|
2320
2518
|
}
|
|
2321
2519
|
}
|
|
@@ -2385,12 +2583,22 @@ export const NewsArticleAssetSentiment = {
|
|
|
2385
2583
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2386
2584
|
retryCount++;
|
|
2387
2585
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2388
|
-
logger.warn("Database connection error, retrying..."
|
|
2586
|
+
logger.warn("Database connection error in getNewsArticleAssetSentiment, retrying...", {
|
|
2587
|
+
operation: 'getNewsArticleAssetSentiment',
|
|
2588
|
+
model: 'NewsArticleAssetSentiment',
|
|
2589
|
+
attempt: retryCount,
|
|
2590
|
+
maxRetries: MAX_RETRIES,
|
|
2591
|
+
});
|
|
2389
2592
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2390
2593
|
continue;
|
|
2391
2594
|
}
|
|
2392
|
-
// Log
|
|
2393
|
-
logger.error("Database
|
|
2595
|
+
// Log structured error details and rethrow
|
|
2596
|
+
logger.error("Database get operation failed", {
|
|
2597
|
+
operation: 'getNewsArticleAssetSentiment',
|
|
2598
|
+
model: 'NewsArticleAssetSentiment',
|
|
2599
|
+
error: String(error),
|
|
2600
|
+
isRetryable: isConnectionError,
|
|
2601
|
+
});
|
|
2394
2602
|
throw error;
|
|
2395
2603
|
}
|
|
2396
2604
|
}
|
|
@@ -2447,12 +2655,22 @@ export const NewsArticleAssetSentiment = {
|
|
|
2447
2655
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2448
2656
|
retryCount++;
|
|
2449
2657
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2450
|
-
logger.warn("Database connection error, retrying..."
|
|
2658
|
+
logger.warn("Database connection error in getAllNewsArticleAssetSentiment, retrying...", {
|
|
2659
|
+
operation: 'getAllNewsArticleAssetSentiment',
|
|
2660
|
+
model: 'NewsArticleAssetSentiment',
|
|
2661
|
+
attempt: retryCount,
|
|
2662
|
+
maxRetries: MAX_RETRIES,
|
|
2663
|
+
});
|
|
2451
2664
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2452
2665
|
continue;
|
|
2453
2666
|
}
|
|
2454
|
-
// Log
|
|
2455
|
-
logger.error("Database
|
|
2667
|
+
// Log structured error details and rethrow
|
|
2668
|
+
logger.error("Database getAll operation failed", {
|
|
2669
|
+
operation: 'getAllNewsArticleAssetSentiment',
|
|
2670
|
+
model: 'NewsArticleAssetSentiment',
|
|
2671
|
+
error: String(error),
|
|
2672
|
+
isRetryable: isConnectionError,
|
|
2673
|
+
});
|
|
2456
2674
|
throw error;
|
|
2457
2675
|
}
|
|
2458
2676
|
}
|
|
@@ -2531,12 +2749,22 @@ export const NewsArticleAssetSentiment = {
|
|
|
2531
2749
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
2532
2750
|
retryCount++;
|
|
2533
2751
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
2534
|
-
logger.warn("Database connection error, retrying..."
|
|
2752
|
+
logger.warn("Database connection error in findManyNewsArticleAssetSentiment, retrying...", {
|
|
2753
|
+
operation: 'findManyNewsArticleAssetSentiment',
|
|
2754
|
+
model: 'NewsArticleAssetSentiment',
|
|
2755
|
+
attempt: retryCount,
|
|
2756
|
+
maxRetries: MAX_RETRIES,
|
|
2757
|
+
});
|
|
2535
2758
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
2536
2759
|
continue;
|
|
2537
2760
|
}
|
|
2538
|
-
// Log
|
|
2539
|
-
logger.error("Database
|
|
2761
|
+
// Log structured error details and rethrow
|
|
2762
|
+
logger.error("Database findMany operation failed", {
|
|
2763
|
+
operation: 'findManyNewsArticleAssetSentiment',
|
|
2764
|
+
model: 'NewsArticleAssetSentiment',
|
|
2765
|
+
error: String(error),
|
|
2766
|
+
isRetryable: isConnectionError,
|
|
2767
|
+
});
|
|
2540
2768
|
throw error;
|
|
2541
2769
|
}
|
|
2542
2770
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsContract.d.ts","sourceRoot":"","sources":["../../src/OptionsContract.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC/G,OAAO,EAA4B,gBAAgB,EAAE,qBAAqB,EAAoB,MAAM,UAAU,CAAC;AAuM7G,eAAO,MAAM,eAAe;IAE1B;;;;;OAKG;IAEH;;;;;;OAMG;kBACiB,mBAAmB,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"OptionsContract.d.ts","sourceRoot":"","sources":["../../src/OptionsContract.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,uDAAuD,CAAC;AAC/G,OAAO,EAA4B,gBAAgB,EAAE,qBAAqB,EAAoB,MAAM,UAAU,CAAC;AAuM7G,eAAO,MAAM,eAAe;IAE1B;;;;;OAKG;IAEH;;;;;;OAMG;kBACiB,mBAAmB,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAgVhI;;;;;;OAMG;sBACqB,mBAAmB,EAAE,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAwHzI;;;;;;OAMG;kBACiB,mBAAmB,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA8oC9H;;;;;;OAMG;kBACiB,mBAAmB,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAy2C9H;;;;;;OAMG;sBACqB,mBAAmB,EAAE,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IA6oCzI;;;;;;OAMG;kBACiB,mBAAmB,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAmH9H;;;;;;;OAOG;eACc,mBAAmB,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,eAAe,GAAG,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAuFpJ;;;;;OAKG;0BACyB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,mBAAmB,EAAE,GAAG,IAAI,CAAC;IA4E3G;;;;;;;OAOG;oBACmB,mBAAmB,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,eAAe,GAAG,GAAG,OAAO,CAAC,mBAAmB,EAAE,GAAG,IAAI,CAAC;CA6F5J,CAAC"}
|