@stacksjs/ts-cloud 0.7.57 → 0.7.59

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.
Files changed (60) hide show
  1. package/dist/aws/index.js +1 -1
  2. package/dist/bin/cli.js +360 -360
  3. package/dist/{chunk-fv1bj3yt.js → chunk-001z7khv.js} +36 -0
  4. package/dist/{chunk-fw3q88wk.js → chunk-g126cfn9.js} +1 -1
  5. package/dist/{chunk-vvkd46k1.js → chunk-gcsv7g83.js} +3 -3
  6. package/dist/{chunk-0z43x8re.js → chunk-z3bakpnh.js} +2 -2
  7. package/dist/deploy/index.js +3 -3
  8. package/dist/dns/index.js +1 -1
  9. package/dist/dns/porkbun.d.ts +27 -0
  10. package/dist/dns/types.d.ts +8 -1
  11. package/dist/index.js +3 -3
  12. package/dist/ui/access-denied.html +2 -2
  13. package/dist/ui/account/automation.html +3 -3
  14. package/dist/ui/account/security.html +2 -2
  15. package/dist/ui/applications/compose.html +4 -4
  16. package/dist/ui/applications/new.html +2 -2
  17. package/dist/ui/data/backups.html +4 -4
  18. package/dist/ui/data/services.html +4 -4
  19. package/dist/ui/data/volumes.html +4 -4
  20. package/dist/ui/index.html +4 -4
  21. package/dist/ui/integrations.html +2 -2
  22. package/dist/ui/operations/alerts.html +3 -3
  23. package/dist/ui/operations/configuration.html +4 -4
  24. package/dist/ui/operations/jobs.html +4 -4
  25. package/dist/ui/operations/maintenance.html +4 -4
  26. package/dist/ui/operations/observability.html +4 -4
  27. package/dist/ui/operations/previews.html +4 -4
  28. package/dist/ui/operations/queue.html +4 -4
  29. package/dist/ui/operations/regions.html +4 -4
  30. package/dist/ui/operations/releases.html +4 -4
  31. package/dist/ui/operations/workloads.html +4 -4
  32. package/dist/ui/security.html +2 -2
  33. package/dist/ui/server/actions.html +4 -4
  34. package/dist/ui/server/activity.html +2 -2
  35. package/dist/ui/server/capacity.html +4 -4
  36. package/dist/ui/server/database.html +4 -4
  37. package/dist/ui/server/deployments.html +4 -4
  38. package/dist/ui/server/diagnostics.html +2 -2
  39. package/dist/ui/server/firewall.html +4 -4
  40. package/dist/ui/server/fleet.html +4 -4
  41. package/dist/ui/server/logs.html +4 -4
  42. package/dist/ui/server/metrics.html +2 -2
  43. package/dist/ui/server/security.html +2 -2
  44. package/dist/ui/server/services.html +2 -2
  45. package/dist/ui/server/sites.html +4 -4
  46. package/dist/ui/server/ssh-keys.html +4 -4
  47. package/dist/ui/server/team.html +4 -4
  48. package/dist/ui/server/terminal.html +2 -2
  49. package/dist/ui/serverless/alarms.html +4 -4
  50. package/dist/ui/serverless/assets.html +2 -2
  51. package/dist/ui/serverless/cost.html +2 -2
  52. package/dist/ui/serverless/data.html +4 -4
  53. package/dist/ui/serverless/functions.html +4 -4
  54. package/dist/ui/serverless/logs.html +4 -4
  55. package/dist/ui/serverless/metrics.html +2 -2
  56. package/dist/ui/serverless/queues.html +3 -3
  57. package/dist/ui/serverless/secrets.html +4 -4
  58. package/dist/ui/serverless/traces.html +4 -4
  59. package/dist/ui/serverless.html +4 -4
  60. package/package.json +3 -3
@@ -95,6 +95,35 @@ class PorkbunProvider {
95
95
  }
96
96
  return domain;
97
97
  }
