@stacksjs/ts-cloud 0.9.3 → 0.10.0

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 (255) hide show
  1. package/dist/aws/index.js +1 -269
  2. package/dist/bin/chunk-08c0pzkb.js +1 -0
  3. package/dist/bin/chunk-12210qvj.js +1 -0
  4. package/dist/bin/chunk-1v6bt68w.js +6 -0
  5. package/dist/bin/chunk-35ttwn26.js +70 -0
  6. package/dist/bin/chunk-3r3be05z.js +1 -0
  7. package/dist/bin/chunk-41yqpdv7.js +2 -0
  8. package/dist/bin/chunk-5rv31chh.js +1 -0
  9. package/dist/bin/chunk-6eat8ezk.js +2 -0
  10. package/dist/bin/chunk-6gktf2m2.js +1 -0
  11. package/dist/bin/chunk-6zjy949y.js +141 -0
  12. package/dist/bin/chunk-7wzdaqh6.js +2 -0
  13. package/dist/bin/chunk-80ar3aty.js +1 -0
  14. package/dist/bin/chunk-8rwhsp5b.js +2 -0
  15. package/dist/bin/chunk-936vp7dx.js +44 -0
  16. package/dist/bin/chunk-9px3rg4a.js +4 -0
  17. package/dist/bin/chunk-anm3ae6z.js +7364 -0
  18. package/dist/bin/{chunk-ynjvbphf.js → chunk-axvr7dwa.js} +6 -6
  19. package/dist/bin/chunk-b0hj9m5e.js +2 -0
  20. package/dist/bin/{chunk-mh0kdzqp.js → chunk-b2ymh8k0.js} +1 -1
  21. package/dist/bin/chunk-b35989e3.js +50 -0
  22. package/dist/bin/chunk-c2b6nk0q.js +37 -0
  23. package/dist/bin/chunk-ckxpgwxw.js +3 -0
  24. package/dist/bin/chunk-d6zzgvtn.js +92 -0
  25. package/dist/bin/chunk-da8zpf82.js +1 -0
  26. package/dist/bin/chunk-ddmjjstg.js +1 -0
  27. package/dist/bin/chunk-dhhz4zyj.js +1 -0
  28. package/dist/bin/chunk-dj9a67c3.js +9 -0
  29. package/dist/bin/chunk-ds1z880f.js +1 -0
  30. package/dist/bin/chunk-dvkj4k6h.js +111 -0
  31. package/dist/bin/chunk-eh40fpvj.js +1 -0
  32. package/dist/bin/chunk-ey9fagrr.js +6 -0
  33. package/dist/bin/chunk-ezftw2q4.js +1 -0
  34. package/dist/bin/chunk-g6a4n3rh.js +1 -0
  35. package/dist/bin/chunk-g90nqfgv.js +585 -0
  36. package/dist/bin/chunk-gs40j75w.js +1 -0
  37. package/dist/bin/chunk-jjjts1vt.js +1 -0
  38. package/dist/bin/{chunk-ry030a6b.js → chunk-jnsbzqzz.js} +30 -30
  39. package/dist/bin/chunk-jnx4jgw8.js +1 -0
  40. package/dist/bin/chunk-jt1tndm2.js +3 -0
  41. package/dist/bin/chunk-kybdb0ws.js +2 -0
  42. package/dist/bin/chunk-m3nqw76h.js +3 -0
  43. package/dist/bin/chunk-mn6j22zn.js +6 -0
  44. package/dist/bin/chunk-nb0yjkv5.js +2 -0
  45. package/dist/bin/chunk-pjpa4x52.js +2 -0
  46. package/dist/bin/chunk-pkgkfe6s.js +2 -0
  47. package/dist/bin/chunk-pnz5hk8n.js +60 -0
  48. package/dist/bin/chunk-q46zr2tv.js +1 -0
  49. package/dist/bin/chunk-qtdngvs8.js +1 -0
  50. package/dist/bin/chunk-sbejksrh.js +2 -0
  51. package/dist/bin/chunk-svyd4v6c.js +34 -0
  52. package/dist/bin/chunk-tna7ay8d.js +1 -0
  53. package/dist/bin/chunk-tp4c2mv1.js +1 -0
  54. package/dist/bin/chunk-w5d6tr2x.js +1 -0
  55. package/dist/bin/chunk-wewcjam5.js +1 -0
  56. package/dist/bin/chunk-xv4bscrm.js +1 -0
  57. package/dist/bin/chunk-y9eyc5pw.js +1 -0
  58. package/dist/bin/chunk-y9f8649w.js +512 -0
  59. package/dist/bin/cli.js +428 -418
  60. package/dist/bin/dashboard-server.js +1 -1
  61. package/dist/chunk-06jk7ba9.js +7355 -0
  62. package/dist/chunk-0e16qt6k.js +5 -0
  63. package/dist/chunk-13hxhzaz.js +34 -0
  64. package/dist/chunk-2p89vt3b.js +2 -0
  65. package/dist/chunk-77t2ctwn.js +2 -0
  66. package/dist/chunk-88z37ey4.js +114 -0
  67. package/dist/chunk-8c4715hz.js +2 -0
  68. package/dist/chunk-9a22225r.js +60 -0
  69. package/dist/chunk-as6by62d.js +1 -0
  70. package/dist/chunk-cd0zpxhf.js +44 -0
  71. package/dist/chunk-cp54a0qn.js +6 -0
  72. package/dist/chunk-d67xbk4v.js +141 -0
  73. package/dist/chunk-dckz9xve.js +2 -0
  74. package/dist/chunk-e1666vjv.js +2 -0
  75. package/dist/chunk-hhdx5k96.js +442 -0
  76. package/dist/chunk-kv2ztkp4.js +1617 -0
  77. package/dist/chunk-nrz6zypg.js +1 -0
  78. package/dist/chunk-q816js1y.js +1 -0
  79. package/dist/chunk-qh9ep11z.js +704 -0
  80. package/dist/chunk-rg720cqg.js +1 -0
  81. package/dist/chunk-snak8s7m.js +92 -0
  82. package/dist/chunk-vq737g82.js +1 -0
  83. package/dist/chunk-xd6w0c11.js +50 -0
  84. package/dist/chunk-xtwjt370.js +37 -0
  85. package/dist/chunk-y26yh5zp.js +1 -0
  86. package/dist/chunk-zmxffmmq.js +4 -0
  87. package/dist/deploy/attach-credentials.d.ts +4 -8
  88. package/dist/deploy/index.js +1 -168
  89. package/dist/dns/cloudflare.d.ts +27 -0
  90. package/dist/dns/godaddy.d.ts +18 -1
  91. package/dist/dns/index.d.ts +2 -0
  92. package/dist/dns/index.js +1 -41
  93. package/dist/dns/zone-migration.d.ts +92 -0
  94. package/dist/dns/zone-migration.test.d.ts +1 -0
  95. package/dist/drivers/hetzner/driver.d.ts +8 -1
  96. package/dist/drivers/index.js +1 -154
  97. package/dist/drivers/shared/compute-provision.d.ts +14 -2
  98. package/dist/drivers/shared/db-provision.d.ts +3 -2
  99. package/dist/drivers/shared/mail-provision.d.ts +116 -0
  100. package/dist/drivers/shared/mail-provision.test.d.ts +1 -0
  101. package/dist/drivers/shared/managed-services-probe.d.ts +47 -0
  102. package/dist/drivers/shared/managed-services-probe.test.d.ts +1 -0
  103. package/dist/drivers/shared/package-manager.d.ts +1 -0
  104. package/dist/drivers/shared/remote-failure.d.ts +21 -0
  105. package/dist/drivers/shared/remote-failure.test.d.ts +1 -0
  106. package/dist/drivers/shared/sqlite-shared-path.d.ts +50 -0
  107. package/dist/drivers/shared/sqlite-shared-path.test.d.ts +1 -0
  108. package/dist/index.d.ts +2 -0
  109. package/dist/index.js +100 -6129
  110. package/dist/operations/plan.d.ts +136 -0
  111. package/dist/operations/plan.test.d.ts +1 -0
  112. package/dist/operations/server-rename.d.ts +84 -0
  113. package/dist/operations/server-rename.test.d.ts +1 -0
  114. package/dist/operations/site-move.d.ts +263 -0
  115. package/dist/operations/site-move.test.d.ts +1 -0
  116. package/dist/protection/index.js +1 -89
  117. package/dist/push/index.js +1 -509
  118. package/dist/spend/index.js +1 -173
  119. package/dist/ui/404.html +1 -1
  120. package/dist/ui/accept-invitation.html +1 -1
  121. package/dist/ui/access-denied.html +1 -1
  122. package/dist/ui/account/automation.html +5 -5
  123. package/dist/ui/account/security.html +2 -2
  124. package/dist/ui/applications/compose.html +6 -6
  125. package/dist/ui/applications/new.html +2 -2
  126. package/dist/ui/data/backups.html +80 -80
  127. package/dist/ui/data/services.html +78 -78
  128. package/dist/ui/data/volumes.html +50 -50
  129. package/dist/ui/index.html +50 -50
  130. package/dist/ui/infrastructure/topology.html +118 -118
  131. package/dist/ui/integrations.html +1 -1
  132. package/dist/ui/operations/alerts.html +47 -47
  133. package/dist/ui/operations/configuration.html +5 -5
  134. package/dist/ui/operations/jobs.html +76 -76
  135. package/dist/ui/operations/maintenance.html +6 -6
  136. package/dist/ui/operations/observability.html +82 -82
  137. package/dist/ui/operations/previews.html +5 -5
  138. package/dist/ui/operations/queue.html +6 -6
  139. package/dist/ui/operations/regions.html +6 -6
  140. package/dist/ui/operations/releases.html +6 -6
  141. package/dist/ui/operations/spend.html +54 -54
  142. package/dist/ui/operations/workloads.html +104 -104
  143. package/dist/ui/security.html +2 -2
  144. package/dist/ui/server/actions.html +56 -56
  145. package/dist/ui/server/activity.html +1 -1
  146. package/dist/ui/server/capacity.html +6 -6
  147. package/dist/ui/server/database.html +106 -106
  148. package/dist/ui/server/deployments.html +50 -50
  149. package/dist/ui/server/diagnostics.html +2 -2
  150. package/dist/ui/server/firewall.html +76 -76
  151. package/dist/ui/server/fleet.html +34 -34
  152. package/dist/ui/server/logs.html +24 -24
  153. package/dist/ui/server/metrics.html +112 -112
  154. package/dist/ui/server/security.html +1 -1
  155. package/dist/ui/server/services.html +27 -27
  156. package/dist/ui/server/sites.html +120 -120
  157. package/dist/ui/server/ssh-keys.html +51 -51
  158. package/dist/ui/server/team.html +144 -144
  159. package/dist/ui/server/terminal.html +15 -15
  160. package/dist/ui/serverless/alarms.html +52 -52
  161. package/dist/ui/serverless/assets.html +27 -27
  162. package/dist/ui/serverless/cost.html +2 -2
  163. package/dist/ui/serverless/data.html +36 -36
  164. package/dist/ui/serverless/deployments.html +27 -27
  165. package/dist/ui/serverless/firewall.html +1 -1
  166. package/dist/ui/serverless/functions.html +40 -40
  167. package/dist/ui/serverless/logs.html +24 -24
  168. package/dist/ui/serverless/metrics.html +2 -2
  169. package/dist/ui/serverless/queues.html +47 -47
  170. package/dist/ui/serverless/secrets.html +52 -52
  171. package/dist/ui/serverless/traces.html +6 -6
  172. package/dist/ui/serverless.html +54 -54
  173. package/dist/ui-src/src/charts.ts +17499 -12662
  174. package/dist/ui-src/src/topology.ts +2 -2
  175. package/package.json +3 -3
  176. package/dist/bin/chunk-09nwf2gy.js +0 -34
  177. package/dist/bin/chunk-14cwr6eh.js +0 -70
  178. package/dist/bin/chunk-271gk1n2.js +0 -6
  179. package/dist/bin/chunk-38pq971s.js +0 -2
  180. package/dist/bin/chunk-3gykfyq4.js +0 -37
  181. package/dist/bin/chunk-3r4fb59r.js +0 -3
  182. package/dist/bin/chunk-41x17hw1.js +0 -1
  183. package/dist/bin/chunk-4vrqm9h0.js +0 -2
  184. package/dist/bin/chunk-57y1zxbf.js +0 -3
  185. package/dist/bin/chunk-598yf4bs.js +0 -1
  186. package/dist/bin/chunk-8v7ddyvf.js +0 -1
  187. package/dist/bin/chunk-92mea34a.js +0 -1
  188. package/dist/bin/chunk-9pvsff8g.js +0 -1
  189. package/dist/bin/chunk-9v39615t.js +0 -1
  190. package/dist/bin/chunk-avm7tnwe.js +0 -1
  191. package/dist/bin/chunk-ax9mr6wm.js +0 -44
  192. package/dist/bin/chunk-axhnkn5g.js +0 -2
  193. package/dist/bin/chunk-b5gd39s8.js +0 -512
  194. package/dist/bin/chunk-b9qbp8j1.js +0 -1
  195. package/dist/bin/chunk-bz828v8q.js +0 -3
  196. package/dist/bin/chunk-c1vcdgvr.js +0 -1
  197. package/dist/bin/chunk-ctd2vg9w.js +0 -2
  198. package/dist/bin/chunk-dbgffky8.js +0 -1
  199. package/dist/bin/chunk-dwr30vbv.js +0 -1
  200. package/dist/bin/chunk-e3xrwh9z.js +0 -1
  201. package/dist/bin/chunk-fhc6ntvd.js +0 -2
  202. package/dist/bin/chunk-fpm59y25.js +0 -6
  203. package/dist/bin/chunk-fvbxvq6b.js +0 -1
  204. package/dist/bin/chunk-fy8j3y8p.js +0 -92
  205. package/dist/bin/chunk-fz21b57w.js +0 -1
  206. package/dist/bin/chunk-gavvf0pg.js +0 -141
  207. package/dist/bin/chunk-ggn7ax8p.js +0 -4
  208. package/dist/bin/chunk-gpe2prkm.js +0 -1
  209. package/dist/bin/chunk-gqf6jsmy.js +0 -1
  210. package/dist/bin/chunk-h5pa5men.js +0 -2
  211. package/dist/bin/chunk-hm08xdxf.js +0 -2
  212. package/dist/bin/chunk-hzgz13nf.js +0 -1
  213. package/dist/bin/chunk-hzqw8xm5.js +0 -111
  214. package/dist/bin/chunk-j703btc5.js +0 -50
  215. package/dist/bin/chunk-jpjamjey.js +0 -6935
  216. package/dist/bin/chunk-m2zwtapr.js +0 -1
  217. package/dist/bin/chunk-m669wtgr.js +0 -1
  218. package/dist/bin/chunk-mr0atd2s.js +0 -2
  219. package/dist/bin/chunk-ngcyftm2.js +0 -1
  220. package/dist/bin/chunk-p66ptpmr.js +0 -2
  221. package/dist/bin/chunk-p8q9bq9g.js +0 -1
  222. package/dist/bin/chunk-r3kv0vm9.js +0 -6
  223. package/dist/bin/chunk-r9hjwcj9.js +0 -6
  224. package/dist/bin/chunk-rtczra13.js +0 -1
  225. package/dist/bin/chunk-rytk89az.js +0 -60
  226. package/dist/bin/chunk-sgyffpgm.js +0 -581
  227. package/dist/bin/chunk-vek8a0w6.js +0 -1
  228. package/dist/bin/chunk-waayf9ay.js +0 -2
  229. package/dist/bin/chunk-yv9sth30.js +0 -1
  230. package/dist/chunk-01d86gt1.js +0 -1324
  231. package/dist/chunk-050r7ycy.js +0 -46516
  232. package/dist/chunk-1c8dbv57.js +0 -7278
  233. package/dist/chunk-29rse4p1.js +0 -12203
  234. package/dist/chunk-32e7ya18.js +0 -642
  235. package/dist/chunk-4cjrg98a.js +0 -597
  236. package/dist/chunk-50jpda9q.js +0 -371
  237. package/dist/chunk-6a1t7fnq.js +0 -12121
  238. package/dist/chunk-728jvrr0.js +0 -1701
  239. package/dist/chunk-7m60qnc8.js +0 -1762
  240. package/dist/chunk-aa2dkn7b.js +0 -205
  241. package/dist/chunk-d48vtdj4.js +0 -433
  242. package/dist/chunk-f55nkpvb.js +0 -8
  243. package/dist/chunk-fgk8cqew.js +0 -152
  244. package/dist/chunk-he9a874b.js +0 -769
  245. package/dist/chunk-k2yyatfw.js +0 -10
  246. package/dist/chunk-k4px0bnv.js +0 -23
  247. package/dist/chunk-nsgqsmrh.js +0 -1779
  248. package/dist/chunk-q0st3se8.js +0 -42033
  249. package/dist/chunk-qr803fye.js +0 -2122
  250. package/dist/chunk-rds0sy87.js +0 -1771
  251. package/dist/chunk-ttz2ra5j.js +0 -12
  252. package/dist/chunk-v0bahtg2.js +0 -4
  253. package/dist/chunk-va2yd85b.js +0 -200
  254. package/dist/chunk-x9s0cqfx.js +0 -13
  255. package/dist/chunk-zqtpg06c.js +0 -1752
