@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
package/SystemAlert.cjs
CHANGED
|
@@ -49,7 +49,7 @@ exports.SystemAlert = {
|
|
|
49
49
|
* @returns The created SystemAlert or null.
|
|
50
50
|
*/
|
|
51
51
|
async create(props, globalClient) {
|
|
52
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
52
|
+
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;
|
|
53
53
|
// Maximum number of retries for database connection issues
|
|
54
54
|
const MAX_RETRIES = 3;
|
|
55
55
|
let retryCount = 0;
|
|
@@ -134,12 +134,31 @@ exports.SystemAlert = {
|
|
|
134
134
|
});
|
|
135
135
|
throw error;
|
|
136
136
|
}
|
|
137
|
-
// Check if this is a database connection error that we should retry
|
|
137
|
+
// Check if this is a database connection error that we should retry.
|
|
138
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
139
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
140
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
138
141
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
139
142
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
140
143
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
141
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
142
|
-
(
|
|
144
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
145
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
146
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
147
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
148
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
149
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
150
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
151
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
152
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
153
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
154
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
155
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
156
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
157
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
158
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
159
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
160
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
161
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
143
162
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
144
163
|
retryCount++;
|
|
145
164
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -174,7 +193,7 @@ exports.SystemAlert = {
|
|
|
174
193
|
* @returns The count of created records or null.
|
|
175
194
|
*/
|
|
176
195
|
async createMany(props, globalClient, options) {
|
|
177
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
196
|
+
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;
|
|
178
197
|
// Maximum number of retries for database connection issues
|
|
179
198
|
const MAX_RETRIES = 3;
|
|
180
199
|
let retryCount = 0;
|
|
@@ -258,12 +277,31 @@ exports.SystemAlert = {
|
|
|
258
277
|
});
|
|
259
278
|
throw error;
|
|
260
279
|
}
|
|
261
|
-
// Check if this is a database connection error that we should retry
|
|
280
|
+
// Check if this is a database connection error that we should retry.
|
|
281
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
282
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
283
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
262
284
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
263
285
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
264
286
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
265
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
266
|
-
(
|
|
287
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
288
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
289
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
290
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
291
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
292
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
293
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
294
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
295
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
296
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
297
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
298
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
299
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
300
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
301
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
302
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
303
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
304
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
267
305
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
268
306
|
retryCount++;
|
|
269
307
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -297,7 +335,7 @@ exports.SystemAlert = {
|
|
|
297
335
|
* @returns The updated SystemAlert or null.
|
|
298
336
|
*/
|
|
299
337
|
async update(props, globalClient) {
|
|
300
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
338
|
+
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;
|
|
301
339
|
// Maximum number of retries for database connection issues
|
|
302
340
|
const MAX_RETRIES = 3;
|
|
303
341
|
let retryCount = 0;
|
|
@@ -428,12 +466,31 @@ exports.SystemAlert = {
|
|
|
428
466
|
});
|
|
429
467
|
throw error;
|
|
430
468
|
}
|
|
431
|
-
// Check if this is a database connection error that we should retry
|
|
469
|
+
// Check if this is a database connection error that we should retry.
|
|
470
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
471
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
472
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
432
473
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
433
474
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
434
475
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
435
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
436
|
-
(
|
|
476
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
477
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
478
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
479
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
480
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
481
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
482
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
483
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
484
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
485
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
486
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
487
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
488
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
489
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
490
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
491
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
492
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
493
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
437
494
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
438
495
|
retryCount++;
|
|
439
496
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -469,7 +526,7 @@ exports.SystemAlert = {
|
|
|
469
526
|
* @returns The updated SystemAlert or null.
|
|
470
527
|
*/
|
|
471
528
|
async upsert(props, globalClient) {
|
|
472
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
529
|
+
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;
|
|
473
530
|
// Maximum number of retries for database connection issues
|
|
474
531
|
const MAX_RETRIES = 3;
|
|
475
532
|
let retryCount = 0;
|
|
@@ -625,12 +682,31 @@ exports.SystemAlert = {
|
|
|
625
682
|
});
|
|
626
683
|
throw error;
|
|
627
684
|
}
|
|
628
|
-
// Check if this is a database connection error that we should retry
|
|
685
|
+
// Check if this is a database connection error that we should retry.
|
|
686
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
687
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
688
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
629
689
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
630
690
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
631
691
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
632
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
633
|
-
(
|
|
692
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
693
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
694
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
695
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
696
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
697
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
698
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
699
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
700
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
701
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
702
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
703
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
704
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
705
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
706
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
707
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
708
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
709
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
634
710
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
635
711
|
retryCount++;
|
|
636
712
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -666,7 +742,7 @@ exports.SystemAlert = {
|
|
|
666
742
|
* @returns The count of created records or null.
|
|
667
743
|
*/
|
|
668
744
|
async updateMany(props, globalClient) {
|
|
669
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
745
|
+
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;
|
|
670
746
|
// Maximum number of retries for database connection issues
|
|
671
747
|
const MAX_RETRIES = 3;
|
|
672
748
|
let retryCount = 0;
|
|
@@ -796,12 +872,31 @@ exports.SystemAlert = {
|
|
|
796
872
|
});
|
|
797
873
|
throw error;
|
|
798
874
|
}
|
|
799
|
-
// Check if this is a database connection error that we should retry
|
|
875
|
+
// Check if this is a database connection error that we should retry.
|
|
876
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
877
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
878
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
800
879
|
const isConnectionError = ((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('Server has closed the connection')) ||
|
|
801
880
|
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Cannot reach database server')) ||
|
|
802
881
|
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Connection timed out')) ||
|
|
803
|
-
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('
|
|
804
|
-
(
|
|
882
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('aborted due to timeout')) ||
|
|
883
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('TimeoutError')) ||
|
|
884
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('fetch failed')) ||
|
|
885
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('socket hang up')) ||
|
|
886
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('ECONNRESET')) ||
|
|
887
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('ECONNREFUSED')) ||
|
|
888
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ETIMEDOUT')) ||
|
|
889
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('Connection pool timeout')) ||
|
|
890
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('P2024')) ||
|
|
891
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('status code 408')) ||
|
|
892
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('status code 502')) ||
|
|
893
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 503')) ||
|
|
894
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 504')) ||
|
|
895
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
896
|
+
(error.networkError && (((_2 = error.networkError.message) === null || _2 === void 0 ? void 0 : _2.includes('Failed to fetch')) ||
|
|
897
|
+
((_3 = error.networkError.message) === null || _3 === void 0 ? void 0 : _3.includes('fetch failed')) ||
|
|
898
|
+
((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('aborted due to timeout')) ||
|
|
899
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('TimeoutError'))));
|
|
805
900
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
806
901
|
retryCount++;
|
|
807
902
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -835,7 +930,7 @@ exports.SystemAlert = {
|
|
|
835
930
|
* @returns The deleted SystemAlert or null.
|
|
836
931
|
*/
|
|
837
932
|
async delete(props, globalClient) {
|
|
838
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
933
|
+
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;
|
|
839
934
|
// Maximum number of retries for database connection issues
|
|
840
935
|
const MAX_RETRIES = 3;
|
|
841
936
|
let retryCount = 0;
|
|
@@ -904,12 +999,31 @@ exports.SystemAlert = {
|
|
|
904
999
|
});
|
|
905
1000
|
throw error;
|
|
906
1001
|
}
|
|
907
|
-
// Check if this is a database connection error that we should retry
|
|
1002
|
+
// Check if this is a database connection error that we should retry.
|
|
1003
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
1004
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
1005
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
908
1006
|
const isConnectionError = ((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('Server has closed the connection')) ||
|
|
909
1007
|
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Cannot reach database server')) ||
|
|
910
1008
|
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('Connection timed out')) ||
|
|
911
|
-
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('
|
|
912
|
-
(
|
|
1009
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('aborted due to timeout')) ||
|
|
1010
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('TimeoutError')) ||
|
|
1011
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('fetch failed')) ||
|
|
1012
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('socket hang up')) ||
|
|
1013
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('ECONNRESET')) ||
|
|
1014
|
+
((_v = error.message) === null || _v === void 0 ? void 0 : _v.includes('ECONNREFUSED')) ||
|
|
1015
|
+
((_w = error.message) === null || _w === void 0 ? void 0 : _w.includes('ETIMEDOUT')) ||
|
|
1016
|
+
((_x = error.message) === null || _x === void 0 ? void 0 : _x.includes('Connection pool timeout')) ||
|
|
1017
|
+
((_y = error.message) === null || _y === void 0 ? void 0 : _y.includes('P2024')) ||
|
|
1018
|
+
((_z = error.message) === null || _z === void 0 ? void 0 : _z.includes('status code 408')) ||
|
|
1019
|
+
((_0 = error.message) === null || _0 === void 0 ? void 0 : _0.includes('status code 502')) ||
|
|
1020
|
+
((_1 = error.message) === null || _1 === void 0 ? void 0 : _1.includes('status code 503')) ||
|
|
1021
|
+
((_2 = error.message) === null || _2 === void 0 ? void 0 : _2.includes('status code 504')) ||
|
|
1022
|
+
((_3 = error.message) === null || _3 === void 0 ? void 0 : _3.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1023
|
+
(error.networkError && (((_4 = error.networkError.message) === null || _4 === void 0 ? void 0 : _4.includes('Failed to fetch')) ||
|
|
1024
|
+
((_5 = error.networkError.message) === null || _5 === void 0 ? void 0 : _5.includes('fetch failed')) ||
|
|
1025
|
+
((_6 = error.networkError.message) === null || _6 === void 0 ? void 0 : _6.includes('aborted due to timeout')) ||
|
|
1026
|
+
((_7 = error.networkError.message) === null || _7 === void 0 ? void 0 : _7.includes('TimeoutError'))));
|
|
913
1027
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
914
1028
|
retryCount++;
|
|
915
1029
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -946,7 +1060,7 @@ exports.SystemAlert = {
|
|
|
946
1060
|
* @returns The retrieved SystemAlert or null.
|
|
947
1061
|
*/
|
|
948
1062
|
async get(props, globalClient, whereInput) {
|
|
949
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1063
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
950
1064
|
// Maximum number of retries for database connection issues
|
|
951
1065
|
const MAX_RETRIES = 3;
|
|
952
1066
|
let retryCount = 0;
|
|
@@ -1000,12 +1114,31 @@ exports.SystemAlert = {
|
|
|
1000
1114
|
if (error.message === 'No SystemAlert found') {
|
|
1001
1115
|
return null;
|
|
1002
1116
|
}
|
|
1003
|
-
// Check if this is a database connection error that we should retry
|
|
1117
|
+
// Check if this is a database connection error that we should retry.
|
|
1118
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
1119
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
1120
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
1004
1121
|
const isConnectionError = ((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('Server has closed the connection')) ||
|
|
1005
1122
|
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('Cannot reach database server')) ||
|
|
1006
1123
|
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('Connection timed out')) ||
|
|
1007
|
-
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('
|
|
1008
|
-
(
|
|
1124
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('aborted due to timeout')) ||
|
|
1125
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('TimeoutError')) ||
|
|
1126
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('fetch failed')) ||
|
|
1127
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('socket hang up')) ||
|
|
1128
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('ECONNRESET')) ||
|
|
1129
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('ECONNREFUSED')) ||
|
|
1130
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('ETIMEDOUT')) ||
|
|
1131
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Connection pool timeout')) ||
|
|
1132
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('P2024')) ||
|
|
1133
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('status code 408')) ||
|
|
1134
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('status code 502')) ||
|
|
1135
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('status code 503')) ||
|
|
1136
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('status code 504')) ||
|
|
1137
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1138
|
+
(error.networkError && (((_v = error.networkError.message) === null || _v === void 0 ? void 0 : _v.includes('Failed to fetch')) ||
|
|
1139
|
+
((_w = error.networkError.message) === null || _w === void 0 ? void 0 : _w.includes('fetch failed')) ||
|
|
1140
|
+
((_x = error.networkError.message) === null || _x === void 0 ? void 0 : _x.includes('aborted due to timeout')) ||
|
|
1141
|
+
((_y = error.networkError.message) === null || _y === void 0 ? void 0 : _y.includes('TimeoutError'))));
|
|
1009
1142
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1010
1143
|
retryCount++;
|
|
1011
1144
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -1038,7 +1171,7 @@ exports.SystemAlert = {
|
|
|
1038
1171
|
* @returns An array of SystemAlert records or null.
|
|
1039
1172
|
*/
|
|
1040
1173
|
async getAll(globalClient) {
|
|
1041
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
1174
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
1042
1175
|
// Maximum number of retries for database connection issues
|
|
1043
1176
|
const MAX_RETRIES = 3;
|
|
1044
1177
|
let retryCount = 0;
|
|
@@ -1073,12 +1206,31 @@ exports.SystemAlert = {
|
|
|
1073
1206
|
if (error.message === 'No SystemAlert found') {
|
|
1074
1207
|
return null;
|
|
1075
1208
|
}
|
|
1076
|
-
// Check if this is a database connection error that we should retry
|
|
1209
|
+
// Check if this is a database connection error that we should retry.
|
|
1210
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
1211
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
1212
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
1077
1213
|
const isConnectionError = ((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('Server has closed the connection')) ||
|
|
1078
1214
|
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('Cannot reach database server')) ||
|
|
1079
1215
|
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('Connection timed out')) ||
|
|
1080
|
-
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('
|
|
1081
|
-
(
|
|
1216
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('aborted due to timeout')) ||
|
|
1217
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('TimeoutError')) ||
|
|
1218
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('fetch failed')) ||
|
|
1219
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('socket hang up')) ||
|
|
1220
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('ECONNRESET')) ||
|
|
1221
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('ECONNREFUSED')) ||
|
|
1222
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('ETIMEDOUT')) ||
|
|
1223
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('Connection pool timeout')) ||
|
|
1224
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('P2024')) ||
|
|
1225
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('status code 408')) ||
|
|
1226
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('status code 502')) ||
|
|
1227
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('status code 503')) ||
|
|
1228
|
+
((_t = error.message) === null || _t === void 0 ? void 0 : _t.includes('status code 504')) ||
|
|
1229
|
+
((_u = error.message) === null || _u === void 0 ? void 0 : _u.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1230
|
+
(error.networkError && (((_v = error.networkError.message) === null || _v === void 0 ? void 0 : _v.includes('Failed to fetch')) ||
|
|
1231
|
+
((_w = error.networkError.message) === null || _w === void 0 ? void 0 : _w.includes('fetch failed')) ||
|
|
1232
|
+
((_x = error.networkError.message) === null || _x === void 0 ? void 0 : _x.includes('aborted due to timeout')) ||
|
|
1233
|
+
((_y = error.networkError.message) === null || _y === void 0 ? void 0 : _y.includes('TimeoutError'))));
|
|
1082
1234
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1083
1235
|
retryCount++;
|
|
1084
1236
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|
|
@@ -1113,7 +1265,7 @@ exports.SystemAlert = {
|
|
|
1113
1265
|
* @returns An array of found SystemAlert records or null.
|
|
1114
1266
|
*/
|
|
1115
1267
|
async findMany(props, globalClient, whereInput) {
|
|
1116
|
-
var _a, _b, _c, _d, _e;
|
|
1268
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
1117
1269
|
// Maximum number of retries for database connection issues
|
|
1118
1270
|
const MAX_RETRIES = 3;
|
|
1119
1271
|
let retryCount = 0;
|
|
@@ -1179,12 +1331,31 @@ exports.SystemAlert = {
|
|
|
1179
1331
|
if (error.message === 'No SystemAlert found') {
|
|
1180
1332
|
return null;
|
|
1181
1333
|
}
|
|
1182
|
-
// Check if this is a database connection error that we should retry
|
|
1334
|
+
// Check if this is a database connection error that we should retry.
|
|
1335
|
+
// Covers undici/fetch timeouts, Prisma Accelerate transients, connection
|
|
1336
|
+
// pool exhaustion, and transient gateway statuses. Must stay consistent
|
|
1337
|
+
// with the transient classifier in client.ts (onError link + enqueueOperation).
|
|
1183
1338
|
const isConnectionError = ((_a = error.message) === null || _a === void 0 ? void 0 : _a.includes('Server has closed the connection')) ||
|
|
1184
1339
|
((_b = error.message) === null || _b === void 0 ? void 0 : _b.includes('Cannot reach database server')) ||
|
|
1185
1340
|
((_c = error.message) === null || _c === void 0 ? void 0 : _c.includes('Connection timed out')) ||
|
|
1186
|
-
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('
|
|
1187
|
-
(
|
|
1341
|
+
((_d = error.message) === null || _d === void 0 ? void 0 : _d.includes('aborted due to timeout')) ||
|
|
1342
|
+
((_e = error.message) === null || _e === void 0 ? void 0 : _e.includes('TimeoutError')) ||
|
|
1343
|
+
((_f = error.message) === null || _f === void 0 ? void 0 : _f.includes('fetch failed')) ||
|
|
1344
|
+
((_g = error.message) === null || _g === void 0 ? void 0 : _g.includes('socket hang up')) ||
|
|
1345
|
+
((_h = error.message) === null || _h === void 0 ? void 0 : _h.includes('ECONNRESET')) ||
|
|
1346
|
+
((_j = error.message) === null || _j === void 0 ? void 0 : _j.includes('ECONNREFUSED')) ||
|
|
1347
|
+
((_k = error.message) === null || _k === void 0 ? void 0 : _k.includes('ETIMEDOUT')) ||
|
|
1348
|
+
((_l = error.message) === null || _l === void 0 ? void 0 : _l.includes('Connection pool timeout')) ||
|
|
1349
|
+
((_m = error.message) === null || _m === void 0 ? void 0 : _m.includes('P2024')) ||
|
|
1350
|
+
((_o = error.message) === null || _o === void 0 ? void 0 : _o.includes('status code 408')) ||
|
|
1351
|
+
((_p = error.message) === null || _p === void 0 ? void 0 : _p.includes('status code 502')) ||
|
|
1352
|
+
((_q = error.message) === null || _q === void 0 ? void 0 : _q.includes('status code 503')) ||
|
|
1353
|
+
((_r = error.message) === null || _r === void 0 ? void 0 : _r.includes('status code 504')) ||
|
|
1354
|
+
((_s = error.message) === null || _s === void 0 ? void 0 : _s.includes('Accelerate')) || // Prisma Accelerate proxy errors
|
|
1355
|
+
(error.networkError && (((_t = error.networkError.message) === null || _t === void 0 ? void 0 : _t.includes('Failed to fetch')) ||
|
|
1356
|
+
((_u = error.networkError.message) === null || _u === void 0 ? void 0 : _u.includes('fetch failed')) ||
|
|
1357
|
+
((_v = error.networkError.message) === null || _v === void 0 ? void 0 : _v.includes('aborted due to timeout')) ||
|
|
1358
|
+
((_w = error.networkError.message) === null || _w === void 0 ? void 0 : _w.includes('TimeoutError'))));
|
|
1188
1359
|
if (isConnectionError && retryCount < MAX_RETRIES - 1) {
|
|
1189
1360
|
retryCount++;
|
|
1190
1361
|
const delay = Math.pow(2, retryCount) * 100; // Exponential backoff: 200ms, 400ms, 800ms
|