98
+ static ADDRESS_TYPES = new Set(["A", "AAAA"]);
99
+ async clearConflictingAliases(domain, record) {
100
+ if (!PorkbunProvider.ADDRESS_TYPES.has(record.type))
101
+ return [];
102
+ const rootDomain = this.getRootDomain(domain);
103
+ const subdomain = this.getSubdomain(record.name, rootDomain);
104
+ const listed = await this.listRecords(domain);
105
+ if (!listed.success)
106
+ return [`could not list records to clear ALIAS/CNAME conflicts: ${listed.message ?? "unknown provider error"}`];
107
+ const warnings = [];
108
+ for (const existing of listed.records) {
109
+ if (existing.type !== "ALIAS" && existing.type !== "CNAME")
110
+ continue;
111
+ if (this.getSubdomain(existing.name, rootDomain) !== subdomain)
112
+ continue;
113
+ const removed = await this.deleteRecord(domain, existing);
114
+ if (!removed.success)
115
+ warnings.push(`could not remove conflicting ${existing.type} on ${existing.name}: ${removed.message ?? "unknown provider error"}`);
116
+ }
117
+ return warnings;
118
+ }
119
+ async addressRecordExists(domain, record) {
120
+ const rootDomain = this.getRootDomain(domain);
121
+ const subdomain = this.getSubdomain(record.name, rootDomain);
122
+ const listed = await this.listRecords(domain);
123
+ if (!listed.success)
124
+ return true;
125
+ return listed.records.some((r) => r.type === record.type && this.getSubdomain(r.name, rootDomain) === subdomain && r.content === record.content);
126
+ }
98
127
  async createRecord(domain, record) {
99
128
  try {
100
129
  const rootDomain = this.getRootDomain(domain);
@@ -113,7 +142,14 @@ class PorkbunProvider {
113
142
  if (record.type === "SRV" && record.weight !== undefined && record.port !== undefined) {
114
143
  body.content = `${record.weight} ${record.port} ${record.content}`;
115
144
  }
145
+ const conflicts = await this.clearConflictingAliases(domain, record);
116
146
  const response = await this.request(`/dns/create/${rootDomain}`, body);
147
+ if (PorkbunProvider.ADDRESS_TYPES.has(record.type) && !await this.addressRecordExists(domain, record)) {
148
+ return {
149
+ success: false,
150
+ message: `Porkbun reported success but no ${record.type} record for ${record.name} exists${conflicts.length > 0 ? ` (${conflicts.join("; ")})` : ""}. A conflicting ALIAS/CNAME on the same name silently voids the write.`
151
+ };
152
+ }
117
153
  return {
118
154
  success: true,
119
155
  id: response.id?.toString(),
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  deployStaticSiteWithExternalDnsFull
3
- } from "./chunk-vvkd46k1.js";
3
+ } from "./chunk-gcsv7g83.js";
4
4
  import {
5
5
  box,
6
6
  error,
@@ -7,7 +7,7 @@ import {
7
7
  Route53Provider,
8
8
  UnifiedDnsValidator,
9
9
  createDnsProvider
10
- } from "./chunk-fv1bj3yt.js";
10
+ } from "./chunk-001z7khv.js";
11
11
  import {
12
12
  CloudFormationClient
13
13
  } from "./chunk-4cjrg98a.js";
@@ -815,7 +815,7 @@ async function deployStaticSiteWithExternalDnsFull(config) {
815
815
  }
816
816
  }
817
817
  onProgress?.("upload", "Uploading files to S3...");
818
- const { uploadStaticFiles } = await import("./chunk-0z43x8re.js");
818
+ const { uploadStaticFiles } = await import("./chunk-z3bakpnh.js");
819
819
  const uploadResult = await uploadStaticFiles({
820
820
  sourceDir,
821
821
  bucket: infraResult.bucket,
@@ -835,7 +835,7 @@ async function deployStaticSiteWithExternalDnsFull(config) {
835
835
  }
836
836
  if (infraResult.distributionId && uploadResult.uploaded > 0) {
837
837
  onProgress?.("invalidate", "Invalidating CloudFront cache...");
838
- const { invalidateCache } = await import("./chunk-0z43x8re.js");
838
+ const { invalidateCache } = await import("./chunk-z3bakpnh.js");
839
839
  await invalidateCache(infraResult.distributionId);
840
840
  }
841
841
  onProgress?.("complete", "Deployment complete!");
@@ -5,9 +5,9 @@ import {
5
5
  generateStaticSiteTemplate,
6
6
  invalidateCache,
7
7
  uploadStaticFiles
8
- } from "./chunk-vvkd46k1.js";
8
+ } from "./chunk-gcsv7g83.js";
9
9
  import"./chunk-01d86gt1.js";
10
- import"./chunk-fv1bj3yt.js";
10
+ import"./chunk-001z7khv.js";
11
11
  import"./chunk-4cjrg98a.js";
12
12
  import"./chunk-32e7ya18.js";
13
13
  import"./chunk-wj3s95p9.js";
@@ -32,7 +32,7 @@ import {
32
32
  synchronizeDashboardUsers,
33
33
  trackDashboardOperation,
34
34
  verifyStaticApiOrigin
35
- } from "../chunk-fw3q88wk.js";
35
+ } from "../chunk-g126cfn9.js";
36
36
  import {
37
37
  deleteStaticSite,
38
38
  deployStaticSite,
@@ -43,7 +43,7 @@ import {
43
43
  generateStaticSiteTemplate,
44
44
  invalidateCache,
45
45
  uploadStaticFiles
46
- } from "../chunk-vvkd46k1.js";
46
+ } from "../chunk-gcsv7g83.js";
47
47
  import {
48
48
  buildAndPushServerlessImage
49
49
  } from "../chunk-exbcsab2.js";
@@ -51,7 +51,7 @@ import"../chunk-ybcz6sxc.js";
51
51
  import"../chunk-01d86gt1.js";
52
52
  import"../chunk-50jpda9q.js";
53
53
  import"../chunk-he9a874b.js";
54
- import"../chunk-fv1bj3yt.js";
54
+ import"../chunk-001z7khv.js";
55
55
  import {
56
56
  DASHBOARD_CREDENTIALS_FILE,
57
57
  MANAGEMENT_DASHBOARD_SITE,
package/dist/dns/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  createRoute53Validator,
12
12
  detectDnsProvider,
13
13
  dnsProviders
14
- } from "../chunk-fv1bj3yt.js";
14
+ } from "../chunk-001z7khv.js";
15
15
  import"../chunk-32e7ya18.js";
