@stacksjs/ts-cloud 0.9.1 → 0.9.3

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 (145) hide show
  1. package/dist/aws/index.js +10 -2
  2. package/dist/bin/chunk-09nwf2gy.js +34 -0
  3. package/dist/bin/chunk-14cwr6eh.js +70 -0
  4. package/dist/bin/chunk-271gk1n2.js +6 -0
  5. package/dist/bin/chunk-38pq971s.js +2 -0
  6. package/dist/bin/chunk-3gykfyq4.js +37 -0
  7. package/dist/bin/chunk-3r4fb59r.js +3 -0
  8. package/dist/bin/chunk-41x17hw1.js +1 -0
  9. package/dist/bin/chunk-4vrqm9h0.js +2 -0
  10. package/dist/bin/chunk-57y1zxbf.js +3 -0
  11. package/dist/bin/chunk-598yf4bs.js +1 -0
  12. package/dist/bin/chunk-8v7ddyvf.js +1 -0
  13. package/dist/bin/chunk-92mea34a.js +1 -0
  14. package/dist/bin/chunk-9pvsff8g.js +1 -0
  15. package/dist/bin/chunk-9v39615t.js +1 -0
  16. package/dist/bin/chunk-avm7tnwe.js +1 -0
  17. package/dist/bin/chunk-ax9mr6wm.js +44 -0
  18. package/dist/bin/chunk-axhnkn5g.js +2 -0
  19. package/dist/bin/chunk-b5gd39s8.js +512 -0
  20. package/dist/bin/chunk-b9qbp8j1.js +1 -0
  21. package/dist/bin/chunk-bz828v8q.js +3 -0
  22. package/dist/bin/chunk-c1vcdgvr.js +1 -0
  23. package/dist/bin/chunk-ctd2vg9w.js +2 -0
  24. package/dist/bin/chunk-dbgffky8.js +1 -0
  25. package/dist/bin/chunk-dwr30vbv.js +1 -0
  26. package/dist/bin/chunk-e3xrwh9z.js +1 -0
  27. package/dist/bin/chunk-fhc6ntvd.js +2 -0
  28. package/dist/bin/chunk-fpm59y25.js +6 -0
  29. package/dist/bin/chunk-fvbxvq6b.js +1 -0
  30. package/dist/bin/chunk-fy8j3y8p.js +92 -0
  31. package/dist/bin/chunk-fz21b57w.js +1 -0
  32. package/dist/bin/chunk-gavvf0pg.js +141 -0
  33. package/dist/bin/chunk-ggn7ax8p.js +4 -0
  34. package/dist/bin/chunk-gpe2prkm.js +1 -0
  35. package/dist/bin/chunk-gqf6jsmy.js +1 -0
  36. package/dist/bin/chunk-h5pa5men.js +2 -0
  37. package/dist/bin/chunk-hm08xdxf.js +2 -0
  38. package/dist/bin/chunk-hzgz13nf.js +1 -0
  39. package/dist/bin/chunk-hzqw8xm5.js +111 -0
  40. package/dist/bin/chunk-j703btc5.js +50 -0
  41. package/dist/bin/chunk-jpjamjey.js +6935 -0
  42. package/dist/bin/chunk-m2zwtapr.js +1 -0
  43. package/dist/bin/chunk-m669wtgr.js +1 -0
  44. package/dist/bin/chunk-mh0kdzqp.js +2 -0
  45. package/dist/bin/chunk-mr0atd2s.js +2 -0
  46. package/dist/bin/chunk-ngcyftm2.js +1 -0
  47. package/dist/bin/chunk-p66ptpmr.js +2 -0
  48. package/dist/bin/chunk-p8q9bq9g.js +1 -0
  49. package/dist/bin/chunk-r3kv0vm9.js +6 -0
  50. package/dist/bin/chunk-r9hjwcj9.js +6 -0
  51. package/dist/bin/chunk-rtczra13.js +1 -0
  52. package/dist/bin/chunk-ry030a6b.js +1507 -0
  53. package/dist/bin/chunk-rytk89az.js +60 -0
  54. package/dist/bin/chunk-sgyffpgm.js +581 -0
  55. package/dist/bin/chunk-vek8a0w6.js +1 -0
  56. package/dist/bin/chunk-waayf9ay.js +2 -0
  57. package/dist/bin/chunk-ynjvbphf.js +8 -0
  58. package/dist/bin/chunk-yv9sth30.js +1 -0
  59. package/dist/bin/cli.js +417 -10597
  60. package/dist/bin/dashboard-server.js +1 -6998
  61. package/dist/{chunk-hg7rhrgd.js → chunk-1c8dbv57.js} +5 -1
  62. package/dist/{chunk-5nr95wpj.js → chunk-728jvrr0.js} +3 -3
  63. package/dist/{chunk-ws47smxr.js → chunk-k4px0bnv.js} +2 -2
  64. package/dist/{chunk-hygwq9y2.js → chunk-q0st3se8.js} +2 -2
  65. package/dist/{chunk-atbgd8wz.js → chunk-qr803fye.js} +112 -1
  66. package/dist/deploy/attach-credentials.d.ts +57 -0
  67. package/dist/deploy/index.js +4 -4
  68. package/dist/deploy/site-ports.d.ts +151 -0
  69. package/dist/deploy/site-target.d.ts +24 -1
  70. package/dist/dns/declared-records.d.ts +87 -0
  71. package/dist/dns/declared-records.test.d.ts +1 -0
  72. package/dist/dns/index.d.ts +2 -0
  73. package/dist/dns/index.js +10 -2
  74. package/dist/drivers/index.js +1 -1
  75. package/dist/index.d.ts +2 -1
  76. package/dist/index.js +13 -5
  77. package/dist/ui/404.html +16 -548
  78. package/dist/ui/_stx/chunk.5ddb5087.js +90 -0
  79. package/dist/ui/_stx/chunk.9fd39d5b.js +86 -0
  80. package/dist/ui/_stx/chunk.d5301f79.js +119 -0
  81. package/dist/ui/_stx/crosswind.222ed683.css +1 -0
  82. package/dist/ui/_stx/crosswind.616c25f3.css +1 -0
  83. package/dist/ui/_stx/crosswind.80baa894.css +320 -0
  84. package/dist/ui/_stx/crosswind.906ee17c.css +1 -0
  85. package/dist/ui/_stx/crosswind.996ed49e.css +1 -0
  86. package/dist/ui/_stx/crosswind.b7a99a5c.css +1 -0
  87. package/dist/ui/_stx/router.fa5bc4dc.js +4 -0
  88. package/dist/ui/_stx/runtime.c696d17a.js +1 -0
  89. package/dist/ui/_stx/style.448ab192.css +1 -0
  90. package/dist/ui/accept-invitation.html +2 -1133
  91. package/dist/ui/access-denied.html +7 -1130
  92. package/dist/ui/account/automation.html +12 -1134
  93. package/dist/ui/account/security.html +13 -1136
  94. package/dist/ui/applications/compose.html +12 -1134
  95. package/dist/ui/applications/new.html +13 -1137
  96. package/dist/ui/data/backups.html +91 -1136
  97. package/dist/ui/data/services.html +89 -1136
  98. package/dist/ui/data/volumes.html +61 -1136
  99. package/dist/ui/index.html +60 -1136
  100. package/dist/ui/infrastructure/topology.html +128 -1135
  101. package/dist/ui/integrations.html +13 -1138
  102. package/dist/ui/operations/alerts.html +59 -1136
  103. package/dist/ui/operations/configuration.html +13 -1135
  104. package/dist/ui/operations/jobs.html +87 -1136
  105. package/dist/ui/operations/maintenance.html +12 -1134
  106. package/dist/ui/operations/observability.html +93 -1136
  107. package/dist/ui/operations/previews.html +12 -1134
  108. package/dist/ui/operations/queue.html +12 -1134
  109. package/dist/ui/operations/regions.html +12 -1134
  110. package/dist/ui/operations/releases.html +12 -1134
  111. package/dist/ui/operations/spend.html +65 -1136
  112. package/dist/ui/operations/workloads.html +115 -1136
  113. package/dist/ui/robots.txt +2 -0
  114. package/dist/ui/security.html +24 -1136
  115. package/dist/ui/server/actions.html +67 -1138
  116. package/dist/ui/server/activity.html +7 -1130
  117. package/dist/ui/server/capacity.html +12 -1134
  118. package/dist/ui/server/database.html +166 -1135
  119. package/dist/ui/server/deployments.html +60 -1136
  120. package/dist/ui/server/diagnostics.html +7 -1130
  121. package/dist/ui/server/firewall.html +286 -1212
  122. package/dist/ui/server/fleet.html +45 -1136
  123. package/dist/ui/server/logs.html +34 -1135
  124. package/dist/ui/server/metrics.html +124 -1140
  125. package/dist/ui/server/security.html +7 -1130
  126. package/dist/ui/server/services.html +46 -1133
  127. package/dist/ui/server/sites.html +287 -1137
  128. package/dist/ui/server/ssh-keys.html +62 -1135
  129. package/dist/ui/server/team.html +155 -1136
  130. package/dist/ui/server/terminal.html +97 -1183
  131. package/dist/ui/serverless/alarms.html +62 -1135
  132. package/dist/ui/serverless/assets.html +47 -1132
  133. package/dist/ui/serverless/cost.html +7 -1130
  134. package/dist/ui/serverless/data.html +46 -1135
  135. package/dist/ui/serverless/deployments.html +47 -1132
  136. package/dist/ui/serverless/firewall.html +7 -1130
  137. package/dist/ui/serverless/functions.html +50 -1136
  138. package/dist/ui/serverless/logs.html +34 -1135
  139. package/dist/ui/serverless/metrics.html +7 -1130
  140. package/dist/ui/serverless/queues.html +58 -1135
  141. package/dist/ui/serverless/secrets.html +62 -1136
  142. package/dist/ui/serverless/traces.html +12 -1134
  143. package/dist/ui/serverless.html +64 -1137
  144. package/dist/ui-src/pages/server/firewall.stx +14 -14
  145. package/package.json +3 -3
