@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
|
@@ -563,6 +563,27 @@ export const AccountLinkingRequest = {
|
|
|
563
563
|
}
|
|
564
564
|
catch (error) {
|
|
565
565
|
lastError = error;
|
|
566
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
567
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
568
|
+
error.message?.includes('violates unique constraint') ||
|
|
569
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
570
|
+
error.message?.includes('unique constraint') ||
|
|
571
|
+
error.message?.includes('23514') ||
|
|
572
|
+
error.message?.includes('23505') ||
|
|
573
|
+
error.message?.includes('P2002') ||
|
|
574
|
+
error.message?.includes('P2003');
|
|
575
|
+
if (isConstraintViolation) {
|
|
576
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
577
|
+
logger.error("Non-retryable constraint violation in createOneAccountLinkingRequest", {
|
|
578
|
+
operation: 'createOneAccountLinkingRequest',
|
|
579
|
+
model: 'AccountLinkingRequest',
|
|
580
|
+
error: String(error),
|
|
581
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
582
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
583
|
+
isRetryable: false,
|
|
584
|
+
});
|
|
585
|
+
throw error;
|
|
586
|
+
}
|
|
566
587
|
// Check if this is a database connection error that we should retry
|
|
567
588
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
568
589
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -572,12 +593,22 @@ export const AccountLinkingRequest = {
|
|
|
572
593
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
573
594
|
retryCount++;
|
|
574
595
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
575
|
-
logger.warn("Database connection error, retrying..."
|
|
596
|
+
logger.warn("Database connection error in createOneAccountLinkingRequest, retrying...", {
|
|
597
|
+
operation: 'createOneAccountLinkingRequest',
|
|
598
|
+
model: 'AccountLinkingRequest',
|
|
599
|
+
attempt: retryCount,
|
|
600
|
+
maxRetries: MAX_RETRIES,
|
|
601
|
+
});
|
|
576
602
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
577
603
|
continue;
|
|
578
604
|
}
|
|
579
|
-
// Log
|
|
580
|
-
logger.error("Database
|
|
605
|
+
// Log structured error details and rethrow
|
|
606
|
+
logger.error("Database create operation failed", {
|
|
607
|
+
operation: 'createOneAccountLinkingRequest',
|
|
608
|
+
model: 'AccountLinkingRequest',
|
|
609
|
+
error: String(error),
|
|
610
|
+
isRetryable: isConnectionError,
|
|
611
|
+
});
|
|
581
612
|
throw error;
|
|
582
613
|
}
|
|
583
614
|
}
|
|
@@ -646,6 +677,27 @@ export const AccountLinkingRequest = {
|
|
|
646
677
|
}
|
|
647
678
|
catch (error) {
|
|
648
679
|
lastError = error;
|
|
680
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
681
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
682
|
+
error.message?.includes('violates unique constraint') ||
|
|
683
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
684
|
+
error.message?.includes('unique constraint') ||
|
|
685
|
+
error.message?.includes('23514') ||
|
|
686
|
+
error.message?.includes('23505') ||
|
|
687
|
+
error.message?.includes('P2002') ||
|
|
688
|
+
error.message?.includes('P2003');
|
|
689
|
+
if (isConstraintViolation) {
|
|
690
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
691
|
+
logger.error("Non-retryable constraint violation in createManyAccountLinkingRequest", {
|
|
692
|
+
operation: 'createManyAccountLinkingRequest',
|
|
693
|
+
model: 'AccountLinkingRequest',
|
|
694
|
+
error: String(error),
|
|
695
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
696
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
697
|
+
isRetryable: false,
|
|
698
|
+
});
|
|
699
|
+
throw error;
|
|
700
|
+
}
|
|
649
701
|
// Check if this is a database connection error that we should retry
|
|
650
702
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
651
703
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -655,12 +707,22 @@ export const AccountLinkingRequest = {
|
|
|
655
707
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
656
708
|
retryCount++;
|
|
657
709
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
658
|
-
logger.warn("Database connection error, retrying..."
|
|
710
|
+
logger.warn("Database connection error in createManyAccountLinkingRequest, retrying...", {
|
|
711
|
+
operation: 'createManyAccountLinkingRequest',
|
|
712
|
+
model: 'AccountLinkingRequest',
|
|
713
|
+
attempt: retryCount,
|
|
714
|
+
maxRetries: MAX_RETRIES,
|
|
715
|
+
});
|
|
659
716
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
660
717
|
continue;
|
|
661
718
|
}
|
|
662
|
-
// Log
|
|
663
|
-
logger.error("Database
|
|
719
|
+
// Log structured error details and rethrow
|
|
720
|
+
logger.error("Database createMany operation failed", {
|
|
721
|
+
operation: 'createManyAccountLinkingRequest',
|
|
722
|
+
model: 'AccountLinkingRequest',
|
|
723
|
+
error: String(error),
|
|
724
|
+
isRetryable: isConnectionError,
|
|
725
|
+
});
|
|
664
726
|
throw error;
|
|
665
727
|
}
|
|
666
728
|
}
|
|
@@ -1790,6 +1852,28 @@ export const AccountLinkingRequest = {
|
|
|
1790
1852
|
}
|
|
1791
1853
|
catch (error) {
|
|
1792
1854
|
lastError = error;
|
|
1855
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1856
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
1857
|
+
error.message?.includes('violates unique constraint') ||
|
|
1858
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
1859
|
+
error.message?.includes('unique constraint') ||
|
|
1860
|
+
error.message?.includes('23514') ||
|
|
1861
|
+
error.message?.includes('23505') ||
|
|
1862
|
+
error.message?.includes('P2002') ||
|
|
1863
|
+
error.message?.includes('P2003');
|
|
1864
|
+
if (isConstraintViolation) {
|
|
1865
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
1866
|
+
logger.error("Non-retryable constraint violation in updateOneAccountLinkingRequest", {
|
|
1867
|
+
operation: 'updateOneAccountLinkingRequest',
|
|
1868
|
+
model: 'AccountLinkingRequest',
|
|
1869
|
+
error: String(error),
|
|
1870
|
+
recordId: props.id,
|
|
1871
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1872
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1873
|
+
isRetryable: false,
|
|
1874
|
+
});
|
|
1875
|
+
throw error;
|
|
1876
|
+
}
|
|
1793
1877
|
// Check if this is a database connection error that we should retry
|
|
1794
1878
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
1795
1879
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -1799,12 +1883,24 @@ export const AccountLinkingRequest = {
|
|
|
1799
1883
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1800
1884
|
retryCount++;
|
|
1801
1885
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1802
|
-
logger.warn("Database connection error, retrying..."
|
|
1886
|
+
logger.warn("Database connection error in updateOneAccountLinkingRequest, retrying...", {
|
|
1887
|
+
operation: 'updateOneAccountLinkingRequest',
|
|
1888
|
+
model: 'AccountLinkingRequest',
|
|
1889
|
+
attempt: retryCount,
|
|
1890
|
+
maxRetries: MAX_RETRIES,
|
|
1891
|
+
recordId: props.id,
|
|
1892
|
+
});
|
|
1803
1893
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1804
1894
|
continue;
|
|
1805
1895
|
}
|
|
1806
|
-
// Log
|
|
1807
|
-
logger.error("Database
|
|
1896
|
+
// Log structured error details and rethrow
|
|
1897
|
+
logger.error("Database update operation failed", {
|
|
1898
|
+
operation: 'updateOneAccountLinkingRequest',
|
|
1899
|
+
model: 'AccountLinkingRequest',
|
|
1900
|
+
error: String(error),
|
|
1901
|
+
recordId: props.id,
|
|
1902
|
+
isRetryable: isConnectionError,
|
|
1903
|
+
});
|
|
1808
1904
|
throw error;
|
|
1809
1905
|
}
|
|
1810
1906
|
}
|
|
@@ -3245,6 +3341,28 @@ export const AccountLinkingRequest = {
|
|
|
3245
3341
|
}
|
|
3246
3342
|
catch (error) {
|
|
3247
3343
|
lastError = error;
|
|
3344
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
3345
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
3346
|
+
error.message?.includes('violates unique constraint') ||
|
|
3347
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
3348
|
+
error.message?.includes('unique constraint') ||
|
|
3349
|
+
error.message?.includes('23514') ||
|
|
3350
|
+
error.message?.includes('23505') ||
|
|
3351
|
+
error.message?.includes('P2002') ||
|
|
3352
|
+
error.message?.includes('P2003');
|
|
3353
|
+
if (isConstraintViolation) {
|
|
3354
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
3355
|
+
logger.error("Non-retryable constraint violation in upsertOneAccountLinkingRequest", {
|
|
3356
|
+
operation: 'upsertOneAccountLinkingRequest',
|
|
3357
|
+
model: 'AccountLinkingRequest',
|
|
3358
|
+
error: String(error),
|
|
3359
|
+
recordId: props.id,
|
|
3360
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
3361
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
3362
|
+
isRetryable: false,
|
|
3363
|
+
});
|
|
3364
|
+
throw error;
|
|
3365
|
+
}
|
|
3248
3366
|
// Check if this is a database connection error that we should retry
|
|
3249
3367
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
3250
3368
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -3254,12 +3372,24 @@ export const AccountLinkingRequest = {
|
|
|
3254
3372
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
3255
3373
|
retryCount++;
|
|
3256
3374
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
3257
|
-
logger.warn("Database connection error, retrying..."
|
|
3375
|
+
logger.warn("Database connection error in upsertOneAccountLinkingRequest, retrying...", {
|
|
3376
|
+
operation: 'upsertOneAccountLinkingRequest',
|
|
3377
|
+
model: 'AccountLinkingRequest',
|
|
3378
|
+
attempt: retryCount,
|
|
3379
|
+
maxRetries: MAX_RETRIES,
|
|
3380
|
+
recordId: props.id,
|
|
3381
|
+
});
|
|
3258
3382
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
3259
3383
|
continue;
|
|
3260
3384
|
}
|
|
3261
|
-
// Log
|
|
3262
|
-
logger.error("Database
|
|
3385
|
+
// Log structured error details and rethrow
|
|
3386
|
+
logger.error("Database upsert operation failed", {
|
|
3387
|
+
operation: 'upsertOneAccountLinkingRequest',
|
|
3388
|
+
model: 'AccountLinkingRequest',
|
|
3389
|
+
error: String(error),
|
|
3390
|
+
recordId: props.id,
|
|
3391
|
+
isRetryable: isConnectionError,
|
|
3392
|
+
});
|
|
3263
3393
|
throw error;
|
|
3264
3394
|
}
|
|
3265
3395
|
}
|
|
@@ -4389,6 +4519,27 @@ export const AccountLinkingRequest = {
|
|
|
4389
4519
|
}
|
|
4390
4520
|
catch (error) {
|
|
4391
4521
|
lastError = error;
|
|
4522
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
4523
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
4524
|
+
error.message?.includes('violates unique constraint') ||
|
|
4525
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
4526
|
+
error.message?.includes('unique constraint') ||
|
|
4527
|
+
error.message?.includes('23514') ||
|
|
4528
|
+
error.message?.includes('23505') ||
|
|
4529
|
+
error.message?.includes('P2002') ||
|
|
4530
|
+
error.message?.includes('P2003');
|
|
4531
|
+
if (isConstraintViolation) {
|
|
4532
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
4533
|
+
logger.error("Non-retryable constraint violation in updateManyAccountLinkingRequest", {
|
|
4534
|
+
operation: 'updateManyAccountLinkingRequest',
|
|
4535
|
+
model: 'AccountLinkingRequest',
|
|
4536
|
+
error: String(error),
|
|
4537
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
4538
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
4539
|
+
isRetryable: false,
|
|
4540
|
+
});
|
|
4541
|
+
throw error;
|
|
4542
|
+
}
|
|
4392
4543
|
// Check if this is a database connection error that we should retry
|
|
4393
4544
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
4394
4545
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -4398,12 +4549,22 @@ export const AccountLinkingRequest = {
|
|
|
4398
4549
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4399
4550
|
retryCount++;
|
|
4400
4551
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4401
|
-
logger.warn("Database connection error, retrying..."
|
|
4552
|
+
logger.warn("Database connection error in updateManyAccountLinkingRequest, retrying...", {
|
|
4553
|
+
operation: 'updateManyAccountLinkingRequest',
|
|
4554
|
+
model: 'AccountLinkingRequest',
|
|
4555
|
+
attempt: retryCount,
|
|
4556
|
+
maxRetries: MAX_RETRIES,
|
|
4557
|
+
});
|
|
4402
4558
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4403
4559
|
continue;
|
|
4404
4560
|
}
|
|
4405
|
-
// Log
|
|
4406
|
-
logger.error("Database
|
|
4561
|
+
// Log structured error details and rethrow
|
|
4562
|
+
logger.error("Database updateMany operation failed", {
|
|
4563
|
+
operation: 'updateManyAccountLinkingRequest',
|
|
4564
|
+
model: 'AccountLinkingRequest',
|
|
4565
|
+
error: String(error),
|
|
4566
|
+
isRetryable: isConnectionError,
|
|
4567
|
+
});
|
|
4407
4568
|
throw error;
|
|
4408
4569
|
}
|
|
4409
4570
|
}
|
|
@@ -4461,6 +4622,31 @@ export const AccountLinkingRequest = {
|
|
|
4461
4622
|
}
|
|
4462
4623
|
catch (error) {
|
|
4463
4624
|
lastError = error;
|
|
4625
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
4626
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
4627
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
4628
|
+
error.message?.includes('violates unique constraint') ||
|
|
4629
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
4630
|
+
error.message?.includes('unique constraint') ||
|
|
4631
|
+
error.message?.includes('23514') ||
|
|
4632
|
+
error.message?.includes('23505') ||
|
|
4633
|
+
error.message?.includes('23503') ||
|
|
4634
|
+
error.message?.includes('P2002') ||
|
|
4635
|
+
error.message?.includes('P2003') ||
|
|
4636
|
+
error.message?.includes('P2014');
|
|
4637
|
+
if (isConstraintViolation) {
|
|
4638
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
4639
|
+
logger.error("Non-retryable constraint violation in deleteOneAccountLinkingRequest", {
|
|
4640
|
+
operation: 'deleteOneAccountLinkingRequest',
|
|
4641
|
+
model: 'AccountLinkingRequest',
|
|
4642
|
+
error: String(error),
|
|
4643
|
+
recordId: props.id,
|
|
4644
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
4645
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
4646
|
+
isRetryable: false,
|
|
4647
|
+
});
|
|
4648
|
+
throw error;
|
|
4649
|
+
}
|
|
4464
4650
|
// Check if this is a database connection error that we should retry
|
|
4465
4651
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
4466
4652
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -4470,12 +4656,24 @@ export const AccountLinkingRequest = {
|
|
|
4470
4656
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4471
4657
|
retryCount++;
|
|
4472
4658
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4473
|
-
logger.warn("Database connection error, retrying..."
|
|
4659
|
+
logger.warn("Database connection error in deleteOneAccountLinkingRequest, retrying...", {
|
|
4660
|
+
operation: 'deleteOneAccountLinkingRequest',
|
|
4661
|
+
model: 'AccountLinkingRequest',
|
|
4662
|
+
attempt: retryCount,
|
|
4663
|
+
maxRetries: MAX_RETRIES,
|
|
4664
|
+
recordId: props.id,
|
|
4665
|
+
});
|
|
4474
4666
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4475
4667
|
continue;
|
|
4476
4668
|
}
|
|
4477
|
-
// Log
|
|
4478
|
-
logger.error("Database
|
|
4669
|
+
// Log structured error details and rethrow
|
|
4670
|
+
logger.error("Database delete operation failed", {
|
|
4671
|
+
operation: 'deleteOneAccountLinkingRequest',
|
|
4672
|
+
model: 'AccountLinkingRequest',
|
|
4673
|
+
error: String(error),
|
|
4674
|
+
recordId: props.id,
|
|
4675
|
+
isRetryable: isConnectionError,
|
|
4676
|
+
});
|
|
4479
4677
|
throw error;
|
|
4480
4678
|
}
|
|
4481
4679
|
}
|
|
@@ -4550,12 +4748,22 @@ export const AccountLinkingRequest = {
|
|
|
4550
4748
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4551
4749
|
retryCount++;
|
|
4552
4750
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4553
|
-
logger.warn("Database connection error, retrying..."
|
|
4751
|
+
logger.warn("Database connection error in getAccountLinkingRequest, retrying...", {
|
|
4752
|
+
operation: 'getAccountLinkingRequest',
|
|
4753
|
+
model: 'AccountLinkingRequest',
|
|
4754
|
+
attempt: retryCount,
|
|
4755
|
+
maxRetries: MAX_RETRIES,
|
|
4756
|
+
});
|
|
4554
4757
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4555
4758
|
continue;
|
|
4556
4759
|
}
|
|
4557
|
-
// Log
|
|
4558
|
-
logger.error("Database
|
|
4760
|
+
// Log structured error details and rethrow
|
|
4761
|
+
logger.error("Database get operation failed", {
|
|
4762
|
+
operation: 'getAccountLinkingRequest',
|
|
4763
|
+
model: 'AccountLinkingRequest',
|
|
4764
|
+
error: String(error),
|
|
4765
|
+
isRetryable: isConnectionError,
|
|
4766
|
+
});
|
|
4559
4767
|
throw error;
|
|
4560
4768
|
}
|
|
4561
4769
|
}
|
|
@@ -4612,12 +4820,22 @@ export const AccountLinkingRequest = {
|
|
|
4612
4820
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4613
4821
|
retryCount++;
|
|
4614
4822
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4615
|
-
logger.warn("Database connection error, retrying..."
|
|
4823
|
+
logger.warn("Database connection error in getAllAccountLinkingRequest, retrying...", {
|
|
4824
|
+
operation: 'getAllAccountLinkingRequest',
|
|
4825
|
+
model: 'AccountLinkingRequest',
|
|
4826
|
+
attempt: retryCount,
|
|
4827
|
+
maxRetries: MAX_RETRIES,
|
|
4828
|
+
});
|
|
4616
4829
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4617
4830
|
continue;
|
|
4618
4831
|
}
|
|
4619
|
-
// Log
|
|
4620
|
-
logger.error("Database
|
|
4832
|
+
// Log structured error details and rethrow
|
|
4833
|
+
logger.error("Database getAll operation failed", {
|
|
4834
|
+
operation: 'getAllAccountLinkingRequest',
|
|
4835
|
+
model: 'AccountLinkingRequest',
|
|
4836
|
+
error: String(error),
|
|
4837
|
+
isRetryable: isConnectionError,
|
|
4838
|
+
});
|
|
4621
4839
|
throw error;
|
|
4622
4840
|
}
|
|
4623
4841
|
}
|
|
@@ -4699,12 +4917,22 @@ export const AccountLinkingRequest = {
|
|
|
4699
4917
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
4700
4918
|
retryCount++;
|
|
4701
4919
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
4702
|
-
logger.warn("Database connection error, retrying..."
|
|
4920
|
+
logger.warn("Database connection error in findManyAccountLinkingRequest, retrying...", {
|
|
4921
|
+
operation: 'findManyAccountLinkingRequest',
|
|
4922
|
+
model: 'AccountLinkingRequest',
|
|
4923
|
+
attempt: retryCount,
|
|
4924
|
+
maxRetries: MAX_RETRIES,
|
|
4925
|
+
});
|
|
4703
4926
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
4704
4927
|
continue;
|
|
4705
4928
|
}
|
|
4706
|
-
// Log
|
|
4707
|
-
logger.error("Database
|
|
4929
|
+
// Log structured error details and rethrow
|
|
4930
|
+
logger.error("Database findMany operation failed", {
|
|
4931
|
+
operation: 'findManyAccountLinkingRequest',
|
|
4932
|
+
model: 'AccountLinkingRequest',
|
|
4933
|
+
error: String(error),
|
|
4934
|
+
isRetryable: isConnectionError,
|
|
4935
|
+
});
|
|
4708
4936
|
throw error;
|
|
4709
4937
|
}
|
|
4710
4938
|
}
|
package/esm/Action.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../src/Action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAA4B,gBAAgB,EAAE,qBAAqB,EAAoB,MAAM,UAAU,CAAC;AAwB7G,eAAO,MAAM,MAAM;IAEjB;;;;;OAKG;IAEH;;;;;;OAMG;kBACiB,UAAU,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../src/Action.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,8CAA8C,CAAC;AACpF,OAAO,EAA4B,gBAAgB,EAAE,qBAAqB,EAAoB,MAAM,UAAU,CAAC;AAwB7G,eAAO,MAAM,MAAM;IAEjB;;;;;OAKG;IAEH;;;;;;OAMG;kBACiB,UAAU,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAkK9G;;;;;;OAMG;sBACqB,UAAU,EAAE,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAoHhI;;;;;;OAMG;kBACiB,UAAU,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAmR5G;;;;;;OAMG;kBACiB,UAAU,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAgU5G;;;;;;OAMG;sBACqB,UAAU,EAAE,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAkRhI;;;;;;OAMG;kBACiB,UAAU,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IAmH5G;;;;;;;OAOG;eACc,UAAU,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,eAAe,GAAG,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC;IAwFlI;;;;;OAKG;0BACyB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC;IA4ElG;;;;;;;OAOG;oBACmB,UAAU,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,eAAe,GAAG,GAAG,OAAO,CAAC,UAAU,EAAE,GAAG,IAAI,CAAC;CA6F1I,CAAC"}
|