16
16
  import"../chunk-zqtpg06c.js";
17
17
  import"../chunk-v0bahtg2.js";
@@ -23,6 +23,33 @@ export declare class PorkbunProvider implements DnsProvider {
23
23
  * e.g., "api.example.com" -> "example.com"
24
24
  */
25
25
  private getRootDomain;
26
+ /**
27
+ * Address record types that cannot coexist with an `ALIAS`/`CNAME` on the
28
+ * same name. Porkbun ships every new domain with a parking `ALIAS` on the
29
+ * apex and a wildcard `CNAME`, both pointing at `pixie.porkbun.com`.
30
+ */
31
+ private static readonly ADDRESS_TYPES;
32
+ /**
33
+ * Remove any `ALIAS`/`CNAME` occupying `record.name` before writing an
34
+ * address record there.
35
+ *
36
+ * Porkbun accepts `POST /dns/create` for an apex `A` while its parking
37
+ * `ALIAS` still owns that name, answers `SUCCESS`, and then silently
38
+ * discards the record — nothing is created and nothing is reported. A deploy
39
+ * therefore logged a successful DNS reconciliation while the domain stayed
40
+ * parked, which is indistinguishable from slow propagation until someone
41
+ * digs the zone by hand.
42
+ *
43
+ * Only conflicting ALIAS/CNAME entries on the SAME name are touched; MX, TXT,
44
+ * NS and records on other names are left alone.
45
+ */
46
+ private clearConflictingAliases;
47
+ /**
48
+ * Confirm an address record actually exists after a create that reported
49
+ * success — see {@link clearConflictingAliases} for why a `SUCCESS` from
50
+ * Porkbun is not sufficient evidence that anything was written.
51
+ */
52
+ private addressRecordExists;
26
53
  createRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
27
54
  upsertRecord(domain: string, record: DnsRecord): Promise<CreateRecordResult>;
28
55
  deleteRecord(domain: string, record: DnsRecord): Promise<DeleteRecordResult>;
@@ -2,7 +2,14 @@
2
2
  * DNS Provider Types
3
3
  * Common interfaces for DNS provider abstraction
4
4
  */
5
- export type DnsRecordType = 'A' | 'AAAA' | 'CNAME' | 'TXT' | 'MX' | 'NS' | 'SRV' | 'CAA';
5
+ /**
6
+ * `ALIAS` is a provider-specific CNAME-like record permitted at a zone apex
7
+ * (Porkbun, DNSimple, Route53's ALIAS). It is included because ts-cloud has to
8
+ * *see* one to manage a zone correctly, not because it writes them: Porkbun
9
+ * puts a parking `ALIAS` on the apex of every new domain, and an apex `A`
10
+ * written while that exists is accepted and then silently discarded.
11
+ */
12
+ export type DnsRecordType = 'A' | 'AAAA' | 'ALIAS' | 'CNAME' | 'TXT' | 'MX' | 'NS' | 'SRV' | 'CAA';
6
13
  export interface DnsRecord {
7
14
  name: string;
8
15
  type: DnsRecordType;
package/dist/index.js CHANGED
@@ -285,7 +285,7 @@ import {
285
285
  volumeCapabilities,
286
286
  webhookEndpoint,
287
287
  zeroCapacity
288
- } from "./chunk-fw3q88wk.js";
288
+ } from "./chunk-g126cfn9.js";
289
289
  import {
290
290
  deleteStaticSite,
291
291
  deployStaticSite,
@@ -296,7 +296,7 @@ import {
296
296
  generateStaticSiteTemplate,
297
297
  invalidateCache,
298
298
  uploadStaticFiles
299
- } from "./chunk-vvkd46k1.js";
299
+ } from "./chunk-gcsv7g83.js";
300
300
  import {
301
301
  buildAndPushServerlessImage
302
302
  } from "./chunk-exbcsab2.js";
@@ -361,7 +361,7 @@ import {
361
361
  createRoute53Validator,
362
362
  detectDnsProvider,
363
363
  dnsProviders
364
- } from "./chunk-fv1bj3yt.js";
364
+ } from "./chunk-001z7khv.js";
365
365
  import {
366
366
  AwsDriver,
367
367
  CloudDriverFactory,