@@ -1,769 +0,0 @@
1
- import {
2
- AWSClient,
3
- buildQueryParams
4
- } from "./chunk-zqtpg06c.js";
5
-
6
- // src/aws/rds.ts
7
- class RDSClient {
8
- client;
9
- region;
10
- constructor(region = "us-east-1") {
11
- this.region = region;
12
- this.client = new AWSClient;
13
- }
14
- async describeDBInstances(options) {
15
- const params = {
16
- Action: "DescribeDBInstances",
17
- Version: "2014-10-31"
18
- };
19
- if (options?.DBInstanceIdentifier) {
20
- params.DBInstanceIdentifier = options.DBInstanceIdentifier;
21
- }
22
- if (options?.MaxRecords) {
23
- params.MaxRecords = options.MaxRecords;
24
- }
25
- if (options?.Marker) {
26
- params.Marker = options.Marker;
27
- }
28
- if (options?.Filters) {
29
- options.Filters.forEach((filter, i) => {
30
- params[`Filters.Filter.${i + 1}.Name`] = filter.Name;
31
- filter.Values.forEach((value, j) => {
32
- params[`Filters.Filter.${i + 1}.Values.Value.${j + 1}`] = value;
33
- });
34
- });
35
- }
36
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
37
- const result = await this.client.request({
38
- service: "rds",
39
- region: this.region,
40
- method: "POST",
41
- path: "/",
42
- headers: {
43
- "Content-Type": "application/x-www-form-urlencoded"
44
- },
45
- body: queryString
46
- });
47
- const response = result.DescribeDBInstancesResult || result;
48
- let instances = response.DBInstances?.DBInstance || [];
49
- if (!Array.isArray(instances)) {
50
- instances = instances ? [instances] : [];
51
- }
52
- return {
53
- DBInstances: instances,
54
- Marker: response.Marker
55
- };
56
- }
57
- async describeDBInstance(dbInstanceIdentifier) {
58
- const result = await this.describeDBInstances({
59
- DBInstanceIdentifier: dbInstanceIdentifier
60
- });
61
- return result.DBInstances?.[0];
62
- }
63
- async describeDBClusters(options) {
64
- const params = {
65
- Action: "DescribeDBClusters",
66
- Version: "2014-10-31"
67
- };
68
- if (options?.DBClusterIdentifier) {
69
- params.DBClusterIdentifier = options.DBClusterIdentifier;
70
- }
71
- if (options?.MaxRecords) {
72
- params.MaxRecords = options.MaxRecords;
73
- }
74
- if (options?.Marker) {
75
- params.Marker = options.Marker;
76
- }
77
- if (options?.Filters) {
78
- options.Filters.forEach((filter, i) => {
79
- params[`Filters.Filter.${i + 1}.Name`] = filter.Name;
80
- filter.Values.forEach((value, j) => {
81
- params[`Filters.Filter.${i + 1}.Values.Value.${j + 1}`] = value;
82
- });
83
- });
84
- }
85
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
86
- const result = await this.client.request({
87
- service: "rds",
88
- region: this.region,
89
- method: "POST",
90
- path: "/",
91
- headers: {
92
- "Content-Type": "application/x-www-form-urlencoded"
93
- },
94
- body: queryString
95
- });
96
- const response = result.DescribeDBClustersResult || result;
97
- let clusters = response.DBClusters?.DBCluster || [];
98
- if (!Array.isArray(clusters)) {
99
- clusters = clusters ? [clusters] : [];
100
- }
101
- return {
102
- DBClusters: clusters,
103
- Marker: response.Marker
104
- };
105
- }
106
- async describeDBSnapshots(options) {
107
- const params = {
108
- Action: "DescribeDBSnapshots",
109
- Version: "2014-10-31"
110
- };
111
- if (options?.DBInstanceIdentifier) {
112
- params.DBInstanceIdentifier = options.DBInstanceIdentifier;
113
- }
114
- if (options?.DBSnapshotIdentifier) {
115
- params.DBSnapshotIdentifier = options.DBSnapshotIdentifier;
116
- }
117
- if (options?.SnapshotType) {
118
- params.SnapshotType = options.SnapshotType;
119
- }
120
- if (options?.MaxRecords) {
121
- params.MaxRecords = options.MaxRecords;
122
- }
123
- if (options?.Marker) {
124
- params.Marker = options.Marker;
125
- }
126
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
127
- const result = await this.client.request({
128
- service: "rds",
129
- region: this.region,
130
- method: "POST",
131
- path: "/",
132
- headers: {
133
- "Content-Type": "application/x-www-form-urlencoded"
134
- },
135
- body: queryString
136
- });
137
- const response = result.DescribeDBSnapshotsResult || result;
138
- let snapshots = response.DBSnapshots?.DBSnapshot || [];
139
- if (!Array.isArray(snapshots)) {
140
- snapshots = snapshots ? [snapshots] : [];
141
- }
142
- return {
143
- DBSnapshots: snapshots,
144
- Marker: response.Marker
145
- };
146
- }
147
- async describeDBSubnetGroups(options) {
148
- const params = {
149
- Action: "DescribeDBSubnetGroups",
150
- Version: "2014-10-31"
151
- };
152
- if (options?.DBSubnetGroupName) {
153
- params.DBSubnetGroupName = options.DBSubnetGroupName;
154
- }
155
- if (options?.MaxRecords) {
156
- params.MaxRecords = options.MaxRecords;
157
- }
158
- if (options?.Marker) {
159
- params.Marker = options.Marker;
160
- }
161
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
162
- const result = await this.client.request({
163
- service: "rds",
164
- region: this.region,
165
- method: "POST",
166
- path: "/",
167
- headers: {
168
- "Content-Type": "application/x-www-form-urlencoded"
169
- },
170
- body: queryString
171
- });
172
- const response = result.DescribeDBSubnetGroupsResult || result;
173
- let groups = response.DBSubnetGroups?.DBSubnetGroup || [];
174
- if (!Array.isArray(groups)) {
175
- groups = groups ? [groups] : [];
176
- }
177
- return {
178
- DBSubnetGroups: groups,
179
- Marker: response.Marker
180
- };
181
- }
182
- async createDBInstance(options) {
183
- const params = {
184
- Action: "CreateDBInstance",
185
- Version: "2014-10-31",
186
- DBInstanceIdentifier: options.DBInstanceIdentifier,
187
- DBInstanceClass: options.DBInstanceClass,
188
- Engine: options.Engine
189
- };
190
- if (options.DBClusterIdentifier)
191
- params.DBClusterIdentifier = options.DBClusterIdentifier;
192
- if (options.MasterUsername)
193
- params.MasterUsername = options.MasterUsername;
194
- if (options.MasterUserPassword)
195
- params.MasterUserPassword = options.MasterUserPassword;
196
- if (options.DBName)
197
- params.DBName = options.DBName;
198
- if (options.AllocatedStorage)
199
- params.AllocatedStorage = options.AllocatedStorage;
200
- if (options.DBSubnetGroupName)
201
- params.DBSubnetGroupName = options.DBSubnetGroupName;
202
- if (options.AvailabilityZone)
203
- params.AvailabilityZone = options.AvailabilityZone;
204
- if (options.PreferredMaintenanceWindow)
205
- params.PreferredMaintenanceWindow = options.PreferredMaintenanceWindow;
206
- if (options.PreferredBackupWindow)
207
- params.PreferredBackupWindow = options.PreferredBackupWindow;
208
- if (options.BackupRetentionPeriod !== undefined)
209
- params.BackupRetentionPeriod = options.BackupRetentionPeriod;
210
- if (options.MultiAZ !== undefined)
211
- params.MultiAZ = options.MultiAZ;
212
- if (options.EngineVersion)
213
- params.EngineVersion = options.EngineVersion;
214
- if (options.AutoMinorVersionUpgrade !== undefined)
215
- params.AutoMinorVersionUpgrade = options.AutoMinorVersionUpgrade;
216
- if (options.LicenseModel)
217
- params.LicenseModel = options.LicenseModel;
218
- if (options.PubliclyAccessible !== undefined)
219
- params.PubliclyAccessible = options.PubliclyAccessible;
220
- if (options.StorageType)
221
- params.StorageType = options.StorageType;
222
- if (options.StorageEncrypted !== undefined)
223
- params.StorageEncrypted = options.StorageEncrypted;
224
- if (options.KmsKeyId)
225
- params.KmsKeyId = options.KmsKeyId;
226
- if (options.DeletionProtection !== undefined)
227
- params.DeletionProtection = options.DeletionProtection;
228
- if (options.VpcSecurityGroupIds) {
229
- options.VpcSecurityGroupIds.forEach((id, i) => {
230
- params[`VpcSecurityGroupIds.VpcSecurityGroupId.${i + 1}`] = id;
231
- });
232
- }
233
- if (options.Tags) {
234
- options.Tags.forEach((tag, i) => {
235
- params[`Tags.Tag.${i + 1}.Key`] = tag.Key;
236
- params[`Tags.Tag.${i + 1}.Value`] = tag.Value;
237
- });
238
- }
239
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
240
- const result = await this.client.request({
241
- service: "rds",
242
- region: this.region,
243
- method: "POST",
244
- path: "/",
245
- headers: {
246
- "Content-Type": "application/x-www-form-urlencoded"
247
- },
248
- body: queryString
249
- });
250
- const response = result.CreateDBInstanceResult || result;
251
- return {
252
- DBInstance: response.DBInstance
253
- };
254
- }
255
- async createDBCluster(options) {
256
- const params = {
257
- Action: "CreateDBCluster",
258
- Version: "2014-10-31",
259
- DBClusterIdentifier: options.DBClusterIdentifier,
260
- Engine: options.Engine
261
- };
262
- if (options.EngineVersion)
263
- params.EngineVersion = options.EngineVersion;
264
- if (options.MasterUsername)
265
- params.MasterUsername = options.MasterUsername;
266
- if (options.MasterUserPassword)
267
- params.MasterUserPassword = options.MasterUserPassword;
268
- if (options.DatabaseName)
269
- params.DatabaseName = options.DatabaseName;
270
- if (options.DBSubnetGroupName)
271
- params.DBSubnetGroupName = options.DBSubnetGroupName;
272
- if (options.BackupRetentionPeriod !== undefined)
273
- params.BackupRetentionPeriod = options.BackupRetentionPeriod;
274
- if (options.StorageEncrypted !== undefined)
275
- params.StorageEncrypted = options.StorageEncrypted;
276
- if (options.KmsKeyId)
277
- params.KmsKeyId = options.KmsKeyId;
278
- if (options.DeletionProtection !== undefined)
279
- params.DeletionProtection = options.DeletionProtection;
280
- if (options.ServerlessV2ScalingConfiguration) {
281
- params["ServerlessV2ScalingConfiguration.MinCapacity"] = options.ServerlessV2ScalingConfiguration.MinCapacity;
282
- params["ServerlessV2ScalingConfiguration.MaxCapacity"] = options.ServerlessV2ScalingConfiguration.MaxCapacity;
283
- }
284
- options.VpcSecurityGroupIds?.forEach((id, index) => {
285
- params[`VpcSecurityGroupIds.VpcSecurityGroupId.${index + 1}`] = id;
286
- });
287
- const result = await this.client.request({
288
- service: "rds",
289
- region: this.region,
290
- method: "POST",
291
- path: "/",
292
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
293
- body: new URLSearchParams(buildQueryParams(params)).toString()
294
- });
295
- const response = result.CreateDBClusterResult || result;
296
- return { DBCluster: response.DBCluster };
297
- }
298
- async deleteDBInstance(options) {
299
- const params = {
300
- Action: "DeleteDBInstance",
301
- Version: "2014-10-31",
302
- DBInstanceIdentifier: options.DBInstanceIdentifier
303
- };
304
- if (options.SkipFinalSnapshot !== undefined) {
305
- params.SkipFinalSnapshot = options.SkipFinalSnapshot;
306
- }
307
- if (options.FinalDBSnapshotIdentifier) {
308
- params.FinalDBSnapshotIdentifier = options.FinalDBSnapshotIdentifier;
309
- }
310
- if (options.DeleteAutomatedBackups !== undefined) {
311
- params.DeleteAutomatedBackups = options.DeleteAutomatedBackups;
312
- }
313
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
314
- const result = await this.client.request({
315
- service: "rds",
316
- region: this.region,
317
- method: "POST",
318
- path: "/",
319
- headers: {
320
- "Content-Type": "application/x-www-form-urlencoded"
321
- },
322
- body: queryString
323
- });
324
- const response = result.DeleteDBInstanceResult || result;
325
- return {
326
- DBInstance: response.DBInstance
327
- };
328
- }
329
- async modifyDBInstance(options) {
330
- const params = {
331
- Action: "ModifyDBInstance",
332
- Version: "2014-10-31",
333
- DBInstanceIdentifier: options.DBInstanceIdentifier
334
- };
335
- if (options.DBInstanceClass)
336
- params.DBInstanceClass = options.DBInstanceClass;
337
- if (options.AllocatedStorage)
338
- params.AllocatedStorage = options.AllocatedStorage;
339
- if (options.MasterUserPassword)
340
- params.MasterUserPassword = options.MasterUserPassword;
341
- if (options.BackupRetentionPeriod !== undefined)
342
- params.BackupRetentionPeriod = options.BackupRetentionPeriod;
343
- if (options.PreferredBackupWindow)
344
- params.PreferredBackupWindow = options.PreferredBackupWindow;
345
- if (options.PreferredMaintenanceWindow)
346
- params.PreferredMaintenanceWindow = options.PreferredMaintenanceWindow;
347
- if (options.MultiAZ !== undefined)
348
- params.MultiAZ = options.MultiAZ;
349
- if (options.EngineVersion)
350
- params.EngineVersion = options.EngineVersion;
351
- if (options.AutoMinorVersionUpgrade !== undefined)
352
- params.AutoMinorVersionUpgrade = options.AutoMinorVersionUpgrade;
353
- if (options.PubliclyAccessible !== undefined)
354
- params.PubliclyAccessible = options.PubliclyAccessible;
355
- if (options.ApplyImmediately !== undefined)
356
- params.ApplyImmediately = options.ApplyImmediately;
357
- if (options.StorageType)
358
- params.StorageType = options.StorageType;
359
- if (options.DeletionProtection !== undefined)
360
- params.DeletionProtection = options.DeletionProtection;
361
- if (options.VpcSecurityGroupIds) {
362
- options.VpcSecurityGroupIds.forEach((id, i) => {
363
- params[`VpcSecurityGroupIds.VpcSecurityGroupId.${i + 1}`] = id;
364
- });
365
- }
366
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
367
- const result = await this.client.request({
368
- service: "rds",
369
- region: this.region,
370
- method: "POST",
371
- path: "/",
372
- headers: {
373
- "Content-Type": "application/x-www-form-urlencoded"
374
- },
375
- body: queryString
376
- });
377
- const response = result.ModifyDBInstanceResult || result;
378
- return {
379
- DBInstance: response.DBInstance
380
- };
381
- }
382
- async modifyDBCluster(options) {
383
- const params = {
384
- Action: "ModifyDBCluster",
385
- Version: "2014-10-31",
386
- DBClusterIdentifier: options.DBClusterIdentifier
387
- };
388
- if (options.ServerlessV2ScalingConfiguration) {
389
- params["ServerlessV2ScalingConfiguration.MinCapacity"] = options.ServerlessV2ScalingConfiguration.MinCapacity;
390
- params["ServerlessV2ScalingConfiguration.MaxCapacity"] = options.ServerlessV2ScalingConfiguration.MaxCapacity;
391
- }
392
- if (options.BackupRetentionPeriod !== undefined)
393
- params.BackupRetentionPeriod = options.BackupRetentionPeriod;
394
- if (options.EngineVersion)
395
- params.EngineVersion = options.EngineVersion;
396
- if (options.MasterUserPassword)
397
- params.MasterUserPassword = options.MasterUserPassword;
398
- if (options.DeletionProtection !== undefined)
399
- params.DeletionProtection = options.DeletionProtection;
400
- if (options.ApplyImmediately !== undefined)
401
- params.ApplyImmediately = options.ApplyImmediately;
402
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
403
- const result = await this.client.request({
404
- service: "rds",
405
- region: this.region,
406
- method: "POST",
407
- path: "/",
408
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
409
- body: queryString
410
- });
411
- const response = result.ModifyDBClusterResult || result;
412
- return { DBCluster: response.DBCluster };
413
- }
414
- async rebootDBCluster(dbClusterIdentifier) {
415
- const params = {
416
- Action: "FailoverDBCluster",
417
- Version: "2014-10-31",
418
- DBClusterIdentifier: dbClusterIdentifier
419
- };
420
- const result = await this.client.request({
421
- service: "rds",
422
- region: this.region,
423
- method: "POST",
424
- path: "/",
425
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
426
- body: new URLSearchParams(buildQueryParams(params)).toString()
427
- });
428
- const response = result.FailoverDBClusterResult || result;
429
- return { DBCluster: response.DBCluster };
430
- }
431
- async createDBClusterSnapshot(dbClusterIdentifier, snapshotIdentifier) {
432
- const params = {
433
- Action: "CreateDBClusterSnapshot",
434
- Version: "2014-10-31",
435
- DBClusterIdentifier: dbClusterIdentifier,
436
- DBClusterSnapshotIdentifier: snapshotIdentifier
437
- };
438
- return this.client.request({
439
- service: "rds",
440
- region: this.region,
441
- method: "POST",
442
- path: "/",
443
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
444
- body: new URLSearchParams(buildQueryParams(params)).toString()
445
- });
446
- }
447
- async describeDBClusterSnapshots(options = {}) {
448
- const params = {
449
- Action: "DescribeDBClusterSnapshots",
450
- Version: "2014-10-31",
451
- ...options
452
- };
453
- const result = await this.client.request({
454
- service: "rds",
455
- region: this.region,
456
- method: "POST",
457
- path: "/",
458
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
459
- body: new URLSearchParams(buildQueryParams(params)).toString()
460
- });
461
- const response = result.DescribeDBClusterSnapshotsResult || result;
462
- const snapshots = response.DBClusterSnapshots?.DBClusterSnapshot ?? response.DBClusterSnapshots ?? [];
463
- return { DBClusterSnapshots: Array.isArray(snapshots) ? snapshots : [snapshots] };
464
- }
465
- async deleteDBClusterSnapshot(snapshotIdentifier) {
466
- await this.client.request({
467
- service: "rds",
468
- region: this.region,
469
- method: "POST",
470
- path: "/",
471
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
472
- body: new URLSearchParams(buildQueryParams({
473
- Action: "DeleteDBClusterSnapshot",
474
- Version: "2014-10-31",
475
- DBClusterSnapshotIdentifier: snapshotIdentifier
476
- })).toString()
477
- });
478
- }
479
- async deleteDBCluster(dbClusterIdentifier, finalSnapshotIdentifier) {
480
- const params = {
481
- Action: "DeleteDBCluster",
482
- Version: "2014-10-31",
483
- DBClusterIdentifier: dbClusterIdentifier,
484
- SkipFinalSnapshot: !finalSnapshotIdentifier
485
- };
486
- if (finalSnapshotIdentifier)
487
- params.FinalDBSnapshotIdentifier = finalSnapshotIdentifier;
488
- const result = await this.client.request({
489
- service: "rds",
490
- region: this.region,
491
- method: "POST",
492
- path: "/",
493
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
494
- body: new URLSearchParams(buildQueryParams(params)).toString()
495
- });
496
- const response = result.DeleteDBClusterResult || result;
497
- return { DBCluster: response.DBCluster };
498
- }
499
- async restoreDBClusterToPointInTime(options) {
500
- const params = {
501
- Action: "RestoreDBClusterToPointInTime",
502
- Version: "2014-10-31",
503
- DBClusterIdentifier: options.DBClusterIdentifier,
504
- SourceDBClusterIdentifier: options.SourceDBClusterIdentifier
505
- };
506
- if (options.RestoreToTime)
507
- params.RestoreToTime = options.RestoreToTime.toISOString();
508
- if (options.UseLatestRestorableTime)
509
- params.UseLatestRestorableTime = true;
510
- if (options.DBSubnetGroupName)
511
- params.DBSubnetGroupName = options.DBSubnetGroupName;
512
- if (options.VpcSecurityGroupIds) {
513
- options.VpcSecurityGroupIds.forEach((id, i) => {
514
- params[`VpcSecurityGroupIds.VpcSecurityGroupId.${i + 1}`] = id;
515
- });
516
- }
517
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
518
- const result = await this.client.request({
519
- service: "rds",
520
- region: this.region,
521
- method: "POST",
522
- path: "/",
523
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
524
- body: queryString
525
- });
526
- const response = result.RestoreDBClusterToPointInTimeResult || result;
527
- return { DBCluster: response.DBCluster };
528
- }
529
- async restoreDBClusterFromSnapshot(options) {
530
- const params = {
531
- Action: "RestoreDBClusterFromSnapshot",
532
- Version: "2014-10-31",
533
- DBClusterIdentifier: options.DBClusterIdentifier,
534
- SnapshotIdentifier: options.SnapshotIdentifier,
535
- Engine: options.Engine
536
- };
537
- if (options.EngineVersion)
538
- params.EngineVersion = options.EngineVersion;
539
- if (options.DBSubnetGroupName)
540
- params.DBSubnetGroupName = options.DBSubnetGroupName;
541
- if (options.DeletionProtection !== undefined)
542
- params.DeletionProtection = options.DeletionProtection;
543
- options.VpcSecurityGroupIds?.forEach((id, index) => {
544
- params[`VpcSecurityGroupIds.VpcSecurityGroupId.${index + 1}`] = id;
545
- });
546
- if (options.ServerlessV2ScalingConfiguration) {
547
- params["ServerlessV2ScalingConfiguration.MinCapacity"] = options.ServerlessV2ScalingConfiguration.MinCapacity;
548
- params["ServerlessV2ScalingConfiguration.MaxCapacity"] = options.ServerlessV2ScalingConfiguration.MaxCapacity;
549
- }
550
- const result = await this.client.request({
551
- service: "rds",
552
- region: this.region,
553
- method: "POST",
554
- path: "/",
555
- headers: { "Content-Type": "application/x-www-form-urlencoded" },
556
- body: new URLSearchParams(buildQueryParams(params)).toString()
557
- });
558
- const response = result.RestoreDBClusterFromSnapshotResult || result;
559
- return { DBCluster: response.DBCluster };
560
- }
561
- async startDBInstance(dbInstanceIdentifier) {
562
- const params = {
563
- Action: "StartDBInstance",
564
- Version: "2014-10-31",
565
- DBInstanceIdentifier: dbInstanceIdentifier
566
- };
567
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
568
- const result = await this.client.request({
569
- service: "rds",
570
- region: this.region,
571
- method: "POST",
572
- path: "/",
573
- headers: {
574
- "Content-Type": "application/x-www-form-urlencoded"
575
- },
576
- body: queryString
577
- });
578
- const response = result.StartDBInstanceResult || result;
579
- return {
580
- DBInstance: response.DBInstance
581
- };
582
- }
583
- async stopDBInstance(options) {
584
- const params = {
585
- Action: "StopDBInstance",
586
- Version: "2014-10-31",
587
- DBInstanceIdentifier: options.DBInstanceIdentifier
588
- };
589
- if (options.DBSnapshotIdentifier) {
590
- params.DBSnapshotIdentifier = options.DBSnapshotIdentifier;
591
- }
592
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
593
- const result = await this.client.request({
594
- service: "rds",
595
- region: this.region,
596
- method: "POST",
597
- path: "/",
598
- headers: {
599
- "Content-Type": "application/x-www-form-urlencoded"
600
- },
601
- body: queryString
602
- });
603
- const response = result.StopDBInstanceResult || result;
604
- return {
605
- DBInstance: response.DBInstance
606
- };
607
- }
608
- async rebootDBInstance(options) {
609
- const params = {
610
- Action: "RebootDBInstance",
611
- Version: "2014-10-31",
612
- DBInstanceIdentifier: options.DBInstanceIdentifier
613
- };
614
- if (options.ForceFailover !== undefined) {
615
- params.ForceFailover = options.ForceFailover;
616
- }
617
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
618
- const result = await this.client.request({
619
- service: "rds",
620
- region: this.region,
621
- method: "POST",
622
- path: "/",
623
- headers: {
624
- "Content-Type": "application/x-www-form-urlencoded"
625
- },
626
- body: queryString
627
- });
628
- const response = result.RebootDBInstanceResult || result;
629
- return {
630
- DBInstance: response.DBInstance
631
- };
632
- }
633
- async createDBSnapshot(options) {
634
- const params = {
635
- Action: "CreateDBSnapshot",
636
- Version: "2014-10-31",
637
- DBInstanceIdentifier: options.DBInstanceIdentifier,
638
- DBSnapshotIdentifier: options.DBSnapshotIdentifier
639
- };
640
- if (options.Tags) {
641
- options.Tags.forEach((tag, i) => {
642
- params[`Tags.Tag.${i + 1}.Key`] = tag.Key;
643
- params[`Tags.Tag.${i + 1}.Value`] = tag.Value;
644
- });
645
- }
646
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
647
- const result = await this.client.request({
648
- service: "rds",
649
- region: this.region,
650
- method: "POST",
651
- path: "/",
652
- headers: {
653
- "Content-Type": "application/x-www-form-urlencoded"
654
- },
655
- body: queryString
656
- });
657
- const response = result.CreateDBSnapshotResult || result;
658
- return {
659
- DBSnapshot: response.DBSnapshot
660
- };
661
- }
662
- async deleteDBSnapshot(dbSnapshotIdentifier) {
663
- const params = {
664
- Action: "DeleteDBSnapshot",
665
- Version: "2014-10-31",
666
- DBSnapshotIdentifier: dbSnapshotIdentifier
667
- };
668
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
669
- const result = await this.client.request({
670
- service: "rds",
671
- region: this.region,
672
- method: "POST",
673
- path: "/",
674
- headers: {
675
- "Content-Type": "application/x-www-form-urlencoded"
676
- },
677
- body: queryString
678
- });
679
- const response = result.DeleteDBSnapshotResult || result;
680
- return {
681
- DBSnapshot: response.DBSnapshot
682
- };
683
- }
684
- async restoreDBInstanceFromDBSnapshot(options) {
685
- const params = {
686
- Action: "RestoreDBInstanceFromDBSnapshot",
687
- Version: "2014-10-31",
688
- DBInstanceIdentifier: options.DBInstanceIdentifier,
689
- DBSnapshotIdentifier: options.DBSnapshotIdentifier
690
- };
691
- if (options.DBInstanceClass)
692
- params.DBInstanceClass = options.DBInstanceClass;
693
- if (options.Port)
694
- params.Port = options.Port;
695
- if (options.AvailabilityZone)
696
- params.AvailabilityZone = options.AvailabilityZone;
697
- if (options.DBSubnetGroupName)
698
- params.DBSubnetGroupName = options.DBSubnetGroupName;
699
- if (options.MultiAZ !== undefined)
700
- params.MultiAZ = options.MultiAZ;
701
- if (options.PubliclyAccessible !== undefined)
702
- params.PubliclyAccessible = options.PubliclyAccessible;
703
- if (options.AutoMinorVersionUpgrade !== undefined)
704
- params.AutoMinorVersionUpgrade = options.AutoMinorVersionUpgrade;
705
- if (options.StorageType)
706
- params.StorageType = options.StorageType;
707
- if (options.DeletionProtection !== undefined)
708
- params.DeletionProtection = options.DeletionProtection;
709
- if (options.VpcSecurityGroupIds) {
710
- options.VpcSecurityGroupIds.forEach((id, i) => {
711
- params[`VpcSecurityGroupIds.VpcSecurityGroupId.${i + 1}`] = id;
712
- });
713
- }
714
- if (options.Tags) {
715
- options.Tags.forEach((tag, i) => {
716
- params[`Tags.Tag.${i + 1}.Key`] = tag.Key;
717
- params[`Tags.Tag.${i + 1}.Value`] = tag.Value;
718
- });
719
- }
720
- const queryString = new URLSearchParams(buildQueryParams(params)).toString();
721
- const result = await this.client.request({
722
- service: "rds",
723
- region: this.region,
724
- method: "POST",
725
- path: "/",
726
- headers: {
727
- "Content-Type": "application/x-www-form-urlencoded"
728
- },
729
- body: queryString
730
- });
731
- const response = result.RestoreDBInstanceFromDBSnapshotResult || result;
732
- return {
733
- DBInstance: response.DBInstance
734
- };
735
- }
736
- async waitForDBInstanceAvailable(dbInstanceIdentifier, maxAttempts = 60, delayMs = 30000) {
737
- for (let i = 0;i < maxAttempts; i++) {
738
- const instance = await this.describeDBInstance(dbInstanceIdentifier);
739
- if (instance?.DBInstanceStatus === "available") {
740
- return instance;
741
- }
742
- if (["deleted", "failed", "incompatible-restore", "incompatible-parameters"].includes(instance?.DBInstanceStatus || "")) {
743
- throw new Error(`DB instance ${dbInstanceIdentifier} is in terminal state: ${instance?.DBInstanceStatus}`);
744
- }
745
- await new Promise((resolve) => setTimeout(resolve, delayMs));
746
- }
747
- throw new Error(`Timeout waiting for DB instance ${dbInstanceIdentifier} to become available`);
748
- }
749
- async waitForDBInstanceDeleted(dbInstanceIdentifier, maxAttempts = 60, delayMs = 30000) {
750
- for (let i = 0;i < maxAttempts; i++) {
751
- try {
752
- const instance = await this.describeDBInstance(dbInstanceIdentifier);
753
- if (instance?.DBInstanceStatus === "deleting") {
754
- await new Promise((resolve) => setTimeout(resolve, delayMs));
755
- continue;
756
- }
757
- throw new Error(`DB instance ${dbInstanceIdentifier} is in state: ${instance?.DBInstanceStatus}`);
758
- } catch (error) {
759
- if (error.code === "DBInstanceNotFound" || error.code === "DBInstanceNotFoundFault") {
760
- return;
761
- }
762
- throw error;
763
- }
764
- }
765
- throw new Error(`Timeout waiting for DB instance ${dbInstanceIdentifier} to be deleted`);
766
- }
767
- }
768
-
769
- export { RDSClient };