@adaptic/backend-legacy 0.0.953 → 0.0.954
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 +207 -36
- package/Account.cjs +207 -36
- package/AccountDecisionRecord.cjs +207 -36
- package/AccountLinkingRequest.cjs +207 -36
- package/Action.cjs +207 -36
- package/Alert.cjs +207 -36
- package/Allocation.cjs +207 -36
- package/AlpacaAccount.cjs +207 -36
- package/AnalyticsConfiguration.cjs +207 -36
- package/AnalyticsSnapshot.cjs +207 -36
- package/Asset.cjs +207 -36
- package/AuditLog.cjs +207 -36
- package/Authenticator.cjs +207 -36
- package/Configuration.cjs +207 -36
- package/ConflictEvent.cjs +207 -36
- package/ConnectionHealthSnapshot.cjs +207 -36
- package/Customer.cjs +207 -36
- package/DeadLetterMessage.cjs +207 -36
- package/DecisionMemorySummary.cjs +207 -36
- package/EconomicEvent.cjs +207 -36
- package/EquityBar.cjs +207 -36
- package/Event.cjs +207 -36
- package/EventSnapshot.cjs +207 -36
- package/FeatureImportanceAnalysis.cjs +207 -36
- package/InstitutionalFlowSignal.cjs +207 -36
- package/InstitutionalHolding.cjs +207 -36
- package/InstitutionalSentimentAlerts.cjs +207 -36
- package/InstitutionalSentimentErrors.cjs +207 -36
- package/InstitutionalSentimentHistory.cjs +207 -36
- package/InstitutionalSentimentMetrics.cjs +207 -36
- package/InviteToken.cjs +207 -36
- package/LinkedProvider.cjs +207 -36
- package/LlmConfiguration.cjs +207 -36
- package/MLModelVersion.cjs +207 -36
- package/MLTrainingData.cjs +207 -36
- package/MarketSentiment.cjs +207 -36
- package/ModelArtifact.cjs +207 -36
- package/ModelVersion.cjs +207 -36
- package/ModelVersionArtifact.cjs +207 -36
- package/NewsArticle.cjs +207 -36
- package/NewsArticleAssetSentiment.cjs +207 -36
- package/OptionsContract.cjs +207 -36
- package/OptionsGreeksHistory.cjs +207 -36
- package/OptionsPosition.cjs +207 -36
- package/OptionsPositionEvent.cjs +207 -36
- package/OptionsTradeExecution.cjs +207 -36
- package/PolicyOverlay.cjs +207 -36
- package/PortfolioGreeksHistory.cjs +207 -36
- package/ScheduledOptionOrder.cjs +207 -36
- package/Session.cjs +207 -36
- package/SignalGeneratorMetrics.cjs +207 -36
- package/SignalLineage.cjs +207 -36
- package/SignalOutcome.cjs +207 -36
- package/SignalPriorityQueue.cjs +207 -36
- package/SyncEvent.cjs +207 -36
- package/SystemAlert.cjs +207 -36
- package/Trade.cjs +207 -36
- package/TradeAuditEvent.cjs +207 -36
- package/TradeExecutionHistory.cjs +207 -36
- package/TradeOutcome.cjs +207 -36
- package/TradingPolicy.cjs +207 -36
- package/User.cjs +207 -36
- package/VerificationToken.cjs +207 -36
- package/WaitlistEntry.cjs +207 -36
- package/client.cjs +2 -0
- package/esm/ABTest.d.ts.map +1 -1
- package/esm/ABTest.js.map +1 -1
- package/esm/ABTest.mjs +189 -18
- package/esm/Account.d.ts.map +1 -1
- package/esm/Account.js.map +1 -1
- package/esm/Account.mjs +189 -18
- package/esm/AccountDecisionRecord.d.ts.map +1 -1
- package/esm/AccountDecisionRecord.js.map +1 -1
- package/esm/AccountDecisionRecord.mjs +189 -18
- package/esm/AccountLinkingRequest.d.ts.map +1 -1
- package/esm/AccountLinkingRequest.js.map +1 -1
- package/esm/AccountLinkingRequest.mjs +189 -18
- package/esm/Action.d.ts.map +1 -1
- package/esm/Action.js.map +1 -1
- package/esm/Action.mjs +189 -18
- package/esm/Alert.d.ts.map +1 -1
- package/esm/Alert.js.map +1 -1
- package/esm/Alert.mjs +189 -18
- package/esm/Allocation.d.ts.map +1 -1
- package/esm/Allocation.js.map +1 -1
- package/esm/Allocation.mjs +189 -18
- package/esm/AlpacaAccount.d.ts.map +1 -1
- package/esm/AlpacaAccount.js.map +1 -1
- package/esm/AlpacaAccount.mjs +189 -18
- package/esm/AnalyticsConfiguration.d.ts.map +1 -1
- package/esm/AnalyticsConfiguration.js.map +1 -1
- package/esm/AnalyticsConfiguration.mjs +189 -18
- package/esm/AnalyticsSnapshot.d.ts.map +1 -1
- package/esm/AnalyticsSnapshot.js.map +1 -1
- package/esm/AnalyticsSnapshot.mjs +189 -18
- package/esm/Asset.d.ts.map +1 -1
- package/esm/Asset.js.map +1 -1
- package/esm/Asset.mjs +189 -18
- package/esm/AuditLog.d.ts.map +1 -1
- package/esm/AuditLog.js.map +1 -1
- package/esm/AuditLog.mjs +189 -18
- package/esm/Authenticator.d.ts.map +1 -1
- package/esm/Authenticator.js.map +1 -1
- package/esm/Authenticator.mjs +189 -18
- package/esm/Configuration.d.ts.map +1 -1
- package/esm/Configuration.js.map +1 -1
- package/esm/Configuration.mjs +189 -18
- package/esm/ConflictEvent.d.ts.map +1 -1
- package/esm/ConflictEvent.js.map +1 -1
- package/esm/ConflictEvent.mjs +189 -18
- package/esm/ConnectionHealthSnapshot.d.ts.map +1 -1
- package/esm/ConnectionHealthSnapshot.js.map +1 -1
- package/esm/ConnectionHealthSnapshot.mjs +189 -18
- package/esm/Customer.d.ts.map +1 -1
- package/esm/Customer.js.map +1 -1
- package/esm/Customer.mjs +189 -18
- package/esm/DeadLetterMessage.d.ts.map +1 -1
- package/esm/DeadLetterMessage.js.map +1 -1
- package/esm/DeadLetterMessage.mjs +189 -18
- package/esm/DecisionMemorySummary.d.ts.map +1 -1
- package/esm/DecisionMemorySummary.js.map +1 -1
- package/esm/DecisionMemorySummary.mjs +189 -18
- package/esm/EconomicEvent.d.ts.map +1 -1
- package/esm/EconomicEvent.js.map +1 -1
- package/esm/EconomicEvent.mjs +189 -18
- package/esm/EquityBar.d.ts.map +1 -1
- package/esm/EquityBar.js.map +1 -1
- package/esm/EquityBar.mjs +189 -18
- package/esm/Event.d.ts.map +1 -1
- package/esm/Event.js.map +1 -1
- package/esm/Event.mjs +189 -18
- package/esm/EventSnapshot.d.ts.map +1 -1
- package/esm/EventSnapshot.js.map +1 -1
- package/esm/EventSnapshot.mjs +189 -18
- package/esm/FeatureImportanceAnalysis.d.ts.map +1 -1
- package/esm/FeatureImportanceAnalysis.js.map +1 -1
- package/esm/FeatureImportanceAnalysis.mjs +189 -18
- package/esm/InstitutionalFlowSignal.d.ts.map +1 -1
- package/esm/InstitutionalFlowSignal.js.map +1 -1
- package/esm/InstitutionalFlowSignal.mjs +189 -18
- package/esm/InstitutionalHolding.d.ts.map +1 -1
- package/esm/InstitutionalHolding.js.map +1 -1
- package/esm/InstitutionalHolding.mjs +189 -18
- package/esm/InstitutionalSentimentAlerts.d.ts.map +1 -1
- package/esm/InstitutionalSentimentAlerts.js.map +1 -1
- package/esm/InstitutionalSentimentAlerts.mjs +189 -18
- package/esm/InstitutionalSentimentErrors.d.ts.map +1 -1
- package/esm/InstitutionalSentimentErrors.js.map +1 -1
- package/esm/InstitutionalSentimentErrors.mjs +189 -18
- package/esm/InstitutionalSentimentHistory.d.ts.map +1 -1
- package/esm/InstitutionalSentimentHistory.js.map +1 -1
- package/esm/InstitutionalSentimentHistory.mjs +189 -18
- package/esm/InstitutionalSentimentMetrics.d.ts.map +1 -1
- package/esm/InstitutionalSentimentMetrics.js.map +1 -1
- package/esm/InstitutionalSentimentMetrics.mjs +189 -18
- package/esm/InviteToken.d.ts.map +1 -1
- package/esm/InviteToken.js.map +1 -1
- package/esm/InviteToken.mjs +189 -18
- package/esm/LinkedProvider.d.ts.map +1 -1
- package/esm/LinkedProvider.js.map +1 -1
- package/esm/LinkedProvider.mjs +189 -18
- package/esm/LlmConfiguration.d.ts.map +1 -1
- package/esm/LlmConfiguration.js.map +1 -1
- package/esm/LlmConfiguration.mjs +189 -18
- package/esm/MLModelVersion.d.ts.map +1 -1
- package/esm/MLModelVersion.js.map +1 -1
- package/esm/MLModelVersion.mjs +189 -18
- package/esm/MLTrainingData.d.ts.map +1 -1
- package/esm/MLTrainingData.js.map +1 -1
- package/esm/MLTrainingData.mjs +189 -18
- package/esm/MarketSentiment.d.ts.map +1 -1
- package/esm/MarketSentiment.js.map +1 -1
- package/esm/MarketSentiment.mjs +189 -18
- package/esm/ModelArtifact.d.ts.map +1 -1
- package/esm/ModelArtifact.js.map +1 -1
- package/esm/ModelArtifact.mjs +189 -18
- package/esm/ModelVersion.d.ts.map +1 -1
- package/esm/ModelVersion.js.map +1 -1
- package/esm/ModelVersion.mjs +189 -18
- package/esm/ModelVersionArtifact.d.ts.map +1 -1
- package/esm/ModelVersionArtifact.js.map +1 -1
- package/esm/ModelVersionArtifact.mjs +189 -18
- package/esm/NewsArticle.d.ts.map +1 -1
- package/esm/NewsArticle.js.map +1 -1
- package/esm/NewsArticle.mjs +189 -18
- package/esm/NewsArticleAssetSentiment.d.ts.map +1 -1
- package/esm/NewsArticleAssetSentiment.js.map +1 -1
- package/esm/NewsArticleAssetSentiment.mjs +189 -18
- package/esm/OptionsContract.d.ts.map +1 -1
- package/esm/OptionsContract.js.map +1 -1
- package/esm/OptionsContract.mjs +189 -18
- package/esm/OptionsGreeksHistory.d.ts.map +1 -1
- package/esm/OptionsGreeksHistory.js.map +1 -1
- package/esm/OptionsGreeksHistory.mjs +189 -18
- package/esm/OptionsPosition.d.ts.map +1 -1
- package/esm/OptionsPosition.js.map +1 -1
- package/esm/OptionsPosition.mjs +189 -18
- package/esm/OptionsPositionEvent.d.ts.map +1 -1
- package/esm/OptionsPositionEvent.js.map +1 -1
- package/esm/OptionsPositionEvent.mjs +189 -18
- package/esm/OptionsTradeExecution.d.ts.map +1 -1
- package/esm/OptionsTradeExecution.js.map +1 -1
- package/esm/OptionsTradeExecution.mjs +189 -18
- package/esm/PolicyOverlay.d.ts.map +1 -1
- package/esm/PolicyOverlay.js.map +1 -1
- package/esm/PolicyOverlay.mjs +189 -18
- package/esm/PortfolioGreeksHistory.d.ts.map +1 -1
- package/esm/PortfolioGreeksHistory.js.map +1 -1
- package/esm/PortfolioGreeksHistory.mjs +189 -18
- package/esm/ScheduledOptionOrder.d.ts.map +1 -1
- package/esm/ScheduledOptionOrder.js.map +1 -1
- package/esm/ScheduledOptionOrder.mjs +189 -18
- package/esm/Session.d.ts.map +1 -1
- package/esm/Session.js.map +1 -1
- package/esm/Session.mjs +189 -18
- package/esm/SignalGeneratorMetrics.d.ts.map +1 -1
- package/esm/SignalGeneratorMetrics.js.map +1 -1
- package/esm/SignalGeneratorMetrics.mjs +189 -18
- package/esm/SignalLineage.d.ts.map +1 -1
- package/esm/SignalLineage.js.map +1 -1
- package/esm/SignalLineage.mjs +189 -18
- package/esm/SignalOutcome.d.ts.map +1 -1
- package/esm/SignalOutcome.js.map +1 -1
- package/esm/SignalOutcome.mjs +189 -18
- package/esm/SignalPriorityQueue.d.ts.map +1 -1
- package/esm/SignalPriorityQueue.js.map +1 -1
- package/esm/SignalPriorityQueue.mjs +189 -18
- package/esm/SyncEvent.d.ts.map +1 -1
- package/esm/SyncEvent.js.map +1 -1
- package/esm/SyncEvent.mjs +189 -18
- package/esm/SystemAlert.d.ts.map +1 -1
- package/esm/SystemAlert.js.map +1 -1
- package/esm/SystemAlert.mjs +189 -18
- package/esm/Trade.d.ts.map +1 -1
- package/esm/Trade.js.map +1 -1
- package/esm/Trade.mjs +189 -18
- package/esm/TradeAuditEvent.d.ts.map +1 -1
- package/esm/TradeAuditEvent.js.map +1 -1
- package/esm/TradeAuditEvent.mjs +189 -18
- package/esm/TradeExecutionHistory.d.ts.map +1 -1
- package/esm/TradeExecutionHistory.js.map +1 -1
- package/esm/TradeExecutionHistory.mjs +189 -18
- package/esm/TradeOutcome.d.ts.map +1 -1
- package/esm/TradeOutcome.js.map +1 -1
- package/esm/TradeOutcome.mjs +189 -18
- package/esm/TradingPolicy.d.ts.map +1 -1
- package/esm/TradingPolicy.js.map +1 -1
- package/esm/TradingPolicy.mjs +189 -18
- package/esm/User.d.ts.map +1 -1
- package/esm/User.js.map +1 -1
- package/esm/User.mjs +189 -18
- package/esm/VerificationToken.d.ts.map +1 -1
- package/esm/VerificationToken.js.map +1 -1
- package/esm/VerificationToken.mjs +189 -18
- package/esm/WaitlistEntry.d.ts.map +1 -1
- package/esm/WaitlistEntry.js.map +1 -1
- package/esm/WaitlistEntry.mjs +189 -18
- package/esm/client.d.ts.map +1 -1
- package/esm/client.js.map +1 -1
- package/esm/client.mjs +2 -0
- package/esm/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -33,7 +33,7 @@ exports.TradeExecutionHistory = {
|
|
|
33
33
|
* @returns The created TradeExecutionHistory or null.
|
|
34
34
|
*/
|
|
35
35
|
async create(props, globalClient) {
|
|
36
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
36
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
37
37
|
// Maximum number of retries for database connection issues
|
|
38
38
|
const MAX_RETRIES = 3;
|
|
39
39
|
let retryCount = 0;
|
|
@@ -104,12 +104,31 @@ exports.TradeExecutionHistory = {
|
|
|
104
104
|
});
|
|
105
105
|
throw error;
|
|
106
106
|
}
|
|
107
|
-
// Check if this is a database connection error that we should retry
|
|
107
|
+
// Check if this is a database connection error that we should retry.
|
|
108
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
109
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
110
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
108
111
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
109
112
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
110
113
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
111
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
112
|
-
(
|
|
114
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
115
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
116
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
117
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
118
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
119
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
120
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
121
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
122
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
123
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
124
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
125
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
126
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
127
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
128
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
129
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
130
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
131
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
113
132
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
114
133
|
retryCount++;
|
|
115
134
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -144,7 +163,7 @@ exports.TradeExecutionHistory = {
|
|
|
144
163
|
* @returns The count of created records or null.
|
|
145
164
|
*/
|
|
146
165
|
async createMany(props, globalClient, options) {
|
|
147
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
166
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
148
167
|
// Maximum number of retries for database connection issues
|
|
149
168
|
const MAX_RETRIES = 3;
|
|
150
169
|
let retryCount = 0;
|
|
@@ -214,12 +233,31 @@ exports.TradeExecutionHistory = {
|
|
|
214
233
|
});
|
|
215
234
|
throw error;
|
|
216
235
|
}
|
|
217
|
-
// Check if this is a database connection error that we should retry
|
|
236
|
+
// Check if this is a database connection error that we should retry.
|
|
237
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
238
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
239
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
218
240
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
219
241
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
220
242
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
221
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
222
|
-
(
|
|
243
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
244
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
245
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
246
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
247
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
248
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
249
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
250
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
251
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
252
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
253
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
254
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
255
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
256
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
257
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
258
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
259
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
260
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
223
261
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
224
262
|
retryCount++;
|
|
225
263
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -253,7 +291,7 @@ exports.TradeExecutionHistory = {
|
|
|
253
291
|
* @returns The updated TradeExecutionHistory or null.
|
|
254
292
|
*/
|
|
255
293
|
async update(props, globalClient) {
|
|
256
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
294
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
257
295
|
// Maximum number of retries for database connection issues
|
|
258
296
|
const MAX_RETRIES = 3;
|
|
259
297
|
let retryCount = 0;
|
|
@@ -340,12 +378,31 @@ exports.TradeExecutionHistory = {
|
|
|
340
378
|
});
|
|
341
379
|
throw error;
|
|
342
380
|
}
|
|
343
|
-
// Check if this is a database connection error that we should retry
|
|
381
|
+
// Check if this is a database connection error that we should retry.
|
|
382
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
383
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
384
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
344
385
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
345
386
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
346
387
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
347
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
348
|
-
(
|
|
388
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
389
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
390
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
391
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
392
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
393
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
394
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
395
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
396
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
397
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
398
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
399
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
400
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
401
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
402
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
403
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
404
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
405
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
349
406
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
350
407
|
retryCount++;
|
|
351
408
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -381,7 +438,7 @@ exports.TradeExecutionHistory = {
|
|
|
381
438
|
* @returns The updated TradeExecutionHistory or null.
|
|
382
439
|
*/
|
|
383
440
|
async upsert(props, globalClient) {
|
|
384
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
441
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
385
442
|
// Maximum number of retries for database connection issues
|
|
386
443
|
const MAX_RETRIES = 3;
|
|
387
444
|
let retryCount = 0;
|
|
@@ -470,12 +527,31 @@ exports.TradeExecutionHistory = {
|
|
|
470
527
|
});
|
|
471
528
|
throw error;
|
|
472
529
|
}
|
|
473
|
-
// Check if this is a database connection error that we should retry
|
|
530
|
+
// Check if this is a database connection error that we should retry.
|
|
531
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
532
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
533
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
474
534
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
475
535
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
476
536
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
477
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
478
|
-
(
|
|
537
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
538
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
539
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
540
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
541
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
542
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
543
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
544
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
545
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
546
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
547
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
548
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
549
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
550
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
551
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
552
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
553
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
554
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
479
555
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
480
556
|
retryCount++;
|
|
481
557
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -511,7 +587,7 @@ exports.TradeExecutionHistory = {
|
|
|
511
587
|
* @returns The count of created records or null.
|
|
512
588
|
*/
|
|
513
589
|
async updateMany(props, globalClient) {
|
|
514
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
590
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
515
591
|
// Maximum number of retries for database connection issues
|
|
516
592
|
const MAX_RETRIES = 3;
|
|
517
593
|
let retryCount = 0;
|
|
@@ -597,12 +673,31 @@ exports.TradeExecutionHistory = {
|
|
|
597
673
|
});
|
|
598
674
|
throw error;
|
|
599
675
|
}
|
|
600
|
-
// Check if this is a database connection error that we should retry
|
|
676
|
+
// Check if this is a database connection error that we should retry.
|
|
677
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
678
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
679
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
601
680
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
602
681
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
603
682
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
604
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
605
|
-
(
|
|
683
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
684
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
685
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
686
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
687
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
688
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
689
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
690
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
691
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
692
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
693
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
694
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
695
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
696
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
697
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
698
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
699
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
700
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
606
701
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
607
702
|
retryCount++;
|
|
608
703
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -636,7 +731,7 @@ exports.TradeExecutionHistory = {
|
|
|
636
731
|
* @returns The deleted TradeExecutionHistory or null.
|
|
637
732
|
*/
|
|
638
733
|
async delete(props, globalClient) {
|
|
639
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
734
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7;
|
|
640
735
|
// Maximum number of retries for database connection issues
|
|
641
736
|
const MAX_RETRIES = 3;
|
|
642
737
|
let retryCount = 0;
|
|
@@ -705,12 +800,31 @@ exports.TradeExecutionHistory = {
|
|
|
705
800
|
});
|
|
706
801
|
throw error;
|
|
707
802
|
}
|
|
708
|
-
// Check if this is a database connection error that we should retry
|
|
803
|
+
// Check if this is a database connection error that we should retry.
|
|
804
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
805
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
806
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
709
807
|
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
710
808
|
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
711
809
|
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
712
|
-
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('
|
|
713
|
-
(
|
|
810
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('aborted due to timeout')) ||
|
|
811
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('TimeoutError')) ||
|
|
812
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('fetch failed')) ||
|
|
813
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('socket hang up')) ||
|
|
814
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ECONNRESET')) ||
|
|
815
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('ECONNREFUSED')) ||
|
|
816
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('ETIMEDOUT')) ||
|
|
817
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('Connection pool timeout')) ||
|
|
818
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('P2024')) ||
|
|
819
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 408')) ||
|
|
820
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 502')) ||
|
|
821
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('status code 503')) ||
|
|
822
|
+
((_2 = error.message) === null || _2 === void 0 ? void 0 : _2.includes('status code 504')) ||
|
|
823
|
+
((_3 = error.message) === null || _3 === void 0 ? void 0 : _3.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
824
|
+
(error.networkError && (((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('Failed to fetch')) ||
|
|
825
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('fetch failed')) ||
|
|
826
|
+
((_6 = error.networkError.message) === null || _6 === void 0 ? void 0 : _6.includes('aborted due to timeout')) ||
|
|
827
|
+
((_7 = error.networkError.message) === null || _7 === void 0 ? void 0 : _7.includes('TimeoutError'))));
|
|
714
828
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
715
829
|
retryCount++;
|
|
716
830
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -747,7 +861,7 @@ exports.TradeExecutionHistory = {
|
|
|
747
861
|
* @returns The retrieved TradeExecutionHistory or null.
|
|
748
862
|
*/
|
|
749
863
|
async get(props, globalClient, whereInput) {
|
|
750
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
864
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
751
865
|
// Maximum number of retries for database connection issues
|
|
752
866
|
const MAX_RETRIES = 3;
|
|
753
867
|
let retryCount = 0;
|
|
@@ -789,12 +903,31 @@ exports.TradeExecutionHistory = {
|
|
|
789
903
|
if (error.message === 'No TradeExecutionHistory found') {
|
|
790
904
|
return null;
|
|
791
905
|
}
|
|
792
|
-
// Check if this is a database connection error that we should retry
|
|
906
|
+
// Check if this is a database connection error that we should retry.
|
|
907
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
908
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
909
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
793
910
|
const isConnectionError = ((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('Server has closed the connection')) ||
|
|
794
911
|
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('Cannot reach database server')) ||
|
|
795
912
|
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('Connection timed out')) ||
|
|
796
|
-
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('
|
|
797
|
-
(
|
|
913
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('aborted due to timeout')) ||
|
|
914
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('TimeoutError')) ||
|
|
915
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('fetch failed')) ||
|
|
916
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('socket hang up')) ||
|
|
917
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('ECONNRESET')) ||
|
|
918
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('ECONNREFUSED')) ||
|
|
919
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('ETIMEDOUT')) ||
|
|
920
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Connection pool timeout')) ||
|
|
921
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('P2024')) ||
|
|
922
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('status code 408')) ||
|
|
923
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('status code 502')) ||
|
|
924
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('status code 503')) ||
|
|
925
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('status code 504')) ||
|
|
926
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
927
|
+
(error.networkError && (((_v = error.networkError.message) === null || _v === void 0 ? void 0 : _v.includes('Failed to fetch')) ||
|
|
928
|
+
((_w = error.networkError.message) === null || _w === void 0 ? void 0 : _w.includes('fetch failed')) ||
|
|
929
|
+
((_x = error.networkError.message) === null || _x === void 0 ? void 0 : _x.includes('aborted due to timeout')) ||
|
|
930
|
+
((_y = error.networkError.message) === null || _y === void 0 ? void 0 : _y.includes('TimeoutError'))));
|
|
798
931
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
799
932
|
retryCount++;
|
|
800
933
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -827,7 +960,7 @@ exports.TradeExecutionHistory = {
|
|
|
827
960
|
* @returns An array of TradeExecutionHistory records or null.
|
|
828
961
|
*/
|
|
829
962
|
async getAll(globalClient) {
|
|
830
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
963
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
831
964
|
// Maximum number of retries for database connection issues
|
|
832
965
|
const MAX_RETRIES = 3;
|
|
833
966
|
let retryCount = 0;
|
|
@@ -862,12 +995,31 @@ exports.TradeExecutionHistory = {
|
|
|
862
995
|
if (error.message === 'No TradeExecutionHistory found') {
|
|
863
996
|
return null;
|
|
864
997
|
}
|
|
865
|
-
// Check if this is a database connection error that we should retry
|
|
998
|
+
// Check if this is a database connection error that we should retry.
|
|
999
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
1000
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
1001
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
866
1002
|
const isConnectionError = ((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('Server has closed the connection')) ||
|
|
867
1003
|
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('Cannot reach database server')) ||
|
|
868
1004
|
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('Connection timed out')) ||
|
|
869
|
-
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('
|
|
870
|
-
(
|
|
1005
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('aborted due to timeout')) ||
|
|
1006
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('TimeoutError')) ||
|
|
1007
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('fetch failed')) ||
|
|
1008
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('socket hang up')) ||
|
|
1009
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('ECONNRESET')) ||
|
|
1010
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('ECONNREFUSED')) ||
|
|
1011
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('ETIMEDOUT')) ||
|
|
1012
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Connection pool timeout')) ||
|
|
1013
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('P2024')) ||
|
|
1014
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('status code 408')) ||
|
|
1015
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('status code 502')) ||
|
|
1016
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('status code 503')) ||
|
|
1017
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('status code 504')) ||
|
|
1018
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1019
|
+
(error.networkError && (((_v = error.networkError.message) === null || _v === void 0 ? void 0 : _v.includes('Failed to fetch')) ||
|
|
1020
|
+
((_w = error.networkError.message) === null || _w === void 0 ? void 0 : _w.includes('fetch failed')) ||
|
|
1021
|
+
((_x = error.networkError.message) === null || _x === void 0 ? void 0 : _x.includes('aborted due to timeout')) ||
|
|
1022
|
+
((_y = error.networkError.message) === null || _y === void 0 ? void 0 : _y.includes('TimeoutError'))));
|
|
871
1023
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
872
1024
|
retryCount++;
|
|
873
1025
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -902,7 +1054,7 @@ exports.TradeExecutionHistory = {
|
|
|
902
1054
|
* @returns An array of found TradeExecutionHistory records or null.
|
|
903
1055
|
*/
|
|
904
1056
|
async findMany(props, globalClient, whereInput) {
|
|
905
|
-
var _a, _b, _c, _d, _e;
|
|
1057
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
906
1058
|
// Maximum number of retries for database connection issues
|
|
907
1059
|
const MAX_RETRIES = 3;
|
|
908
1060
|
let retryCount = 0;
|
|
@@ -956,12 +1108,31 @@ exports.TradeExecutionHistory = {
|
|
|
956
1108
|
if (error.message === 'No TradeExecutionHistory found') {
|
|
957
1109
|
return null;
|
|
958
1110
|
}
|
|
959
|
-
// Check if this is a database connection error that we should retry
|
|
1111
|
+
// Check if this is a database connection error that we should retry.
|
|
1112
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
1113
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
1114
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
960
1115
|
const isConnectionError = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('Server has closed the connection')) ||
|
|
961
1116
|
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('Cannot reach database server')) ||
|
|
962
1117
|
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('Connection timed out')) ||
|
|
963
|
-
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('
|
|
964
|
-
(
|
|
1118
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('aborted due to timeout')) ||
|
|
1119
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('TimeoutError')) ||
|
|
1120
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('fetch failed')) ||
|
|
1121
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('socket hang up')) ||
|
|
1122
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('ECONNRESET')) ||
|
|
1123
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('ECONNREFUSED')) ||
|
|
1124
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('ETIMEDOUT')) ||
|
|
1125
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Connection pool timeout')) ||
|
|
1126
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('P2024')) ||
|
|
1127
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('status code 408')) ||
|
|
1128
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('status code 502')) ||
|
|
1129
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('status code 503')) ||
|
|
1130
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('status code 504')) ||
|
|
1131
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1132
|
+
(error.networkError && (((_t = error.networkError.message) === null || _t === void 0 ? void 0 : _t.includes('Failed to fetch')) ||
|
|
1133
|
+
((_u = error.networkError.message) === null || _u === void 0 ? void 0 : _u.includes('fetch failed')) ||
|
|
1134
|
+
((_v = error.networkError.message) === null || _v === void 0 ? void 0 : _v.includes('aborted due to timeout')) ||
|
|
1135
|
+
((_w = error.networkError.message) === null || _w === void 0 ? void 0 : _w.includes('TimeoutError'))));
|
|
965
1136
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
966
1137
|
retryCount++;
|
|
967
1138
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|