@stacksjs/ts-cloud 0.7.56 → 0.7.58

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 (467) hide show
  1. package/dist/alerts/alerts.test.d.ts +1 -0
  2. package/dist/alerts/delivery.d.ts +45 -0
  3. package/dist/alerts/evaluator.d.ts +12 -0
  4. package/dist/alerts/health.d.ts +34 -0
  5. package/dist/alerts/index.d.ts +6 -0
  6. package/dist/alerts/model.d.ts +170 -0
  7. package/dist/alerts/store.d.ts +90 -0
  8. package/dist/alerts/telemetry.d.ts +3 -0
  9. package/dist/api/client.d.ts +197 -0
  10. package/dist/api/handler.d.ts +18 -0
  11. package/dist/api/handler.test.d.ts +1 -0
  12. package/dist/api/index.d.ts +6 -0
  13. package/dist/api/openapi.d.ts +2 -0
  14. package/dist/api/service.d.ts +28 -0
  15. package/dist/api/types.d.ts +119 -0
  16. package/dist/auth/encryption.d.ts +3 -0
  17. package/dist/auth/index.d.ts +8 -0
  18. package/dist/auth/mailer.d.ts +9 -0
  19. package/dist/auth/oidc.d.ts +36 -0
  20. package/dist/auth/oidc.test.d.ts +1 -0
  21. package/dist/auth/store.d.ts +121 -0
  22. package/dist/auth/store.test.d.ts +1 -0
  23. package/dist/auth/totp.d.ts +11 -0
  24. package/dist/auth/totp.test.d.ts +1 -0
  25. package/dist/auth/types.d.ts +138 -0
  26. package/dist/automation/index.d.ts +2 -0
  27. package/dist/automation/store.d.ts +46 -0
  28. package/dist/automation/store.test.d.ts +1 -0
  29. package/dist/automation/types.d.ts +66 -0
  30. package/dist/aws/acm.d.ts +0 -4
  31. package/dist/aws/application-autoscaling.d.ts +0 -5
  32. package/dist/aws/backup.d.ts +42 -0
  33. package/dist/aws/bedrock.d.ts +0 -5
  34. package/dist/aws/client.d.ts +3 -6
  35. package/dist/aws/cloudformation.d.ts +0 -4
  36. package/dist/aws/cloudfront-media.test.d.ts +1 -0
  37. package/dist/aws/cloudfront-origin.test.d.ts +1 -0
  38. package/dist/aws/cloudfront.d.ts +87 -3
  39. package/dist/aws/cloudwatch-logs.d.ts +2 -4
  40. package/dist/aws/cloudwatch.d.ts +1 -1
  41. package/dist/aws/comprehend.d.ts +0 -5
  42. package/dist/aws/connect.d.ts +0 -4
  43. package/dist/aws/cost-explorer-cache.d.ts +1 -15
  44. package/dist/aws/cost-explorer.d.ts +18 -9
  45. package/dist/aws/cost-explorer.test.d.ts +1 -0
  46. package/dist/aws/dynamodb.d.ts +0 -4
  47. package/dist/aws/ec2.d.ts +0 -4
  48. package/dist/aws/ecr.d.ts +0 -4
  49. package/dist/aws/ecs.d.ts +17 -7
  50. package/dist/aws/efs.d.ts +0 -4
  51. package/dist/aws/elasticache.d.ts +0 -4
  52. package/dist/aws/elbv2.d.ts +0 -7
  53. package/dist/aws/email.d.ts +0 -10
  54. package/dist/aws/eventbridge.d.ts +0 -4
  55. package/dist/aws/iam.d.ts +1 -5
  56. package/dist/aws/imap-server.d.ts +0 -7
  57. package/dist/aws/index.d.ts +4 -3
  58. package/dist/aws/index.js +31 -31
  59. package/dist/aws/kendra.d.ts +0 -5
  60. package/dist/aws/lambda.d.ts +3 -5
  61. package/dist/aws/opensearch.d.ts +0 -4
  62. package/dist/aws/personalize.d.ts +0 -5
  63. package/dist/aws/polly.d.ts +0 -5
  64. package/dist/aws/rds.d.ts +59 -4
  65. package/dist/aws/rekognition.d.ts +0 -5
  66. package/dist/aws/route53-domains.d.ts +0 -4
  67. package/dist/aws/route53.d.ts +0 -4
  68. package/dist/aws/s3.d.ts +10 -6
  69. package/dist/aws/scheduler.d.ts +0 -4
  70. package/dist/aws/secrets-manager.d.ts +0 -4
  71. package/dist/aws/setup-sms.d.ts +0 -14
  72. package/dist/aws/sms.d.ts +0 -10
  73. package/dist/aws/smtp-server.d.ts +0 -11
  74. package/dist/aws/sns.d.ts +0 -4
  75. package/dist/aws/sqs.d.ts +0 -4
  76. package/dist/aws/ssm.d.ts +0 -4
  77. package/dist/aws/sts.d.ts +0 -4
  78. package/dist/aws/support.d.ts +0 -4
  79. package/dist/aws/textract.d.ts +0 -5
  80. package/dist/aws/transcribe.d.ts +0 -4
  81. package/dist/aws/translate.d.ts +0 -5
  82. package/dist/aws/voice.d.ts +0 -11
  83. package/dist/aws/xray.d.ts +1 -0
  84. package/dist/backups/aws-database-source.d.ts +19 -0
  85. package/dist/backups/aws-database-source.test.d.ts +1 -0
  86. package/dist/backups/aws-infrastructure-source.d.ts +43 -0
  87. package/dist/backups/aws-infrastructure-source.test.d.ts +1 -0
  88. package/dist/backups/control-plane-source.d.ts +16 -0
  89. package/dist/backups/control-plane-source.test.d.ts +1 -0
  90. package/dist/backups/docker-volume-source.d.ts +31 -0
  91. package/dist/backups/docker-volume-source.test.d.ts +1 -0
  92. package/dist/backups/filesystem-source.d.ts +34 -0
  93. package/dist/backups/filesystem-source.test.d.ts +1 -0
  94. package/dist/backups/index.d.ts +10 -0
  95. package/dist/backups/logical-database-source.d.ts +16 -0
  96. package/dist/backups/logical-database-source.test.d.ts +1 -0
  97. package/dist/backups/model.d.ts +121 -0
  98. package/dist/backups/s3-destination.d.ts +85 -0
  99. package/dist/backups/s3-destination.test.d.ts +1 -0
  100. package/dist/backups/service.d.ts +80 -0
  101. package/dist/backups/service.test.d.ts +1 -0
  102. package/dist/backups/store.d.ts +30 -0
  103. package/dist/backups/store.test.d.ts +1 -0
  104. package/dist/bin/cli.js +3360 -1802
  105. package/dist/{chunk-tjjgajbh.js → chunk-01d86gt1.js} +301 -9
  106. package/dist/{chunk-73vcqg6z.js → chunk-0z43x8re.js} +7 -7
  107. package/dist/{chunk-tnztxpcb.js → chunk-32e7ya18.js} +61 -49
  108. package/dist/{chunk-qpj3edwz.js → chunk-4cjrg98a.js} +3 -7
  109. package/dist/{chunk-hsk6fe6x.js → chunk-50jpda9q.js} +2 -2
  110. package/dist/{chunk-93hjhs78.js → chunk-703nkybg.js} +1 -1
  111. package/dist/{chunk-d5vqwj8s.js → chunk-9m6b4m74.js} +755 -720
  112. package/dist/chunk-e05phx5f.js +10 -0
  113. package/dist/{chunk-f29w04w5.js → chunk-exbcsab2.js} +10 -4
  114. package/dist/{chunk-eq08r166.js → chunk-f55nkpvb.js} +2 -2
  115. package/dist/{chunk-3bfv1z4v.js → chunk-fv1bj3yt.js} +63 -56
  116. package/dist/chunk-fw3q88wk.js +48641 -0
  117. package/dist/{chunk-3knnr7wh.js → chunk-he9a874b.js} +170 -2
  118. package/dist/{chunk-zn0nxxa8.js → chunk-hpv68b4a.js} +1070 -1070
  119. package/dist/chunk-k114qwg9.js +12 -0
  120. package/dist/{chunk-r16e02bc.js → chunk-vdk53yyq.js} +3900 -4101
  121. package/dist/{chunk-jp2a8yad.js → chunk-vvkd46k1.js} +15 -13
  122. package/dist/{chunk-vd87cpvn.js → chunk-wj3s95p9.js} +62 -46
  123. package/dist/{chunk-mj1tmhte.js → chunk-x9s0cqfx.js} +1 -1
  124. package/dist/{chunk-3rsfns7x.js → chunk-ybcz6sxc.js} +2048 -387
  125. package/dist/{chunk-arsh1g5h.js → chunk-zqtpg06c.js} +14 -11
  126. package/dist/compose/index.d.ts +6 -0
  127. package/dist/compose/parser.d.ts +13 -0
  128. package/dist/compose/parser.test.d.ts +1 -0
  129. package/dist/compose/runtime.d.ts +10 -0
  130. package/dist/compose/service.d.ts +18 -0
  131. package/dist/compose/store.d.ts +59 -0
  132. package/dist/compose/store.test.d.ts +1 -0
  133. package/dist/compose/templates.d.ts +17 -0
  134. package/dist/compose/types.d.ts +164 -0
  135. package/dist/configuration/backends.d.ts +66 -0
  136. package/dist/configuration/backends.test.d.ts +1 -0
  137. package/dist/configuration/dotenv.d.ts +14 -0
  138. package/dist/configuration/dotenv.test.d.ts +1 -0
  139. package/dist/configuration/index.d.ts +6 -0
  140. package/dist/configuration/migrate.d.ts +10 -0
  141. package/dist/configuration/migrate.test.d.ts +1 -0
  142. package/dist/configuration/model.d.ts +50 -0
  143. package/dist/configuration/service.d.ts +144 -0
  144. package/dist/configuration/service.test.d.ts +1 -0
  145. package/dist/configuration/store.d.ts +33 -0
  146. package/dist/configuration/store.test.d.ts +1 -0
  147. package/dist/control-plane/authorization.d.ts +24 -0
  148. package/dist/control-plane/authorization.test.d.ts +1 -0
  149. package/dist/control-plane/index.d.ts +8 -0
  150. package/dist/control-plane/migrations.d.ts +7 -0
  151. package/dist/control-plane/search.d.ts +25 -0
  152. package/dist/control-plane/store.d.ts +117 -0
  153. package/dist/control-plane/store.test.d.ts +1 -0
  154. package/dist/control-plane/types.d.ts +381 -0
  155. package/dist/cost/reporting.d.ts +24 -0
  156. package/dist/cost/reporting.test.d.ts +1 -0
  157. package/dist/cost/resource-inventory.d.ts +32 -0
  158. package/dist/cost/resource-inventory.test.d.ts +1 -0
  159. package/dist/cost/resource-optimization.d.ts +59 -0
  160. package/dist/cost/resource-optimization.test.d.ts +1 -0
  161. package/dist/data-services/adapters.d.ts +39 -0
  162. package/dist/data-services/aws-transports.d.ts +29 -0
  163. package/dist/data-services/aws-transports.test.d.ts +1 -0
  164. package/dist/data-services/capabilities.d.ts +2 -0
  165. package/dist/data-services/data-services.test.d.ts +1 -0
  166. package/dist/data-services/docker-transport.d.ts +55 -0
  167. package/dist/data-services/docker-transport.test.d.ts +1 -0
  168. package/dist/data-services/index.d.ts +8 -0
  169. package/dist/data-services/model.d.ts +79 -0
  170. package/dist/data-services/secrets.d.ts +13 -0
  171. package/dist/data-services/secrets.test.d.ts +1 -0
  172. package/dist/data-services/service.d.ts +51 -0
  173. package/dist/data-services/store.d.ts +17 -0
  174. package/dist/deploy/container-image.d.ts +28 -0
  175. package/dist/deploy/container-image.test.d.ts +1 -0
  176. package/dist/deploy/dashboard-audit.test.d.ts +1 -0
  177. package/dist/deploy/dashboard-auth.d.ts +4 -23
  178. package/dist/deploy/dashboard-backups.integration.test.d.ts +1 -0
  179. package/dist/deploy/dashboard-configuration.integration.test.d.ts +1 -0
  180. package/dist/deploy/dashboard-control-plane.d.ts +37 -0
  181. package/dist/deploy/dashboard-control-plane.test.d.ts +1 -0
  182. package/dist/deploy/dashboard-data-services.integration.test.d.ts +1 -0
  183. package/dist/deploy/dashboard-environment-scope.test.d.ts +1 -0
  184. package/dist/deploy/dashboard-guard.d.ts +12 -0
  185. package/dist/deploy/dashboard-guard.test.d.ts +1 -0
  186. package/dist/deploy/dashboard-identities.d.ts +15 -0
  187. package/dist/deploy/dashboard-identities.test.d.ts +1 -0
  188. package/dist/deploy/dashboard-jobs.integration.test.d.ts +1 -0
  189. package/dist/deploy/dashboard-login-page.d.ts +5 -5
  190. package/dist/deploy/dashboard-login-page.test.d.ts +1 -0
  191. package/dist/deploy/dashboard-oidc.integration.test.d.ts +1 -0
  192. package/dist/deploy/dashboard-onboarding.integration.test.d.ts +1 -0
  193. package/dist/deploy/dashboard-policy.d.ts +4 -2
  194. package/dist/deploy/dashboard-queue-worker.integration.test.d.ts +1 -0
  195. package/dist/deploy/dashboard-release.integration.test.d.ts +1 -0
  196. package/dist/deploy/dashboard-route-manifest.d.ts +14 -0
  197. package/dist/deploy/dashboard-route-manifest.test.d.ts +1 -0
  198. package/dist/deploy/dashboard-security.integration.test.d.ts +1 -0
  199. package/dist/deploy/dashboard-session.d.ts +3 -14
  200. package/dist/deploy/dashboard-source.integration.test.d.ts +1 -0
  201. package/dist/deploy/dashboard-users.d.ts +3 -0
  202. package/dist/deploy/fullstack-container.d.ts +87 -0
  203. package/dist/deploy/fullstack-container.test.d.ts +1 -0
  204. package/dist/deploy/index.d.ts +7 -2
  205. package/dist/deploy/index.js +65 -25
  206. package/dist/deploy/local-dashboard-server.d.ts +30 -0
  207. package/dist/deploy/quick-deploy.d.ts +1 -1
  208. package/dist/deploy/serverless-operations.d.ts +1 -0
  209. package/dist/deploy/site-target.d.ts +16 -0
  210. package/dist/deploy/static-api-origin.d.ts +107 -0
  211. package/dist/deploy/static-api-origin.test.d.ts +1 -0
  212. package/dist/deploy/static-site-helper.d.ts +0 -16
  213. package/dist/deploy/telemetry-access.d.ts +5 -0
  214. package/dist/deploy/telemetry-access.test.d.ts +1 -0
  215. package/dist/deploy/telemetry-collection.d.ts +44 -0
  216. package/dist/deploy/telemetry-collection.test.d.ts +1 -0
  217. package/dist/dns/index.js +3 -3
  218. package/dist/dns/route53-adapter.d.ts +1 -1
  219. package/dist/drivers/hetzner/cloud-init.d.ts +1 -1
  220. package/dist/drivers/index.d.ts +2 -2
  221. package/dist/drivers/index.js +6 -6
  222. package/dist/drivers/shared/notifications.d.ts +1 -1
  223. package/dist/drivers/shared/rpx-gateway.d.ts +1 -0
  224. package/dist/fleet/fleet.test.d.ts +1 -0
  225. package/dist/fleet/index.d.ts +144 -0
  226. package/dist/fleet/queue.d.ts +3 -0
  227. package/dist/fleet/ssh-driver.d.ts +34 -0
  228. package/dist/index.d.ts +28 -4
  229. package/dist/index.js +1132 -424
  230. package/dist/jobs/adapters.d.ts +23 -0
  231. package/dist/jobs/index.d.ts +7 -0
  232. package/dist/jobs/jobs.test.d.ts +1 -0
  233. package/dist/jobs/model.d.ts +100 -0
  234. package/dist/jobs/provider-adapters.d.ts +49 -0
  235. package/dist/jobs/reconcile.d.ts +19 -0
  236. package/dist/jobs/schedule.d.ts +9 -0
  237. package/dist/jobs/service.d.ts +30 -0
  238. package/dist/jobs/store.d.ts +48 -0
  239. package/dist/maintenance/drivers.d.ts +117 -0
  240. package/dist/maintenance/index.d.ts +6 -0
  241. package/dist/maintenance/maintenance.test.d.ts +1 -0
  242. package/dist/maintenance/manifest.d.ts +15 -0
  243. package/dist/maintenance/queue.d.ts +9 -0
  244. package/dist/maintenance/service.d.ts +31 -0
  245. package/dist/maintenance/store.d.ts +84 -0
  246. package/dist/maintenance/types.d.ts +192 -0
  247. package/dist/media.d.ts +62 -0
  248. package/dist/media.test.d.ts +1 -0
  249. package/dist/object-storage/index.d.ts +0 -24
  250. package/dist/onboarding/archive.d.ts +12 -0
  251. package/dist/onboarding/artifact-store.d.ts +22 -0
  252. package/dist/onboarding/detection.d.ts +8 -0
  253. package/dist/onboarding/index.d.ts +9 -0
  254. package/dist/onboarding/migrations.d.ts +3 -0
  255. package/dist/onboarding/onboarding.test.d.ts +1 -0
  256. package/dist/onboarding/plan.d.ts +3 -0
  257. package/dist/onboarding/registry.d.ts +41 -0
  258. package/dist/onboarding/service.d.ts +16 -0
  259. package/dist/onboarding/store.d.ts +30 -0
  260. package/dist/onboarding/types.d.ts +204 -0
  261. package/dist/placement/builds.d.ts +20 -0
  262. package/dist/placement/drivers.d.ts +54 -0
  263. package/dist/placement/index.d.ts +6 -0
  264. package/dist/placement/placement.test.d.ts +1 -0
  265. package/dist/placement/queue.d.ts +4 -0
  266. package/dist/placement/service.d.ts +34 -0
  267. package/dist/placement/store.d.ts +49 -0
  268. package/dist/placement/types.d.ts +109 -0
  269. package/dist/preview/index.d.ts +3 -0
  270. package/dist/preview/service.d.ts +45 -0
  271. package/dist/preview/service.test.d.ts +1 -0
  272. package/dist/preview/store.d.ts +47 -0
  273. package/dist/preview/store.test.d.ts +1 -0
  274. package/dist/preview/types.d.ts +99 -0
  275. package/dist/push/apns.d.ts +0 -26
  276. package/dist/push/fcm.d.ts +0 -23
  277. package/dist/push/index.d.ts +2 -2
  278. package/dist/push/index.js +1 -1
  279. package/dist/queue/deployment-handlers.d.ts +27 -0
  280. package/dist/queue/deployment-handlers.test.d.ts +1 -0
  281. package/dist/queue/index.d.ts +4 -0
  282. package/dist/queue/queue.d.ts +57 -0
  283. package/dist/queue/queue.test.d.ts +1 -0
  284. package/dist/queue/types.d.ts +93 -0
  285. package/dist/queue/worker.d.ts +32 -0
  286. package/dist/queue/worker.test.d.ts +1 -0
  287. package/dist/regions/drivers.d.ts +139 -0
  288. package/dist/regions/index.d.ts +5 -0
  289. package/dist/regions/queue.d.ts +4 -0
  290. package/dist/regions/regions.test.d.ts +1 -0
  291. package/dist/regions/service.d.ts +23 -0
  292. package/dist/regions/store.d.ts +41 -0
  293. package/dist/regions/types.d.ts +132 -0
  294. package/dist/release/index.d.ts +6 -0
  295. package/dist/release/queue.d.ts +15 -0
  296. package/dist/release/queue.test.d.ts +1 -0
  297. package/dist/release/runtime.d.ts +35 -0
  298. package/dist/release/runtime.test.d.ts +1 -0
  299. package/dist/release/service.d.ts +28 -0
  300. package/dist/release/store.d.ts +88 -0
  301. package/dist/release/store.test.d.ts +1 -0
  302. package/dist/release/strategy.d.ts +8 -0
  303. package/dist/release/types.d.ts +103 -0
  304. package/dist/runtime/adapters/aws.d.ts +5 -0
  305. package/dist/runtime/adapters/docker.d.ts +53 -0
  306. package/dist/runtime/adapters/systemd.d.ts +26 -0
  307. package/dist/runtime/index.d.ts +9 -0
  308. package/dist/runtime/inventory.d.ts +6 -0
  309. package/dist/runtime/model.d.ts +130 -0
  310. package/dist/runtime/normalize.d.ts +5 -0
  311. package/dist/runtime/operations.d.ts +113 -0
  312. package/dist/runtime/service.d.ts +32 -0
  313. package/dist/runtime/streams.d.ts +49 -0
  314. package/dist/security/artifacts.d.ts +105 -0
  315. package/dist/security/artifacts.test.d.ts +1 -0
  316. package/dist/security/container-release.d.ts +35 -0
  317. package/dist/security/container-release.test.d.ts +1 -0
  318. package/dist/security/index.d.ts +8 -0
  319. package/dist/security/integration.d.ts +41 -0
  320. package/dist/security/integration.test.d.ts +1 -0
  321. package/dist/security/posture-store.d.ts +80 -0
  322. package/dist/security/posture-store.test.d.ts +1 -0
  323. package/dist/security/pre-deploy-scanner.d.ts +0 -4
  324. package/dist/security/scanners.d.ts +81 -0
  325. package/dist/security/scanners.test.d.ts +1 -0
  326. package/dist/security/types.d.ts +150 -0
  327. package/dist/source/git-workspace.d.ts +26 -0
  328. package/dist/source/git-workspace.test.d.ts +1 -0
  329. package/dist/source/index.d.ts +6 -0
  330. package/dist/source/providers.d.ts +199 -0
  331. package/dist/source/providers.test.d.ts +1 -0
  332. package/dist/source/service.d.ts +18 -0
  333. package/dist/source/store.d.ts +149 -0
  334. package/dist/source/store.test.d.ts +1 -0
  335. package/dist/source/types.d.ts +191 -0
  336. package/dist/source/webhooks.d.ts +33 -0
  337. package/dist/source/webhooks.test.d.ts +1 -0
  338. package/dist/ssl/acme-client.d.ts +0 -6
  339. package/dist/storage/compose.d.ts +4 -0
  340. package/dist/storage/compose.test.d.ts +1 -0
  341. package/dist/storage/drivers.d.ts +107 -0
  342. package/dist/storage/drivers.test.d.ts +1 -0
  343. package/dist/storage/index.d.ts +5 -0
  344. package/dist/storage/model.d.ts +112 -0
  345. package/dist/storage/service.d.ts +95 -0
  346. package/dist/storage/storage.test.d.ts +1 -0
  347. package/dist/storage/store.d.ts +40 -0
  348. package/dist/telemetry/correlation.test.d.ts +1 -0
  349. package/dist/telemetry/index.d.ts +4 -0
  350. package/dist/telemetry/model.d.ts +145 -0
  351. package/dist/telemetry/policy.d.ts +8 -0
  352. package/dist/telemetry/policy.test.d.ts +1 -0
  353. package/dist/telemetry/redaction.d.ts +9 -0
  354. package/dist/telemetry/store.d.ts +34 -0
  355. package/dist/telemetry/store.test.d.ts +1 -0
  356. package/dist/ui/404.html +1506 -17
  357. package/dist/ui/accept-invitation.html +1163 -0
  358. package/dist/ui/{server/backups.html → access-denied.html} +344 -55
  359. package/dist/ui/account/automation.html +1669 -0
  360. package/dist/ui/account/security.html +1646 -0
  361. package/dist/ui/applications/compose.html +1590 -0
  362. package/dist/ui/applications/new.html +1868 -0
  363. package/dist/ui/data/backups.html +1757 -0
  364. package/dist/ui/data/services.html +1723 -0
  365. package/dist/ui/data/volumes.html +1639 -0
  366. package/dist/ui/index.html +392 -29
  367. package/dist/ui/integrations.html +1865 -0
  368. package/dist/ui/operations/alerts.html +1610 -0
  369. package/dist/ui/operations/configuration.html +1746 -0
  370. package/dist/ui/operations/jobs.html +1709 -0
  371. package/dist/ui/operations/maintenance.html +1540 -0
  372. package/dist/ui/operations/observability.html +1742 -0
  373. package/dist/ui/{serverless/scheduler.html → operations/previews.html} +447 -46
  374. package/dist/ui/operations/queue.html +1615 -0
  375. package/dist/ui/{server/workers.html → operations/regions.html} +413 -49
  376. package/dist/ui/operations/releases.html +1596 -0
  377. package/dist/ui/operations/workloads.html +1775 -0
  378. package/dist/ui/security.html +1767 -0
  379. package/dist/ui/server/actions.html +446 -57
  380. package/dist/ui/server/activity.html +346 -1
  381. package/dist/ui/server/capacity.html +1542 -0
  382. package/dist/ui/server/database.html +443 -36
  383. package/dist/ui/server/deployments.html +439 -53
  384. package/dist/ui/server/diagnostics.html +346 -1
  385. package/dist/ui/server/firewall.html +476 -50
  386. package/dist/ui/server/fleet.html +1577 -0
  387. package/dist/ui/server/logs.html +389 -25
  388. package/dist/ui/server/metrics.html +346 -1
  389. package/dist/ui/server/security.html +346 -1
  390. package/dist/ui/server/services.html +421 -46
  391. package/dist/ui/server/sites.html +476 -95
  392. package/dist/ui/server/ssh-keys.html +476 -46
  393. package/dist/ui/server/team.html +700 -77
  394. package/dist/ui/server/terminal.html +444 -54
  395. package/dist/ui/serverless/alarms.html +430 -42
  396. package/dist/ui/serverless/assets.html +421 -46
  397. package/dist/ui/serverless/cost.html +346 -1
  398. package/dist/ui/serverless/data.html +422 -47
  399. package/dist/ui/serverless/deployments.html +421 -46
  400. package/dist/ui/serverless/firewall.html +346 -1
  401. package/dist/ui/serverless/functions.html +423 -48
  402. package/dist/ui/serverless/logs.html +389 -25
  403. package/dist/ui/serverless/metrics.html +346 -1
  404. package/dist/ui/serverless/queues.html +448 -62
  405. package/dist/ui/serverless/secrets.html +448 -42
  406. package/dist/ui/serverless/traces.html +350 -5
  407. package/dist/ui/serverless.html +434 -58
  408. package/dist/ui-src/pages/404.stx +18 -0
  409. package/dist/ui-src/pages/accept-invitation.stx +50 -0
  410. package/dist/ui-src/pages/access-denied.stx +18 -0
  411. package/dist/ui-src/pages/account/automation.stx +187 -0
  412. package/dist/ui-src/pages/account/security.stx +249 -0
  413. package/dist/ui-src/pages/applications/compose.stx +38 -0
  414. package/dist/ui-src/pages/applications/new.stx +76 -0
  415. package/dist/ui-src/pages/data/backups.stx +214 -0
  416. package/dist/ui-src/pages/data/services.stx +257 -0
  417. package/dist/ui-src/pages/data/volumes.stx +40 -0
  418. package/dist/ui-src/pages/index.stx +24 -10
  419. package/dist/ui-src/pages/integrations.stx +186 -0
  420. package/dist/ui-src/pages/operations/alerts.stx +40 -0
  421. package/dist/ui-src/pages/operations/configuration.stx +164 -0
  422. package/dist/ui-src/pages/operations/jobs.stx +238 -0
  423. package/dist/ui-src/pages/operations/maintenance.stx +15 -0
  424. package/dist/ui-src/pages/operations/observability.stx +76 -0
  425. package/dist/ui-src/pages/operations/previews.stx +62 -0
  426. package/dist/ui-src/pages/operations/queue.stx +158 -0
  427. package/dist/ui-src/pages/operations/regions.stx +12 -0
  428. package/dist/ui-src/pages/operations/releases.stx +39 -0
  429. package/dist/ui-src/pages/operations/workloads.stx +151 -0
  430. package/dist/ui-src/pages/partials/head.stx +148 -15
  431. package/dist/ui-src/pages/partials/nav.stx +491 -74
  432. package/dist/ui-src/pages/partials/op-confirm.stx +6 -6
  433. package/dist/ui-src/pages/security.stx +264 -0
  434. package/dist/ui-src/pages/server/actions.stx +17 -26
  435. package/dist/ui-src/pages/server/capacity.stx +16 -0
  436. package/dist/ui-src/pages/server/database.stx +31 -16
  437. package/dist/ui-src/pages/server/deployments.stx +28 -30
  438. package/dist/ui-src/pages/server/firewall.stx +25 -30
  439. package/dist/ui-src/pages/server/fleet.stx +10 -0
  440. package/dist/ui-src/pages/server/logs.stx +11 -9
  441. package/dist/ui-src/pages/server/metrics.stx +8 -16
  442. package/dist/ui-src/pages/server/services.stx +19 -28
  443. package/dist/ui-src/pages/server/sites.stx +75 -72
  444. package/dist/ui-src/pages/server/ssh-keys.stx +24 -30
  445. package/dist/ui-src/pages/server/team.stx +286 -149
  446. package/dist/ui-src/pages/server/terminal.stx +6 -28
  447. package/dist/ui-src/pages/serverless/alarms.stx +17 -31
  448. package/dist/ui-src/pages/serverless/assets.stx +13 -22
  449. package/dist/ui-src/pages/serverless/cost.stx +15 -3
  450. package/dist/ui-src/pages/serverless/data.stx +12 -25
  451. package/dist/ui-src/pages/serverless/deployments.stx +14 -23
  452. package/dist/ui-src/pages/serverless/firewall.stx +5 -1
  453. package/dist/ui-src/pages/serverless/functions.stx +20 -26
  454. package/dist/ui-src/pages/serverless/logs.stx +11 -10
  455. package/dist/ui-src/pages/serverless/metrics.stx +18 -17
  456. package/dist/ui-src/pages/serverless/queues.stx +34 -42
  457. package/dist/ui-src/pages/serverless/secrets.stx +31 -34
  458. package/dist/ui-src/pages/serverless/traces.stx +2 -6
  459. package/dist/ui-src/pages/serverless.stx +40 -74
  460. package/package.json +11 -11
  461. package/dist/chunk-b17vf1g1.js +0 -13787
  462. package/dist/chunk-b82pbxyp.js +0 -1572
  463. package/dist/chunk-pqfzdg68.js +0 -12
  464. package/dist/chunk-z58fqnjm.js +0 -10
  465. package/dist/ui-src/pages/server/backups.stx +0 -91
  466. package/dist/ui-src/pages/server/workers.stx +0 -99
  467. package/dist/ui-src/pages/serverless/scheduler.stx +0 -89
