@stacksjs/ts-cloud 0.7.41 → 0.7.43
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/dist/aws/index.js +1 -1
- package/dist/bin/cli.js +268 -268
- package/dist/{chunk-d2p5n2aq.js → chunk-5snr8g8q.js} +2 -2
- package/dist/{chunk-tt4kxske.js → chunk-602g36gf.js} +49 -18
- package/dist/{chunk-5pf5n3x1.js → chunk-7z3tf1mj.js} +1 -1
- package/dist/{chunk-d7p84vz5.js → chunk-9n57qng8.js} +3 -3
- package/dist/deploy/index.js +3 -3
- package/dist/dns/index.js +1 -1
- package/dist/index.js +3 -3
- package/dist/ui/index.html +3 -3
- package/dist/ui/server/actions.html +3 -3
- package/dist/ui/server/backups.html +3 -3
- package/dist/ui/server/database.html +3 -3
- package/dist/ui/server/deployments.html +3 -3
- package/dist/ui/server/firewall.html +3 -3
- package/dist/ui/server/logs.html +3 -3
- package/dist/ui/server/services.html +3 -3
- package/dist/ui/server/sites.html +3 -3
- package/dist/ui/server/ssh-keys.html +3 -3
- package/dist/ui/server/team.html +3 -3
- package/dist/ui/server/terminal.html +3 -3
- package/dist/ui/server/workers.html +3 -3
- package/dist/ui/serverless/alarms.html +3 -3
- package/dist/ui/serverless/assets.html +3 -3
- package/dist/ui/serverless/data.html +3 -3
- package/dist/ui/serverless/deployments.html +3 -3
- package/dist/ui/serverless/functions.html +3 -3
- package/dist/ui/serverless/logs.html +3 -3
- package/dist/ui/serverless/queues.html +3 -3
- package/dist/ui/serverless/scheduler.html +3 -3
- package/dist/ui/serverless/secrets.html +3 -3
- package/dist/ui/serverless/traces.html +3 -3
- package/dist/ui/serverless.html +3 -3
- package/package.json +3 -3
|
@@ -5,9 +5,9 @@ import {
|
|
|
5
5
|
generateStaticSiteTemplate,
|
|
6
6
|
invalidateCache,
|
|
7
7
|
uploadStaticFiles
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-9n57qng8.js";
|
|
9
9
|
import"./chunk-tjjgajbh.js";
|
|
10
|
-
import"./chunk-
|
|
10
|
+
import"./chunk-602g36gf.js";
|
|
11
11
|
import"./chunk-tnztxpcb.js";
|
|
12
12
|
import"./chunk-qpj3edwz.js";
|
|
13
13
|
import"./chunk-vd87cpvn.js";
|
|
@@ -6,6 +6,16 @@ import {
|
|
|
6
6
|
} from "./chunk-arsh1g5h.js";
|
|
7
7
|
// src/dns/porkbun.ts
|
|
8
8
|
var PORKBUN_API_URL = "https://api.porkbun.com/api/json/v3";
|
|
9
|
+
var PORKBUN_MAX_ATTEMPTS = 8;
|
|
10
|
+
function isRetryablePorkbunResponse(status, message = "") {
|
|
11
|
+
return status === 408 || status === 409 || status === 425 || status === 429 || status >= 500 || /rate limit|temporar|timed? ?out|try again/i.test(message);
|
|
12
|
+
}
|
|
13
|
+
async function waitForPorkbunRetry(attempt, response) {
|
|
14
|
+
const retryAfter = response?.headers.get("retry-after");
|
|
15
|
+
const retryAfterMs = retryAfter === null || retryAfter === undefined ? undefined : Number(retryAfter) * 1000;
|
|
16
|
+
const delay = Number.isFinite(retryAfterMs) ? Math.max(0, retryAfterMs) : Math.min(1000 * 2 ** (attempt - 1), 30000);
|
|
17
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
18
|
+
}
|
|
9
19
|
|
|
10
20
|
class PorkbunProvider {
|
|
11
21
|
name = "porkbun";
|
|
@@ -16,25 +26,46 @@ class PorkbunProvider {
|
|
|
16
26
|
this.secretKey = secretKey;
|
|
17
27
|
}
|
|
18
28
|
async request(endpoint, additionalBody = {}) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
let lastError;
|
|
30
|
+
for (let attempt = 1;attempt <= PORKBUN_MAX_ATTEMPTS; attempt += 1) {
|
|
31
|
+
let response;
|
|
32
|
+
try {
|
|
33
|
+
response = await fetch(`${PORKBUN_API_URL}${endpoint}`, {
|
|
34
|
+
method: "POST",
|
|
35
|
+
headers: {
|
|
36
|
+
"Content-Type": "application/json"
|
|
37
|
+
},
|
|
38
|
+
body: JSON.stringify({
|
|
39
|
+
apikey: this.apiKey,
|
|
40
|
+
secretapikey: this.secretKey,
|
|
41
|
+
...additionalBody
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
} catch (error) {
|
|
45
|
+
lastError = error;
|
|
46
|
+
if (attempt === PORKBUN_MAX_ATTEMPTS)
|
|
47
|
+
throw error;
|
|
48
|
+
await waitForPorkbunRetry(attempt);
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
if (!response.ok) {
|
|
52
|
+
lastError = new Error(`Porkbun API error: ${response.status} ${response.statusText}`);
|
|
53
|
+
if (!isRetryablePorkbunResponse(response.status) || attempt === PORKBUN_MAX_ATTEMPTS)
|
|
54
|
+
throw lastError;
|
|
55
|
+
await waitForPorkbunRetry(attempt, response);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const data = await response.json();
|
|
59
|
+
if (data.status === "ERROR") {
|
|
60
|
+
lastError = new Error(`Porkbun API error: ${data.message || "Unknown error"}`);
|
|
61
|
+
if (!isRetryablePorkbunResponse(0, data.message) || attempt === PORKBUN_MAX_ATTEMPTS)
|
|
62
|
+
throw lastError;
|
|
63
|
+
await waitForPorkbunRetry(attempt, response);
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
return data;
|
|
36
67
|
}
|
|
37
|
-
|
|
68
|
+
throw lastError;
|
|
38
69
|
}
|
|
39
70
|
getSubdomain(recordName, domain) {
|
|
40
71
|
const cleanName = recordName.replace(/\.$/, "");
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
Route53Provider,
|
|
8
8
|
UnifiedDnsValidator,
|
|
9
9
|
createDnsProvider
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-602g36gf.js";
|
|
11
11
|
import {
|
|
12
12
|
Route53Client
|
|
13
13
|
} from "./chunk-tnztxpcb.js";
|
|
@@ -813,7 +813,7 @@ async function deployStaticSiteWithExternalDnsFull(config) {
|
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
815
|
onProgress?.("upload", "Uploading files to S3...");
|
|
816
|
-
const { uploadStaticFiles } = await import("./chunk-
|
|
816
|
+
const { uploadStaticFiles } = await import("./chunk-5snr8g8q.js");
|
|
817
817
|
const uploadResult = await uploadStaticFiles({
|
|
818
818
|
sourceDir,
|
|
819
819
|
bucket: infraResult.bucket,
|
|
@@ -833,7 +833,7 @@ async function deployStaticSiteWithExternalDnsFull(config) {
|
|
|
833
833
|
}
|
|
834
834
|
if (infraResult.distributionId && uploadResult.uploaded > 0) {
|
|
835
835
|
onProgress?.("invalidate", "Invalidating CloudFront cache...");
|
|
836
|
-
const { invalidateCache } = await import("./chunk-
|
|
836
|
+
const { invalidateCache } = await import("./chunk-5snr8g8q.js");
|
|
837
837
|
await invalidateCache(infraResult.distributionId);
|
|
838
838
|
}
|
|
839
839
|
onProgress?.("complete", "Deployment complete!");
|
package/dist/deploy/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
sanitizeCloudConfig,
|
|
15
15
|
setMaintenance,
|
|
16
16
|
startLocalDashboardServer
|
|
17
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-7z3tf1mj.js";
|
|
18
18
|
import {
|
|
19
19
|
buildAndPushServerlessImage
|
|
20
20
|
} from "../chunk-tskj9fay.js";
|
|
@@ -45,9 +45,9 @@ import {
|
|
|
45
45
|
generateStaticSiteTemplate,
|
|
46
46
|
invalidateCache,
|
|
47
47
|
uploadStaticFiles
|
|
48
|
-
} from "../chunk-
|
|
48
|
+
} from "../chunk-9n57qng8.js";
|
|
49
49
|
import"../chunk-tjjgajbh.js";
|
|
50
|
-
import"../chunk-
|
|
50
|
+
import"../chunk-602g36gf.js";
|
|
51
51
|
import"../chunk-tnztxpcb.js";
|
|
52
52
|
import"../chunk-qpj3edwz.js";
|
|
53
53
|
import"../chunk-vd87cpvn.js";
|
package/dist/dns/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
sanitizeCloudConfig,
|
|
58
58
|
setMaintenance,
|
|
59
59
|
startLocalDashboardServer
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-7z3tf1mj.js";
|
|
61
61
|
import {
|
|
62
62
|
buildAndPushServerlessImage
|
|
63
63
|
} from "./chunk-tskj9fay.js";
|
|
@@ -528,7 +528,7 @@ import {
|
|
|
528
528
|
generateStaticSiteTemplate,
|
|
529
529
|
invalidateCache,
|
|
530
530
|
uploadStaticFiles
|
|
531
|
-
} from "./chunk-
|
|
531
|
+
} from "./chunk-9n57qng8.js";
|
|
532
532
|
import {
|
|
533
533
|
CloudFrontClient
|
|
534
534
|
} from "./chunk-tjjgajbh.js";
|
|
@@ -546,7 +546,7 @@ import {
|
|
|
546
546
|
createRoute53Validator,
|
|
547
547
|
detectDnsProvider,
|
|
548
548
|
dnsProviders
|
|
549
|
-
} from "./chunk-
|
|
549
|
+
} from "./chunk-602g36gf.js";
|
|
550
550
|
import {
|
|
551
551
|
Route53Client
|
|
552
552
|
} from "./chunk-tnztxpcb.js";
|