@@ -20,7 +20,7 @@ const messageKind = state('')
20
20
  const reserved = [22, 80, 443]
21
21
  const posture = state(null)
22
22
  const ipRules = state({ allow: [], block: [] })
23
- const busy = state(false)
23
+ const working = state(false)
24
24
  function setMessage(text, kind) { message.set(text); messageKind.set(kind || '') }
25
25
  function applyLine(apply) {
26
26
  if (!apply) return ''
@@ -35,13 +35,13 @@ async function loadProtection() {
35
35
  } catch { posture.set(null) }
36
36
  }
37
37
  async function protect(path, body, note) {
38
- busy.set(true)
38
+ working.set(true)
39
39
  try {
40
40
  await requestJson(path, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(body) })
41
41
  setMessage(note, 'ok')
42
42
  await loadProtection()
43
43
  } catch (e) { setMessage((e && e.message) || 'Request failed.', 'bad') }
44
- finally { busy.set(false) }
44
+ finally { working.set(false) }
45
45
  }
46
46
  async function toggleAttackMode(on) {
47
47
  if (on && !confirm('Attack mode challenges every visitor, including legitimate ones. Continue?')) return
@@ -61,13 +61,13 @@ async function addIpRule(list, cidr) {
61
61
  await protect('/api/protection/ip-rules', { list, cidr }, `Added ${cidr} to the ${list} list.`)
62
62
  }
63
63
  async function removeIpRule(list, cidr) {
64
- busy.set(true)
64
+ working.set(true)
65
65
  try {
66
66
  await requestJson('/api/protection/ip-rules', { method: 'DELETE', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ list, cidr }) })
67
67
  setMessage(`Removed ${cidr} from the ${list} list.`, 'ok')
68
68
  await loadProtection()
69
69
  } catch (e) { setMessage((e && e.message) || 'Request failed.', 'bad') }
