@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
package/esm/ABTest.mjs
CHANGED
|
@@ -1684,6 +1684,27 @@ export const ABTest = {
|
|
|
1684
1684
|
}
|
|
1685
1685
|
catch (error) {
|
|
1686
1686
|
lastError = error;
|
|
1687
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1688
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
1689
|
+
error.message?.includes('violates unique constraint') ||
|
|
1690
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
1691
|
+
error.message?.includes('unique constraint') ||
|
|
1692
|
+
error.message?.includes('23514') ||
|
|
1693
|
+
error.message?.includes('23505') ||
|
|
1694
|
+
error.message?.includes('P2002') ||
|
|
1695
|
+
error.message?.includes('P2003');
|
|
1696
|
+
if (isConstraintViolation) {
|
|
1697
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
1698
|
+
logger.error("Non-retryable constraint violation in createOneABTest", {
|
|
1699
|
+
operation: 'createOneABTest',
|
|
1700
|
+
model: 'ABTest',
|
|
1701
|
+
error: String(error),
|
|
1702
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1703
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1704
|
+
isRetryable: false,
|
|
1705
|
+
});
|
|
1706
|
+
throw error;
|
|
1707
|
+
}
|
|
1687
1708
|
// Check if this is a database connection error that we should retry
|
|
1688
1709
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
1689
1710
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -1693,12 +1714,22 @@ export const ABTest = {
|
|
|
1693
1714
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1694
1715
|
retryCount++;
|
|
1695
1716
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1696
|
-
logger.warn("Database connection error, retrying..."
|
|
1717
|
+
logger.warn("Database connection error in createOneABTest, retrying...", {
|
|
1718
|
+
operation: 'createOneABTest',
|
|
1719
|
+
model: 'ABTest',
|
|
1720
|
+
attempt: retryCount,
|
|
1721
|
+
maxRetries: MAX_RETRIES,
|
|
1722
|
+
});
|
|
1697
1723
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1698
1724
|
continue;
|
|
1699
1725
|
}
|
|
1700
|
-
// Log
|
|
1701
|
-
logger.error("Database
|
|
1726
|
+
// Log structured error details and rethrow
|
|
1727
|
+
logger.error("Database create operation failed", {
|
|
1728
|
+
operation: 'createOneABTest',
|
|
1729
|
+
model: 'ABTest',
|
|
1730
|
+
error: String(error),
|
|
1731
|
+
isRetryable: isConnectionError,
|
|
1732
|
+
});
|
|
1702
1733
|
throw error;
|
|
1703
1734
|
}
|
|
1704
1735
|
}
|
|
@@ -1780,6 +1811,27 @@ export const ABTest = {
|
|
|
1780
1811
|
}
|
|
1781
1812
|
catch (error) {
|
|
1782
1813
|
lastError = error;
|
|
1814
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
1815
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
1816
|
+
error.message?.includes('violates unique constraint') ||
|
|
1817
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
1818
|
+
error.message?.includes('unique constraint') ||
|
|
1819
|
+
error.message?.includes('23514') ||
|
|
1820
|
+
error.message?.includes('23505') ||
|
|
1821
|
+
error.message?.includes('P2002') ||
|
|
1822
|
+
error.message?.includes('P2003');
|
|
1823
|
+
if (isConstraintViolation) {
|
|
1824
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
1825
|
+
logger.error("Non-retryable constraint violation in createManyABTest", {
|
|
1826
|
+
operation: 'createManyABTest',
|
|
1827
|
+
model: 'ABTest',
|
|
1828
|
+
error: String(error),
|
|
1829
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
1830
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
1831
|
+
isRetryable: false,
|
|
1832
|
+
});
|
|
1833
|
+
throw error;
|
|
1834
|
+
}
|
|
1783
1835
|
// Check if this is a database connection error that we should retry
|
|
1784
1836
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
1785
1837
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -1789,12 +1841,22 @@ export const ABTest = {
|
|
|
1789
1841
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1790
1842
|
retryCount++;
|
|
1791
1843
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
1792
|
-
logger.warn("Database connection error, retrying..."
|
|
1844
|
+
logger.warn("Database connection error in createManyABTest, retrying...", {
|
|
1845
|
+
operation: 'createManyABTest',
|
|
1846
|
+
model: 'ABTest',
|
|
1847
|
+
attempt: retryCount,
|
|
1848
|
+
maxRetries: MAX_RETRIES,
|
|
1849
|
+
});
|
|
1793
1850
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
1794
1851
|
continue;
|
|
1795
1852
|
}
|
|
1796
|
-
// Log
|
|
1797
|
-
logger.error("Database
|
|
1853
|
+
// Log structured error details and rethrow
|
|
1854
|
+
logger.error("Database createMany operation failed", {
|
|
1855
|
+
operation: 'createManyABTest',
|
|
1856
|
+
model: 'ABTest',
|
|
1857
|
+
error: String(error),
|
|
1858
|
+
isRetryable: isConnectionError,
|
|
1859
|
+
});
|
|
1798
1860
|
throw error;
|
|
1799
1861
|
}
|
|
1800
1862
|
}
|
|
@@ -7968,6 +8030,28 @@ export const ABTest = {
|
|
|
7968
8030
|
}
|
|
7969
8031
|
catch (error) {
|
|
7970
8032
|
lastError = error;
|
|
8033
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
8034
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
8035
|
+
error.message?.includes('violates unique constraint') ||
|
|
8036
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
8037
|
+
error.message?.includes('unique constraint') ||
|
|
8038
|
+
error.message?.includes('23514') ||
|
|
8039
|
+
error.message?.includes('23505') ||
|
|
8040
|
+
error.message?.includes('P2002') ||
|
|
8041
|
+
error.message?.includes('P2003');
|
|
8042
|
+
if (isConstraintViolation) {
|
|
8043
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
8044
|
+
logger.error("Non-retryable constraint violation in updateOneABTest", {
|
|
8045
|
+
operation: 'updateOneABTest',
|
|
8046
|
+
model: 'ABTest',
|
|
8047
|
+
error: String(error),
|
|
8048
|
+
recordId: props.id,
|
|
8049
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
8050
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
8051
|
+
isRetryable: false,
|
|
8052
|
+
});
|
|
8053
|
+
throw error;
|
|
8054
|
+
}
|
|
7971
8055
|
// Check if this is a database connection error that we should retry
|
|
7972
8056
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
7973
8057
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -7977,12 +8061,24 @@ export const ABTest = {
|
|
|
7977
8061
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
7978
8062
|
retryCount++;
|
|
7979
8063
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
7980
|
-
logger.warn("Database connection error, retrying..."
|
|
8064
|
+
logger.warn("Database connection error in updateOneABTest, retrying...", {
|
|
8065
|
+
operation: 'updateOneABTest',
|
|
8066
|
+
model: 'ABTest',
|
|
8067
|
+
attempt: retryCount,
|
|
8068
|
+
maxRetries: MAX_RETRIES,
|
|
8069
|
+
recordId: props.id,
|
|
8070
|
+
});
|
|
7981
8071
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
7982
8072
|
continue;
|
|
7983
8073
|
}
|
|
7984
|
-
// Log
|
|
7985
|
-
logger.error("Database
|
|
8074
|
+
// Log structured error details and rethrow
|
|
8075
|
+
logger.error("Database update operation failed", {
|
|
8076
|
+
operation: 'updateOneABTest',
|
|
8077
|
+
model: 'ABTest',
|
|
8078
|
+
error: String(error),
|
|
8079
|
+
recordId: props.id,
|
|
8080
|
+
isRetryable: isConnectionError,
|
|
8081
|
+
});
|
|
7986
8082
|
throw error;
|
|
7987
8083
|
}
|
|
7988
8084
|
}
|
|
@@ -15552,6 +15648,28 @@ export const ABTest = {
|
|
|
15552
15648
|
}
|
|
15553
15649
|
catch (error) {
|
|
15554
15650
|
lastError = error;
|
|
15651
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
15652
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
15653
|
+
error.message?.includes('violates unique constraint') ||
|
|
15654
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
15655
|
+
error.message?.includes('unique constraint') ||
|
|
15656
|
+
error.message?.includes('23514') ||
|
|
15657
|
+
error.message?.includes('23505') ||
|
|
15658
|
+
error.message?.includes('P2002') ||
|
|
15659
|
+
error.message?.includes('P2003');
|
|
15660
|
+
if (isConstraintViolation) {
|
|
15661
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
15662
|
+
logger.error("Non-retryable constraint violation in upsertOneABTest", {
|
|
15663
|
+
operation: 'upsertOneABTest',
|
|
15664
|
+
model: 'ABTest',
|
|
15665
|
+
error: String(error),
|
|
15666
|
+
recordId: props.id,
|
|
15667
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
15668
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
15669
|
+
isRetryable: false,
|
|
15670
|
+
});
|
|
15671
|
+
throw error;
|
|
15672
|
+
}
|
|
15555
15673
|
// Check if this is a database connection error that we should retry
|
|
15556
15674
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
15557
15675
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -15561,12 +15679,24 @@ export const ABTest = {
|
|
|
15561
15679
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
15562
15680
|
retryCount++;
|
|
15563
15681
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
15564
|
-
logger.warn("Database connection error, retrying..."
|
|
15682
|
+
logger.warn("Database connection error in upsertOneABTest, retrying...", {
|
|
15683
|
+
operation: 'upsertOneABTest',
|
|
15684
|
+
model: 'ABTest',
|
|
15685
|
+
attempt: retryCount,
|
|
15686
|
+
maxRetries: MAX_RETRIES,
|
|
15687
|
+
recordId: props.id,
|
|
15688
|
+
});
|
|
15565
15689
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
15566
15690
|
continue;
|
|
15567
15691
|
}
|
|
15568
|
-
// Log
|
|
15569
|
-
logger.error("Database
|
|
15692
|
+
// Log structured error details and rethrow
|
|
15693
|
+
logger.error("Database upsert operation failed", {
|
|
15694
|
+
operation: 'upsertOneABTest',
|
|
15695
|
+
model: 'ABTest',
|
|
15696
|
+
error: String(error),
|
|
15697
|
+
recordId: props.id,
|
|
15698
|
+
isRetryable: isConnectionError,
|
|
15699
|
+
});
|
|
15570
15700
|
throw error;
|
|
15571
15701
|
}
|
|
15572
15702
|
}
|
|
@@ -21740,6 +21870,27 @@ export const ABTest = {
|
|
|
21740
21870
|
}
|
|
21741
21871
|
catch (error) {
|
|
21742
21872
|
lastError = error;
|
|
21873
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
21874
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
21875
|
+
error.message?.includes('violates unique constraint') ||
|
|
21876
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
21877
|
+
error.message?.includes('unique constraint') ||
|
|
21878
|
+
error.message?.includes('23514') ||
|
|
21879
|
+
error.message?.includes('23505') ||
|
|
21880
|
+
error.message?.includes('P2002') ||
|
|
21881
|
+
error.message?.includes('P2003');
|
|
21882
|
+
if (isConstraintViolation) {
|
|
21883
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
21884
|
+
logger.error("Non-retryable constraint violation in updateManyABTest", {
|
|
21885
|
+
operation: 'updateManyABTest',
|
|
21886
|
+
model: 'ABTest',
|
|
21887
|
+
error: String(error),
|
|
21888
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
21889
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
21890
|
+
isRetryable: false,
|
|
21891
|
+
});
|
|
21892
|
+
throw error;
|
|
21893
|
+
}
|
|
21743
21894
|
// Check if this is a database connection error that we should retry
|
|
21744
21895
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
21745
21896
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -21749,12 +21900,22 @@ export const ABTest = {
|
|
|
21749
21900
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
21750
21901
|
retryCount++;
|
|
21751
21902
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
21752
|
-
logger.warn("Database connection error, retrying..."
|
|
21903
|
+
logger.warn("Database connection error in updateManyABTest, retrying...", {
|
|
21904
|
+
operation: 'updateManyABTest',
|
|
21905
|
+
model: 'ABTest',
|
|
21906
|
+
attempt: retryCount,
|
|
21907
|
+
maxRetries: MAX_RETRIES,
|
|
21908
|
+
});
|
|
21753
21909
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
21754
21910
|
continue;
|
|
21755
21911
|
}
|
|
21756
|
-
// Log
|
|
21757
|
-
logger.error("Database
|
|
21912
|
+
// Log structured error details and rethrow
|
|
21913
|
+
logger.error("Database updateMany operation failed", {
|
|
21914
|
+
operation: 'updateManyABTest',
|
|
21915
|
+
model: 'ABTest',
|
|
21916
|
+
error: String(error),
|
|
21917
|
+
isRetryable: isConnectionError,
|
|
21918
|
+
});
|
|
21758
21919
|
throw error;
|
|
21759
21920
|
}
|
|
21760
21921
|
}
|
|
@@ -21812,6 +21973,31 @@ export const ABTest = {
|
|
|
21812
21973
|
}
|
|
21813
21974
|
catch (error) {
|
|
21814
21975
|
lastError = error;
|
|
21976
|
+
// Check for constraint violations FIRST - these are NEVER retryable
|
|
21977
|
+
// (e.g., foreign key constraints preventing deletion)
|
|
21978
|
+
const isConstraintViolation = error.message?.includes('violates check constraint') ||
|
|
21979
|
+
error.message?.includes('violates unique constraint') ||
|
|
21980
|
+
error.message?.includes('violates foreign key constraint') ||
|
|
21981
|
+
error.message?.includes('unique constraint') ||
|
|
21982
|
+
error.message?.includes('23514') ||
|
|
21983
|
+
error.message?.includes('23505') ||
|
|
21984
|
+
error.message?.includes('23503') ||
|
|
21985
|
+
error.message?.includes('P2002') ||
|
|
21986
|
+
error.message?.includes('P2003') ||
|
|
21987
|
+
error.message?.includes('P2014');
|
|
21988
|
+
if (isConstraintViolation) {
|
|
21989
|
+
const constraintMatch = error.message?.match(/constraint\s+"([^"]+)"/);
|
|
21990
|
+
logger.error("Non-retryable constraint violation in deleteOneABTest", {
|
|
21991
|
+
operation: 'deleteOneABTest',
|
|
21992
|
+
model: 'ABTest',
|
|
21993
|
+
error: String(error),
|
|
21994
|
+
recordId: props.id,
|
|
21995
|
+
constraintName: constraintMatch ? constraintMatch[1] : undefined,
|
|
21996
|
+
errorCategory: 'CONSTRAINT_VIOLATION',
|
|
21997
|
+
isRetryable: false,
|
|
21998
|
+
});
|
|
21999
|
+
throw error;
|
|
22000
|
+
}
|
|
21815
22001
|
// Check if this is a database connection error that we should retry
|
|
21816
22002
|
const isConnectionError = error.message?.includes('Server has closed the connection') ||
|
|
21817
22003
|
error.message?.includes('Cannot reach database server') ||
|
|
@@ -21821,12 +22007,24 @@ export const ABTest = {
|
|
|
21821
22007
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
21822
22008
|
retryCount++;
|
|
21823
22009
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
21824
|
-
logger.warn("Database connection error, retrying..."
|
|
22010
|
+
logger.warn("Database connection error in deleteOneABTest, retrying...", {
|
|
22011
|
+
operation: 'deleteOneABTest',
|
|
22012
|
+
model: 'ABTest',
|
|
22013
|
+
attempt: retryCount,
|
|
22014
|
+
maxRetries: MAX_RETRIES,
|
|
22015
|
+
recordId: props.id,
|
|
22016
|
+
});
|
|
21825
22017
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
21826
22018
|
continue;
|
|
21827
22019
|
}
|
|
21828
|
-
// Log
|
|
21829
|
-
logger.error("Database
|
|
22020
|
+
// Log structured error details and rethrow
|
|
22021
|
+
logger.error("Database delete operation failed", {
|
|
22022
|
+
operation: 'deleteOneABTest',
|
|
22023
|
+
model: 'ABTest',
|
|
22024
|
+
error: String(error),
|
|
22025
|
+
recordId: props.id,
|
|
22026
|
+
isRetryable: isConnectionError,
|
|
22027
|
+
});
|
|
21830
22028
|
throw error;
|
|
21831
22029
|
}
|
|
21832
22030
|
}
|
|
@@ -21901,12 +22099,22 @@ export const ABTest = {
|
|
|
21901
22099
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
21902
22100
|
retryCount++;
|
|
21903
22101
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
21904
|
-
logger.warn("Database connection error, retrying..."
|
|
22102
|
+
logger.warn("Database connection error in getABTest, retrying...", {
|
|
22103
|
+
operation: 'getABTest',
|
|
22104
|
+
model: 'ABTest',
|
|
22105
|
+
attempt: retryCount,
|
|
22106
|
+
maxRetries: MAX_RETRIES,
|
|
22107
|
+
});
|
|
21905
22108
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
21906
22109
|
continue;
|
|
21907
22110
|
}
|
|
21908
|
-
// Log
|
|
21909
|
-
logger.error("Database
|
|
22111
|
+
// Log structured error details and rethrow
|
|
22112
|
+
logger.error("Database get operation failed", {
|
|
22113
|
+
operation: 'getABTest',
|
|
22114
|
+
model: 'ABTest',
|
|
22115
|
+
error: String(error),
|
|
22116
|
+
isRetryable: isConnectionError,
|
|
22117
|
+
});
|
|
21910
22118
|
throw error;
|
|
21911
22119
|
}
|
|
21912
22120
|
}
|
|
@@ -21963,12 +22171,22 @@ export const ABTest = {
|
|
|
21963
22171
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
21964
22172
|
retryCount++;
|
|
21965
22173
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
21966
|
-
logger.warn("Database connection error, retrying..."
|
|
22174
|
+
logger.warn("Database connection error in getAllABTest, retrying...", {
|
|
22175
|
+
operation: 'getAllABTest',
|
|
22176
|
+
model: 'ABTest',
|
|
22177
|
+
attempt: retryCount,
|
|
22178
|
+
maxRetries: MAX_RETRIES,
|
|
22179
|
+
});
|
|
21967
22180
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
21968
22181
|
continue;
|
|
21969
22182
|
}
|
|
21970
|
-
// Log
|
|
21971
|
-
logger.error("Database
|
|
22183
|
+
// Log structured error details and rethrow
|
|
22184
|
+
logger.error("Database getAll operation failed", {
|
|
22185
|
+
operation: 'getAllABTest',
|
|
22186
|
+
model: 'ABTest',
|
|
22187
|
+
error: String(error),
|
|
22188
|
+
isRetryable: isConnectionError,
|
|
22189
|
+
});
|
|
21972
22190
|
throw error;
|
|
21973
22191
|
}
|
|
21974
22192
|
}
|
|
@@ -22050,12 +22268,22 @@ export const ABTest = {
|
|
|
22050
22268
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
22051
22269
|
retryCount++;
|
|
22052
22270
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
22053
|
-
logger.warn("Database connection error, retrying..."
|
|
22271
|
+
logger.warn("Database connection error in findManyABTest, retrying...", {
|
|
22272
|
+
operation: 'findManyABTest',
|
|
22273
|
+
model: 'ABTest',
|
|
22274
|
+
attempt: retryCount,
|
|
22275
|
+
maxRetries: MAX_RETRIES,
|
|
22276
|
+
});
|
|
22054
22277
|
await new Promise(resolve => setTimeout(resolve, delay));
|
|
22055
22278
|
continue;
|
|
22056
22279
|
}
|
|
22057
|
-
// Log
|
|
22058
|
-
logger.error("Database
|
|
22280
|
+
// Log structured error details and rethrow
|
|
22281
|
+
logger.error("Database findMany operation failed", {
|
|
22282
|
+
operation: 'findManyABTest',
|
|
22283
|
+
model: 'ABTest',
|
|
22284
|
+
error: String(error),
|
|
22285
|
+
isRetryable: isConnectionError,
|
|
22286
|
+
});
|
|
22059
22287
|
throw error;
|
|
22060
22288
|
}
|
|
22061
22289
|
}
|
package/esm/Account.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../src/Account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAA4B,gBAAgB,EAAE,qBAAqB,EAAoB,MAAM,UAAU,CAAC;AAmM7G,eAAO,MAAM,OAAO;IAElB;;;;;OAKG;IAEH;;;;;;OAMG;kBACiB,WAAW,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"Account.d.ts","sourceRoot":"","sources":["../../src/Account.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,+CAA+C,CAAC;AACvF,OAAO,EAA4B,gBAAgB,EAAE,qBAAqB,EAAoB,MAAM,UAAU,CAAC;AAmM7G,eAAO,MAAM,OAAO;IAElB;;;;;OAKG;IAEH;;;;;;OAMG;kBACiB,WAAW,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IA8ahH;;;;;;OAMG;sBACqB,WAAW,EAAE,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAuHjI;;;;;;OAMG;kBACiB,WAAW,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IA0qC9G;;;;;;OAMG;kBACiB,WAAW,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAm+C9G;;;;;;OAMG;sBACqB,WAAW,EAAE,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAyqCjI;;;;;;OAMG;kBACiB,WAAW,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAmH9G;;;;;;;OAOG;eACc,WAAW,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,eAAe,GAAG,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;IAwFpI;;;;;OAKG;0BACyB,gBAAgB,CAAC,qBAAqB,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;IA4EnG;;;;;;;OAOG;oBACmB,WAAW,iBAAiB,gBAAgB,CAAC,qBAAqB,CAAC,eAAe,GAAG,GAAG,OAAO,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC;CAgG5I,CAAC"}
|