@dvmkit/sdk 0.1.0-rc.2 → 0.1.0-rc.4
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/README.md +10 -2
- package/dist/{revenue-reporter-GB4WKLDC.js → chunk-2ABMGUDS.js} +1 -0
- package/dist/chunk-2K6UXDAN.js +1557 -0
- package/dist/chunk-4UVRXDNY.js +21745 -0
- package/dist/chunk-66HGCPBU.js +25 -0
- package/dist/{chunk-DCNT4PJS.js → chunk-AAJNGQMC.js} +6 -258
- package/dist/{chunk-KQAJVVZT.js → chunk-AZBXSXQT.js} +27 -287
- package/dist/{chunk-H25M54MI.js → chunk-C3MTFLC6.js} +16 -0
- package/dist/chunk-EDU6COY2.js +1057 -0
- package/dist/{chunk-OJ5WFIB2.js → chunk-EXHBXA4U.js} +1 -1
- package/dist/chunk-F2L6KIMD.js +380 -0
- package/dist/{chunk-KXWROQGK.js → chunk-FUJ36YDV.js} +1 -24
- package/dist/chunk-GJD7PVWY.js +1090 -0
- package/dist/{tempo-charge-store-6GJEMNUU.js → chunk-JZWELPFH.js} +1 -0
- package/dist/{chunk-365P52XQ.js → chunk-LWUR4CGG.js} +2 -1
- package/dist/{tempo-session-store-FTEEGZXA.js → chunk-RU7SXHLO.js} +2 -1
- package/dist/{chunk-7IH5SG2A.js → chunk-TKA6ZP4M.js} +62 -41
- package/dist/chunk-TVI4V7GF.js +283 -0
- package/dist/{payout-reporter-4TNWRS5F.js → chunk-X3IKFWJA.js} +3 -2
- package/dist/chunk-XYTSDAPH.js +232 -0
- package/dist/{credit-ledger-RO4FGSHG.js → credit-ledger-ED6JXKVD.js} +2 -2
- package/dist/credit-menu-ClA1JyYW.d.ts +5076 -0
- package/dist/{ssrf-DZi-xJyn.d.ts → fx-ptKVFOwq.d.ts} +37 -119
- package/dist/index.d.ts +8 -66
- package/dist/index.js +11 -219
- package/dist/internal/index.d.ts +5896 -0
- package/dist/internal/index.js +6407 -0
- package/dist/{job-store-6gR4pZRP.d.ts → job-store-DxFqDPYq.d.ts} +1498 -12
- package/dist/{memory-credit-ledger-I2G64DDK.js → memory-credit-ledger-XJ5VQEVP.js} +3 -3
- package/dist/payout-reporter-3UB5WRCV.js +13 -0
- package/dist/revenue-reporter-JIKUPXOK.js +7 -0
- package/dist/server/index.d.ts +14 -3590
- package/dist/server/index.js +155 -20850
- package/dist/ssrf-DbFkpDv0.d.ts +118 -0
- package/dist/tempo-charge-store-RIFTALZK.js +8 -0
- package/dist/tempo-session-store-DALMRIWN.js +11 -0
- package/dist/testing/index.d.ts +3 -2
- package/dist/testing/index.js +3 -2
- package/dist/usd-Cha_j80I.d.ts +97 -0
- package/dist/x402-XXFQQAAD.js +81 -0
- package/package.json +6 -2
- package/dist/x402-35VLYFKZ.js +0 -1272
|
@@ -11,6 +11,21 @@ function isTransportError(err) {
|
|
|
11
11
|
if (typeof code === "string" && /^[0-9A-Z]{5}$/.test(code)) return false;
|
|
12
12
|
return typeof msg === "string" && msg.includes("Connection terminated") || code === "ECONNRESET" || code === "ENOTFOUND";
|
|
13
13
|
}
|
|
14
|
+
async function withInitRetry(fn, label, delays = [1e3, 4e3, 15e3]) {
|
|
15
|
+
for (let attempt = 0; ; attempt++) {
|
|
16
|
+
try {
|
|
17
|
+
await fn();
|
|
18
|
+
return;
|
|
19
|
+
} catch (err) {
|
|
20
|
+
if (!isTransportError(err) || attempt >= delays.length) throw err;
|
|
21
|
+
const wait = delays[attempt];
|
|
22
|
+
console.warn(
|
|
23
|
+
`[${label}] DB init attempt ${attempt + 1} failed (${err.message}), retrying in ${wait / 1e3}s`
|
|
24
|
+
);
|
|
25
|
+
await new Promise((resolve) => setTimeout(resolve, wait));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
14
29
|
var POSTGRES_APPLICATION_NAME_MAX_BYTES = 63;
|
|
15
30
|
function formatPostgresApplicationName(label, machineId = process.env.FLY_MACHINE_ID) {
|
|
16
31
|
const machineSuffix = machineId ? `@${machineId}` : "";
|
|
@@ -144,6 +159,7 @@ function truncateUtf8(value, maxBytes) {
|
|
|
144
159
|
|
|
145
160
|
export {
|
|
146
161
|
withPostgresRecoveryContext,
|
|
162
|
+
withInitRetry,
|
|
147
163
|
applyRetryToPool,
|
|
148
164
|
withPostgresTransactionRecovery
|
|
149
165
|
};
|