70
- finally { busy.set(false) }
70
+ finally { working.set(false) }
71
71
  }
72
72
  function submitIpRule(event) {
73
73
  event.preventDefault()
@@ -86,17 +86,17 @@ async function load() {
86
86
  } catch (e) { setMessage((e && e.message) || 'Could not read firewall config.', 'bad') }
87
87
  }
88
88
  async function allowPort() {
89
- if (busy()) return
89
+ if (working()) return
90
90
  const port = Number(newPort())
91
91
  if (!Number.isInteger(port) || port < 1 || port > 65535) { setMessage('Port must be a whole number between 1 and 65535.', 'bad'); return }
92
92
  if (reserved.includes(port)) { setMessage('Ports 22, 80, and 443 are always open, so there is nothing to add.', 'bad'); return }
93
- busy.set(true); setMessage('Allowing port ' + port + '...', '')
93
+ working.set(true); setMessage('Allowing port ' + port + '...', '')
94
94
  try {
95
95
  const data = await requestJson('/api/firewall', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ port }) })
96
96
  ports.set(data.ports || []); newPort.set('')
97
97
  setMessage('Allowed port ' + port + ' in cloud config.' + applyLine(data.apply), 'ok')
98
98
  } catch (error) { setMessage(error?.message || 'Could not allow port.', 'bad') }
99
- finally { busy.set(false) }
99
+ finally { working.set(false) }
100
100
  }