@@ -1,1255 +1,1255 @@
1
1
  import {
2
2
  Route53Client
3
- } from "./chunk-tnztxpcb.js";
3
+ } from "./chunk-32e7ya18.js";
4
4
  import {
5
5
  S3Client
6
- } from "./chunk-vd87cpvn.js";
6
+ } from "./chunk-wj3s95p9.js";
7
7
  import {
8
8
  AWSClient
9
- } from "./chunk-arsh1g5h.js";
9
+ } from "./chunk-zqtpg06c.js";
10
10
  import {
11
11
  __require
12
12
  } from "./chunk-v0bahtg2.js";
13
13
 
14
- // src/aws/ses.ts
15
- class SESClient {
14
+ // src/aws/iam.ts
15
+ function buildQueryParams(action, params) {
16
+ const queryParams = [`Action=${action}`, "Version=2010-05-08"];
17
+ for (const [key, value] of Object.entries(params)) {
18
+ if (value === undefined || value === null)
19
+ continue;
20
+ if (Array.isArray(value)) {
21
+ value.forEach((item, index) => {
22
+ if (typeof item === "object" && item !== null) {
23
+ for (const [subKey, subValue] of Object.entries(item)) {
24
+ queryParams.push(`${key}.member.${index + 1}.${subKey}=${encodeURIComponent(String(subValue))}`);
25
+ }
26
+ } else {
27
+ queryParams.push(`${key}.member.${index + 1}=${encodeURIComponent(String(item))}`);
28
+ }
29
+ });
30
+ } else if (typeof value === "object") {
31
+ for (const [subKey, subValue] of Object.entries(value)) {
32
+ if (subValue !== undefined && subValue !== null) {
33
+ queryParams.push(`${key}.${subKey}=${encodeURIComponent(String(subValue))}`);
34
+ }
35
+ }
36
+ } else {
37
+ queryParams.push(`${key}=${encodeURIComponent(String(value))}`);
38
+ }
39
+ }
40
+ return queryParams.join("&");
41
+ }
42
+ function parseXmlValue(xml, tag) {
43
+ const regex = new RegExp(`<${tag}>([^<]*)</${tag}>`);
44
+ const match = xml.match(regex);
45
+ return match ? match[1] : undefined;
46
+ }
47
+ function parseXmlArray(xml, containerTag, itemTag) {
48
+ const containerRegex = new RegExp(`<${containerTag}>([\\s\\S]*?)</${containerTag}>`);
49
+ const containerMatch = xml.match(containerRegex);
50
+ if (!containerMatch)
51
+ return [];
52
+ const items = [];
53
+ const itemRegex = new RegExp(`<${itemTag}>([\\s\\S]*?)</${itemTag}>`, "g");
54
+ let match;
55
+ while ((match = itemRegex.exec(containerMatch[1])) !== null) {
56
+ items.push(match[1]);
57
+ }
58
+ return items;
59
+ }
60
+
61
+ class IAMClient {
16
62
  client;
17
63
  region;
18
- constructor(region = "us-east-1", credentials) {
64
+ constructor(region = "us-east-1", profile) {
65
+ this.client = new AWSClient(undefined, { profile });
19
66
  this.region = region;
20
- this.client = new AWSClient(credentials);
21
67
  }
22
- async createEmailIdentity(params) {
23
- const result = await this.client.request({
24
- service: "email",
68
+ async request(action, params = {}) {
69
+ const body = buildQueryParams(action, params);
70
+ const response = await this.client.request({
71
+ service: "iam",
25
72
  region: this.region,
26
73
  method: "POST",
27
- path: "/v2/email/identities",
74
+ path: "/",
28
75
  headers: {
29
- "Content-Type": "application/json"
76
+ "Content-Type": "application/x-www-form-urlencoded"
30
77
  },
31
- body: JSON.stringify(params)
78
+ body
32
79
  });
33
- return result;
80
+ return response;
34
81
  }
35
- async getEmailIdentity(emailIdentity) {
36
- const result = await this.client.request({
37
- service: "email",
38
- region: this.region,
39
- method: "GET",
40
- path: `/v2/email/identities/${encodeURIComponent(emailIdentity)}`,
41
- headers: {
42
- "Content-Type": "application/json"
43
- }
44
- });
45
- return {
46
- IdentityType: result.IdentityType,
47
- IdentityName: emailIdentity,
48
- SendingEnabled: result.VerifiedForSendingStatus,
49
- VerificationStatus: result.VerificationStatus,
50
- DkimAttributes: result.DkimAttributes,
51
- MailFromAttributes: result.MailFromAttributes
52
- };
82
+ async createUser(params) {
83
+ const response = await this.request("CreateUser", params);
84
+ return this.parseUser(response);
53
85
  }
54
- async putEmailIdentityMailFromAttributes(emailIdentity, params) {
55
- await this.client.request({
56
- service: "email",
57
- region: this.region,
58
- method: "PUT",
59
- path: `/v2/email/identities/${encodeURIComponent(emailIdentity)}/mail-from`,
60
- headers: {
61
- "Content-Type": "application/json"
62
- },
63
- body: JSON.stringify(params)
64
- });
86
+ async getUser(params = {}) {
87
+ const response = await this.request("GetUser", params);
88
+ return this.parseUser(response);
65
89
  }
66
- async listEmailIdentities(params) {
67
- let path = "/v2/email/identities";
68
- const queryParams = [];
69
- if (params?.PageSize) {
70
- queryParams.push(`PageSize=${params.PageSize}`);
71
- }
72
- if (params?.NextToken) {
73
- queryParams.push(`NextToken=${encodeURIComponent(params.NextToken)}`);
74
- }
75
- if (queryParams.length > 0) {
76
- path += `?${queryParams.join("&")}`;
77
- }
78
- const result = await this.client.request({
79
- service: "email",
80
- region: this.region,
81
- method: "GET",
82
- path,
83
- headers: {
84
- "Content-Type": "application/json"
85
- }
86
- });
87
- return {
88
- EmailIdentities: result.EmailIdentities,
89
- NextToken: result.NextToken
90
- };
90
+ async listUsers(params = {}) {
91
+ const response = await this.request("ListUsers", params);
92
+ const users = this.parseUsers(response);
93
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
94
+ const marker = parseXmlValue(response, "Marker");
95
+ return { Users: users, IsTruncated: isTruncated, Marker: marker };
91
96
  }
92
- async deleteEmailIdentity(emailIdentity) {
93
- await this.client.request({
94
- service: "email",
95
- region: this.region,
96
- method: "DELETE",
97
- path: `/v2/email/identities/${encodeURIComponent(emailIdentity)}`,
98
- headers: {
99
- "Content-Type": "application/json"
100
- }
101
- });
97
+ async updateUser(params) {
98
+ await this.request("UpdateUser", params);
102
99
  }
103
- async putEmailIdentityDkimAttributes(params) {
104
- await this.client.request({
105
- service: "email",
106
- region: this.region,
107
- method: "PUT",
108
- path: `/v2/email/identities/${encodeURIComponent(params.EmailIdentity)}/dkim`,
109
- headers: {
110
- "Content-Type": "application/json"
111
- },
112
- body: JSON.stringify({ SigningEnabled: params.SigningEnabled })
113
- });
100
+ async deleteUser(params) {
101
+ await this.request("DeleteUser", params);
114
102
  }
115
- async sendEmail(params) {
116
- const result = await this.client.request({
117
- service: "email",
118
- region: this.region,
119
- method: "POST",
120
- path: "/v2/email/outbound-emails",
121
- headers: {
122
- "Content-Type": "application/json"
123
- },
124
- body: JSON.stringify(params)
125
- });
103
+ parseUser(xml) {
126
104
  return {
127
- MessageId: result.MessageId
105
+ UserName: parseXmlValue(xml, "UserName") || "",
106
+ UserId: parseXmlValue(xml, "UserId") || "",
107
+ Arn: parseXmlValue(xml, "Arn") || "",
108
+ Path: parseXmlValue(xml, "Path"),
109
+ CreateDate: parseXmlValue(xml, "CreateDate"),
110
+ PasswordLastUsed: parseXmlValue(xml, "PasswordLastUsed")
128
111
  };
129
112
  }
130
- async sendBulkEmail(params) {
131
- const result = await this.client.request({
132
- service: "email",
133
- region: this.region,
134
- method: "POST",
135
- path: "/v2/email/outbound-bulk-emails",
136
- headers: {
137
- "Content-Type": "application/json"
138
- },
139
- body: JSON.stringify(params)
140
- });
141
- return {
142
- BulkEmailEntryResults: result.BulkEmailEntryResults
143
- };
113
+ parseUsers(xml) {
114
+ const memberXmls = parseXmlArray(xml, "Users", "member");
115
+ return memberXmls.map((memberXml) => ({
116
+ UserName: parseXmlValue(memberXml, "UserName") || "",
117
+ UserId: parseXmlValue(memberXml, "UserId") || "",
118
+ Arn: parseXmlValue(memberXml, "Arn") || "",
119
+ Path: parseXmlValue(memberXml, "Path"),
120
+ CreateDate: parseXmlValue(memberXml, "CreateDate"),
121
+ PasswordLastUsed: parseXmlValue(memberXml, "PasswordLastUsed")
122
+ }));
144
123
  }
145
- async createEmailTemplate(params) {
146
- await this.client.request({
147
- service: "email",
148
- region: this.region,
149
- method: "POST",
150
- path: "/v2/email/templates",
151
- headers: {
152
- "Content-Type": "application/json"
153
- },
154
- body: JSON.stringify(params)
155
- });
124
+ async createGroup(params) {
125
+ const response = await this.request("CreateGroup", params);
126
+ return this.parseGroup(response);
156
127
  }
157
- async getEmailTemplate(templateName) {
158
- const result = await this.client.request({
159
- service: "email",
160
- region: this.region,
161
- method: "GET",
162
- path: `/v2/email/templates/${encodeURIComponent(templateName)}`,
163
- headers: {
164
- "Content-Type": "application/json"
165
- }
166
- });
167
- return result;
128
+ async getGroup(params) {
129
+ const response = await this.request("GetGroup", params);
130
+ const group = this.parseGroup(response);
131
+ const users = this.parseUsers(response);
132
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
133
+ const marker = parseXmlValue(response, "Marker");
134
+ return { Group: group, Users: users, IsTruncated: isTruncated, Marker: marker };
168
135
  }
169
- async deleteEmailTemplate(templateName) {
170
- await this.client.request({
171
- service: "email",
172
- region: this.region,
173
- method: "DELETE",
174
- path: `/v2/email/templates/${encodeURIComponent(templateName)}`,
175
- headers: {
176
- "Content-Type": "application/json"
177
- }
178
- });
136
+ async listGroups(params = {}) {
137
+ const response = await this.request("ListGroups", params);
138
+ const groups = this.parseGroups(response);
139
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
140
+ const marker = parseXmlValue(response, "Marker");
141
+ return { Groups: groups, IsTruncated: isTruncated, Marker: marker };
179
142
  }
180
- async listEmailTemplates(params) {
181
- let path = "/v2/email/templates";
182
- const queryParams = [];
183
- if (params?.PageSize) {
184
- queryParams.push(`PageSize=${params.PageSize}`);
185
- }
186
- if (params?.NextToken) {
187
- queryParams.push(`NextToken=${encodeURIComponent(params.NextToken)}`);
188
- }
189
- if (queryParams.length > 0) {
190
- path += `?${queryParams.join("&")}`;
191
- }
192
- const result = await this.client.request({
193
- service: "email",
194
- region: this.region,
195
- method: "GET",
196
- path,
197
- headers: {
198
- "Content-Type": "application/json"
199
- }
200
- });
201
- return result;
143
+ async updateGroup(params) {
144
+ await this.request("UpdateGroup", params);
202
145
  }
203
- async getSendStatistics() {
204
- const result = await this.client.request({
205
- service: "ses",
206
- region: this.region,
207
- method: "POST",
208
- path: "/",
209
- headers: {
210
- "Content-Type": "application/x-www-form-urlencoded"
211
- },
212
- body: "Action=GetSendStatistics&Version=2010-12-01"
213
- });
214
- return {
215
- SendDataPoints: result.GetSendStatisticsResponse?.GetSendStatisticsResult?.SendDataPoints?.member
216
- };
146
+ async deleteGroup(params) {
147
+ await this.request("DeleteGroup", params);
217
148
  }
218
- async getSendQuota() {
219
- const result = await this.client.request({
220
- service: "ses",
221
- region: this.region,
222
- method: "POST",
223
- path: "/",
224
- headers: {
225
- "Content-Type": "application/x-www-form-urlencoded"
226
- },
227
- body: "Action=GetSendQuota&Version=2010-12-01"
228
- });
229
- const quota = result.GetSendQuotaResponse?.GetSendQuotaResult;
230
- return {
231
- Max24HourSend: quota?.Max24HourSend ? Number(quota.Max24HourSend) : undefined,
232
- MaxSendRate: quota?.MaxSendRate ? Number(quota.MaxSendRate) : undefined,
233
- SentLast24Hours: quota?.SentLast24Hours ? Number(quota.SentLast24Hours) : undefined
234
- };
149
+ async addUserToGroup(params) {
150
+ await this.request("AddUserToGroup", params);
235
151
  }
236
- async verifyDomain(domain) {
237
- const result = await this.createEmailIdentity({
238
- EmailIdentity: domain
239
- });
152
+ async removeUserFromGroup(params) {
153
+ await this.request("RemoveUserFromGroup", params);
154
+ }
155
+ async listGroupsForUser(params) {
156
+ const response = await this.request("ListGroupsForUser", params);
157
+ const groups = this.parseGroups(response);
158
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
159
+ const marker = parseXmlValue(response, "Marker");
160
+ return { Groups: groups, IsTruncated: isTruncated, Marker: marker };
161
+ }
162
+ parseGroup(xml) {
240
163
  return {
241
- dkimTokens: result.DkimAttributes?.Tokens,
242
- verificationStatus: result.DkimAttributes?.Status
164
+ GroupName: parseXmlValue(xml, "GroupName") || "",
165
+ GroupId: parseXmlValue(xml, "GroupId") || "",
166
+ Arn: parseXmlValue(xml, "Arn") || "",
167
+ Path: parseXmlValue(xml, "Path"),
168
+ CreateDate: parseXmlValue(xml, "CreateDate")
243
169
  };
244
170
  }
245
- async sendSimpleEmail(params) {
246
- const toAddresses = Array.isArray(params.to) ? params.to : [params.to];
247
- const replyToAddresses = params.replyTo ? Array.isArray(params.replyTo) ? params.replyTo : [params.replyTo] : undefined;
248
- const body = {};
249
- if (params.text) {
250
- body.Text = { Data: params.text };
251
- }
252
- if (params.html) {
253
- body.Html = { Data: params.html };
254
- }
255
- return this.sendEmail({
256
- FromEmailAddress: params.from,
257
- Destination: {
258
- ToAddresses: toAddresses
259
- },
260
- Content: {
261
- Simple: {
262
- Subject: { Data: params.subject },
263
- Body: body
264
- }
265
- },
266
- ReplyToAddresses: replyToAddresses
267
- });
171
+ parseGroups(xml) {
172
+ const memberXmls = parseXmlArray(xml, "Groups", "member");
173
+ return memberXmls.map((memberXml) => ({
174
+ GroupName: parseXmlValue(memberXml, "GroupName") || "",
175
+ GroupId: parseXmlValue(memberXml, "GroupId") || "",
176
+ Arn: parseXmlValue(memberXml, "Arn") || "",
177
+ Path: parseXmlValue(memberXml, "Path"),
178
+ CreateDate: parseXmlValue(memberXml, "CreateDate")
179
+ }));
268
180
  }
269
- async sendTemplatedEmail(params) {
270
- const toAddresses = Array.isArray(params.to) ? params.to : [params.to];
271
- const replyToAddresses = params.replyTo ? Array.isArray(params.replyTo) ? params.replyTo : [params.replyTo] : undefined;
272
- return this.sendEmail({
273
- FromEmailAddress: params.from,
274
- Destination: {
275
- ToAddresses: toAddresses
276
- },
277
- Content: {
278
- Template: {
279
- TemplateName: params.templateName,
280
- TemplateData: JSON.stringify(params.templateData)
281
- }
282
- },
283
- ReplyToAddresses: replyToAddresses
284
- });
181
+ async createRole(params) {
182
+ const response = await this.request("CreateRole", params);
183
+ return this.parseRole(response);
285
184
  }
286
- async getDkimRecords(domain) {
287
- const identity = await this.getEmailIdentity(domain);
288
- if (!identity.DkimAttributes?.Tokens) {
289
- return [];
290
- }
291
- return identity.DkimAttributes.Tokens.map((token) => ({
292
- name: `${token}._domainkey.${domain}`,
293
- type: "CNAME",
294
- value: `${token}.dkim.amazonses.com`
295
- }));
185
+ async getRole(params) {
186
+ const response = await this.request("GetRole", params);
187
+ return this.parseRole(response);
296
188
  }
297
- async isDomainVerified(domain) {
298
- try {
299
- const identity = await this.getEmailIdentity(domain);
300
- return identity.VerificationStatus === "SUCCESS" && identity.SendingEnabled === true;
301
- } catch {
302
- return false;
303
- }
189
+ async listRoles(params = {}) {
190
+ const response = await this.request("ListRoles", params);
191
+ const roles = this.parseRoles(response);
192
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
193
+ const marker = parseXmlValue(response, "Marker");
194
+ return { Roles: roles, IsTruncated: isTruncated, Marker: marker };
304
195
  }
305
- async waitForDomainVerification(domain, maxAttempts = 60, delayMs = 30000) {
306
- for (let i = 0;i < maxAttempts; i++) {
307
- const isVerified = await this.isDomainVerified(domain);
308
- if (isVerified) {
309
- return true;
310
- }
311
- await new Promise((resolve) => setTimeout(resolve, delayMs));
312
- }
313
- return false;
196
+ async updateRole(params) {
197
+ await this.request("UpdateRole", params);
314
198
  }
315
- buildFormBody(params) {
316
- const entries = Object.entries(params).filter(([, value]) => value !== undefined).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
317
- return entries.join("&");
199
+ async updateRoleDescription(params) {
200
+ const response = await this.request("UpdateRoleDescription", params);
201
+ return this.parseRole(response);
318
202
  }
319
- async createReceiptRuleSet(ruleSetName) {
320
- await this.client.request({
321
- service: "ses",
322
- region: this.region,
323
- method: "POST",
324
- path: "/",
325
- headers: {
326
- "Content-Type": "application/x-www-form-urlencoded"
327
- },
328
- body: this.buildFormBody({
329
- Action: "CreateReceiptRuleSet",
330
- Version: "2010-12-01",
331
- RuleSetName: ruleSetName
332
- })
333
- });
203
+ async updateAssumeRolePolicy(params) {
204
+ await this.request("UpdateAssumeRolePolicy", params);
334
205
  }
335
- async deleteReceiptRuleSet(ruleSetName) {
336
- await this.client.request({
337
- service: "ses",
338
- region: this.region,
339
- method: "POST",
340
- path: "/",
341
- headers: {
342
- "Content-Type": "application/x-www-form-urlencoded"
343
- },
344
- body: this.buildFormBody({
345
- Action: "DeleteReceiptRuleSet",
346
- Version: "2010-12-01",
347
- RuleSetName: ruleSetName
348
- })
349
- });
206
+ async deleteRole(params) {
207
+ await this.request("DeleteRole", params);
350
208
  }
351
- async setActiveReceiptRuleSet(ruleSetName) {
352
- await this.client.request({
353
- service: "ses",
354
- region: this.region,
355
- method: "POST",
356
- path: "/",
357
- headers: {
358
- "Content-Type": "application/x-www-form-urlencoded"
359
- },
360
- body: this.buildFormBody({
361
- Action: "SetActiveReceiptRuleSet",
362
- Version: "2010-12-01",
363
- RuleSetName: ruleSetName
364
- })
365
- });
209
+ async tagRole(params) {
210
+ await this.request("TagRole", params);
366
211
  }
367
- async listReceiptRuleSets(nextToken) {
368
- const formParams = {
369
- Action: "ListReceiptRuleSets",
370
- Version: "2010-12-01"
371
- };
372
- if (nextToken) {
373
- formParams.NextToken = nextToken;
374
- }
375
- const result = await this.client.request({
376
- service: "ses",
377
- region: this.region,
378
- method: "POST",
379
- path: "/",
380
- headers: {
381
- "Content-Type": "application/x-www-form-urlencoded"
382
- },
383
- body: this.buildFormBody(formParams)
384
- });
385
- const ruleSetsResult = result?.ListReceiptRuleSetsResponse?.ListReceiptRuleSetsResult || result?.ListReceiptRuleSetsResult;
386
- const ruleSets = ruleSetsResult?.RuleSets?.member;
387
- return {
388
- RuleSets: Array.isArray(ruleSets) ? ruleSets : ruleSets ? [ruleSets] : [],
389
- NextToken: ruleSetsResult?.NextToken
390
- };
212
+ async untagRole(params) {
213
+ await this.request("UntagRole", params);
391
214
  }
392
- async describeReceiptRuleSet(ruleSetName) {
393
- const result = await this.client.request({
394
- service: "ses",
395
- region: this.region,
396
- method: "POST",
397
- path: "/",
398
- headers: {
399
- "Content-Type": "application/x-www-form-urlencoded"
400
- },
401
- body: this.buildFormBody({
402
- Action: "DescribeReceiptRuleSet",
403
- Version: "2010-12-01",
404
- RuleSetName: ruleSetName
405
- })
406
- });
407
- const response = result?.DescribeReceiptRuleSetResponse?.DescribeReceiptRuleSetResult || result?.DescribeReceiptRuleSetResult;
408
- const rules = response?.Rules?.member;
215
+ async listRoleTags(params) {
216
+ const response = await this.request("ListRoleTags", params);
217
+ const tags = this.parseTags(response);
218
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
219
+ const marker = parseXmlValue(response, "Marker");
220
+ return { Tags: tags, IsTruncated: isTruncated, Marker: marker };
221
+ }
222
+ parseRole(xml) {
409
223
  return {
410
- Metadata: response?.Metadata,
411
- Rules: Array.isArray(rules) ? rules : rules ? [rules] : []
224
+ RoleName: parseXmlValue(xml, "RoleName") || "",
225
+ RoleId: parseXmlValue(xml, "RoleId") || "",
226
+ Arn: parseXmlValue(xml, "Arn") || "",
227
+ Path: parseXmlValue(xml, "Path"),
228
+ CreateDate: parseXmlValue(xml, "CreateDate"),
229
+ AssumeRolePolicyDocument: parseXmlValue(xml, "AssumeRolePolicyDocument"),
230
+ Description: parseXmlValue(xml, "Description"),
231
+ MaxSessionDuration: parseXmlValue(xml, "MaxSessionDuration") ? Number.parseInt(parseXmlValue(xml, "MaxSessionDuration"), 10) : undefined
412
232
  };
413
233
  }
414
- async createReceiptRule(params) {
415
- const formParams = {
416
- Action: "CreateReceiptRule",
417
- Version: "2010-12-01",
418
- RuleSetName: params.RuleSetName,
419
- "Rule.Name": params.Rule.Name,
420
- "Rule.Enabled": params.Rule.Enabled !== false ? "true" : "false"
421
- };
422
- if (params.Rule.TlsPolicy) {
423
- formParams["Rule.TlsPolicy"] = params.Rule.TlsPolicy;
424
- }
425
- if (params.Rule.ScanEnabled !== undefined) {
426
- formParams["Rule.ScanEnabled"] = params.Rule.ScanEnabled ? "true" : "false";
427
- }
428
- if (params.After) {
429
- formParams.After = params.After;
430
- }
431
- if (params.Rule.Recipients) {
432
- params.Rule.Recipients.forEach((recipient, index) => {
433
- formParams[`Rule.Recipients.member.${index + 1}`] = recipient;
434
- });
435
- }
436
- params.Rule.Actions.forEach((action, index) => {
437
- const actionNum = index + 1;
438
- if (action.S3Action) {
439
- formParams[`Rule.Actions.member.${actionNum}.S3Action.BucketName`] = action.S3Action.BucketName;
440
- if (action.S3Action.ObjectKeyPrefix) {
441
- formParams[`Rule.Actions.member.${actionNum}.S3Action.ObjectKeyPrefix`] = action.S3Action.ObjectKeyPrefix;
442
- }
443
- if (action.S3Action.KmsKeyArn) {
444
- formParams[`Rule.Actions.member.${actionNum}.S3Action.KmsKeyArn`] = action.S3Action.KmsKeyArn;
445
- }
446
- }
447
- if (action.LambdaAction) {
448
- formParams[`Rule.Actions.member.${actionNum}.LambdaAction.FunctionArn`] = action.LambdaAction.FunctionArn;
449
- formParams[`Rule.Actions.member.${actionNum}.LambdaAction.InvocationType`] = action.LambdaAction.InvocationType || "Event";
450
- }
451
- if (action.SNSAction) {
452
- formParams[`Rule.Actions.member.${actionNum}.SNSAction.TopicArn`] = action.SNSAction.TopicArn;
453
- if (action.SNSAction.Encoding) {
454
- formParams[`Rule.Actions.member.${actionNum}.SNSAction.Encoding`] = action.SNSAction.Encoding;
455
- }
456
- }
457
- if (action.StopAction) {
458
- formParams[`Rule.Actions.member.${actionNum}.StopAction.Scope`] = action.StopAction.Scope;
459
- if (action.StopAction.TopicArn) {
460
- formParams[`Rule.Actions.member.${actionNum}.StopAction.TopicArn`] = action.StopAction.TopicArn;
461
- }
462
- }
463
- });
464
- await this.client.request({
465
- service: "ses",
466
- region: this.region,
467
- method: "POST",
468
- path: "/",
469
- headers: {
470
- "Content-Type": "application/x-www-form-urlencoded"
471
- },
472
- body: this.buildFormBody(formParams)
473
- });
234
+ parseRoles(xml) {
235
+ const memberXmls = parseXmlArray(xml, "Roles", "member");
236
+ return memberXmls.map((memberXml) => ({
237
+ RoleName: parseXmlValue(memberXml, "RoleName") || "",
238
+ RoleId: parseXmlValue(memberXml, "RoleId") || "",
239
+ Arn: parseXmlValue(memberXml, "Arn") || "",
240
+ Path: parseXmlValue(memberXml, "Path"),
241
+ CreateDate: parseXmlValue(memberXml, "CreateDate"),
242
+ AssumeRolePolicyDocument: parseXmlValue(memberXml, "AssumeRolePolicyDocument"),
243
+ Description: parseXmlValue(memberXml, "Description"),
244
+ MaxSessionDuration: parseXmlValue(memberXml, "MaxSessionDuration") ? Number.parseInt(parseXmlValue(memberXml, "MaxSessionDuration"), 10) : undefined
245
+ }));
474
246
  }
475
- async deleteReceiptRule(ruleSetName, ruleName) {
476
- await this.client.request({
477
- service: "ses",
478
- region: this.region,
479
- method: "POST",
480
- path: "/",
481
- headers: {
482
- "Content-Type": "application/x-www-form-urlencoded"
483
- },
484
- body: this.buildFormBody({
485
- Action: "DeleteReceiptRule",
486
- Version: "2010-12-01",
487
- RuleSetName: ruleSetName,
488
- RuleName: ruleName
489
- })
490
- });
247
+ parseTags(xml) {
248
+ const memberXmls = parseXmlArray(xml, "Tags", "member");
249
+ return memberXmls.map((memberXml) => ({
250
+ Key: parseXmlValue(memberXml, "Key") || "",
251
+ Value: parseXmlValue(memberXml, "Value") || ""
252
+ }));
491
253
  }
492
- async receiptRuleSetExists(ruleSetName) {
493
- try {
494
- await this.describeReceiptRuleSet(ruleSetName);
495
- return true;
496
- } catch (error) {
497
- if (error.code === "RuleSetDoesNotExist" || error.statusCode === 400) {
498
- return false;
499
- }
500
- throw error;
501
- }
254
+ async createPolicy(params) {
255
+ const response = await this.request("CreatePolicy", params);
256
+ return this.parsePolicy(response);
502
257
  }
503
- async getActiveReceiptRuleSet() {
504
- const result = await this.client.request({
505
- service: "ses",
506
- region: this.region,
507
- method: "POST",
508
- path: "/",
509
- headers: {
510
- "Content-Type": "application/x-www-form-urlencoded"
511
- },
512
- body: this.buildFormBody({
513
- Action: "DescribeActiveReceiptRuleSet",
514
- Version: "2010-12-01"
515
- })
516
- });
517
- const response = result?.DescribeActiveReceiptRuleSetResponse?.DescribeActiveReceiptRuleSetResult || result?.DescribeActiveReceiptRuleSetResult;
518
- if (!response?.Metadata) {
519
- return null;
520
- }
521
- const rules = response?.Rules?.member;
258
+ async getPolicy(params) {
259
+ const response = await this.request("GetPolicy", params);
260
+ return this.parsePolicy(response);
261
+ }
262
+ async getPolicyVersion(params) {
263
+ const response = await this.request("GetPolicyVersion", params);
522
264
  return {
523
- Metadata: response?.Metadata,
524
- Rules: Array.isArray(rules) ? rules : rules ? [rules] : []
265
+ VersionId: parseXmlValue(response, "VersionId") || "",
266
+ IsDefaultVersion: parseXmlValue(response, "IsDefaultVersion") === "true",
267
+ CreateDate: parseXmlValue(response, "CreateDate"),
268
+ Document: parseXmlValue(response, "Document")
525
269
  };
526
270
  }
527
- async updateReceiptRule(params) {
528
- const formParams = {
529
- Action: "UpdateReceiptRule",
530
- Version: "2010-12-01",
531
- RuleSetName: params.RuleSetName,
532
- "Rule.Name": params.Rule.Name
533
- };
534
- if (params.Rule.Enabled !== undefined) {
535
- formParams["Rule.Enabled"] = params.Rule.Enabled ? "true" : "false";
536
- }
537
- if (params.Rule.TlsPolicy) {
538
- formParams["Rule.TlsPolicy"] = params.Rule.TlsPolicy;
539
- }
540
- if (params.Rule.ScanEnabled !== undefined) {
541
- formParams["Rule.ScanEnabled"] = params.Rule.ScanEnabled ? "true" : "false";
542
- }
543
- if (params.Rule.Recipients) {
544
- params.Rule.Recipients.forEach((recipient, index) => {
545
- formParams[`Rule.Recipients.member.${index + 1}`] = recipient;
546
- });
547
- }
548
- params.Rule.Actions.forEach((action, index) => {
549
- const actionNum = index + 1;
550
- if (action.S3Action) {
551
- formParams[`Rule.Actions.member.${actionNum}.S3Action.BucketName`] = action.S3Action.BucketName;
552
- if (action.S3Action.ObjectKeyPrefix) {
553
- formParams[`Rule.Actions.member.${actionNum}.S3Action.ObjectKeyPrefix`] = action.S3Action.ObjectKeyPrefix;
554
- }
555
- if (action.S3Action.KmsKeyArn) {
556
- formParams[`Rule.Actions.member.${actionNum}.S3Action.KmsKeyArn`] = action.S3Action.KmsKeyArn;
557
- }
558
- }
559
- if (action.LambdaAction) {
560
- formParams[`Rule.Actions.member.${actionNum}.LambdaAction.FunctionArn`] = action.LambdaAction.FunctionArn;
561
- formParams[`Rule.Actions.member.${actionNum}.LambdaAction.InvocationType`] = action.LambdaAction.InvocationType || "Event";
562
- }
563
- if (action.SNSAction) {
564
- formParams[`Rule.Actions.member.${actionNum}.SNSAction.TopicArn`] = action.SNSAction.TopicArn;
565
- if (action.SNSAction.Encoding) {
566
- formParams[`Rule.Actions.member.${actionNum}.SNSAction.Encoding`] = action.SNSAction.Encoding;
567
- }
568
- }
569
- if (action.StopAction) {
570
- formParams[`Rule.Actions.member.${actionNum}.StopAction.Scope`] = action.StopAction.Scope;
571
- if (action.StopAction.TopicArn) {
572
- formParams[`Rule.Actions.member.${actionNum}.StopAction.TopicArn`] = action.StopAction.TopicArn;
573
- }
574
- }
575
- });
576
- await this.client.request({
577
- service: "ses",
578
- region: this.region,
579
- method: "POST",
580
- path: "/",
581
- headers: {
582
- "Content-Type": "application/x-www-form-urlencoded"
583
- },
584
- body: this.buildFormBody(formParams)
585
- });
271
+ async listPolicies(params = {}) {
272
+ const response = await this.request("ListPolicies", params);
273
+ const policies = this.parsePolicies(response);
274
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
275
+ const marker = parseXmlValue(response, "Marker");
276
+ return { Policies: policies, IsTruncated: isTruncated, Marker: marker };
586
277
  }
587
- async sendRawEmail(params) {
588
- const rawMessageBase64 = Buffer.from(params.rawMessage).toString("base64");
589
- const formParams = {
590
- Action: "SendRawEmail",
591
- Version: "2010-12-01",
592
- Source: params.source,
593
- "RawMessage.Data": rawMessageBase64
594
- };
595
- params.destinations.forEach((dest, index) => {
596
- formParams[`Destinations.member.${index + 1}`] = dest;
597
- });
598
- const result = await this.client.request({
599
- service: "ses",
600
- region: this.region,
601
- method: "POST",
602
- path: "/",
603
- headers: {
604
- "Content-Type": "application/x-www-form-urlencoded"
605
- },
606
- body: this.buildFormBody(formParams)
607
- });
608
- const response = result?.SendRawEmailResponse?.SendRawEmailResult || result?.SendRawEmailResult;
278
+ async listPolicyVersions(params) {
279
+ const response = await this.request("ListPolicyVersions", params);
280
+ const versions = this.parsePolicyVersions(response);
281
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
282
+ const marker = parseXmlValue(response, "Marker");
283
+ return { Versions: versions, IsTruncated: isTruncated, Marker: marker };
284
+ }
285
+ async createPolicyVersion(params) {
286
+ const response = await this.request("CreatePolicyVersion", params);
609
287
  return {
610
- MessageId: response?.MessageId
288
+ VersionId: parseXmlValue(response, "VersionId") || "",
289
+ IsDefaultVersion: parseXmlValue(response, "IsDefaultVersion") === "true",
290
+ CreateDate: parseXmlValue(response, "CreateDate")
611
291
  };
612
292
  }
613
- async getSuppressedDestination(emailAddress) {
614
- try {
615
- const result = await this.client.request({
616
- service: "ses",
617
- region: this.region,
618
- method: "GET",
619
- path: `/v2/email/suppression/addresses/${encodeURIComponent(emailAddress)}`
620
- });
621
- return result?.SuppressedDestination || null;
622
- } catch (error) {
623
- if (error.message?.includes("404") || error.message?.includes("NotFoundException")) {
624
- return null;
625
- }
626
- throw error;
627
- }
628
- }
629
- async deleteSuppressedDestination(emailAddress) {
630
- await this.client.request({
631
- service: "ses",
632
- region: this.region,
633
- method: "DELETE",
634
- path: `/v2/email/suppression/addresses/${encodeURIComponent(emailAddress)}`
635
- });
293
+ async deletePolicyVersion(params) {
294
+ await this.request("DeletePolicyVersion", params);
636
295
  }
637
- }
638
-
639
- // src/aws/iam.ts
640
- function buildQueryParams(action, params) {
641
- const queryParams = [`Action=${action}`, "Version=2010-05-08"];
642
- for (const [key, value] of Object.entries(params)) {
643
- if (value === undefined || value === null)
644
- continue;
645
- if (Array.isArray(value)) {
646
- value.forEach((item, index) => {
647
- if (typeof item === "object" && item !== null) {
648
- for (const [subKey, subValue] of Object.entries(item)) {
649
- queryParams.push(`${key}.member.${index + 1}.${subKey}=${encodeURIComponent(String(subValue))}`);
650
- }
651
- } else {
652
- queryParams.push(`${key}.member.${index + 1}=${encodeURIComponent(String(item))}`);
653
- }
654
- });
655
- } else if (typeof value === "object") {
656
- for (const [subKey, subValue] of Object.entries(value)) {
657
- if (subValue !== undefined && subValue !== null) {
658
- queryParams.push(`${key}.${subKey}=${encodeURIComponent(String(subValue))}`);
659
- }
660
- }
661
- } else {
662
- queryParams.push(`${key}=${encodeURIComponent(String(value))}`);
663
- }
296
+ async setDefaultPolicyVersion(params) {
297
+ await this.request("SetDefaultPolicyVersion", params);
664
298
  }
665
- return queryParams.join("&");
666
- }
667
- function parseXmlValue(xml, tag) {
668
- const regex = new RegExp(`<${tag}>([^<]*)</${tag}>`);
669
- const match = xml.match(regex);
670
- return match ? match[1] : undefined;
671
- }
672
- function parseXmlArray(xml, containerTag, itemTag) {
673
- const containerRegex = new RegExp(`<${containerTag}>([\\s\\S]*?)</${containerTag}>`);
674
- const containerMatch = xml.match(containerRegex);
675
- if (!containerMatch)
676
- return [];
677
- const items = [];
678
- const itemRegex = new RegExp(`<${itemTag}>([\\s\\S]*?)</${itemTag}>`, "g");
679
- let match;
680
- while ((match = itemRegex.exec(containerMatch[1])) !== null) {
681
- items.push(match[1]);
299
+ async deletePolicy(params) {
300
+ await this.request("DeletePolicy", params);
682
301
  }
683
- return items;
684
- }
685
-
686
- class IAMClient {
687
- client;
688
- region;
689
- constructor(region = "us-east-1") {
690
- this.client = new AWSClient;
691
- this.region = region;
302
+ async attachUserPolicy(params) {
303
+ await this.request("AttachUserPolicy", params);
692
304
  }
693
- async request(action, params = {}) {
694
- const body = buildQueryParams(action, params);
695
- const response = await this.client.request({
696
- service: "iam",
697
- region: this.region,
698
- method: "POST",
699
- path: "/",
700
- headers: {
701
- "Content-Type": "application/x-www-form-urlencoded"
702
- },
703
- body
704
- });
705
- return response;
305
+ async detachUserPolicy(params) {
306
+ await this.request("DetachUserPolicy", params);
706
307
  }
707
- async createUser(params) {
708
- const response = await this.request("CreateUser", params);
709
- return this.parseUser(response);
308
+ async attachGroupPolicy(params) {
309
+ await this.request("AttachGroupPolicy", params);
710
310
  }
711
- async getUser(params = {}) {
712
- const response = await this.request("GetUser", params);
713
- return this.parseUser(response);
311
+ async detachGroupPolicy(params) {
312
+ await this.request("DetachGroupPolicy", params);
714
313
  }
715
- async listUsers(params = {}) {
716
- const response = await this.request("ListUsers", params);
717
- const users = this.parseUsers(response);
314
+ async attachRolePolicy(params) {
315
+ await this.request("AttachRolePolicy", params);
316
+ }
317
+ async detachRolePolicy(params) {
318
+ await this.request("DetachRolePolicy", params);
319
+ }
320
+ async listAttachedUserPolicies(params) {
321
+ const response = await this.request("ListAttachedUserPolicies", params);
322
+ const policies = this.parseAttachedPolicies(response);
718
323
  const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
719
324
  const marker = parseXmlValue(response, "Marker");
720
- return { Users: users, IsTruncated: isTruncated, Marker: marker };
325
+ return { AttachedPolicies: policies, IsTruncated: isTruncated, Marker: marker };
721
326
  }
722
- async updateUser(params) {
723
- await this.request("UpdateUser", params);
327
+ async listAttachedGroupPolicies(params) {
328
+ const response = await this.request("ListAttachedGroupPolicies", params);
329
+ const policies = this.parseAttachedPolicies(response);
330
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
331
+ const marker = parseXmlValue(response, "Marker");
332
+ return { AttachedPolicies: policies, IsTruncated: isTruncated, Marker: marker };
724
333
  }
725
- async deleteUser(params) {
726
- await this.request("DeleteUser", params);
334
+ async listAttachedRolePolicies(params) {
335
+ const response = await this.request("ListAttachedRolePolicies", params);
336
+ const policies = this.parseAttachedPolicies(response);
337
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
338
+ const marker = parseXmlValue(response, "Marker");
339
+ return { AttachedPolicies: policies, IsTruncated: isTruncated, Marker: marker };
727
340
  }
728
- parseUser(xml) {
341
+ parsePolicy(xml) {
729
342
  return {
730
- UserName: parseXmlValue(xml, "UserName") || "",
731
- UserId: parseXmlValue(xml, "UserId") || "",
343
+ PolicyName: parseXmlValue(xml, "PolicyName") || "",
344
+ PolicyId: parseXmlValue(xml, "PolicyId") || "",
732
345
  Arn: parseXmlValue(xml, "Arn") || "",
733
346
  Path: parseXmlValue(xml, "Path"),
347
+ DefaultVersionId: parseXmlValue(xml, "DefaultVersionId"),
348
+ AttachmentCount: parseXmlValue(xml, "AttachmentCount") ? Number.parseInt(parseXmlValue(xml, "AttachmentCount"), 10) : undefined,
349
+ PermissionsBoundaryUsageCount: parseXmlValue(xml, "PermissionsBoundaryUsageCount") ? Number.parseInt(parseXmlValue(xml, "PermissionsBoundaryUsageCount"), 10) : undefined,
350
+ IsAttachable: parseXmlValue(xml, "IsAttachable") === "true",
351
+ Description: parseXmlValue(xml, "Description"),
734
352
  CreateDate: parseXmlValue(xml, "CreateDate"),
735
- PasswordLastUsed: parseXmlValue(xml, "PasswordLastUsed")
353
+ UpdateDate: parseXmlValue(xml, "UpdateDate")
736
354
  };
737
355
  }
738
- parseUsers(xml) {
739
- const memberXmls = parseXmlArray(xml, "Users", "member");
356
+ parsePolicies(xml) {
357
+ const memberXmls = parseXmlArray(xml, "Policies", "member");
740
358
  return memberXmls.map((memberXml) => ({
741
- UserName: parseXmlValue(memberXml, "UserName") || "",
742
- UserId: parseXmlValue(memberXml, "UserId") || "",
359
+ PolicyName: parseXmlValue(memberXml, "PolicyName") || "",
360
+ PolicyId: parseXmlValue(memberXml, "PolicyId") || "",
743
361
  Arn: parseXmlValue(memberXml, "Arn") || "",
744
362
  Path: parseXmlValue(memberXml, "Path"),
363
+ DefaultVersionId: parseXmlValue(memberXml, "DefaultVersionId"),
364
+ AttachmentCount: parseXmlValue(memberXml, "AttachmentCount") ? Number.parseInt(parseXmlValue(memberXml, "AttachmentCount"), 10) : undefined,
365
+ PermissionsBoundaryUsageCount: parseXmlValue(memberXml, "PermissionsBoundaryUsageCount") ? Number.parseInt(parseXmlValue(memberXml, "PermissionsBoundaryUsageCount"), 10) : undefined,
366
+ IsAttachable: parseXmlValue(memberXml, "IsAttachable") === "true",
367
+ Description: parseXmlValue(memberXml, "Description"),
745
368
  CreateDate: parseXmlValue(memberXml, "CreateDate"),
746
- PasswordLastUsed: parseXmlValue(memberXml, "PasswordLastUsed")
369
+ UpdateDate: parseXmlValue(memberXml, "UpdateDate")
747
370
  }));
748
371
  }
749
- async createGroup(params) {
750
- const response = await this.request("CreateGroup", params);
751
- return this.parseGroup(response);
372
+ parsePolicyVersions(xml) {
373
+ const memberXmls = parseXmlArray(xml, "Versions", "member");
374
+ return memberXmls.map((memberXml) => ({
375
+ VersionId: parseXmlValue(memberXml, "VersionId") || "",
376
+ IsDefaultVersion: parseXmlValue(memberXml, "IsDefaultVersion") === "true",
377
+ CreateDate: parseXmlValue(memberXml, "CreateDate")
378
+ }));
752
379
  }
753
- async getGroup(params) {
754
- const response = await this.request("GetGroup", params);
755
- const group = this.parseGroup(response);
756
- const users = this.parseUsers(response);
757
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
758
- const marker = parseXmlValue(response, "Marker");
759
- return { Group: group, Users: users, IsTruncated: isTruncated, Marker: marker };
380
+ parseAttachedPolicies(xml) {
381
+ const memberXmls = parseXmlArray(xml, "AttachedPolicies", "member");
382
+ return memberXmls.map((memberXml) => ({
383
+ PolicyName: parseXmlValue(memberXml, "PolicyName") || "",
384
+ PolicyArn: parseXmlValue(memberXml, "PolicyArn") || ""
385
+ }));
760
386
  }
761
- async listGroups(params = {}) {
762
- const response = await this.request("ListGroups", params);
763
- const groups = this.parseGroups(response);
387
+ async putUserPolicy(params) {
388
+ await this.request("PutUserPolicy", params);
389
+ }
390
+ async getUserPolicy(params) {
391
+ const response = await this.request("GetUserPolicy", params);
392
+ return {
393
+ UserName: parseXmlValue(response, "UserName") || "",
394
+ PolicyName: parseXmlValue(response, "PolicyName") || "",
395
+ PolicyDocument: decodeURIComponent(parseXmlValue(response, "PolicyDocument") || "")
396
+ };
397
+ }
398
+ async deleteUserPolicy(params) {
399
+ await this.request("DeleteUserPolicy", params);
400
+ }
401
+ async listUserPolicies(params) {
402
+ const response = await this.request("ListUserPolicies", params);
403
+ const policyNames = parseXmlArray(response, "PolicyNames", "member");
764
404
  const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
765
405
  const marker = parseXmlValue(response, "Marker");
766
- return { Groups: groups, IsTruncated: isTruncated, Marker: marker };
767
- }
768
- async updateGroup(params) {
769
- await this.request("UpdateGroup", params);
406
+ return { PolicyNames: policyNames, IsTruncated: isTruncated, Marker: marker };
770
407
  }
771
- async deleteGroup(params) {
772
- await this.request("DeleteGroup", params);
408
+ async putGroupPolicy(params) {
409
+ await this.request("PutGroupPolicy", params);
773
410
  }
774
- async addUserToGroup(params) {
775
- await this.request("AddUserToGroup", params);
411
+ async getGroupPolicy(params) {
412
+ const response = await this.request("GetGroupPolicy", params);
413
+ return {
414
+ GroupName: parseXmlValue(response, "GroupName") || "",
415
+ PolicyName: parseXmlValue(response, "PolicyName") || "",
416
+ PolicyDocument: decodeURIComponent(parseXmlValue(response, "PolicyDocument") || "")
417
+ };
776
418
  }
777
- async removeUserFromGroup(params) {
778
- await this.request("RemoveUserFromGroup", params);
419
+ async deleteGroupPolicy(params) {
420
+ await this.request("DeleteGroupPolicy", params);
779
421
  }
780
- async listGroupsForUser(params) {
781
- const response = await this.request("ListGroupsForUser", params);
782
- const groups = this.parseGroups(response);
422
+ async listGroupPolicies(params) {
423
+ const response = await this.request("ListGroupPolicies", params);
424
+ const policyNames = parseXmlArray(response, "PolicyNames", "member");
783
425
  const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
784
426
  const marker = parseXmlValue(response, "Marker");
785
- return { Groups: groups, IsTruncated: isTruncated, Marker: marker };
427
+ return { PolicyNames: policyNames, IsTruncated: isTruncated, Marker: marker };
786
428
  }
787
- parseGroup(xml) {
429
+ async putRolePolicy(params) {
430
+ await this.request("PutRolePolicy", params);
431
+ }
432
+ async getRolePolicy(params) {
433
+ const response = await this.request("GetRolePolicy", params);
788
434
  return {
789
- GroupName: parseXmlValue(xml, "GroupName") || "",
790
- GroupId: parseXmlValue(xml, "GroupId") || "",
791
- Arn: parseXmlValue(xml, "Arn") || "",
792
- Path: parseXmlValue(xml, "Path"),
793
- CreateDate: parseXmlValue(xml, "CreateDate")
435
+ RoleName: parseXmlValue(response, "RoleName") || "",
436
+ PolicyName: parseXmlValue(response, "PolicyName") || "",
437
+ PolicyDocument: decodeURIComponent(parseXmlValue(response, "PolicyDocument") || "")
794
438
  };
795
439
  }
796
- parseGroups(xml) {
797
- const memberXmls = parseXmlArray(xml, "Groups", "member");
798
- return memberXmls.map((memberXml) => ({
799
- GroupName: parseXmlValue(memberXml, "GroupName") || "",
800
- GroupId: parseXmlValue(memberXml, "GroupId") || "",
801
- Arn: parseXmlValue(memberXml, "Arn") || "",
802
- Path: parseXmlValue(memberXml, "Path"),
803
- CreateDate: parseXmlValue(memberXml, "CreateDate")
804
- }));
440
+ async deleteRolePolicy(params) {
441
+ await this.request("DeleteRolePolicy", params);
805
442
  }
806
- async createRole(params) {
807
- const response = await this.request("CreateRole", params);
808
- return this.parseRole(response);
443
+ async listRolePolicies(params) {
444
+ const response = await this.request("ListRolePolicies", params);
445
+ const policyNames = parseXmlArray(response, "PolicyNames", "member");
446
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
447
+ const marker = parseXmlValue(response, "Marker");
448
+ return { PolicyNames: policyNames, IsTruncated: isTruncated, Marker: marker };
809
449
  }
810
- async getRole(params) {
811
- const response = await this.request("GetRole", params);
812
- return this.parseRole(response);
450
+ async createAccessKey(params = {}) {
451
+ const response = await this.request("CreateAccessKey", params);
452
+ if (typeof response === "object") {
453
+ const accessKey = response?.CreateAccessKeyResult?.AccessKey || response?.AccessKey;
454
+ if (accessKey) {
455
+ return {
456
+ AccessKey: {
457
+ UserName: accessKey.UserName || "",
458
+ AccessKeyId: accessKey.AccessKeyId || "",
459
+ Status: accessKey.Status || "Active",
460
+ SecretAccessKey: accessKey.SecretAccessKey || "",
461
+ CreateDate: accessKey.CreateDate
462
+ }
463
+ };
464
+ }
465
+ }
466
+ return {
467
+ AccessKey: {
468
+ UserName: parseXmlValue(response, "UserName") || "",
469
+ AccessKeyId: parseXmlValue(response, "AccessKeyId") || "",
470
+ Status: parseXmlValue(response, "Status") || "Active",
471
+ SecretAccessKey: parseXmlValue(response, "SecretAccessKey") || "",
472
+ CreateDate: parseXmlValue(response, "CreateDate")
473
+ }
474
+ };
813
475
  }
814
- async listRoles(params = {}) {
815
- const response = await this.request("ListRoles", params);
816
- const roles = this.parseRoles(response);
476
+ async listAccessKeys(params = {}) {
477
+ const response = await this.request("ListAccessKeys", params);
478
+ const keys = this.parseAccessKeys(response);
817
479
  const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
818
480
  const marker = parseXmlValue(response, "Marker");
819
- return { Roles: roles, IsTruncated: isTruncated, Marker: marker };
481
+ return { AccessKeyMetadata: keys, IsTruncated: isTruncated, Marker: marker };
820
482
  }
821
- async updateRole(params) {
822
- await this.request("UpdateRole", params);
483
+ async updateAccessKey(params) {
484
+ await this.request("UpdateAccessKey", params);
823
485
  }
824
- async updateRoleDescription(params) {
825
- const response = await this.request("UpdateRoleDescription", params);
826
- return this.parseRole(response);
486
+ async deleteAccessKey(params) {
487
+ await this.request("DeleteAccessKey", params);
488
+ }
489
+ async getAccessKeyLastUsed(params) {
490
+ const response = await this.request("GetAccessKeyLastUsed", params);
491
+ return {
492
+ UserName: parseXmlValue(response, "UserName") || "",
493
+ AccessKeyLastUsed: {
494
+ LastUsedDate: parseXmlValue(response, "LastUsedDate"),
495
+ ServiceName: parseXmlValue(response, "ServiceName"),
496
+ Region: parseXmlValue(response, "Region")
497
+ }
498
+ };
827
499
  }
828
- async updateAssumeRolePolicy(params) {
829
- await this.request("UpdateAssumeRolePolicy", params);
500
+ parseAccessKeys(xml) {
501
+ const memberXmls = parseXmlArray(xml, "AccessKeyMetadata", "member");
502
+ return memberXmls.map((memberXml) => ({
503
+ UserName: parseXmlValue(memberXml, "UserName"),
504
+ AccessKeyId: parseXmlValue(memberXml, "AccessKeyId") || "",
505
+ Status: parseXmlValue(memberXml, "Status") || "Active",
506
+ CreateDate: parseXmlValue(memberXml, "CreateDate")
507
+ }));
830
508
  }
831
- async deleteRole(params) {
832
- await this.request("DeleteRole", params);
509
+ async createInstanceProfile(params) {
510
+ const response = await this.request("CreateInstanceProfile", params);
511
+ return this.parseInstanceProfile(response);
833
512
  }
834
- async tagRole(params) {
835
- await this.request("TagRole", params);
513
+ async getInstanceProfile(params) {
514
+ const response = await this.request("GetInstanceProfile", params);
515
+ return this.parseInstanceProfile(response);
836
516
  }
837
- async untagRole(params) {
838
- await this.request("UntagRole", params);
517
+ async listInstanceProfiles(params = {}) {
518
+ const response = await this.request("ListInstanceProfiles", params);
519
+ const profiles = this.parseInstanceProfiles(response);
520
+ const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
521
+ const marker = parseXmlValue(response, "Marker");
522
+ return { InstanceProfiles: profiles, IsTruncated: isTruncated, Marker: marker };
839
523
  }
840
- async listRoleTags(params) {
841
- const response = await this.request("ListRoleTags", params);
842
- const tags = this.parseTags(response);
524
+ async listInstanceProfilesForRole(params) {
525
+ const response = await this.request("ListInstanceProfilesForRole", params);
526
+ const profiles = this.parseInstanceProfiles(response);
843
527
  const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
844
528
  const marker = parseXmlValue(response, "Marker");
845
- return { Tags: tags, IsTruncated: isTruncated, Marker: marker };
529
+ return { InstanceProfiles: profiles, IsTruncated: isTruncated, Marker: marker };
846
530
  }
847
- parseRole(xml) {
531
+ async addRoleToInstanceProfile(params) {
532
+ await this.request("AddRoleToInstanceProfile", params);
533
+ }
534
+ async removeRoleFromInstanceProfile(params) {
535
+ await this.request("RemoveRoleFromInstanceProfile", params);
536
+ }
537
+ async deleteInstanceProfile(params) {
538
+ await this.request("DeleteInstanceProfile", params);
539
+ }
540
+ parseInstanceProfile(xml) {
848
541
  return {
849
- RoleName: parseXmlValue(xml, "RoleName") || "",
850
- RoleId: parseXmlValue(xml, "RoleId") || "",
542
+ InstanceProfileName: parseXmlValue(xml, "InstanceProfileName") || "",
543
+ InstanceProfileId: parseXmlValue(xml, "InstanceProfileId") || "",
851
544
  Arn: parseXmlValue(xml, "Arn") || "",
852
545
  Path: parseXmlValue(xml, "Path"),
853
- CreateDate: parseXmlValue(xml, "CreateDate"),
854
- AssumeRolePolicyDocument: parseXmlValue(xml, "AssumeRolePolicyDocument"),
855
- Description: parseXmlValue(xml, "Description"),
856
- MaxSessionDuration: parseXmlValue(xml, "MaxSessionDuration") ? Number.parseInt(parseXmlValue(xml, "MaxSessionDuration"), 10) : undefined
546
+ CreateDate: parseXmlValue(xml, "CreateDate")
857
547
  };
858
548
  }
859
- parseRoles(xml) {
860
- const memberXmls = parseXmlArray(xml, "Roles", "member");
549
+ parseInstanceProfiles(xml) {
550
+ const memberXmls = parseXmlArray(xml, "InstanceProfiles", "member");
861
551
  return memberXmls.map((memberXml) => ({
862
- RoleName: parseXmlValue(memberXml, "RoleName") || "",
863
- RoleId: parseXmlValue(memberXml, "RoleId") || "",
552
+ InstanceProfileName: parseXmlValue(memberXml, "InstanceProfileName") || "",
553
+ InstanceProfileId: parseXmlValue(memberXml, "InstanceProfileId") || "",
864
554
  Arn: parseXmlValue(memberXml, "Arn") || "",
865
555
  Path: parseXmlValue(memberXml, "Path"),
866
- CreateDate: parseXmlValue(memberXml, "CreateDate"),
867
- AssumeRolePolicyDocument: parseXmlValue(memberXml, "AssumeRolePolicyDocument"),
868
- Description: parseXmlValue(memberXml, "Description"),
869
- MaxSessionDuration: parseXmlValue(memberXml, "MaxSessionDuration") ? Number.parseInt(parseXmlValue(memberXml, "MaxSessionDuration"), 10) : undefined
870
- }));
871
- }
872
- parseTags(xml) {
873
- const memberXmls = parseXmlArray(xml, "Tags", "member");
874
- return memberXmls.map((memberXml) => ({
875
- Key: parseXmlValue(memberXml, "Key") || "",
876
- Value: parseXmlValue(memberXml, "Value") || ""
556
+ CreateDate: parseXmlValue(memberXml, "CreateDate")
877
557
  }));
878
558
  }
879
- async createPolicy(params) {
880
- const response = await this.request("CreatePolicy", params);
881
- return this.parsePolicy(response);
882
- }
883
- async getPolicy(params) {
884
- const response = await this.request("GetPolicy", params);
885
- return this.parsePolicy(response);
886
- }
887
- async getPolicyVersion(params) {
888
- const response = await this.request("GetPolicyVersion", params);
559
+ async getAccountPasswordPolicy() {
560
+ const response = await this.request("GetAccountPasswordPolicy");
889
561
  return {
890
- VersionId: parseXmlValue(response, "VersionId") || "",
891
- IsDefaultVersion: parseXmlValue(response, "IsDefaultVersion") === "true",
892
- CreateDate: parseXmlValue(response, "CreateDate"),
893
- Document: parseXmlValue(response, "Document")
562
+ MinimumPasswordLength: parseXmlValue(response, "MinimumPasswordLength") ? Number.parseInt(parseXmlValue(response, "MinimumPasswordLength"), 10) : undefined,
563
+ RequireSymbols: parseXmlValue(response, "RequireSymbols") === "true",
564
+ RequireNumbers: parseXmlValue(response, "RequireNumbers") === "true",
565
+ RequireUppercaseCharacters: parseXmlValue(response, "RequireUppercaseCharacters") === "true",
566
+ RequireLowercaseCharacters: parseXmlValue(response, "RequireLowercaseCharacters") === "true",
567
+ AllowUsersToChangePassword: parseXmlValue(response, "AllowUsersToChangePassword") === "true",
568
+ ExpirePasswords: parseXmlValue(response, "ExpirePasswords") === "true",
569
+ MaxPasswordAge: parseXmlValue(response, "MaxPasswordAge") ? Number.parseInt(parseXmlValue(response, "MaxPasswordAge"), 10) : undefined,
570
+ PasswordReusePrevention: parseXmlValue(response, "PasswordReusePrevention") ? Number.parseInt(parseXmlValue(response, "PasswordReusePrevention"), 10) : undefined,
571
+ HardExpiry: parseXmlValue(response, "HardExpiry") === "true"
894
572
  };
895
573
  }
896
- async listPolicies(params = {}) {
897
- const response = await this.request("ListPolicies", params);
898
- const policies = this.parsePolicies(response);
899
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
900
- const marker = parseXmlValue(response, "Marker");
901
- return { Policies: policies, IsTruncated: isTruncated, Marker: marker };
574
+ async updateAccountPasswordPolicy(params) {
575
+ await this.request("UpdateAccountPasswordPolicy", params);
902
576
  }
903
- async listPolicyVersions(params) {
904
- const response = await this.request("ListPolicyVersions", params);
905
- const versions = this.parsePolicyVersions(response);
577
+ async deleteAccountPasswordPolicy() {
578
+ await this.request("DeleteAccountPasswordPolicy");
579
+ }
580
+ async getAccountSummary() {
581
+ const response = await this.request("GetAccountSummary");
582
+ const summary = {};
583
+ const entries = parseXmlArray(response, "SummaryMap", "entry");
584
+ for (const entry of entries) {
585
+ const key = parseXmlValue(entry, "key");
586
+ const value = parseXmlValue(entry, "value");
587
+ if (key && value) {
588
+ summary[key] = Number.parseInt(value, 10);
589
+ }
590
+ }
591
+ return summary;
592
+ }
593
+ async listAccountAliases() {
594
+ const response = await this.request("ListAccountAliases");
595
+ const aliases = parseXmlArray(response, "AccountAliases", "member");
906
596
  const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
907
597
  const marker = parseXmlValue(response, "Marker");
908
- return { Versions: versions, IsTruncated: isTruncated, Marker: marker };
909
- }
910
- async createPolicyVersion(params) {
911
- const response = await this.request("CreatePolicyVersion", params);
912
- return {
913
- VersionId: parseXmlValue(response, "VersionId") || "",
914
- IsDefaultVersion: parseXmlValue(response, "IsDefaultVersion") === "true",
915
- CreateDate: parseXmlValue(response, "CreateDate")
916
- };
598
+ return { AccountAliases: aliases, IsTruncated: isTruncated, Marker: marker };
917
599
  }
918
- async deletePolicyVersion(params) {
919
- await this.request("DeletePolicyVersion", params);
600
+ async createAccountAlias(params) {
601
+ await this.request("CreateAccountAlias", params);
920
602
  }
921
- async setDefaultPolicyVersion(params) {
922
- await this.request("SetDefaultPolicyVersion", params);
603
+ async deleteAccountAlias(params) {
604
+ await this.request("DeleteAccountAlias", params);
923
605
  }
924
- async deletePolicy(params) {
925
- await this.request("DeletePolicy", params);
606
+ async simulatePrincipalPolicy(params) {
607
+ const response = await this.request("SimulatePrincipalPolicy", params);
608
+ return this.parseSimulationResults(response);
926
609
  }
927
- async attachUserPolicy(params) {
928
- await this.request("AttachUserPolicy", params);
610
+ parseSimulationResults(xml) {
611
+ const resultXmls = parseXmlArray(xml, "EvaluationResults", "member");
612
+ const evaluationResults = resultXmls.map((resultXml) => {
613
+ const matchedStatementXmls = parseXmlArray(resultXml, "MatchedStatements", "member");
614
+ const matchedStatements = matchedStatementXmls.map((stmtXml) => ({
615
+ SourcePolicyId: parseXmlValue(stmtXml, "SourcePolicyId"),
616
+ SourcePolicyType: parseXmlValue(stmtXml, "SourcePolicyType")
617
+ }));
618
+ return {
619
+ EvalActionName: parseXmlValue(resultXml, "EvalActionName") || "",
620
+ EvalResourceName: parseXmlValue(resultXml, "EvalResourceName"),
621
+ EvalDecision: parseXmlValue(resultXml, "EvalDecision") || "",
622
+ MatchedStatements: matchedStatements.length > 0 ? matchedStatements : undefined
623
+ };
624
+ });
625
+ const isTruncated = parseXmlValue(xml, "IsTruncated") === "true";
626
+ const marker = parseXmlValue(xml, "Marker");
627
+ return { EvaluationResults: evaluationResults, IsTruncated: isTruncated, Marker: marker };
929
628
  }
930
- async detachUserPolicy(params) {
931
- await this.request("DetachUserPolicy", params);
629
+ }
630
+
631
+ // src/aws/ses.ts
632
+ class SESClient {
633
+ client;
634
+ region;
635
+ constructor(region = "us-east-1", credentials) {
636
+ this.region = region;
637
+ this.client = new AWSClient(credentials);
932
638
  }
933
- async attachGroupPolicy(params) {
934
- await this.request("AttachGroupPolicy", params);
639
+ async createEmailIdentity(params) {
640
+ const result = await this.client.request({
641
+ service: "email",
642
+ region: this.region,
643
+ method: "POST",
644
+ path: "/v2/email/identities",
645
+ headers: {
646
+ "Content-Type": "application/json"
647
+ },
648
+ body: JSON.stringify(params)
649
+ });
650
+ return result;
935
651
  }
936
- async detachGroupPolicy(params) {
937
- await this.request("DetachGroupPolicy", params);
652
+ async getEmailIdentity(emailIdentity) {
653
+ const result = await this.client.request({
654
+ service: "email",
655
+ region: this.region,
656
+ method: "GET",
657
+ path: `/v2/email/identities/${encodeURIComponent(emailIdentity)}`,
658
+ headers: {
659
+ "Content-Type": "application/json"
660
+ }
661
+ });
662
+ return {
663
+ IdentityType: result.IdentityType,
664
+ IdentityName: emailIdentity,
665
+ SendingEnabled: result.VerifiedForSendingStatus,
666
+ VerificationStatus: result.VerificationStatus,
667
+ DkimAttributes: result.DkimAttributes,
668
+ MailFromAttributes: result.MailFromAttributes
669
+ };
938
670
  }
939
- async attachRolePolicy(params) {
940
- await this.request("AttachRolePolicy", params);
671
+ async putEmailIdentityMailFromAttributes(emailIdentity, params) {
672
+ await this.client.request({
673
+ service: "email",
674
+ region: this.region,
675
+ method: "PUT",
676
+ path: `/v2/email/identities/${encodeURIComponent(emailIdentity)}/mail-from`,
677
+ headers: {
678
+ "Content-Type": "application/json"
679
+ },
680
+ body: JSON.stringify(params)
681
+ });
941
682
  }
942
- async detachRolePolicy(params) {
943
- await this.request("DetachRolePolicy", params);
683
+ async listEmailIdentities(params) {
684
+ let path = "/v2/email/identities";
685
+ const queryParams = [];
686
+ if (params?.PageSize) {
687
+ queryParams.push(`PageSize=${params.PageSize}`);
688
+ }
689
+ if (params?.NextToken) {
690
+ queryParams.push(`NextToken=${encodeURIComponent(params.NextToken)}`);
691
+ }
692
+ if (queryParams.length > 0) {
693
+ path += `?${queryParams.join("&")}`;
694
+ }
695
+ const result = await this.client.request({
696
+ service: "email",
697
+ region: this.region,
698
+ method: "GET",
699
+ path,
700
+ headers: {
701
+ "Content-Type": "application/json"
702
+ }
703
+ });
704
+ return {
705
+ EmailIdentities: result.EmailIdentities,
706
+ NextToken: result.NextToken
707
+ };
944
708
  }
945
- async listAttachedUserPolicies(params) {
946
- const response = await this.request("ListAttachedUserPolicies", params);
947
- const policies = this.parseAttachedPolicies(response);
948
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
949
- const marker = parseXmlValue(response, "Marker");
950
- return { AttachedPolicies: policies, IsTruncated: isTruncated, Marker: marker };
709
+ async deleteEmailIdentity(emailIdentity) {
710
+ await this.client.request({
711
+ service: "email",
712
+ region: this.region,
713
+ method: "DELETE",
714
+ path: `/v2/email/identities/${encodeURIComponent(emailIdentity)}`,
715
+ headers: {
716
+ "Content-Type": "application/json"
717
+ }
718
+ });
951
719
  }
952
- async listAttachedGroupPolicies(params) {
953
- const response = await this.request("ListAttachedGroupPolicies", params);
954
- const policies = this.parseAttachedPolicies(response);
955
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
956
- const marker = parseXmlValue(response, "Marker");
957
- return { AttachedPolicies: policies, IsTruncated: isTruncated, Marker: marker };
720
+ async putEmailIdentityDkimAttributes(params) {
721
+ await this.client.request({
722
+ service: "email",
723
+ region: this.region,
724
+ method: "PUT",
725
+ path: `/v2/email/identities/${encodeURIComponent(params.EmailIdentity)}/dkim`,
726
+ headers: {
727
+ "Content-Type": "application/json"
728
+ },
729
+ body: JSON.stringify({ SigningEnabled: params.SigningEnabled })
730
+ });
958
731
  }
959
- async listAttachedRolePolicies(params) {
960
- const response = await this.request("ListAttachedRolePolicies", params);
961
- const policies = this.parseAttachedPolicies(response);
962
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
963
- const marker = parseXmlValue(response, "Marker");
964
- return { AttachedPolicies: policies, IsTruncated: isTruncated, Marker: marker };
732
+ async sendEmail(params) {
733
+ const result = await this.client.request({
734
+ service: "email",
735
+ region: this.region,
736
+ method: "POST",
737
+ path: "/v2/email/outbound-emails",
738
+ headers: {
739
+ "Content-Type": "application/json"
740
+ },
741
+ body: JSON.stringify(params)
742
+ });
743
+ return {
744
+ MessageId: result.MessageId
745
+ };
965
746
  }
966
- parsePolicy(xml) {
747
+ async sendBulkEmail(params) {
748
+ const result = await this.client.request({
749
+ service: "email",
750
+ region: this.region,
751
+ method: "POST",
752
+ path: "/v2/email/outbound-bulk-emails",
753
+ headers: {
754
+ "Content-Type": "application/json"
755
+ },
756
+ body: JSON.stringify(params)
757
+ });
967
758
  return {
968
- PolicyName: parseXmlValue(xml, "PolicyName") || "",
969
- PolicyId: parseXmlValue(xml, "PolicyId") || "",
970
- Arn: parseXmlValue(xml, "Arn") || "",
971
- Path: parseXmlValue(xml, "Path"),
972
- DefaultVersionId: parseXmlValue(xml, "DefaultVersionId"),
973
- AttachmentCount: parseXmlValue(xml, "AttachmentCount") ? Number.parseInt(parseXmlValue(xml, "AttachmentCount"), 10) : undefined,
974
- PermissionsBoundaryUsageCount: parseXmlValue(xml, "PermissionsBoundaryUsageCount") ? Number.parseInt(parseXmlValue(xml, "PermissionsBoundaryUsageCount"), 10) : undefined,
975
- IsAttachable: parseXmlValue(xml, "IsAttachable") === "true",
976
- Description: parseXmlValue(xml, "Description"),
977
- CreateDate: parseXmlValue(xml, "CreateDate"),
978
- UpdateDate: parseXmlValue(xml, "UpdateDate")
759
+ BulkEmailEntryResults: result.BulkEmailEntryResults
979
760
  };
980
761
  }
981
- parsePolicies(xml) {
982
- const memberXmls = parseXmlArray(xml, "Policies", "member");
983
- return memberXmls.map((memberXml) => ({
984
- PolicyName: parseXmlValue(memberXml, "PolicyName") || "",
985
- PolicyId: parseXmlValue(memberXml, "PolicyId") || "",
986
- Arn: parseXmlValue(memberXml, "Arn") || "",
987
- Path: parseXmlValue(memberXml, "Path"),
988
- DefaultVersionId: parseXmlValue(memberXml, "DefaultVersionId"),
989
- AttachmentCount: parseXmlValue(memberXml, "AttachmentCount") ? Number.parseInt(parseXmlValue(memberXml, "AttachmentCount"), 10) : undefined,
990
- PermissionsBoundaryUsageCount: parseXmlValue(memberXml, "PermissionsBoundaryUsageCount") ? Number.parseInt(parseXmlValue(memberXml, "PermissionsBoundaryUsageCount"), 10) : undefined,
991
- IsAttachable: parseXmlValue(memberXml, "IsAttachable") === "true",
992
- Description: parseXmlValue(memberXml, "Description"),
993
- CreateDate: parseXmlValue(memberXml, "CreateDate"),
994
- UpdateDate: parseXmlValue(memberXml, "UpdateDate")
995
- }));
762
+ async createEmailTemplate(params) {
763
+ await this.client.request({
764
+ service: "email",
765
+ region: this.region,
766
+ method: "POST",
767
+ path: "/v2/email/templates",
768
+ headers: {
769
+ "Content-Type": "application/json"
770
+ },
771
+ body: JSON.stringify(params)
772
+ });
996
773
  }
997
- parsePolicyVersions(xml) {
998
- const memberXmls = parseXmlArray(xml, "Versions", "member");
999
- return memberXmls.map((memberXml) => ({
1000
- VersionId: parseXmlValue(memberXml, "VersionId") || "",
1001
- IsDefaultVersion: parseXmlValue(memberXml, "IsDefaultVersion") === "true",
1002
- CreateDate: parseXmlValue(memberXml, "CreateDate")
1003
- }));
774
+ async getEmailTemplate(templateName) {
775
+ const result = await this.client.request({
776
+ service: "email",
777
+ region: this.region,
778
+ method: "GET",
779
+ path: `/v2/email/templates/${encodeURIComponent(templateName)}`,
780
+ headers: {
781
+ "Content-Type": "application/json"
782
+ }
783
+ });
784
+ return result;
1004
785
  }
1005
- parseAttachedPolicies(xml) {
1006
- const memberXmls = parseXmlArray(xml, "AttachedPolicies", "member");
1007
- return memberXmls.map((memberXml) => ({
1008
- PolicyName: parseXmlValue(memberXml, "PolicyName") || "",
1009
- PolicyArn: parseXmlValue(memberXml, "PolicyArn") || ""
1010
- }));
786
+ async deleteEmailTemplate(templateName) {
787
+ await this.client.request({
788
+ service: "email",
789
+ region: this.region,
790
+ method: "DELETE",
791
+ path: `/v2/email/templates/${encodeURIComponent(templateName)}`,
792
+ headers: {
793
+ "Content-Type": "application/json"
794
+ }
795
+ });
1011
796
  }
1012
- async putUserPolicy(params) {
1013
- await this.request("PutUserPolicy", params);
797
+ async listEmailTemplates(params) {
798
+ let path = "/v2/email/templates";
799
+ const queryParams = [];
800
+ if (params?.PageSize) {
801
+ queryParams.push(`PageSize=${params.PageSize}`);
802
+ }
803
+ if (params?.NextToken) {
804
+ queryParams.push(`NextToken=${encodeURIComponent(params.NextToken)}`);
805
+ }
806
+ if (queryParams.length > 0) {
807
+ path += `?${queryParams.join("&")}`;
808
+ }
809
+ const result = await this.client.request({
810
+ service: "email",
811
+ region: this.region,
812
+ method: "GET",
813
+ path,
814
+ headers: {
815
+ "Content-Type": "application/json"
816
+ }
817
+ });
818
+ return result;
1014
819
  }
1015
- async getUserPolicy(params) {
1016
- const response = await this.request("GetUserPolicy", params);
820
+ async getSendStatistics() {
821
+ const result = await this.client.request({
822
+ service: "ses",
823
+ region: this.region,
824
+ method: "POST",
825
+ path: "/",
826
+ headers: {
827
+ "Content-Type": "application/x-www-form-urlencoded"
828
+ },
829
+ body: "Action=GetSendStatistics&Version=2010-12-01"
830
+ });
1017
831
  return {
1018
- UserName: parseXmlValue(response, "UserName") || "",
1019
- PolicyName: parseXmlValue(response, "PolicyName") || "",
1020
- PolicyDocument: decodeURIComponent(parseXmlValue(response, "PolicyDocument") || "")
832
+ SendDataPoints: result.GetSendStatisticsResponse?.GetSendStatisticsResult?.SendDataPoints?.member
1021
833
  };
1022
834
  }
1023
- async deleteUserPolicy(params) {
1024
- await this.request("DeleteUserPolicy", params);
835
+ async getSendQuota() {
836
+ const result = await this.client.request({
837
+ service: "ses",
838
+ region: this.region,
839
+ method: "POST",
840
+ path: "/",
841
+ headers: {
842
+ "Content-Type": "application/x-www-form-urlencoded"
843
+ },
844
+ body: "Action=GetSendQuota&Version=2010-12-01"
845
+ });
846
+ const quota = result.GetSendQuotaResponse?.GetSendQuotaResult;
847
+ return {
848
+ Max24HourSend: quota?.Max24HourSend ? Number(quota.Max24HourSend) : undefined,
849
+ MaxSendRate: quota?.MaxSendRate ? Number(quota.MaxSendRate) : undefined,
850
+ SentLast24Hours: quota?.SentLast24Hours ? Number(quota.SentLast24Hours) : undefined
851
+ };
1025
852
  }
1026
- async listUserPolicies(params) {
1027
- const response = await this.request("ListUserPolicies", params);
1028
- const policyNames = parseXmlArray(response, "PolicyNames", "member");
1029
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
1030
- const marker = parseXmlValue(response, "Marker");
1031
- return { PolicyNames: policyNames, IsTruncated: isTruncated, Marker: marker };
853
+ async verifyDomain(domain) {
854
+ const result = await this.createEmailIdentity({
855
+ EmailIdentity: domain
856
+ });
857
+ return {
858
+ dkimTokens: result.DkimAttributes?.Tokens,
859
+ verificationStatus: result.DkimAttributes?.Status
860
+ };
1032
861
  }
1033
- async putGroupPolicy(params) {
1034
- await this.request("PutGroupPolicy", params);
862
+ async sendSimpleEmail(params) {
863
+ const toAddresses = Array.isArray(params.to) ? params.to : [params.to];
864
+ const replyToAddresses = params.replyTo ? Array.isArray(params.replyTo) ? params.replyTo : [params.replyTo] : undefined;
865
+ const body = {};
866
+ if (params.text) {
867
+ body.Text = { Data: params.text };
868
+ }
869
+ if (params.html) {
870
+ body.Html = { Data: params.html };
871
+ }
872
+ return this.sendEmail({
873
+ FromEmailAddress: params.from,
874
+ Destination: {
875
+ ToAddresses: toAddresses
876
+ },
877
+ Content: {
878
+ Simple: {
879
+ Subject: { Data: params.subject },
880
+ Body: body
881
+ }
882
+ },
883
+ ReplyToAddresses: replyToAddresses
884
+ });
885
+ }
886
+ async sendTemplatedEmail(params) {
887
+ const toAddresses = Array.isArray(params.to) ? params.to : [params.to];
888
+ const replyToAddresses = params.replyTo ? Array.isArray(params.replyTo) ? params.replyTo : [params.replyTo] : undefined;
889
+ return this.sendEmail({
890
+ FromEmailAddress: params.from,
891
+ Destination: {
892
+ ToAddresses: toAddresses
893
+ },
894
+ Content: {
895
+ Template: {
896
+ TemplateName: params.templateName,
897
+ TemplateData: JSON.stringify(params.templateData)
898
+ }
899
+ },
900
+ ReplyToAddresses: replyToAddresses
901
+ });
1035
902
  }
1036
- async getGroupPolicy(params) {
1037
- const response = await this.request("GetGroupPolicy", params);
1038
- return {
1039
- GroupName: parseXmlValue(response, "GroupName") || "",
1040
- PolicyName: parseXmlValue(response, "PolicyName") || "",
1041
- PolicyDocument: decodeURIComponent(parseXmlValue(response, "PolicyDocument") || "")
1042
- };
903
+ async getDkimRecords(domain) {
904
+ const identity = await this.getEmailIdentity(domain);
905
+ if (!identity.DkimAttributes?.Tokens) {
906
+ return [];
907
+ }
908
+ return identity.DkimAttributes.Tokens.map((token) => ({
909
+ name: `${token}._domainkey.${domain}`,
910
+ type: "CNAME",
911
+ value: `${token}.dkim.amazonses.com`
912
+ }));
1043
913
  }
1044
- async deleteGroupPolicy(params) {
1045
- await this.request("DeleteGroupPolicy", params);
914
+ async isDomainVerified(domain) {
915
+ try {
916
+ const identity = await this.getEmailIdentity(domain);
917
+ return identity.VerificationStatus === "SUCCESS" && identity.SendingEnabled === true;
918
+ } catch {
919
+ return false;
920
+ }
1046
921
  }
1047
- async listGroupPolicies(params) {
1048
- const response = await this.request("ListGroupPolicies", params);
1049
- const policyNames = parseXmlArray(response, "PolicyNames", "member");
1050
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
1051
- const marker = parseXmlValue(response, "Marker");
1052
- return { PolicyNames: policyNames, IsTruncated: isTruncated, Marker: marker };
922
+ async waitForDomainVerification(domain, maxAttempts = 60, delayMs = 30000) {
923
+ for (let i = 0;i < maxAttempts; i++) {
924
+ const isVerified = await this.isDomainVerified(domain);
925
+ if (isVerified) {
926
+ return true;
927
+ }
928
+ await new Promise((resolve) => setTimeout(resolve, delayMs));
929
+ }
930
+ return false;
1053
931
  }
1054
- async putRolePolicy(params) {
1055
- await this.request("PutRolePolicy", params);
932
+ buildFormBody(params) {
933
+ const entries = Object.entries(params).filter(([, value]) => value !== undefined).map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
934
+ return entries.join("&");
1056
935
  }
1057
- async getRolePolicy(params) {
1058
- const response = await this.request("GetRolePolicy", params);
1059
- return {
1060
- RoleName: parseXmlValue(response, "RoleName") || "",
1061
- PolicyName: parseXmlValue(response, "PolicyName") || "",
1062
- PolicyDocument: decodeURIComponent(parseXmlValue(response, "PolicyDocument") || "")
1063
- };
936
+ async createReceiptRuleSet(ruleSetName) {
937
+ await this.client.request({
938
+ service: "ses",
939
+ region: this.region,
940
+ method: "POST",
941
+ path: "/",
942
+ headers: {
943
+ "Content-Type": "application/x-www-form-urlencoded"
944
+ },
945
+ body: this.buildFormBody({
946
+ Action: "CreateReceiptRuleSet",
947
+ Version: "2010-12-01",
948
+ RuleSetName: ruleSetName
949
+ })
950
+ });
1064
951
  }
1065
- async deleteRolePolicy(params) {
1066
- await this.request("DeleteRolePolicy", params);
952
+ async deleteReceiptRuleSet(ruleSetName) {
953
+ await this.client.request({
954
+ service: "ses",
955
+ region: this.region,
956
+ method: "POST",
957
+ path: "/",
958
+ headers: {
959
+ "Content-Type": "application/x-www-form-urlencoded"
960
+ },
961
+ body: this.buildFormBody({
962
+ Action: "DeleteReceiptRuleSet",
963
+ Version: "2010-12-01",
964
+ RuleSetName: ruleSetName
965
+ })
966
+ });
1067
967
  }
1068
- async listRolePolicies(params) {
1069
- const response = await this.request("ListRolePolicies", params);
1070
- const policyNames = parseXmlArray(response, "PolicyNames", "member");
1071
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
1072
- const marker = parseXmlValue(response, "Marker");
1073
- return { PolicyNames: policyNames, IsTruncated: isTruncated, Marker: marker };
968
+ async setActiveReceiptRuleSet(ruleSetName) {
969
+ await this.client.request({
970
+ service: "ses",
971
+ region: this.region,
972
+ method: "POST",
973
+ path: "/",
974
+ headers: {
975
+ "Content-Type": "application/x-www-form-urlencoded"
976
+ },
977
+ body: this.buildFormBody({
978
+ Action: "SetActiveReceiptRuleSet",
979
+ Version: "2010-12-01",
980
+ RuleSetName: ruleSetName
981
+ })
982
+ });
1074
983
  }
1075
- async createAccessKey(params = {}) {
1076
- const response = await this.request("CreateAccessKey", params);
1077
- if (typeof response === "object") {
1078
- const accessKey = response?.CreateAccessKeyResult?.AccessKey || response?.AccessKey;
1079
- if (accessKey) {
1080
- return {
1081
- AccessKey: {
1082
- UserName: accessKey.UserName || "",
1083
- AccessKeyId: accessKey.AccessKeyId || "",
1084
- Status: accessKey.Status || "Active",
1085
- SecretAccessKey: accessKey.SecretAccessKey || "",
1086
- CreateDate: accessKey.CreateDate
1087
- }
1088
- };
1089
- }
984
+ async listReceiptRuleSets(nextToken) {
985
+ const formParams = {
986
+ Action: "ListReceiptRuleSets",
987
+ Version: "2010-12-01"
988
+ };
989
+ if (nextToken) {
990
+ formParams.NextToken = nextToken;
1090
991
  }
992
+ const result = await this.client.request({
993
+ service: "ses",
994
+ region: this.region,
995
+ method: "POST",
996
+ path: "/",
997
+ headers: {
998
+ "Content-Type": "application/x-www-form-urlencoded"
999
+ },
1000
+ body: this.buildFormBody(formParams)
1001
+ });
1002
+ const ruleSetsResult = result?.ListReceiptRuleSetsResponse?.ListReceiptRuleSetsResult || result?.ListReceiptRuleSetsResult;
1003
+ const ruleSets = ruleSetsResult?.RuleSets?.member;
1091
1004
  return {
1092
- AccessKey: {
1093
- UserName: parseXmlValue(response, "UserName") || "",
1094
- AccessKeyId: parseXmlValue(response, "AccessKeyId") || "",
1095
- Status: parseXmlValue(response, "Status") || "Active",
1096
- SecretAccessKey: parseXmlValue(response, "SecretAccessKey") || "",
1097
- CreateDate: parseXmlValue(response, "CreateDate")
1098
- }
1005
+ RuleSets: Array.isArray(ruleSets) ? ruleSets : ruleSets ? [ruleSets] : [],
1006
+ NextToken: ruleSetsResult?.NextToken
1099
1007
  };
1100
1008
  }
1101
- async listAccessKeys(params = {}) {
1102
- const response = await this.request("ListAccessKeys", params);
1103
- const keys = this.parseAccessKeys(response);
1104
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
1105
- const marker = parseXmlValue(response, "Marker");
1106
- return { AccessKeyMetadata: keys, IsTruncated: isTruncated, Marker: marker };
1107
- }
1108
- async updateAccessKey(params) {
1109
- await this.request("UpdateAccessKey", params);
1110
- }
1111
- async deleteAccessKey(params) {
1112
- await this.request("DeleteAccessKey", params);
1113
- }
1114
- async getAccessKeyLastUsed(params) {
1115
- const response = await this.request("GetAccessKeyLastUsed", params);
1009
+ async describeReceiptRuleSet(ruleSetName) {
1010
+ const result = await this.client.request({
1011
+ service: "ses",
1012
+ region: this.region,
1013
+ method: "POST",
1014
+ path: "/",
1015
+ headers: {
1016
+ "Content-Type": "application/x-www-form-urlencoded"
1017
+ },
1018
+ body: this.buildFormBody({
1019
+ Action: "DescribeReceiptRuleSet",
1020
+ Version: "2010-12-01",
1021
+ RuleSetName: ruleSetName
1022
+ })
1023
+ });
1024
+ const response = result?.DescribeReceiptRuleSetResponse?.DescribeReceiptRuleSetResult || result?.DescribeReceiptRuleSetResult;
1025
+ const rules = response?.Rules?.member;
1116
1026
  return {
1117
- UserName: parseXmlValue(response, "UserName") || "",
1118
- AccessKeyLastUsed: {
1119
- LastUsedDate: parseXmlValue(response, "LastUsedDate"),
1120
- ServiceName: parseXmlValue(response, "ServiceName"),
1121
- Region: parseXmlValue(response, "Region")
1122
- }
1027
+ Metadata: response?.Metadata,
1028
+ Rules: Array.isArray(rules) ? rules : rules ? [rules] : []
1123
1029
  };
1124
1030
  }
1125
- parseAccessKeys(xml) {
1126
- const memberXmls = parseXmlArray(xml, "AccessKeyMetadata", "member");
1127
- return memberXmls.map((memberXml) => ({
1128
- UserName: parseXmlValue(memberXml, "UserName"),
1129
- AccessKeyId: parseXmlValue(memberXml, "AccessKeyId") || "",
1130
- Status: parseXmlValue(memberXml, "Status") || "Active",
1131
- CreateDate: parseXmlValue(memberXml, "CreateDate")
1132
- }));
1133
- }
1134
- async createInstanceProfile(params) {
1135
- const response = await this.request("CreateInstanceProfile", params);
1136
- return this.parseInstanceProfile(response);
1137
- }
1138
- async getInstanceProfile(params) {
1139
- const response = await this.request("GetInstanceProfile", params);
1140
- return this.parseInstanceProfile(response);
1141
- }
1142
- async listInstanceProfiles(params = {}) {
1143
- const response = await this.request("ListInstanceProfiles", params);
1144
- const profiles = this.parseInstanceProfiles(response);
1145
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
1146
- const marker = parseXmlValue(response, "Marker");
1147
- return { InstanceProfiles: profiles, IsTruncated: isTruncated, Marker: marker };
1148
- }
1149
- async listInstanceProfilesForRole(params) {
1150
- const response = await this.request("ListInstanceProfilesForRole", params);
1151
- const profiles = this.parseInstanceProfiles(response);
1152
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
1153
- const marker = parseXmlValue(response, "Marker");
1154
- return { InstanceProfiles: profiles, IsTruncated: isTruncated, Marker: marker };
1155
- }
1156
- async addRoleToInstanceProfile(params) {
1157
- await this.request("AddRoleToInstanceProfile", params);
1031
+ async createReceiptRule(params) {
1032
+ const formParams = {
1033
+ Action: "CreateReceiptRule",
1034
+ Version: "2010-12-01",
1035
+ RuleSetName: params.RuleSetName,
1036
+ "Rule.Name": params.Rule.Name,
1037
+ "Rule.Enabled": params.Rule.Enabled !== false ? "true" : "false"
1038
+ };
1039
+ if (params.Rule.TlsPolicy) {
1040
+ formParams["Rule.TlsPolicy"] = params.Rule.TlsPolicy;
1041
+ }
1042
+ if (params.Rule.ScanEnabled !== undefined) {
1043
+ formParams["Rule.ScanEnabled"] = params.Rule.ScanEnabled ? "true" : "false";
1044
+ }
1045
+ if (params.After) {
1046
+ formParams.After = params.After;
1047
+ }
1048
+ if (params.Rule.Recipients) {
1049
+ params.Rule.Recipients.forEach((recipient, index) => {
1050
+ formParams[`Rule.Recipients.member.${index + 1}`] = recipient;
1051
+ });
1052
+ }
1053
+ params.Rule.Actions.forEach((action, index) => {
1054
+ const actionNum = index + 1;
1055
+ if (action.S3Action) {
1056
+ formParams[`Rule.Actions.member.${actionNum}.S3Action.BucketName`] = action.S3Action.BucketName;
1057
+ if (action.S3Action.ObjectKeyPrefix) {
1058
+ formParams[`Rule.Actions.member.${actionNum}.S3Action.ObjectKeyPrefix`] = action.S3Action.ObjectKeyPrefix;
1059
+ }
1060
+ if (action.S3Action.KmsKeyArn) {
1061
+ formParams[`Rule.Actions.member.${actionNum}.S3Action.KmsKeyArn`] = action.S3Action.KmsKeyArn;
1062
+ }
1063
+ }
1064
+ if (action.LambdaAction) {
1065
+ formParams[`Rule.Actions.member.${actionNum}.LambdaAction.FunctionArn`] = action.LambdaAction.FunctionArn;
1066
+ formParams[`Rule.Actions.member.${actionNum}.LambdaAction.InvocationType`] = action.LambdaAction.InvocationType || "Event";
1067
+ }
1068
+ if (action.SNSAction) {
1069
+ formParams[`Rule.Actions.member.${actionNum}.SNSAction.TopicArn`] = action.SNSAction.TopicArn;
1070
+ if (action.SNSAction.Encoding) {
1071
+ formParams[`Rule.Actions.member.${actionNum}.SNSAction.Encoding`] = action.SNSAction.Encoding;
1072
+ }
1073
+ }
1074
+ if (action.StopAction) {
1075
+ formParams[`Rule.Actions.member.${actionNum}.StopAction.Scope`] = action.StopAction.Scope;
1076
+ if (action.StopAction.TopicArn) {
1077
+ formParams[`Rule.Actions.member.${actionNum}.StopAction.TopicArn`] = action.StopAction.TopicArn;
1078
+ }
1079
+ }
1080
+ });
1081
+ await this.client.request({
1082
+ service: "ses",
1083
+ region: this.region,
1084
+ method: "POST",
1085
+ path: "/",
1086
+ headers: {
1087
+ "Content-Type": "application/x-www-form-urlencoded"
1088
+ },
1089
+ body: this.buildFormBody(formParams)
1090
+ });
1158
1091
  }
1159
- async removeRoleFromInstanceProfile(params) {
1160
- await this.request("RemoveRoleFromInstanceProfile", params);
1092
+ async deleteReceiptRule(ruleSetName, ruleName) {
1093
+ await this.client.request({
1094
+ service: "ses",
1095
+ region: this.region,
1096
+ method: "POST",
1097
+ path: "/",
1098
+ headers: {
1099
+ "Content-Type": "application/x-www-form-urlencoded"
1100
+ },
1101
+ body: this.buildFormBody({
1102
+ Action: "DeleteReceiptRule",
1103
+ Version: "2010-12-01",
1104
+ RuleSetName: ruleSetName,
1105
+ RuleName: ruleName
1106
+ })
1107
+ });
1161
1108
  }
1162
- async deleteInstanceProfile(params) {
1163
- await this.request("DeleteInstanceProfile", params);
1109
+ async receiptRuleSetExists(ruleSetName) {
1110
+ try {
1111
+ await this.describeReceiptRuleSet(ruleSetName);
1112
+ return true;
1113
+ } catch (error) {
1114
+ if (error.code === "RuleSetDoesNotExist" || error.statusCode === 400) {
1115
+ return false;
1116
+ }
1117
+ throw error;
1118
+ }
1164
1119
  }
1165
- parseInstanceProfile(xml) {
1120
+ async getActiveReceiptRuleSet() {
1121
+ const result = await this.client.request({
1122
+ service: "ses",
1123
+ region: this.region,
1124
+ method: "POST",
1125
+ path: "/",
1126
+ headers: {
1127
+ "Content-Type": "application/x-www-form-urlencoded"
1128
+ },
1129
+ body: this.buildFormBody({
1130
+ Action: "DescribeActiveReceiptRuleSet",
1131
+ Version: "2010-12-01"
1132
+ })
1133
+ });
1134
+ const response = result?.DescribeActiveReceiptRuleSetResponse?.DescribeActiveReceiptRuleSetResult || result?.DescribeActiveReceiptRuleSetResult;
1135
+ if (!response?.Metadata) {
1136
+ return null;
1137
+ }
1138
+ const rules = response?.Rules?.member;
1166
1139
  return {
1167
- InstanceProfileName: parseXmlValue(xml, "InstanceProfileName") || "",
1168
- InstanceProfileId: parseXmlValue(xml, "InstanceProfileId") || "",
1169
- Arn: parseXmlValue(xml, "Arn") || "",
1170
- Path: parseXmlValue(xml, "Path"),
1171
- CreateDate: parseXmlValue(xml, "CreateDate")
1140
+ Metadata: response?.Metadata,
1141
+ Rules: Array.isArray(rules) ? rules : rules ? [rules] : []
1172
1142
  };
1173
1143
  }
1174
- parseInstanceProfiles(xml) {
1175
- const memberXmls = parseXmlArray(xml, "InstanceProfiles", "member");
1176
- return memberXmls.map((memberXml) => ({
1177
- InstanceProfileName: parseXmlValue(memberXml, "InstanceProfileName") || "",
1178
- InstanceProfileId: parseXmlValue(memberXml, "InstanceProfileId") || "",
1179
- Arn: parseXmlValue(memberXml, "Arn") || "",
1180
- Path: parseXmlValue(memberXml, "Path"),
1181
- CreateDate: parseXmlValue(memberXml, "CreateDate")
1182
- }));
1144
+ async updateReceiptRule(params) {
1145
+ const formParams = {
1146
+ Action: "UpdateReceiptRule",
1147
+ Version: "2010-12-01",
1148
+ RuleSetName: params.RuleSetName,
1149
+ "Rule.Name": params.Rule.Name
1150
+ };
1151
+ if (params.Rule.Enabled !== undefined) {
1152
+ formParams["Rule.Enabled"] = params.Rule.Enabled ? "true" : "false";
1153
+ }
1154
+ if (params.Rule.TlsPolicy) {
1155
+ formParams["Rule.TlsPolicy"] = params.Rule.TlsPolicy;
1156
+ }
1157
+ if (params.Rule.ScanEnabled !== undefined) {
1158
+ formParams["Rule.ScanEnabled"] = params.Rule.ScanEnabled ? "true" : "false";
1159
+ }
1160
+ if (params.Rule.Recipients) {
1161
+ params.Rule.Recipients.forEach((recipient, index) => {
1162
+ formParams[`Rule.Recipients.member.${index + 1}`] = recipient;
1163
+ });
1164
+ }
1165
+ params.Rule.Actions.forEach((action, index) => {
1166
+ const actionNum = index + 1;
1167
+ if (action.S3Action) {
1168
+ formParams[`Rule.Actions.member.${actionNum}.S3Action.BucketName`] = action.S3Action.BucketName;
1169
+ if (action.S3Action.ObjectKeyPrefix) {
1170
+ formParams[`Rule.Actions.member.${actionNum}.S3Action.ObjectKeyPrefix`] = action.S3Action.ObjectKeyPrefix;
1171
+ }
1172
+ if (action.S3Action.KmsKeyArn) {
1173
+ formParams[`Rule.Actions.member.${actionNum}.S3Action.KmsKeyArn`] = action.S3Action.KmsKeyArn;
1174
+ }
1175
+ }
1176
+ if (action.LambdaAction) {
1177
+ formParams[`Rule.Actions.member.${actionNum}.LambdaAction.FunctionArn`] = action.LambdaAction.FunctionArn;
1178
+ formParams[`Rule.Actions.member.${actionNum}.LambdaAction.InvocationType`] = action.LambdaAction.InvocationType || "Event";
1179
+ }
1180
+ if (action.SNSAction) {
1181
+ formParams[`Rule.Actions.member.${actionNum}.SNSAction.TopicArn`] = action.SNSAction.TopicArn;
1182
+ if (action.SNSAction.Encoding) {
1183
+ formParams[`Rule.Actions.member.${actionNum}.SNSAction.Encoding`] = action.SNSAction.Encoding;
1184
+ }
1185
+ }
1186
+ if (action.StopAction) {
1187
+ formParams[`Rule.Actions.member.${actionNum}.StopAction.Scope`] = action.StopAction.Scope;
1188
+ if (action.StopAction.TopicArn) {
1189
+ formParams[`Rule.Actions.member.${actionNum}.StopAction.TopicArn`] = action.StopAction.TopicArn;
1190
+ }
1191
+ }
1192
+ });
1193
+ await this.client.request({
1194
+ service: "ses",
1195
+ region: this.region,
1196
+ method: "POST",
1197
+ path: "/",
1198
+ headers: {
1199
+ "Content-Type": "application/x-www-form-urlencoded"
1200
+ },
1201
+ body: this.buildFormBody(formParams)
1202
+ });
1183
1203
  }
1184
- async getAccountPasswordPolicy() {
1185
- const response = await this.request("GetAccountPasswordPolicy");
1204
+ async sendRawEmail(params) {
1205
+ const rawMessageBase64 = Buffer.from(params.rawMessage).toString("base64");
1206
+ const formParams = {
1207
+ Action: "SendRawEmail",
1208
+ Version: "2010-12-01",
1209
+ Source: params.source,
1210
+ "RawMessage.Data": rawMessageBase64
1211
+ };
1212
+ params.destinations.forEach((dest, index) => {
1213
+ formParams[`Destinations.member.${index + 1}`] = dest;
1214
+ });
1215
+ const result = await this.client.request({
1216
+ service: "ses",
1217
+ region: this.region,
1218
+ method: "POST",
1219
+ path: "/",
1220
+ headers: {
1221
+ "Content-Type": "application/x-www-form-urlencoded"
1222
+ },
1223
+ body: this.buildFormBody(formParams)
1224
+ });
1225
+ const response = result?.SendRawEmailResponse?.SendRawEmailResult || result?.SendRawEmailResult;
1186
1226
  return {
1187
- MinimumPasswordLength: parseXmlValue(response, "MinimumPasswordLength") ? Number.parseInt(parseXmlValue(response, "MinimumPasswordLength"), 10) : undefined,
1188
- RequireSymbols: parseXmlValue(response, "RequireSymbols") === "true",
1189
- RequireNumbers: parseXmlValue(response, "RequireNumbers") === "true",
1190
- RequireUppercaseCharacters: parseXmlValue(response, "RequireUppercaseCharacters") === "true",
1191
- RequireLowercaseCharacters: parseXmlValue(response, "RequireLowercaseCharacters") === "true",
1192
- AllowUsersToChangePassword: parseXmlValue(response, "AllowUsersToChangePassword") === "true",
1193
- ExpirePasswords: parseXmlValue(response, "ExpirePasswords") === "true",
1194
- MaxPasswordAge: parseXmlValue(response, "MaxPasswordAge") ? Number.parseInt(parseXmlValue(response, "MaxPasswordAge"), 10) : undefined,
1195
- PasswordReusePrevention: parseXmlValue(response, "PasswordReusePrevention") ? Number.parseInt(parseXmlValue(response, "PasswordReusePrevention"), 10) : undefined,
1196
- HardExpiry: parseXmlValue(response, "HardExpiry") === "true"
1227
+ MessageId: response?.MessageId
1197
1228
  };
1198
1229
  }
1199
- async updateAccountPasswordPolicy(params) {
1200
- await this.request("UpdateAccountPasswordPolicy", params);
1201
- }
1202
- async deleteAccountPasswordPolicy() {
1203
- await this.request("DeleteAccountPasswordPolicy");
1204
- }
1205
- async getAccountSummary() {
1206
- const response = await this.request("GetAccountSummary");
1207
- const summary = {};
1208
- const entries = parseXmlArray(response, "SummaryMap", "entry");
1209
- for (const entry of entries) {
1210
- const key = parseXmlValue(entry, "key");
1211
- const value = parseXmlValue(entry, "value");
1212
- if (key && value) {
1213
- summary[key] = Number.parseInt(value, 10);
1230
+ async getSuppressedDestination(emailAddress) {
1231
+ try {
1232
+ const result = await this.client.request({
1233
+ service: "ses",
1234
+ region: this.region,
1235
+ method: "GET",
1236
+ path: `/v2/email/suppression/addresses/${encodeURIComponent(emailAddress)}`
1237
+ });
1238
+ return result?.SuppressedDestination || null;
1239
+ } catch (error) {
1240
+ if (error.message?.includes("404") || error.message?.includes("NotFoundException")) {
1241
+ return null;
1214
1242
  }
1243
+ throw error;
1215
1244
  }
1216
- return summary;
1217
- }
1218
- async listAccountAliases() {
1219
- const response = await this.request("ListAccountAliases");
1220
- const aliases = parseXmlArray(response, "AccountAliases", "member");
1221
- const isTruncated = parseXmlValue(response, "IsTruncated") === "true";
1222
- const marker = parseXmlValue(response, "Marker");
1223
- return { AccountAliases: aliases, IsTruncated: isTruncated, Marker: marker };
1224
- }
1225
- async createAccountAlias(params) {
1226
- await this.request("CreateAccountAlias", params);
1227
- }
1228
- async deleteAccountAlias(params) {
1229
- await this.request("DeleteAccountAlias", params);
1230
- }
1231
- async simulatePrincipalPolicy(params) {
1232
- const response = await this.request("SimulatePrincipalPolicy", params);
1233
- return this.parseSimulationResults(response);
1234
1245
  }
1235
- parseSimulationResults(xml) {
1236
- const resultXmls = parseXmlArray(xml, "EvaluationResults", "member");
1237
- const evaluationResults = resultXmls.map((resultXml) => {
1238
- const matchedStatementXmls = parseXmlArray(resultXml, "MatchedStatements", "member");
1239
- const matchedStatements = matchedStatementXmls.map((stmtXml) => ({
1240
- SourcePolicyId: parseXmlValue(stmtXml, "SourcePolicyId"),
1241
- SourcePolicyType: parseXmlValue(stmtXml, "SourcePolicyType")
1242
- }));
1243
- return {
1244
- EvalActionName: parseXmlValue(resultXml, "EvalActionName") || "",
1245
- EvalResourceName: parseXmlValue(resultXml, "EvalResourceName"),
1246
- EvalDecision: parseXmlValue(resultXml, "EvalDecision") || "",
1247
- MatchedStatements: matchedStatements.length > 0 ? matchedStatements : undefined
1248
- };
1246
+ async deleteSuppressedDestination(emailAddress) {
1247
+ await this.client.request({
1248
+ service: "ses",
1249
+ region: this.region,
1250
+ method: "DELETE",
1251
+ path: `/v2/email/suppression/addresses/${encodeURIComponent(emailAddress)}`
1249
1252
  });
1250
- const isTruncated = parseXmlValue(xml, "IsTruncated") === "true";
1251
- const marker = parseXmlValue(xml, "Marker");
1252
- return { EvaluationResults: evaluationResults, IsTruncated: isTruncated, Marker: marker };
1253
1253
  }
1254
1254
  }
1255
1255
 
@@ -1521,7 +1521,7 @@ class EmailClient {
1521
1521
  }
1522
1522
  async createSmtpCredentials(options) {
1523
1523
  const iamUsername = `ses-smtp-${options.username.replace(/[^a-zA-Z0-9]/g, "-")}`;
1524
- const { AWSClient: AWSClient2 } = await import("./chunk-mj1tmhte.js");
1524
+ const { AWSClient: AWSClient2 } = await import("./chunk-x9s0cqfx.js");
1525
1525
  const client = new AWSClient2;
1526
1526
  const buildBody = (action, params) => {
1527
1527
  const allParams = { Action: action, Version: "2010-05-08", ...params };
@@ -1776,4 +1776,4 @@ class EmailClient {
1776
1776
  }
1777
1777
  var email = new EmailClient;
1778
1778
 
1779
- export { SESClient, IAMClient, EmailClient, email };
1779
+ export { IAMClient, SESClient, EmailClient, email };