101
101
  async function removePort(port) {
102
102
  setMessage('Removing port ' + port + '...', '')
@@ -133,8 +133,8 @@ onMount(() => { load() })
133
133
  <p class="notice" :class="posture()?.attackMode || posture()?.mitigationPaused ? 'warn' : ''" @show="!!posture()">{{ posture()?.summary }}</p>
134
134
  <p class="note" @show="!posture()">Protection controls are unavailable for this account.</p>
135
135
  <div class="actions" @show="!!posture()">
136
- <button class="btn ghost sm" :disabled="busy()" @click="toggleAttackMode(!posture()?.attackMode)">{{ posture()?.attackMode ? 'Turn attack mode off' : 'Turn attack mode on' }}</button>
137
- <button class="btn danger ghost sm" :disabled="busy()" @click="togglePause(!posture()?.mitigationPaused)">{{ posture()?.mitigationPaused ? 'Resume mitigation' : 'Pause mitigation' }}</button>
136
+ <button class="btn ghost sm" :disabled="working()" @click="toggleAttackMode(!posture()?.attackMode)">{{ posture()?.attackMode ? 'Turn attack mode off' : 'Turn attack mode on' }}</button>
137
+ <button class="btn danger ghost sm" :disabled="working()" @click="togglePause(!posture()?.mitigationPaused)">{{ posture()?.mitigationPaused ? 'Resume mitigation' : 'Pause mitigation' }}</button>
138
138
  </div>
139
139
  <p class="note">Attack mode challenges every visitor, so it is time-boxed and lifts itself. Pausing mitigation serves and bills all traffic, including attacks, and is capped at 24 hours.</p>
140
140
  </div>
@@ -146,16 +146,16 @@ onMount(() => { load() })
146
146
  <form class="inline-form" @submit="submitIpRule($event)">
147
147
  <select name="list" aria-label="List"><option value="block">Block</option><option value="allow">Allow</option></select>
148
148
  <input name="cidr" placeholder="203.0.113.0/24" aria-label="IP or CIDR" required>
149
- <button class="btn sm" type="submit" :disabled="busy()">Add</button>
149
+ <button class="btn sm" type="submit" :disabled="working()">Add</button>
150
150
  </form>
151
151
  <table>
152
152
  <thead><tr><th scope="col">List</th><th scope="col">CIDR</th><th scope="col"></th></tr></thead>
153
153
  <tbody>
154
154
  <template :for="cidr in ipRules().allow">
155
- <tr><td><span class="ok pill">allow</span></td><td class="mono">{{ cidr }}</td><td><button class="btn ghost sm" :disabled="busy()" @click="removeIpRule('allow', cidr)">Remove</button></td></tr>
155
+ <tr><td><span class="ok pill">allow</span></td><td class="mono">{{ cidr }}</td><td><button class="btn ghost sm" :disabled="working()" @click="removeIpRule('allow', cidr)">Remove</button></td></tr>
156
156
  </template>
157
157
  <template :for="cidr in ipRules().block">
158
- <tr><td><span class="bad pill">block</span></td><td class="mono">{{ cidr }}</td><td><button class="btn ghost sm" :disabled="busy()" @click="removeIpRule('block', cidr)">Remove</button></td></tr>
158
+ <tr><td><span class="bad pill">block</span></td><td class="mono">{{ cidr }}</td><td><button class="btn ghost sm" :disabled="working()" @click="removeIpRule('block', cidr)">Remove</button></td></tr>
159
159
  </template>
160
160
  </tbody>
161
161
  </table>
@@ -189,7 +189,7 @@ onMount(() => { load() })
189
189
  <input id="fw-port" type="number" min="1" max="65535" autocomplete="off" placeholder="8080" :value="newPort()" @input="newPort.set($event.target.value)" required>
190
190
  </div>
191
191
  <div class="form-actions">
192
- <button class="btn" type="submit" :disabled="busy()">Allow</button>
192
+ <button class="btn" type="submit" :disabled="working()">Allow</button>
193
193
  <span class="msg" :class="messageKind()" role="status">{{ message() }}</span>
194
194
  </div>
195
195
  </form>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/ts-cloud",
3
3
  "type": "module",
4
- "version": "0.9.1",
4
+ "version": "0.9.3",
5
5
  "description": "A lightweight, performant infrastructure-as-code library and CLI for deploying both server-based (EC2) and serverless applications.",
6
6
  "author": "Chris Breuer <chris@stacksjs.com>",
7
7
  "license": "MIT",
@@ -98,8 +98,8 @@
98
98
  },
99
99
  "dependencies": {
100
100
  "@stacksjs/ts-xml": "^0.1.0",
101
- "@ts-cloud/aws-types": "0.9.1",
102
- "@ts-cloud/core": "0.9.1"
101
+ "@ts-cloud/aws-types": "0.9.3",
102
+ "@ts-cloud/core": "0.9.3"
103
103
  },
104
104
  "devDependencies": {
105
105
  "better-dx": "^0.2.16",